Files
obsidian/.obsidian/plugins/notion-bases/main.js

100 lines
639 KiB
JavaScript

/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var ob=Object.create;var xa=Object.defineProperty;var rb=Object.getOwnPropertyDescriptor;var ib=Object.getOwnPropertyNames;var lb=Object.getPrototypeOf,ab=Object.prototype.hasOwnProperty;var Ao=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),sb=(e,t)=>{for(var n in t)xa(e,n,{get:t[n],enumerable:!0})},fm=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ib(t))!ab.call(e,r)&&r!==n&&xa(e,r,{get:()=>t[r],enumerable:!(o=rb(t,r))||o.enumerable});return e};var ze=(e,t,n)=>(n=e!=null?ob(lb(e)):{},fm(t||!e||!e.__esModule?xa(n,"default",{value:e,enumerable:!0}):n,e)),ub=e=>fm(xa({},"__esModule",{value:!0}),e);var Mm=Ao(lt=>{"use strict";var il=Symbol.for("react.element"),vb=Symbol.for("react.portal"),bb=Symbol.for("react.fragment"),yb=Symbol.for("react.strict_mode"),wb=Symbol.for("react.profiler"),Cb=Symbol.for("react.provider"),kb=Symbol.for("react.context"),Sb=Symbol.for("react.forward_ref"),Nb=Symbol.for("react.suspense"),xb=Symbol.for("react.memo"),Rb=Symbol.for("react.lazy"),ym=Symbol.iterator;function Eb(e){return e===null||typeof e!="object"?null:(e=ym&&e[ym]||e["@@iterator"],typeof e=="function"?e:null)}var km={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Sm=Object.assign,Nm={};function ci(e,t,n){this.props=e,this.context=t,this.refs=Nm,this.updater=n||km}ci.prototype.isReactComponent={};ci.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ci.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function xm(){}xm.prototype=ci.prototype;function Xu(e,t,n){this.props=e,this.context=t,this.refs=Nm,this.updater=n||km}var Qu=Xu.prototype=new xm;Qu.constructor=Xu;Sm(Qu,ci.prototype);Qu.isPureReactComponent=!0;var wm=Array.isArray,Rm=Object.prototype.hasOwnProperty,Zu={current:null},Em={key:!0,ref:!0,__self:!0,__source:!0};function Fm(e,t,n){var o,r={},i=null,l=null;if(t!=null)for(o in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)Rm.call(t,o)&&!Em.hasOwnProperty(o)&&(r[o]=t[o]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var s=Array(a),c=0;c<a;c++)s[c]=arguments[c+2];r.children=s}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return{$$typeof:il,type:e,key:i,ref:l,props:r,_owner:Zu.current}}function Fb(e,t){return{$$typeof:il,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ju(e){return typeof e=="object"&&e!==null&&e.$$typeof===il}function Db(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Cm=/\/+/g;function Yu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Db(""+e.key):t.toString(36)}function Ea(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(i){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case il:case vb:l=!0}}if(l)return l=e,r=r(l),e=o===""?"."+Yu(l,0):o,wm(r)?(n="",e!=null&&(n=e.replace(Cm,"$&/")+"/"),Ea(r,t,n,"",function(c){return c})):r!=null&&(Ju(r)&&(r=Fb(r,n+(!r.key||l&&l.key===r.key?"":(""+r.key).replace(Cm,"$&/")+"/")+e)),t.push(r)),1;if(l=0,o=o===""?".":o+":",wm(e))for(var a=0;a<e.length;a++){i=e[a];var s=o+Yu(i,a);l+=Ea(i,t,n,s,r)}else if(s=Eb(e),typeof s=="function")for(e=s.call(e),a=0;!(i=e.next()).done;)i=i.value,s=o+Yu(i,a++),l+=Ea(i,t,n,s,r);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function Ra(e,t,n){if(e==null)return e;var o=[],r=0;return Ea(e,o,"","",function(i){return t.call(n,i,r++)}),o}function Mb(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var hn={current:null},Fa={transition:null},Tb={ReactCurrentDispatcher:hn,ReactCurrentBatchConfig:Fa,ReactCurrentOwner:Zu};function Dm(){throw Error("act(...) is not supported in production builds of React.")}lt.Children={map:Ra,forEach:function(e,t,n){Ra(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ra(e,function(){t++}),t},toArray:function(e){return Ra(e,function(t){return t})||[]},only:function(e){if(!Ju(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};lt.Component=ci;lt.Fragment=bb;lt.Profiler=wb;lt.PureComponent=Xu;lt.StrictMode=yb;lt.Suspense=Nb;lt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Tb;lt.act=Dm;lt.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=Sm({},e.props),r=e.key,i=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,l=Zu.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(s in t)Rm.call(t,s)&&!Em.hasOwnProperty(s)&&(o[s]=t[s]===void 0&&a!==void 0?a[s]:t[s])}var s=arguments.length-2;if(s===1)o.children=n;else if(1<s){a=Array(s);for(var c=0;c<s;c++)a[c]=arguments[c+2];o.children=a}return{$$typeof:il,type:e.type,key:r,ref:i,props:o,_owner:l}};lt.createContext=function(e){return e={$$typeof:kb,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Cb,_context:e},e.Consumer=e};lt.createElement=Fm;lt.createFactory=function(e){var t=Fm.bind(null,e);return t.type=e,t};lt.createRef=function(){return{current:null}};lt.forwardRef=function(e){return{$$typeof:Sb,render:e}};lt.isValidElement=Ju;lt.lazy=function(e){return{$$typeof:Rb,_payload:{_status:-1,_result:e},_init:Mb}};lt.memo=function(e,t){return{$$typeof:xb,type:e,compare:t===void 0?null:t}};lt.startTransition=function(e){var t=Fa.transition;Fa.transition={};try{e()}finally{Fa.transition=t}};lt.unstable_act=Dm;lt.useCallback=function(e,t){return hn.current.useCallback(e,t)};lt.useContext=function(e){return hn.current.useContext(e)};lt.useDebugValue=function(){};lt.useDeferredValue=function(e){return hn.current.useDeferredValue(e)};lt.useEffect=function(e,t){return hn.current.useEffect(e,t)};lt.useId=function(){return hn.current.useId()};lt.useImperativeHandle=function(e,t,n){return hn.current.useImperativeHandle(e,t,n)};lt.useInsertionEffect=function(e,t){return hn.current.useInsertionEffect(e,t)};lt.useLayoutEffect=function(e,t){return hn.current.useLayoutEffect(e,t)};lt.useMemo=function(e,t){return hn.current.useMemo(e,t)};lt.useReducer=function(e,t,n){return hn.current.useReducer(e,t,n)};lt.useRef=function(e){return hn.current.useRef(e)};lt.useState=function(e){return hn.current.useState(e)};lt.useSyncExternalStore=function(e,t,n){return hn.current.useSyncExternalStore(e,t,n)};lt.useTransition=function(){return hn.current.useTransition()};lt.version="18.3.1"});var yt=Ao((qS,Tm)=>{"use strict";Tm.exports=Mm()});var jm=Ao(wt=>{"use strict";function oc(e,t){var n=e.length;e.push(t);e:for(;0<n;){var o=n-1>>>1,r=e[o];if(0<Da(r,t))e[o]=t,e[n]=r,n=o;else break e}}function uo(e){return e.length===0?null:e[0]}function Ta(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var o=0,r=e.length,i=r>>>1;o<i;){var l=2*(o+1)-1,a=e[l],s=l+1,c=e[s];if(0>Da(a,n))s<r&&0>Da(c,a)?(e[o]=c,e[s]=n,o=s):(e[o]=a,e[l]=n,o=l);else if(s<r&&0>Da(c,n))e[o]=c,e[s]=n,o=s;else break e}}return t}function Da(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(Lm=performance,wt.unstable_now=function(){return Lm.now()}):(ec=Date,Pm=ec.now(),wt.unstable_now=function(){return ec.now()-Pm});var Lm,ec,Pm,So=[],Yo=[],Lb=1,Xn=null,an=3,La=!1,Tr=!1,al=!1,Om=typeof setTimeout=="function"?setTimeout:null,$m=typeof clearTimeout=="function"?clearTimeout:null,Im=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function rc(e){for(var t=uo(Yo);t!==null;){if(t.callback===null)Ta(Yo);else if(t.startTime<=e)Ta(Yo),t.sortIndex=t.expirationTime,oc(So,t);else break;t=uo(Yo)}}function ic(e){if(al=!1,rc(e),!Tr)if(uo(So)!==null)Tr=!0,ac(lc);else{var t=uo(Yo);t!==null&&sc(ic,t.startTime-e)}}function lc(e,t){Tr=!1,al&&(al=!1,$m(sl),sl=-1),La=!0;var n=an;try{for(rc(t),Xn=uo(So);Xn!==null&&(!(Xn.expirationTime>t)||e&&!Bm());){var o=Xn.callback;if(typeof o=="function"){Xn.callback=null,an=Xn.priorityLevel;var r=o(Xn.expirationTime<=t);t=wt.unstable_now(),typeof r=="function"?Xn.callback=r:Xn===uo(So)&&Ta(So),rc(t)}else Ta(So);Xn=uo(So)}if(Xn!==null)var i=!0;else{var l=uo(Yo);l!==null&&sc(ic,l.startTime-t),i=!1}return i}finally{Xn=null,an=n,La=!1}}var Pa=!1,Ma=null,sl=-1,zm=5,Vm=-1;function Bm(){return!(wt.unstable_now()-Vm<zm)}function tc(){if(Ma!==null){var e=wt.unstable_now();Vm=e;var t=!0;try{t=Ma(!0,e)}finally{t?ll():(Pa=!1,Ma=null)}}else Pa=!1}var ll;typeof Im=="function"?ll=function(){Im(tc)}:typeof MessageChannel<"u"?(nc=new MessageChannel,Am=nc.port2,nc.port1.onmessage=tc,ll=function(){Am.postMessage(null)}):ll=function(){Om(tc,0)};var nc,Am;function ac(e){Ma=e,Pa||(Pa=!0,ll())}function sc(e,t){sl=Om(function(){e(wt.unstable_now())},t)}wt.unstable_IdlePriority=5;wt.unstable_ImmediatePriority=1;wt.unstable_LowPriority=4;wt.unstable_NormalPriority=3;wt.unstable_Profiling=null;wt.unstable_UserBlockingPriority=2;wt.unstable_cancelCallback=function(e){e.callback=null};wt.unstable_continueExecution=function(){Tr||La||(Tr=!0,ac(lc))};wt.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):zm=0<e?Math.floor(1e3/e):5};wt.unstable_getCurrentPriorityLevel=function(){return an};wt.unstable_getFirstCallbackNode=function(){return uo(So)};wt.unstable_next=function(e){switch(an){case 1:case 2:case 3:var t=3;break;default:t=an}var n=an;an=t;try{return e()}finally{an=n}};wt.unstable_pauseExecution=function(){};wt.unstable_requestPaint=function(){};wt.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=an;an=e;try{return t()}finally{an=n}};wt.unstable_scheduleCallback=function(e,t,n){var o=wt.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?o+n:o):n=o,e){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=n+r,e={id:Lb++,callback:t,priorityLevel:e,startTime:n,expirationTime:r,sortIndex:-1},n>o?(e.sortIndex=n,oc(Yo,e),uo(So)===null&&e===uo(Yo)&&(al?($m(sl),sl=-1):al=!0,sc(ic,n-o))):(e.sortIndex=r,oc(So,e),Tr||La||(Tr=!0,ac(lc))),e};wt.unstable_shouldYield=Bm;wt.unstable_wrapCallback=function(e){var t=an;return function(){var n=an;an=t;try{return e.apply(this,arguments)}finally{an=n}}}});var Um=Ao((YS,Hm)=>{"use strict";Hm.exports=jm()});var Yh=Ao(Un=>{"use strict";var Pb=yt(),jn=Um();function fe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Zf=new Set,Dl={};function Wr(e,t){Mi(e,t),Mi(e+"Capture",t)}function Mi(e,t){for(Dl[e]=t,e=0;e<t.length;e++)Zf.add(t[e])}var jo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mc=Object.prototype.hasOwnProperty,Ib=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Wm={},Gm={};function Ab(e){return Mc.call(Gm,e)?!0:Mc.call(Wm,e)?!1:Ib.test(e)?Gm[e]=!0:(Wm[e]=!0,!1)}function Ob(e,t,n,o){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return o?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function $b(e,t,n,o){if(t===null||typeof t>"u"||Ob(e,t,n,o))return!0;if(o)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function bn(e,t,n,o,r,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=o,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var rn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){rn[e]=new bn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];rn[t]=new bn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){rn[e]=new bn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){rn[e]=new bn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){rn[e]=new bn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){rn[e]=new bn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){rn[e]=new bn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){rn[e]=new bn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){rn[e]=new bn(e,5,!1,e.toLowerCase(),null,!1,!1)});var kd=/[\-:]([a-z])/g;function Sd(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(kd,Sd);rn[t]=new bn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(kd,Sd);rn[t]=new bn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(kd,Sd);rn[t]=new bn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){rn[e]=new bn(e,1,!1,e.toLowerCase(),null,!1,!1)});rn.xlinkHref=new bn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){rn[e]=new bn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Nd(e,t,n,o){var r=rn.hasOwnProperty(t)?rn[t]:null;(r!==null?r.type!==0:o||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&($b(t,n,r,o)&&(n=null),o||r===null?Ab(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):r.mustUseProperty?e[r.propertyName]=n===null?r.type===3?!1:"":n:(t=r.attributeName,o=r.attributeNamespace,n===null?e.removeAttribute(t):(r=r.type,n=r===3||r===4&&n===!0?"":""+n,o?e.setAttributeNS(o,t,n):e.setAttribute(t,n))))}var Go=Pb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ia=Symbol.for("react.element"),mi=Symbol.for("react.portal"),fi=Symbol.for("react.fragment"),xd=Symbol.for("react.strict_mode"),Tc=Symbol.for("react.profiler"),Jf=Symbol.for("react.provider"),eg=Symbol.for("react.context"),Rd=Symbol.for("react.forward_ref"),Lc=Symbol.for("react.suspense"),Pc=Symbol.for("react.suspense_list"),Ed=Symbol.for("react.memo"),Qo=Symbol.for("react.lazy"),tg=Symbol.for("react.offscreen"),qm=Symbol.iterator;function ul(e){return e===null||typeof e!="object"?null:(e=qm&&e[qm]||e["@@iterator"],typeof e=="function"?e:null)}var Pt=Object.assign,uc;function _l(e){if(uc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);uc=t&&t[1]||""}return`
`+uc+e}var cc=!1;function dc(e,t){if(!e||cc)return"";cc=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var o=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){o=c}e.call(t.prototype)}else{try{throw Error()}catch(c){o=c}e()}}catch(c){if(c&&o&&typeof c.stack=="string"){for(var r=c.stack.split(`
`),i=o.stack.split(`
`),l=r.length-1,a=i.length-1;1<=l&&0<=a&&r[l]!==i[a];)a--;for(;1<=l&&0<=a;l--,a--)if(r[l]!==i[a]){if(l!==1||a!==1)do if(l--,a--,0>a||r[l]!==i[a]){var s=`
`+r[l].replace(" at new "," at ");return e.displayName&&s.includes("<anonymous>")&&(s=s.replace("<anonymous>",e.displayName)),s}while(1<=l&&0<=a);break}}}finally{cc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?_l(e):""}function zb(e){switch(e.tag){case 5:return _l(e.type);case 16:return _l("Lazy");case 13:return _l("Suspense");case 19:return _l("SuspenseList");case 0:case 2:case 15:return e=dc(e.type,!1),e;case 11:return e=dc(e.type.render,!1),e;case 1:return e=dc(e.type,!0),e;default:return""}}function Ic(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case fi:return"Fragment";case mi:return"Portal";case Tc:return"Profiler";case xd:return"StrictMode";case Lc:return"Suspense";case Pc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case eg:return(e.displayName||"Context")+".Consumer";case Jf:return(e._context.displayName||"Context")+".Provider";case Rd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ed:return t=e.displayName||null,t!==null?t:Ic(e.type)||"Memo";case Qo:t=e._payload,e=e._init;try{return Ic(e(t))}catch{}}return null}function Vb(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ic(t);case 8:return t===xd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function dr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ng(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Bb(e){var t=ng(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),o=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(l){o=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return o},setValue:function(l){o=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Aa(e){e._valueTracker||(e._valueTracker=Bb(e))}function og(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),o="";return e&&(o=ng(e)?e.checked?"true":"false":e.value),e=o,e!==n?(t.setValue(e),!0):!1}function cs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ac(e,t){var n=t.checked;return Pt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Km(e,t){var n=t.defaultValue==null?"":t.defaultValue,o=t.checked!=null?t.checked:t.defaultChecked;n=dr(t.value!=null?t.value:n),e._wrapperState={initialChecked:o,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function rg(e,t){t=t.checked,t!=null&&Nd(e,"checked",t,!1)}function Oc(e,t){rg(e,t);var n=dr(t.value),o=t.type;if(n!=null)o==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(o==="submit"||o==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?$c(e,t.type,n):t.hasOwnProperty("defaultValue")&&$c(e,t.type,dr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ym(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var o=t.type;if(!(o!=="submit"&&o!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function $c(e,t,n){(t!=="number"||cs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var vl=Array.isArray;function Ni(e,t,n,o){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&o&&(e[n].defaultSelected=!0)}else{for(n=""+dr(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,o&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function zc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(fe(91));return Pt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Xm(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(fe(92));if(vl(n)){if(1<n.length)throw Error(fe(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:dr(n)}}function ig(e,t){var n=dr(t.value),o=dr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),o!=null&&(e.defaultValue=""+o)}function Qm(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function lg(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Vc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?lg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Oa,ag=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,o,r){MSApp.execUnsafeLocalFunction(function(){return e(t,n,o,r)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Oa=Oa||document.createElement("div"),Oa.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Oa.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ml(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var wl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},jb=["Webkit","ms","Moz","O"];Object.keys(wl).forEach(function(e){jb.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),wl[t]=wl[e]})});function sg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||wl.hasOwnProperty(e)&&wl[e]?(""+t).trim():t+"px"}function ug(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var o=n.indexOf("--")===0,r=sg(n,t[n],o);n==="float"&&(n="cssFloat"),o?e.setProperty(n,r):e[n]=r}}var Hb=Pt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Bc(e,t){if(t){if(Hb[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(fe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(fe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(fe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(fe(62))}}function jc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Hc=null;function Fd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Uc=null,xi=null,Ri=null;function Zm(e){if(e=Yl(e)){if(typeof Uc!="function")throw Error(fe(280));var t=e.stateNode;t&&(t=$s(t),Uc(e.stateNode,e.type,t))}}function cg(e){xi?Ri?Ri.push(e):Ri=[e]:xi=e}function dg(){if(xi){var e=xi,t=Ri;if(Ri=xi=null,Zm(e),t)for(e=0;e<t.length;e++)Zm(t[e])}}function pg(e,t){return e(t)}function mg(){}var pc=!1;function fg(e,t,n){if(pc)return e(t,n);pc=!0;try{return pg(e,t,n)}finally{pc=!1,(xi!==null||Ri!==null)&&(mg(),dg())}}function Tl(e,t){var n=e.stateNode;if(n===null)return null;var o=$s(n);if(o===null)return null;n=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(fe(231,t,typeof n));return n}var Wc=!1;if(jo)try{di={},Object.defineProperty(di,"passive",{get:function(){Wc=!0}}),window.addEventListener("test",di,di),window.removeEventListener("test",di,di)}catch{Wc=!1}var di;function Ub(e,t,n,o,r,i,l,a,s){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(p){this.onError(p)}}var Cl=!1,ds=null,ps=!1,Gc=null,Wb={onError:function(e){Cl=!0,ds=e}};function Gb(e,t,n,o,r,i,l,a,s){Cl=!1,ds=null,Ub.apply(Wb,arguments)}function qb(e,t,n,o,r,i,l,a,s){if(Gb.apply(this,arguments),Cl){if(Cl){var c=ds;Cl=!1,ds=null}else throw Error(fe(198));ps||(ps=!0,Gc=c)}}function Gr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function gg(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Jm(e){if(Gr(e)!==e)throw Error(fe(188))}function Kb(e){var t=e.alternate;if(!t){if(t=Gr(e),t===null)throw Error(fe(188));return t!==e?null:e}for(var n=e,o=t;;){var r=n.return;if(r===null)break;var i=r.alternate;if(i===null){if(o=r.return,o!==null){n=o;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===n)return Jm(r),e;if(i===o)return Jm(r),t;i=i.sibling}throw Error(fe(188))}if(n.return!==o.return)n=r,o=i;else{for(var l=!1,a=r.child;a;){if(a===n){l=!0,n=r,o=i;break}if(a===o){l=!0,o=r,n=i;break}a=a.sibling}if(!l){for(a=i.child;a;){if(a===n){l=!0,n=i,o=r;break}if(a===o){l=!0,o=i,n=r;break}a=a.sibling}if(!l)throw Error(fe(189))}}if(n.alternate!==o)throw Error(fe(190))}if(n.tag!==3)throw Error(fe(188));return n.stateNode.current===n?e:t}function hg(e){return e=Kb(e),e!==null?_g(e):null}function _g(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=_g(e);if(t!==null)return t;e=e.sibling}return null}var vg=jn.unstable_scheduleCallback,ef=jn.unstable_cancelCallback,Yb=jn.unstable_shouldYield,Xb=jn.unstable_requestPaint,Bt=jn.unstable_now,Qb=jn.unstable_getCurrentPriorityLevel,Dd=jn.unstable_ImmediatePriority,bg=jn.unstable_UserBlockingPriority,ms=jn.unstable_NormalPriority,Zb=jn.unstable_LowPriority,yg=jn.unstable_IdlePriority,Ps=null,Eo=null;function Jb(e){if(Eo&&typeof Eo.onCommitFiberRoot=="function")try{Eo.onCommitFiberRoot(Ps,e,void 0,(e.current.flags&128)===128)}catch{}}var go=Math.clz32?Math.clz32:ny,ey=Math.log,ty=Math.LN2;function ny(e){return e>>>=0,e===0?32:31-(ey(e)/ty|0)|0}var $a=64,za=4194304;function bl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function fs(e,t){var n=e.pendingLanes;if(n===0)return 0;var o=0,r=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var a=l&~r;a!==0?o=bl(a):(i&=l,i!==0&&(o=bl(i)))}else l=n&~r,l!==0?o=bl(l):i!==0&&(o=bl(i));if(o===0)return 0;if(t!==0&&t!==o&&(t&r)===0&&(r=o&-o,i=t&-t,r>=i||r===16&&(i&4194240)!==0))return t;if((o&4)!==0&&(o|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=o;0<t;)n=31-go(t),r=1<<n,o|=e[n],t&=~r;return o}function oy(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ry(e,t){for(var n=e.suspendedLanes,o=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes;0<i;){var l=31-go(i),a=1<<l,s=r[l];s===-1?((a&n)===0||(a&o)!==0)&&(r[l]=oy(a,t)):s<=t&&(e.expiredLanes|=a),i&=~a}}function qc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function wg(){var e=$a;return $a<<=1,($a&4194240)===0&&($a=64),e}function mc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ql(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-go(t),e[t]=n}function iy(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var o=e.eventTimes;for(e=e.expirationTimes;0<n;){var r=31-go(n),i=1<<r;t[r]=0,o[r]=-1,e[r]=-1,n&=~i}}function Md(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var o=31-go(n),r=1<<o;r&t|e[o]&t&&(e[o]|=t),n&=~r}}var ht=0;function Cg(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var kg,Td,Sg,Ng,xg,Kc=!1,Va=[],or=null,rr=null,ir=null,Ll=new Map,Pl=new Map,Jo=[],ly="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function tf(e,t){switch(e){case"focusin":case"focusout":or=null;break;case"dragenter":case"dragleave":rr=null;break;case"mouseover":case"mouseout":ir=null;break;case"pointerover":case"pointerout":Ll.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pl.delete(t.pointerId)}}function cl(e,t,n,o,r,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:o,nativeEvent:i,targetContainers:[r]},t!==null&&(t=Yl(t),t!==null&&Td(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function ay(e,t,n,o,r){switch(t){case"focusin":return or=cl(or,e,t,n,o,r),!0;case"dragenter":return rr=cl(rr,e,t,n,o,r),!0;case"mouseover":return ir=cl(ir,e,t,n,o,r),!0;case"pointerover":var i=r.pointerId;return Ll.set(i,cl(Ll.get(i)||null,e,t,n,o,r)),!0;case"gotpointercapture":return i=r.pointerId,Pl.set(i,cl(Pl.get(i)||null,e,t,n,o,r)),!0}return!1}function Rg(e){var t=Ir(e.target);if(t!==null){var n=Gr(t);if(n!==null){if(t=n.tag,t===13){if(t=gg(n),t!==null){e.blockedOn=t,xg(e.priority,function(){Sg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function es(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Yc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var o=new n.constructor(n.type,n);Hc=o,n.target.dispatchEvent(o),Hc=null}else return t=Yl(n),t!==null&&Td(t),e.blockedOn=n,!1;t.shift()}return!0}function nf(e,t,n){es(e)&&n.delete(t)}function sy(){Kc=!1,or!==null&&es(or)&&(or=null),rr!==null&&es(rr)&&(rr=null),ir!==null&&es(ir)&&(ir=null),Ll.forEach(nf),Pl.forEach(nf)}function dl(e,t){e.blockedOn===t&&(e.blockedOn=null,Kc||(Kc=!0,jn.unstable_scheduleCallback(jn.unstable_NormalPriority,sy)))}function Il(e){function t(r){return dl(r,e)}if(0<Va.length){dl(Va[0],e);for(var n=1;n<Va.length;n++){var o=Va[n];o.blockedOn===e&&(o.blockedOn=null)}}for(or!==null&&dl(or,e),rr!==null&&dl(rr,e),ir!==null&&dl(ir,e),Ll.forEach(t),Pl.forEach(t),n=0;n<Jo.length;n++)o=Jo[n],o.blockedOn===e&&(o.blockedOn=null);for(;0<Jo.length&&(n=Jo[0],n.blockedOn===null);)Rg(n),n.blockedOn===null&&Jo.shift()}var Ei=Go.ReactCurrentBatchConfig,gs=!0;function uy(e,t,n,o){var r=ht,i=Ei.transition;Ei.transition=null;try{ht=1,Ld(e,t,n,o)}finally{ht=r,Ei.transition=i}}function cy(e,t,n,o){var r=ht,i=Ei.transition;Ei.transition=null;try{ht=4,Ld(e,t,n,o)}finally{ht=r,Ei.transition=i}}function Ld(e,t,n,o){if(gs){var r=Yc(e,t,n,o);if(r===null)yc(e,t,o,hs,n),tf(e,o);else if(ay(r,e,t,n,o))o.stopPropagation();else if(tf(e,o),t&4&&-1<ly.indexOf(e)){for(;r!==null;){var i=Yl(r);if(i!==null&&kg(i),i=Yc(e,t,n,o),i===null&&yc(e,t,o,hs,n),i===r)break;r=i}r!==null&&o.stopPropagation()}else yc(e,t,o,null,n)}}var hs=null;function Yc(e,t,n,o){if(hs=null,e=Fd(o),e=Ir(e),e!==null)if(t=Gr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=gg(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return hs=e,null}function Eg(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Qb()){case Dd:return 1;case bg:return 4;case ms:case Zb:return 16;case yg:return 536870912;default:return 16}default:return 16}}var tr=null,Pd=null,ts=null;function Fg(){if(ts)return ts;var e,t=Pd,n=t.length,o,r="value"in tr?tr.value:tr.textContent,i=r.length;for(e=0;e<n&&t[e]===r[e];e++);var l=n-e;for(o=1;o<=l&&t[n-o]===r[i-o];o++);return ts=r.slice(e,1<o?1-o:void 0)}function ns(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ba(){return!0}function of(){return!1}function Hn(e){function t(n,o,r,i,l){this._reactName=n,this._targetInst=r,this.type=o,this.nativeEvent=i,this.target=l,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ba:of,this.isPropagationStopped=of,this}return Pt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ba)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ba)},persist:function(){},isPersistent:Ba}),t}var $i={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Id=Hn($i),Kl=Pt({},$i,{view:0,detail:0}),dy=Hn(Kl),fc,gc,pl,Is=Pt({},Kl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ad,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==pl&&(pl&&e.type==="mousemove"?(fc=e.screenX-pl.screenX,gc=e.screenY-pl.screenY):gc=fc=0,pl=e),fc)},movementY:function(e){return"movementY"in e?e.movementY:gc}}),rf=Hn(Is),py=Pt({},Is,{dataTransfer:0}),my=Hn(py),fy=Pt({},Kl,{relatedTarget:0}),hc=Hn(fy),gy=Pt({},$i,{animationName:0,elapsedTime:0,pseudoElement:0}),hy=Hn(gy),_y=Pt({},$i,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vy=Hn(_y),by=Pt({},$i,{data:0}),lf=Hn(by),yy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wy={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Cy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ky(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Cy[e])?!!t[e]:!1}function Ad(){return ky}var Sy=Pt({},Kl,{key:function(e){if(e.key){var t=yy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ns(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?wy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ad,charCode:function(e){return e.type==="keypress"?ns(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ns(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ny=Hn(Sy),xy=Pt({},Is,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),af=Hn(xy),Ry=Pt({},Kl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ad}),Ey=Hn(Ry),Fy=Pt({},$i,{propertyName:0,elapsedTime:0,pseudoElement:0}),Dy=Hn(Fy),My=Pt({},Is,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Ty=Hn(My),Ly=[9,13,27,32],Od=jo&&"CompositionEvent"in window,kl=null;jo&&"documentMode"in document&&(kl=document.documentMode);var Py=jo&&"TextEvent"in window&&!kl,Dg=jo&&(!Od||kl&&8<kl&&11>=kl),sf=" ",uf=!1;function Mg(e,t){switch(e){case"keyup":return Ly.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var gi=!1;function Iy(e,t){switch(e){case"compositionend":return Tg(t);case"keypress":return t.which!==32?null:(uf=!0,sf);case"textInput":return e=t.data,e===sf&&uf?null:e;default:return null}}function Ay(e,t){if(gi)return e==="compositionend"||!Od&&Mg(e,t)?(e=Fg(),ts=Pd=tr=null,gi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Dg&&t.locale!=="ko"?null:t.data;default:return null}}var Oy={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function cf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Oy[e.type]:t==="textarea"}function Lg(e,t,n,o){cg(o),t=_s(t,"onChange"),0<t.length&&(n=new Id("onChange","change",null,n,o),e.push({event:n,listeners:t}))}var Sl=null,Al=null;function $y(e){Ug(e,0)}function As(e){var t=vi(e);if(og(t))return e}function zy(e,t){if(e==="change")return t}var Pg=!1;jo&&(jo?(Ha="oninput"in document,Ha||(_c=document.createElement("div"),_c.setAttribute("oninput","return;"),Ha=typeof _c.oninput=="function"),ja=Ha):ja=!1,Pg=ja&&(!document.documentMode||9<document.documentMode));var ja,Ha,_c;function df(){Sl&&(Sl.detachEvent("onpropertychange",Ig),Al=Sl=null)}function Ig(e){if(e.propertyName==="value"&&As(Al)){var t=[];Lg(t,Al,e,Fd(e)),fg($y,t)}}function Vy(e,t,n){e==="focusin"?(df(),Sl=t,Al=n,Sl.attachEvent("onpropertychange",Ig)):e==="focusout"&&df()}function By(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return As(Al)}function jy(e,t){if(e==="click")return As(t)}function Hy(e,t){if(e==="input"||e==="change")return As(t)}function Uy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _o=typeof Object.is=="function"?Object.is:Uy;function Ol(e,t){if(_o(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(o=0;o<n.length;o++){var r=n[o];if(!Mc.call(t,r)||!_o(e[r],t[r]))return!1}return!0}function pf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mf(e,t){var n=pf(e);e=0;for(var o;n;){if(n.nodeType===3){if(o=e+n.textContent.length,e<=t&&o>=t)return{node:n,offset:t-e};e=o}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=pf(n)}}function Ag(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ag(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Og(){for(var e=window,t=cs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=cs(e.document)}return t}function $d(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Wy(e){var t=Og(),n=e.focusedElem,o=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ag(n.ownerDocument.documentElement,n)){if(o!==null&&$d(n)){if(t=o.start,e=o.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var r=n.textContent.length,i=Math.min(o.start,r);o=o.end===void 0?i:Math.min(o.end,r),!e.extend&&i>o&&(r=o,o=i,i=r),r=mf(n,i);var l=mf(n,o);r&&l&&(e.rangeCount!==1||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(r.node,r.offset),e.removeAllRanges(),i>o?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Gy=jo&&"documentMode"in document&&11>=document.documentMode,hi=null,Xc=null,Nl=null,Qc=!1;function ff(e,t,n){var o=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qc||hi==null||hi!==cs(o)||(o=hi,"selectionStart"in o&&$d(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Nl&&Ol(Nl,o)||(Nl=o,o=_s(Xc,"onSelect"),0<o.length&&(t=new Id("onSelect","select",null,t,n),e.push({event:t,listeners:o}),t.target=hi)))}function Ua(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _i={animationend:Ua("Animation","AnimationEnd"),animationiteration:Ua("Animation","AnimationIteration"),animationstart:Ua("Animation","AnimationStart"),transitionend:Ua("Transition","TransitionEnd")},vc={},$g={};jo&&($g=document.createElement("div").style,"AnimationEvent"in window||(delete _i.animationend.animation,delete _i.animationiteration.animation,delete _i.animationstart.animation),"TransitionEvent"in window||delete _i.transitionend.transition);function Os(e){if(vc[e])return vc[e];if(!_i[e])return e;var t=_i[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in $g)return vc[e]=t[n];return e}var zg=Os("animationend"),Vg=Os("animationiteration"),Bg=Os("animationstart"),jg=Os("transitionend"),Hg=new Map,gf="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function mr(e,t){Hg.set(e,t),Wr(t,[e])}for(Wa=0;Wa<gf.length;Wa++)Ga=gf[Wa],hf=Ga.toLowerCase(),_f=Ga[0].toUpperCase()+Ga.slice(1),mr(hf,"on"+_f);var Ga,hf,_f,Wa;mr(zg,"onAnimationEnd");mr(Vg,"onAnimationIteration");mr(Bg,"onAnimationStart");mr("dblclick","onDoubleClick");mr("focusin","onFocus");mr("focusout","onBlur");mr(jg,"onTransitionEnd");Mi("onMouseEnter",["mouseout","mouseover"]);Mi("onMouseLeave",["mouseout","mouseover"]);Mi("onPointerEnter",["pointerout","pointerover"]);Mi("onPointerLeave",["pointerout","pointerover"]);Wr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Wr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Wr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Wr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Wr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Wr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),qy=new Set("cancel close invalid load scroll toggle".split(" ").concat(yl));function vf(e,t,n){var o=e.type||"unknown-event";e.currentTarget=n,qb(o,t,void 0,e),e.currentTarget=null}function Ug(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var o=e[n],r=o.event;o=o.listeners;e:{var i=void 0;if(t)for(var l=o.length-1;0<=l;l--){var a=o[l],s=a.instance,c=a.currentTarget;if(a=a.listener,s!==i&&r.isPropagationStopped())break e;vf(r,a,c),i=s}else for(l=0;l<o.length;l++){if(a=o[l],s=a.instance,c=a.currentTarget,a=a.listener,s!==i&&r.isPropagationStopped())break e;vf(r,a,c),i=s}}}if(ps)throw e=Gc,ps=!1,Gc=null,e}function Nt(e,t){var n=t[nd];n===void 0&&(n=t[nd]=new Set);var o=e+"__bubble";n.has(o)||(Wg(t,e,2,!1),n.add(o))}function bc(e,t,n){var o=0;t&&(o|=4),Wg(n,e,o,t)}var qa="_reactListening"+Math.random().toString(36).slice(2);function $l(e){if(!e[qa]){e[qa]=!0,Zf.forEach(function(n){n!=="selectionchange"&&(qy.has(n)||bc(n,!1,e),bc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qa]||(t[qa]=!0,bc("selectionchange",!1,t))}}function Wg(e,t,n,o){switch(Eg(t)){case 1:var r=uy;break;case 4:r=cy;break;default:r=Ld}n=r.bind(null,t,n,e),r=void 0,!Wc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),o?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function yc(e,t,n,o,r){var i=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var l=o.tag;if(l===3||l===4){var a=o.stateNode.containerInfo;if(a===r||a.nodeType===8&&a.parentNode===r)break;if(l===4)for(l=o.return;l!==null;){var s=l.tag;if((s===3||s===4)&&(s=l.stateNode.containerInfo,s===r||s.nodeType===8&&s.parentNode===r))return;l=l.return}for(;a!==null;){if(l=Ir(a),l===null)return;if(s=l.tag,s===5||s===6){o=i=l;continue e}a=a.parentNode}}o=o.return}fg(function(){var c=i,p=Fd(n),m=[];e:{var g=Hg.get(e);if(g!==void 0){var d=Id,v=e;switch(e){case"keypress":if(ns(n)===0)break e;case"keydown":case"keyup":d=Ny;break;case"focusin":v="focus",d=hc;break;case"focusout":v="blur",d=hc;break;case"beforeblur":case"afterblur":d=hc;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":d=rf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=my;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=Ey;break;case zg:case Vg:case Bg:d=hy;break;case jg:d=Dy;break;case"scroll":d=dy;break;case"wheel":d=Ty;break;case"copy":case"cut":case"paste":d=vy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=af}var h=(t&4)!==0,y=!h&&e==="scroll",_=h?g!==null?g+"Capture":null:g;h=[];for(var f=c,w;f!==null;){w=f;var R=w.stateNode;if(w.tag===5&&R!==null&&(w=R,_!==null&&(R=Tl(f,_),R!=null&&h.push(zl(f,R,w)))),y)break;f=f.return}0<h.length&&(g=new d(g,v,null,n,p),m.push({event:g,listeners:h}))}}if((t&7)===0){e:{if(g=e==="mouseover"||e==="pointerover",d=e==="mouseout"||e==="pointerout",g&&n!==Hc&&(v=n.relatedTarget||n.fromElement)&&(Ir(v)||v[Ho]))break e;if((d||g)&&(g=p.window===p?p:(g=p.ownerDocument)?g.defaultView||g.parentWindow:window,d?(v=n.relatedTarget||n.toElement,d=c,v=v?Ir(v):null,v!==null&&(y=Gr(v),v!==y||v.tag!==5&&v.tag!==6)&&(v=null)):(d=null,v=c),d!==v)){if(h=rf,R="onMouseLeave",_="onMouseEnter",f="mouse",(e==="pointerout"||e==="pointerover")&&(h=af,R="onPointerLeave",_="onPointerEnter",f="pointer"),y=d==null?g:vi(d),w=v==null?g:vi(v),g=new h(R,f+"leave",d,n,p),g.target=y,g.relatedTarget=w,R=null,Ir(p)===c&&(h=new h(_,f+"enter",v,n,p),h.target=w,h.relatedTarget=y,R=h),y=R,d&&v)t:{for(h=d,_=v,f=0,w=h;w;w=pi(w))f++;for(w=0,R=_;R;R=pi(R))w++;for(;0<f-w;)h=pi(h),f--;for(;0<w-f;)_=pi(_),w--;for(;f--;){if(h===_||_!==null&&h===_.alternate)break t;h=pi(h),_=pi(_)}h=null}else h=null;d!==null&&bf(m,g,d,h,!1),v!==null&&y!==null&&bf(m,y,v,h,!0)}}e:{if(g=c?vi(c):window,d=g.nodeName&&g.nodeName.toLowerCase(),d==="select"||d==="input"&&g.type==="file")var P=zy;else if(cf(g))if(Pg)P=Hy;else{P=By;var L=Vy}else(d=g.nodeName)&&d.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(P=jy);if(P&&(P=P(e,c))){Lg(m,P,n,p);break e}L&&L(e,g,c),e==="focusout"&&(L=g._wrapperState)&&L.controlled&&g.type==="number"&&$c(g,"number",g.value)}switch(L=c?vi(c):window,e){case"focusin":(cf(L)||L.contentEditable==="true")&&(hi=L,Xc=c,Nl=null);break;case"focusout":Nl=Xc=hi=null;break;case"mousedown":Qc=!0;break;case"contextmenu":case"mouseup":case"dragend":Qc=!1,ff(m,n,p);break;case"selectionchange":if(Gy)break;case"keydown":case"keyup":ff(m,n,p)}var V;if(Od)e:{switch(e){case"compositionstart":var W="onCompositionStart";break e;case"compositionend":W="onCompositionEnd";break e;case"compositionupdate":W="onCompositionUpdate";break e}W=void 0}else gi?Mg(e,n)&&(W="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(W="onCompositionStart");W&&(Dg&&n.locale!=="ko"&&(gi||W!=="onCompositionStart"?W==="onCompositionEnd"&&gi&&(V=Fg()):(tr=p,Pd="value"in tr?tr.value:tr.textContent,gi=!0)),L=_s(c,W),0<L.length&&(W=new lf(W,e,null,n,p),m.push({event:W,listeners:L}),V?W.data=V:(V=Tg(n),V!==null&&(W.data=V)))),(V=Py?Iy(e,n):Ay(e,n))&&(c=_s(c,"onBeforeInput"),0<c.length&&(p=new lf("onBeforeInput","beforeinput",null,n,p),m.push({event:p,listeners:c}),p.data=V))}Ug(m,t)})}function zl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function _s(e,t){for(var n=t+"Capture",o=[];e!==null;){var r=e,i=r.stateNode;r.tag===5&&i!==null&&(r=i,i=Tl(e,n),i!=null&&o.unshift(zl(e,i,r)),i=Tl(e,t),i!=null&&o.push(zl(e,i,r))),e=e.return}return o}function pi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function bf(e,t,n,o,r){for(var i=t._reactName,l=[];n!==null&&n!==o;){var a=n,s=a.alternate,c=a.stateNode;if(s!==null&&s===o)break;a.tag===5&&c!==null&&(a=c,r?(s=Tl(n,i),s!=null&&l.unshift(zl(n,s,a))):r||(s=Tl(n,i),s!=null&&l.push(zl(n,s,a)))),n=n.return}l.length!==0&&e.push({event:t,listeners:l})}var Ky=/\r\n?/g,Yy=/\u0000|\uFFFD/g;function yf(e){return(typeof e=="string"?e:""+e).replace(Ky,`
`).replace(Yy,"")}function Ka(e,t,n){if(t=yf(t),yf(e)!==t&&n)throw Error(fe(425))}function vs(){}var Zc=null,Jc=null;function ed(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var td=typeof setTimeout=="function"?setTimeout:void 0,Xy=typeof clearTimeout=="function"?clearTimeout:void 0,wf=typeof Promise=="function"?Promise:void 0,Qy=typeof queueMicrotask=="function"?queueMicrotask:typeof wf<"u"?function(e){return wf.resolve(null).then(e).catch(Zy)}:td;function Zy(e){setTimeout(function(){throw e})}function wc(e,t){var n=t,o=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(o===0){e.removeChild(r),Il(t);return}o--}else n!=="$"&&n!=="$?"&&n!=="$!"||o++;n=r}while(n);Il(t)}function lr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Cf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var zi=Math.random().toString(36).slice(2),Ro="__reactFiber$"+zi,Vl="__reactProps$"+zi,Ho="__reactContainer$"+zi,nd="__reactEvents$"+zi,Jy="__reactListeners$"+zi,ew="__reactHandles$"+zi;function Ir(e){var t=e[Ro];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ho]||n[Ro]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Cf(e);e!==null;){if(n=e[Ro])return n;e=Cf(e)}return t}e=n,n=e.parentNode}return null}function Yl(e){return e=e[Ro]||e[Ho],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function vi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(fe(33))}function $s(e){return e[Vl]||null}var od=[],bi=-1;function fr(e){return{current:e}}function xt(e){0>bi||(e.current=od[bi],od[bi]=null,bi--)}function Ct(e,t){bi++,od[bi]=e.current,e.current=t}var pr={},dn=fr(pr),Rn=fr(!1),Vr=pr;function Ti(e,t){var n=e.type.contextTypes;if(!n)return pr;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===t)return o.__reactInternalMemoizedMaskedChildContext;var r={},i;for(i in n)r[i]=t[i];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function En(e){return e=e.childContextTypes,e!=null}function bs(){xt(Rn),xt(dn)}function kf(e,t,n){if(dn.current!==pr)throw Error(fe(168));Ct(dn,t),Ct(Rn,n)}function Gg(e,t,n){var o=e.stateNode;if(t=t.childContextTypes,typeof o.getChildContext!="function")return n;o=o.getChildContext();for(var r in o)if(!(r in t))throw Error(fe(108,Vb(e)||"Unknown",r));return Pt({},n,o)}function ys(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||pr,Vr=dn.current,Ct(dn,e),Ct(Rn,Rn.current),!0}function Sf(e,t,n){var o=e.stateNode;if(!o)throw Error(fe(169));n?(e=Gg(e,t,Vr),o.__reactInternalMemoizedMergedChildContext=e,xt(Rn),xt(dn),Ct(dn,e)):xt(Rn),Ct(Rn,n)}var $o=null,zs=!1,Cc=!1;function qg(e){$o===null?$o=[e]:$o.push(e)}function tw(e){zs=!0,qg(e)}function gr(){if(!Cc&&$o!==null){Cc=!0;var e=0,t=ht;try{var n=$o;for(ht=1;e<n.length;e++){var o=n[e];do o=o(!0);while(o!==null)}$o=null,zs=!1}catch(r){throw $o!==null&&($o=$o.slice(e+1)),vg(Dd,gr),r}finally{ht=t,Cc=!1}}return null}var yi=[],wi=0,ws=null,Cs=0,Qn=[],Zn=0,Br=null,zo=1,Vo="";function Lr(e,t){yi[wi++]=Cs,yi[wi++]=ws,ws=e,Cs=t}function Kg(e,t,n){Qn[Zn++]=zo,Qn[Zn++]=Vo,Qn[Zn++]=Br,Br=e;var o=zo;e=Vo;var r=32-go(o)-1;o&=~(1<<r),n+=1;var i=32-go(t)+r;if(30<i){var l=r-r%5;i=(o&(1<<l)-1).toString(32),o>>=l,r-=l,zo=1<<32-go(t)+r|n<<r|o,Vo=i+e}else zo=1<<i|n<<r|o,Vo=e}function zd(e){e.return!==null&&(Lr(e,1),Kg(e,1,0))}function Vd(e){for(;e===ws;)ws=yi[--wi],yi[wi]=null,Cs=yi[--wi],yi[wi]=null;for(;e===Br;)Br=Qn[--Zn],Qn[Zn]=null,Vo=Qn[--Zn],Qn[Zn]=null,zo=Qn[--Zn],Qn[Zn]=null}var Bn=null,Vn=null,Ft=!1,fo=null;function Yg(e,t){var n=Jn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Nf(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Bn=e,Vn=lr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Bn=e,Vn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Br!==null?{id:zo,overflow:Vo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Jn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Bn=e,Vn=null,!0):!1;default:return!1}}function rd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function id(e){if(Ft){var t=Vn;if(t){var n=t;if(!Nf(e,t)){if(rd(e))throw Error(fe(418));t=lr(n.nextSibling);var o=Bn;t&&Nf(e,t)?Yg(o,n):(e.flags=e.flags&-4097|2,Ft=!1,Bn=e)}}else{if(rd(e))throw Error(fe(418));e.flags=e.flags&-4097|2,Ft=!1,Bn=e}}}function xf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Bn=e}function Ya(e){if(e!==Bn)return!1;if(!Ft)return xf(e),Ft=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ed(e.type,e.memoizedProps)),t&&(t=Vn)){if(rd(e))throw Xg(),Error(fe(418));for(;t;)Yg(e,t),t=lr(t.nextSibling)}if(xf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(fe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Vn=lr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Vn=null}}else Vn=Bn?lr(e.stateNode.nextSibling):null;return!0}function Xg(){for(var e=Vn;e;)e=lr(e.nextSibling)}function Li(){Vn=Bn=null,Ft=!1}function Bd(e){fo===null?fo=[e]:fo.push(e)}var nw=Go.ReactCurrentBatchConfig;function ml(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(fe(309));var o=n.stateNode}if(!o)throw Error(fe(147,e));var r=o,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(l){var a=r.refs;l===null?delete a[i]:a[i]=l},t._stringRef=i,t)}if(typeof e!="string")throw Error(fe(284));if(!n._owner)throw Error(fe(290,e))}return e}function Xa(e,t){throw e=Object.prototype.toString.call(t),Error(fe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Rf(e){var t=e._init;return t(e._payload)}function Qg(e){function t(_,f){if(e){var w=_.deletions;w===null?(_.deletions=[f],_.flags|=16):w.push(f)}}function n(_,f){if(!e)return null;for(;f!==null;)t(_,f),f=f.sibling;return null}function o(_,f){for(_=new Map;f!==null;)f.key!==null?_.set(f.key,f):_.set(f.index,f),f=f.sibling;return _}function r(_,f){return _=cr(_,f),_.index=0,_.sibling=null,_}function i(_,f,w){return _.index=w,e?(w=_.alternate,w!==null?(w=w.index,w<f?(_.flags|=2,f):w):(_.flags|=2,f)):(_.flags|=1048576,f)}function l(_){return e&&_.alternate===null&&(_.flags|=2),_}function a(_,f,w,R){return f===null||f.tag!==6?(f=Fc(w,_.mode,R),f.return=_,f):(f=r(f,w),f.return=_,f)}function s(_,f,w,R){var P=w.type;return P===fi?p(_,f,w.props.children,R,w.key):f!==null&&(f.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Qo&&Rf(P)===f.type)?(R=r(f,w.props),R.ref=ml(_,f,w),R.return=_,R):(R=us(w.type,w.key,w.props,null,_.mode,R),R.ref=ml(_,f,w),R.return=_,R)}function c(_,f,w,R){return f===null||f.tag!==4||f.stateNode.containerInfo!==w.containerInfo||f.stateNode.implementation!==w.implementation?(f=Dc(w,_.mode,R),f.return=_,f):(f=r(f,w.children||[]),f.return=_,f)}function p(_,f,w,R,P){return f===null||f.tag!==7?(f=zr(w,_.mode,R,P),f.return=_,f):(f=r(f,w),f.return=_,f)}function m(_,f,w){if(typeof f=="string"&&f!==""||typeof f=="number")return f=Fc(""+f,_.mode,w),f.return=_,f;if(typeof f=="object"&&f!==null){switch(f.$$typeof){case Ia:return w=us(f.type,f.key,f.props,null,_.mode,w),w.ref=ml(_,null,f),w.return=_,w;case mi:return f=Dc(f,_.mode,w),f.return=_,f;case Qo:var R=f._init;return m(_,R(f._payload),w)}if(vl(f)||ul(f))return f=zr(f,_.mode,w,null),f.return=_,f;Xa(_,f)}return null}function g(_,f,w,R){var P=f!==null?f.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return P!==null?null:a(_,f,""+w,R);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ia:return w.key===P?s(_,f,w,R):null;case mi:return w.key===P?c(_,f,w,R):null;case Qo:return P=w._init,g(_,f,P(w._payload),R)}if(vl(w)||ul(w))return P!==null?null:p(_,f,w,R,null);Xa(_,w)}return null}function d(_,f,w,R,P){if(typeof R=="string"&&R!==""||typeof R=="number")return _=_.get(w)||null,a(f,_,""+R,P);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case Ia:return _=_.get(R.key===null?w:R.key)||null,s(f,_,R,P);case mi:return _=_.get(R.key===null?w:R.key)||null,c(f,_,R,P);case Qo:var L=R._init;return d(_,f,w,L(R._payload),P)}if(vl(R)||ul(R))return _=_.get(w)||null,p(f,_,R,P,null);Xa(f,R)}return null}function v(_,f,w,R){for(var P=null,L=null,V=f,W=f=0,re=null;V!==null&&W<w.length;W++){V.index>W?(re=V,V=null):re=V.sibling;var J=g(_,V,w[W],R);if(J===null){V===null&&(V=re);break}e&&V&&J.alternate===null&&t(_,V),f=i(J,f,W),L===null?P=J:L.sibling=J,L=J,V=re}if(W===w.length)return n(_,V),Ft&&Lr(_,W),P;if(V===null){for(;W<w.length;W++)V=m(_,w[W],R),V!==null&&(f=i(V,f,W),L===null?P=V:L.sibling=V,L=V);return Ft&&Lr(_,W),P}for(V=o(_,V);W<w.length;W++)re=d(V,_,W,w[W],R),re!==null&&(e&&re.alternate!==null&&V.delete(re.key===null?W:re.key),f=i(re,f,W),L===null?P=re:L.sibling=re,L=re);return e&&V.forEach(function(ue){return t(_,ue)}),Ft&&Lr(_,W),P}function h(_,f,w,R){var P=ul(w);if(typeof P!="function")throw Error(fe(150));if(w=P.call(w),w==null)throw Error(fe(151));for(var L=P=null,V=f,W=f=0,re=null,J=w.next();V!==null&&!J.done;W++,J=w.next()){V.index>W?(re=V,V=null):re=V.sibling;var ue=g(_,V,J.value,R);if(ue===null){V===null&&(V=re);break}e&&V&&ue.alternate===null&&t(_,V),f=i(ue,f,W),L===null?P=ue:L.sibling=ue,L=ue,V=re}if(J.done)return n(_,V),Ft&&Lr(_,W),P;if(V===null){for(;!J.done;W++,J=w.next())J=m(_,J.value,R),J!==null&&(f=i(J,f,W),L===null?P=J:L.sibling=J,L=J);return Ft&&Lr(_,W),P}for(V=o(_,V);!J.done;W++,J=w.next())J=d(V,_,W,J.value,R),J!==null&&(e&&J.alternate!==null&&V.delete(J.key===null?W:J.key),f=i(J,f,W),L===null?P=J:L.sibling=J,L=J);return e&&V.forEach(function(Ne){return t(_,Ne)}),Ft&&Lr(_,W),P}function y(_,f,w,R){if(typeof w=="object"&&w!==null&&w.type===fi&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Ia:e:{for(var P=w.key,L=f;L!==null;){if(L.key===P){if(P=w.type,P===fi){if(L.tag===7){n(_,L.sibling),f=r(L,w.props.children),f.return=_,_=f;break e}}else if(L.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Qo&&Rf(P)===L.type){n(_,L.sibling),f=r(L,w.props),f.ref=ml(_,L,w),f.return=_,_=f;break e}n(_,L);break}else t(_,L);L=L.sibling}w.type===fi?(f=zr(w.props.children,_.mode,R,w.key),f.return=_,_=f):(R=us(w.type,w.key,w.props,null,_.mode,R),R.ref=ml(_,f,w),R.return=_,_=R)}return l(_);case mi:e:{for(L=w.key;f!==null;){if(f.key===L)if(f.tag===4&&f.stateNode.containerInfo===w.containerInfo&&f.stateNode.implementation===w.implementation){n(_,f.sibling),f=r(f,w.children||[]),f.return=_,_=f;break e}else{n(_,f);break}else t(_,f);f=f.sibling}f=Dc(w,_.mode,R),f.return=_,_=f}return l(_);case Qo:return L=w._init,y(_,f,L(w._payload),R)}if(vl(w))return v(_,f,w,R);if(ul(w))return h(_,f,w,R);Xa(_,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,f!==null&&f.tag===6?(n(_,f.sibling),f=r(f,w),f.return=_,_=f):(n(_,f),f=Fc(w,_.mode,R),f.return=_,_=f),l(_)):n(_,f)}return y}var Pi=Qg(!0),Zg=Qg(!1),ks=fr(null),Ss=null,Ci=null,jd=null;function Hd(){jd=Ci=Ss=null}function Ud(e){var t=ks.current;xt(ks),e._currentValue=t}function ld(e,t,n){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===n)break;e=e.return}}function Fi(e,t){Ss=e,jd=Ci=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(xn=!0),e.firstContext=null)}function to(e){var t=e._currentValue;if(jd!==e)if(e={context:e,memoizedValue:t,next:null},Ci===null){if(Ss===null)throw Error(fe(308));Ci=e,Ss.dependencies={lanes:0,firstContext:e}}else Ci=Ci.next=e;return t}var Ar=null;function Wd(e){Ar===null?Ar=[e]:Ar.push(e)}function Jg(e,t,n,o){var r=t.interleaved;return r===null?(n.next=n,Wd(t)):(n.next=r.next,r.next=n),t.interleaved=n,Uo(e,o)}function Uo(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Zo=!1;function Gd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function eh(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Bo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ar(e,t,n){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(pt&2)!==0){var r=o.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),o.pending=t,Uo(e,n)}return r=o.interleaved,r===null?(t.next=t,Wd(o)):(t.next=r.next,r.next=t),o.interleaved=t,Uo(e,n)}function os(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,Md(e,n)}}function Ef(e,t){var n=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,n===o)){var r=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?r=i=l:i=i.next=l,n=n.next}while(n!==null);i===null?r=i=t:i=i.next=t}else r=i=t;n={baseState:o.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:o.shared,effects:o.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ns(e,t,n,o){var r=e.updateQueue;Zo=!1;var i=r.firstBaseUpdate,l=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var s=a,c=s.next;s.next=null,l===null?i=c:l.next=c,l=s;var p=e.alternate;p!==null&&(p=p.updateQueue,a=p.lastBaseUpdate,a!==l&&(a===null?p.firstBaseUpdate=c:a.next=c,p.lastBaseUpdate=s))}if(i!==null){var m=r.baseState;l=0,p=c=s=null,a=i;do{var g=a.lane,d=a.eventTime;if((o&g)===g){p!==null&&(p=p.next={eventTime:d,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=e,h=a;switch(g=t,d=n,h.tag){case 1:if(v=h.payload,typeof v=="function"){m=v.call(d,m,g);break e}m=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=h.payload,g=typeof v=="function"?v.call(d,m,g):v,g==null)break e;m=Pt({},m,g);break e;case 2:Zo=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,g=r.effects,g===null?r.effects=[a]:g.push(a))}else d={eventTime:d,lane:g,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(c=p=d,s=m):p=p.next=d,l|=g;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;g=a,a=g.next,g.next=null,r.lastBaseUpdate=g,r.shared.pending=null}}while(!0);if(p===null&&(s=m),r.baseState=s,r.firstBaseUpdate=c,r.lastBaseUpdate=p,t=r.shared.interleaved,t!==null){r=t;do l|=r.lane,r=r.next;while(r!==t)}else i===null&&(r.shared.lanes=0);Hr|=l,e.lanes=l,e.memoizedState=m}}function Ff(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var o=e[t],r=o.callback;if(r!==null){if(o.callback=null,o=n,typeof r!="function")throw Error(fe(191,r));r.call(o)}}}var Xl={},Fo=fr(Xl),Bl=fr(Xl),jl=fr(Xl);function Or(e){if(e===Xl)throw Error(fe(174));return e}function qd(e,t){switch(Ct(jl,t),Ct(Bl,e),Ct(Fo,Xl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Vc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Vc(t,e)}xt(Fo),Ct(Fo,t)}function Ii(){xt(Fo),xt(Bl),xt(jl)}function th(e){Or(jl.current);var t=Or(Fo.current),n=Vc(t,e.type);t!==n&&(Ct(Bl,e),Ct(Fo,n))}function Kd(e){Bl.current===e&&(xt(Fo),xt(Bl))}var Tt=fr(0);function xs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var kc=[];function Yd(){for(var e=0;e<kc.length;e++)kc[e]._workInProgressVersionPrimary=null;kc.length=0}var rs=Go.ReactCurrentDispatcher,Sc=Go.ReactCurrentBatchConfig,jr=0,Lt=null,qt=null,Xt=null,Rs=!1,xl=!1,Hl=0,ow=0;function sn(){throw Error(fe(321))}function Xd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_o(e[n],t[n]))return!1;return!0}function Qd(e,t,n,o,r,i){if(jr=i,Lt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,rs.current=e===null||e.memoizedState===null?aw:sw,e=n(o,r),xl){i=0;do{if(xl=!1,Hl=0,25<=i)throw Error(fe(301));i+=1,Xt=qt=null,t.updateQueue=null,rs.current=uw,e=n(o,r)}while(xl)}if(rs.current=Es,t=qt!==null&&qt.next!==null,jr=0,Xt=qt=Lt=null,Rs=!1,t)throw Error(fe(300));return e}function Zd(){var e=Hl!==0;return Hl=0,e}function xo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?Lt.memoizedState=Xt=e:Xt=Xt.next=e,Xt}function no(){if(qt===null){var e=Lt.alternate;e=e!==null?e.memoizedState:null}else e=qt.next;var t=Xt===null?Lt.memoizedState:Xt.next;if(t!==null)Xt=t,qt=e;else{if(e===null)throw Error(fe(310));qt=e,e={memoizedState:qt.memoizedState,baseState:qt.baseState,baseQueue:qt.baseQueue,queue:qt.queue,next:null},Xt===null?Lt.memoizedState=Xt=e:Xt=Xt.next=e}return Xt}function Ul(e,t){return typeof t=="function"?t(e):t}function Nc(e){var t=no(),n=t.queue;if(n===null)throw Error(fe(311));n.lastRenderedReducer=e;var o=qt,r=o.baseQueue,i=n.pending;if(i!==null){if(r!==null){var l=r.next;r.next=i.next,i.next=l}o.baseQueue=r=i,n.pending=null}if(r!==null){i=r.next,o=o.baseState;var a=l=null,s=null,c=i;do{var p=c.lane;if((jr&p)===p)s!==null&&(s=s.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),o=c.hasEagerState?c.eagerState:e(o,c.action);else{var m={lane:p,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};s===null?(a=s=m,l=o):s=s.next=m,Lt.lanes|=p,Hr|=p}c=c.next}while(c!==null&&c!==i);s===null?l=o:s.next=a,_o(o,t.memoizedState)||(xn=!0),t.memoizedState=o,t.baseState=l,t.baseQueue=s,n.lastRenderedState=o}if(e=n.interleaved,e!==null){r=e;do i=r.lane,Lt.lanes|=i,Hr|=i,r=r.next;while(r!==e)}else r===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function xc(e){var t=no(),n=t.queue;if(n===null)throw Error(fe(311));n.lastRenderedReducer=e;var o=n.dispatch,r=n.pending,i=t.memoizedState;if(r!==null){n.pending=null;var l=r=r.next;do i=e(i,l.action),l=l.next;while(l!==r);_o(i,t.memoizedState)||(xn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,o]}function nh(){}function oh(e,t){var n=Lt,o=no(),r=t(),i=!_o(o.memoizedState,r);if(i&&(o.memoizedState=r,xn=!0),o=o.queue,Jd(lh.bind(null,n,o,e),[e]),o.getSnapshot!==t||i||Xt!==null&&Xt.memoizedState.tag&1){if(n.flags|=2048,Wl(9,ih.bind(null,n,o,r,t),void 0,null),Qt===null)throw Error(fe(349));(jr&30)!==0||rh(n,t,r)}return r}function rh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Lt.updateQueue,t===null?(t={lastEffect:null,stores:null},Lt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ih(e,t,n,o){t.value=n,t.getSnapshot=o,ah(t)&&sh(e)}function lh(e,t,n){return n(function(){ah(t)&&sh(e)})}function ah(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_o(e,n)}catch{return!0}}function sh(e){var t=Uo(e,1);t!==null&&ho(t,e,1,-1)}function Df(e){var t=xo();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ul,lastRenderedState:e},t.queue=e,e=e.dispatch=lw.bind(null,Lt,e),[t.memoizedState,e]}function Wl(e,t,n,o){return e={tag:e,create:t,destroy:n,deps:o,next:null},t=Lt.updateQueue,t===null?(t={lastEffect:null,stores:null},Lt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(o=n.next,n.next=e,e.next=o,t.lastEffect=e)),e}function uh(){return no().memoizedState}function is(e,t,n,o){var r=xo();Lt.flags|=e,r.memoizedState=Wl(1|t,n,void 0,o===void 0?null:o)}function Vs(e,t,n,o){var r=no();o=o===void 0?null:o;var i=void 0;if(qt!==null){var l=qt.memoizedState;if(i=l.destroy,o!==null&&Xd(o,l.deps)){r.memoizedState=Wl(t,n,i,o);return}}Lt.flags|=e,r.memoizedState=Wl(1|t,n,i,o)}function Mf(e,t){return is(8390656,8,e,t)}function Jd(e,t){return Vs(2048,8,e,t)}function ch(e,t){return Vs(4,2,e,t)}function dh(e,t){return Vs(4,4,e,t)}function ph(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function mh(e,t,n){return n=n!=null?n.concat([e]):null,Vs(4,4,ph.bind(null,t,e),n)}function ep(){}function fh(e,t){var n=no();t=t===void 0?null:t;var o=n.memoizedState;return o!==null&&t!==null&&Xd(t,o[1])?o[0]:(n.memoizedState=[e,t],e)}function gh(e,t){var n=no();t=t===void 0?null:t;var o=n.memoizedState;return o!==null&&t!==null&&Xd(t,o[1])?o[0]:(e=e(),n.memoizedState=[e,t],e)}function hh(e,t,n){return(jr&21)===0?(e.baseState&&(e.baseState=!1,xn=!0),e.memoizedState=n):(_o(n,t)||(n=wg(),Lt.lanes|=n,Hr|=n,e.baseState=!0),t)}function rw(e,t){var n=ht;ht=n!==0&&4>n?n:4,e(!0);var o=Sc.transition;Sc.transition={};try{e(!1),t()}finally{ht=n,Sc.transition=o}}function _h(){return no().memoizedState}function iw(e,t,n){var o=ur(e);if(n={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null},vh(e))bh(t,n);else if(n=Jg(e,t,n,o),n!==null){var r=vn();ho(n,e,o,r),yh(n,t,o)}}function lw(e,t,n){var o=ur(e),r={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null};if(vh(e))bh(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,a=i(l,n);if(r.hasEagerState=!0,r.eagerState=a,_o(a,l)){var s=t.interleaved;s===null?(r.next=r,Wd(t)):(r.next=s.next,s.next=r),t.interleaved=r;return}}catch{}n=Jg(e,t,r,o),n!==null&&(r=vn(),ho(n,e,o,r),yh(n,t,o))}}function vh(e){var t=e.alternate;return e===Lt||t!==null&&t===Lt}function bh(e,t){xl=Rs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function yh(e,t,n){if((n&4194240)!==0){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,Md(e,n)}}var Es={readContext:to,useCallback:sn,useContext:sn,useEffect:sn,useImperativeHandle:sn,useInsertionEffect:sn,useLayoutEffect:sn,useMemo:sn,useReducer:sn,useRef:sn,useState:sn,useDebugValue:sn,useDeferredValue:sn,useTransition:sn,useMutableSource:sn,useSyncExternalStore:sn,useId:sn,unstable_isNewReconciler:!1},aw={readContext:to,useCallback:function(e,t){return xo().memoizedState=[e,t===void 0?null:t],e},useContext:to,useEffect:Mf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,is(4194308,4,ph.bind(null,t,e),n)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){return is(4,2,e,t)},useMemo:function(e,t){var n=xo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var o=xo();return t=n!==void 0?n(t):t,o.memoizedState=o.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},o.queue=e,e=e.dispatch=iw.bind(null,Lt,e),[o.memoizedState,e]},useRef:function(e){var t=xo();return e={current:e},t.memoizedState=e},useState:Df,useDebugValue:ep,useDeferredValue:function(e){return xo().memoizedState=e},useTransition:function(){var e=Df(!1),t=e[0];return e=rw.bind(null,e[1]),xo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var o=Lt,r=xo();if(Ft){if(n===void 0)throw Error(fe(407));n=n()}else{if(n=t(),Qt===null)throw Error(fe(349));(jr&30)!==0||rh(o,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,Mf(lh.bind(null,o,i,e),[e]),o.flags|=2048,Wl(9,ih.bind(null,o,i,n,t),void 0,null),n},useId:function(){var e=xo(),t=Qt.identifierPrefix;if(Ft){var n=Vo,o=zo;n=(o&~(1<<32-go(o)-1)).toString(32)+n,t=":"+t+"R"+n,n=Hl++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=ow++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},sw={readContext:to,useCallback:fh,useContext:to,useEffect:Jd,useImperativeHandle:mh,useInsertionEffect:ch,useLayoutEffect:dh,useMemo:gh,useReducer:Nc,useRef:uh,useState:function(){return Nc(Ul)},useDebugValue:ep,useDeferredValue:function(e){var t=no();return hh(t,qt.memoizedState,e)},useTransition:function(){var e=Nc(Ul)[0],t=no().memoizedState;return[e,t]},useMutableSource:nh,useSyncExternalStore:oh,useId:_h,unstable_isNewReconciler:!1},uw={readContext:to,useCallback:fh,useContext:to,useEffect:Jd,useImperativeHandle:mh,useInsertionEffect:ch,useLayoutEffect:dh,useMemo:gh,useReducer:xc,useRef:uh,useState:function(){return xc(Ul)},useDebugValue:ep,useDeferredValue:function(e){var t=no();return qt===null?t.memoizedState=e:hh(t,qt.memoizedState,e)},useTransition:function(){var e=xc(Ul)[0],t=no().memoizedState;return[e,t]},useMutableSource:nh,useSyncExternalStore:oh,useId:_h,unstable_isNewReconciler:!1};function po(e,t){if(e&&e.defaultProps){t=Pt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ad(e,t,n,o){t=e.memoizedState,n=n(o,t),n=n==null?t:Pt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Bs={isMounted:function(e){return(e=e._reactInternals)?Gr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var o=vn(),r=ur(e),i=Bo(o,r);i.payload=t,n!=null&&(i.callback=n),t=ar(e,i,r),t!==null&&(ho(t,e,r,o),os(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var o=vn(),r=ur(e),i=Bo(o,r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ar(e,i,r),t!==null&&(ho(t,e,r,o),os(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=vn(),o=ur(e),r=Bo(n,o);r.tag=2,t!=null&&(r.callback=t),t=ar(e,r,o),t!==null&&(ho(t,e,o,n),os(t,e,o))}};function Tf(e,t,n,o,r,i,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,i,l):t.prototype&&t.prototype.isPureReactComponent?!Ol(n,o)||!Ol(r,i):!0}function wh(e,t,n){var o=!1,r=pr,i=t.contextType;return typeof i=="object"&&i!==null?i=to(i):(r=En(t)?Vr:dn.current,o=t.contextTypes,i=(o=o!=null)?Ti(e,r):pr),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Bs,e.stateNode=t,t._reactInternals=e,o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=i),t}function Lf(e,t,n,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,o),t.state!==e&&Bs.enqueueReplaceState(t,t.state,null)}function sd(e,t,n,o){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},Gd(e);var i=t.contextType;typeof i=="object"&&i!==null?r.context=to(i):(i=En(t)?Vr:dn.current,r.context=Ti(e,i)),r.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(ad(e,t,i,n),r.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(t=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),t!==r.state&&Bs.enqueueReplaceState(r,r.state,null),Ns(e,n,r,o),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.flags|=4194308)}function Ai(e,t){try{var n="",o=t;do n+=zb(o),o=o.return;while(o);var r=n}catch(i){r=`
Error generating stack: `+i.message+`
`+i.stack}return{value:e,source:t,stack:r,digest:null}}function Rc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ud(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var cw=typeof WeakMap=="function"?WeakMap:Map;function Ch(e,t,n){n=Bo(-1,n),n.tag=3,n.payload={element:null};var o=t.value;return n.callback=function(){Ds||(Ds=!0,bd=o),ud(e,t)},n}function kh(e,t,n){n=Bo(-1,n),n.tag=3;var o=e.type.getDerivedStateFromError;if(typeof o=="function"){var r=t.value;n.payload=function(){return o(r)},n.callback=function(){ud(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){ud(e,t),typeof o!="function"&&(sr===null?sr=new Set([this]):sr.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function Pf(e,t,n){var o=e.pingCache;if(o===null){o=e.pingCache=new cw;var r=new Set;o.set(t,r)}else r=o.get(t),r===void 0&&(r=new Set,o.set(t,r));r.has(n)||(r.add(n),e=Sw.bind(null,e,t,n),t.then(e,e))}function If(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Af(e,t,n,o,r){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Bo(-1,1),t.tag=2,ar(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=r,e)}var dw=Go.ReactCurrentOwner,xn=!1;function _n(e,t,n,o){t.child=e===null?Zg(t,null,n,o):Pi(t,e.child,n,o)}function Of(e,t,n,o,r){n=n.render;var i=t.ref;return Fi(t,r),o=Qd(e,t,n,o,i,r),n=Zd(),e!==null&&!xn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Wo(e,t,r)):(Ft&&n&&zd(t),t.flags|=1,_n(e,t,o,r),t.child)}function $f(e,t,n,o,r){if(e===null){var i=n.type;return typeof i=="function"&&!sp(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Sh(e,t,i,o,r)):(e=us(n.type,null,o,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,(e.lanes&r)===0){var l=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ol,n(l,o)&&e.ref===t.ref)return Wo(e,t,r)}return t.flags|=1,e=cr(i,o),e.ref=t.ref,e.return=t,t.child=e}function Sh(e,t,n,o,r){if(e!==null){var i=e.memoizedProps;if(Ol(i,o)&&e.ref===t.ref)if(xn=!1,t.pendingProps=o=i,(e.lanes&r)!==0)(e.flags&131072)!==0&&(xn=!0);else return t.lanes=e.lanes,Wo(e,t,r)}return cd(e,t,n,o,r)}function Nh(e,t,n){var o=t.pendingProps,r=o.children,i=e!==null?e.memoizedState:null;if(o.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ct(Si,zn),zn|=n;else{if((n&1073741824)===0)return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ct(Si,zn),zn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},o=i!==null?i.baseLanes:n,Ct(Si,zn),zn|=o}else i!==null?(o=i.baseLanes|n,t.memoizedState=null):o=n,Ct(Si,zn),zn|=o;return _n(e,t,r,n),t.child}function xh(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function cd(e,t,n,o,r){var i=En(n)?Vr:dn.current;return i=Ti(t,i),Fi(t,r),n=Qd(e,t,n,o,i,r),o=Zd(),e!==null&&!xn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Wo(e,t,r)):(Ft&&o&&zd(t),t.flags|=1,_n(e,t,n,r),t.child)}function zf(e,t,n,o,r){if(En(n)){var i=!0;ys(t)}else i=!1;if(Fi(t,r),t.stateNode===null)ls(e,t),wh(t,n,o),sd(t,n,o,r),o=!0;else if(e===null){var l=t.stateNode,a=t.memoizedProps;l.props=a;var s=l.context,c=n.contextType;typeof c=="object"&&c!==null?c=to(c):(c=En(n)?Vr:dn.current,c=Ti(t,c));var p=n.getDerivedStateFromProps,m=typeof p=="function"||typeof l.getSnapshotBeforeUpdate=="function";m||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==o||s!==c)&&Lf(t,l,o,c),Zo=!1;var g=t.memoizedState;l.state=g,Ns(t,o,l,r),s=t.memoizedState,a!==o||g!==s||Rn.current||Zo?(typeof p=="function"&&(ad(t,n,p,o),s=t.memoizedState),(a=Zo||Tf(t,n,a,o,g,s,c))?(m||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=s),l.props=o,l.state=s,l.context=c,o=a):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{l=t.stateNode,eh(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:po(t.type,a),l.props=c,m=t.pendingProps,g=l.context,s=n.contextType,typeof s=="object"&&s!==null?s=to(s):(s=En(n)?Vr:dn.current,s=Ti(t,s));var d=n.getDerivedStateFromProps;(p=typeof d=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==m||g!==s)&&Lf(t,l,o,s),Zo=!1,g=t.memoizedState,l.state=g,Ns(t,o,l,r);var v=t.memoizedState;a!==m||g!==v||Rn.current||Zo?(typeof d=="function"&&(ad(t,n,d,o),v=t.memoizedState),(c=Zo||Tf(t,n,c,o,g,v,s)||!1)?(p||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(o,v,s),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(o,v,s)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=v),l.props=o,l.state=v,l.context=s,o=c):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),o=!1)}return dd(e,t,n,o,i,r)}function dd(e,t,n,o,r,i){xh(e,t);var l=(t.flags&128)!==0;if(!o&&!l)return r&&Sf(t,n,!1),Wo(e,t,i);o=t.stateNode,dw.current=t;var a=l&&typeof n.getDerivedStateFromError!="function"?null:o.render();return t.flags|=1,e!==null&&l?(t.child=Pi(t,e.child,null,i),t.child=Pi(t,null,a,i)):_n(e,t,a,i),t.memoizedState=o.state,r&&Sf(t,n,!0),t.child}function Rh(e){var t=e.stateNode;t.pendingContext?kf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&kf(e,t.context,!1),qd(e,t.containerInfo)}function Vf(e,t,n,o,r){return Li(),Bd(r),t.flags|=256,_n(e,t,n,o),t.child}var pd={dehydrated:null,treeContext:null,retryLane:0};function md(e){return{baseLanes:e,cachePool:null,transitions:null}}function Eh(e,t,n){var o=t.pendingProps,r=Tt.current,i=!1,l=(t.flags&128)!==0,a;if((a=l)||(a=e!==null&&e.memoizedState===null?!1:(r&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(r|=1),Ct(Tt,r&1),e===null)return id(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(l=o.children,e=o.fallback,i?(o=t.mode,i=t.child,l={mode:"hidden",children:l},(o&1)===0&&i!==null?(i.childLanes=0,i.pendingProps=l):i=Us(l,o,0,null),e=zr(e,o,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=md(n),t.memoizedState=pd,e):tp(t,l));if(r=e.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return pw(e,t,l,o,a,r,n);if(i){i=o.fallback,l=t.mode,r=e.child,a=r.sibling;var s={mode:"hidden",children:o.children};return(l&1)===0&&t.child!==r?(o=t.child,o.childLanes=0,o.pendingProps=s,t.deletions=null):(o=cr(r,s),o.subtreeFlags=r.subtreeFlags&14680064),a!==null?i=cr(a,i):(i=zr(i,l,n,null),i.flags|=2),i.return=t,o.return=t,o.sibling=i,t.child=o,o=i,i=t.child,l=e.child.memoizedState,l=l===null?md(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},i.memoizedState=l,i.childLanes=e.childLanes&~n,t.memoizedState=pd,o}return i=e.child,e=i.sibling,o=cr(i,{mode:"visible",children:o.children}),(t.mode&1)===0&&(o.lanes=n),o.return=t,o.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function tp(e,t){return t=Us({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Qa(e,t,n,o){return o!==null&&Bd(o),Pi(t,e.child,null,n),e=tp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function pw(e,t,n,o,r,i,l){if(n)return t.flags&256?(t.flags&=-257,o=Rc(Error(fe(422))),Qa(e,t,l,o)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=o.fallback,r=t.mode,o=Us({mode:"visible",children:o.children},r,0,null),i=zr(i,r,l,null),i.flags|=2,o.return=t,i.return=t,o.sibling=i,t.child=o,(t.mode&1)!==0&&Pi(t,e.child,null,l),t.child.memoizedState=md(l),t.memoizedState=pd,i);if((t.mode&1)===0)return Qa(e,t,l,null);if(r.data==="$!"){if(o=r.nextSibling&&r.nextSibling.dataset,o)var a=o.dgst;return o=a,i=Error(fe(419)),o=Rc(i,o,void 0),Qa(e,t,l,o)}if(a=(l&e.childLanes)!==0,xn||a){if(o=Qt,o!==null){switch(l&-l){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}r=(r&(o.suspendedLanes|l))!==0?0:r,r!==0&&r!==i.retryLane&&(i.retryLane=r,Uo(e,r),ho(o,e,r,-1))}return ap(),o=Rc(Error(fe(421))),Qa(e,t,l,o)}return r.data==="$?"?(t.flags|=128,t.child=e.child,t=Nw.bind(null,e),r._reactRetry=t,null):(e=i.treeContext,Vn=lr(r.nextSibling),Bn=t,Ft=!0,fo=null,e!==null&&(Qn[Zn++]=zo,Qn[Zn++]=Vo,Qn[Zn++]=Br,zo=e.id,Vo=e.overflow,Br=t),t=tp(t,o.children),t.flags|=4096,t)}function Bf(e,t,n){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),ld(e.return,t,n)}function Ec(e,t,n,o,r){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:n,tailMode:r}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=o,i.tail=n,i.tailMode=r)}function Fh(e,t,n){var o=t.pendingProps,r=o.revealOrder,i=o.tail;if(_n(e,t,o.children,n),o=Tt.current,(o&2)!==0)o=o&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Bf(e,n,t);else if(e.tag===19)Bf(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}o&=1}if(Ct(Tt,o),(t.mode&1)===0)t.memoizedState=null;else switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&xs(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Ec(t,!1,r,n,i);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&xs(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Ec(t,!0,n,null,i);break;case"together":Ec(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ls(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Wo(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Hr|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(fe(153));if(t.child!==null){for(e=t.child,n=cr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=cr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function mw(e,t,n){switch(t.tag){case 3:Rh(t),Li();break;case 5:th(t);break;case 1:En(t.type)&&ys(t);break;case 4:qd(t,t.stateNode.containerInfo);break;case 10:var o=t.type._context,r=t.memoizedProps.value;Ct(ks,o._currentValue),o._currentValue=r;break;case 13:if(o=t.memoizedState,o!==null)return o.dehydrated!==null?(Ct(Tt,Tt.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?Eh(e,t,n):(Ct(Tt,Tt.current&1),e=Wo(e,t,n),e!==null?e.sibling:null);Ct(Tt,Tt.current&1);break;case 19:if(o=(n&t.childLanes)!==0,(e.flags&128)!==0){if(o)return Fh(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Ct(Tt,Tt.current),o)break;return null;case 22:case 23:return t.lanes=0,Nh(e,t,n)}return Wo(e,t,n)}var Dh,fd,Mh,Th;Dh=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};fd=function(){};Mh=function(e,t,n,o){var r=e.memoizedProps;if(r!==o){e=t.stateNode,Or(Fo.current);var i=null;switch(n){case"input":r=Ac(e,r),o=Ac(e,o),i=[];break;case"select":r=Pt({},r,{value:void 0}),o=Pt({},o,{value:void 0}),i=[];break;case"textarea":r=zc(e,r),o=zc(e,o),i=[];break;default:typeof r.onClick!="function"&&typeof o.onClick=="function"&&(e.onclick=vs)}Bc(n,o);var l;n=null;for(c in r)if(!o.hasOwnProperty(c)&&r.hasOwnProperty(c)&&r[c]!=null)if(c==="style"){var a=r[c];for(l in a)a.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Dl.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in o){var s=o[c];if(a=r?.[c],o.hasOwnProperty(c)&&s!==a&&(s!=null||a!=null))if(c==="style")if(a){for(l in a)!a.hasOwnProperty(l)||s&&s.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in s)s.hasOwnProperty(l)&&a[l]!==s[l]&&(n||(n={}),n[l]=s[l])}else n||(i||(i=[]),i.push(c,n)),n=s;else c==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,a=a?a.__html:void 0,s!=null&&a!==s&&(i=i||[]).push(c,s)):c==="children"?typeof s!="string"&&typeof s!="number"||(i=i||[]).push(c,""+s):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Dl.hasOwnProperty(c)?(s!=null&&c==="onScroll"&&Nt("scroll",e),i||a===s||(i=[])):(i=i||[]).push(c,s))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};Th=function(e,t,n,o){n!==o&&(t.flags|=4)};function fl(e,t){if(!Ft)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function un(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,o=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,o|=r.subtreeFlags&14680064,o|=r.flags&14680064,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,o|=r.subtreeFlags,o|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=o,e.childLanes=n,t}function fw(e,t,n){var o=t.pendingProps;switch(Vd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return un(t),null;case 1:return En(t.type)&&bs(),un(t),null;case 3:return o=t.stateNode,Ii(),xt(Rn),xt(dn),Yd(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(e===null||e.child===null)&&(Ya(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,fo!==null&&(Cd(fo),fo=null))),fd(e,t),un(t),null;case 5:Kd(t);var r=Or(jl.current);if(n=t.type,e!==null&&t.stateNode!=null)Mh(e,t,n,o,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!o){if(t.stateNode===null)throw Error(fe(166));return un(t),null}if(e=Or(Fo.current),Ya(t)){o=t.stateNode,n=t.type;var i=t.memoizedProps;switch(o[Ro]=t,o[Vl]=i,e=(t.mode&1)!==0,n){case"dialog":Nt("cancel",o),Nt("close",o);break;case"iframe":case"object":case"embed":Nt("load",o);break;case"video":case"audio":for(r=0;r<yl.length;r++)Nt(yl[r],o);break;case"source":Nt("error",o);break;case"img":case"image":case"link":Nt("error",o),Nt("load",o);break;case"details":Nt("toggle",o);break;case"input":Km(o,i),Nt("invalid",o);break;case"select":o._wrapperState={wasMultiple:!!i.multiple},Nt("invalid",o);break;case"textarea":Xm(o,i),Nt("invalid",o)}Bc(n,i),r=null;for(var l in i)if(i.hasOwnProperty(l)){var a=i[l];l==="children"?typeof a=="string"?o.textContent!==a&&(i.suppressHydrationWarning!==!0&&Ka(o.textContent,a,e),r=["children",a]):typeof a=="number"&&o.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Ka(o.textContent,a,e),r=["children",""+a]):Dl.hasOwnProperty(l)&&a!=null&&l==="onScroll"&&Nt("scroll",o)}switch(n){case"input":Aa(o),Ym(o,i,!0);break;case"textarea":Aa(o),Qm(o);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(o.onclick=vs)}o=r,t.updateQueue=o,o!==null&&(t.flags|=4)}else{l=r.nodeType===9?r:r.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=lg(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=l.createElement(n,{is:o.is}):(e=l.createElement(n),n==="select"&&(l=e,o.multiple?l.multiple=!0:o.size&&(l.size=o.size))):e=l.createElementNS(e,n),e[Ro]=t,e[Vl]=o,Dh(e,t,!1,!1),t.stateNode=e;e:{switch(l=jc(n,o),n){case"dialog":Nt("cancel",e),Nt("close",e),r=o;break;case"iframe":case"object":case"embed":Nt("load",e),r=o;break;case"video":case"audio":for(r=0;r<yl.length;r++)Nt(yl[r],e);r=o;break;case"source":Nt("error",e),r=o;break;case"img":case"image":case"link":Nt("error",e),Nt("load",e),r=o;break;case"details":Nt("toggle",e),r=o;break;case"input":Km(e,o),r=Ac(e,o),Nt("invalid",e);break;case"option":r=o;break;case"select":e._wrapperState={wasMultiple:!!o.multiple},r=Pt({},o,{value:void 0}),Nt("invalid",e);break;case"textarea":Xm(e,o),r=zc(e,o),Nt("invalid",e);break;default:r=o}Bc(n,r),a=r;for(i in a)if(a.hasOwnProperty(i)){var s=a[i];i==="style"?ug(e,s):i==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,s!=null&&ag(e,s)):i==="children"?typeof s=="string"?(n!=="textarea"||s!=="")&&Ml(e,s):typeof s=="number"&&Ml(e,""+s):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Dl.hasOwnProperty(i)?s!=null&&i==="onScroll"&&Nt("scroll",e):s!=null&&Nd(e,i,s,l))}switch(n){case"input":Aa(e),Ym(e,o,!1);break;case"textarea":Aa(e),Qm(e);break;case"option":o.value!=null&&e.setAttribute("value",""+dr(o.value));break;case"select":e.multiple=!!o.multiple,i=o.value,i!=null?Ni(e,!!o.multiple,i,!1):o.defaultValue!=null&&Ni(e,!!o.multiple,o.defaultValue,!0);break;default:typeof r.onClick=="function"&&(e.onclick=vs)}switch(n){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}}o&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return un(t),null;case 6:if(e&&t.stateNode!=null)Th(e,t,e.memoizedProps,o);else{if(typeof o!="string"&&t.stateNode===null)throw Error(fe(166));if(n=Or(jl.current),Or(Fo.current),Ya(t)){if(o=t.stateNode,n=t.memoizedProps,o[Ro]=t,(i=o.nodeValue!==n)&&(e=Bn,e!==null))switch(e.tag){case 3:Ka(o.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ka(o.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else o=(n.nodeType===9?n:n.ownerDocument).createTextNode(o),o[Ro]=t,t.stateNode=o}return un(t),null;case 13:if(xt(Tt),o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ft&&Vn!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Xg(),Li(),t.flags|=98560,i=!1;else if(i=Ya(t),o!==null&&o.dehydrated!==null){if(e===null){if(!i)throw Error(fe(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(fe(317));i[Ro]=t}else Li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;un(t),i=!1}else fo!==null&&(Cd(fo),fo=null),i=!0;if(!i)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(o=o!==null,o!==(e!==null&&e.memoizedState!==null)&&o&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Tt.current&1)!==0?Kt===0&&(Kt=3):ap())),t.updateQueue!==null&&(t.flags|=4),un(t),null);case 4:return Ii(),fd(e,t),e===null&&$l(t.stateNode.containerInfo),un(t),null;case 10:return Ud(t.type._context),un(t),null;case 17:return En(t.type)&&bs(),un(t),null;case 19:if(xt(Tt),i=t.memoizedState,i===null)return un(t),null;if(o=(t.flags&128)!==0,l=i.rendering,l===null)if(o)fl(i,!1);else{if(Kt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(l=xs(e),l!==null){for(t.flags|=128,fl(i,!1),o=l.updateQueue,o!==null&&(t.updateQueue=o,t.flags|=4),t.subtreeFlags=0,o=n,n=t.child;n!==null;)i=n,e=o,i.flags&=14680066,l=i.alternate,l===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,e=l.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ct(Tt,Tt.current&1|2),t.child}e=e.sibling}i.tail!==null&&Bt()>Oi&&(t.flags|=128,o=!0,fl(i,!1),t.lanes=4194304)}else{if(!o)if(e=xs(l),e!==null){if(t.flags|=128,o=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),fl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!Ft)return un(t),null}else 2*Bt()-i.renderingStartTime>Oi&&n!==1073741824&&(t.flags|=128,o=!0,fl(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Bt(),t.sibling=null,n=Tt.current,Ct(Tt,o?n&1|2:n&1),t):(un(t),null);case 22:case 23:return lp(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&(t.mode&1)!==0?(zn&1073741824)!==0&&(un(t),t.subtreeFlags&6&&(t.flags|=8192)):un(t),null;case 24:return null;case 25:return null}throw Error(fe(156,t.tag))}function gw(e,t){switch(Vd(t),t.tag){case 1:return En(t.type)&&bs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ii(),xt(Rn),xt(dn),Yd(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Kd(t),null;case 13:if(xt(Tt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(fe(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xt(Tt),null;case 4:return Ii(),null;case 10:return Ud(t.type._context),null;case 22:case 23:return lp(),null;case 24:return null;default:return null}}var Za=!1,cn=!1,hw=typeof WeakSet=="function"?WeakSet:Set,Te=null;function ki(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(o){Ot(e,t,o)}else n.current=null}function gd(e,t,n){try{n()}catch(o){Ot(e,t,o)}}var jf=!1;function _w(e,t){if(Zc=gs,e=Og(),$d(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var o=n.getSelection&&n.getSelection();if(o&&o.rangeCount!==0){n=o.anchorNode;var r=o.anchorOffset,i=o.focusNode;o=o.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,a=-1,s=-1,c=0,p=0,m=e,g=null;t:for(;;){for(var d;m!==n||r!==0&&m.nodeType!==3||(a=l+r),m!==i||o!==0&&m.nodeType!==3||(s=l+o),m.nodeType===3&&(l+=m.nodeValue.length),(d=m.firstChild)!==null;)g=m,m=d;for(;;){if(m===e)break t;if(g===n&&++c===r&&(a=l),g===i&&++p===o&&(s=l),(d=m.nextSibling)!==null)break;m=g,g=m.parentNode}m=d}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Jc={focusedElem:e,selectionRange:n},gs=!1,Te=t;Te!==null;)if(t=Te,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Te=e;else for(;Te!==null;){t=Te;try{var v=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var h=v.memoizedProps,y=v.memoizedState,_=t.stateNode,f=_.getSnapshotBeforeUpdate(t.elementType===t.type?h:po(t.type,h),y);_.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(fe(163))}}catch(R){Ot(t,t.return,R)}if(e=t.sibling,e!==null){e.return=t.return,Te=e;break}Te=t.return}return v=jf,jf=!1,v}function Rl(e,t,n){var o=t.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var r=o=o.next;do{if((r.tag&e)===e){var i=r.destroy;r.destroy=void 0,i!==void 0&&gd(t,n,i)}r=r.next}while(r!==o)}}function js(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var o=n.create;n.destroy=o()}n=n.next}while(n!==t)}}function hd(e){var t=e.ref;if(t!==null){var n=e.stateNode;e.tag,e=n,typeof t=="function"?t(e):t.current=e}}function Lh(e){var t=e.alternate;t!==null&&(e.alternate=null,Lh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ro],delete t[Vl],delete t[nd],delete t[Jy],delete t[ew])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ph(e){return e.tag===5||e.tag===3||e.tag===4}function Hf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ph(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function _d(e,t,n){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=vs));else if(o!==4&&(e=e.child,e!==null))for(_d(e,t,n),e=e.sibling;e!==null;)_d(e,t,n),e=e.sibling}function vd(e,t,n){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(o!==4&&(e=e.child,e!==null))for(vd(e,t,n),e=e.sibling;e!==null;)vd(e,t,n),e=e.sibling}var nn=null,mo=!1;function Xo(e,t,n){for(n=n.child;n!==null;)Ih(e,t,n),n=n.sibling}function Ih(e,t,n){if(Eo&&typeof Eo.onCommitFiberUnmount=="function")try{Eo.onCommitFiberUnmount(Ps,n)}catch{}switch(n.tag){case 5:cn||ki(n,t);case 6:var o=nn,r=mo;nn=null,Xo(e,t,n),nn=o,mo=r,nn!==null&&(mo?(e=nn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):nn.removeChild(n.stateNode));break;case 18:nn!==null&&(mo?(e=nn,n=n.stateNode,e.nodeType===8?wc(e.parentNode,n):e.nodeType===1&&wc(e,n),Il(e)):wc(nn,n.stateNode));break;case 4:o=nn,r=mo,nn=n.stateNode.containerInfo,mo=!0,Xo(e,t,n),nn=o,mo=r;break;case 0:case 11:case 14:case 15:if(!cn&&(o=n.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){r=o=o.next;do{var i=r,l=i.destroy;i=i.tag,l!==void 0&&((i&2)!==0||(i&4)!==0)&&gd(n,t,l),r=r.next}while(r!==o)}Xo(e,t,n);break;case 1:if(!cn&&(ki(n,t),o=n.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=n.memoizedProps,o.state=n.memoizedState,o.componentWillUnmount()}catch(a){Ot(n,t,a)}Xo(e,t,n);break;case 21:Xo(e,t,n);break;case 22:n.mode&1?(cn=(o=cn)||n.memoizedState!==null,Xo(e,t,n),cn=o):Xo(e,t,n);break;default:Xo(e,t,n)}}function Uf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new hw),t.forEach(function(o){var r=xw.bind(null,e,o);n.has(o)||(n.add(o),o.then(r,r))})}}function co(e,t){var n=t.deletions;if(n!==null)for(var o=0;o<n.length;o++){var r=n[o];try{var i=e,l=t,a=l;e:for(;a!==null;){switch(a.tag){case 5:nn=a.stateNode,mo=!1;break e;case 3:nn=a.stateNode.containerInfo,mo=!0;break e;case 4:nn=a.stateNode.containerInfo,mo=!0;break e}a=a.return}if(nn===null)throw Error(fe(160));Ih(i,l,r),nn=null,mo=!1;var s=r.alternate;s!==null&&(s.return=null),r.return=null}catch(c){Ot(r,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Ah(t,e),t=t.sibling}function Ah(e,t){var n=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(co(t,e),No(e),o&4){try{Rl(3,e,e.return),js(3,e)}catch(h){Ot(e,e.return,h)}try{Rl(5,e,e.return)}catch(h){Ot(e,e.return,h)}}break;case 1:co(t,e),No(e),o&512&&n!==null&&ki(n,n.return);break;case 5:if(co(t,e),No(e),o&512&&n!==null&&ki(n,n.return),e.flags&32){var r=e.stateNode;try{Ml(r,"")}catch(h){Ot(e,e.return,h)}}if(o&4&&(r=e.stateNode,r!=null)){var i=e.memoizedProps,l=n!==null?n.memoizedProps:i,a=e.type,s=e.updateQueue;if(e.updateQueue=null,s!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&rg(r,i),jc(a,l);var c=jc(a,i);for(l=0;l<s.length;l+=2){var p=s[l],m=s[l+1];p==="style"?ug(r,m):p==="dangerouslySetInnerHTML"?ag(r,m):p==="children"?Ml(r,m):Nd(r,p,m,c)}switch(a){case"input":Oc(r,i);break;case"textarea":ig(r,i);break;case"select":var g=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!i.multiple;var d=i.value;d!=null?Ni(r,!!i.multiple,d,!1):g!==!!i.multiple&&(i.defaultValue!=null?Ni(r,!!i.multiple,i.defaultValue,!0):Ni(r,!!i.multiple,i.multiple?[]:"",!1))}r[Vl]=i}catch(h){Ot(e,e.return,h)}}break;case 6:if(co(t,e),No(e),o&4){if(e.stateNode===null)throw Error(fe(162));r=e.stateNode,i=e.memoizedProps;try{r.nodeValue=i}catch(h){Ot(e,e.return,h)}}break;case 3:if(co(t,e),No(e),o&4&&n!==null&&n.memoizedState.isDehydrated)try{Il(t.containerInfo)}catch(h){Ot(e,e.return,h)}break;case 4:co(t,e),No(e);break;case 13:co(t,e),No(e),r=e.child,r.flags&8192&&(i=r.memoizedState!==null,r.stateNode.isHidden=i,!i||r.alternate!==null&&r.alternate.memoizedState!==null||(rp=Bt())),o&4&&Uf(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(cn=(c=cn)||p,co(t,e),cn=c):co(t,e),No(e),o&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!p&&(e.mode&1)!==0)for(Te=e,p=e.child;p!==null;){for(m=Te=p;Te!==null;){switch(g=Te,d=g.child,g.tag){case 0:case 11:case 14:case 15:Rl(4,g,g.return);break;case 1:ki(g,g.return);var v=g.stateNode;if(typeof v.componentWillUnmount=="function"){o=g,n=g.return;try{t=o,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(h){Ot(o,n,h)}}break;case 5:ki(g,g.return);break;case 22:if(g.memoizedState!==null){Gf(m);continue}}d!==null?(d.return=g,Te=d):Gf(m)}p=p.sibling}e:for(p=null,m=e;;){if(m.tag===5){if(p===null){p=m;try{r=m.stateNode,c?(i=r.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=m.stateNode,s=m.memoizedProps.style,l=s!=null&&s.hasOwnProperty("display")?s.display:null,a.style.display=sg("display",l))}catch(h){Ot(e,e.return,h)}}}else if(m.tag===6){if(p===null)try{m.stateNode.nodeValue=c?"":m.memoizedProps}catch(h){Ot(e,e.return,h)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===e)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===e)break e;for(;m.sibling===null;){if(m.return===null||m.return===e)break e;p===m&&(p=null),m=m.return}p===m&&(p=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:co(t,e),No(e),o&4&&Uf(e);break;case 21:break;default:co(t,e),No(e)}}function No(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Ph(n)){var o=n;break e}n=n.return}throw Error(fe(160))}switch(o.tag){case 5:var r=o.stateNode;o.flags&32&&(Ml(r,""),o.flags&=-33);var i=Hf(e);vd(e,i,r);break;case 3:case 4:var l=o.stateNode.containerInfo,a=Hf(e);_d(e,a,l);break;default:throw Error(fe(161))}}catch(s){Ot(e,e.return,s)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vw(e,t,n){Te=e,Oh(e,t,n)}function Oh(e,t,n){for(var o=(e.mode&1)!==0;Te!==null;){var r=Te,i=r.child;if(r.tag===22&&o){var l=r.memoizedState!==null||Za;if(!l){var a=r.alternate,s=a!==null&&a.memoizedState!==null||cn;a=Za;var c=cn;if(Za=l,(cn=s)&&!c)for(Te=r;Te!==null;)l=Te,s=l.child,l.tag===22&&l.memoizedState!==null?qf(r):s!==null?(s.return=l,Te=s):qf(r);for(;i!==null;)Te=i,Oh(i,t,n),i=i.sibling;Te=r,Za=a,cn=c}Wf(e,t,n)}else(r.subtreeFlags&8772)!==0&&i!==null?(i.return=r,Te=i):Wf(e,t,n)}}function Wf(e){for(;Te!==null;){var t=Te;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:cn||js(5,t);break;case 1:var o=t.stateNode;if(t.flags&4&&!cn)if(n===null)o.componentDidMount();else{var r=t.elementType===t.type?n.memoizedProps:po(t.type,n.memoizedProps);o.componentDidUpdate(r,n.memoizedState,o.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Ff(t,i,o);break;case 3:var l=t.updateQueue;if(l!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Ff(t,l,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var s=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":s.autoFocus&&n.focus();break;case"img":s.src&&(n.src=s.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var p=c.memoizedState;if(p!==null){var m=p.dehydrated;m!==null&&Il(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(fe(163))}cn||t.flags&512&&hd(t)}catch(g){Ot(t,t.return,g)}}if(t===e){Te=null;break}if(n=t.sibling,n!==null){n.return=t.return,Te=n;break}Te=t.return}}function Gf(e){for(;Te!==null;){var t=Te;if(t===e){Te=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Te=n;break}Te=t.return}}function qf(e){for(;Te!==null;){var t=Te;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{js(4,t)}catch(s){Ot(t,n,s)}break;case 1:var o=t.stateNode;if(typeof o.componentDidMount=="function"){var r=t.return;try{o.componentDidMount()}catch(s){Ot(t,r,s)}}var i=t.return;try{hd(t)}catch(s){Ot(t,i,s)}break;case 5:var l=t.return;try{hd(t)}catch(s){Ot(t,l,s)}}}catch(s){Ot(t,t.return,s)}if(t===e){Te=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Te=a;break}Te=t.return}}var bw=Math.ceil,Fs=Go.ReactCurrentDispatcher,np=Go.ReactCurrentOwner,eo=Go.ReactCurrentBatchConfig,pt=0,Qt=null,Wt=null,on=0,zn=0,Si=fr(0),Kt=0,Gl=null,Hr=0,Hs=0,op=0,El=null,Nn=null,rp=0,Oi=1/0,Oo=null,Ds=!1,bd=null,sr=null,Ja=!1,nr=null,Ms=0,Fl=0,yd=null,as=-1,ss=0;function vn(){return(pt&6)!==0?Bt():as!==-1?as:as=Bt()}function ur(e){return(e.mode&1)===0?1:(pt&2)!==0&&on!==0?on&-on:nw.transition!==null?(ss===0&&(ss=wg()),ss):(e=ht,e!==0||(e=window.event,e=e===void 0?16:Eg(e.type)),e)}function ho(e,t,n,o){if(50<Fl)throw Fl=0,yd=null,Error(fe(185));ql(e,n,o),((pt&2)===0||e!==Qt)&&(e===Qt&&((pt&2)===0&&(Hs|=n),Kt===4&&er(e,on)),Fn(e,o),n===1&&pt===0&&(t.mode&1)===0&&(Oi=Bt()+500,zs&&gr()))}function Fn(e,t){var n=e.callbackNode;ry(e,t);var o=fs(e,e===Qt?on:0);if(o===0)n!==null&&ef(n),e.callbackNode=null,e.callbackPriority=0;else if(t=o&-o,e.callbackPriority!==t){if(n!=null&&ef(n),t===1)e.tag===0?tw(Kf.bind(null,e)):qg(Kf.bind(null,e)),Qy(function(){(pt&6)===0&&gr()}),n=null;else{switch(Cg(o)){case 1:n=Dd;break;case 4:n=bg;break;case 16:n=ms;break;case 536870912:n=yg;break;default:n=ms}n=Wh(n,$h.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function $h(e,t){if(as=-1,ss=0,(pt&6)!==0)throw Error(fe(327));var n=e.callbackNode;if(Di()&&e.callbackNode!==n)return null;var o=fs(e,e===Qt?on:0);if(o===0)return null;if((o&30)!==0||(o&e.expiredLanes)!==0||t)t=Ts(e,o);else{t=o;var r=pt;pt|=2;var i=Vh();(Qt!==e||on!==t)&&(Oo=null,Oi=Bt()+500,$r(e,t));do try{Cw();break}catch(a){zh(e,a)}while(!0);Hd(),Fs.current=i,pt=r,Wt!==null?t=0:(Qt=null,on=0,t=Kt)}if(t!==0){if(t===2&&(r=qc(e),r!==0&&(o=r,t=wd(e,r))),t===1)throw n=Gl,$r(e,0),er(e,o),Fn(e,Bt()),n;if(t===6)er(e,o);else{if(r=e.current.alternate,(o&30)===0&&!yw(r)&&(t=Ts(e,o),t===2&&(i=qc(e),i!==0&&(o=i,t=wd(e,i))),t===1))throw n=Gl,$r(e,0),er(e,o),Fn(e,Bt()),n;switch(e.finishedWork=r,e.finishedLanes=o,t){case 0:case 1:throw Error(fe(345));case 2:Pr(e,Nn,Oo);break;case 3:if(er(e,o),(o&130023424)===o&&(t=rp+500-Bt(),10<t)){if(fs(e,0)!==0)break;if(r=e.suspendedLanes,(r&o)!==o){vn(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=td(Pr.bind(null,e,Nn,Oo),t);break}Pr(e,Nn,Oo);break;case 4:if(er(e,o),(o&4194240)===o)break;for(t=e.eventTimes,r=-1;0<o;){var l=31-go(o);i=1<<l,l=t[l],l>r&&(r=l),o&=~i}if(o=r,o=Bt()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*bw(o/1960))-o,10<o){e.timeoutHandle=td(Pr.bind(null,e,Nn,Oo),o);break}Pr(e,Nn,Oo);break;case 5:Pr(e,Nn,Oo);break;default:throw Error(fe(329))}}}return Fn(e,Bt()),e.callbackNode===n?$h.bind(null,e):null}function wd(e,t){var n=El;return e.current.memoizedState.isDehydrated&&($r(e,t).flags|=256),e=Ts(e,t),e!==2&&(t=Nn,Nn=n,t!==null&&Cd(t)),e}function Cd(e){Nn===null?Nn=e:Nn.push.apply(Nn,e)}function yw(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var o=0;o<n.length;o++){var r=n[o],i=r.getSnapshot;r=r.value;try{if(!_o(i(),r))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function er(e,t){for(t&=~op,t&=~Hs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-go(t),o=1<<n;e[n]=-1,t&=~o}}function Kf(e){if((pt&6)!==0)throw Error(fe(327));Di();var t=fs(e,0);if((t&1)===0)return Fn(e,Bt()),null;var n=Ts(e,t);if(e.tag!==0&&n===2){var o=qc(e);o!==0&&(t=o,n=wd(e,o))}if(n===1)throw n=Gl,$r(e,0),er(e,t),Fn(e,Bt()),n;if(n===6)throw Error(fe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Pr(e,Nn,Oo),Fn(e,Bt()),null}function ip(e,t){var n=pt;pt|=1;try{return e(t)}finally{pt=n,pt===0&&(Oi=Bt()+500,zs&&gr())}}function Ur(e){nr!==null&&nr.tag===0&&(pt&6)===0&&Di();var t=pt;pt|=1;var n=eo.transition,o=ht;try{if(eo.transition=null,ht=1,e)return e()}finally{ht=o,eo.transition=n,pt=t,(pt&6)===0&&gr()}}function lp(){zn=Si.current,xt(Si)}function $r(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Xy(n)),Wt!==null)for(n=Wt.return;n!==null;){var o=n;switch(Vd(o),o.tag){case 1:o=o.type.childContextTypes,o!=null&&bs();break;case 3:Ii(),xt(Rn),xt(dn),Yd();break;case 5:Kd(o);break;case 4:Ii();break;case 13:xt(Tt);break;case 19:xt(Tt);break;case 10:Ud(o.type._context);break;case 22:case 23:lp()}n=n.return}if(Qt=e,Wt=e=cr(e.current,null),on=zn=t,Kt=0,Gl=null,op=Hs=Hr=0,Nn=El=null,Ar!==null){for(t=0;t<Ar.length;t++)if(n=Ar[t],o=n.interleaved,o!==null){n.interleaved=null;var r=o.next,i=n.pending;if(i!==null){var l=i.next;i.next=r,o.next=l}n.pending=o}Ar=null}return e}function zh(e,t){do{var n=Wt;try{if(Hd(),rs.current=Es,Rs){for(var o=Lt.memoizedState;o!==null;){var r=o.queue;r!==null&&(r.pending=null),o=o.next}Rs=!1}if(jr=0,Xt=qt=Lt=null,xl=!1,Hl=0,np.current=null,n===null||n.return===null){Kt=1,Gl=t,Wt=null;break}e:{var i=e,l=n.return,a=n,s=t;if(t=on,a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){var c=s,p=a,m=p.tag;if((p.mode&1)===0&&(m===0||m===11||m===15)){var g=p.alternate;g?(p.updateQueue=g.updateQueue,p.memoizedState=g.memoizedState,p.lanes=g.lanes):(p.updateQueue=null,p.memoizedState=null)}var d=If(l);if(d!==null){d.flags&=-257,Af(d,l,a,i,t),d.mode&1&&Pf(i,c,t),t=d,s=c;var v=t.updateQueue;if(v===null){var h=new Set;h.add(s),t.updateQueue=h}else v.add(s);break e}else{if((t&1)===0){Pf(i,c,t),ap();break e}s=Error(fe(426))}}else if(Ft&&a.mode&1){var y=If(l);if(y!==null){(y.flags&65536)===0&&(y.flags|=256),Af(y,l,a,i,t),Bd(Ai(s,a));break e}}i=s=Ai(s,a),Kt!==4&&(Kt=2),El===null?El=[i]:El.push(i),i=l;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var _=Ch(i,s,t);Ef(i,_);break e;case 1:a=s;var f=i.type,w=i.stateNode;if((i.flags&128)===0&&(typeof f.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(sr===null||!sr.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var R=kh(i,a,t);Ef(i,R);break e}}i=i.return}while(i!==null)}jh(n)}catch(P){t=P,Wt===n&&n!==null&&(Wt=n=n.return);continue}break}while(!0)}function Vh(){var e=Fs.current;return Fs.current=Es,e===null?Es:e}function ap(){(Kt===0||Kt===3||Kt===2)&&(Kt=4),Qt===null||(Hr&268435455)===0&&(Hs&268435455)===0||er(Qt,on)}function Ts(e,t){var n=pt;pt|=2;var o=Vh();(Qt!==e||on!==t)&&(Oo=null,$r(e,t));do try{ww();break}catch(r){zh(e,r)}while(!0);if(Hd(),pt=n,Fs.current=o,Wt!==null)throw Error(fe(261));return Qt=null,on=0,Kt}function ww(){for(;Wt!==null;)Bh(Wt)}function Cw(){for(;Wt!==null&&!Yb();)Bh(Wt)}function Bh(e){var t=Uh(e.alternate,e,zn);e.memoizedProps=e.pendingProps,t===null?jh(e):Wt=t,np.current=null}function jh(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=fw(n,t,zn),n!==null){Wt=n;return}}else{if(n=gw(n,t),n!==null){n.flags&=32767,Wt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Kt=6,Wt=null;return}}if(t=t.sibling,t!==null){Wt=t;return}Wt=t=e}while(t!==null);Kt===0&&(Kt=5)}function Pr(e,t,n){var o=ht,r=eo.transition;try{eo.transition=null,ht=1,kw(e,t,n,o)}finally{eo.transition=r,ht=o}return null}function kw(e,t,n,o){do Di();while(nr!==null);if((pt&6)!==0)throw Error(fe(327));n=e.finishedWork;var r=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(fe(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(iy(e,i),e===Qt&&(Wt=Qt=null,on=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Ja||(Ja=!0,Wh(ms,function(){return Di(),null})),i=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||i){i=eo.transition,eo.transition=null;var l=ht;ht=1;var a=pt;pt|=4,np.current=null,_w(e,n),Ah(n,e),Wy(Jc),gs=!!Zc,Jc=Zc=null,e.current=n,vw(n,e,r),Xb(),pt=a,ht=l,eo.transition=i}else e.current=n;if(Ja&&(Ja=!1,nr=e,Ms=r),i=e.pendingLanes,i===0&&(sr=null),Jb(n.stateNode,o),Fn(e,Bt()),t!==null)for(o=e.onRecoverableError,n=0;n<t.length;n++)r=t[n],o(r.value,{componentStack:r.stack,digest:r.digest});if(Ds)throw Ds=!1,e=bd,bd=null,e;return(Ms&1)!==0&&e.tag!==0&&Di(),i=e.pendingLanes,(i&1)!==0?e===yd?Fl++:(Fl=0,yd=e):Fl=0,gr(),null}function Di(){if(nr!==null){var e=Cg(Ms),t=eo.transition,n=ht;try{if(eo.transition=null,ht=16>e?16:e,nr===null)var o=!1;else{if(e=nr,nr=null,Ms=0,(pt&6)!==0)throw Error(fe(331));var r=pt;for(pt|=4,Te=e.current;Te!==null;){var i=Te,l=i.child;if((Te.flags&16)!==0){var a=i.deletions;if(a!==null){for(var s=0;s<a.length;s++){var c=a[s];for(Te=c;Te!==null;){var p=Te;switch(p.tag){case 0:case 11:case 15:Rl(8,p,i)}var m=p.child;if(m!==null)m.return=p,Te=m;else for(;Te!==null;){p=Te;var g=p.sibling,d=p.return;if(Lh(p),p===c){Te=null;break}if(g!==null){g.return=d,Te=g;break}Te=d}}}var v=i.alternate;if(v!==null){var h=v.child;if(h!==null){v.child=null;do{var y=h.sibling;h.sibling=null,h=y}while(h!==null)}}Te=i}}if((i.subtreeFlags&2064)!==0&&l!==null)l.return=i,Te=l;else e:for(;Te!==null;){if(i=Te,(i.flags&2048)!==0)switch(i.tag){case 0:case 11:case 15:Rl(9,i,i.return)}var _=i.sibling;if(_!==null){_.return=i.return,Te=_;break e}Te=i.return}}var f=e.current;for(Te=f;Te!==null;){l=Te;var w=l.child;if((l.subtreeFlags&2064)!==0&&w!==null)w.return=l,Te=w;else e:for(l=f;Te!==null;){if(a=Te,(a.flags&2048)!==0)try{switch(a.tag){case 0:case 11:case 15:js(9,a)}}catch(P){Ot(a,a.return,P)}if(a===l){Te=null;break e}var R=a.sibling;if(R!==null){R.return=a.return,Te=R;break e}Te=a.return}}if(pt=r,gr(),Eo&&typeof Eo.onPostCommitFiberRoot=="function")try{Eo.onPostCommitFiberRoot(Ps,e)}catch{}o=!0}return o}finally{ht=n,eo.transition=t}}return!1}function Yf(e,t,n){t=Ai(n,t),t=Ch(e,t,1),e=ar(e,t,1),t=vn(),e!==null&&(ql(e,1,t),Fn(e,t))}function Ot(e,t,n){if(e.tag===3)Yf(e,e,n);else for(;t!==null;){if(t.tag===3){Yf(t,e,n);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(sr===null||!sr.has(o))){e=Ai(n,e),e=kh(t,e,1),t=ar(t,e,1),e=vn(),t!==null&&(ql(t,1,e),Fn(t,e));break}}t=t.return}}function Sw(e,t,n){var o=e.pingCache;o!==null&&o.delete(t),t=vn(),e.pingedLanes|=e.suspendedLanes&n,Qt===e&&(on&n)===n&&(Kt===4||Kt===3&&(on&130023424)===on&&500>Bt()-rp?$r(e,0):op|=n),Fn(e,t)}function Hh(e,t){t===0&&((e.mode&1)===0?t=1:(t=za,za<<=1,(za&130023424)===0&&(za=4194304)));var n=vn();e=Uo(e,t),e!==null&&(ql(e,t,n),Fn(e,n))}function Nw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Hh(e,n)}function xw(e,t){var n=0;switch(e.tag){case 13:var o=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(fe(314))}o!==null&&o.delete(t),Hh(e,n)}var Uh;Uh=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Rn.current)xn=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return xn=!1,mw(e,t,n);xn=(e.flags&131072)!==0}else xn=!1,Ft&&(t.flags&1048576)!==0&&Kg(t,Cs,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;ls(e,t),e=t.pendingProps;var r=Ti(t,dn.current);Fi(t,n),r=Qd(null,t,o,e,r,n);var i=Zd();return t.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,En(o)?(i=!0,ys(t)):i=!1,t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Gd(t),r.updater=Bs,t.stateNode=r,r._reactInternals=t,sd(t,o,e,n),t=dd(null,t,o,!0,i,n)):(t.tag=0,Ft&&i&&zd(t),_n(null,t,r,n),t=t.child),t;case 16:o=t.elementType;e:{switch(ls(e,t),e=t.pendingProps,r=o._init,o=r(o._payload),t.type=o,r=t.tag=Ew(o),e=po(o,e),r){case 0:t=cd(null,t,o,e,n);break e;case 1:t=zf(null,t,o,e,n);break e;case 11:t=Of(null,t,o,e,n);break e;case 14:t=$f(null,t,o,po(o.type,e),n);break e}throw Error(fe(306,o,""))}return t;case 0:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:po(o,r),cd(e,t,o,r,n);case 1:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:po(o,r),zf(e,t,o,r,n);case 3:e:{if(Rh(t),e===null)throw Error(fe(387));o=t.pendingProps,i=t.memoizedState,r=i.element,eh(e,t),Ns(t,o,null,n);var l=t.memoizedState;if(o=l.element,i.isDehydrated)if(i={element:o,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){r=Ai(Error(fe(423)),t),t=Vf(e,t,o,n,r);break e}else if(o!==r){r=Ai(Error(fe(424)),t),t=Vf(e,t,o,n,r);break e}else for(Vn=lr(t.stateNode.containerInfo.firstChild),Bn=t,Ft=!0,fo=null,n=Zg(t,null,o,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Li(),o===r){t=Wo(e,t,n);break e}_n(e,t,o,n)}t=t.child}return t;case 5:return th(t),e===null&&id(t),o=t.type,r=t.pendingProps,i=e!==null?e.memoizedProps:null,l=r.children,ed(o,r)?l=null:i!==null&&ed(o,i)&&(t.flags|=32),xh(e,t),_n(e,t,l,n),t.child;case 6:return e===null&&id(t),null;case 13:return Eh(e,t,n);case 4:return qd(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=Pi(t,null,o,n):_n(e,t,o,n),t.child;case 11:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:po(o,r),Of(e,t,o,r,n);case 7:return _n(e,t,t.pendingProps,n),t.child;case 8:return _n(e,t,t.pendingProps.children,n),t.child;case 12:return _n(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(o=t.type._context,r=t.pendingProps,i=t.memoizedProps,l=r.value,Ct(ks,o._currentValue),o._currentValue=l,i!==null)if(_o(i.value,l)){if(i.children===r.children&&!Rn.current){t=Wo(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){l=i.child;for(var s=a.firstContext;s!==null;){if(s.context===o){if(i.tag===1){s=Bo(-1,n&-n),s.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var p=c.pending;p===null?s.next=s:(s.next=p.next,p.next=s),c.pending=s}}i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),ld(i.return,n,t),a.lanes|=n;break}s=s.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(fe(341));l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),ld(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}_n(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,o=t.pendingProps.children,Fi(t,n),r=to(r),o=o(r),t.flags|=1,_n(e,t,o,n),t.child;case 14:return o=t.type,r=po(o,t.pendingProps),r=po(o.type,r),$f(e,t,o,r,n);case 15:return Sh(e,t,t.type,t.pendingProps,n);case 17:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:po(o,r),ls(e,t),t.tag=1,En(o)?(e=!0,ys(t)):e=!1,Fi(t,n),wh(t,o,r),sd(t,o,r,n),dd(null,t,o,!0,e,n);case 19:return Fh(e,t,n);case 22:return Nh(e,t,n)}throw Error(fe(156,t.tag))};function Wh(e,t){return vg(e,t)}function Rw(e,t,n,o){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jn(e,t,n,o){return new Rw(e,t,n,o)}function sp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ew(e){if(typeof e=="function")return sp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Rd)return 11;if(e===Ed)return 14}return 2}function cr(e,t){var n=e.alternate;return n===null?(n=Jn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function us(e,t,n,o,r,i){var l=2;if(o=e,typeof e=="function")sp(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case fi:return zr(n.children,r,i,t);case xd:l=8,r|=8;break;case Tc:return e=Jn(12,n,t,r|2),e.elementType=Tc,e.lanes=i,e;case Lc:return e=Jn(13,n,t,r),e.elementType=Lc,e.lanes=i,e;case Pc:return e=Jn(19,n,t,r),e.elementType=Pc,e.lanes=i,e;case tg:return Us(n,r,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Jf:l=10;break e;case eg:l=9;break e;case Rd:l=11;break e;case Ed:l=14;break e;case Qo:l=16,o=null;break e}throw Error(fe(130,e==null?e:typeof e,""))}return t=Jn(l,n,t,r),t.elementType=e,t.type=o,t.lanes=i,t}function zr(e,t,n,o){return e=Jn(7,e,o,t),e.lanes=n,e}function Us(e,t,n,o){return e=Jn(22,e,o,t),e.elementType=tg,e.lanes=n,e.stateNode={isHidden:!1},e}function Fc(e,t,n){return e=Jn(6,e,null,t),e.lanes=n,e}function Dc(e,t,n){return t=Jn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fw(e,t,n,o,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mc(0),this.expirationTimes=mc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mc(0),this.identifierPrefix=o,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function up(e,t,n,o,r,i,l,a,s){return e=new Fw(e,t,n,a,s),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Jn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:o,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Gd(i),e}function Dw(e,t,n){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:mi,key:o==null?null:""+o,children:e,containerInfo:t,implementation:n}}function Gh(e){if(!e)return pr;e=e._reactInternals;e:{if(Gr(e)!==e||e.tag!==1)throw Error(fe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(En(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(fe(171))}if(e.tag===1){var n=e.type;if(En(n))return Gg(e,n,t)}return t}function qh(e,t,n,o,r,i,l,a,s){return e=up(n,o,!0,e,r,i,l,a,s),e.context=Gh(null),n=e.current,o=vn(),r=ur(n),i=Bo(o,r),i.callback=t??null,ar(n,i,r),e.current.lanes=r,ql(e,r,o),Fn(e,o),e}function Ws(e,t,n,o){var r=t.current,i=vn(),l=ur(r);return n=Gh(n),t.context===null?t.context=n:t.pendingContext=n,t=Bo(i,l),t.payload={element:e},o=o===void 0?null:o,o!==null&&(t.callback=o),e=ar(r,t,l),e!==null&&(ho(e,r,l,i),os(e,r,l)),l}function Ls(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Xf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function cp(e,t){Xf(e,t),(e=e.alternate)&&Xf(e,t)}function Mw(){return null}var Kh=typeof reportError=="function"?reportError:function(e){console.error(e)};function dp(e){this._internalRoot=e}Gs.prototype.render=dp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(fe(409));Ws(e,t,null,null)};Gs.prototype.unmount=dp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ur(function(){Ws(null,e,null,null)}),t[Ho]=null}};function Gs(e){this._internalRoot=e}Gs.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ng();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Jo.length&&t!==0&&t<Jo[n].priority;n++);Jo.splice(n,0,e),n===0&&Rg(e)}};function pp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function qs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Qf(){}function Tw(e,t,n,o,r){if(r){if(typeof o=="function"){var i=o;o=function(){var c=Ls(l);i.call(c)}}var l=qh(t,o,e,0,null,!1,!1,"",Qf);return e._reactRootContainer=l,e[Ho]=l.current,$l(e.nodeType===8?e.parentNode:e),Ur(),l}for(;r=e.lastChild;)e.removeChild(r);if(typeof o=="function"){var a=o;o=function(){var c=Ls(s);a.call(c)}}var s=up(e,0,!1,null,null,!1,!1,"",Qf);return e._reactRootContainer=s,e[Ho]=s.current,$l(e.nodeType===8?e.parentNode:e),Ur(function(){Ws(t,s,n,o)}),s}function Ks(e,t,n,o,r){var i=n._reactRootContainer;if(i){var l=i;if(typeof r=="function"){var a=r;r=function(){var s=Ls(l);a.call(s)}}Ws(t,l,e,r)}else l=Tw(n,t,e,r,o);return Ls(l)}kg=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=bl(t.pendingLanes);n!==0&&(Md(t,n|1),Fn(t,Bt()),(pt&6)===0&&(Oi=Bt()+500,gr()))}break;case 13:Ur(function(){var o=Uo(e,1);if(o!==null){var r=vn();ho(o,e,1,r)}}),cp(e,1)}};Td=function(e){if(e.tag===13){var t=Uo(e,134217728);if(t!==null){var n=vn();ho(t,e,134217728,n)}cp(e,134217728)}};Sg=function(e){if(e.tag===13){var t=ur(e),n=Uo(e,t);if(n!==null){var o=vn();ho(n,e,t,o)}cp(e,t)}};Ng=function(){return ht};xg=function(e,t){var n=ht;try{return ht=e,t()}finally{ht=n}};Uc=function(e,t,n){switch(t){case"input":if(Oc(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var o=n[t];if(o!==e&&o.form===e.form){var r=$s(o);if(!r)throw Error(fe(90));og(o),Oc(o,r)}}}break;case"textarea":ig(e,n);break;case"select":t=n.value,t!=null&&Ni(e,!!n.multiple,t,!1)}};pg=ip;mg=Ur;var Lw={usingClientEntryPoint:!1,Events:[Yl,vi,$s,cg,dg,ip]},gl={findFiberByHostInstance:Ir,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Pw={bundleType:gl.bundleType,version:gl.version,rendererPackageName:gl.rendererPackageName,rendererConfig:gl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Go.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=hg(e),e===null?null:e.stateNode},findFiberByHostInstance:gl.findFiberByHostInstance||Mw,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(hl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!hl.isDisabled&&hl.supportsFiber))try{Ps=hl.inject(Pw),Eo=hl}catch{}var hl;Un.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Lw;Un.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!pp(t))throw Error(fe(200));return Dw(e,t,null,n)};Un.createRoot=function(e,t){if(!pp(e))throw Error(fe(299));var n=!1,o="",r=Kh;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=up(e,1,!1,null,null,n,!1,o,r),e[Ho]=t.current,$l(e.nodeType===8?e.parentNode:e),new dp(t)};Un.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(fe(188)):(e=Object.keys(e).join(","),Error(fe(268,e)));return e=hg(t),e=e===null?null:e.stateNode,e};Un.flushSync=function(e){return Ur(e)};Un.hydrate=function(e,t,n){if(!qs(t))throw Error(fe(200));return Ks(null,e,t,!0,n)};Un.hydrateRoot=function(e,t,n){if(!pp(e))throw Error(fe(405));var o=n!=null&&n.hydratedSources||null,r=!1,i="",l=Kh;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),t=qh(t,null,e,1,n??null,r,!1,i,l),e[Ho]=t.current,$l(e),o)for(e=0;e<o.length;e++)n=o[e],r=n._getVersion,r=r(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,r]:t.mutableSourceEagerHydrationData.push(n,r);return new Gs(t)};Un.render=function(e,t,n){if(!qs(t))throw Error(fe(200));return Ks(null,e,t,!1,n)};Un.unmountComponentAtNode=function(e){if(!qs(e))throw Error(fe(40));return e._reactRootContainer?(Ur(function(){Ks(null,null,e,!1,function(){e._reactRootContainer=null,e[Ho]=null})}),!0):!1};Un.unstable_batchedUpdates=ip;Un.unstable_renderSubtreeIntoContainer=function(e,t,n,o){if(!qs(n))throw Error(fe(200));if(e==null||e._reactInternals===void 0)throw Error(fe(38));return Ks(e,t,n,!1,o)};Un.version="18.3.1-next-f1338f8080-20240426"});var vo=Ao((QS,Qh)=>{"use strict";function Xh(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Xh)}catch(e){console.error(e)}}Xh(),Qh.exports=Yh()});var fp=Ao(mp=>{"use strict";var Zh=vo();mp.createRoot=Zh.createRoot,mp.hydrateRoot=Zh.hydrateRoot;var ZS});var uv=Ao(_u=>{"use strict";var lk=yt(),ak=Symbol.for("react.element"),sk=Symbol.for("react.fragment"),uk=Object.prototype.hasOwnProperty,ck=lk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,dk={key:!0,ref:!0,__self:!0,__source:!0};function sv(e,t,n){var o,r={},i=null,l=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(l=t.ref);for(o in t)uk.call(t,o)&&!dk.hasOwnProperty(o)&&(r[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps,t)r[o]===void 0&&(r[o]=t[o]);return{$$typeof:ak,type:e,key:i,ref:l,props:r,_owner:ck.current}}_u.Fragment=sk;_u.jsx=sv;_u.jsxs=sv});var Rt=Ao((IN,cv)=>{"use strict";cv.exports=uv()});var FS={};sb(FS,{default:()=>Lu});module.exports=ub(FS);var Ji=require("obsidian");var bm=require("obsidian");var cb={view_table:"Table",view_list:"List",view_board:"Board",view_gallery:"Gallery",view_calendar:"Calendar",view_timeline:"Timeline",view_chart:"Chart",add_view:"Add view",remove_view:"Remove view",rename_view_hint:"Double-click to rename",fields:"Fields",filter:"Filter",filters:"Filters",sort:"Sort",actions:"Actions",group_by:"Group by",cover:"Cover",date_field:"Date",start_field:"Start",end_field:"End",group_field:"Group",fields_in_card:"Fields in card",fields_label:"Fields",fields_on_bars:"Fields on bars",filter_by:"Filter by",sort_by:"Sort by",group_by_label:"Group by",date_field_label:"Date field",cover_field_label:"Cover field",card_size_label:"Card size",row_height_label:"Row height",none_value:"None",no_value:"No value",no_cover:"None",size_small:"Small",size_medium:"Medium",size_large:"Large",height_compact:"Compact",height_medium:"Medium",height_tall:"Tall",add_filter_advanced:"Add advanced filter",add_sort:"Add sort",no_active_sorts:"No active sorts",name_column:"Name",conjunction_and:"AND",conjunction_or:"OR",filter_number_placeholder:"Number...",filter_value_placeholder:"Value...",delete_selected:"Delete all selected",move_selected:"Move all selected",duplicate_selected:"Duplicate all selected",export_csv:"Export CSV",import_csv:"Import CSV",open_note:"Open note",delete_note:"Delete note",duplicate_note:"Duplicate note",sort_asc:"Ascending",sort_desc:"Descending",sort_asc_title:"Sort descending",sort_desc_title:"Remove sort",sort_none_title:"Sort ascending",rename_column:"Rename",edit_formula:"Edit formula",configure_lookup:"Configure lookup",configure_relation:"Configure relation",format_number:"Format number",configure_image_folder:"Configure image folder",field_type_label:"Field type",hide_field:"Hide field",delete_field:"Delete field",type_title:"Title",type_text:"Text",type_number:"Number",type_select:"Select",type_multiselect:"Multi-select",type_date:"Date",type_checkbox:"Checkbox",type_url:"URL",type_email:"Email",type_phone:"Phone",type_status:"Status",type_formula:"Formula",type_relation:"Relation",type_lookup:"Lookup",type_rollup:"Rollup",rollup_panel_title:"Rollup",configure_rollup:"Configure rollup",rollup_select_relation:"1. Relation column",rollup_select_relation_placeholder:"Select relation...",rollup_select_target:"2. Target column",rollup_select_target_placeholder:"Select column...",rollup_select_function:"3. Aggregation",rollup_no_relations:"No relation columns found. Add a relation column first.",rollup_fn_sum:"Sum",rollup_fn_count:"Count",rollup_fn_avg:"Average",rollup_fn_min:"Min",rollup_fn_max:"Max",rollup_fn_count_values:"Count unique",rollup_fn_list:"List all",type_image:"Image",type_audio:"Audio",audio_path_placeholder:"Path to audio file...",audio_select_placeholder:"Select audio...",audio_picker_title:"Select audio",audio_picker_clear:"Clear",audio_picker_empty_folder:"No audio files in folder",audio_picker_empty_vault:"No audio files in vault",audio_panel_title:"Audio settings",audio_folder_label:"Source folder (leave empty for entire vault)",audio_folder_placeholder:"Ex: audio/music",configure_audio_folder:"Configure audio folder",type_video:"Video",video_select_placeholder:"Select video...",video_picker_clear:"Clear",video_picker_empty_folder:"No video files in folder",video_picker_empty_vault:"No video files in vault",video_panel_title:"Video settings",video_folder_label:"Source folder (leave empty for entire vault)",video_folder_placeholder:"Ex: video/clips",configure_video_folder:"Configure video folder",formula_panel_title:"Formula",formula_placeholder:'Example: if(status = "done", 1, 0)',formula_valid:"Valid syntax",formula_available_cols:"Available columns:",formula_ref_toggle:"Function reference",formula_save:"Save",formula_cancel:"Cancel",formula_save_hint:"Save (Ctrl+Enter)",formula_group_logic:"Logic",formula_group_comparators:"Comparators",formula_group_aggregators:"Aggregators",formula_group_text:"Text",formula_group_math:"Math",formula_group_utils:"Utilities",number_format_title:"Format",number_decimals_label:"Decimal places",number_thousands_label:"Thousands separator",number_prefix_label:"Prefix",number_suffix_label:"Suffix",number_prefix_placeholder:"Ex: $, \u20AC",number_suffix_placeholder:"Ex: %, kg, km",number_remove_format:"Remove formatting",relation_panel_title:"Relation",lookup_panel_title:"Lookup",lookup_ref_table:"1. Reference table",lookup_select_table:"Select table...",lookup_col_to_display:"2. Column to display",lookup_origin_col:"2. Source field for values",lookup_select_col:"Select column...",lookup_file_name:"File name",lookup_join_col:"3. Join column (this table)",lookup_join_col_title:"File name (join by title)",lookup_select_join_col:"Select column...",lookup_hint:"The value of this column must match the file name in the referenced table",image_panel_title:"Image",image_folder_label:"Source folder (optional)",image_folder_placeholder:"Ex: images/covers",image_picker_title:"Select image",image_picker_clear:"Clear",image_picker_empty_vault:"No images found in vault",image_picker_empty_folder:"No images found in",image_select_placeholder:"Select image\u2026",agg_none:"None",agg_count:"Count",agg_count_values:"Count values",agg_sum:"Sum",agg_avg:"Average",agg_min:"Min",agg_max:"Max",no_database_open:"No database open.",no_database_hint:'Use the ribbon button or the "create new database" command.',loading:"Loading...",no_results:"No items found",item_singular:"Item",item_plural:"Items",row_singular:"Row",row_plural:"Rows",record_singular:"Record",record_plural:"Records",add_row:"New row",add_entry:"New entry",add_card:"New card",new_field:"New field",add_field:"Add field",board_no_select_col:"The board requires a select or status column to group cards.",board_add_select_hint:"Add a column of that type in the table view and come back here.",board_drag_reorder:"Drag to reorder",board_set_limit:"Click to set card limit",board_limit_placeholder:"Limit (0 = none)",board_show_more:"More",board_show_less:"Show less",hide_empty_cols:"Hide empty",hide_no_value_cols:"Hide no-value",calendar_no_date_field:"Select a date field in the toolbar to show the calendar.",calendar_no_date_section:"No date",calendar_click_to_create:"Click to create note",calendar_today:"Today",calendar_prev_month:"Previous month",calendar_next_month:"Next month",calendar_view_month:"Month",calendar_view_week:"Week",calendar_prev_week:"Previous week",calendar_next_week:"Next week",calendar_add_time:"Add time",calendar_remove_time:"Remove time",calendar_all_day:"All day",day_sun:"Sun",day_mon:"Mon",day_tue:"Tue",day_wed:"Wed",day_thu:"Thu",day_fri:"Fri",day_sat:"Sat",month_january:"January",month_february:"February",month_march:"March",month_april:"April",month_may:"May",month_june:"June",month_july:"July",month_august:"August",month_september:"September",month_october:"October",month_november:"November",month_december:"December",timeline_no_start_field:"Select a start field in the toolbar to show the timeline.",timeline_no_interval:"No interval",timeline_scroll_prev:"Scroll back",timeline_scroll_next:"Scroll forward",zoom_days:"Days",zoom_weeks:"Weeks",zoom_months:"Months",month_short_jan:"Jan",month_short_feb:"Feb",month_short_mar:"Mar",month_short_apr:"Apr",month_short_may:"May",month_short_jun:"Jun",month_short_jul:"Jul",month_short_aug:"Aug",month_short_sep:"Sep",month_short_oct:"Oct",month_short_nov:"Nov",month_short_dec:"Dec",hierarchy_toggle:"Use as hierarchy",hierarchy_toggle_hint:"Enables parent-child relationships between rows in this database",add_subrow:"Add sub-row",collapse_all:"Collapse all",expand_all:"Expand all",max_depth_reached:"Maximum depth reached (3 levels)",chart_configure:"Configure",chart_type:"Chart type",chart_type_bar:"Bar",chart_type_line:"Line",chart_type_pie:"Pie",chart_x_axis:"Categories (X axis)",chart_y_axis:"Values (y axis)",chart_aggregation:"Aggregation",chart_select_column:"Select column...",chart_count_records:"Count",chart_no_config:"Configure the chart to get started.",chart_no_config_hint:"Select a column for categories in the toolbar above.",tooltip_pin_column:"Pin columns up to here",tooltip_unpin_column:"Unpin columns",tooltip_resize_column:"Drag to resize; double-click to fit content",tooltip_wrap_text:"Wrap text",tooltip_include_subfolders:"Include subfolders",folder_column:"Folder",tooltip_manage_fields:"Manage fields",tooltip_batch_actions:"Batch actions",tooltip_remove_filter:"Remove filter",tooltip_close:"Close",tooltip_remove:"Remove",tooltip_move_up:"Move up",tooltip_move_down:"Move down",tooltip_change_color:"Change color",tooltip_delete_status:"Delete status",status_not_started:"Not started",status_in_progress:"In progress",status_done:"Done",status_cancelled:"Cancelled",relation_search_placeholder:"Search...",relation_clear:"Clear",relation_no_results:"No results",relation_two_way:"Two-way relation",relation_two_way_hint:"Automatically creates a reverse relation in the target database",select_clear:"Clear",select_create_placeholder:"Create new option...",status_new_placeholder:"New status...",color_custom:"Custom",validate_non_numeric:'Cell(s) contain non-numeric values (e.g.: "',validate_invalid_dates:'Cell(s) contain values that are not valid dates (e.g.: "',validate_invalid_checkbox:'Cell(s) contain values incompatible with checkbox (e.g.: "',validate_multiselect_to_select:"Row(s) have multiple values selected. Remove extras before changing to single select.",validate_invalid_email:'Cell(s) contain values that are not valid emails (e.g.: "',validate_invalid_url:'Cell(s) contain values that are not valid URLs (e.g.: "',validate_invalid_phone:'Cell(s) contain values that are not valid phone numbers (e.g.: "',validate_type_change_prefix:"Cannot change type: ",email_invalid:"Invalid email",op_is:"Is",op_is_not:"Is not",op_contains:"Contains",op_not_contains:"Does not contain",op_starts_with:"Starts with",op_ends_with:"Ends with",op_is_empty:"Is empty",op_is_not_empty:"Is not empty",op_gt:">",op_gte:">=",op_lt:"<",op_lte:"<=",op_is_checked:"Is checked",op_is_unchecked:"Is unchecked",settings_db_filename_name:"Database file name",settings_db_filename_desc:"Name of the special file that identifies a database in a folder.",settings_row_height_name:"Default row height",settings_row_height_desc:"Height in pixels of each table row.",settings_inline_fields_name:"Read dataview inline fields",settings_inline_fields_desc:"Parse key:: value fields from note body and display as column values (read-only)",db_untitled_note:"Untitled",db_copy_suffix:"(copy)",db_copy_suffix_n:"(copy $n)",db_already_exists:'A database already exists in "$folder"',db_tip_body:"This file is a database. Open it to see the table view.",formula_err_unclosed_string:"Unclosed string at position $pos",formula_err_unclosed_bracket:"Unclosed bracket at position $pos",formula_err_unexpected_bang:"Unexpected character '!' at position $pos",formula_err_unexpected_char:"Unexpected character '$char' at position $pos",formula_err_expected_token:"Expected $expected, found '$found' at position $pos",formula_err_unexpected_token:"Unexpected token '$token' at position $pos",formula_err_circular_ref:'Circular reference: "$name" is a formula column',formula_err_unknown_fn:"Unknown function: $fn()",formula_err_if_args:"Expected if(condition, if_true, [if_false])",formula_err_avg_args:"Expected avg(column) \u2014 requires a column reference as argument",formula_err_count_args:"Expected count(column) \u2014 requires a column reference as argument",formula_err_mid_args:"Expected mid(text, start, length)",formula_err_mod_args:"Expected mod(number, divisor)",formula_err_sqrt_args:"Expected sqrt(number)",formula_err_not_implemented:"Function not implemented: $fn()",plugin_display_name:"Notion bases",no_databases_found:'No databases found. Use the "create new database" command to create one.',cmd_open_database:"Open database for this folder",cmd_create_database:"Create new database in current folder",cmd_quick_add:"Quick add row to database",quick_add_title:"Quick add",quick_add_note_title:"Title",quick_add_note_title_placeholder:"Note title...",quick_add_create:"Create",quick_add_create_and_open:"Create and open",quick_add_no_visible_fields:"No editable fields in this database",picker_placeholder:"Select database...",picker_root:"/ (root)",view_fallback_name:"Database"},Gu=cb;var db={view_table:"Tabela",view_list:"Lista",view_board:"Board",view_gallery:"Galeria",view_calendar:"Calend\xE1rio",view_timeline:"Timeline",view_chart:"Gr\xE1fico",add_view:"Adicionar view",remove_view:"Remover view",rename_view_hint:"Duplo clique para renomear",fields:"Campos",filter:"Filtro",filters:"Filtros",sort:"Ordenar",actions:"A\xE7\xF5es",group_by:"Agrupar por",cover:"Capa",date_field:"Data",start_field:"In\xEDcio",end_field:"Fim",group_field:"Agrupar",fields_in_card:"Campos no card",fields_label:"Campos",fields_on_bars:"Campos nas barras",filter_by:"Filtrar por",sort_by:"Ordenar por",group_by_label:"Agrupar por",date_field_label:"Campo de data",cover_field_label:"Campo de capa",card_size_label:"Tamanho dos cards",row_height_label:"Altura das linhas",none_value:"Nenhum",no_value:"Sem valor",no_cover:"Nenhuma",size_small:"Pequeno",size_medium:"M\xE9dio",size_large:"Grande",height_compact:"Compacto",height_medium:"M\xE9dio",height_tall:"Alto",add_filter_advanced:"Adicionar filtro avan\xE7ado",add_sort:"Adicionar ordena\xE7\xE3o",no_active_sorts:"Nenhuma ordena\xE7\xE3o ativa",name_column:"Nome",conjunction_and:"E",conjunction_or:"OU",filter_number_placeholder:"N\xFAmero...",filter_value_placeholder:"Valor...",delete_selected:"Apagar todos selecionados",move_selected:"Mover todos selecionados",duplicate_selected:"Duplicar todos selecionados",export_csv:"Exportar CSV",import_csv:"Importar CSV",open_note:"Abrir nota",delete_note:"Excluir nota",duplicate_note:"Duplicar nota",sort_asc:"Ascendente",sort_desc:"Descendente",sort_asc_title:"Ordenar descendente",sort_desc_title:"Remover ordena\xE7\xE3o",sort_none_title:"Ordenar ascendente",rename_column:"Renomear",edit_formula:"Editar f\xF3rmula",configure_lookup:"Configurar lookup",configure_relation:"Configurar rela\xE7\xE3o",format_number:"Formatar n\xFAmero",configure_image_folder:"Configurar pasta de imagens",field_type_label:"Tipo de campo",hide_field:"Ocultar campo",delete_field:"Excluir campo",type_title:"T\xEDtulo",type_text:"Texto",type_number:"N\xFAmero",type_select:"Sele\xE7\xE3o",type_multiselect:"Multi-sele\xE7\xE3o",type_date:"Data",type_checkbox:"Checkbox",type_url:"URL",type_email:"Email",type_phone:"Telefone",type_status:"Status",type_formula:"F\xF3rmula",type_relation:"Rela\xE7\xE3o",type_lookup:"Lookup",type_rollup:"Rollup",rollup_panel_title:"Rollup",configure_rollup:"Configurar rollup",rollup_select_relation:"1. Coluna de rela\xE7\xE3o",rollup_select_relation_placeholder:"Selecionar rela\xE7\xE3o...",rollup_select_target:"2. Coluna de destino",rollup_select_target_placeholder:"Selecionar coluna...",rollup_select_function:"3. Agrega\xE7\xE3o",rollup_no_relations:"Nenhuma coluna de rela\xE7\xE3o encontrada. Adicione uma coluna de rela\xE7\xE3o primeiro.",rollup_fn_sum:"Soma",rollup_fn_count:"Contar",rollup_fn_avg:"M\xE9dia",rollup_fn_min:"M\xEDn",rollup_fn_max:"M\xE1x",rollup_fn_count_values:"Contar \xFAnicos",rollup_fn_list:"Listar tudo",type_image:"Imagem",type_audio:"\xC1udio",audio_path_placeholder:"Caminho para o arquivo de \xE1udio...",audio_select_placeholder:"Selecionar \xE1udio...",audio_picker_title:"Selecionar \xE1udio",audio_picker_clear:"Limpar",audio_picker_empty_folder:"Nenhum arquivo de \xE1udio na pasta",audio_picker_empty_vault:"Nenhum arquivo de \xE1udio no vault",audio_panel_title:"Configura\xE7\xF5es de \xE1udio",audio_folder_label:"Pasta de origem (deixe vazio para o vault inteiro)",audio_folder_placeholder:"Ex: audio/musica",configure_audio_folder:"Configurar pasta de \xE1udio",type_video:"V\xEDdeo",video_select_placeholder:"Selecionar v\xEDdeo...",video_picker_clear:"Limpar",video_picker_empty_folder:"Nenhum arquivo de v\xEDdeo na pasta",video_picker_empty_vault:"Nenhum arquivo de v\xEDdeo no vault",video_panel_title:"Configura\xE7\xF5es de v\xEDdeo",video_folder_label:"Pasta de origem (deixe vazio para o vault inteiro)",video_folder_placeholder:"Ex: video/clipes",configure_video_folder:"Configurar pasta de v\xEDdeo",formula_panel_title:"F\xF3rmula",formula_placeholder:'Ex: if(status = "feito", 1, 0)',formula_valid:"Sintaxe v\xE1lida",formula_available_cols:"Colunas dispon\xEDveis:",formula_ref_toggle:"Refer\xEAncia de fun\xE7\xF5es",formula_save:"Salvar",formula_cancel:"Cancelar",formula_save_hint:"Salvar (Ctrl+Enter)",formula_group_logic:"L\xF3gica",formula_group_comparators:"Comparadores",formula_group_aggregators:"Agregadores",formula_group_text:"Texto",formula_group_math:"Matem\xE1tica",formula_group_utils:"Utilit\xE1rios",number_format_title:"Formatar",number_decimals_label:"Casas decimais",number_thousands_label:"Separador de milhar",number_prefix_label:"Prefixo",number_suffix_label:"Sufixo",number_prefix_placeholder:"Ex: R$, $, \u20AC",number_suffix_placeholder:"Ex: %, kg, km",number_remove_format:"Remover formata\xE7\xE3o",relation_panel_title:"Rela\xE7\xE3o",lookup_panel_title:"Lookup",lookup_ref_table:"1. Tabela de refer\xEAncia",lookup_select_table:"Selecionar tabela...",lookup_col_to_display:"2. Coluna a exibir",lookup_origin_col:"2. Campo de origem dos valores",lookup_select_col:"Selecionar coluna...",lookup_file_name:"Nome do arquivo",lookup_join_col:"3. Coluna de jun\xE7\xE3o (nesta tabela)",lookup_join_col_title:"Nome do arquivo (jun\xE7\xE3o por t\xEDtulo)",lookup_select_join_col:"Selecionar coluna...",lookup_hint:"O valor desta coluna deve ser igual ao nome do arquivo da nota na tabela referenciada",image_panel_title:"Imagem",image_folder_label:"Pasta de origem (opcional)",image_folder_placeholder:"Ex: imagens/capas",image_picker_title:"Selecionar imagem",image_picker_clear:"Limpar",image_picker_empty_vault:"Nenhuma imagem encontrada no vault",image_picker_empty_folder:"Nenhuma imagem encontrada em",image_select_placeholder:"Selecionar imagem\u2026",agg_none:"Nenhum",agg_count:"Contar",agg_count_values:"Contar valores",agg_sum:"Soma",agg_avg:"M\xE9dia",agg_min:"M\xEDn",agg_max:"M\xE1x",no_database_open:"Nenhum banco de dados aberto.",no_database_hint:'Use o bot\xE3o na ribbon ou o comando "criar novo banco de dados".',loading:"Carregando...",no_results:"Nenhum item encontrado",item_singular:"Item",item_plural:"Itens",row_singular:"Linha",row_plural:"Linhas",record_singular:"Registro",record_plural:"Registros",add_row:"Nova linha",add_entry:"Nova entrada",add_card:"Novo card",new_field:"Novo campo",add_field:"Adicionar campo",board_no_select_col:"O board precisa de uma coluna do tipo select ou status para agrupar os cards.",board_add_select_hint:"Adicione uma coluna desse tipo na view de tabela e volte aqui.",board_drag_reorder:"Arraste para reordenar",board_set_limit:"Clique para definir limite de cards",board_limit_placeholder:"Limite (0 = nenhum)",board_show_more:"Mais",board_show_less:"Mostrar menos",hide_empty_cols:"Ocultar vazias",hide_no_value_cols:"Ocultar sem valor",calendar_no_date_field:"Selecione um campo de data no toolbar para exibir o calend\xE1rio.",calendar_no_date_section:"Sem data",calendar_click_to_create:"Clique para criar nota",calendar_today:"Hoje",calendar_prev_month:"M\xEAs anterior",calendar_next_month:"Pr\xF3ximo m\xEAs",calendar_view_month:"M\xEAs",calendar_view_week:"Semana",calendar_prev_week:"Semana anterior",calendar_next_week:"Pr\xF3xima semana",calendar_add_time:"Adicionar hor\xE1rio",calendar_remove_time:"Remover hor\xE1rio",calendar_all_day:"Dia inteiro",day_sun:"Dom",day_mon:"Seg",day_tue:"Ter",day_wed:"Qua",day_thu:"Qui",day_fri:"Sex",day_sat:"S\xE1b",month_january:"Janeiro",month_february:"Fevereiro",month_march:"Mar\xE7o",month_april:"Abril",month_may:"Maio",month_june:"Junho",month_july:"Julho",month_august:"Agosto",month_september:"Setembro",month_october:"Outubro",month_november:"Novembro",month_december:"Dezembro",timeline_no_start_field:"Selecione um campo de in\xEDcio no toolbar para exibir a timeline.",timeline_no_interval:"Sem intervalo",timeline_scroll_prev:"Scroll anterior",timeline_scroll_next:"Scroll pr\xF3ximo",zoom_days:"Dias",zoom_weeks:"Semanas",zoom_months:"Meses",month_short_jan:"Jan",month_short_feb:"Fev",month_short_mar:"Mar",month_short_apr:"Abr",month_short_may:"Mai",month_short_jun:"Jun",month_short_jul:"Jul",month_short_aug:"Ago",month_short_sep:"Set",month_short_oct:"Out",month_short_nov:"Nov",month_short_dec:"Dez",hierarchy_toggle:"Usar como hierarquia",hierarchy_toggle_hint:"Habilita relacionamentos pai-filho entre linhas neste banco de dados",add_subrow:"Adicionar sublinha",collapse_all:"Recolher tudo",expand_all:"Expandir tudo",max_depth_reached:"Profundidade m\xE1xima atingida (3 n\xEDveis)",chart_configure:"Configurar",chart_type:"Tipo de gr\xE1fico",chart_type_bar:"Barras",chart_type_line:"Linhas",chart_type_pie:"Pizza",chart_x_axis:"Categorias (eixo X)",chart_y_axis:"Valores (eixo Y)",chart_aggregation:"Agrega\xE7\xE3o",chart_select_column:"Selecionar coluna...",chart_count_records:"Contagem",chart_no_config:"Configure o gr\xE1fico para come\xE7ar.",chart_no_config_hint:"Selecione uma coluna para categorias na barra de ferramentas acima.",tooltip_pin_column:"Fixar colunas at\xE9 aqui",tooltip_unpin_column:"Desafixar colunas",tooltip_resize_column:"Arrastar para redimensionar; clique duplo para ajustar ao conte\xFAdo",tooltip_wrap_text:"Wrap de texto",tooltip_include_subfolders:"Incluir subpastas",folder_column:"Pasta",tooltip_manage_fields:"Gerenciar campos",tooltip_batch_actions:"A\xE7\xF5es em lote",tooltip_remove_filter:"Remover filtro",tooltip_close:"Fechar",tooltip_remove:"Remover",tooltip_move_up:"Mover para cima",tooltip_move_down:"Mover para baixo",tooltip_change_color:"Trocar cor",tooltip_delete_status:"Excluir status",status_not_started:"N\xE3o iniciado",status_in_progress:"Em andamento",status_done:"Conclu\xEDdo",status_cancelled:"Cancelado",relation_search_placeholder:"Buscar...",relation_clear:"Limpar",relation_no_results:"Nenhum resultado",relation_two_way:"Rela\xE7\xE3o bidirecional",relation_two_way_hint:"Cria automaticamente uma rela\xE7\xE3o inversa no banco de dados de destino",select_clear:"Limpar",select_create_placeholder:"Criar nova op\xE7\xE3o...",status_new_placeholder:"Novo status...",color_custom:"Personalizada",validate_non_numeric:'C\xE9lula(s) cont\xEAm valores n\xE3o num\xE9ricos (ex: "',validate_invalid_dates:'C\xE9lula(s) cont\xEAm valores que n\xE3o s\xE3o datas v\xE1lidas (ex: "',validate_invalid_checkbox:'C\xE9lula(s) cont\xEAm valores incompat\xEDveis com checkbox (ex: "',validate_multiselect_to_select:"Linha(s) t\xEAm m\xFAltiplos valores selecionados. Remova os extras antes de mudar para sele\xE7\xE3o \xFAnica.",validate_invalid_email:'C\xE9lula(s) cont\xEAm valores que n\xE3o s\xE3o e-mails v\xE1lidos (ex: "',validate_invalid_url:'C\xE9lula(s) cont\xEAm valores que n\xE3o s\xE3o URLs v\xE1lidas (ex: "',validate_invalid_phone:'C\xE9lula(s) cont\xEAm valores que n\xE3o s\xE3o telefones v\xE1lidos (ex: "',validate_type_change_prefix:"N\xE3o \xE9 poss\xEDvel mudar o tipo: ",email_invalid:"E-mail inv\xE1lido",op_is:"\xC9",op_is_not:"N\xE3o \xE9",op_contains:"Cont\xE9m",op_not_contains:"N\xE3o cont\xE9m",op_starts_with:"Come\xE7a com",op_ends_with:"Termina com",op_is_empty:"Est\xE1 vazio",op_is_not_empty:"N\xE3o est\xE1 vazio",op_gt:">",op_gte:">=",op_lt:"<",op_lte:"<=",op_is_checked:"Est\xE1 marcado",op_is_unchecked:"N\xE3o est\xE1 marcado",settings_db_filename_name:"Nome do arquivo de banco de dados",settings_db_filename_desc:"Nome do arquivo especial que identifica um banco de dados na pasta.",settings_row_height_name:"Altura padr\xE3o das linhas",settings_row_height_desc:"Altura em pixels de cada linha da tabela.",settings_inline_fields_name:"Ler campos inline do dataview",settings_inline_fields_desc:"Interpreta campos key:: value no corpo da nota e os exibe como valores de coluna (somente leitura)",db_untitled_note:"Sem t\xEDtulo",db_copy_suffix:"(c\xF3pia)",db_copy_suffix_n:"(c\xF3pia $n)",db_already_exists:'J\xE1 existe um banco de dados em "$folder"',db_tip_body:"Este arquivo \xE9 um banco de dados. Abra-o para ver a visualiza\xE7\xE3o de tabela.",formula_err_unclosed_string:"String n\xE3o fechada na posi\xE7\xE3o $pos",formula_err_unclosed_bracket:"Colchete n\xE3o fechado na posi\xE7\xE3o $pos",formula_err_unexpected_bang:"Caractere inesperado '!' na posi\xE7\xE3o $pos",formula_err_unexpected_char:"Caractere inesperado '$char' na posi\xE7\xE3o $pos",formula_err_expected_token:"Esperado $expected, encontrado '$found' na posi\xE7\xE3o $pos",formula_err_unexpected_token:"Token inesperado '$token' na posi\xE7\xE3o $pos",formula_err_circular_ref:'Refer\xEAncia circular: "$name" \xE9 uma coluna f\xF3rmula',formula_err_unknown_fn:"Fun\xE7\xE3o desconhecida: $fn()",formula_err_if_args:"Esperado if(condi\xE7\xE3o, se_verdadeiro, [se_falso])",formula_err_avg_args:"Esperado avg(coluna) \u2014 requer refer\xEAncia de coluna como argumento",formula_err_count_args:"Esperado count(coluna) \u2014 requer refer\xEAncia de coluna como argumento",formula_err_mid_args:"Esperado mid(texto, in\xEDcio, comprimento)",formula_err_mod_args:"Esperado mod(n\xFAmero, divisor)",formula_err_sqrt_args:"Esperado sqrt(n\xFAmero)",formula_err_not_implemented:"Fun\xE7\xE3o n\xE3o implementada: $fn()",plugin_display_name:"Notion bases",no_databases_found:'Nenhum banco de dados encontrado. Use o comando "Criar novo banco de dados" para criar um.',cmd_open_database:"Abrir banco de dados desta pasta",cmd_create_database:"Criar novo banco de dados na pasta atual",cmd_quick_add:"Adicionar linha rapidamente ao banco de dados",quick_add_title:"Adi\xE7\xE3o r\xE1pida",quick_add_note_title:"T\xEDtulo",quick_add_note_title_placeholder:"T\xEDtulo da nota...",quick_add_create:"Criar",quick_add_create_and_open:"Criar e abrir",quick_add_no_visible_fields:"Nenhum campo edit\xE1vel neste banco de dados",picker_placeholder:"Selecionar banco de dados...",picker_root:"/ (Raiz)",view_fallback_name:"Banco de dados"},qu=db;var pb={view_table:"Tabla",view_list:"Lista",view_board:"Tablero",view_gallery:"Galer\xEDa",view_calendar:"Calendario",view_timeline:"L\xEDnea de tiempo",view_chart:"Gr\xE1fico",add_view:"A\xF1adir vista",remove_view:"Eliminar vista",rename_view_hint:"Doble clic para renombrar",fields:"Campos",filter:"Filtro",filters:"Filtros",sort:"Ordenar",actions:"Acciones",group_by:"Agrupar por",cover:"Portada",date_field:"Fecha",start_field:"Inicio",end_field:"Fin",group_field:"Grupo",fields_in_card:"Campos en tarjeta",fields_label:"Campos",fields_on_bars:"Campos en barras",filter_by:"Filtrar por",sort_by:"Ordenar por",group_by_label:"Agrupar por",date_field_label:"Campo de fecha",cover_field_label:"Campo de portada",card_size_label:"Tama\xF1o de tarjeta",row_height_label:"Altura de fila",none_value:"Ninguno",no_value:"Sin valor",no_cover:"Ninguna",size_small:"Peque\xF1o",size_medium:"Mediano",size_large:"Grande",height_compact:"Compacto",height_medium:"Mediano",height_tall:"Alto",add_filter_advanced:"A\xF1adir filtro avanzado",add_sort:"A\xF1adir ordenaci\xF3n",no_active_sorts:"Sin ordenaciones activas",name_column:"Nombre",conjunction_and:"Y",conjunction_or:"O",filter_number_placeholder:"N\xFAmero...",filter_value_placeholder:"Valor...",delete_selected:"Eliminar todos los seleccionados",move_selected:"Mover todos los seleccionados",duplicate_selected:"Duplicar todos los seleccionados",export_csv:"Exportar CSV",import_csv:"Importar CSV",open_note:"Abrir nota",delete_note:"Eliminar nota",duplicate_note:"Duplicar nota",sort_asc:"Ascendente",sort_desc:"Descendente",sort_asc_title:"Ordenar descendente",sort_desc_title:"Eliminar ordenaci\xF3n",sort_none_title:"Ordenar ascendente",rename_column:"Renombrar",edit_formula:"Editar f\xF3rmula",configure_lookup:"Configurar lookup",configure_relation:"Configurar relaci\xF3n",format_number:"Formatear n\xFAmero",configure_image_folder:"Configurar carpeta de im\xE1genes",field_type_label:"Tipo de campo",hide_field:"Ocultar campo",delete_field:"Eliminar campo",type_title:"T\xEDtulo",type_text:"Texto",type_number:"N\xFAmero",type_select:"Selecci\xF3n",type_multiselect:"Multi-selecci\xF3n",type_date:"Fecha",type_checkbox:"Checkbox",type_url:"URL",type_email:"Email",type_phone:"Tel\xE9fono",type_status:"Estado",type_formula:"F\xF3rmula",type_relation:"Relaci\xF3n",type_lookup:"Lookup",type_rollup:"Rollup",rollup_panel_title:"Rollup",configure_rollup:"Configurar rollup",rollup_select_relation:"1. Columna de relaci\xF3n",rollup_select_relation_placeholder:"Seleccionar relaci\xF3n...",rollup_select_target:"2. Columna de destino",rollup_select_target_placeholder:"Seleccionar columna...",rollup_select_function:"3. Agregaci\xF3n",rollup_no_relations:"No se encontraron columnas de relaci\xF3n. A\xF1ade una columna de relaci\xF3n primero.",rollup_fn_sum:"Suma",rollup_fn_count:"Contar",rollup_fn_avg:"Promedio",rollup_fn_min:"M\xEDn",rollup_fn_max:"M\xE1x",rollup_fn_count_values:"Contar \xFAnicos",rollup_fn_list:"Listar todo",type_image:"Imagen",type_audio:"Audio",audio_path_placeholder:"Ruta al archivo de audio...",audio_select_placeholder:"Seleccionar audio...",audio_picker_title:"Seleccionar audio",audio_picker_clear:"Limpiar",audio_picker_empty_folder:"No hay archivos de audio en la carpeta",audio_picker_empty_vault:"No hay archivos de audio en el vault",audio_panel_title:"Configuraci\xF3n de audio",audio_folder_label:"Carpeta de origen (dejar vac\xEDo para todo el vault)",audio_folder_placeholder:"Ej: audio/musica",configure_audio_folder:"Configurar carpeta de audio",type_video:"V\xEDdeo",video_select_placeholder:"Seleccionar v\xEDdeo...",video_picker_clear:"Limpiar",video_picker_empty_folder:"No hay archivos de v\xEDdeo en la carpeta",video_picker_empty_vault:"No hay archivos de v\xEDdeo en el vault",video_panel_title:"Configuraci\xF3n de v\xEDdeo",video_folder_label:"Carpeta de origen (dejar vac\xEDo para todo el vault)",video_folder_placeholder:"Ej: video/clips",configure_video_folder:"Configurar carpeta de v\xEDdeo",formula_panel_title:"F\xF3rmula",formula_placeholder:'Ejemplo: if(status = "done", 1, 0)',formula_valid:"Sintaxis v\xE1lida",formula_available_cols:"Columnas disponibles:",formula_ref_toggle:"Referencia de funciones",formula_save:"Guardar",formula_cancel:"Cancelar",formula_save_hint:"Guardar (Ctrl+Enter)",formula_group_logic:"L\xF3gica",formula_group_comparators:"Comparadores",formula_group_aggregators:"Agregadores",formula_group_text:"Texto",formula_group_math:"Matem\xE1ticas",formula_group_utils:"Utilidades",number_format_title:"Formato",number_decimals_label:"Decimales",number_thousands_label:"Separador de miles",number_prefix_label:"Prefijo",number_suffix_label:"Sufijo",number_prefix_placeholder:"Ej: $, \u20AC",number_suffix_placeholder:"Ej: %, kg, km",number_remove_format:"Eliminar formato",relation_panel_title:"Relaci\xF3n",lookup_panel_title:"Lookup",lookup_ref_table:"1. Tabla de referencia",lookup_select_table:"Seleccionar tabla...",lookup_col_to_display:"2. Columna a mostrar",lookup_origin_col:"2. Campo de origen de valores",lookup_select_col:"Seleccionar columna...",lookup_file_name:"Nombre de archivo",lookup_join_col:"3. Columna de uni\xF3n (esta tabla)",lookup_join_col_title:"Nombre de archivo (unir por t\xEDtulo)",lookup_select_join_col:"Seleccionar columna...",lookup_hint:"El valor de esta columna debe coincidir con el nombre de archivo en la tabla referenciada",image_panel_title:"Imagen",image_folder_label:"Carpeta de origen (opcional)",image_folder_placeholder:"Ej: images/covers",image_picker_title:"Seleccionar imagen",image_picker_clear:"Limpiar",image_picker_empty_vault:"No se encontraron im\xE1genes en el vault",image_picker_empty_folder:"No se encontraron im\xE1genes en",image_select_placeholder:"Seleccionar imagen\u2026",agg_none:"Ninguno",agg_count:"Contar",agg_count_values:"Contar valores",agg_sum:"Suma",agg_avg:"Promedio",agg_min:"M\xEDn",agg_max:"M\xE1x",no_database_open:"No hay base de datos abierta.",no_database_hint:'Usa el bot\xF3n de la barra lateral o el comando "crear nueva base de datos".',loading:"Cargando...",no_results:"No se encontraron elementos",item_singular:"Elemento",item_plural:"Elementos",row_singular:"Fila",row_plural:"Filas",record_singular:"Registro",record_plural:"Registros",add_row:"Nueva fila",add_entry:"Nueva entrada",add_card:"Nueva tarjeta",new_field:"Nuevo campo",add_field:"A\xF1adir campo",board_no_select_col:"El tablero requiere una columna de selecci\xF3n o estado para agrupar tarjetas.",board_add_select_hint:"A\xF1ade una columna de ese tipo en la vista de tabla y vuelve aqu\xED.",board_drag_reorder:"Arrastra para reordenar",board_set_limit:"Clic para definir limite de tarjetas",board_limit_placeholder:"Limite (0 = ninguno)",board_show_more:"Mas",board_show_less:"Mostrar menos",hide_empty_cols:"Ocultar vac\xEDas",hide_no_value_cols:"Ocultar sin valor",calendar_no_date_field:"Selecciona un campo de fecha en la barra de herramientas para mostrar el calendario.",calendar_no_date_section:"Sin fecha",calendar_click_to_create:"Clic para crear nota",calendar_today:"Hoy",calendar_prev_month:"Mes anterior",calendar_next_month:"Mes siguiente",calendar_view_month:"Mes",calendar_view_week:"Semana",calendar_prev_week:"Semana anterior",calendar_next_week:"Semana siguiente",calendar_add_time:"A\xF1adir hora",calendar_remove_time:"Quitar hora",calendar_all_day:"Todo el d\xEDa",day_sun:"Dom",day_mon:"Lun",day_tue:"Mar",day_wed:"Mi\xE9",day_thu:"Jue",day_fri:"Vie",day_sat:"S\xE1b",month_january:"Enero",month_february:"Febrero",month_march:"Marzo",month_april:"Abril",month_may:"Mayo",month_june:"Junio",month_july:"Julio",month_august:"Agosto",month_september:"Septiembre",month_october:"Octubre",month_november:"Noviembre",month_december:"Diciembre",timeline_no_start_field:"Selecciona un campo de inicio en la barra de herramientas para mostrar la l\xEDnea de tiempo.",timeline_no_interval:"Sin intervalo",timeline_scroll_prev:"Desplazar atr\xE1s",timeline_scroll_next:"Desplazar adelante",zoom_days:"D\xEDas",zoom_weeks:"Semanas",zoom_months:"Meses",month_short_jan:"Ene",month_short_feb:"Feb",month_short_mar:"Mar",month_short_apr:"Abr",month_short_may:"May",month_short_jun:"Jun",month_short_jul:"Jul",month_short_aug:"Ago",month_short_sep:"Sep",month_short_oct:"Oct",month_short_nov:"Nov",month_short_dec:"Dic",hierarchy_toggle:"Usar como jerarqu\xEDa",hierarchy_toggle_hint:"Habilita relaciones padre-hijo entre filas de esta base de datos",add_subrow:"A\xF1adir subfila",collapse_all:"Contraer todo",expand_all:"Expandir todo",max_depth_reached:"Profundidad m\xE1xima alcanzada (3 niveles)",chart_configure:"Configurar",chart_type:"Tipo de gr\xE1fico",chart_type_bar:"Barras",chart_type_line:"L\xEDneas",chart_type_pie:"Circular",chart_x_axis:"Categor\xEDas (eje X)",chart_y_axis:"Valores (eje Y)",chart_aggregation:"Agregaci\xF3n",chart_select_column:"Seleccionar columna...",chart_count_records:"Contar",chart_no_config:"Configura el gr\xE1fico para empezar.",chart_no_config_hint:"Selecciona una columna para categor\xEDas en la barra de herramientas de arriba.",tooltip_pin_column:"Fijar columnas hasta aqu\xED",tooltip_unpin_column:"Desfijar columnas",tooltip_resize_column:"Arrastra para redimensionar; doble clic para ajustar al contenido",tooltip_wrap_text:"Ajuste de texto",tooltip_include_subfolders:"Incluir subcarpetas",folder_column:"Carpeta",tooltip_manage_fields:"Gestionar campos",tooltip_batch_actions:"Acciones en lote",tooltip_remove_filter:"Eliminar filtro",tooltip_close:"Cerrar",tooltip_remove:"Eliminar",tooltip_move_up:"Mover arriba",tooltip_move_down:"Mover abajo",tooltip_change_color:"Cambiar color",tooltip_delete_status:"Eliminar estado",status_not_started:"No iniciado",status_in_progress:"En progreso",status_done:"Hecho",status_cancelled:"Cancelado",relation_search_placeholder:"Buscar...",relation_clear:"Limpiar",relation_no_results:"Sin resultados",relation_two_way:"Relaci\xF3n bidireccional",relation_two_way_hint:"Crea autom\xE1ticamente una relaci\xF3n inversa en la base de datos de destino",select_clear:"Limpiar",select_create_placeholder:"Crear nueva opci\xF3n...",status_new_placeholder:"Nuevo estado...",color_custom:"Personalizado",validate_non_numeric:'Celda(s) contienen valores no num\xE9ricos (ej: "',validate_invalid_dates:'Celda(s) contienen valores que no son fechas v\xE1lidas (ej: "',validate_invalid_checkbox:'Celda(s) contienen valores incompatibles con checkbox (ej: "',validate_multiselect_to_select:"Fila(s) tienen m\xFAltiples valores seleccionados. Elimina los extras antes de cambiar a selecci\xF3n \xFAnica.",validate_invalid_email:'Celda(s) contienen valores que no son emails v\xE1lidos (ej: "',validate_invalid_url:'Celda(s) contienen valores que no son URLs v\xE1lidas (ej: "',validate_invalid_phone:'Celda(s) contienen valores que no son tel\xE9fonos v\xE1lidos (ej: "',validate_type_change_prefix:"No se puede cambiar el tipo: ",email_invalid:"Email inv\xE1lido",op_is:"Es",op_is_not:"No es",op_contains:"Contiene",op_not_contains:"No contiene",op_starts_with:"Empieza con",op_ends_with:"Termina con",op_is_empty:"Est\xE1 vac\xEDo",op_is_not_empty:"No est\xE1 vac\xEDo",op_gt:">",op_gte:">=",op_lt:"<",op_lte:"<=",op_is_checked:"Est\xE1 marcado",op_is_unchecked:"No est\xE1 marcado",settings_db_filename_name:"Nombre del archivo de base de datos",settings_db_filename_desc:"Nombre del archivo especial que identifica una base de datos en una carpeta.",settings_row_height_name:"Altura de fila predeterminada",settings_row_height_desc:"Altura en p\xEDxeles de cada fila de la tabla.",settings_inline_fields_name:"Leer campos inline de dataview",settings_inline_fields_desc:"Interpreta campos key:: value del cuerpo de la nota y los muestra como valores de columna (solo lectura)",db_untitled_note:"Sin t\xEDtulo",db_copy_suffix:"(copia)",db_copy_suffix_n:"(copia $n)",db_already_exists:'Ya existe una base de datos en "$folder"',db_tip_body:"Este archivo es una base de datos. \xC1brelo para ver la vista de tabla.",formula_err_unclosed_string:"Cadena sin cerrar en posici\xF3n $pos",formula_err_unclosed_bracket:"Corchete sin cerrar en posici\xF3n $pos",formula_err_unexpected_bang:"Car\xE1cter inesperado '!' en posici\xF3n $pos",formula_err_unexpected_char:"Car\xE1cter inesperado '$char' en posici\xF3n $pos",formula_err_expected_token:"Se esperaba $expected, se encontr\xF3 '$found' en posici\xF3n $pos",formula_err_unexpected_token:"Token inesperado '$token' en posici\xF3n $pos",formula_err_circular_ref:'Referencia circular: "$name" es una columna f\xF3rmula',formula_err_unknown_fn:"Funci\xF3n desconocida: $fn()",formula_err_if_args:"Expected if(condition, if_true, [if_false])",formula_err_avg_args:"Se espera avg(columna) \u2014 requiere referencia de columna como argumento",formula_err_count_args:"Se espera count(columna) \u2014 requiere referencia de columna como argumento",formula_err_mid_args:"Se espera mid(texto, inicio, longitud)",formula_err_mod_args:"Se espera mod(n\xFAmero, divisor)",formula_err_sqrt_args:"Se espera sqrt(n\xFAmero)",formula_err_not_implemented:"Funci\xF3n no implementada: $fn()",plugin_display_name:"Notion bases",no_databases_found:'No se encontraron bases de datos. Usa el comando "crear nueva base de datos" para crear una.',cmd_open_database:"Abrir base de datos de esta carpeta",cmd_create_database:"Crear nueva base de datos en la carpeta actual",cmd_quick_add:"A\xF1adir fila r\xE1pidamente a la base de datos",quick_add_title:"A\xF1adir r\xE1pido",quick_add_note_title:"T\xEDtulo",quick_add_note_title_placeholder:"T\xEDtulo de la nota...",quick_add_create:"Crear",quick_add_create_and_open:"Crear y abrir",quick_add_no_visible_fields:"No hay campos editables en esta base de datos",picker_placeholder:"Seleccionar base de datos...",picker_root:"/ (Ra\xEDz)",view_fallback_name:"Base de datos"},gm=pb;var mb={view_table:"Tableau",view_list:"Liste",view_board:"Tableau Kanban",view_gallery:"Galerie",view_calendar:"Calendrier",view_timeline:"Chronologie",view_chart:"Graphique",add_view:"Ajouter une vue",remove_view:"Supprimer la vue",rename_view_hint:"Double-cliquez pour renommer",fields:"Champs",filter:"Filtre",filters:"Filtres",sort:"Trier",actions:"Actions",group_by:"Grouper par",cover:"Couverture",date_field:"Date",start_field:"D\xE9but",end_field:"Fin",group_field:"Groupe",fields_in_card:"Champs dans la carte",fields_label:"Champs",fields_on_bars:"Champs sur les barres",filter_by:"Filtrer par",sort_by:"Trier par",group_by_label:"Grouper par",date_field_label:"Champ de date",cover_field_label:"Champ de couverture",card_size_label:"Taille de carte",row_height_label:"Hauteur de ligne",none_value:"Aucun",no_value:"Sans valeur",no_cover:"Aucune",size_small:"Petit",size_medium:"Moyen",size_large:"Grand",height_compact:"Compact",height_medium:"Moyen",height_tall:"Grand",add_filter_advanced:"Ajouter un filtre avanc\xE9",add_sort:"Ajouter un tri",no_active_sorts:"Aucun tri actif",name_column:"Nom",conjunction_and:"ET",conjunction_or:"OU",filter_number_placeholder:"Nombre...",filter_value_placeholder:"Valeur...",delete_selected:"Supprimer tous les s\xE9lectionn\xE9s",move_selected:"D\xE9placer tous les s\xE9lectionn\xE9s",duplicate_selected:"Dupliquer tous les s\xE9lectionn\xE9s",export_csv:"Exporter CSV",import_csv:"Importer CSV",open_note:"Ouvrir la note",delete_note:"Supprimer la note",duplicate_note:"Dupliquer la note",sort_asc:"Croissant",sort_desc:"D\xE9croissant",sort_asc_title:"Trier d\xE9croissant",sort_desc_title:"Supprimer le tri",sort_none_title:"Trier croissant",rename_column:"Renommer",edit_formula:"Modifier la formule",configure_lookup:"Configurer le lookup",configure_relation:"Configurer la relation",format_number:"Formater le nombre",configure_image_folder:"Configurer le dossier d'images",field_type_label:"Type de champ",hide_field:"Masquer le champ",delete_field:"Supprimer le champ",type_title:"Titre",type_text:"Texte",type_number:"Nombre",type_select:"S\xE9lection",type_multiselect:"Multi-s\xE9lection",type_date:"Date",type_checkbox:"Checkbox",type_url:"URL",type_email:"Email",type_phone:"T\xE9l\xE9phone",type_status:"Statut",type_formula:"Formule",type_relation:"Relation",type_lookup:"Lookup",type_rollup:"Rollup",rollup_panel_title:"Rollup",configure_rollup:"Configurer le rollup",rollup_select_relation:"1. Colonne de relation",rollup_select_relation_placeholder:"S\xE9lectionner une relation...",rollup_select_target:"2. Colonne cible",rollup_select_target_placeholder:"S\xE9lectionner une colonne...",rollup_select_function:"3. Agr\xE9gation",rollup_no_relations:"Aucune colonne de relation trouv\xE9e. Ajoutez d'abord une colonne de relation.",rollup_fn_sum:"Somme",rollup_fn_count:"Compter",rollup_fn_avg:"Moyenne",rollup_fn_min:"Min",rollup_fn_max:"Max",rollup_fn_count_values:"Compter les uniques",rollup_fn_list:"Tout lister",type_image:"Image",type_audio:"Audio",audio_path_placeholder:"Chemin vers le fichier audio...",audio_select_placeholder:"S\xE9lectionner un audio...",audio_picker_title:"S\xE9lectionner un audio",audio_picker_clear:"Effacer",audio_picker_empty_folder:"Aucun fichier audio dans le dossier",audio_picker_empty_vault:"Aucun fichier audio dans le vault",audio_panel_title:"Param\xE8tres audio",audio_folder_label:"Dossier source (laisser vide pour tout le vault)",audio_folder_placeholder:"Ex : audio/musique",configure_audio_folder:"Configurer le dossier audio",type_video:"Vid\xE9o",video_select_placeholder:"S\xE9lectionner une vid\xE9o...",video_picker_clear:"Effacer",video_picker_empty_folder:"Aucun fichier vid\xE9o dans le dossier",video_picker_empty_vault:"Aucun fichier vid\xE9o dans le vault",video_panel_title:"Param\xE8tres vid\xE9o",video_folder_label:"Dossier source (laisser vide pour tout le vault)",video_folder_placeholder:"Ex : video/clips",configure_video_folder:"Configurer le dossier vid\xE9o",formula_panel_title:"Formule",formula_placeholder:'Exemple : if(status = "done", 1, 0)',formula_valid:"Syntaxe valide",formula_available_cols:"Colonnes disponibles :",formula_ref_toggle:"R\xE9f\xE9rence des fonctions",formula_save:"Enregistrer",formula_cancel:"Annuler",formula_save_hint:"Enregistrer (Ctrl+Entr\xE9e)",formula_group_logic:"Logique",formula_group_comparators:"Comparateurs",formula_group_aggregators:"Agr\xE9gateurs",formula_group_text:"Texte",formula_group_math:"Math\xE9matiques",formula_group_utils:"Utilitaires",number_format_title:"Format",number_decimals_label:"D\xE9cimales",number_thousands_label:"S\xE9parateur de milliers",number_prefix_label:"Pr\xE9fixe",number_suffix_label:"Suffixe",number_prefix_placeholder:"Ex : $, \u20AC",number_suffix_placeholder:"Ex : %, kg, km",number_remove_format:"Supprimer le format",relation_panel_title:"Relation",lookup_panel_title:"Lookup",lookup_ref_table:"1. Table de r\xE9f\xE9rence",lookup_select_table:"S\xE9lectionner une table...",lookup_col_to_display:"2. Colonne \xE0 afficher",lookup_origin_col:"2. Champ source des valeurs",lookup_select_col:"S\xE9lectionner une colonne...",lookup_file_name:"Nom du fichier",lookup_join_col:"3. Colonne de jointure (cette table)",lookup_join_col_title:"Nom du fichier (jointure par titre)",lookup_select_join_col:"S\xE9lectionner une colonne...",lookup_hint:"La valeur de cette colonne doit correspondre au nom du fichier dans la table r\xE9f\xE9renc\xE9e",image_panel_title:"Image",image_folder_label:"Dossier source (optionnel)",image_folder_placeholder:"Ex : images/covers",image_picker_title:"S\xE9lectionner une image",image_picker_clear:"Effacer",image_picker_empty_vault:"Aucune image trouv\xE9e dans le vault",image_picker_empty_folder:"Aucune image trouv\xE9e dans",image_select_placeholder:"S\xE9lectionner une image\u2026",agg_none:"Aucun",agg_count:"Compter",agg_count_values:"Compter les valeurs",agg_sum:"Somme",agg_avg:"Moyenne",agg_min:"Min",agg_max:"Max",no_database_open:"Aucune base de donn\xE9es ouverte.",no_database_hint:'Utilisez le bouton du ruban ou la commande "cr\xE9er une nouvelle base de donn\xE9es".',loading:"Chargement...",no_results:"Aucun \xE9l\xE9ment trouv\xE9",item_singular:"\xC9l\xE9ment",item_plural:"\xC9l\xE9ments",row_singular:"Ligne",row_plural:"Lignes",record_singular:"Enregistrement",record_plural:"Enregistrements",add_row:"Nouvelle ligne",add_entry:"Nouvelle entr\xE9e",add_card:"Nouvelle carte",new_field:"Nouveau champ",add_field:"Ajouter un champ",board_no_select_col:"Le tableau n\xE9cessite une colonne de s\xE9lection ou de statut pour grouper les cartes.",board_add_select_hint:"Ajoutez une colonne de ce type dans la vue tableau et revenez ici.",board_drag_reorder:"Glisser pour r\xE9organiser",board_set_limit:"Cliquer pour definir la limite de cartes",board_limit_placeholder:"Limite (0 = aucune)",board_show_more:"De plus",board_show_less:"Afficher moins",hide_empty_cols:"Masquer vides",hide_no_value_cols:"Masquer sans valeur",calendar_no_date_field:"S\xE9lectionnez un champ de date dans la barre d'outils pour afficher le calendrier.",calendar_no_date_section:"Sans date",calendar_click_to_create:"Cliquez pour cr\xE9er une note",calendar_today:"Aujourd'hui",calendar_prev_month:"Mois pr\xE9c\xE9dent",calendar_next_month:"Mois suivant",calendar_view_month:"Mois",calendar_view_week:"Semaine",calendar_prev_week:"Semaine pr\xE9c\xE9dente",calendar_next_week:"Semaine suivante",calendar_add_time:"Ajouter une heure",calendar_remove_time:"Supprimer l'heure",calendar_all_day:"Toute la journ\xE9e",day_sun:"Dim",day_mon:"Lun",day_tue:"Mar",day_wed:"Mer",day_thu:"Jeu",day_fri:"Ven",day_sat:"Sam",month_january:"Janvier",month_february:"F\xE9vrier",month_march:"Mars",month_april:"Avril",month_may:"Mai",month_june:"Juin",month_july:"Juillet",month_august:"Ao\xFBt",month_september:"Septembre",month_october:"Octobre",month_november:"Novembre",month_december:"D\xE9cembre",timeline_no_start_field:"S\xE9lectionnez un champ de d\xE9but dans la barre d'outils pour afficher la chronologie.",timeline_no_interval:"Sans intervalle",timeline_scroll_prev:"D\xE9filer en arri\xE8re",timeline_scroll_next:"D\xE9filer en avant",zoom_days:"Jours",zoom_weeks:"Semaines",zoom_months:"Mois",month_short_jan:"Jan",month_short_feb:"F\xE9v",month_short_mar:"Mar",month_short_apr:"Avr",month_short_may:"Mai",month_short_jun:"Jun",month_short_jul:"Jul",month_short_aug:"Ao\xFB",month_short_sep:"Sep",month_short_oct:"Oct",month_short_nov:"Nov",month_short_dec:"D\xE9c",hierarchy_toggle:"Utiliser comme hi\xE9rarchie",hierarchy_toggle_hint:"Active les relations parent-enfant entre les lignes de cette base de donn\xE9es",add_subrow:"Ajouter une sous-ligne",collapse_all:"Tout r\xE9duire",expand_all:"Tout d\xE9velopper",max_depth_reached:"Profondeur maximale atteinte (3 niveaux)",chart_configure:"Configurer",chart_type:"Type de graphique",chart_type_bar:"Barres",chart_type_line:"Courbes",chart_type_pie:"Camembert",chart_x_axis:"Cat\xE9gories (axe X)",chart_y_axis:"Valeurs (axe Y)",chart_aggregation:"Agr\xE9gation",chart_select_column:"S\xE9lectionner une colonne...",chart_count_records:"Compter",chart_no_config:"Configurez le graphique pour commencer.",chart_no_config_hint:"S\xE9lectionnez une colonne pour les cat\xE9gories dans la barre d'outils ci-dessus.",tooltip_pin_column:"Fixer les colonnes jusqu'ici",tooltip_unpin_column:"D\xE9tacher les colonnes",tooltip_resize_column:"Glisser pour redimensionner ; double-clic pour ajuster au contenu",tooltip_wrap_text:"Retour \xE0 la ligne",tooltip_include_subfolders:"Inclure les sous-dossiers",folder_column:"Dossier",tooltip_manage_fields:"G\xE9rer les champs",tooltip_batch_actions:"Actions group\xE9es",tooltip_remove_filter:"Supprimer le filtre",tooltip_close:"Fermer",tooltip_remove:"Supprimer",tooltip_move_up:"Monter",tooltip_move_down:"Descendre",tooltip_change_color:"Changer la couleur",tooltip_delete_status:"Supprimer le statut",status_not_started:"Non commenc\xE9",status_in_progress:"En cours",status_done:"Termin\xE9",status_cancelled:"Annul\xE9",relation_search_placeholder:"Rechercher...",relation_clear:"Effacer",relation_no_results:"Aucun r\xE9sultat",relation_two_way:"Relation bidirectionnelle",relation_two_way_hint:"Cr\xE9e automatiquement une relation inverse dans la base de donn\xE9es cible",select_clear:"Effacer",select_create_placeholder:"Cr\xE9er une nouvelle option...",status_new_placeholder:"Nouveau statut...",color_custom:"Personnalis\xE9e",validate_non_numeric:'Cellule(s) contiennent des valeurs non num\xE9riques (ex : "',validate_invalid_dates:'Cellule(s) contiennent des valeurs qui ne sont pas des dates valides (ex : "',validate_invalid_checkbox:'Cellule(s) contiennent des valeurs incompatibles avec checkbox (ex : "',validate_multiselect_to_select:"Ligne(s) ont plusieurs valeurs s\xE9lectionn\xE9es. Supprimez les extras avant de passer en s\xE9lection unique.",validate_invalid_email:'Cellule(s) contiennent des valeurs qui ne sont pas des emails valides (ex : "',validate_invalid_url:'Cellule(s) contiennent des valeurs qui ne sont pas des URLs valides (ex : "',validate_invalid_phone:'Cellule(s) contiennent des valeurs qui ne sont pas des num\xE9ros de t\xE9l\xE9phone valides (ex : "',validate_type_change_prefix:"Impossible de changer le type : ",email_invalid:"Email invalide",op_is:"Est",op_is_not:"N'est pas",op_contains:"Contient",op_not_contains:"Ne contient pas",op_starts_with:"Commence par",op_ends_with:"Finit par",op_is_empty:"Est vide",op_is_not_empty:"N'est pas vide",op_gt:">",op_gte:">=",op_lt:"<",op_lte:"<=",op_is_checked:"Est coch\xE9",op_is_unchecked:"N'est pas coch\xE9",settings_db_filename_name:"Nom du fichier de base de donn\xE9es",settings_db_filename_desc:"Nom du fichier sp\xE9cial qui identifie une base de donn\xE9es dans un dossier.",settings_row_height_name:"Hauteur de ligne par d\xE9faut",settings_row_height_desc:"Hauteur en pixels de chaque ligne du tableau.",settings_inline_fields_name:"Lire les champs inline dataview",settings_inline_fields_desc:"Analyse les champs key:: value dans le corps de la note et les affiche comme valeurs de colonne (lecture seule)",db_untitled_note:"Sans titre",db_copy_suffix:"(copie)",db_copy_suffix_n:"(copie $n)",db_already_exists:'Une base de donn\xE9es existe d\xE9j\xE0 dans "$folder"',db_tip_body:"Ce fichier est une base de donn\xE9es. Ouvrez-le pour voir la vue tableau.",formula_err_unclosed_string:"Cha\xEEne non ferm\xE9e \xE0 la position $pos",formula_err_unclosed_bracket:"Crochet non ferm\xE9 \xE0 la position $pos",formula_err_unexpected_bang:"Caract\xE8re inattendu '!' \xE0 la position $pos",formula_err_unexpected_char:"Caract\xE8re inattendu '$char' \xE0 la position $pos",formula_err_expected_token:"Attendu $expected, trouv\xE9 '$found' \xE0 la position $pos",formula_err_unexpected_token:"Token inattendu '$token' \xE0 la position $pos",formula_err_circular_ref:'R\xE9f\xE9rence circulaire : "$name" est une colonne formule',formula_err_unknown_fn:"Fonction inconnue : $fn()",formula_err_if_args:"Attendu if(condition, si_vrai, [si_faux])",formula_err_avg_args:"Attendu avg(colonne) \u2014 n\xE9cessite une r\xE9f\xE9rence de colonne",formula_err_count_args:"Attendu count(colonne) \u2014 n\xE9cessite une r\xE9f\xE9rence de colonne",formula_err_mid_args:"Attendu mid(texte, d\xE9but, longueur)",formula_err_mod_args:"Attendu mod(nombre, diviseur)",formula_err_sqrt_args:"Attendu sqrt(nombre)",formula_err_not_implemented:"Fonction non impl\xE9ment\xE9e : $fn()",plugin_display_name:"Notion bases",no_databases_found:'Aucune base de donn\xE9es trouv\xE9e. Utilisez la commande "cr\xE9er une nouvelle base de donn\xE9es" pour en cr\xE9er une.',cmd_open_database:"Ouvrir la base de donn\xE9es de ce dossier",cmd_create_database:"Cr\xE9er une nouvelle base de donn\xE9es dans le dossier actuel",cmd_quick_add:"Ajouter rapidement une ligne \xE0 la base de donn\xE9es",quick_add_title:"Ajout rapide",quick_add_note_title:"Titre",quick_add_note_title_placeholder:"Titre de la note...",quick_add_create:"Cr\xE9er",quick_add_create_and_open:"Cr\xE9er et ouvrir",quick_add_no_visible_fields:"Aucun champ modifiable dans cette base de donn\xE9es",picker_placeholder:"S\xE9lectionner une base de donn\xE9es...",picker_root:"/ (Racine)",view_fallback_name:"Base de donn\xE9es"},hm=mb;var fb={view_table:"Tabelle",view_list:"Liste",view_board:"Board",view_gallery:"Galerie",view_calendar:"Kalender",view_timeline:"Zeitleiste",view_chart:"Diagramm",add_view:"Ansicht hinzuf\xFCgen",remove_view:"Ansicht entfernen",rename_view_hint:"Doppelklick zum Umbenennen",fields:"Felder",filter:"Filter",filters:"Filter",sort:"Sortieren",actions:"Aktionen",group_by:"Gruppieren nach",cover:"Titelbild",date_field:"Datum",start_field:"Start",end_field:"Ende",group_field:"Gruppe",fields_in_card:"Felder in der Karte",fields_label:"Felder",fields_on_bars:"Felder auf Balken",filter_by:"Filtern nach",sort_by:"Sortieren nach",group_by_label:"Gruppieren nach",date_field_label:"Datumsfeld",cover_field_label:"Titelbildfeld",card_size_label:"Kartengr\xF6\xDFe",row_height_label:"Zeilenh\xF6he",none_value:"Keine",no_value:"Kein Wert",no_cover:"Keine",size_small:"Klein",size_medium:"Mittel",size_large:"Gro\xDF",height_compact:"Kompakt",height_medium:"Mittel",height_tall:"Gro\xDF",add_filter_advanced:"Erweiterten Filter hinzuf\xFCgen",add_sort:"Sortierung hinzuf\xFCgen",no_active_sorts:"Keine aktiven Sortierungen",name_column:"Name",conjunction_and:"UND",conjunction_or:"ODER",filter_number_placeholder:"Zahl...",filter_value_placeholder:"Wert...",delete_selected:"Alle ausgew\xE4hlten l\xF6schen",move_selected:"Alle ausgew\xE4hlten verschieben",duplicate_selected:"Alle ausgew\xE4hlten duplizieren",export_csv:"CSV exportieren",import_csv:"CSV importieren",open_note:"Notiz \xF6ffnen",delete_note:"Notiz l\xF6schen",duplicate_note:"Notiz duplizieren",sort_asc:"Aufsteigend",sort_desc:"Absteigend",sort_asc_title:"Absteigend sortieren",sort_desc_title:"Sortierung entfernen",sort_none_title:"Aufsteigend sortieren",rename_column:"Umbenennen",edit_formula:"Formel bearbeiten",configure_lookup:"Lookup konfigurieren",configure_relation:"Relation konfigurieren",format_number:"Zahl formatieren",configure_image_folder:"Bildordner konfigurieren",field_type_label:"Feldtyp",hide_field:"Feld ausblenden",delete_field:"Feld l\xF6schen",type_title:"Titel",type_text:"Text",type_number:"Zahl",type_select:"Auswahl",type_multiselect:"Mehrfachauswahl",type_date:"Datum",type_checkbox:"Checkbox",type_url:"URL",type_email:"E-Mail",type_phone:"Telefon",type_status:"Status",type_formula:"Formel",type_relation:"Relation",type_lookup:"Lookup",type_rollup:"Rollup",rollup_panel_title:"Rollup",configure_rollup:"Rollup konfigurieren",rollup_select_relation:"1. Relationsspalte",rollup_select_relation_placeholder:"Relation ausw\xE4hlen...",rollup_select_target:"2. Zielspalte",rollup_select_target_placeholder:"Spalte ausw\xE4hlen...",rollup_select_function:"3. Aggregation",rollup_no_relations:"Keine Relationsspalten gefunden. F\xFCgen Sie zuerst eine Relationsspalte hinzu.",rollup_fn_sum:"Summe",rollup_fn_count:"Anzahl",rollup_fn_avg:"Durchschnitt",rollup_fn_min:"Min",rollup_fn_max:"Max",rollup_fn_count_values:"Eindeutige z\xE4hlen",rollup_fn_list:"Alle auflisten",type_image:"Bild",type_audio:"Audio",audio_path_placeholder:"Pfad zur Audiodatei...",audio_select_placeholder:"Audio ausw\xE4hlen...",audio_picker_title:"Audio ausw\xE4hlen",audio_picker_clear:"L\xF6schen",audio_picker_empty_folder:"Keine Audiodateien im Ordner",audio_picker_empty_vault:"Keine Audiodateien im Vault",audio_panel_title:"Audioeinstellungen",audio_folder_label:"Quellordner (leer lassen f\xFCr den gesamten Vault)",audio_folder_placeholder:"Z.B.: audio/musik",configure_audio_folder:"Audioordner konfigurieren",type_video:"Video",video_select_placeholder:"Video ausw\xE4hlen...",video_picker_clear:"L\xF6schen",video_picker_empty_folder:"Keine Videodateien im Ordner",video_picker_empty_vault:"Keine Videodateien im Vault",video_panel_title:"Videoeinstellungen",video_folder_label:"Quellordner (leer lassen f\xFCr den gesamten Vault)",video_folder_placeholder:"Z.B.: video/clips",configure_video_folder:"Videoordner konfigurieren",formula_panel_title:"Formel",formula_placeholder:'Beispiel: if(status = "done", 1, 0)',formula_valid:"G\xFCltige Syntax",formula_available_cols:"Verf\xFCgbare Spalten:",formula_ref_toggle:"Funktionsreferenz",formula_save:"Speichern",formula_cancel:"Abbrechen",formula_save_hint:"Speichern (Strg+Eingabe)",formula_group_logic:"Logik",formula_group_comparators:"Vergleiche",formula_group_aggregators:"Aggregatoren",formula_group_text:"Text",formula_group_math:"Mathematik",formula_group_utils:"Hilfsfunktionen",number_format_title:"Format",number_decimals_label:"Dezimalstellen",number_thousands_label:"Tausendertrennzeichen",number_prefix_label:"Pr\xE4fix",number_suffix_label:"Suffix",number_prefix_placeholder:"Z.B.: $, \u20AC",number_suffix_placeholder:"Z.B.: %, kg, km",number_remove_format:"Formatierung entfernen",relation_panel_title:"Relation",lookup_panel_title:"Lookup",lookup_ref_table:"1. Referenztabelle",lookup_select_table:"Tabelle ausw\xE4hlen...",lookup_col_to_display:"2. Anzuzeigende Spalte",lookup_origin_col:"2. Quellfeld f\xFCr Werte",lookup_select_col:"Spalte ausw\xE4hlen...",lookup_file_name:"Dateiname",lookup_join_col:"3. Verkn\xFCpfungsspalte (diese Tabelle)",lookup_join_col_title:"Dateiname (Verkn\xFCpfung nach Titel)",lookup_select_join_col:"Spalte ausw\xE4hlen...",lookup_hint:"Der Wert dieser Spalte muss mit dem Dateinamen in der referenzierten Tabelle \xFCbereinstimmen",image_panel_title:"Bild",image_folder_label:"Quellordner (optional)",image_folder_placeholder:"Z.B.: images/covers",image_picker_title:"Bild ausw\xE4hlen",image_picker_clear:"L\xF6schen",image_picker_empty_vault:"Keine Bilder im Vault gefunden",image_picker_empty_folder:"Keine Bilder gefunden in",image_select_placeholder:"Bild ausw\xE4hlen\u2026",agg_none:"Keine",agg_count:"Anzahl",agg_count_values:"Werte z\xE4hlen",agg_sum:"Summe",agg_avg:"Durchschnitt",agg_min:"Min",agg_max:"Max",no_database_open:"Keine Datenbank ge\xF6ffnet.",no_database_hint:'Verwenden Sie die Schaltfl\xE4che in der Leiste oder den Befehl "Neue Datenbank erstellen".',loading:"Laden...",no_results:"Keine Eintr\xE4ge gefunden",item_singular:"Element",item_plural:"Elemente",row_singular:"Zeile",row_plural:"Zeilen",record_singular:"Datensatz",record_plural:"Datens\xE4tze",add_row:"Neue Zeile",add_entry:"Neuer Eintrag",add_card:"Neue Karte",new_field:"Neues Feld",add_field:"Feld hinzuf\xFCgen",board_no_select_col:"Das Board ben\xF6tigt eine Auswahl- oder Statusspalte zum Gruppieren der Karten.",board_add_select_hint:"F\xFCgen Sie eine Spalte dieses Typs in der Tabellenansicht hinzu und kehren Sie hierher zur\xFCck.",board_drag_reorder:"Ziehen zum Neuordnen",board_set_limit:"Klicken um Kartenlimit zu setzen",board_limit_placeholder:"Limit (0 = kein)",board_show_more:"Mehr",board_show_less:"Weniger anzeigen",hide_empty_cols:"Leere ausblenden",hide_no_value_cols:"Ohne Wert ausblenden",calendar_no_date_field:"W\xE4hlen Sie ein Datumsfeld in der Symbolleiste aus, um den Kalender anzuzeigen.",calendar_no_date_section:"Ohne Datum",calendar_click_to_create:"Klicken zum Erstellen einer Notiz",calendar_today:"Heute",calendar_prev_month:"Vorheriger Monat",calendar_next_month:"N\xE4chster Monat",calendar_view_month:"Monat",calendar_view_week:"Woche",calendar_prev_week:"Vorherige Woche",calendar_next_week:"N\xE4chste Woche",calendar_add_time:"Uhrzeit hinzuf\xFCgen",calendar_remove_time:"Uhrzeit entfernen",calendar_all_day:"Ganzt\xE4gig",day_sun:"So",day_mon:"Mo",day_tue:"Di",day_wed:"Mi",day_thu:"Do",day_fri:"Fr",day_sat:"Sa",month_january:"Januar",month_february:"Februar",month_march:"M\xE4rz",month_april:"April",month_may:"Mai",month_june:"Juni",month_july:"Juli",month_august:"August",month_september:"September",month_october:"Oktober",month_november:"November",month_december:"Dezember",timeline_no_start_field:"W\xE4hlen Sie ein Startfeld in der Symbolleiste aus, um die Zeitleiste anzuzeigen.",timeline_no_interval:"Kein Intervall",timeline_scroll_prev:"Zur\xFCck scrollen",timeline_scroll_next:"Vorw\xE4rts scrollen",zoom_days:"Tage",zoom_weeks:"Wochen",zoom_months:"Monate",month_short_jan:"Jan",month_short_feb:"Feb",month_short_mar:"M\xE4r",month_short_apr:"Apr",month_short_may:"Mai",month_short_jun:"Jun",month_short_jul:"Jul",month_short_aug:"Aug",month_short_sep:"Sep",month_short_oct:"Okt",month_short_nov:"Nov",month_short_dec:"Dez",hierarchy_toggle:"Als hierarchie verwenden",hierarchy_toggle_hint:"Erm\xF6glicht Eltern-Kind-Beziehungen zwischen Zeilen in dieser Datenbank",add_subrow:"Unterzeile hinzuf\xFCgen",collapse_all:"Alle einklappen",expand_all:"Alle ausklappen",max_depth_reached:"Maximale tiefe erreicht (3 Ebenen)",chart_configure:"Konfigurieren",chart_type:"Diagrammtyp",chart_type_bar:"Balken",chart_type_line:"Linie",chart_type_pie:"Kreis",chart_x_axis:"Kategorien (X-Achse)",chart_y_axis:"Werte (Y-Achse)",chart_aggregation:"Aggregation",chart_select_column:"Spalte ausw\xE4hlen...",chart_count_records:"Anzahl",chart_no_config:"Konfigurieren Sie das Diagramm, um zu beginnen.",chart_no_config_hint:"W\xE4hlen Sie oben in der Symbolleiste eine Spalte f\xFCr Kategorien aus.",tooltip_pin_column:"Spalten bis hier fixieren",tooltip_unpin_column:"Spalten l\xF6sen",tooltip_resize_column:"Ziehen zum \xC4ndern der Gr\xF6\xDFe; Doppelklick zum Anpassen",tooltip_wrap_text:"Textumbruch",tooltip_include_subfolders:"Unterordner einbeziehen",folder_column:"Ordner",tooltip_manage_fields:"Felder verwalten",tooltip_batch_actions:"Stapelaktionen",tooltip_remove_filter:"Filter entfernen",tooltip_close:"Schlie\xDFen",tooltip_remove:"Entfernen",tooltip_move_up:"Nach oben",tooltip_move_down:"Nach unten",tooltip_change_color:"Farbe \xE4ndern",tooltip_delete_status:"Status l\xF6schen",status_not_started:"Nicht begonnen",status_in_progress:"In Bearbeitung",status_done:"Erledigt",status_cancelled:"Abgebrochen",relation_search_placeholder:"Suchen...",relation_clear:"L\xF6schen",relation_no_results:"Keine Ergebnisse",relation_two_way:"Bidirektionale relation",relation_two_way_hint:"Erstellt automatisch eine umgekehrte Relation in der Zieldatenbank",select_clear:"L\xF6schen",select_create_placeholder:"Neue Option erstellen...",status_new_placeholder:"Neuer Status...",color_custom:"Benutzerdefiniert",validate_non_numeric:'Zelle(n) enthalten nicht-numerische Werte (z.B.: "',validate_invalid_dates:'Zelle(n) enthalten Werte, die keine g\xFCltigen Daten sind (z.B.: "',validate_invalid_checkbox:'Zelle(n) enthalten Werte, die mit Checkbox inkompatibel sind (z.B.: "',validate_multiselect_to_select:"Zeile(n) haben mehrere Werte ausgew\xE4hlt. Entfernen Sie die Extras, bevor Sie zur Einzelauswahl wechseln.",validate_invalid_email:'Zelle(n) enthalten Werte, die keine g\xFCltigen E-Mails sind (z.B.: "',validate_invalid_url:'Zelle(n) enthalten Werte, die keine g\xFCltigen URLs sind (z.B.: "',validate_invalid_phone:'Zelle(n) enthalten Werte, die keine g\xFCltigen Telefonnummern sind (z.B.: "',validate_type_change_prefix:"Typ\xE4nderung nicht m\xF6glich: ",email_invalid:"Ung\xFCltige E-Mail",op_is:"Ist",op_is_not:"Ist nicht",op_contains:"Enth\xE4lt",op_not_contains:"Enth\xE4lt nicht",op_starts_with:"Beginnt mit",op_ends_with:"Endet mit",op_is_empty:"Ist leer",op_is_not_empty:"Ist nicht leer",op_gt:">",op_gte:">=",op_lt:"<",op_lte:"<=",op_is_checked:"Ist aktiviert",op_is_unchecked:"Ist nicht aktiviert",settings_db_filename_name:"Datenbankdateiname",settings_db_filename_desc:"Name der speziellen Datei, die eine Datenbank in einem Ordner identifiziert.",settings_row_height_name:"Standard-Zeilenh\xF6he",settings_row_height_desc:"H\xF6he in Pixeln jeder Tabellenzeile.",settings_inline_fields_name:"Dataview-Inline-Felder lesen",settings_inline_fields_desc:"Liest key:: value-Felder aus dem Notiztext und zeigt sie als Spaltenwerte an (schreibgesch\xFCtzt)",db_untitled_note:"Unbenannt",db_copy_suffix:"(Kopie)",db_copy_suffix_n:"(Kopie $n)",db_already_exists:'Eine Datenbank existiert bereits in "$folder"',db_tip_body:"Diese Datei ist eine Datenbank. \xD6ffnen Sie sie, um die Tabellenansicht zu sehen.",formula_err_unclosed_string:"Nicht geschlossene Zeichenkette an Position $pos",formula_err_unclosed_bracket:"Nicht geschlossene Klammer an Position $pos",formula_err_unexpected_bang:"Unerwartetes Zeichen '!' an Position $pos",formula_err_unexpected_char:"Unerwartetes Zeichen '$char' an Position $pos",formula_err_expected_token:"Erwartet $expected, gefunden '$found' an Position $pos",formula_err_unexpected_token:"Unerwartetes Token '$token' an Position $pos",formula_err_circular_ref:'Zirkul\xE4re Referenz: "$name" ist eine Formelspalte',formula_err_unknown_fn:"Unbekannte Funktion: $fn()",formula_err_if_args:"Erwartet if(Bedingung, wenn_wahr, [wenn_falsch])",formula_err_avg_args:"Erwartet avg(Spalte) \u2014 ben\xF6tigt eine Spaltenreferenz als Argument",formula_err_count_args:"Erwartet count(Spalte) \u2014 ben\xF6tigt eine Spaltenreferenz als Argument",formula_err_mid_args:"Erwartet mid(Text, Start, L\xE4nge)",formula_err_mod_args:"Erwartet mod(Zahl, Divisor)",formula_err_sqrt_args:"Erwartet sqrt(Zahl)",formula_err_not_implemented:"Funktion nicht implementiert: $fn()",plugin_display_name:"Notion bases",no_databases_found:'Keine Datenbanken gefunden. Verwenden Sie den Befehl "Neue Datenbank erstellen", um eine zu erstellen.',cmd_open_database:"Datenbank f\xFCr diesen Ordner \xF6ffnen",cmd_create_database:"Neue Datenbank im aktuellen Ordner erstellen",cmd_quick_add:"Zeile schnell zur Datenbank hinzuf\xFCgen",quick_add_title:"Schnell hinzuf\xFCgen",quick_add_note_title:"Titel",quick_add_note_title_placeholder:"Notiztitel...",quick_add_create:"Erstellen",quick_add_create_and_open:"Erstellen und \xF6ffnen",quick_add_no_visible_fields:"Keine bearbeitbaren Felder in dieser Datenbank",picker_placeholder:"Datenbank ausw\xE4hlen...",picker_root:"/ (Stammverzeichnis)",view_fallback_name:"Datenbank"},_m=fb;var gb={view_table:"\u8868\u683C",view_list:"\u5217\u8868",view_board:"\u770B\u677F",view_gallery:"\u753B\u5ECA",view_calendar:"\u65E5\u5386",view_timeline:"\u65F6\u95F4\u7EBF",view_chart:"\u56FE\u8868",add_view:"\u6DFB\u52A0\u89C6\u56FE",remove_view:"\u5220\u9664\u89C6\u56FE",rename_view_hint:"\u53CC\u51FB\u91CD\u547D\u540D",fields:"\u5B57\u6BB5",filter:"\u7B5B\u9009",filters:"\u7B5B\u9009",sort:"\u6392\u5E8F",actions:"\u64CD\u4F5C",group_by:"\u5206\u7EC4",cover:"\u5C01\u9762",date_field:"\u65E5\u671F",start_field:"\u5F00\u59CB",end_field:"\u7ED3\u675F",group_field:"\u5206\u7EC4",fields_in_card:"\u5361\u7247\u4E2D\u7684\u5B57\u6BB5",fields_label:"\u5B57\u6BB5",fields_on_bars:"\u6761\u5F62\u4E0A\u7684\u5B57\u6BB5",filter_by:"\u7B5B\u9009\u6761\u4EF6",sort_by:"\u6392\u5E8F\u6761\u4EF6",group_by_label:"\u5206\u7EC4\u6761\u4EF6",date_field_label:"\u65E5\u671F\u5B57\u6BB5",cover_field_label:"\u5C01\u9762\u5B57\u6BB5",card_size_label:"\u5361\u7247\u5927\u5C0F",row_height_label:"\u884C\u9AD8",none_value:"\u65E0",no_value:"\u65E0\u503C",no_cover:"\u65E0",size_small:"\u5C0F",size_medium:"\u4E2D",size_large:"\u5927",height_compact:"\u7D27\u51D1",height_medium:"\u4E2D\u7B49",height_tall:"\u9AD8",add_filter_advanced:"\u6DFB\u52A0\u9AD8\u7EA7\u7B5B\u9009",add_sort:"\u6DFB\u52A0\u6392\u5E8F",no_active_sorts:"\u65E0\u6D3B\u8DC3\u6392\u5E8F",name_column:"\u540D\u79F0",conjunction_and:"\u4E14",conjunction_or:"\u6216",filter_number_placeholder:"\u6570\u5B57...",filter_value_placeholder:"\u503C...",delete_selected:"\u5220\u9664\u6240\u6709\u9009\u4E2D\u9879",move_selected:"\u79FB\u52A8\u6240\u6709\u9009\u4E2D\u9879",duplicate_selected:"\u590D\u5236\u6240\u6709\u9009\u4E2D\u9879",export_csv:"\u5BFC\u51FA CSV",import_csv:"\u5BFC\u5165 CSV",open_note:"\u6253\u5F00\u7B14\u8BB0",delete_note:"\u5220\u9664\u7B14\u8BB0",duplicate_note:"\u590D\u5236\u7B14\u8BB0",sort_asc:"\u5347\u5E8F",sort_desc:"\u964D\u5E8F",sort_asc_title:"\u964D\u5E8F\u6392\u5217",sort_desc_title:"\u79FB\u9664\u6392\u5E8F",sort_none_title:"\u5347\u5E8F\u6392\u5217",rename_column:"\u91CD\u547D\u540D",edit_formula:"\u7F16\u8F91\u516C\u5F0F",configure_lookup:"\u914D\u7F6E lookup",configure_relation:"\u914D\u7F6E\u5173\u8054",format_number:"\u6570\u5B57\u683C\u5F0F",configure_image_folder:"\u914D\u7F6E\u56FE\u7247\u6587\u4EF6\u5939",field_type_label:"\u5B57\u6BB5\u7C7B\u578B",hide_field:"\u9690\u85CF\u5B57\u6BB5",delete_field:"\u5220\u9664\u5B57\u6BB5",type_title:"\u6807\u9898",type_text:"\u6587\u672C",type_number:"\u6570\u5B57",type_select:"\u5355\u9009",type_multiselect:"\u591A\u9009",type_date:"\u65E5\u671F",type_checkbox:"\u590D\u9009\u6846",type_url:"URL",type_email:"\u90AE\u7BB1",type_phone:"\u7535\u8BDD",type_status:"\u72B6\u6001",type_formula:"\u516C\u5F0F",type_relation:"\u5173\u8054",type_lookup:"Lookup",type_rollup:"Rollup",rollup_panel_title:"Rollup",configure_rollup:"\u914D\u7F6E rollup",rollup_select_relation:"1. \u5173\u8054\u5217",rollup_select_relation_placeholder:"\u9009\u62E9\u5173\u8054...",rollup_select_target:"2. \u76EE\u6807\u5217",rollup_select_target_placeholder:"\u9009\u62E9\u5217...",rollup_select_function:"3. \u805A\u5408\u51FD\u6570",rollup_no_relations:"\u672A\u627E\u5230\u5173\u8054\u5217\u3002\u8BF7\u5148\u6DFB\u52A0\u4E00\u4E2A\u5173\u8054\u5217\u3002",rollup_fn_sum:"\u6C42\u548C",rollup_fn_count:"\u8BA1\u6570",rollup_fn_avg:"\u5E73\u5747\u503C",rollup_fn_min:"\u6700\u5C0F\u503C",rollup_fn_max:"\u6700\u5927\u503C",rollup_fn_count_values:"\u8BA1\u552F\u4E00\u503C",rollup_fn_list:"\u5217\u51FA\u5168\u90E8",type_image:"\u56FE\u7247",type_audio:"\u97F3\u9891",audio_path_placeholder:"\u97F3\u9891\u6587\u4EF6\u8DEF\u5F84...",audio_select_placeholder:"\u9009\u62E9\u97F3\u9891...",audio_picker_title:"\u9009\u62E9\u97F3\u9891",audio_picker_clear:"\u6E05\u9664",audio_picker_empty_folder:"\u6587\u4EF6\u5939\u4E2D\u6CA1\u6709\u97F3\u9891\u6587\u4EF6",audio_picker_empty_vault:"\u4ED3\u5E93\u4E2D\u6CA1\u6709\u97F3\u9891\u6587\u4EF6",audio_panel_title:"\u97F3\u9891\u8BBE\u7F6E",audio_folder_label:"\u6765\u6E90\u6587\u4EF6\u5939\uFF08\u7559\u7A7A\u5219\u4F7F\u7528\u6574\u4E2A\u4ED3\u5E93\uFF09",audio_folder_placeholder:"\u4F8B\uFF1Aaudio/music",configure_audio_folder:"\u914D\u7F6E\u97F3\u9891\u6587\u4EF6\u5939",type_video:"\u89C6\u9891",video_select_placeholder:"\u9009\u62E9\u89C6\u9891...",video_picker_clear:"\u6E05\u9664",video_picker_empty_folder:"\u6587\u4EF6\u5939\u4E2D\u6CA1\u6709\u89C6\u9891\u6587\u4EF6",video_picker_empty_vault:"\u4ED3\u5E93\u4E2D\u6CA1\u6709\u89C6\u9891\u6587\u4EF6",video_panel_title:"\u89C6\u9891\u8BBE\u7F6E",video_folder_label:"\u6765\u6E90\u6587\u4EF6\u5939\uFF08\u7559\u7A7A\u5219\u4F7F\u7528\u6574\u4E2A\u4ED3\u5E93\uFF09",video_folder_placeholder:"\u4F8B\uFF1Avideo/clips",configure_video_folder:"\u914D\u7F6E\u89C6\u9891\u6587\u4EF6\u5939",formula_panel_title:"\u516C\u5F0F",formula_placeholder:'\u793A\u4F8B\uFF1Aif(status = "done", 1, 0)',formula_valid:"\u8BED\u6CD5\u6B63\u786E",formula_available_cols:"\u53EF\u7528\u5217\uFF1A",formula_ref_toggle:"\u51FD\u6570\u53C2\u8003",formula_save:"\u4FDD\u5B58",formula_cancel:"\u53D6\u6D88",formula_save_hint:"\u4FDD\u5B58 (Ctrl+Enter)",formula_group_logic:"\u903B\u8F91",formula_group_comparators:"\u6BD4\u8F83",formula_group_aggregators:"\u805A\u5408",formula_group_text:"\u6587\u672C",formula_group_math:"\u6570\u5B66",formula_group_utils:"\u5DE5\u5177",number_format_title:"\u683C\u5F0F",number_decimals_label:"\u5C0F\u6570\u4F4D\u6570",number_thousands_label:"\u5343\u4F4D\u5206\u9694\u7B26",number_prefix_label:"\u524D\u7F00",number_suffix_label:"\u540E\u7F00",number_prefix_placeholder:"\u4F8B\uFF1A$\u3001\xA5",number_suffix_placeholder:"\u4F8B\uFF1A%\u3001kg\u3001km",number_remove_format:"\u79FB\u9664\u683C\u5F0F",relation_panel_title:"\u5173\u8054",lookup_panel_title:"Lookup",lookup_ref_table:"1. \u5F15\u7528\u8868",lookup_select_table:"\u9009\u62E9\u8868...",lookup_col_to_display:"2. \u663E\u793A\u5217",lookup_origin_col:"2. \u503C\u7684\u6765\u6E90\u5B57\u6BB5",lookup_select_col:"\u9009\u62E9\u5217...",lookup_file_name:"\u6587\u4EF6\u540D",lookup_join_col:"3. \u8FDE\u63A5\u5217\uFF08\u672C\u8868\uFF09",lookup_join_col_title:"\u6587\u4EF6\u540D\uFF08\u6309\u6807\u9898\u8FDE\u63A5\uFF09",lookup_select_join_col:"\u9009\u62E9\u5217...",lookup_hint:"\u6B64\u5217\u7684\u503C\u5FC5\u987B\u4E0E\u5F15\u7528\u8868\u4E2D\u7684\u6587\u4EF6\u540D\u5339\u914D",image_panel_title:"\u56FE\u7247",image_folder_label:"\u6765\u6E90\u6587\u4EF6\u5939\uFF08\u53EF\u9009\uFF09",image_folder_placeholder:"\u4F8B\uFF1Aimages/covers",image_picker_title:"\u9009\u62E9\u56FE\u7247",image_picker_clear:"\u6E05\u9664",image_picker_empty_vault:"\u4ED3\u5E93\u4E2D\u672A\u627E\u5230\u56FE\u7247",image_picker_empty_folder:"\u672A\u627E\u5230\u56FE\u7247\u4E8E",image_select_placeholder:"\u9009\u62E9\u56FE\u7247\u2026",agg_none:"\u65E0",agg_count:"\u8BA1\u6570",agg_count_values:"\u8BA1\u6570\u503C",agg_sum:"\u6C42\u548C",agg_avg:"\u5E73\u5747\u503C",agg_min:"\u6700\u5C0F\u503C",agg_max:"\u6700\u5927\u503C",no_database_open:"\u672A\u6253\u5F00\u6570\u636E\u5E93\u3002",no_database_hint:'\u4F7F\u7528\u5DE5\u5177\u680F\u6309\u94AE\u6216"\u521B\u5EFA\u65B0\u6570\u636E\u5E93"\u547D\u4EE4\u3002',loading:"\u52A0\u8F7D\u4E2D...",no_results:"\u672A\u627E\u5230\u9879\u76EE",item_singular:"\u9879",item_plural:"\u9879",row_singular:"\u884C",row_plural:"\u884C",record_singular:"\u8BB0\u5F55",record_plural:"\u8BB0\u5F55",add_row:"\u65B0\u5EFA\u884C",add_entry:"\u65B0\u5EFA\u6761\u76EE",add_card:"\u65B0\u5EFA\u5361\u7247",new_field:"\u65B0\u5B57\u6BB5",add_field:"\u6DFB\u52A0\u5B57\u6BB5",board_no_select_col:"\u770B\u677F\u9700\u8981\u4E00\u4E2A\u5355\u9009\u6216\u72B6\u6001\u5217\u6765\u5206\u7EC4\u5361\u7247\u3002",board_add_select_hint:"\u5728\u8868\u683C\u89C6\u56FE\u4E2D\u6DFB\u52A0\u8BE5\u7C7B\u578B\u7684\u5217\uFF0C\u7136\u540E\u56DE\u5230\u8FD9\u91CC\u3002",board_drag_reorder:"\u62D6\u52A8\u4EE5\u91CD\u65B0\u6392\u5E8F",board_set_limit:"\u70B9\u51FB\u8BBE\u7F6E\u5361\u7247\u9650\u5236",board_limit_placeholder:"\u9650\u5236 (0 = \u65E0)",board_show_more:"\u66F4\u591A",board_show_less:"\u6536\u8D77",hide_empty_cols:"\u9690\u85CF\u7A7A\u5217",hide_no_value_cols:"\u9690\u85CF\u65E0\u503C\u5217",calendar_no_date_field:"\u5728\u5DE5\u5177\u680F\u4E2D\u9009\u62E9\u4E00\u4E2A\u65E5\u671F\u5B57\u6BB5\u4EE5\u663E\u793A\u65E5\u5386\u3002",calendar_no_date_section:"\u65E0\u65E5\u671F",calendar_click_to_create:"\u70B9\u51FB\u521B\u5EFA\u7B14\u8BB0",calendar_today:"\u4ECA\u5929",calendar_prev_month:"\u4E0A\u4E2A\u6708",calendar_next_month:"\u4E0B\u4E2A\u6708",calendar_view_month:"\u6708",calendar_view_week:"\u5468",calendar_prev_week:"\u4E0A\u4E00\u5468",calendar_next_week:"\u4E0B\u4E00\u5468",calendar_add_time:"\u6DFB\u52A0\u65F6\u95F4",calendar_remove_time:"\u79FB\u9664\u65F6\u95F4",calendar_all_day:"\u5168\u5929",day_sun:"\u65E5",day_mon:"\u4E00",day_tue:"\u4E8C",day_wed:"\u4E09",day_thu:"\u56DB",day_fri:"\u4E94",day_sat:"\u516D",month_january:"\u4E00\u6708",month_february:"\u4E8C\u6708",month_march:"\u4E09\u6708",month_april:"\u56DB\u6708",month_may:"\u4E94\u6708",month_june:"\u516D\u6708",month_july:"\u4E03\u6708",month_august:"\u516B\u6708",month_september:"\u4E5D\u6708",month_october:"\u5341\u6708",month_november:"\u5341\u4E00\u6708",month_december:"\u5341\u4E8C\u6708",timeline_no_start_field:"\u5728\u5DE5\u5177\u680F\u4E2D\u9009\u62E9\u4E00\u4E2A\u5F00\u59CB\u5B57\u6BB5\u4EE5\u663E\u793A\u65F6\u95F4\u7EBF\u3002",timeline_no_interval:"\u65E0\u95F4\u9694",timeline_scroll_prev:"\u5411\u524D\u6EDA\u52A8",timeline_scroll_next:"\u5411\u540E\u6EDA\u52A8",zoom_days:"\u5929",zoom_weeks:"\u5468",zoom_months:"\u6708",month_short_jan:"1\u6708",month_short_feb:"2\u6708",month_short_mar:"3\u6708",month_short_apr:"4\u6708",month_short_may:"5\u6708",month_short_jun:"6\u6708",month_short_jul:"7\u6708",month_short_aug:"8\u6708",month_short_sep:"9\u6708",month_short_oct:"10\u6708",month_short_nov:"11\u6708",month_short_dec:"12\u6708",hierarchy_toggle:"\u7528\u4F5C\u5C42\u7EA7",hierarchy_toggle_hint:"\u542F\u7528\u6B64\u6570\u636E\u5E93\u4E2D\u884C\u4E4B\u95F4\u7684\u7236\u5B50\u5173\u7CFB",add_subrow:"\u6DFB\u52A0\u5B50\u884C",collapse_all:"\u5168\u90E8\u6298\u53E0",expand_all:"\u5168\u90E8\u5C55\u5F00",max_depth_reached:"\u5DF2\u8FBE\u5230\u6700\u5927\u6DF1\u5EA6\uFF083 \u5C42\uFF09",chart_configure:"\u914D\u7F6E",chart_type:"\u56FE\u8868\u7C7B\u578B",chart_type_bar:"\u67F1\u72B6\u56FE",chart_type_line:"\u6298\u7EBF\u56FE",chart_type_pie:"\u997C\u56FE",chart_x_axis:"\u5206\u7C7B (X \u8F74)",chart_y_axis:"\u6570\u503C (Y \u8F74)",chart_aggregation:"\u805A\u5408",chart_select_column:"\u9009\u62E9\u5217...",chart_count_records:"\u8BA1\u6570",chart_no_config:"\u8BF7\u914D\u7F6E\u56FE\u8868\u4EE5\u5F00\u59CB\u4F7F\u7528\u3002",chart_no_config_hint:"\u5728\u4E0A\u65B9\u5DE5\u5177\u680F\u4E2D\u9009\u62E9\u4E00\u4E2A\u5206\u7C7B\u5217\u3002",tooltip_pin_column:"\u56FA\u5B9A\u5230\u6B64\u5217",tooltip_unpin_column:"\u53D6\u6D88\u56FA\u5B9A\u5217",tooltip_resize_column:"\u62D6\u52A8\u8C03\u6574\u5927\u5C0F\uFF1B\u53CC\u51FB\u9002\u5E94\u5185\u5BB9",tooltip_wrap_text:"\u6587\u5B57\u6362\u884C",tooltip_include_subfolders:"\u5305\u542B\u5B50\u6587\u4EF6\u5939",folder_column:"\u6587\u4EF6\u5939",tooltip_manage_fields:"\u7BA1\u7406\u5B57\u6BB5",tooltip_batch_actions:"\u6279\u91CF\u64CD\u4F5C",tooltip_remove_filter:"\u79FB\u9664\u7B5B\u9009",tooltip_close:"\u5173\u95ED",tooltip_remove:"\u79FB\u9664",tooltip_move_up:"\u4E0A\u79FB",tooltip_move_down:"\u4E0B\u79FB",tooltip_change_color:"\u66F4\u6539\u989C\u8272",tooltip_delete_status:"\u5220\u9664\u72B6\u6001",status_not_started:"\u672A\u5F00\u59CB",status_in_progress:"\u8FDB\u884C\u4E2D",status_done:"\u5DF2\u5B8C\u6210",status_cancelled:"\u5DF2\u53D6\u6D88",relation_search_placeholder:"\u641C\u7D22...",relation_clear:"\u6E05\u9664",relation_no_results:"\u65E0\u7ED3\u679C",relation_two_way:"\u53CC\u5411\u5173\u8054",relation_two_way_hint:"\u81EA\u52A8\u5728\u76EE\u6807\u6570\u636E\u5E93\u4E2D\u521B\u5EFA\u53CD\u5411\u5173\u8054",select_clear:"\u6E05\u9664",select_create_placeholder:"\u521B\u5EFA\u65B0\u9009\u9879...",status_new_placeholder:"\u65B0\u72B6\u6001...",color_custom:"\u81EA\u5B9A\u4E49",validate_non_numeric:'\u5355\u5143\u683C\u5305\u542B\u975E\u6570\u5B57\u503C\uFF08\u4F8B\uFF1A"',validate_invalid_dates:'\u5355\u5143\u683C\u5305\u542B\u65E0\u6548\u65E5\u671F\u503C\uFF08\u4F8B\uFF1A"',validate_invalid_checkbox:'\u5355\u5143\u683C\u5305\u542B\u4E0E\u590D\u9009\u6846\u4E0D\u517C\u5BB9\u7684\u503C\uFF08\u4F8B\uFF1A"',validate_multiselect_to_select:"\u884C\u6709\u591A\u4E2A\u9009\u4E2D\u503C\u3002\u8BF7\u5728\u5207\u6362\u5230\u5355\u9009\u524D\u79FB\u9664\u591A\u4F59\u7684\u503C\u3002",validate_invalid_email:'\u5355\u5143\u683C\u5305\u542B\u65E0\u6548\u90AE\u7BB1\u503C\uFF08\u4F8B\uFF1A"',validate_invalid_url:'\u5355\u5143\u683C\u5305\u542B\u65E0\u6548 URL \u503C\uFF08\u4F8B\uFF1A"',validate_invalid_phone:'\u5355\u5143\u683C\u5305\u542B\u65E0\u6548\u7535\u8BDD\u53F7\u7801\uFF08\u4F8B\uFF1A"',validate_type_change_prefix:"\u65E0\u6CD5\u66F4\u6539\u7C7B\u578B\uFF1A",email_invalid:"\u65E0\u6548\u90AE\u7BB1",op_is:"\u7B49\u4E8E",op_is_not:"\u4E0D\u7B49\u4E8E",op_contains:"\u5305\u542B",op_not_contains:"\u4E0D\u5305\u542B",op_starts_with:"\u5F00\u5934\u662F",op_ends_with:"\u7ED3\u5C3E\u662F",op_is_empty:"\u4E3A\u7A7A",op_is_not_empty:"\u4E0D\u4E3A\u7A7A",op_gt:">",op_gte:">=",op_lt:"<",op_lte:"<=",op_is_checked:"\u5DF2\u52FE\u9009",op_is_unchecked:"\u672A\u52FE\u9009",settings_db_filename_name:"\u6570\u636E\u5E93\u6587\u4EF6\u540D",settings_db_filename_desc:"\u7528\u4E8E\u6807\u8BC6\u6587\u4EF6\u5939\u4E2D\u6570\u636E\u5E93\u7684\u7279\u6B8A\u6587\u4EF6\u540D\u3002",settings_row_height_name:"\u9ED8\u8BA4\u884C\u9AD8",settings_row_height_desc:"\u6BCF\u4E2A\u8868\u683C\u884C\u7684\u50CF\u7D20\u9AD8\u5EA6\u3002",settings_inline_fields_name:"\u8BFB\u53D6 dataview \u5185\u8054\u5B57\u6BB5",settings_inline_fields_desc:"\u89E3\u6790\u7B14\u8BB0\u6B63\u6587\u4E2D\u7684 key:: value \u5B57\u6BB5\u5E76\u5C06\u5176\u663E\u793A\u4E3A\u5217\u503C\uFF08\u53EA\u8BFB\uFF09",db_untitled_note:"\u672A\u547D\u540D",db_copy_suffix:"(\u526F\u672C)",db_copy_suffix_n:"(\u526F\u672C $n)",db_already_exists:'"$folder" \u4E2D\u5DF2\u5B58\u5728\u6570\u636E\u5E93',db_tip_body:"\u6B64\u6587\u4EF6\u662F\u4E00\u4E2A\u6570\u636E\u5E93\u3002\u6253\u5F00\u5B83\u4EE5\u67E5\u770B\u8868\u683C\u89C6\u56FE\u3002",formula_err_unclosed_string:"\u4F4D\u7F6E $pos \u5904\u5B57\u7B26\u4E32\u672A\u5173\u95ED",formula_err_unclosed_bracket:"\u4F4D\u7F6E $pos \u5904\u62EC\u53F7\u672A\u5173\u95ED",formula_err_unexpected_bang:"\u4F4D\u7F6E $pos \u5904\u51FA\u73B0\u610F\u5916\u5B57\u7B26 '!'",formula_err_unexpected_char:"\u4F4D\u7F6E $pos \u5904\u51FA\u73B0\u610F\u5916\u5B57\u7B26 '$char'",formula_err_expected_token:"\u4F4D\u7F6E $pos \u5904\u671F\u671B $expected\uFF0C\u627E\u5230 '$found'",formula_err_unexpected_token:"\u4F4D\u7F6E $pos \u5904\u51FA\u73B0\u610F\u5916\u6807\u8BB0 '$token'",formula_err_circular_ref:'\u5FAA\u73AF\u5F15\u7528\uFF1A"$name" \u662F\u4E00\u4E2A\u516C\u5F0F\u5217',formula_err_unknown_fn:"\u672A\u77E5\u51FD\u6570\uFF1A$fn()",formula_err_if_args:"\u671F\u671B if(\u6761\u4EF6, \u771F\u503C, [\u5047\u503C])",formula_err_avg_args:"\u671F\u671B avg(\u5217) \u2014 \u9700\u8981\u5217\u5F15\u7528\u4F5C\u4E3A\u53C2\u6570",formula_err_count_args:"\u671F\u671B count(\u5217) \u2014 \u9700\u8981\u5217\u5F15\u7528\u4F5C\u4E3A\u53C2\u6570",formula_err_mid_args:"\u671F\u671B mid(\u6587\u672C, \u8D77\u59CB, \u957F\u5EA6)",formula_err_mod_args:"\u671F\u671B mod(\u6570\u5B57, \u9664\u6570)",formula_err_sqrt_args:"\u671F\u671B sqrt(\u6570\u5B57)",formula_err_not_implemented:"\u51FD\u6570\u672A\u5B9E\u73B0\uFF1A$fn()",plugin_display_name:"Notion bases",no_databases_found:'\u672A\u627E\u5230\u6570\u636E\u5E93\u3002\u4F7F\u7528"\u521B\u5EFA\u65B0\u6570\u636E\u5E93"\u547D\u4EE4\u6765\u521B\u5EFA\u4E00\u4E2A\u3002',cmd_open_database:"\u6253\u5F00\u6B64\u6587\u4EF6\u5939\u7684\u6570\u636E\u5E93",cmd_create_database:"\u5728\u5F53\u524D\u6587\u4EF6\u5939\u521B\u5EFA\u65B0\u6570\u636E\u5E93",cmd_quick_add:"\u5FEB\u901F\u5411\u6570\u636E\u5E93\u6DFB\u52A0\u884C",quick_add_title:"\u5FEB\u901F\u6DFB\u52A0",quick_add_note_title:"\u6807\u9898",quick_add_note_title_placeholder:"\u7B14\u8BB0\u6807\u9898...",quick_add_create:"\u521B\u5EFA",quick_add_create_and_open:"\u521B\u5EFA\u5E76\u6253\u5F00",quick_add_no_visible_fields:"\u6B64\u6570\u636E\u5E93\u4E2D\u6CA1\u6709\u53EF\u7F16\u8F91\u5B57\u6BB5",picker_placeholder:"\u9009\u62E9\u6570\u636E\u5E93...",picker_root:"/\uFF08\u6839\u76EE\u5F55\uFF09",view_fallback_name:"\u6570\u636E\u5E93"},Ku=gb;var hb={view_table:"\u30C6\u30FC\u30D6\u30EB",view_list:"\u30EA\u30B9\u30C8",view_board:"\u30DC\u30FC\u30C9",view_gallery:"\u30AE\u30E3\u30E9\u30EA\u30FC",view_calendar:"\u30AB\u30EC\u30F3\u30C0\u30FC",view_timeline:"\u30BF\u30A4\u30E0\u30E9\u30A4\u30F3",view_chart:"\u30C1\u30E3\u30FC\u30C8",add_view:"\u30D3\u30E5\u30FC\u3092\u8FFD\u52A0",remove_view:"\u30D3\u30E5\u30FC\u3092\u524A\u9664",rename_view_hint:"\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u540D\u524D\u5909\u66F4",fields:"\u30D5\u30A3\u30FC\u30EB\u30C9",filter:"\u30D5\u30A3\u30EB\u30BF\u30FC",filters:"\u30D5\u30A3\u30EB\u30BF\u30FC",sort:"\u4E26\u3079\u66FF\u3048",actions:"\u30A2\u30AF\u30B7\u30E7\u30F3",group_by:"\u30B0\u30EB\u30FC\u30D7\u5316",cover:"\u30AB\u30D0\u30FC",date_field:"\u65E5\u4ED8",start_field:"\u958B\u59CB",end_field:"\u7D42\u4E86",group_field:"\u30B0\u30EB\u30FC\u30D7",fields_in_card:"\u30AB\u30FC\u30C9\u306E\u30D5\u30A3\u30FC\u30EB\u30C9",fields_label:"\u30D5\u30A3\u30FC\u30EB\u30C9",fields_on_bars:"\u30D0\u30FC\u306E\u30D5\u30A3\u30FC\u30EB\u30C9",filter_by:"\u30D5\u30A3\u30EB\u30BF\u30FC\u6761\u4EF6",sort_by:"\u4E26\u3079\u66FF\u3048\u6761\u4EF6",group_by_label:"\u30B0\u30EB\u30FC\u30D7\u5316\u6761\u4EF6",date_field_label:"\u65E5\u4ED8\u30D5\u30A3\u30FC\u30EB\u30C9",cover_field_label:"\u30AB\u30D0\u30FC\u30D5\u30A3\u30FC\u30EB\u30C9",card_size_label:"\u30AB\u30FC\u30C9\u30B5\u30A4\u30BA",row_height_label:"\u884C\u306E\u9AD8\u3055",none_value:"\u306A\u3057",no_value:"\u5024\u306A\u3057",no_cover:"\u306A\u3057",size_small:"\u5C0F",size_medium:"\u4E2D",size_large:"\u5927",height_compact:"\u30B3\u30F3\u30D1\u30AF\u30C8",height_medium:"\u6A19\u6E96",height_tall:"\u9AD8\u3044",add_filter_advanced:"\u8A73\u7D30\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8FFD\u52A0",add_sort:"\u4E26\u3079\u66FF\u3048\u3092\u8FFD\u52A0",no_active_sorts:"\u30A2\u30AF\u30C6\u30A3\u30D6\u306A\u4E26\u3079\u66FF\u3048\u306A\u3057",name_column:"\u540D\u524D",conjunction_and:"\u304B\u3064",conjunction_or:"\u307E\u305F\u306F",filter_number_placeholder:"\u6570\u5024...",filter_value_placeholder:"\u5024...",delete_selected:"\u9078\u629E\u9805\u76EE\u3092\u3059\u3079\u3066\u524A\u9664",move_selected:"\u9078\u629E\u9805\u76EE\u3092\u3059\u3079\u3066\u79FB\u52D5",duplicate_selected:"\u9078\u629E\u9805\u76EE\u3092\u3059\u3079\u3066\u8907\u88FD",export_csv:"CSV \u30A8\u30AF\u30B9\u30DD\u30FC\u30C8",import_csv:"CSV \u30A4\u30F3\u30DD\u30FC\u30C8",open_note:"\u30CE\u30FC\u30C8\u3092\u958B\u304F",delete_note:"\u30CE\u30FC\u30C8\u3092\u524A\u9664",duplicate_note:"\u30CE\u30FC\u30C8\u3092\u8907\u88FD",sort_asc:"\u6607\u9806",sort_desc:"\u964D\u9806",sort_asc_title:"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048",sort_desc_title:"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664",sort_none_title:"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048",rename_column:"\u540D\u524D\u5909\u66F4",edit_formula:"\u6570\u5F0F\u3092\u7DE8\u96C6",configure_lookup:"Lookup \u3092\u8A2D\u5B9A",configure_relation:"\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3\u3092\u8A2D\u5B9A",format_number:"\u6570\u5024\u306E\u66F8\u5F0F",configure_image_folder:"\u753B\u50CF\u30D5\u30A9\u30EB\u30C0\u30FC\u3092\u8A2D\u5B9A",field_type_label:"\u30D5\u30A3\u30FC\u30EB\u30C9\u30BF\u30A4\u30D7",hide_field:"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u975E\u8868\u793A",delete_field:"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u524A\u9664",type_title:"\u30BF\u30A4\u30C8\u30EB",type_text:"\u30C6\u30AD\u30B9\u30C8",type_number:"\u6570\u5024",type_select:"\u9078\u629E",type_multiselect:"\u8907\u6570\u9078\u629E",type_date:"\u65E5\u4ED8",type_checkbox:"\u30C1\u30A7\u30C3\u30AF\u30DC\u30C3\u30AF\u30B9",type_url:"URL",type_email:"\u30E1\u30FC\u30EB",type_phone:"\u96FB\u8A71",type_status:"\u30B9\u30C6\u30FC\u30BF\u30B9",type_formula:"\u6570\u5F0F",type_relation:"\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3",type_lookup:"Lookup",type_rollup:"Rollup",rollup_panel_title:"Rollup",configure_rollup:"Rollup \u3092\u8A2D\u5B9A",rollup_select_relation:"1. \u30EA\u30EC\u30FC\u30B7\u30E7\u30F3\u5217",rollup_select_relation_placeholder:"\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3\u3092\u9078\u629E...",rollup_select_target:"2. \u30BF\u30FC\u30B2\u30C3\u30C8\u5217",rollup_select_target_placeholder:"\u5217\u3092\u9078\u629E...",rollup_select_function:"3. \u96C6\u8A08",rollup_no_relations:"\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3\u5217\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u5148\u306B\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3\u5217\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",rollup_fn_sum:"\u5408\u8A08",rollup_fn_count:"\u30AB\u30A6\u30F3\u30C8",rollup_fn_avg:"\u5E73\u5747",rollup_fn_min:"\u6700\u5C0F",rollup_fn_max:"\u6700\u5927",rollup_fn_count_values:"\u4E00\u610F\u3092\u30AB\u30A6\u30F3\u30C8",rollup_fn_list:"\u3059\u3079\u3066\u5217\u6319",type_image:"\u753B\u50CF",type_audio:"\u30AA\u30FC\u30C7\u30A3\u30AA",audio_path_placeholder:"\u97F3\u58F0\u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9...",audio_select_placeholder:"\u97F3\u58F0\u3092\u9078\u629E...",audio_picker_title:"\u97F3\u58F0\u3092\u9078\u629E",audio_picker_clear:"\u30AF\u30EA\u30A2",audio_picker_empty_folder:"\u30D5\u30A9\u30EB\u30C0\u30FC\u306B\u97F3\u58F0\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093",audio_picker_empty_vault:"\u4FDD\u7BA1\u5EAB\u306B\u97F3\u58F0\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093",audio_panel_title:"\u97F3\u58F0\u8A2D\u5B9A",audio_folder_label:"\u30BD\u30FC\u30B9\u30D5\u30A9\u30EB\u30C0\u30FC\uFF08\u7A7A\u306B\u3059\u308B\u3068\u4FDD\u7BA1\u5EAB\u5168\u4F53\u3092\u5BFE\u8C61\uFF09",audio_folder_placeholder:"\u4F8B\uFF1Aaudio/music",configure_audio_folder:"\u97F3\u58F0\u30D5\u30A9\u30EB\u30C0\u30FC\u3092\u8A2D\u5B9A",type_video:"\u52D5\u753B",video_select_placeholder:"\u52D5\u753B\u3092\u9078\u629E...",video_picker_clear:"\u30AF\u30EA\u30A2",video_picker_empty_folder:"\u30D5\u30A9\u30EB\u30C0\u30FC\u306B\u52D5\u753B\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093",video_picker_empty_vault:"\u4FDD\u7BA1\u5EAB\u306B\u52D5\u753B\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093",video_panel_title:"\u52D5\u753B\u8A2D\u5B9A",video_folder_label:"\u30BD\u30FC\u30B9\u30D5\u30A9\u30EB\u30C0\u30FC\uFF08\u7A7A\u306B\u3059\u308B\u3068\u4FDD\u7BA1\u5EAB\u5168\u4F53\u3092\u5BFE\u8C61\uFF09",video_folder_placeholder:"\u4F8B\uFF1Avideo/clips",configure_video_folder:"\u52D5\u753B\u30D5\u30A9\u30EB\u30C0\u30FC\u3092\u8A2D\u5B9A",formula_panel_title:"\u6570\u5F0F",formula_placeholder:'\u4F8B\uFF1Aif(status = "done", 1, 0)',formula_valid:"\u69CB\u6587\u306F\u6B63\u3057\u3044\u3067\u3059",formula_available_cols:"\u5229\u7528\u53EF\u80FD\u306A\u5217\uFF1A",formula_ref_toggle:"\u95A2\u6570\u30EA\u30D5\u30A1\u30EC\u30F3\u30B9",formula_save:"\u4FDD\u5B58",formula_cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",formula_save_hint:"\u4FDD\u5B58 (Ctrl+Enter)",formula_group_logic:"\u8AD6\u7406",formula_group_comparators:"\u6BD4\u8F03",formula_group_aggregators:"\u96C6\u8A08",formula_group_text:"\u30C6\u30AD\u30B9\u30C8",formula_group_math:"\u6570\u5B66",formula_group_utils:"\u30E6\u30FC\u30C6\u30A3\u30EA\u30C6\u30A3",number_format_title:"\u66F8\u5F0F",number_decimals_label:"\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u6570",number_thousands_label:"\u6841\u533A\u5207\u308A",number_prefix_label:"\u63A5\u982D\u8F9E",number_suffix_label:"\u63A5\u5C3E\u8F9E",number_prefix_placeholder:"\u4F8B\uFF1A$\u3001\xA5",number_suffix_placeholder:"\u4F8B\uFF1A%\u3001kg\u3001km",number_remove_format:"\u66F8\u5F0F\u3092\u524A\u9664",relation_panel_title:"\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3",lookup_panel_title:"Lookup",lookup_ref_table:"1. \u53C2\u7167\u30C6\u30FC\u30D6\u30EB",lookup_select_table:"\u30C6\u30FC\u30D6\u30EB\u3092\u9078\u629E...",lookup_col_to_display:"2. \u8868\u793A\u3059\u308B\u5217",lookup_origin_col:"2. \u5024\u306E\u30BD\u30FC\u30B9\u30D5\u30A3\u30FC\u30EB\u30C9",lookup_select_col:"\u5217\u3092\u9078\u629E...",lookup_file_name:"\u30D5\u30A1\u30A4\u30EB\u540D",lookup_join_col:"3. \u7D50\u5408\u5217\uFF08\u3053\u306E\u30C6\u30FC\u30D6\u30EB\uFF09",lookup_join_col_title:"\u30D5\u30A1\u30A4\u30EB\u540D\uFF08\u30BF\u30A4\u30C8\u30EB\u3067\u7D50\u5408\uFF09",lookup_select_join_col:"\u5217\u3092\u9078\u629E...",lookup_hint:"\u3053\u306E\u5217\u306E\u5024\u306F\u53C2\u7167\u30C6\u30FC\u30D6\u30EB\u306E\u30D5\u30A1\u30A4\u30EB\u540D\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",image_panel_title:"\u753B\u50CF",image_folder_label:"\u30BD\u30FC\u30B9\u30D5\u30A9\u30EB\u30C0\u30FC\uFF08\u4EFB\u610F\uFF09",image_folder_placeholder:"\u4F8B\uFF1Aimages/covers",image_picker_title:"\u753B\u50CF\u3092\u9078\u629E",image_picker_clear:"\u30AF\u30EA\u30A2",image_picker_empty_vault:"\u4FDD\u7BA1\u5EAB\u306B\u753B\u50CF\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",image_picker_empty_folder:"\u753B\u50CF\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\uFF1A",image_select_placeholder:"\u753B\u50CF\u3092\u9078\u629E\u2026",agg_none:"\u306A\u3057",agg_count:"\u30AB\u30A6\u30F3\u30C8",agg_count_values:"\u5024\u3092\u30AB\u30A6\u30F3\u30C8",agg_sum:"\u5408\u8A08",agg_avg:"\u5E73\u5747",agg_min:"\u6700\u5C0F",agg_max:"\u6700\u5927",no_database_open:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u304C\u958B\u304B\u308C\u3066\u3044\u307E\u305B\u3093\u3002",no_database_hint:"\u30EA\u30DC\u30F3\u30DC\u30BF\u30F3\u307E\u305F\u306F\u300C\u65B0\u3057\u3044\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u4F5C\u6210\u300D\u30B3\u30DE\u30F3\u30C9\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002",loading:"\u8AAD\u307F\u8FBC\u307F\u4E2D...",no_results:"\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",item_singular:"\u4EF6",item_plural:"\u4EF6",row_singular:"\u884C",row_plural:"\u884C",record_singular:"\u30EC\u30B3\u30FC\u30C9",record_plural:"\u30EC\u30B3\u30FC\u30C9",add_row:"\u65B0\u3057\u3044\u884C",add_entry:"\u65B0\u3057\u3044\u30A8\u30F3\u30C8\u30EA\u30FC",add_card:"\u65B0\u3057\u3044\u30AB\u30FC\u30C9",new_field:"\u65B0\u3057\u3044\u30D5\u30A3\u30FC\u30EB\u30C9",add_field:"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0",board_no_select_col:"\u30DC\u30FC\u30C9\u306B\u306F\u30AB\u30FC\u30C9\u3092\u30B0\u30EB\u30FC\u30D7\u5316\u3059\u308B\u305F\u3081\u306E\u9078\u629E\u307E\u305F\u306F\u30B9\u30C6\u30FC\u30BF\u30B9\u5217\u304C\u5FC5\u8981\u3067\u3059\u3002",board_add_select_hint:"\u30C6\u30FC\u30D6\u30EB\u30D3\u30E5\u30FC\u3067\u305D\u306E\u30BF\u30A4\u30D7\u306E\u5217\u3092\u8FFD\u52A0\u3057\u3066\u304B\u3089\u3001\u3053\u3053\u306B\u623B\u3063\u3066\u304F\u3060\u3055\u3044\u3002",board_drag_reorder:"\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u4E26\u3079\u66FF\u3048",board_set_limit:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30AB\u30FC\u30C9\u5236\u9650\u3092\u8A2D\u5B9A",board_limit_placeholder:"\u5236\u9650 (0 = \u306A\u3057)",board_show_more:"\u4EF6\u4EE5\u4E0A",board_show_less:"\u6298\u308A\u305F\u305F\u3080",hide_empty_cols:"\u7A7A\u3092\u975E\u8868\u793A",hide_no_value_cols:"\u5024\u306A\u3057\u3092\u975E\u8868\u793A",calendar_no_date_field:"\u30C4\u30FC\u30EB\u30D0\u30FC\u3067\u65E5\u4ED8\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u9078\u629E\u3057\u3066\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u8868\u793A\u3057\u307E\u3059\u3002",calendar_no_date_section:"\u65E5\u4ED8\u306A\u3057",calendar_click_to_create:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30CE\u30FC\u30C8\u3092\u4F5C\u6210",calendar_today:"\u4ECA\u65E5",calendar_prev_month:"\u524D\u6708",calendar_next_month:"\u7FCC\u6708",calendar_view_month:"\u6708",calendar_view_week:"\u9031",calendar_prev_week:"\u524D\u9031",calendar_next_week:"\u7FCC\u9031",calendar_add_time:"\u6642\u523B\u3092\u8FFD\u52A0",calendar_remove_time:"\u6642\u523B\u3092\u524A\u9664",calendar_all_day:"\u7D42\u65E5",day_sun:"\u65E5",day_mon:"\u6708",day_tue:"\u706B",day_wed:"\u6C34",day_thu:"\u6728",day_fri:"\u91D1",day_sat:"\u571F",month_january:"1\u6708",month_february:"2\u6708",month_march:"3\u6708",month_april:"4\u6708",month_may:"5\u6708",month_june:"6\u6708",month_july:"7\u6708",month_august:"8\u6708",month_september:"9\u6708",month_october:"10\u6708",month_november:"11\u6708",month_december:"12\u6708",timeline_no_start_field:"\u30C4\u30FC\u30EB\u30D0\u30FC\u3067\u958B\u59CB\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u9078\u629E\u3057\u3066\u30BF\u30A4\u30E0\u30E9\u30A4\u30F3\u3092\u8868\u793A\u3057\u307E\u3059\u3002",timeline_no_interval:"\u9593\u9694\u306A\u3057",timeline_scroll_prev:"\u524D\u306B\u30B9\u30AF\u30ED\u30FC\u30EB",timeline_scroll_next:"\u6B21\u306B\u30B9\u30AF\u30ED\u30FC\u30EB",zoom_days:"\u65E5",zoom_weeks:"\u9031",zoom_months:"\u6708",month_short_jan:"1\u6708",month_short_feb:"2\u6708",month_short_mar:"3\u6708",month_short_apr:"4\u6708",month_short_may:"5\u6708",month_short_jun:"6\u6708",month_short_jul:"7\u6708",month_short_aug:"8\u6708",month_short_sep:"9\u6708",month_short_oct:"10\u6708",month_short_nov:"11\u6708",month_short_dec:"12\u6708",hierarchy_toggle:"\u968E\u5C64\u3068\u3057\u3066\u4F7F\u7528",hierarchy_toggle_hint:"\u3053\u306E\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306E\u884C\u9593\u306B\u89AA\u5B50\u95A2\u4FC2\u3092\u6709\u52B9\u306B\u3057\u307E\u3059",add_subrow:"\u30B5\u30D6\u884C\u3092\u8FFD\u52A0",collapse_all:"\u3059\u3079\u3066\u6298\u308A\u305F\u305F\u3080",expand_all:"\u3059\u3079\u3066\u5C55\u958B",max_depth_reached:"\u6700\u5927\u306E\u6DF1\u3055\u306B\u9054\u3057\u307E\u3057\u305F\uFF083 \u30EC\u30D9\u30EB\uFF09",chart_configure:"\u8A2D\u5B9A",chart_type:"\u30B0\u30E9\u30D5\u306E\u7A2E\u985E",chart_type_bar:"\u68D2\u30B0\u30E9\u30D5",chart_type_line:"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5",chart_type_pie:"\u5186\u30B0\u30E9\u30D5",chart_x_axis:"\u30AB\u30C6\u30B4\u30EA\u30FC (X \u8EF8)",chart_y_axis:"\u5024 (Y \u8EF8)",chart_aggregation:"\u96C6\u8A08",chart_select_column:"\u5217\u3092\u9078\u629E...",chart_count_records:"\u30AB\u30A6\u30F3\u30C8",chart_no_config:"\u30B0\u30E9\u30D5\u3092\u8A2D\u5B9A\u3057\u3066\u59CB\u3081\u307E\u3057\u3087\u3046\u3002",chart_no_config_hint:"\u4E0A\u306E\u30C4\u30FC\u30EB\u30D0\u30FC\u3067\u30AB\u30C6\u30B4\u30EA\u30FC\u7528\u306E\u5217\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002",tooltip_pin_column:"\u3053\u3053\u307E\u3067\u306E\u5217\u3092\u56FA\u5B9A",tooltip_unpin_column:"\u5217\u306E\u56FA\u5B9A\u3092\u89E3\u9664",tooltip_resize_column:"\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30B5\u30A4\u30BA\u5909\u66F4\uFF1B\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u5185\u5BB9\u306B\u5408\u308F\u305B\u308B",tooltip_wrap_text:"\u30C6\u30AD\u30B9\u30C8\u306E\u6298\u308A\u8FD4\u3057",tooltip_include_subfolders:"\u30B5\u30D6\u30D5\u30A9\u30EB\u30C0\u30FC\u3092\u542B\u3081\u308B",folder_column:"\u30D5\u30A9\u30EB\u30C0\u30FC",tooltip_manage_fields:"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u7BA1\u7406",tooltip_batch_actions:"\u4E00\u62EC\u64CD\u4F5C",tooltip_remove_filter:"\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u524A\u9664",tooltip_close:"\u9589\u3058\u308B",tooltip_remove:"\u524A\u9664",tooltip_move_up:"\u4E0A\u306B\u79FB\u52D5",tooltip_move_down:"\u4E0B\u306B\u79FB\u52D5",tooltip_change_color:"\u8272\u3092\u5909\u66F4",tooltip_delete_status:"\u30B9\u30C6\u30FC\u30BF\u30B9\u3092\u524A\u9664",status_not_started:"\u672A\u7740\u624B",status_in_progress:"\u9032\u884C\u4E2D",status_done:"\u5B8C\u4E86",status_cancelled:"\u30AD\u30E3\u30F3\u30BB\u30EB\u6E08\u307F",relation_search_placeholder:"\u691C\u7D22...",relation_clear:"\u30AF\u30EA\u30A2",relation_no_results:"\u7D50\u679C\u306A\u3057",relation_two_way:"\u53CC\u65B9\u5411\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3",relation_two_way_hint:"\u5BFE\u8C61\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306B\u9006\u65B9\u5411\u306E\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3\u3092\u81EA\u52D5\u7684\u306B\u4F5C\u6210\u3057\u307E\u3059",select_clear:"\u30AF\u30EA\u30A2",select_create_placeholder:"\u65B0\u3057\u3044\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F5C\u6210...",status_new_placeholder:"\u65B0\u3057\u3044\u30B9\u30C6\u30FC\u30BF\u30B9...",color_custom:"\u30AB\u30B9\u30BF\u30E0",validate_non_numeric:'\u30BB\u30EB\u306B\u6570\u5024\u3067\u306A\u3044\u5024\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\uFF08\u4F8B\uFF1A"',validate_invalid_dates:'\u30BB\u30EB\u306B\u6709\u52B9\u3067\u306A\u3044\u65E5\u4ED8\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\uFF08\u4F8B\uFF1A"',validate_invalid_checkbox:'\u30BB\u30EB\u306B\u30C1\u30A7\u30C3\u30AF\u30DC\u30C3\u30AF\u30B9\u3068\u4E92\u63DB\u6027\u306E\u306A\u3044\u5024\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\uFF08\u4F8B\uFF1A"',validate_multiselect_to_select:"\u884C\u306B\u8907\u6570\u306E\u5024\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u5358\u4E00\u9078\u629E\u306B\u5909\u66F4\u3059\u308B\u524D\u306B\u4F59\u5206\u306A\u5024\u3092\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002",validate_invalid_email:'\u30BB\u30EB\u306B\u6709\u52B9\u3067\u306A\u3044\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\uFF08\u4F8B\uFF1A"',validate_invalid_url:'\u30BB\u30EB\u306B\u6709\u52B9\u3067\u306A\u3044 URL \u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\uFF08\u4F8B\uFF1A"',validate_invalid_phone:'\u30BB\u30EB\u306B\u6709\u52B9\u3067\u306A\u3044\u96FB\u8A71\u756A\u53F7\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\uFF08\u4F8B\uFF1A"',validate_type_change_prefix:"\u30BF\u30A4\u30D7\u3092\u5909\u66F4\u3067\u304D\u307E\u305B\u3093\uFF1A",email_invalid:"\u7121\u52B9\u306A\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",op_is:"\u7B49\u3057\u3044",op_is_not:"\u7B49\u3057\u304F\u306A\u3044",op_contains:"\u542B\u3080",op_not_contains:"\u542B\u307E\u306A\u3044",op_starts_with:"\u3067\u59CB\u307E\u308B",op_ends_with:"\u3067\u7D42\u308F\u308B",op_is_empty:"\u7A7A\u3067\u3042\u308B",op_is_not_empty:"\u7A7A\u3067\u306A\u3044",op_gt:">",op_gte:">=",op_lt:"<",op_lte:"<=",op_is_checked:"\u30C1\u30A7\u30C3\u30AF\u6E08\u307F",op_is_unchecked:"\u672A\u30C1\u30A7\u30C3\u30AF",settings_db_filename_name:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u30D5\u30A1\u30A4\u30EB\u540D",settings_db_filename_desc:"\u30D5\u30A9\u30EB\u30C0\u30FC\u5185\u306E\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u8B58\u5225\u3059\u308B\u7279\u5225\u306A\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D\u3002",settings_row_height_name:"\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u884C\u306E\u9AD8\u3055",settings_row_height_desc:"\u5404\u30C6\u30FC\u30D6\u30EB\u884C\u306E\u30D4\u30AF\u30BB\u30EB\u9AD8\u3055\u3002",settings_inline_fields_name:"Dataview \u30A4\u30F3\u30E9\u30A4\u30F3\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8AAD\u307F\u53D6\u308B",settings_inline_fields_desc:"\u30CE\u30FC\u30C8\u672C\u6587\u306E key:: value \u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u89E3\u6790\u3057\u3001\u5217\u306E\u5024\u3068\u3057\u3066\u8868\u793A\u3057\u307E\u3059\uFF08\u8AAD\u307F\u53D6\u308A\u5C02\u7528\uFF09",db_untitled_note:"\u7121\u984C",db_copy_suffix:"(\u30B3\u30D4\u30FC)",db_copy_suffix_n:"(\u30B3\u30D4\u30FC $n)",db_already_exists:'"$folder" \u306B\u306F\u3059\u3067\u306B\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u304C\u5B58\u5728\u3057\u307E\u3059',db_tip_body:"\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u306F\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3067\u3059\u3002\u30C6\u30FC\u30D6\u30EB\u30D3\u30E5\u30FC\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u958B\u3044\u3066\u304F\u3060\u3055\u3044\u3002",formula_err_unclosed_string:"\u4F4D\u7F6E $pos \u3067\u6587\u5B57\u5217\u304C\u9589\u3058\u3089\u308C\u3066\u3044\u307E\u305B\u3093",formula_err_unclosed_bracket:"\u4F4D\u7F6E $pos \u3067\u62EC\u5F27\u304C\u9589\u3058\u3089\u308C\u3066\u3044\u307E\u305B\u3093",formula_err_unexpected_bang:"\u4F4D\u7F6E $pos \u3067\u4E88\u671F\u3057\u306A\u3044\u6587\u5B57 '!'",formula_err_unexpected_char:"\u4F4D\u7F6E $pos \u3067\u4E88\u671F\u3057\u306A\u3044\u6587\u5B57 '$char'",formula_err_expected_token:"\u4F4D\u7F6E $pos \u3067 $expected \u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001'$found' \u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F",formula_err_unexpected_token:"\u4F4D\u7F6E $pos \u3067\u4E88\u671F\u3057\u306A\u3044\u30C8\u30FC\u30AF\u30F3 '$token'",formula_err_circular_ref:'\u5FAA\u74B0\u53C2\u7167\uFF1A"$name" \u306F\u6570\u5F0F\u5217\u3067\u3059',formula_err_unknown_fn:"\u4E0D\u660E\u306A\u95A2\u6570\uFF1A$fn()",formula_err_if_args:"\u671F\u5F85\u3055\u308C\u308B\u5F62\u5F0F\uFF1Aif(\u6761\u4EF6, \u771F\u306E\u5024, [\u507D\u306E\u5024])",formula_err_avg_args:"\u671F\u5F85\u3055\u308C\u308B\u5F62\u5F0F\uFF1Aavg(\u5217) \u2014 \u5217\u53C2\u7167\u304C\u5F15\u6570\u3068\u3057\u3066\u5FC5\u8981",formula_err_count_args:"\u671F\u5F85\u3055\u308C\u308B\u5F62\u5F0F\uFF1Acount(\u5217) \u2014 \u5217\u53C2\u7167\u304C\u5F15\u6570\u3068\u3057\u3066\u5FC5\u8981",formula_err_mid_args:"\u671F\u5F85\u3055\u308C\u308B\u5F62\u5F0F\uFF1Amid(\u30C6\u30AD\u30B9\u30C8, \u958B\u59CB, \u9577\u3055)",formula_err_mod_args:"\u671F\u5F85\u3055\u308C\u308B\u5F62\u5F0F\uFF1Amod(\u6570\u5024, \u9664\u6570)",formula_err_sqrt_args:"\u671F\u5F85\u3055\u308C\u308B\u5F62\u5F0F\uFF1Asqrt(\u6570\u5024)",formula_err_not_implemented:"\u672A\u5B9F\u88C5\u306E\u95A2\u6570\uFF1A$fn()",plugin_display_name:"Notion bases",no_databases_found:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u300C\u65B0\u3057\u3044\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u4F5C\u6210\u300D\u30B3\u30DE\u30F3\u30C9\u3092\u4F7F\u7528\u3057\u3066\u4F5C\u6210\u3057\u3066\u304F\u3060\u3055\u3044\u3002",cmd_open_database:"\u3053\u306E\u30D5\u30A9\u30EB\u30C0\u30FC\u306E\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u958B\u304F",cmd_create_database:"\u73FE\u5728\u306E\u30D5\u30A9\u30EB\u30C0\u30FC\u306B\u65B0\u3057\u3044\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u4F5C\u6210",cmd_quick_add:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306B\u884C\u3092\u3059\u3070\u3084\u304F\u8FFD\u52A0",quick_add_title:"\u30AF\u30A4\u30C3\u30AF\u8FFD\u52A0",quick_add_note_title:"\u30BF\u30A4\u30C8\u30EB",quick_add_note_title_placeholder:"\u30CE\u30FC\u30C8\u306E\u30BF\u30A4\u30C8\u30EB...",quick_add_create:"\u4F5C\u6210",quick_add_create_and_open:"\u4F5C\u6210\u3057\u3066\u958B\u304F",quick_add_no_visible_fields:"\u3053\u306E\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306B\u7DE8\u96C6\u53EF\u80FD\u306A\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u3042\u308A\u307E\u305B\u3093",picker_placeholder:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u9078\u629E...",picker_root:"/\uFF08\u30EB\u30FC\u30C8\uFF09",view_fallback_name:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9"},vm=hb;var _b={en:Gu,"pt-BR":qu,pt:qu,es:gm,fr:hm,de:_m,zh:Ku,"zh-TW":Ku,ja:vm};function u(e){let t=(0,bm.getLanguage)()??"en";return(_b[t]??{})[e]??Gu[e]??e}var Wv=require("obsidian");var sm=ze(yt(),1),Gv=ze(fp(),1);var Ys=ze(yt(),1),Ql=(0,Ys.createContext)(null);function Dt(){let e=(0,Ys.useContext)(Ql);if(!e)throw new Error("useApp deve ser usado dentro de AppContext.Provider");return e}var _t=ze(yt(),1);var Wn={id:"default",type:"table",filters:[],sorts:[],hiddenColumns:[],columnWidths:{},pinnedColumnId:null},hr={schema:[],views:[Wn]};var ea=ze(yt(),1);function _r(e,t){return typeof e=="function"?e(t):e}function Gn(e,t){return n=>{t.setState(o=>({...o,[e]:_r(n,o[e])}))}}function Js(e){return e instanceof Function}function Iw(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Aw(e,t){let n=[],o=r=>{r.forEach(i=>{n.push(i);let l=t(i);l!=null&&l.length&&o(l)})};return o(e),n}function We(e,t,n){let o=[],r;return i=>{let l;n.key&&n.debug&&(l=Date.now());let a=e(i);if(!(a.length!==o.length||a.some((p,m)=>o[m]!==p)))return r;o=a;let c;if(n.key&&n.debug&&(c=Date.now()),r=t(...a),n==null||n.onChange==null||n.onChange(r),n.key&&n.debug&&n!=null&&n.debug()){let p=Math.round((Date.now()-l)*100)/100,m=Math.round((Date.now()-c)*100)/100,g=m/16,d=(v,h)=>{for(v=String(v);v.length<h;)v=" "+v;return v};console.info(`%c\u23F1 ${d(m,5)} /${d(p,5)} ms`,`
font-size: .6rem;
font-weight: bold;
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,n?.key)}return r}}function Ge(e,t,n,o){return{debug:()=>{var r;return(r=e?.debugAll)!=null?r:e[t]},key:!1,onChange:o}}function Ow(e,t,n,o){let r=()=>{var l;return(l=i.getValue())!=null?l:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:r,getContext:We(()=>[e,n,t,i],(l,a,s,c)=>({table:l,column:a,row:s,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Ge(e.options,"debugCells","cell.getContext"))};return e._features.forEach(l=>{l.createCell==null||l.createCell(i,n,t,e)},{}),i}function $w(e,t,n,o){var r,i;let a={...e._getDefaultColumnDef(),...t},s=a.accessorKey,c=(r=(i=a.id)!=null?i:s?typeof String.prototype.replaceAll=="function"?s.replaceAll(".","_"):s.replace(/\./g,"_"):void 0)!=null?r:typeof a.header=="string"?a.header:void 0,p;if(a.accessorFn?p=a.accessorFn:s&&(s.includes(".")?p=g=>{let d=g;for(let h of s.split(".")){var v;d=(v=d)==null?void 0:v[h]}return d}:p=g=>g[a.accessorKey]),!c)throw new Error;let m={id:`${String(c)}`,accessorFn:p,parent:o,depth:n,columnDef:a,columns:[],getFlatColumns:We(()=>[!0],()=>{var g;return[m,...(g=m.columns)==null?void 0:g.flatMap(d=>d.getFlatColumns())]},Ge(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:We(()=>[e._getOrderColumnsFn()],g=>{var d;if((d=m.columns)!=null&&d.length){let v=m.columns.flatMap(h=>h.getLeafColumns());return g(v)}return[m]},Ge(e.options,"debugColumns","column.getLeafColumns"))};for(let g of e._features)g.createColumn==null||g.createColumn(m,e);return m}var pn="debugHeaders";function Jh(e,t,n){var o;let i={id:(o=n.id)!=null?o:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{let l=[],a=s=>{s.subHeaders&&s.subHeaders.length&&s.subHeaders.map(a),l.push(s)};return a(i),l},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(l=>{l.createHeader==null||l.createHeader(i,e)}),i}var zw={createTable:e=>{e.getHeaderGroups=We(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>{var i,l;let a=(i=o?.map(m=>n.find(g=>g.id===m)).filter(Boolean))!=null?i:[],s=(l=r?.map(m=>n.find(g=>g.id===m)).filter(Boolean))!=null?l:[],c=n.filter(m=>!(o!=null&&o.includes(m.id))&&!(r!=null&&r.includes(m.id)));return Xs(t,[...a,...c,...s],e)},Ge(e.options,pn,"getHeaderGroups")),e.getCenterHeaderGroups=We(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>(n=n.filter(i=>!(o!=null&&o.includes(i.id))&&!(r!=null&&r.includes(i.id))),Xs(t,n,e,"center")),Ge(e.options,pn,"getCenterHeaderGroups")),e.getLeftHeaderGroups=We(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,o)=>{var r;let i=(r=o?.map(l=>n.find(a=>a.id===l)).filter(Boolean))!=null?r:[];return Xs(t,i,e,"left")},Ge(e.options,pn,"getLeftHeaderGroups")),e.getRightHeaderGroups=We(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,o)=>{var r;let i=(r=o?.map(l=>n.find(a=>a.id===l)).filter(Boolean))!=null?r:[];return Xs(t,i,e,"right")},Ge(e.options,pn,"getRightHeaderGroups")),e.getFooterGroups=We(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Ge(e.options,pn,"getFooterGroups")),e.getLeftFooterGroups=We(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Ge(e.options,pn,"getLeftFooterGroups")),e.getCenterFooterGroups=We(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Ge(e.options,pn,"getCenterFooterGroups")),e.getRightFooterGroups=We(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Ge(e.options,pn,"getRightFooterGroups")),e.getFlatHeaders=We(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ge(e.options,pn,"getFlatHeaders")),e.getLeftFlatHeaders=We(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ge(e.options,pn,"getLeftFlatHeaders")),e.getCenterFlatHeaders=We(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ge(e.options,pn,"getCenterFlatHeaders")),e.getRightFlatHeaders=We(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ge(e.options,pn,"getRightFlatHeaders")),e.getCenterLeafHeaders=We(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),Ge(e.options,pn,"getCenterLeafHeaders")),e.getLeftLeafHeaders=We(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),Ge(e.options,pn,"getLeftLeafHeaders")),e.getRightLeafHeaders=We(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),Ge(e.options,pn,"getRightLeafHeaders")),e.getLeafHeaders=We(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,o)=>{var r,i,l,a,s,c;return[...(r=(i=t[0])==null?void 0:i.headers)!=null?r:[],...(l=(a=n[0])==null?void 0:a.headers)!=null?l:[],...(s=(c=o[0])==null?void 0:c.headers)!=null?s:[]].map(p=>p.getLeafHeaders()).flat()},Ge(e.options,pn,"getLeafHeaders"))}};function Xs(e,t,n,o){var r,i;let l=0,a=function(g,d){d===void 0&&(d=1),l=Math.max(l,d),g.filter(v=>v.getIsVisible()).forEach(v=>{var h;(h=v.columns)!=null&&h.length&&a(v.columns,d+1)},0)};a(e);let s=[],c=(g,d)=>{let v={depth:d,id:[o,`${d}`].filter(Boolean).join("_"),headers:[]},h=[];g.forEach(y=>{let _=[...h].reverse()[0],f=y.column.depth===v.depth,w,R=!1;if(f&&y.column.parent?w=y.column.parent:(w=y.column,R=!0),_&&_?.column===w)_.subHeaders.push(y);else{let P=Jh(n,w,{id:[o,d,w.id,y?.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${h.filter(L=>L.column===w).length}`:void 0,depth:d,index:h.length});P.subHeaders.push(y),h.push(P)}v.headers.push(y),y.headerGroup=v}),s.push(v),d>0&&c(h,d-1)},p=t.map((g,d)=>Jh(n,g,{depth:l,index:d}));c(p,l-1),s.reverse();let m=g=>g.filter(v=>v.column.getIsVisible()).map(v=>{let h=0,y=0,_=[0];v.subHeaders&&v.subHeaders.length?(_=[],m(v.subHeaders).forEach(w=>{let{colSpan:R,rowSpan:P}=w;h+=R,_.push(P)})):h=1;let f=Math.min(..._);return y=y+f,v.colSpan=h,v.rowSpan=y,{colSpan:h,rowSpan:y}});return m((r=(i=s[0])==null?void 0:i.headers)!=null?r:[]),s}var Rp=(e,t,n,o,r,i,l)=>{let a={id:t,index:o,original:n,depth:r,parentId:l,_valuesCache:{},_uniqueValuesCache:{},getValue:s=>{if(a._valuesCache.hasOwnProperty(s))return a._valuesCache[s];let c=e.getColumn(s);if(c!=null&&c.accessorFn)return a._valuesCache[s]=c.accessorFn(a.original,o),a._valuesCache[s]},getUniqueValues:s=>{if(a._uniqueValuesCache.hasOwnProperty(s))return a._uniqueValuesCache[s];let c=e.getColumn(s);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[s]=c.columnDef.getUniqueValues(a.original,o),a._uniqueValuesCache[s]):(a._uniqueValuesCache[s]=[a.getValue(s)],a._uniqueValuesCache[s])},renderValue:s=>{var c;return(c=a.getValue(s))!=null?c:e.options.renderFallbackValue},subRows:i??[],getLeafRows:()=>Aw(a.subRows,s=>s.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let s=[],c=a;for(;;){let p=c.getParentRow();if(!p)break;s.push(p),c=p}return s.reverse()},getAllCells:We(()=>[e.getAllLeafColumns()],s=>s.map(c=>Ow(e,a,c,c.id)),Ge(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:We(()=>[a.getAllCells()],s=>s.reduce((c,p)=>(c[p.column.id]=p,c),{}),Ge(e.options,"debugRows","getAllCellsByColumnId"))};for(let s=0;s<e._features.length;s++){let c=e._features[s];c==null||c.createRow==null||c.createRow(a,e)}return a},Vw={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},t_=(e,t,n)=>{var o,r;let i=n==null||(o=n.toString())==null?void 0:o.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(i))};t_.autoRemove=e=>bo(e);var n_=(e,t,n)=>{var o;return!!(!((o=e.getValue(t))==null||(o=o.toString())==null)&&o.includes(n))};n_.autoRemove=e=>bo(e);var o_=(e,t,n)=>{var o;return((o=e.getValue(t))==null||(o=o.toString())==null?void 0:o.toLowerCase())===n?.toLowerCase()};o_.autoRemove=e=>bo(e);var r_=(e,t,n)=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(n)};r_.autoRemove=e=>bo(e);var i_=(e,t,n)=>!n.some(o=>{var r;return!((r=e.getValue(t))!=null&&r.includes(o))});i_.autoRemove=e=>bo(e)||!(e!=null&&e.length);var l_=(e,t,n)=>n.some(o=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(o)});l_.autoRemove=e=>bo(e)||!(e!=null&&e.length);var a_=(e,t,n)=>e.getValue(t)===n;a_.autoRemove=e=>bo(e);var s_=(e,t,n)=>e.getValue(t)==n;s_.autoRemove=e=>bo(e);var Ep=(e,t,n)=>{let[o,r]=n,i=e.getValue(t);return i>=o&&i<=r};Ep.resolveFilterValue=e=>{let[t,n]=e,o=typeof t!="number"?parseFloat(t):t,r=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(o)?-1/0:o,l=n===null||Number.isNaN(r)?1/0:r;if(i>l){let a=i;i=l,l=a}return[i,l]};Ep.autoRemove=e=>bo(e)||bo(e[0])&&bo(e[1]);var qo={includesString:t_,includesStringSensitive:n_,equalsString:o_,arrIncludes:r_,arrIncludesAll:i_,arrIncludesSome:l_,equals:a_,weakEquals:s_,inNumberRange:Ep};function bo(e){return e==null||e===""}var Bw={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Gn("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let n=t.getCoreRowModel().flatRows[0],o=n?.getValue(e.id);return typeof o=="string"?qo.includesString:typeof o=="number"?qo.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?qo.equals:Array.isArray(o)?qo.arrIncludes:qo.weakEquals},e.getFilterFn=()=>{var n,o;return Js(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(o=t.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?n:qo[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,o,r;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((o=t.options.enableColumnFilters)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(o=>o.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,o;return(n=(o=t.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(o=>{let r=e.getFilterFn(),i=o?.find(p=>p.id===e.id),l=_r(n,i?i.value:void 0);if(e_(r,l,e)){var a;return(a=o?.filter(p=>p.id!==e.id))!=null?a:[]}let s={id:e.id,value:l};if(i){var c;return(c=o?.map(p=>p.id===e.id?s:p))!=null?c:[]}return o!=null&&o.length?[...o,s]:[s]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{let n=e.getAllLeafColumns(),o=r=>{var i;return(i=_r(t,r))==null?void 0:i.filter(l=>{let a=n.find(s=>s.id===l.id);if(a){let s=a.getFilterFn();if(e_(s,l.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.resetColumnFilters=t=>{var n,o;e.setColumnFilters(t?[]:(n=(o=e.initialState)==null?void 0:o.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function e_(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}var jw=(e,t,n)=>n.reduce((o,r)=>{let i=r.getValue(e);return o+(typeof i=="number"?i:0)},0),Hw=(e,t,n)=>{let o;return n.forEach(r=>{let i=r.getValue(e);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},Uw=(e,t,n)=>{let o;return n.forEach(r=>{let i=r.getValue(e);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},Ww=(e,t,n)=>{let o,r;return n.forEach(i=>{let l=i.getValue(e);l!=null&&(o===void 0?l>=l&&(o=r=l):(o>l&&(o=l),r<l&&(r=l)))}),[o,r]},Gw=(e,t)=>{let n=0,o=0;if(t.forEach(r=>{let i=r.getValue(e);i!=null&&(i=+i)>=i&&(++n,o+=i)}),n)return o/n},qw=(e,t)=>{if(!t.length)return;let n=t.map(i=>i.getValue(e));if(!Iw(n))return;if(n.length===1)return n[0];let o=Math.floor(n.length/2),r=n.sort((i,l)=>i-l);return n.length%2!==0?r[o]:(r[o-1]+r[o])/2},Kw=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Yw=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,Xw=(e,t)=>t.length,gp={sum:jw,min:Hw,max:Uw,extent:Ww,mean:Gw,median:qw,unique:Kw,uniqueCount:Yw,count:Xw},Qw={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Gn("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(o=>o!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,o;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((o=t.options.enableGrouping)!=null?o:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{let n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{let n=t.getCoreRowModel().flatRows[0],o=n?.getValue(e.id);if(typeof o=="number")return gp.sum;if(Object.prototype.toString.call(o)==="[object Date]")return gp.extent},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return Js(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(o=t.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?n:gp[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,o;e.setGrouping(t?[]:(n=(o=e.initialState)==null?void 0:o.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];let o=t.getColumn(n);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[n]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,o)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=n.subRows)!=null&&r.length)}}};function Zw(e,t,n){if(!(t!=null&&t.length)||!n)return e;let o=e.filter(i=>!t.includes(i.id));return n==="remove"?o:[...t.map(i=>e.find(l=>l.id===i)).filter(Boolean),...o]}var Jw={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Gn("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=We(n=>[Jl(t,n)],n=>n.findIndex(o=>o.id===e.id),Ge(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var o;return((o=Jl(t,n)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=n=>{var o;let r=Jl(t,n);return((o=r[r.length-1])==null?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=We(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,o)=>r=>{let i=[];if(!(t!=null&&t.length))i=r;else{let l=[...t],a=[...r];for(;a.length&&l.length;){let s=l.shift(),c=a.findIndex(p=>p.id===s);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return Zw(i,n,o)},Ge(e.options,"debugTable","_getOrderColumnsFn"))}},hp=()=>({left:[],right:[]}),eC={getInitialState:e=>({columnPinning:hp(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Gn("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{let o=e.getLeafColumns().map(r=>r.id).filter(Boolean);t.setColumnPinning(r=>{var i,l;if(n==="right"){var a,s;return{left:((a=r?.left)!=null?a:[]).filter(m=>!(o!=null&&o.includes(m))),right:[...((s=r?.right)!=null?s:[]).filter(m=>!(o!=null&&o.includes(m))),...o]}}if(n==="left"){var c,p;return{left:[...((c=r?.left)!=null?c:[]).filter(m=>!(o!=null&&o.includes(m))),...o],right:((p=r?.right)!=null?p:[]).filter(m=>!(o!=null&&o.includes(m)))}}return{left:((i=r?.left)!=null?i:[]).filter(m=>!(o!=null&&o.includes(m))),right:((l=r?.right)!=null?l:[]).filter(m=>!(o!=null&&o.includes(m)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,i,l;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((i=(l=t.options.enableColumnPinning)!=null?l:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{let n=e.getLeafColumns().map(a=>a.id),{left:o,right:r}=t.getState().columnPinning,i=n.some(a=>o?.includes(a)),l=n.some(a=>r?.includes(a));return i?"left":l?"right":!1},e.getPinnedIndex=()=>{var n,o;let r=e.getIsPinned();return r?(n=(o=t.getState().columnPinning)==null||(o=o[r])==null?void 0:o.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=We(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,o,r)=>{let i=[...o??[],...r??[]];return n.filter(l=>!i.includes(l.column.id))},Ge(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=We(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,o)=>(o??[]).map(i=>n.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),Ge(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=We(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,o)=>(o??[]).map(i=>n.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),Ge(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,o;return e.setColumnPinning(t?hp():(n=(o=e.initialState)==null?void 0:o.columnPinning)!=null?n:hp())},e.getIsSomeColumnsPinned=t=>{var n;let o=e.getState().columnPinning;if(!t){var r,i;return!!((r=o.left)!=null&&r.length||(i=o.right)!=null&&i.length)}return!!((n=o[t])!=null&&n.length)},e.getLeftLeafColumns=We(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),Ge(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=We(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),Ge(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=We(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o)=>{let r=[...n??[],...o??[]];return t.filter(i=>!r.includes(i.id))},Ge(e.options,"debugColumns","getCenterLeafColumns"))}};function tC(e){return e||(typeof document<"u"?document:null)}var Qs={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},_p=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),nC={getDefaultColumnDef:()=>Qs,getInitialState:e=>({columnSizing:{},columnSizingInfo:_p(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Gn("columnSizing",e),onColumnSizingInfoChange:Gn("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,o,r;let i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Qs.minSize,(o=i??e.columnDef.size)!=null?o:Qs.size),(r=e.columnDef.maxSize)!=null?r:Qs.maxSize)},e.getStart=We(n=>[n,Jl(t,n),t.getState().columnSizing],(n,o)=>o.slice(0,e.getIndex(n)).reduce((r,i)=>r+i.getSize(),0),Ge(t.options,"debugColumns","getStart")),e.getAfter=We(n=>[n,Jl(t,n),t.getState().columnSizing],(n,o)=>o.slice(e.getIndex(n)+1).reduce((r,i)=>r+i.getSize(),0),Ge(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:o,...r}=n;return r})},e.getCanResize=()=>{var n,o;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((o=t.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0,o=r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var i;n+=(i=r.column.getSize())!=null?i:0}};return o(e),n},e.getStart=()=>{if(e.index>0){let n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{let o=t.getColumn(e.column.id),r=o?.getCanResize();return i=>{if(!o||!r||(i.persist==null||i.persist(),vp(i)&&i.touches&&i.touches.length>1))return;let l=e.getSize(),a=e?e.getLeafHeaders().map(_=>[_.column.id,_.column.getSize()]):[[o.id,o.getSize()]],s=vp(i)?Math.round(i.touches[0].clientX):i.clientX,c={},p=(_,f)=>{typeof f=="number"&&(t.setColumnSizingInfo(w=>{var R,P;let L=t.options.columnResizeDirection==="rtl"?-1:1,V=(f-((R=w?.startOffset)!=null?R:0))*L,W=Math.max(V/((P=w?.startSize)!=null?P:0),-.999999);return w.columnSizingStart.forEach(re=>{let[J,ue]=re;c[J]=Math.round(Math.max(ue+ue*W,0)*100)/100}),{...w,deltaOffset:V,deltaPercentage:W}}),(t.options.columnResizeMode==="onChange"||_==="end")&&t.setColumnSizing(w=>({...w,...c})))},m=_=>p("move",_),g=_=>{p("end",_),t.setColumnSizingInfo(f=>({...f,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},d=tC(n),v={moveHandler:_=>m(_.clientX),upHandler:_=>{d?.removeEventListener("mousemove",v.moveHandler),d?.removeEventListener("mouseup",v.upHandler),g(_.clientX)}},h={moveHandler:_=>(_.cancelable&&(_.preventDefault(),_.stopPropagation()),m(_.touches[0].clientX),!1),upHandler:_=>{var f;d?.removeEventListener("touchmove",h.moveHandler),d?.removeEventListener("touchend",h.upHandler),_.cancelable&&(_.preventDefault(),_.stopPropagation()),g((f=_.touches[0])==null?void 0:f.clientX)}},y=oC()?{passive:!1}:!1;vp(i)?(d?.addEventListener("touchmove",h.moveHandler,y),d?.addEventListener("touchend",h.upHandler,y)):(d?.addEventListener("mousemove",v.moveHandler,y),d?.addEventListener("mouseup",v.upHandler,y)),t.setColumnSizingInfo(_=>({..._,startOffset:s,startSize:l,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?_p():(n=e.initialState.columnSizingInfo)!=null?n:_p())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0}}},Zs=null;function oC(){if(typeof Zs=="boolean")return Zs;let e=!1;try{let t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Zs=e,Zs}function vp(e){return e.type==="touchstart"}var rC={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Gn("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(o=>({...o,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,o;let r=e.columns;return(n=r.length?r.some(i=>i.getIsVisible()):(o=t.getState().columnVisibility)==null?void 0:o[e.id])!=null?n:!0},e.getCanHide=()=>{var n,o;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((o=t.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=We(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),Ge(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=We(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,o,r)=>[...n,...o,...r],Ge(t.options,"debugRows","getVisibleCells"))},createTable:e=>{let t=(n,o)=>We(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),Ge(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var o;e.setColumnVisibility(n?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=n=>{var o;n=(o=n)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,i)=>({...r,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var o;e.toggleAllColumnsVisible((o=n.target)==null?void 0:o.checked)}}};function Jl(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}var iC={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},lC={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Gn("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;let o=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,o,r,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=t.options.enableGlobalFilter)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>qo.includesString,e.getGlobalFilterFn=()=>{var t,n;let{globalFilterFn:o}=e.options;return Js(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[o])!=null?t:qo[o]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},aC={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Gn("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var r,i;e.setExpanded(o?{}:(r=(i=e.initialState)==null?void 0:i.expanded)!=null?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{let o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},e.getIsAllRowsExpanded=()=>{let o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{let l=i.split(".");o=Math.max(o,l.length)}),o},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(o=>{var r;let i=o===!0?!0:!!(o!=null&&o[e.id]),l={};if(o===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{l[a]=!0}):l=o,n=(r=n)!=null?r:!i,!i&&n)return{...l,[e.id]:!0};if(i&&!n){let{[e.id]:a,...s}=l;return s}return o})},e.getIsExpanded=()=>{var n;let o=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:o===!0||o?.[e.id])},e.getCanExpand=()=>{var n,o,r;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((o=t.options.enableExpanding)!=null?o:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let n=!0,o=e;for(;n&&o.parentId;)o=t.getRow(o.parentId,!0),n=o.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{let n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},Cp=0,kp=10,bp=()=>({pageIndex:Cp,pageSize:kp}),sC={getInitialState:e=>({...e,pagination:{...bp(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Gn("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=o=>{let r=i=>_r(o,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?bp():(r=e.initialState.pagination)!=null?r:bp())},e.setPageIndex=o=>{e.setPagination(r=>{let i=_r(o,r.pageIndex),l=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,l)),{...r,pageIndex:i}})},e.resetPageIndex=o=>{var r,i;e.setPageIndex(o?Cp:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?r:Cp)},e.resetPageSize=o=>{var r,i;e.setPageSize(o?kp:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?r:kp)},e.setPageSize=o=>{e.setPagination(r=>{let i=Math.max(1,_r(o,r.pageSize)),l=r.pageSize*r.pageIndex,a=Math.floor(l/i);return{...r,pageIndex:a,pageSize:i}})},e.setPageCount=o=>e.setPagination(r=>{var i;let l=_r(o,(i=e.options.pageCount)!=null?i:-1);return typeof l=="number"&&(l=Math.max(-1,l)),{...r,pageCount:l}}),e.getPageOptions=We(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((i,l)=>l)),r},Ge(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{let{pageIndex:o}=e.getState().pagination,r=e.getPageCount();return r===-1?!0:r===0?!1:o<r-1},e.previousPage=()=>e.setPageIndex(o=>o-1),e.nextPage=()=>e.setPageIndex(o=>o+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var o;return(o=e.options.pageCount)!=null?o:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var o;return(o=e.options.rowCount)!=null?o:e.getPrePaginationRowModel().rows.length}}},yp=()=>({top:[],bottom:[]}),uC={getInitialState:e=>({rowPinning:yp(),...e}),getDefaultOptions:e=>({onRowPinningChange:Gn("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,o,r)=>{let i=o?e.getLeafRows().map(s=>{let{id:c}=s;return c}):[],l=r?e.getParentRows().map(s=>{let{id:c}=s;return c}):[],a=new Set([...l,e.id,...i]);t.setRowPinning(s=>{var c,p;if(n==="bottom"){var m,g;return{top:((m=s?.top)!=null?m:[]).filter(h=>!(a!=null&&a.has(h))),bottom:[...((g=s?.bottom)!=null?g:[]).filter(h=>!(a!=null&&a.has(h))),...Array.from(a)]}}if(n==="top"){var d,v;return{top:[...((d=s?.top)!=null?d:[]).filter(h=>!(a!=null&&a.has(h))),...Array.from(a)],bottom:((v=s?.bottom)!=null?v:[]).filter(h=>!(a!=null&&a.has(h)))}}return{top:((c=s?.top)!=null?c:[]).filter(h=>!(a!=null&&a.has(h))),bottom:((p=s?.bottom)!=null?p:[]).filter(h=>!(a!=null&&a.has(h)))}})},e.getCanPin=()=>{var n;let{enableRowPinning:o,enablePinning:r}=t.options;return typeof o=="function"?o(e):(n=o??r)!=null?n:!0},e.getIsPinned=()=>{let n=[e.id],{top:o,bottom:r}=t.getState().rowPinning,i=n.some(a=>o?.includes(a)),l=n.some(a=>r?.includes(a));return i?"top":l?"bottom":!1},e.getPinnedIndex=()=>{var n,o;let r=e.getIsPinned();if(!r)return-1;let i=(n=r==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(l=>{let{id:a}=l;return a});return(o=i?.indexOf(e.id))!=null?o:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,o;return e.setRowPinning(t?yp():(n=(o=e.initialState)==null?void 0:o.rowPinning)!=null?n:yp())},e.getIsSomeRowsPinned=t=>{var n;let o=e.getState().rowPinning;if(!t){var r,i;return!!((r=o.top)!=null&&r.length||(i=o.bottom)!=null&&i.length)}return!!((n=o[t])!=null&&n.length)},e._getPinnedRows=(t,n,o)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(n??[]).map(l=>{let a=e.getRow(l,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(l=>t.find(a=>a.id===l))).filter(Boolean).map(l=>({...l,position:o}))},e.getTopRows=We(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Ge(e.options,"debugRows","getTopRows")),e.getBottomRows=We(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Ge(e.options,"debugRows","getBottomRows")),e.getCenterRows=We(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,o)=>{let r=new Set([...n??[],...o??[]]);return t.filter(i=>!r.has(i.id))},Ge(e.options,"debugRows","getCenterRows"))}},cC={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Gn("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();let o={...n},r=e.getPreGroupedRowModel().flatRows;return t?r.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):r.forEach(i=>{delete o[i.id]}),o})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{let o=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),r={...n};return e.getRowModel().rows.forEach(i=>{Sp(r,i.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=We(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?wp(e,n):{rows:[],flatRows:[],rowsById:{}},Ge(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=We(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?wp(e,n):{rows:[],flatRows:[],rowsById:{}},Ge(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=We(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?wp(e,n):{rows:[],flatRows:[],rowsById:{}},Ge(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState(),o=!!(t.length&&Object.keys(n).length);return o&&t.some(r=>r.getCanSelect()&&!n[r.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:n}=e.getState(),o=!!t.length;return o&&t.some(r=>!n[r.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var t;let n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,o)=>{let r=e.getIsSelected();t.setRowSelection(i=>{var l;if(n=typeof n<"u"?n:!r,e.getCanSelect()&&r===n)return i;let a={...i};return Sp(a,e.id,n,(l=o?.selectChildren)!=null?l:!0,t),a})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return Fp(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return Np(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return Np(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{let n=e.getCanSelect();return o=>{var r;n&&e.toggleSelected((r=o.target)==null?void 0:r.checked)}}}},Sp=(e,t,n,o,r)=>{var i;let l=r.getRow(t,!0);n?(l.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),l.getCanSelect()&&(e[t]=!0)):delete e[t],o&&(i=l.subRows)!=null&&i.length&&l.getCanSelectSubRows()&&l.subRows.forEach(a=>Sp(e,a.id,n,o,r))};function wp(e,t){let n=e.getState().rowSelection,o=[],r={},i=function(l,a){return l.map(s=>{var c;let p=Fp(s,n);if(p&&(o.push(s),r[s.id]=s),(c=s.subRows)!=null&&c.length&&(s={...s,subRows:i(s.subRows)}),p)return s}).filter(Boolean)};return{rows:i(t.rows),flatRows:o,rowsById:r}}function Fp(e,t){var n;return(n=t[e.id])!=null?n:!1}function Np(e,t,n){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,i=!1;return e.subRows.forEach(l=>{if(!(i&&!r)&&(l.getCanSelect()&&(Fp(l,t)?i=!0:r=!1),l.subRows&&l.subRows.length)){let a=Np(l,t);a==="all"?i=!0:(a==="some"&&(i=!0),r=!1)}}),r?"all":i?"some":!1}var xp=/([0-9]+)/gm,dC=(e,t,n)=>u_(vr(e.getValue(n)).toLowerCase(),vr(t.getValue(n)).toLowerCase()),pC=(e,t,n)=>u_(vr(e.getValue(n)),vr(t.getValue(n))),mC=(e,t,n)=>Dp(vr(e.getValue(n)).toLowerCase(),vr(t.getValue(n)).toLowerCase()),fC=(e,t,n)=>Dp(vr(e.getValue(n)),vr(t.getValue(n))),gC=(e,t,n)=>{let o=e.getValue(n),r=t.getValue(n);return o>r?1:o<r?-1:0},hC=(e,t,n)=>Dp(e.getValue(n),t.getValue(n));function Dp(e,t){return e===t?0:e>t?1:-1}function vr(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function u_(e,t){let n=e.split(xp).filter(Boolean),o=t.split(xp).filter(Boolean);for(;n.length&&o.length;){let r=n.shift(),i=o.shift(),l=parseInt(r,10),a=parseInt(i,10),s=[l,a].sort();if(isNaN(s[0])){if(r>i)return 1;if(i>r)return-1;continue}if(isNaN(s[1]))return isNaN(l)?-1:1;if(l>a)return 1;if(a>l)return-1}return n.length-o.length}var Zl={alphanumeric:dC,alphanumericCaseSensitive:pC,text:mC,textCaseSensitive:fC,datetime:gC,basic:hC},_C={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Gn("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let n=t.getFilteredRowModel().flatRows.slice(10),o=!1;for(let r of n){let i=r?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Zl.datetime;if(typeof i=="string"&&(o=!0,i.split(xp).length>1))return Zl.alphanumeric}return o?Zl.text:Zl.basic},e.getAutoSortDir=()=>{let n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,o;if(!e)throw new Error;return Js(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(o=t.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?n:Zl[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{let r=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(l=>{let a=l?.find(d=>d.id===e.id),s=l?.findIndex(d=>d.id===e.id),c=[],p,m=i?n:r==="desc";if(l!=null&&l.length&&e.getCanMultiSort()&&o?a?p="toggle":p="add":l!=null&&l.length&&s!==l.length-1?p="replace":a?p="toggle":p="replace",p==="toggle"&&(i||r||(p="remove")),p==="add"){var g;c=[...l,{id:e.id,desc:m}],c.splice(0,c.length-((g=t.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else p==="toggle"?c=l.map(d=>d.id===e.id?{...d,desc:m}:d):p==="remove"?c=l.filter(d=>d.id!==e.id):c=[{id:e.id,desc:m}];return c})},e.getFirstSortDir=()=>{var n,o;return((n=(o=e.columnDef.sortDescFirst)!=null?o:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var o,r;let i=e.getFirstSortDir(),l=e.getIsSorted();return l?l!==i&&((o=t.options.enableSortingRemoval)==null||o)&&(!(n&&(r=t.options.enableMultiRemove)!=null)||r)?!1:l==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,o;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((o=t.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,o;return(n=(o=e.columnDef.enableMultiSort)!=null?o:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;let o=(n=t.getState().sorting)==null?void 0:n.find(r=>r.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,o;return(n=(o=t.getState().sorting)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{let n=e.getCanSort();return o=>{n&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,o;e.setSorting(t?[]:(n=(o=e.initialState)==null?void 0:o.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},vC=[zw,rC,Jw,eC,Vw,Bw,iC,lC,_C,Qw,aC,sC,uC,cC,nC];function c_(e){var t,n;let o=[...vC,...(t=e._features)!=null?t:[]],r={_features:o},i=r._features.reduce((g,d)=>Object.assign(g,d.getDefaultOptions==null?void 0:d.getDefaultOptions(r)),{}),l=g=>r.options.mergeOptions?r.options.mergeOptions(i,g):{...i,...g},s={...{},...(n=e.initialState)!=null?n:{}};r._features.forEach(g=>{var d;s=(d=g.getInitialState==null?void 0:g.getInitialState(s))!=null?d:s});let c=[],p=!1,m={_features:o,options:{...i,...e},initialState:s,_queue:g=>{c.push(g),p||(p=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();p=!1}).catch(d=>setTimeout(()=>{throw d})))},reset:()=>{r.setState(r.initialState)},setOptions:g=>{let d=_r(g,r.options);r.options=l(d)},getState:()=>r.options.state,setState:g=>{r.options.onStateChange==null||r.options.onStateChange(g)},_getRowId:(g,d,v)=>{var h;return(h=r.options.getRowId==null?void 0:r.options.getRowId(g,d,v))!=null?h:`${v?[v.id,d].join("."):d}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(g,d)=>{let v=(d?r.getPrePaginationRowModel():r.getRowModel()).rowsById[g];if(!v&&(v=r.getCoreRowModel().rowsById[g],!v))throw new Error;return v},_getDefaultColumnDef:We(()=>[r.options.defaultColumn],g=>{var d;return g=(d=g)!=null?d:{},{header:v=>{let h=v.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},cell:v=>{var h,y;return(h=(y=v.renderValue())==null||y.toString==null?void 0:y.toString())!=null?h:null},...r._features.reduce((v,h)=>Object.assign(v,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...g}},Ge(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:We(()=>[r._getColumnDefs()],g=>{let d=function(v,h,y){return y===void 0&&(y=0),v.map(_=>{let f=$w(r,_,y,h),w=_;return f.columns=w.columns?d(w.columns,f,y+1):[],f})};return d(g)},Ge(e,"debugColumns","getAllColumns")),getAllFlatColumns:We(()=>[r.getAllColumns()],g=>g.flatMap(d=>d.getFlatColumns()),Ge(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:We(()=>[r.getAllFlatColumns()],g=>g.reduce((d,v)=>(d[v.id]=v,d),{}),Ge(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:We(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(g,d)=>{let v=g.flatMap(h=>h.getLeafColumns());return d(v)},Ge(e,"debugColumns","getAllLeafColumns")),getColumn:g=>r._getAllFlatColumnsById()[g]};Object.assign(r,m);for(let g=0;g<r._features.length;g++){let d=r._features[g];d==null||d.createTable==null||d.createTable(r)}return r}function d_(){return e=>We(()=>[e.options.data],t=>{let n={rows:[],flatRows:[],rowsById:{}},o=function(r,i,l){i===void 0&&(i=0);let a=[];for(let c=0;c<r.length;c++){let p=Rp(e,e._getRowId(r[c],c,l),r[c],c,i,void 0,l?.id);if(n.flatRows.push(p),n.rowsById[p.id]=p,a.push(p),e.options.getSubRows){var s;p.originalSubRows=e.options.getSubRows(r[c],c),(s=p.originalSubRows)!=null&&s.length&&(p.subRows=o(p.originalSubRows,i+1,p))}}return a};return n.rows=o(t),n},Ge(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function bC(e,t,n){return n.options.filterFromLeafRows?yC(e,t,n):wC(e,t,n)}function yC(e,t,n){var o;let r=[],i={},l=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,a=function(s,c){c===void 0&&(c=0);let p=[];for(let g=0;g<s.length;g++){var m;let d=s[g],v=Rp(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);if(v.columnFilters=d.columnFilters,(m=d.subRows)!=null&&m.length&&c<l){if(v.subRows=a(d.subRows,c+1),d=v,t(d)&&!v.subRows.length){p.push(d),i[d.id]=d,r.push(d);continue}if(t(d)||v.subRows.length){p.push(d),i[d.id]=d,r.push(d);continue}}else d=v,t(d)&&(p.push(d),i[d.id]=d,r.push(d))}return p};return{rows:a(e),flatRows:r,rowsById:i}}function wC(e,t,n){var o;let r=[],i={},l=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,a=function(s,c){c===void 0&&(c=0);let p=[];for(let g=0;g<s.length;g++){let d=s[g];if(t(d)){var m;if((m=d.subRows)!=null&&m.length&&c<l){let h=Rp(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);h.subRows=a(d.subRows,c+1),d=h}p.push(d),r.push(d),i[d.id]=d}}return p};return{rows:a(e),flatRows:r,rowsById:i}}function p_(){return e=>We(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,o)=>{if(!t.rows.length||!(n!=null&&n.length)&&!o){for(let g=0;g<t.flatRows.length;g++)t.flatRows[g].columnFilters={},t.flatRows[g].columnFiltersMeta={};return t}let r=[],i=[];(n??[]).forEach(g=>{var d;let v=e.getColumn(g.id);if(!v)return;let h=v.getFilterFn();h&&r.push({id:g.id,filterFn:h,resolvedValue:(d=h.resolveFilterValue==null?void 0:h.resolveFilterValue(g.value))!=null?d:g.value})});let l=(n??[]).map(g=>g.id),a=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter(g=>g.getCanGlobalFilter());o&&a&&s.length&&(l.push("__global__"),s.forEach(g=>{var d;i.push({id:g.id,filterFn:a,resolvedValue:(d=a.resolveFilterValue==null?void 0:a.resolveFilterValue(o))!=null?d:o})}));let c,p;for(let g=0;g<t.flatRows.length;g++){let d=t.flatRows[g];if(d.columnFilters={},r.length)for(let v=0;v<r.length;v++){c=r[v];let h=c.id;d.columnFilters[h]=c.filterFn(d,h,c.resolvedValue,y=>{d.columnFiltersMeta[h]=y})}if(i.length){for(let v=0;v<i.length;v++){p=i[v];let h=p.id;if(p.filterFn(d,h,p.resolvedValue,y=>{d.columnFiltersMeta[h]=y})){d.columnFilters.__global__=!0;break}}d.columnFilters.__global__!==!0&&(d.columnFilters.__global__=!1)}}let m=g=>{for(let d=0;d<l.length;d++)if(g.columnFilters[l[d]]===!1)return!1;return!0};return bC(t.rows,m,e)},Ge(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function m_(){return e=>We(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;let o=e.getState().sorting,r=[],i=o.filter(s=>{var c;return(c=e.getColumn(s.id))==null?void 0:c.getCanSort()}),l={};i.forEach(s=>{let c=e.getColumn(s.id);c&&(l[s.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});let a=s=>{let c=s.map(p=>({...p}));return c.sort((p,m)=>{for(let d=0;d<i.length;d+=1){var g;let v=i[d],h=l[v.id],y=h.sortUndefined,_=(g=v?.desc)!=null?g:!1,f=0;if(y){let w=p.getValue(v.id),R=m.getValue(v.id),P=w===void 0,L=R===void 0;if(P||L){if(y==="first")return P?-1:1;if(y==="last")return P?1:-1;f=P&&L?0:P?y:-y}}if(f===0&&(f=h.sortingFn(p,m,v.id)),f!==0)return _&&(f*=-1),h.invertSorting&&(f*=-1),f}return p.index-m.index}),c.forEach(p=>{var m;r.push(p),(m=p.subRows)!=null&&m.length&&(p.subRows=a(p.subRows))}),c};return{rows:a(n.rows),flatRows:r,rowsById:n.rowsById}},Ge(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function Vi(e,t){return e?CC(e)?ea.createElement(e,t):e:null}function CC(e){return kC(e)||typeof e=="function"||SC(e)}function kC(e){return typeof e=="function"&&(()=>{let t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function SC(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function f_(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=ea.useState(()=>({current:c_(t)})),[o,r]=ea.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...o,...e.state},onStateChange:l=>{r(l),e.onStateChange==null||e.onStateChange(l)}})),n.current}var ne=ze(yt()),Zr=ze(vo());var jt=ze(yt());function h_(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,jt.useMemo)(()=>o=>{t.forEach(r=>r(o))},t)}var ta=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function qr(e){let t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function eu(e){return"nodeType"in e}function yn(e){var t,n;return e?qr(e)?e:eu(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function tu(e){let{Document:t}=yn(e);return e instanceof t}function Bi(e){return qr(e)?!1:e instanceof yn(e).HTMLElement}function Tp(e){return e instanceof yn(e).SVGElement}function Kr(e){return e?qr(e)?e.document:eu(e)?tu(e)?e:Bi(e)||Tp(e)?e.ownerDocument:document:document:document}var oo=ta?jt.useLayoutEffect:jt.useEffect;function nu(e){let t=(0,jt.useRef)(e);return oo(()=>{t.current=e}),(0,jt.useCallback)(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}function __(){let e=(0,jt.useRef)(null),t=(0,jt.useCallback)((o,r)=>{e.current=setInterval(o,r)},[]),n=(0,jt.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ji(e,t){t===void 0&&(t=[e]);let n=(0,jt.useRef)(e);return oo(()=>{n.current!==e&&(n.current=e)},t),n}function Hi(e,t){let n=(0,jt.useRef)();return(0,jt.useMemo)(()=>{let o=e(n.current);return n.current=o,o},[...t])}function na(e){let t=nu(e),n=(0,jt.useRef)(null),o=(0,jt.useCallback)(r=>{r!==n.current&&t?.(r,n.current),n.current=r},[]);return[n,o]}function ou(e){let t=(0,jt.useRef)();return(0,jt.useEffect)(()=>{t.current=e},[e]),t.current}var Mp={};function Yr(e,t){return(0,jt.useMemo)(()=>{if(t)return t;let n=Mp[e]==null?0:Mp[e]+1;return Mp[e]=n,e+"-"+n},[e,t])}function v_(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((i,l)=>{let a=Object.entries(l);for(let[s,c]of a){let p=i[s];p!=null&&(i[s]=p+e*c)}return i},{...t})}}var Xr=v_(1),Ui=v_(-1);function NC(e){return"clientX"in e&&"clientY"in e}function oa(e){if(!e)return!1;let{KeyboardEvent:t}=yn(e.target);return t&&e instanceof t}function xC(e){if(!e)return!1;let{TouchEvent:t}=yn(e.target);return t&&e instanceof t}function ru(e){if(xC(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return NC(e)?{x:e.clientX,y:e.clientY}:null}var Ko=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ko.Translate.toString(e),Ko.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),g_="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function b_(e){return e.matches(g_)?e:e.querySelector(g_)}var Qr=ze(yt()),RC={display:"none"};function y_(e){let{id:t,value:n}=e;return Qr.default.createElement("div",{id:t,style:RC},n)}function w_(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e,r={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Qr.default.createElement("div",{id:t,style:r,role:"status","aria-live":o,"aria-atomic":!0},n)}function C_(){let[e,t]=(0,Qr.useState)("");return{announce:(0,Qr.useCallback)(o=>{o!=null&&t(o)},[]),announcement:e}}var P_=(0,ne.createContext)(null);function EC(e){let t=(0,ne.useContext)(P_);(0,ne.useEffect)(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function FC(){let[e]=(0,ne.useState)(()=>new Set),t=(0,ne.useCallback)(o=>(e.add(o),()=>e.delete(o)),[e]);return[(0,ne.useCallback)(o=>{let{type:r,event:i}=o;e.forEach(l=>{var a;return(a=l[r])==null?void 0:a.call(l,i)})},[e]),t]}var DC={draggable:`
To pick up a draggable item, press the space bar.
While dragging, use the arrow keys to move the item.
Press space again to drop the item in its new position, or press escape to cancel.
`},MC={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function TC(e){let{announcements:t=MC,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=DC}=e,{announce:i,announcement:l}=C_(),a=Yr("DndLiveRegion"),[s,c]=(0,ne.useState)(!1);if((0,ne.useEffect)(()=>{c(!0)},[]),EC((0,ne.useMemo)(()=>({onDragStart(m){let{active:g}=m;i(t.onDragStart({active:g}))},onDragMove(m){let{active:g,over:d}=m;t.onDragMove&&i(t.onDragMove({active:g,over:d}))},onDragOver(m){let{active:g,over:d}=m;i(t.onDragOver({active:g,over:d}))},onDragEnd(m){let{active:g,over:d}=m;i(t.onDragEnd({active:g,over:d}))},onDragCancel(m){let{active:g,over:d}=m;i(t.onDragCancel({active:g,over:d}))}}),[i,t])),!s)return null;let p=ne.default.createElement(ne.default.Fragment,null,ne.default.createElement(y_,{id:o,value:r.draggable}),ne.default.createElement(w_,{id:a,announcement:l}));return n?(0,Zr.createPortal)(p,n):p}var Yt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Yt||(Yt={}));function lu(){}function Vp(e,t){return(0,ne.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function I_(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,ne.useMemo)(()=>[...t].filter(o=>o!=null),[...t])}var yo=Object.freeze({x:0,y:0});function LC(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function PC(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function IC(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function A_(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function k_(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var Bp=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e,r=k_(t,t.left,t.top),i=[];for(let l of o){let{id:a}=l,s=n.get(a);if(s){let c=LC(k_(s),r);i.push({id:a,data:{droppableContainer:l,value:c}})}}return i.sort(PC)};function AC(e,t){let n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),l=r-o,a=i-n;if(o<r&&n<i){let s=t.width*t.height,c=e.width*e.height,p=l*a,m=p/(s+c-p);return Number(m.toFixed(4))}return 0}var OC=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e,r=[];for(let i of o){let{id:l}=i,a=n.get(l);if(a){let s=AC(a,t);s>0&&r.push({id:l,data:{droppableContainer:i,value:s}})}}return r.sort(IC)};function $C(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function O_(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:yo}function zC(e){return function(n){for(var o=arguments.length,r=new Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];return r.reduce((l,a)=>({...l,top:l.top+e*a.y,bottom:l.bottom+e*a.y,left:l.left+e*a.x,right:l.right+e*a.x}),{...n})}}var VC=zC(1);function BC(e){if(e.startsWith("matrix3d(")){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function jC(e,t,n){let o=BC(t);if(!o)return e;let{scaleX:r,scaleY:i,x:l,y:a}=o,s=e.left-l-(1-r)*parseFloat(n),c=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),p=r?e.width/r:e.width,m=i?e.height/i:e.height;return{width:p,height:m,top:c,right:s+p,bottom:c+m,left:s}}var HC={ignoreTransform:!1};function ti(e,t){t===void 0&&(t=HC);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:c,transformOrigin:p}=yn(e).getComputedStyle(e);c&&(n=jC(n,c,p))}let{top:o,left:r,width:i,height:l,bottom:a,right:s}=n;return{top:o,left:r,width:i,height:l,bottom:a,right:s}}function S_(e){return ti(e,{ignoreTransform:!0})}function UC(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function WC(e,t){return t===void 0&&(t=yn(e).getComputedStyle(e)),t.position==="fixed"}function GC(e,t){t===void 0&&(t=yn(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(r=>{let i=t[r];return typeof i=="string"?n.test(i):!1})}function uu(e,t){let n=[];function o(r){if(t!=null&&n.length>=t||!r)return n;if(tu(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!Bi(r)||Tp(r)||n.includes(r))return n;let i=yn(e).getComputedStyle(r);return r!==e&&GC(r,i)&&n.push(r),WC(r,i)?n:o(r.parentNode)}return e?o(e):n}function $_(e){let[t]=uu(e,1);return t??null}function Lp(e){return!ta||!e?null:qr(e)?e:eu(e)?tu(e)||e===Kr(e).scrollingElement?window:Bi(e)?e:null:null}function z_(e){return qr(e)?e.scrollX:e.scrollLeft}function V_(e){return qr(e)?e.scrollY:e.scrollTop}function Ap(e){return{x:z_(e),y:V_(e)}}var Zt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Zt||(Zt={}));function B_(e){return!ta||!e?!1:e===document.scrollingElement}function j_(e){let t={x:0,y:0},n=B_(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},r=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,l=e.scrollTop>=o.y,a=e.scrollLeft>=o.x;return{isTop:r,isLeft:i,isBottom:l,isRight:a,maxScroll:o,minScroll:t}}var qC={x:.2,y:.2};function KC(e,t,n,o,r){let{top:i,left:l,right:a,bottom:s}=n;o===void 0&&(o=10),r===void 0&&(r=qC);let{isTop:c,isBottom:p,isLeft:m,isRight:g}=j_(e),d={x:0,y:0},v={x:0,y:0},h={height:t.height*r.y,width:t.width*r.x};return!c&&i<=t.top+h.height?(d.y=Zt.Backward,v.y=o*Math.abs((t.top+h.height-i)/h.height)):!p&&s>=t.bottom-h.height&&(d.y=Zt.Forward,v.y=o*Math.abs((t.bottom-h.height-s)/h.height)),!g&&a>=t.right-h.width?(d.x=Zt.Forward,v.x=o*Math.abs((t.right-h.width-a)/h.width)):!m&&l<=t.left+h.width&&(d.x=Zt.Backward,v.x=o*Math.abs((t.left+h.width-l)/h.width)),{direction:d,speed:v}}function YC(e){if(e===document.scrollingElement){let{innerWidth:i,innerHeight:l}=window;return{top:0,left:0,right:i,bottom:l,width:i,height:l}}let{top:t,left:n,right:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function H_(e){return e.reduce((t,n)=>Xr(t,Ap(n)),yo)}function XC(e){return e.reduce((t,n)=>t+z_(n),0)}function QC(e){return e.reduce((t,n)=>t+V_(n),0)}function ZC(e,t){if(t===void 0&&(t=ti),!e)return;let{top:n,left:o,bottom:r,right:i}=t(e);$_(e)&&(r<=0||i<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}var JC=[["x",["left","right"],XC],["y",["top","bottom"],QC]],ia=class{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let o=uu(n),r=H_(o);this.rect={...t},this.width=t.width,this.height=t.height;for(let[i,l,a]of JC)for(let s of l)Object.defineProperty(this,s,{get:()=>{let c=a(o),p=r[i]-c;return this.rect[s]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},Jr=class{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...n)})},this.target=t}add(t,n,o){var r;(r=this.target)==null||r.addEventListener(t,n,o),this.listeners.push([t,n,o])}};function e0(e){let{EventTarget:t}=yn(e);return e instanceof t?e:Kr(e)}function Pp(e,t){let n=Math.abs(e.x),o=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t?o>t.y:!1}var ro;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(ro||(ro={}));function N_(e){e.preventDefault()}function t0(e){e.stopPropagation()}var mt;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(mt||(mt={}));var U_={start:[mt.Space,mt.Enter],cancel:[mt.Esc],end:[mt.Space,mt.Enter,mt.Tab]},n0=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case mt.Right:return{...n,x:n.x+25};case mt.Left:return{...n,x:n.x-25};case mt.Down:return{...n,y:n.y+25};case mt.Up:return{...n,y:n.y-25}}},au=class{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;let{event:{target:n}}=t;this.props=t,this.listeners=new Jr(Kr(n)),this.windowListeners=new Jr(yn(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ro.Resize,this.handleCancel),this.windowListeners.add(ro.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ro.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&ZC(o),n(yo)}handleKeyDown(t){if(oa(t)){let{active:n,context:o,options:r}=this.props,{keyboardCodes:i=U_,coordinateGetter:l=n0,scrollBehavior:a="smooth"}=r,{code:s}=t;if(i.end.includes(s)){this.handleEnd(t);return}if(i.cancel.includes(s)){this.handleCancel(t);return}let{collisionRect:c}=o.current,p=c?{x:c.left,y:c.top}:yo;this.referenceCoordinates||(this.referenceCoordinates=p);let m=l(t,{active:n,context:o.current,currentCoordinates:p});if(m){let g=Ui(m,p),d={x:0,y:0},{scrollableAncestors:v}=o.current;for(let h of v){let y=t.code,{isTop:_,isRight:f,isLeft:w,isBottom:R,maxScroll:P,minScroll:L}=j_(h),V=YC(h),W={x:Math.min(y===mt.Right?V.right-V.width/2:V.right,Math.max(y===mt.Right?V.left:V.left+V.width/2,m.x)),y:Math.min(y===mt.Down?V.bottom-V.height/2:V.bottom,Math.max(y===mt.Down?V.top:V.top+V.height/2,m.y))},re=y===mt.Right&&!f||y===mt.Left&&!w,J=y===mt.Down&&!R||y===mt.Up&&!_;if(re&&W.x!==m.x){let ue=h.scrollLeft+g.x,Ne=y===mt.Right&&ue<=P.x||y===mt.Left&&ue>=L.x;if(Ne&&!g.y){h.scrollTo({left:ue,behavior:a});return}Ne?d.x=h.scrollLeft-ue:d.x=y===mt.Right?h.scrollLeft-P.x:h.scrollLeft-L.x,d.x&&h.scrollBy({left:-d.x,behavior:a});break}else if(J&&W.y!==m.y){let ue=h.scrollTop+g.y,Ne=y===mt.Down&&ue<=P.y||y===mt.Up&&ue>=L.y;if(Ne&&!g.x){h.scrollTo({top:ue,behavior:a});return}Ne?d.y=h.scrollTop-ue:d.y=y===mt.Down?h.scrollTop-P.y:h.scrollTop-L.y,d.y&&h.scrollBy({top:-d.y,behavior:a});break}}this.handleMove(t,Xr(Ui(m,this.referenceCoordinates),d))}}}handleMove(t,n){let{onMove:o}=this.props;t.preventDefault(),o(n)}handleEnd(t){let{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){let{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};au.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=U_,onActivation:r}=t,{active:i}=n,{code:l}=e.nativeEvent;if(o.start.includes(l)){let a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),r?.({event:e.nativeEvent}),!0)}return!1}}];function x_(e){return!!(e&&"distance"in e)}function R_(e){return!!(e&&"delay"in e)}var la=class{constructor(t,n,o){var r;o===void 0&&(o=e0(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;let{event:i}=t,{target:l}=i;this.props=t,this.events=n,this.document=Kr(l),this.documentListeners=new Jr(this.document),this.listeners=new Jr(o),this.windowListeners=new Jr(yn(l)),this.initialCoordinates=(r=ru(i))!=null?r:yo,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:o}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(ro.Resize,this.handleCancel),this.windowListeners.add(ro.DragStart,N_),this.windowListeners.add(ro.VisibilityChange,this.handleCancel),this.windowListeners.add(ro.ContextMenu,N_),this.documentListeners.add(ro.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(R_(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(x_(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){let{active:o,onPending:r}=this.props;r(o,t,this.initialCoordinates,n)}handleStart(){let{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(ro.Click,t0,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ro.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;let{activated:o,initialCoordinates:r,props:i}=this,{onMove:l,options:{activationConstraint:a}}=i;if(!r)return;let s=(n=ru(t))!=null?n:yo,c=Ui(r,s);if(!o&&a){if(x_(a)){if(a.tolerance!=null&&Pp(c,a.tolerance))return this.handleCancel();if(Pp(c,a.distance))return this.handleStart()}if(R_(a)&&Pp(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),l(s)}handleEnd(){let{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){let{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===mt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}},o0={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}},Wi=class extends la{constructor(t){let{event:n}=t,o=Kr(n.target);super(t,o0,o)}};Wi.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!n.isPrimary||n.button!==0?!1:(o?.({event:n}),!0)}}];var r0={move:{name:"mousemove"},end:{name:"mouseup"}},Op;(function(e){e[e.RightClick=2]="RightClick"})(Op||(Op={}));var $p=class extends la{constructor(t){super(t,r0,Kr(t.event.target))}};$p.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button===Op.RightClick?!1:(o?.({event:n}),!0)}}];var Ip={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}},aa=class extends la{constructor(t){super(t,Ip)}static setup(){return window.addEventListener(Ip.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ip.move.name,t)};function t(){}}};aa.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t,{touches:r}=n;return r.length>1?!1:(o?.({event:n}),!0)}}];var ra;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ra||(ra={}));var su;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(su||(su={}));function i0(e){let{acceleration:t,activator:n=ra.Pointer,canScroll:o,draggingRect:r,enabled:i,interval:l=5,order:a=su.TreeOrder,pointerCoordinates:s,scrollableAncestors:c,scrollableAncestorRects:p,delta:m,threshold:g}=e,d=a0({delta:m,disabled:!i}),[v,h]=__(),y=(0,ne.useRef)({x:0,y:0}),_=(0,ne.useRef)({x:0,y:0}),f=(0,ne.useMemo)(()=>{switch(n){case ra.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case ra.DraggableRect:return r}},[n,r,s]),w=(0,ne.useRef)(null),R=(0,ne.useCallback)(()=>{let L=w.current;if(!L)return;let V=y.current.x*_.current.x,W=y.current.y*_.current.y;L.scrollBy(V,W)},[]),P=(0,ne.useMemo)(()=>a===su.TreeOrder?[...c].reverse():c,[a,c]);(0,ne.useEffect)(()=>{if(!i||!c.length||!f){h();return}for(let L of P){if(o?.(L)===!1)continue;let V=c.indexOf(L),W=p[V];if(!W)continue;let{direction:re,speed:J}=KC(L,W,f,t,g);for(let ue of["x","y"])d[ue][re[ue]]||(J[ue]=0,re[ue]=0);if(J.x>0||J.y>0){h(),w.current=L,v(R,l),y.current=J,_.current=re;return}}y.current={x:0,y:0},_.current={x:0,y:0},h()},[t,R,o,h,i,l,JSON.stringify(f),JSON.stringify(d),v,c,P,p,JSON.stringify(g)])}var l0={x:{[Zt.Backward]:!1,[Zt.Forward]:!1},y:{[Zt.Backward]:!1,[Zt.Forward]:!1}};function a0(e){let{delta:t,disabled:n}=e,o=ou(t);return Hi(r=>{if(n||!o||!r)return l0;let i={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[Zt.Backward]:r.x[Zt.Backward]||i.x===-1,[Zt.Forward]:r.x[Zt.Forward]||i.x===1},y:{[Zt.Backward]:r.y[Zt.Backward]||i.y===-1,[Zt.Forward]:r.y[Zt.Forward]||i.y===1}}},[n,t,o])}function s0(e,t){let n=t!=null?e.get(t):void 0,o=n?n.node.current:null;return Hi(r=>{var i;return t==null?null:(i=o??r)!=null?i:null},[o,t])}function u0(e,t){return(0,ne.useMemo)(()=>e.reduce((n,o)=>{let{sensor:r}=o,i=r.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,o)}));return[...n,...i]},[]),[e,t])}var sa;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(sa||(sa={}));var zp;(function(e){e.Optimized="optimized"})(zp||(zp={}));var E_=new Map;function c0(e,t){let{dragging:n,dependencies:o,config:r}=t,[i,l]=(0,ne.useState)(null),{frequency:a,measure:s,strategy:c}=r,p=(0,ne.useRef)(e),m=y(),g=ji(m),d=(0,ne.useCallback)(function(_){_===void 0&&(_=[]),!g.current&&l(f=>f===null?_:f.concat(_.filter(w=>!f.includes(w))))},[g]),v=(0,ne.useRef)(null),h=Hi(_=>{if(m&&!n)return E_;if(!_||_===E_||p.current!==e||i!=null){let f=new Map;for(let w of e){if(!w)continue;if(i&&i.length>0&&!i.includes(w.id)&&w.rect.current){f.set(w.id,w.rect.current);continue}let R=w.node.current,P=R?new ia(s(R),R):null;w.rect.current=P,P&&f.set(w.id,P)}return f}return _},[e,i,n,m,s]);return(0,ne.useEffect)(()=>{p.current=e},[e]),(0,ne.useEffect)(()=>{m||d()},[n,m]),(0,ne.useEffect)(()=>{i&&i.length>0&&l(null)},[JSON.stringify(i)]),(0,ne.useEffect)(()=>{m||typeof a!="number"||v.current!==null||(v.current=setTimeout(()=>{d(),v.current=null},a))},[a,m,d,...o]),{droppableRects:h,measureDroppableContainers:d,measuringScheduled:i!=null};function y(){switch(c){case sa.Always:return!1;case sa.BeforeDragging:return n;default:return!n}}}function W_(e,t){return Hi(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function d0(e,t){return W_(e,t)}function p0(e){let{callback:t,disabled:n}=e,o=nu(t),r=(0,ne.useMemo)(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:i}=window;return new i(o)},[o,n]);return(0,ne.useEffect)(()=>()=>r?.disconnect(),[r]),r}function cu(e){let{callback:t,disabled:n}=e,o=nu(t),r=(0,ne.useMemo)(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:i}=window;return new i(o)},[n]);return(0,ne.useEffect)(()=>()=>r?.disconnect(),[r]),r}function m0(e){return new ia(ti(e),e)}function F_(e,t,n){t===void 0&&(t=m0);let[o,r]=(0,ne.useState)(null);function i(){r(s=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=s??n)!=null?c:null}let p=t(e);return JSON.stringify(s)===JSON.stringify(p)?s:p})}let l=p0({callback(s){if(e)for(let c of s){let{type:p,target:m}=c;if(p==="childList"&&m instanceof HTMLElement&&m.contains(e)){i();break}}}}),a=cu({callback:i});return oo(()=>{i(),e?(a?.observe(e),l?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),l?.disconnect())},[e]),o}function f0(e){let t=W_(e);return O_(e,t)}var D_=[];function g0(e){let t=(0,ne.useRef)(e),n=Hi(o=>e?o&&o!==D_&&e&&t.current&&e.parentNode===t.current.parentNode?o:uu(e):D_,[e]);return(0,ne.useEffect)(()=>{t.current=e},[e]),n}function h0(e){let[t,n]=(0,ne.useState)(null),o=(0,ne.useRef)(e),r=(0,ne.useCallback)(i=>{let l=Lp(i.target);l&&n(a=>a?(a.set(l,Ap(l)),new Map(a)):null)},[]);return(0,ne.useEffect)(()=>{let i=o.current;if(e!==i){l(i);let a=e.map(s=>{let c=Lp(s);return c?(c.addEventListener("scroll",r,{passive:!0}),[c,Ap(c)]):null}).filter(s=>s!=null);n(a.length?new Map(a):null),o.current=e}return()=>{l(e),l(i)};function l(a){a.forEach(s=>{let c=Lp(s);c?.removeEventListener("scroll",r)})}},[r,e]),(0,ne.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((i,l)=>Xr(i,l),yo):H_(e):yo,[e,t])}function M_(e,t){t===void 0&&(t=[]);let n=(0,ne.useRef)(null);return(0,ne.useEffect)(()=>{n.current=null},t),(0,ne.useEffect)(()=>{let o=e!==yo;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?Ui(e,n.current):yo}function _0(e){(0,ne.useEffect)(()=>{if(!ta)return;let t=e.map(n=>{let{sensor:o}=n;return o.setup==null?void 0:o.setup()});return()=>{for(let n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function v0(e,t){return(0,ne.useMemo)(()=>e.reduce((n,o)=>{let{eventName:r,handler:i}=o;return n[r]=l=>{i(l,t)},n},{}),[e,t])}function G_(e){return(0,ne.useMemo)(()=>e?UC(e):null,[e])}var T_=[];function b0(e,t){t===void 0&&(t=ti);let[n]=e,o=G_(n?yn(n):null),[r,i]=(0,ne.useState)(T_);function l(){i(()=>e.length?e.map(s=>B_(s)?o:new ia(t(s),s)):T_)}let a=cu({callback:l});return oo(()=>{a?.disconnect(),l(),e.forEach(s=>a?.observe(s))},[e]),r}function y0(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return Bi(t)?t:e}function w0(e){let{measure:t}=e,[n,o]=(0,ne.useState)(null),r=(0,ne.useCallback)(c=>{for(let{target:p}of c)if(Bi(p)){o(m=>{let g=t(p);return m?{...m,width:g.width,height:g.height}:g});break}},[t]),i=cu({callback:r}),l=(0,ne.useCallback)(c=>{let p=y0(c);i?.disconnect(),p&&i?.observe(p),o(p?t(p):null)},[t,i]),[a,s]=na(l);return(0,ne.useMemo)(()=>({nodeRef:a,rect:n,setRef:s}),[n,a,s])}var C0=[{sensor:Wi,options:{}},{sensor:au,options:{}}],k0={current:{}},iu={draggable:{measure:S_},droppable:{measure:S_,strategy:sa.WhileDragging,frequency:zp.Optimized},dragOverlay:{measure:ti}},ei=class extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,o;return(n=(o=this.get(t))==null?void 0:o.node.current)!=null?n:void 0}},S0={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ei,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:lu},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:iu,measureDroppableContainers:lu,windowRect:null,measuringScheduled:!1},N0={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:lu,draggableNodes:new Map,over:null,measureDroppableContainers:lu},du=(0,ne.createContext)(N0),q_=(0,ne.createContext)(S0);function x0(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ei}}}function R0(e,t){switch(t.type){case Yt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Yt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Yt.DragEnd:case Yt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Yt.RegisterDroppable:{let{element:n}=t,{id:o}=n,r=new ei(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case Yt.SetDroppableDisabled:{let{id:n,key:o,disabled:r}=t,i=e.droppable.containers.get(n);if(!i||o!==i.key)return e;let l=new ei(e.droppable.containers);return l.set(n,{...i,disabled:r}),{...e,droppable:{...e.droppable,containers:l}}}case Yt.UnregisterDroppable:{let{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;let i=new ei(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function E0(e){let{disabled:t}=e,{active:n,activatorEvent:o,draggableNodes:r}=(0,ne.useContext)(du),i=ou(o),l=ou(n?.id);return(0,ne.useEffect)(()=>{if(!t&&!o&&i&&l!=null){if(!oa(i)||document.activeElement===i.target)return;let a=r.get(l);if(!a)return;let{activatorNode:s,node:c}=a;if(!s.current&&!c.current)return;requestAnimationFrame(()=>{for(let p of[s.current,c.current]){if(!p)continue;let m=b_(p);if(m){m.focus();break}}})}},[o,t,r,l,i]),null}function F0(e,t){let{transform:n,...o}=t;return e!=null&&e.length?e.reduce((r,i)=>i({transform:r,...o}),n):n}function D0(e){return(0,ne.useMemo)(()=>({draggable:{...iu.draggable,...e?.draggable},droppable:{...iu.droppable,...e?.droppable},dragOverlay:{...iu.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function M0(e){let{activeNode:t,measure:n,initialRect:o,config:r=!0}=e,i=(0,ne.useRef)(!1),{x:l,y:a}=typeof r=="boolean"?{x:r,y:r}:r;oo(()=>{if(!l&&!a||!t){i.current=!1;return}if(i.current||!o)return;let c=t?.node.current;if(!c||c.isConnected===!1)return;let p=n(c),m=O_(p,o);if(l||(m.x=0),a||(m.y=0),i.current=!0,Math.abs(m.x)>0||Math.abs(m.y)>0){let g=$_(c);g&&g.scrollBy({top:m.y,left:m.x})}},[t,l,a,o,n])}var K_=(0,ne.createContext)({...yo,scaleX:1,scaleY:1}),br;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(br||(br={}));var jp=(0,ne.memo)(function(t){var n,o,r,i;let{id:l,accessibility:a,autoScroll:s=!0,children:c,sensors:p=C0,collisionDetection:m=OC,measuring:g,modifiers:d,...v}=t,h=(0,ne.useReducer)(R0,void 0,x0),[y,_]=h,[f,w]=FC(),[R,P]=(0,ne.useState)(br.Uninitialized),L=R===br.Initialized,{draggable:{active:V,nodes:W,translate:re},droppable:{containers:J}}=y,ue=V!=null?W.get(V):null,Ne=(0,ne.useRef)({initial:null,translated:null}),de=(0,ne.useMemo)(()=>{var Se;return V!=null?{id:V,data:(Se=ue?.data)!=null?Se:k0,rect:Ne}:null},[V,ue]),Re=(0,ne.useRef)(null),[Y,te]=(0,ne.useState)(null),[j,ie]=(0,ne.useState)(null),_e=ji(v,Object.values(v)),me=Yr("DndDescribedBy",l),Ae=(0,ne.useMemo)(()=>J.getEnabled(),[J]),Ee=D0(g),{droppableRects:xe,measureDroppableContainers:Fe,measuringScheduled:Ie}=c0(Ae,{dragging:L,dependencies:[re.x,re.y],config:Ee.droppable}),Ve=s0(W,V),He=(0,ne.useMemo)(()=>j?ru(j):null,[j]),Ye=Me(),Ze=d0(Ve,Ee.draggable.measure);M0({activeNode:V!=null?W.get(V):null,config:Ye.layoutShiftCompensation,initialRect:Ze,measure:Ee.draggable.measure});let De=F_(Ve,Ee.draggable.measure,Ze),q=F_(Ve?Ve.parentElement:null),ce=(0,ne.useRef)({activatorEvent:null,active:null,activeNode:Ve,collisionRect:null,collisions:null,droppableRects:xe,draggableNodes:W,draggingNode:null,draggingNodeRect:null,droppableContainers:J,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),$=J.getNodeFor((n=ce.current.over)==null?void 0:n.id),oe=w0({measure:Ee.dragOverlay.measure}),ve=(o=oe.nodeRef.current)!=null?o:Ve,S=L?(r=oe.rect)!=null?r:De:null,K=!!(oe.nodeRef.current&&oe.rect),D=f0(K?null:De),Z=G_(ve?yn(ve):null),ke=g0(L?$??Ve:null),ye=b0(ke),ft=F0(d,{transform:{x:re.x-D.x,y:re.y-D.y,scaleX:1,scaleY:1},activatorEvent:j,active:de,activeNodeRect:De,containerNodeRect:q,draggingNodeRect:S,over:ce.current.over,overlayNodeRect:oe.rect,scrollableAncestors:ke,scrollableAncestorRects:ye,windowRect:Z}),Jt=He?Xr(He,re):null,vt=h0(ke),Mt=M_(vt),Et=M_(vt,[De]),bt=Xr(ft,Mt),$t=S?VC(S,ft):null,it=de&&$t?m({active:de,collisionRect:$t,droppableRects:xe,droppableContainers:Ae,pointerCoordinates:Jt}):null,en=A_(it,"id"),[M,Ce]=(0,ne.useState)(null),C=K?ft:Xr(ft,Et),X=$C(C,(i=M?.rect)!=null?i:null,De),H=(0,ne.useRef)(null),ae=(0,ne.useCallback)((Se,U)=>{let{sensor:Le,options:Pe}=U;if(Re.current==null)return;let Oe=W.get(Re.current);if(!Oe)return;let $e=Se.nativeEvent,Xe=new Le({active:Re.current,activeNode:Oe,event:$e,options:Pe,context:ce,onAbort(ct){if(!W.get(ct))return;let{onDragAbort:It}=_e.current,At={id:ct};It?.(At),f({type:"onDragAbort",event:At})},onPending(ct,gt,It,At){if(!W.get(ct))return;let{onDragPending:tn}=_e.current,fn={id:ct,constraint:gt,initialCoordinates:It,offset:At};tn?.(fn),f({type:"onDragPending",event:fn})},onStart(ct){let gt=Re.current;if(gt==null)return;let It=W.get(gt);if(!It)return;let{onDragStart:At}=_e.current,zt={activatorEvent:$e,active:{id:gt,data:It.data,rect:Ne}};(0,Zr.unstable_batchedUpdates)(()=>{At?.(zt),P(br.Initializing),_({type:Yt.DragStart,initialCoordinates:ct,active:gt}),f({type:"onDragStart",event:zt}),te(H.current),ie($e)})},onMove(ct){_({type:Yt.DragMove,coordinates:ct})},onEnd:ut(Yt.DragEnd),onCancel:ut(Yt.DragCancel)});H.current=Xe;function ut(ct){return async function(){let{active:It,collisions:At,over:zt,scrollAdjustedTranslate:tn}=ce.current,fn=null;if(It&&tn){let{cancelDrop:gn}=_e.current;fn={activatorEvent:$e,active:It,collisions:At,delta:tn,over:zt},ct===Yt.DragEnd&&typeof gn=="function"&&await Promise.resolve(gn(fn))&&(ct=Yt.DragCancel)}Re.current=null,(0,Zr.unstable_batchedUpdates)(()=>{_({type:ct}),P(br.Uninitialized),Ce(null),te(null),ie(null),H.current=null;let gn=ct===Yt.DragEnd?"onDragEnd":"onDragCancel";if(fn){let ln=_e.current[gn];ln?.(fn),f({type:gn,event:fn})}})}}},[W]),le=(0,ne.useCallback)((Se,U)=>(Le,Pe)=>{let Oe=Le.nativeEvent,$e=W.get(Pe);if(Re.current!==null||!$e||Oe.dndKit||Oe.defaultPrevented)return;let Xe={active:$e};Se(Le,U.options,Xe)===!0&&(Oe.dndKit={capturedBy:U.sensor},Re.current=Pe,ae(Le,U))},[W,ae]),we=u0(p,le);_0(p),oo(()=>{De&&R===br.Initializing&&P(br.Initialized)},[De,R]),(0,ne.useEffect)(()=>{let{onDragMove:Se}=_e.current,{active:U,activatorEvent:Le,collisions:Pe,over:Oe}=ce.current;if(!U||!Le)return;let $e={active:U,activatorEvent:Le,collisions:Pe,delta:{x:bt.x,y:bt.y},over:Oe};(0,Zr.unstable_batchedUpdates)(()=>{Se?.($e),f({type:"onDragMove",event:$e})})},[bt.x,bt.y]),(0,ne.useEffect)(()=>{let{active:Se,activatorEvent:U,collisions:Le,droppableContainers:Pe,scrollAdjustedTranslate:Oe}=ce.current;if(!Se||Re.current==null||!U||!Oe)return;let{onDragOver:$e}=_e.current,Xe=Pe.get(en),ut=Xe&&Xe.rect.current?{id:Xe.id,rect:Xe.rect.current,data:Xe.data,disabled:Xe.disabled}:null,ct={active:Se,activatorEvent:U,collisions:Le,delta:{x:Oe.x,y:Oe.y},over:ut};(0,Zr.unstable_batchedUpdates)(()=>{Ce(ut),$e?.(ct),f({type:"onDragOver",event:ct})})},[en]),oo(()=>{ce.current={activatorEvent:j,active:de,activeNode:Ve,collisionRect:$t,collisions:it,droppableRects:xe,draggableNodes:W,draggingNode:ve,draggingNodeRect:S,droppableContainers:J,over:M,scrollableAncestors:ke,scrollAdjustedTranslate:bt},Ne.current={initial:S,translated:$t}},[de,Ve,it,$t,W,ve,S,xe,J,M,ke,bt]),i0({...Ye,delta:re,draggingRect:$t,pointerCoordinates:Jt,scrollableAncestors:ke,scrollableAncestorRects:ye});let N=(0,ne.useMemo)(()=>({active:de,activeNode:Ve,activeNodeRect:De,activatorEvent:j,collisions:it,containerNodeRect:q,dragOverlay:oe,draggableNodes:W,droppableContainers:J,droppableRects:xe,over:M,measureDroppableContainers:Fe,scrollableAncestors:ke,scrollableAncestorRects:ye,measuringConfiguration:Ee,measuringScheduled:Ie,windowRect:Z}),[de,Ve,De,j,it,q,oe,W,J,xe,M,Fe,ke,ye,Ee,Ie,Z]),be=(0,ne.useMemo)(()=>({activatorEvent:j,activators:we,active:de,activeNodeRect:De,ariaDescribedById:{draggable:me},dispatch:_,draggableNodes:W,over:M,measureDroppableContainers:Fe}),[j,we,de,De,_,me,W,M,Fe]);return ne.default.createElement(P_.Provider,{value:w},ne.default.createElement(du.Provider,{value:be},ne.default.createElement(q_.Provider,{value:N},ne.default.createElement(K_.Provider,{value:X},c)),ne.default.createElement(E0,{disabled:a?.restoreFocus===!1})),ne.default.createElement(TC,{...a,hiddenTextDescribedById:me}));function Me(){let Se=Y?.autoScrollEnabled===!1,U=typeof s=="object"?s.enabled===!1:s===!1,Le=L&&!Se&&!U;return typeof s=="object"?{...s,enabled:Le}:{enabled:Le}}}),T0=(0,ne.createContext)(null),L_="button",L0="Draggable";function Y_(e){let{id:t,data:n,disabled:o=!1,attributes:r}=e,i=Yr(L0),{activators:l,activatorEvent:a,active:s,activeNodeRect:c,ariaDescribedById:p,draggableNodes:m,over:g}=(0,ne.useContext)(du),{role:d=L_,roleDescription:v="draggable",tabIndex:h=0}=r??{},y=s?.id===t,_=(0,ne.useContext)(y?K_:T0),[f,w]=na(),[R,P]=na(),L=v0(l,t),V=ji(n);oo(()=>(m.set(t,{id:t,key:i,node:f,activatorNode:R,data:V}),()=>{let re=m.get(t);re&&re.key===i&&m.delete(t)}),[m,t]);let W=(0,ne.useMemo)(()=>({role:d,tabIndex:h,"aria-disabled":o,"aria-pressed":y&&d===L_?!0:void 0,"aria-roledescription":v,"aria-describedby":p.draggable}),[o,d,h,y,v,p.draggable]);return{active:s,activatorEvent:a,activeNodeRect:c,attributes:W,isDragging:y,listeners:o?void 0:L,node:f,over:g,setNodeRef:w,setActivatorNodeRef:P,transform:_}}function X_(){return(0,ne.useContext)(q_)}var P0="Droppable",I0={timeout:25};function Q_(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:r}=e,i=Yr(P0),{active:l,dispatch:a,over:s,measureDroppableContainers:c}=(0,ne.useContext)(du),p=(0,ne.useRef)({disabled:n}),m=(0,ne.useRef)(!1),g=(0,ne.useRef)(null),d=(0,ne.useRef)(null),{disabled:v,updateMeasurementsFor:h,timeout:y}={...I0,...r},_=ji(h??o),f=(0,ne.useCallback)(()=>{if(!m.current){m.current=!0;return}d.current!=null&&clearTimeout(d.current),d.current=setTimeout(()=>{c(Array.isArray(_.current)?_.current:[_.current]),d.current=null},y)},[y]),w=cu({callback:f,disabled:v||!l}),R=(0,ne.useCallback)((W,re)=>{w&&(re&&(w.unobserve(re),m.current=!1),W&&w.observe(W))},[w]),[P,L]=na(R),V=ji(t);return(0,ne.useEffect)(()=>{!w||!P.current||(w.disconnect(),m.current=!1,w.observe(P.current))},[P,w]),(0,ne.useEffect)(()=>(a({type:Yt.RegisterDroppable,element:{id:o,key:i,disabled:n,node:P,rect:g,data:V}}),()=>a({type:Yt.UnregisterDroppable,key:i,id:o})),[o]),(0,ne.useEffect)(()=>{n!==p.current.disabled&&(a({type:Yt.SetDroppableDisabled,id:o,key:i,disabled:n}),p.current.disabled=n)},[o,i,n,a]),{active:l,rect:g,isOver:s?.id===o,node:P,over:s,setNodeRef:L}}var Ht=ze(yt());function Gi(e,t,n){let o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function A0(e,t){return e.reduce((n,o,r)=>{let i=t.get(o);return i&&(n[r]=i),n},Array(e.length))}function pu(e){return e!==null&&e>=0}function O0(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function $0(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}var mu={scaleX:1,scaleY:1},Hp=e=>{var t;let{rects:n,activeNodeRect:o,activeIndex:r,overIndex:i,index:l}=e,a=(t=n[r])!=null?t:o;if(!a)return null;let s=z0(n,l,r);if(l===r){let c=n[i];return c?{x:r<i?c.left+c.width-(a.left+a.width):c.left-a.left,y:0,...mu}:null}return l>r&&l<=i?{x:-a.width-s,y:0,...mu}:l<r&&l>=i?{x:a.width+s,y:0,...mu}:{x:0,y:0,...mu}};function z0(e,t,n){let o=e[t],r=e[t-1],i=e[t+1];return!o||!r&&!i?0:n<t?r?o.left-(r.left+r.width):i.left-(o.left+o.width):i?i.left-(o.left+o.width):o.left-(r.left+r.width)}var Z_=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e,i=Gi(t,o,n),l=t[r],a=i[r];return!a||!l?null:{x:a.left-l.left,y:a.top-l.top,scaleX:a.width/l.width,scaleY:a.height/l.height}};var J_="Sortable",ev=Ht.default.createContext({activeIndex:-1,containerId:J_,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Z_,disabled:{draggable:!1,droppable:!1}});function Up(e){let{children:t,id:n,items:o,strategy:r=Z_,disabled:i=!1}=e,{active:l,dragOverlay:a,droppableRects:s,over:c,measureDroppableContainers:p}=X_(),m=Yr(J_,n),g=a.rect!==null,d=(0,Ht.useMemo)(()=>o.map(L=>typeof L=="object"&&"id"in L?L.id:L),[o]),v=l!=null,h=l?d.indexOf(l.id):-1,y=c?d.indexOf(c.id):-1,_=(0,Ht.useRef)(d),f=!O0(d,_.current),w=y!==-1&&h===-1||f,R=$0(i);oo(()=>{f&&v&&p(d)},[f,d,v,p]),(0,Ht.useEffect)(()=>{_.current=d},[d]);let P=(0,Ht.useMemo)(()=>({activeIndex:h,containerId:m,disabled:R,disableTransforms:w,items:d,overIndex:y,useDragOverlay:g,sortedRects:A0(d,s),strategy:r}),[h,m,R.draggable,R.droppable,w,d,y,s,g,r]);return Ht.default.createElement(ev.Provider,{value:P},t)}var V0=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return Gi(n,o,r).indexOf(t)},B0=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:i,newIndex:l,previousItems:a,previousContainerId:s,transition:c}=e;return!c||!o||a!==i&&r===l?!1:n?!0:l!==r&&t===s},j0={duration:200,easing:"ease"},tv="transform",H0=Ko.Transition.toString({property:tv,duration:0,easing:"linear"}),U0={roleDescription:"sortable"};function W0(e){let{disabled:t,index:n,node:o,rect:r}=e,[i,l]=(0,Ht.useState)(null),a=(0,Ht.useRef)(n);return oo(()=>{if(!t&&n!==a.current&&o.current){let s=r.current;if(s){let c=ti(o.current,{ignoreTransform:!0}),p={x:s.left-c.left,y:s.top-c.top,scaleX:s.width/c.width,scaleY:s.height/c.height};(p.x||p.y)&&l(p)}}n!==a.current&&(a.current=n)},[t,n,o,r]),(0,Ht.useEffect)(()=>{i&&l(null)},[i]),i}function Wp(e){let{animateLayoutChanges:t=B0,attributes:n,disabled:o,data:r,getNewIndex:i=V0,id:l,strategy:a,resizeObserverConfig:s,transition:c=j0}=e,{items:p,containerId:m,activeIndex:g,disabled:d,disableTransforms:v,sortedRects:h,overIndex:y,useDragOverlay:_,strategy:f}=(0,Ht.useContext)(ev),w=G0(o,d),R=p.indexOf(l),P=(0,Ht.useMemo)(()=>({sortable:{containerId:m,index:R,items:p},...r}),[m,r,R,p]),L=(0,Ht.useMemo)(()=>p.slice(p.indexOf(l)),[p,l]),{rect:V,node:W,isOver:re,setNodeRef:J}=Q_({id:l,data:P,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:L,...s}}),{active:ue,activatorEvent:Ne,activeNodeRect:de,attributes:Re,setNodeRef:Y,listeners:te,isDragging:j,over:ie,setActivatorNodeRef:_e,transform:me}=Y_({id:l,data:P,attributes:{...U0,...n},disabled:w.draggable}),Ae=h_(J,Y),Ee=!!ue,xe=Ee&&!v&&pu(g)&&pu(y),Fe=!_&&j,Ie=Fe&&xe?me:null,He=xe?Ie??(a??f)({rects:h,activeNodeRect:de,activeIndex:g,overIndex:y,index:R}):null,Ye=pu(g)&&pu(y)?i({id:l,items:p,activeIndex:g,overIndex:y}):R,Ze=ue?.id,De=(0,Ht.useRef)({activeId:Ze,items:p,newIndex:Ye,containerId:m}),q=p!==De.current.items,ce=t({active:ue,containerId:m,isDragging:j,isSorting:Ee,id:l,index:R,items:p,newIndex:De.current.newIndex,previousItems:De.current.items,previousContainerId:De.current.containerId,transition:c,wasDragging:De.current.activeId!=null}),$=W0({disabled:!ce,index:R,node:W,rect:V});return(0,Ht.useEffect)(()=>{Ee&&De.current.newIndex!==Ye&&(De.current.newIndex=Ye),m!==De.current.containerId&&(De.current.containerId=m),p!==De.current.items&&(De.current.items=p)},[Ee,Ye,m,p]),(0,Ht.useEffect)(()=>{if(Ze===De.current.activeId)return;if(Ze!=null&&De.current.activeId==null){De.current.activeId=Ze;return}let ve=setTimeout(()=>{De.current.activeId=Ze},50);return()=>clearTimeout(ve)},[Ze]),{active:ue,activeIndex:g,attributes:Re,data:P,rect:V,index:R,newIndex:Ye,items:p,isOver:re,isSorting:Ee,isDragging:j,listeners:te,node:W,overIndex:y,over:ie,setNodeRef:Ae,setActivatorNodeRef:_e,setDroppableNodeRef:J,setDraggableNodeRef:Y,transform:$??He,transition:oe()};function oe(){if($||q&&De.current.newIndex===R)return H0;if(!(Fe&&!oa(Ne)||!c)&&(Ee||ce))return Ko.Transition.toString({...c,property:tv})}}function G0(e,t){var n,o;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(o=e?.droppable)!=null?o:t.droppable}}var fN=[mt.Down,mt.Right,mt.Up,mt.Left];var Cv=require("obsidian"),se=ze(yt(),1),Su=ze(vo(),1);var Tn=ze(yt(),1);var at=class extends Error{constructor(t){super(t),this.name="FormulaError"}};function Gp(e){let t=[],n=0;for(;n<e.length;){if(/\s/.test(e[n])){n++;continue}let o=n;if(/[0-9]/.test(e[n])||e[n]==="."&&/[0-9]/.test(e[n+1]??"")){for(;n<e.length&&/[0-9.]/.test(e[n]);)n++;t.push({type:"NUM",val:e.slice(o,n),pos:o});continue}if(e[n]==='"'||e[n]==="'"){let r=e[n++];for(;n<e.length&&e[n]!==r;)e[n]==="\\"&&n++,n++;if(n>=e.length)throw new at(u("formula_err_unclosed_string").replace("$pos",String(o)));n++,t.push({type:"STR",val:e.slice(o+1,n-1),pos:o});continue}if(e[n]==="["){n++;let r=n;for(;n<e.length&&e[n]!=="]";)n++;if(n>=e.length)throw new at(u("formula_err_unclosed_bracket").replace("$pos",String(o)));let i=e.slice(r,n++);t.push({type:"BRACKET_IDENT",val:i,pos:o});continue}if(/[a-zA-Z_]/.test(e[n])){for(;n<e.length&&/[a-zA-Z0-9_]/.test(e[n]);)n++;let r=e.slice(o,n),i=r.toUpperCase();i==="TRUE"||i==="FALSE"?t.push({type:"BOOL",val:i,pos:o}):t.push({type:"IDENT",val:r,pos:o});continue}switch(e[n]){case"(":t.push({type:"LPAREN",val:"(",pos:n++});break;case")":t.push({type:"RPAREN",val:")",pos:n++});break;case",":t.push({type:"COMMA",val:",",pos:n++});break;case"+":t.push({type:"PLUS",val:"+",pos:n++});break;case"-":t.push({type:"MINUS",val:"-",pos:n++});break;case"*":t.push({type:"STAR",val:"*",pos:n++});break;case"/":t.push({type:"SLASH",val:"/",pos:n++});break;case"&":t.push({type:"AMP",val:"&",pos:n++});break;case"=":e[n+1]==="="?(t.push({type:"EQ",val:"==",pos:n}),n+=2):t.push({type:"EQ",val:"=",pos:n++});break;case"!":if(e[n+1]==="=")t.push({type:"NEQ",val:"!=",pos:n}),n+=2;else throw new at(u("formula_err_unexpected_bang").replace("$pos",String(n)));break;case"<":e[n+1]===">"?(t.push({type:"NEQ",val:"<>",pos:n}),n+=2):e[n+1]==="="?(t.push({type:"LTE",val:"<=",pos:n}),n+=2):t.push({type:"LT",val:"<",pos:n++});break;case">":e[n+1]==="="?(t.push({type:"GTE",val:">=",pos:n}),n+=2):t.push({type:"GT",val:">",pos:n++});break;default:throw new at(u("formula_err_unexpected_char").replace("$char",e[n]).replace("$pos",String(n)))}}return t.push({type:"EOF",val:"",pos:n}),t}var fu=class{constructor(t){this.toks=t;this.p=0}cur(){return this.toks[this.p]}eat(){return this.toks[this.p++]}expect(t){let n=this.eat();if(n.type!==t)throw new at(u("formula_err_expected_token").replace("$expected",String(t)).replace("$found",n.val).replace("$pos",String(n.pos)));return n}is(t){return this.cur().type===t}parse(){let t=this.expr();if(!this.is("EOF"))throw new at(u("formula_err_unexpected_token").replace("$token",this.cur().val).replace("$pos",String(this.cur().pos)));return t}expr(){return this.cmp()}cmp(){let t=this.add();for(;["EQ","NEQ","GT","LT","GTE","LTE"].includes(this.cur().type);)t={k:"bin",op:this.eat().val,l:t,r:this.add()};return t}add(){let t=this.mul();for(;this.is("PLUS")||this.is("MINUS")||this.is("AMP");)t={k:"bin",op:this.eat().val,l:t,r:this.mul()};return t}mul(){let t=this.unary();for(;this.is("STAR")||this.is("SLASH");)t={k:"bin",op:this.eat().val,l:t,r:this.unary()};return t}unary(){return this.is("MINUS")?(this.eat(),{k:"neg",x:this.unary()}):this.primary()}primary(){let t=this.cur();if(t.type==="NUM")return this.eat(),{k:"num",v:parseFloat(t.val)};if(t.type==="STR")return this.eat(),{k:"str",v:t.val};if(t.type==="BOOL")return this.eat(),{k:"bool",v:t.val==="TRUE"};if(t.type==="BRACKET_IDENT")return this.eat(),{k:"col",name:t.val};if(t.type==="IDENT"){if(this.eat(),this.is("LPAREN")){this.eat();let n=[];if(!this.is("RPAREN"))for(n.push(this.expr());this.is("COMMA");)this.eat(),n.push(this.expr());return this.expect("RPAREN"),{k:"call",fn:t.val.toUpperCase(),args:n}}return{k:"col",name:t.val}}if(t.type==="LPAREN"){this.eat();let n=this.expr();return this.expect("RPAREN"),n}throw new at(u("formula_err_unexpected_token").replace("$token",t.val).replace("$pos",String(t.pos)))}};function tt(e){if(typeof e=="number")return isNaN(e)?0:e;if(typeof e=="string"){let t=parseFloat(e);return isNaN(t)?0:t}return typeof e=="boolean"&&e?1:0}function wn(e){return e==null?"":Array.isArray(e)?e.map(wn).join(", "):String(e)}function ua(e){return e!=null&&e!==!1&&e!==""&&e!==0}function nv(e,t){let n=typeof e=="string"?e.toLowerCase():e,o=typeof t=="string"?t.toLowerCase():t;return n==o}function qi(e,t){if(e==="_title")return"_title";let n=t.schema.find(r=>r.id===e&&r.type!=="formula");if(n)return n.id;let o=t.schema.find(r=>r.name.toLowerCase()===e.toLowerCase()&&r.type!=="formula");return o?o.id:null}function Ki(e,t){return e==="_title"?t._title:t[e]}function q0(e,t){let n=qi(e,t);if(n===null)throw t.schema.some(r=>(r.id===e||r.name.toLowerCase()===e.toLowerCase())&&r.type==="formula")?new at(u("formula_err_circular_ref").replace("$name",e)):new at(`Coluna desconhecida: "${e}"`);return Ki(n,t.row)}var K0=new Set(["IF","IFS","AND","OR","NOT","SUM","AVG","AVERAGE","COUNT","COUNTA","MIN","MAX","CONCAT","LEN","UPPER","LOWER","TRIM","LEFT","RIGHT","MID","SUBSTITUTE","ROUND","FLOOR","CEIL","ABS","MOD","POWER","SQRT","ISNULL","ISEMPTY","COALESCE","TEXT","VALUE"]);function Qe(e,t){switch(e.k){case"num":return e.v;case"str":return e.v;case"bool":return e.v;case"col":return q0(e.name,t);case"neg":return-tt(Qe(e.x,t));case"bin":{let{op:n,l:o,r}=e,i=Qe(o,t),l=Qe(r,t);switch(n){case"+":return tt(i)+tt(l);case"-":return tt(i)-tt(l);case"*":return tt(i)*tt(l);case"/":{let a=tt(l);return a===0?null:tt(i)/a}case"&":return wn(i)+wn(l);case"=":case"==":return nv(i,l);case"<>":case"!=":return!nv(i,l);case">":return tt(i)>tt(l);case"<":return tt(i)<tt(l);case">=":return tt(i)>=tt(l);case"<=":return tt(i)<=tt(l);default:throw new at(`Operador desconhecido: ${n}`)}}case"call":{let{fn:n,args:o}=e;if(!K0.has(n))throw new at(u("formula_err_unknown_fn").replace("$fn",n));if(n==="IF"){if(o.length<2||o.length>3)throw new at(u("formula_err_if_args"));return ua(Qe(o[0],t))?Qe(o[1],t):o[2]?Qe(o[2],t):null}if(n==="IFS"){if(o.length<2||o.length%2!==0)throw new at("IFS(cond1, val1, cond2, val2, ...)");for(let r=0;r<o.length;r+=2)if(ua(Qe(o[r],t)))return Qe(o[r+1],t);return null}if(n==="AND"){if(o.length===0)throw new at("AND requer ao menos 1 argumento");return o.every(r=>ua(Qe(r,t)))}if(n==="OR"){if(o.length===0)throw new at("OR requer ao menos 1 argumento");return o.some(r=>ua(Qe(r,t)))}if(n==="NOT"){if(o.length!==1)throw new at("NOT(valor)");return!ua(Qe(o[0],t))}if(n==="SUM"){if(o.length===0)throw new at("SUM requer ao menos 1 argumento");if(o.length===1&&o[0].k==="col"){let r=qi(o[0].name,t);if(r)return t.allRows.reduce((i,l)=>i+tt(Ki(r,l)),0)}return o.reduce((r,i)=>r+tt(Qe(i,t)),0)}if(n==="AVG"||n==="AVERAGE"){if(o.length!==1||o[0].k!=="col")throw new at(u("formula_err_avg_args"));let r=qi(o[0].name,t);if(!r)throw new at("Coluna desconhecida em AVG");let i=t.allRows.map(l=>tt(Ki(r,l)));return i.length?i.reduce((l,a)=>l+a,0)/i.length:0}if(n==="COUNT"||n==="COUNTA"){if(o.length!==1||o[0].k!=="col")throw new at(u("formula_err_count_args"));let r=qi(o[0].name,t);if(!r)throw new at("Coluna desconhecida em COUNT");return t.allRows.filter(i=>{let l=Ki(r,i);return l!=null&&l!==""}).length}if(n==="MIN"){if(o.length===1&&o[0].k==="col"){let r=qi(o[0].name,t);if(r)return Math.min(...t.allRows.map(i=>tt(Ki(r,i))))}return Math.min(...o.map(r=>tt(Qe(r,t))))}if(n==="MAX"){if(o.length===1&&o[0].k==="col"){let r=qi(o[0].name,t);if(r)return Math.max(...t.allRows.map(i=>tt(Ki(r,i))))}return Math.max(...o.map(r=>tt(Qe(r,t))))}if(n==="CONCAT")return o.map(r=>wn(Qe(r,t))).join("");if(n==="LEN"){if(o.length!==1)throw new at("LEN(texto)");return wn(Qe(o[0],t)).length}if(n==="UPPER"){if(o.length!==1)throw new at("UPPER(texto)");return wn(Qe(o[0],t)).toUpperCase()}if(n==="LOWER"){if(o.length!==1)throw new at("LOWER(texto)");return wn(Qe(o[0],t)).toLowerCase()}if(n==="TRIM"){if(o.length!==1)throw new at("TRIM(texto)");return wn(Qe(o[0],t)).trim()}if(n==="LEFT"){if(o.length!==2)throw new at("LEFT(texto, n)");return wn(Qe(o[0],t)).slice(0,tt(Qe(o[1],t)))}if(n==="RIGHT"){if(o.length!==2)throw new at("RIGHT(texto, n)");let r=wn(Qe(o[0],t)),i=tt(Qe(o[1],t));return r.slice(Math.max(0,r.length-i))}if(n==="MID"){if(o.length!==3)throw new at(u("formula_err_mid_args"));let r=wn(Qe(o[0],t)),i=tt(Qe(o[1],t))-1;return r.slice(i,i+tt(Qe(o[2],t)))}if(n==="SUBSTITUTE"){if(o.length<3)throw new at("SUBSTITUTE(texto, de, para)");return wn(Qe(o[0],t)).split(wn(Qe(o[1],t))).join(wn(Qe(o[2],t)))}if(n==="ROUND"){let r=tt(Qe(o[0],t)),i=o[1]?tt(Qe(o[1],t)):0;return Math.round(r*10**i)/10**i}if(n==="FLOOR")return Math.floor(tt(Qe(o[0],t)));if(n==="CEIL")return Math.ceil(tt(Qe(o[0],t)));if(n==="ABS")return Math.abs(tt(Qe(o[0],t)));if(n==="MOD"){if(o.length!==2)throw new at(u("formula_err_mod_args"));return tt(Qe(o[0],t))%tt(Qe(o[1],t))}if(n==="POWER"){if(o.length!==2)throw new at("POWER(base, expoente)");return Math.pow(tt(Qe(o[0],t)),tt(Qe(o[1],t)))}if(n==="SQRT"){if(o.length!==1)throw new at(u("formula_err_sqrt_args"));return Math.sqrt(tt(Qe(o[0],t)))}if(n==="ISNULL"||n==="ISEMPTY"){if(o.length!==1)throw new at(`${n}(valor)`);let r=Qe(o[0],t);return r==null||r===""}if(n==="COALESCE"){for(let r of o){let i=Qe(r,t);if(i!=null&&i!=="")return i}return null}if(n==="TEXT")return o.length===1?wn(Qe(o[0],t)):null;if(n==="VALUE")return o.length===1?tt(Qe(o[0],t)):null;throw new at(u("formula_err_not_implemented").replace("$fn",n))}}}function ov(e){if(!e.trim())return null;try{Gp(e);let t=Gp(e);return new fu(t).parse(),null}catch(t){return t instanceof at?t.message:String(t)}}function Y0(e,t,n,o){if(!e.trim())return null;try{let r=new fu(Gp(e)).parse(),i=new Set(o.filter(l=>l.type==="formula").map(l=>l.id));return Qe(r,{row:t,allRows:n,schema:o,formulaColIds:i})}catch{return"#ERRO"}}function rv(e,t){let n=t.filter(o=>o.type==="formula"&&o.formula);return n.length===0?e:e.map(o=>{let r={...o};for(let i of n)r[i.id]=Y0(i.formula,o,e,t);return r})}var X0=["contains","not_contains","starts_with","ends_with","is","is_not","is_empty","is_not_empty"],Q0=["is","is_not","gt","gte","lt","lte","is_empty","is_not_empty"],Z0=["is","is_not","gt","gte","lt","lte","is_empty","is_not_empty"],qp=["is","is_not","contains","not_contains","is_empty","is_not_empty"],J0=["is_checked","is_unchecked","is_empty","is_not_empty"];function Dn(e){switch(e){case"number":return Q0;case"date":return Z0;case"select":return qp;case"multiselect":return qp;case"status":return qp;case"checkbox":return J0;default:return X0}}function io(e){switch(e){case"number":case"date":return"is";case"checkbox":return"is_checked";case"select":case"multiselect":case"status":return"is";default:return"contains"}}function ek(){return{is:u("op_is"),is_not:u("op_is_not"),contains:u("op_contains"),not_contains:u("op_not_contains"),starts_with:u("op_starts_with"),ends_with:u("op_ends_with"),gt:u("op_gt"),gte:u("op_gte"),lt:u("op_lt"),lte:u("op_lte"),is_checked:u("op_is_checked"),is_unchecked:u("op_is_unchecked"),is_empty:u("op_is_empty"),is_not_empty:u("op_is_not_empty")}}var Mn=new Proxy({},{get:(e,t)=>ek()[t]??t}),Cn=new Set(["is_empty","is_not_empty","is_checked","is_unchecked"]),iv="|||";function gu(e){return(e.columnType==="select"||e.columnType==="multiselect"||e.columnType==="status")&&(e.operator==="is"||e.operator==="is_not")}function ca(e){return e.split(iv).filter(t=>t!=="")}function lv(e,t){let n=ca(e),o=n.indexOf(t);return o>=0?n.splice(o,1):n.push(t),n.join(iv)}function Ke(e){return{title:"\u{1F4C4}",text:"Aa",number:"#",select:"\u25C9",multiselect:"\u25C8",date:"\u{1F4C5}",checkbox:"\u2611",formula:"\u0192",relation:"\u{1F517}",lookup:"\u2197",image:"\u{1F5BC}",audio:"\u{1F3B5}",video:"\u{1F3AC}"}[e]??"\xB7"}function tk(e,t){if(!Cn.has(t.operator)&&t.value==="")return!0;let o=t.columnId==="_title"?e._title:e[t.columnId];if(t.operator==="is_empty")return o==null||String(o??"").trim()==="";if(t.operator==="is_not_empty")return o!=null&&String(o??"").trim()!=="";if(t.operator==="is_checked")return o===!0||o==="true";if(t.operator==="is_unchecked")return o!==!0&&o!=="true";if(t.columnType==="number"){let l=parseFloat(String(o??"")),a=parseFloat(t.value);if(isNaN(l)||isNaN(a))return!1;switch(t.operator){case"is":return l===a;case"is_not":return l!==a;case"gt":return l>a;case"gte":return l>=a;case"lt":return l<a;case"lte":return l<=a;default:return!0}}if(t.columnType==="date"){let l=new Date(String(o??"")).getTime(),a=new Date(t.value).getTime();if(isNaN(l)||isNaN(a))return!1;switch(t.operator){case"is":return l===a;case"is_not":return l!==a;case"gt":return l>a;case"gte":return l>=a;case"lt":return l<a;case"lte":return l<=a;default:return!0}}if(gu(t)){let l=ca(t.value).map(s=>s.toLowerCase());if(l.length===0)return!0;let a=Array.isArray(o)?o.map(s=>s.toLowerCase()):[String(o??"").toLowerCase()];return t.operator==="is"?a.some(s=>l.includes(s)):a.every(s=>!l.includes(s))}let r=Array.isArray(o)?o.join(", ").toLowerCase():String(o??"").toLowerCase(),i=t.value.toLowerCase();switch(t.operator){case"is":return r===i;case"is_not":return r!==i;case"contains":return r.includes(i);case"not_contains":return!r.includes(i);case"starts_with":return r.startsWith(i);case"ends_with":return r.endsWith(i);default:return!0}}function lo(e,t){if(t.length===0)return e;let n=[],o=[];for(let r of t)r.conjunction==="or"&&o.length>0&&(n.push(o),o=[]),o.push(r);return o.length>0&&n.push(o),e.filter(r=>n.some(i=>i.every(l=>tk(r,l))))}function av(e,t){if(!t||t.length===0)return e;let n=new Map(t.map((o,r)=>[o,r]));return[...e].sort((o,r)=>{let i=n.get(o._file.path)??1/0,l=n.get(r._file.path)??1/0;return i-l})}function qn(e,t){return t.length===0?e:[...e].sort((n,o)=>{for(let r of t){let i=r.columnId==="_title"?n._title:n[r.columnId],l=r.columnId==="_title"?o._title:o[r.columnId],a=0;if(i==null)a=-1;else if(l==null)a=1;else{let s=parseFloat(String(i)),c=parseFloat(String(l));!isNaN(s)&&!isNaN(c)?a=s-c:a=String(i??"").toLowerCase().localeCompare(String(l??"").toLowerCase())}if(a!==0)return r.direction==="asc"?a:-a}return 0})}var Kp=200,nk=100,ok=50;async function rk(e,t,n,o,r){if(e.length<=nk)return Promise.all(e.map(l=>n.getNoteData(l,t)));let i=[];for(let l=0;l<e.length;l+=Kp){if(o.current!==r)return null;let a=e.slice(l,l+Kp),s=await Promise.all(a.map(c=>n.getNoteData(c,t)));i.push(...s),l+Kp<e.length&&await new Promise(c=>setTimeout(c,0))}return o.current===r?i:null}function ik(e,t){return!e||e.length===0?[]:e.flatMap(n=>{if(n.columnId==="_title")return[{id:n.id??crypto.randomUUID(),columnId:"_title",columnName:u("name_column"),columnType:"title",icon:"\u{1F4C4}",operator:n.operator,value:n.value,conjunction:n.conjunction??"and"}];let o=t.find(r=>r.id===n.columnId);return o?[{id:n.id??crypto.randomUUID(),columnId:o.id,columnName:o.name,columnType:o.type,icon:Ke(o.type),operator:n.operator,value:n.value,conjunction:n.conjunction??"and"}]:[]})}function Ln(e){let{app:t,dbFile:n,manager:o,includeSubfolders:r,externalView:i,onLoaded:l}=e,[a,s]=(0,Tn.useState)([]),[c,p]=(0,Tn.useState)(hr),[m,g]=(0,Tn.useState)(!0),[d,v]=(0,Tn.useState)([]),h=(0,Tn.useRef)(0),y=(0,Tn.useRef)(!1),_=(0,Tn.useCallback)(async()=>{if(!n){g(!1);return}g(!0);let f=++h.current,w=o.readConfig(n),R=o.getNotesInDatabase(n,r);w.schema.length===0&&R.length>0&&(w.schema=await o.inferSchema(R),await o.writeConfig(n,w));let P=await rk(R,w.schema,o,h,f);if(!P)return;let L=o.resolveRollupsForRows(o.resolveLookupsForRows(rv(P,w.schema),w.schema),w.schema);if(h.current===f){if(!y.current){y.current=!0;let V=i.activePills??[];v(ik(V,w.schema))}p(V=>({schema:w.schema,views:V.views})),s(L),l?.(w,L),g(!1)}},[n,o,r,t,i,l]);return(0,Tn.useEffect)(()=>{y.current=!1},[n]),(0,Tn.useEffect)(()=>{_()},[_]),(0,Tn.useEffect)(()=>{let f=null,w=()=>{f&&clearTimeout(f),f=setTimeout(()=>{_()},ok)};return t.vault.on("create",w),t.vault.on("delete",w),t.vault.on("rename",w),t.metadataCache.on("changed",w),()=>{f&&clearTimeout(f),t.vault.off("create",w),t.vault.off("delete",w),t.vault.off("rename",w),t.metadataCache.off("changed",w)}},[t,_]),{rows:a,config:c,loading:m,activeFilters:d,setActiveFilters:v,reload:_}}var hu=ze(yt(),1);function Pn(e,t){let[n,o]=(0,hu.useState)(e);return(0,hu.useEffect)(()=>{let r=setTimeout(()=>o(e),t);return()=>clearTimeout(r)},[e,t]),n}var he=ze(yt(),1),yr=ze(vo(),1);var T=ze(Rt(),1),dv={title:"\u{1F4C4}",text:"Aa",number:"#",select:"\u25C9",multiselect:"\u25C8",date:"\u{1F4C5}",checkbox:"\u2611",url:"\u2197",email:"\u2709",phone:"\u{1F4DE}",status:"\u25CE",formula:"\u0192",relation:"\u{1F517}",lookup:"\u2197",rollup:"\u03A3",image:"\u{1F5BC}",audio:"\u{1F3B5}",video:"\u{1F3AC}"},pk=()=>({title:u("type_title"),text:u("type_text"),number:u("type_number"),select:u("type_select"),multiselect:u("type_multiselect"),date:u("type_date"),checkbox:u("type_checkbox"),url:u("type_url"),email:u("type_email"),phone:u("type_phone"),status:u("type_status"),formula:u("type_formula"),relation:u("type_relation"),lookup:u("type_lookup"),rollup:u("type_rollup"),image:u("type_image"),audio:u("type_audio"),video:u("type_video")});function pv({col:e,schema:t,onUpdateSchema:n,onRenameColumn:o,onChangeType:r,manager:i,dbFile:l}){let a=Dt(),[s,c]=(0,he.useState)(!1),[p,m]=(0,he.useState)(!1),[g,d]=(0,he.useState)(e.name),[v,h]=(0,he.useState)(!1),[y,_]=(0,he.useState)(e.formula??""),[f,w]=(0,he.useState)(null),[R,P]=(0,he.useState)(null),L=(0,he.useRef)(null),V=(0,he.useRef)(null),W=(0,he.useRef)(null),re=(0,he.useRef)(null),J=(0,he.useRef)(null),[ue,Ne]=(0,he.useState)(!1),[de,Re]=(0,he.useState)(null),[Y,te]=(0,he.useState)(e.refDatabasePath??""),[j,ie]=(0,he.useState)(e.refColumnId??""),[_e,me]=(0,he.useState)(e.refMatchColumnId??""),[Ae,Ee]=(0,he.useState)(!!e.pairedColumnId),[xe,Fe]=(0,he.useState)(!!e.isHierarchical),[Ie,Ve]=(0,he.useState)([]),[He,Ye]=(0,he.useState)([]),Ze=(0,he.useRef)(null),De=(0,he.useRef)(null),[q,ce]=(0,he.useState)(!1),[$,oe]=(0,he.useState)(null),[ve,S]=(0,he.useState)(e.rollupRelationColumnId??""),[K,D]=(0,he.useState)(e.rollupTargetColumnId??""),[Z,ke]=(0,he.useState)(e.rollupFunction??"count"),[ye,ft]=(0,he.useState)([]),Jt=(0,he.useRef)(null),vt=(0,he.useRef)(null),[Mt,Et]=(0,he.useState)(!1),[bt,$t]=(0,he.useState)(null),[it,en]=(0,he.useState)(e.numberFormat?.decimals??2),[M,Ce]=(0,he.useState)(e.numberFormat?.thousandsSeparator??!1),[C,X]=(0,he.useState)(e.numberFormat?.prefix??""),[H,ae]=(0,he.useState)(e.numberFormat?.suffix??""),le=(0,he.useRef)(null),we=(0,he.useRef)(null),[N,be]=(0,he.useState)(!1),[Me,Se]=(0,he.useState)(null),[U,Le]=(0,he.useState)(e.imageSourceFolder??""),Pe=(0,he.useRef)(null),Oe=(0,he.useRef)(null),[$e,Xe]=(0,he.useState)(!1),[ut,ct]=(0,he.useState)(null),[gt,It]=(0,he.useState)(e.audioSourceFolder??""),At=(0,he.useRef)(null),zt=(0,he.useRef)(null),[tn,fn]=(0,he.useState)(!1),[gn,ln]=(0,he.useState)(null),[kn,To]=(0,he.useState)(e.videoSourceFolder??""),xr=(0,he.useRef)(null),wo=(0,he.useRef)(null);(0,he.useEffect)(()=>{if(!s)return;let F=b=>{let x=b.target,E=L.current?.contains(x),z=J.current?.contains(x)||Ze.current?.contains(x)||Jt.current?.contains(x)||le.current?.contains(x)||Pe.current?.contains(x)||At.current?.contains(x)||xr.current?.contains(x);!E&&!z&&(c(!1),h(!1),Ne(!1),Et(!1))};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[s]),(0,he.useEffect)(()=>{p||d(e.name)},[e.name,p]),(0,he.useEffect)(()=>{v||_(e.formula??"")},[e.formula,v]),(0,he.useEffect)(()=>{if(!p)return;let F=V.current;F&&(F.focus(),F.select())},[p]),(0,he.useEffect)(()=>{if(v){if(L.current){let F=L.current.getBoundingClientRect(),b=320,x=420,E=F.left,z=F.bottom+4;E+b>window.innerWidth&&(E=window.innerWidth-b-8),z+x>window.innerHeight&&(z=F.top-x-4),P({x:E,y:z})}setTimeout(()=>W.current?.focus(),50)}},[v]),(0,he.useEffect)(()=>{if(!v)return;let F=x=>{re.current&&P({x:x.clientX-re.current.x,y:x.clientY-re.current.y})},b=()=>{re.current=null};return document.addEventListener("mousemove",F),document.addEventListener("mouseup",b),()=>{document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",b)}},[v]),(0,he.useEffect)(()=>{w(ov(y))},[y]),(0,he.useEffect)(()=>{if(!ue)return;let F=i.getAllDatabases().map(b=>({path:b.path,name:b.parent?.name||u("picker_root")}));if(Ve(F),L.current){let b=L.current.getBoundingClientRect(),x=320,E=380,z=b.left,pe=b.bottom+4;z+x>window.innerWidth&&(z=window.innerWidth-x-8),pe+E>window.innerHeight&&(pe=b.top-E-4),Re({x:z,y:pe})}},[ue,i,l]),(0,he.useEffect)(()=>{if(!Y){Ye([]);return}let F=a.vault.getFileByPath(Y);if(!F){Ye([]);return}Ye(i.readConfig(F).schema)},[Y,a,i]),(0,he.useEffect)(()=>{ue||(te(e.refDatabasePath??""),ie(e.refColumnId??""),me(e.refMatchColumnId??""))},[e.refDatabasePath,e.refColumnId,e.refMatchColumnId,ue]),(0,he.useEffect)(()=>{if(!ue)return;let F=x=>{De.current&&Re({x:x.clientX-De.current.x,y:x.clientY-De.current.y})},b=()=>{De.current=null};return document.addEventListener("mousemove",F),document.addEventListener("mouseup",b),()=>{document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",b)}},[ue]),(0,he.useEffect)(()=>{if(!q||!ve){ft([]);return}let F=t.find(E=>E.id===ve);if(!F?.refDatabasePath){ft([]);return}let b=a.vault.getFileByPath(F.refDatabasePath);if(!b){ft([]);return}let x=i.readConfig(b);ft(x.schema)},[q,ve,t,a,i]),(0,he.useEffect)(()=>{q||(S(e.rollupRelationColumnId??""),D(e.rollupTargetColumnId??""),ke(e.rollupFunction??"count"))},[e.rollupRelationColumnId,e.rollupTargetColumnId,e.rollupFunction,q]),(0,he.useEffect)(()=>{if(!q)return;if(L.current){let x=L.current.getBoundingClientRect(),E=x.left,z=x.bottom+4;E+340>window.innerWidth&&(E=window.innerWidth-348),z+300>window.innerHeight&&(z=x.top-304),oe({x:E,y:z})}let F=x=>{vt.current&&oe({x:x.clientX-vt.current.x,y:x.clientY-vt.current.y})},b=()=>{vt.current=null};return document.addEventListener("mousemove",F),document.addEventListener("mouseup",b),()=>{document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",b)}},[q]),(0,he.useEffect)(()=>{if(Mt&&L.current){let F=L.current.getBoundingClientRect(),b=300,x=300,E=F.left,z=F.bottom+4;E+b>window.innerWidth&&(E=window.innerWidth-b-8),z+x>window.innerHeight&&(z=F.top-x-4),$t({x:E,y:z})}},[Mt]),(0,he.useEffect)(()=>{Mt||(en(e.numberFormat?.decimals??2),Ce(e.numberFormat?.thousandsSeparator??!1),X(e.numberFormat?.prefix??""),ae(e.numberFormat?.suffix??""))},[e.numberFormat,Mt]),(0,he.useEffect)(()=>{N||Le(e.imageSourceFolder??"")},[e.imageSourceFolder,N]),(0,he.useEffect)(()=>{if(N&&L.current){let F=L.current.getBoundingClientRect(),b=280,x=160,E=F.left,z=F.bottom+4;E+b>window.innerWidth&&(E=window.innerWidth-b-8),z+x>window.innerHeight&&(z=F.top-x-4),Se({x:E,y:z})}},[N]),(0,he.useEffect)(()=>{if(!N)return;let F=x=>{Oe.current&&Se({x:x.clientX-Oe.current.x,y:x.clientY-Oe.current.y})},b=()=>{Oe.current=null};return document.addEventListener("mousemove",F),document.addEventListener("mouseup",b),()=>{document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",b)}},[N]),(0,he.useEffect)(()=>{$e||It(e.audioSourceFolder??"")},[e.audioSourceFolder,$e]),(0,he.useEffect)(()=>{if($e&&L.current){let F=L.current.getBoundingClientRect(),b=280,x=160,E=F.left,z=F.bottom+4;E+b>window.innerWidth&&(E=window.innerWidth-b-8),z+x>window.innerHeight&&(z=F.top-x-4),ct({x:E,y:z})}},[$e]),(0,he.useEffect)(()=>{if(!$e)return;let F=x=>{zt.current&&ct({x:x.clientX-zt.current.x,y:x.clientY-zt.current.y})},b=()=>{zt.current=null};return document.addEventListener("mousemove",F),document.addEventListener("mouseup",b),()=>{document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",b)}},[$e]),(0,he.useEffect)(()=>{tn||To(e.videoSourceFolder??"")},[e.videoSourceFolder,tn]),(0,he.useEffect)(()=>{if(tn&&L.current){let F=L.current.getBoundingClientRect(),b=280,x=160,E=F.left,z=F.bottom+4;E+b>window.innerWidth&&(E=window.innerWidth-b-8),z+x>window.innerHeight&&(z=F.top-x-4),ln({x:E,y:z})}},[tn]),(0,he.useEffect)(()=>{if(!tn)return;let F=x=>{wo.current&&ln({x:x.clientX-wo.current.x,y:x.clientY-wo.current.y})},b=()=>{wo.current=null};return document.addEventListener("mousemove",F),document.addEventListener("mouseup",b),()=>{document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",b)}},[tn]),(0,he.useEffect)(()=>{if(!Mt)return;let F=x=>{we.current&&$t({x:x.clientX-we.current.x,y:x.clientY-we.current.y})},b=()=>{we.current=null};return document.addEventListener("mousemove",F),document.addEventListener("mouseup",b),()=>{document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",b)}},[Mt]);let fa=async()=>{await Yn({imageSourceFolder:U.trim()||void 0}),be(!1),c(!1)},kt=()=>{be(!1),c(!1)},Pu=F=>{Me&&(Oe.current={x:F.clientX-Me.x,y:F.clientY-Me.y},F.preventDefault())},Iu=async()=>{await Yn({audioSourceFolder:gt.trim()||void 0}),Xe(!1),c(!1)},ga=()=>{Xe(!1),c(!1)},Au=F=>{ut&&(zt.current={x:F.clientX-ut.x,y:F.clientY-ut.y},F.preventDefault())},Ou=async()=>{await Yn({videoSourceFolder:kn.trim()||void 0}),fn(!1),c(!1)},ha=()=>{fn(!1),c(!1)},_a=F=>{gn&&(wo.current={x:F.clientX-gn.x,y:F.clientY-gn.y},F.preventDefault())},Yn=async F=>{let b=t.map(x=>x.id===e.id?{...x,...F}:x);await n(b)},Lo=async()=>{let F=g.trim();F&&F!==e.name&&await o(e.id,F),m(!1),c(!1)},va=async()=>{await Yn({visible:!1}),c(!1)},ba=async()=>{let F=t.filter(b=>b.id!==e.id);await n(F),c(!1)},ya=async F=>{await r(F)&&(await Yn({type:F}),F==="formula"?h(!0):F==="lookup"||F==="relation"?Ne(!0):F==="rollup"?ce(!0):F==="image"?be(!0):c(!1))},el=async()=>{f||(await Yn({formula:y.trim()||void 0}),h(!1),c(!1))},li=()=>{h(!1),c(!1)},Rr=F=>{R&&(re.current={x:F.clientX-R.x,y:F.clientY-R.y},F.preventDefault())},Er=async()=>{let F=e.pairedColumnId;if(e.type==="relation"&&Ae&&Y&&!e.pairedColumnId){let b=a.vault.getFileByPath(Y);if(b){let x=i.readConfig(b),E=`rel_${e.id}_${Date.now()}`,z=l?.parent?.name||a.vault.getName(),pe={id:E,name:z,type:"relation",visible:!0,refDatabasePath:l?.path.replace(/\/[^/]+$/,"/_database.md")??"",refColumnId:"_title",pairedColumnId:e.id};x.schema.push(pe),await i.writeConfig(b,x),F=E}}else if(e.type==="relation"&&!Ae&&e.pairedColumnId){let b=a.vault.getFileByPath(Y||e.refDatabasePath||"");if(b){let x=i.readConfig(b);x.schema=x.schema.filter(E=>E.id!==e.pairedColumnId),await i.writeConfig(b,x)}F=void 0}await Yn({refDatabasePath:Y,refColumnId:e.type==="relation"?"_title":j,...e.type==="lookup"?{refMatchColumnId:_e}:{},...e.type==="relation"?{pairedColumnId:F,isHierarchical:xe||void 0}:{}}),Ne(!1),c(!1)},wa=()=>{Ne(!1),c(!1)},ai=F=>{de&&(De.current={x:F.clientX-de.x,y:F.clientY-de.y},F.preventDefault())},tl=async()=>{await Yn({rollupRelationColumnId:ve,rollupTargetColumnId:K,rollupFunction:Z}),ce(!1),c(!1)},$u=F=>{$&&(vt.current={x:F.clientX-$.x,y:F.clientY-$.y},F.preventDefault())},zu=[{value:"count",label:u("rollup_fn_count")},{value:"sum",label:u("rollup_fn_sum")},{value:"avg",label:u("rollup_fn_avg")},{value:"min",label:u("rollup_fn_min")},{value:"max",label:u("rollup_fn_max")},{value:"count_values",label:u("rollup_fn_count_values")},{value:"list",label:u("rollup_fn_list")}],nl=t.filter(F=>F.type==="relation"),Vu=async()=>{let F={decimals:it,thousandsSeparator:M,...C.trim()?{prefix:C.trim()}:{},...H.trim()?{suffix:H.trim()}:{}};await Yn({numberFormat:F}),Et(!1),c(!1)},Ca=()=>{Et(!1),c(!1)},Bu=async()=>{await Yn({numberFormat:void 0}),Et(!1),c(!1)},Fr=F=>{bt&&(we.current={x:F.clientX-bt.x,y:F.clientY-bt.y},F.preventDefault())},[ol,Co]=(0,he.useState)(!1),rl=t.filter(F=>F.id!==e.id&&F.type!=="formula"),ka=[{group:u("formula_group_logic"),items:[{fn:"IF(cond, a, b)",desc:"Se cond for verdadeiro retorna a, sen\xE3o b"},{fn:"IFS(c1, v1, c2, v2\u2026)",desc:"Testa condi\xE7\xF5es em sequ\xEAncia"},{fn:"AND(a, b, \u2026)",desc:"Verdadeiro se todos forem verdadeiros"},{fn:"OR(a, b, \u2026)",desc:"Verdadeiro se algum for verdadeiro"},{fn:"NOT(a)",desc:"Inverte o valor l\xF3gico"}]},{group:u("formula_group_comparators"),items:[{fn:"= <> != > < >= <=",desc:"Compara dois valores; use com IF"}]},{group:u("formula_group_aggregators"),items:[{fn:"SUM(col)",desc:"Soma todos os valores da coluna"},{fn:"AVG(col)",desc:"M\xE9dia dos valores da coluna"},{fn:"COUNT(col)",desc:"Conta valores n\xE3o vazios da coluna"},{fn:"MIN(col)",desc:"Menor valor da coluna"},{fn:"MAX(col)",desc:"Maior valor da coluna"}]},{group:u("formula_group_text"),items:[{fn:"CONCAT(a, b, \u2026)",desc:"Concatena textos (ou use &)"},{fn:"LEN(texto)",desc:"N\xFAmero de caracteres"},{fn:"UPPER / LOWER(texto)",desc:"Mai\xFAsculas / min\xFAsculas"},{fn:"TRIM(texto)",desc:"Remove espa\xE7os nas bordas"},{fn:"LEFT(texto, n)",desc:"Primeiros n caracteres"},{fn:"RIGHT(texto, n)",desc:"\xDAltimos n caracteres"},{fn:"MID(texto, in\xEDcio, n)",desc:"Substring a partir de in\xEDcio"},{fn:"SUBSTITUTE(t, de, para)",desc:"Substitui ocorr\xEAncias"}]},{group:u("formula_group_math"),items:[{fn:"ROUND(n, d)",desc:"Arredonda n com d casas decimais"},{fn:"FLOOR / CEIL(n)",desc:"Arredonda para baixo / cima"},{fn:"ABS(n)",desc:"Valor absoluto"},{fn:"MOD(n, d)",desc:"Resto da divis\xE3o"},{fn:"POWER(b, e)",desc:"Base elevado ao expoente"},{fn:"SQRT(n)",desc:"Raiz quadrada"}]},{group:u("formula_group_utils"),items:[{fn:"ISNULL(v)",desc:"Verdadeiro se v for vazio ou nulo"},{fn:"COALESCE(a, b, \u2026)",desc:"Primeiro valor n\xE3o vazio"},{fn:"TEXT(v)",desc:"Converte para texto"},{fn:"VALUE(v)",desc:"Converte para n\xFAmero"}]}],ju=(()=>{let F=1234.5678,b={minimumFractionDigits:it,maximumFractionDigits:it,useGrouping:M},x=new Intl.NumberFormat("pt-BR",b).format(F);return C.trim()&&(x=`${C.trim()} ${x}`),H.trim()&&(x=`${x} ${H.trim()}`),x})(),Sa=v&&R?(0,yr.createPortal)((0,T.jsxs)("div",{ref:J,className:"nb-formula-floating-panel",style:{top:R.y,left:R.x},children:[(0,T.jsxs)("div",{className:"nb-formula-titlebar",onMouseDown:Rr,children:[(0,T.jsx)("span",{className:"nb-formula-titlebar-icon",children:"\u0192"}),(0,T.jsxs)("span",{className:"nb-formula-titlebar-title",children:[u("formula_panel_title"),": ",e.name]}),(0,T.jsx)("button",{className:"nb-formula-close",onClick:li,title:u("tooltip_close"),children:"\xD7"})]}),(0,T.jsxs)("div",{className:"nb-formula-body",children:[(0,T.jsx)("textarea",{ref:W,className:`nb-formula-textarea${f?" nb-formula-textarea--error":y.trim()?" nb-formula-textarea--ok":""}`,value:y,onChange:F=>_(F.target.value),placeholder:u("formula_placeholder"),rows:3,spellCheck:!1,onKeyDown:F=>{F.key==="Enter"&&(F.ctrlKey||F.metaKey)&&(F.preventDefault(),el()),F.key==="Escape"&&li()}}),f&&(0,T.jsxs)("div",{className:"nb-formula-feedback nb-formula-feedback--error",children:[(0,T.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,T.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,T.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,T.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),f]}),!f&&y.trim()&&(0,T.jsxs)("div",{className:"nb-formula-feedback nb-formula-feedback--ok",children:[(0,T.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,T.jsx)("polyline",{points:"20 6 9 17 4 12"})}),u("formula_valid")]}),rl.length>0&&(0,T.jsxs)("div",{className:"nb-formula-cols-hint",children:[(0,T.jsx)("span",{className:"nb-formula-cols-label",children:u("formula_available_cols")}),(0,T.jsx)("div",{className:"nb-formula-cols-list",children:rl.map(F=>(0,T.jsx)("code",{className:"nb-formula-col-chip",title:`ID: ${F.id}`,onClick:()=>{let b=/\s/.test(F.name)?`[${F.name}]`:F.name;_(x=>x+b),W.current?.focus()},children:F.name},F.id))})]}),(0,T.jsxs)("div",{className:"nb-formula-ref",children:[(0,T.jsxs)("button",{className:"nb-formula-ref-toggle",onClick:()=>Co(F=>!F),children:[(0,T.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",style:{transform:ol?"rotate(90deg)":"none",transition:"transform 150ms"},children:(0,T.jsx)("polyline",{points:"9 18 15 12 9 6"})}),u("formula_ref_toggle")]}),ol&&(0,T.jsx)("div",{className:"nb-formula-ref-body",children:ka.map(F=>(0,T.jsxs)("div",{className:"nb-formula-ref-group",children:[(0,T.jsx)("div",{className:"nb-formula-ref-group-title",children:F.group}),(0,T.jsx)("table",{className:"nb-formula-ref-table",children:(0,T.jsx)("tbody",{children:F.items.map(b=>(0,T.jsxs)("tr",{children:[(0,T.jsx)("td",{className:"nb-formula-ref-fn",children:(0,T.jsx)("code",{children:b.fn})}),(0,T.jsx)("td",{className:"nb-formula-ref-desc",children:b.desc})]},b.fn))})})]},F.group))})]}),(0,T.jsxs)("div",{className:"nb-formula-actions",children:[(0,T.jsx)("button",{className:"nb-formula-save",disabled:!!f,onClick:()=>{el()},title:u("formula_save_hint"),children:u("formula_save")}),(0,T.jsx)("button",{className:"nb-formula-cancel",onClick:li,children:u("formula_cancel")})]})]})]}),document.body):null,Na=Mt&&bt?(0,yr.createPortal)((0,T.jsxs)("div",{ref:le,className:"nb-formula-floating-panel",style:{top:bt.y,left:bt.x},children:[(0,T.jsxs)("div",{className:"nb-formula-titlebar",onMouseDown:Fr,children:[(0,T.jsx)("span",{className:"nb-formula-titlebar-icon",children:"#"}),(0,T.jsxs)("span",{className:"nb-formula-titlebar-title",children:[u("number_format_title"),": ",e.name]}),(0,T.jsx)("button",{className:"nb-formula-close",onClick:Ca,title:u("tooltip_close"),children:"\xD7"})]}),(0,T.jsxs)("div",{className:"nb-formula-body",children:[(0,T.jsx)("div",{className:"nb-numfmt-preview",children:ju}),(0,T.jsxs)("div",{className:"nb-lookup-section",children:[(0,T.jsx)("label",{className:"nb-lookup-label",children:u("number_decimals_label")}),(0,T.jsx)("select",{className:"nb-lookup-select",value:it,onChange:F=>en(Number(F.target.value)),children:[0,1,2,3,4,5,6].map(F=>(0,T.jsx)("option",{value:F,children:F},F))})]}),(0,T.jsxs)("div",{className:"nb-numfmt-checkbox-row",children:[(0,T.jsx)("input",{type:"checkbox",id:"nb-fmt-thousands",checked:M,onChange:F=>Ce(F.target.checked),className:"nb-cell-checkbox"}),(0,T.jsx)("label",{htmlFor:"nb-fmt-thousands",className:"nb-lookup-label",style:{cursor:"pointer"},children:u("number_thousands_label")})]}),(0,T.jsxs)("div",{className:"nb-lookup-section",children:[(0,T.jsx)("label",{className:"nb-lookup-label",children:u("number_prefix_label")}),(0,T.jsx)("input",{type:"text",className:"nb-numfmt-text-input",value:C,onChange:F=>X(F.target.value),placeholder:u("number_prefix_placeholder")})]}),(0,T.jsxs)("div",{className:"nb-lookup-section",children:[(0,T.jsx)("label",{className:"nb-lookup-label",children:u("number_suffix_label")}),(0,T.jsx)("input",{type:"text",className:"nb-numfmt-text-input",value:H,onChange:F=>ae(F.target.value),placeholder:u("number_suffix_placeholder")})]}),(0,T.jsxs)("div",{className:"nb-formula-actions",children:[(0,T.jsx)("button",{className:"nb-formula-save",onClick:()=>{Vu()},children:u("formula_save")}),(0,T.jsx)("button",{className:"nb-formula-cancel",onClick:Ca,children:u("formula_cancel")})]}),e.numberFormat&&(0,T.jsx)("div",{style:{marginTop:"8px",textAlign:"center"},children:(0,T.jsx)("button",{className:"nb-formula-cancel",onClick:()=>{Bu()},style:{color:"var(--text-error)",width:"100%"},children:u("number_remove_format")})})]})]}),document.body):null,Hu=q&&$?(0,yr.createPortal)((0,T.jsxs)("div",{ref:Jt,className:"nb-formula-floating-panel",style:{top:$.y,left:$.x},children:[(0,T.jsxs)("div",{className:"nb-formula-titlebar",onMouseDown:$u,children:[(0,T.jsx)("span",{className:"nb-formula-titlebar-icon",children:"\u03A3"}),(0,T.jsxs)("span",{className:"nb-formula-titlebar-title",children:[u("rollup_panel_title"),": ",e.name]}),(0,T.jsx)("button",{className:"nb-formula-close",onClick:()=>{ce(!1),c(!1)},title:u("tooltip_close"),children:"\xD7"})]}),(0,T.jsx)("div",{className:"nb-formula-body",style:{padding:"12px"},children:nl.length===0?(0,T.jsx)("div",{style:{color:"var(--text-muted)",fontSize:"0.85rem"},children:u("rollup_no_relations")}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("div",{className:"nb-lookup-section",children:[(0,T.jsx)("label",{className:"nb-lookup-label",children:u("rollup_select_relation")}),(0,T.jsxs)("select",{className:"nb-lookup-select",value:ve,onChange:F=>{S(F.target.value),D("")},children:[(0,T.jsx)("option",{value:"",children:u("rollup_select_relation_placeholder")}),nl.map(F=>(0,T.jsx)("option",{value:F.id,children:F.name},F.id))]})]}),ve&&(0,T.jsxs)("div",{className:"nb-lookup-section",children:[(0,T.jsx)("label",{className:"nb-lookup-label",children:u("rollup_select_target")}),(0,T.jsxs)("select",{className:"nb-lookup-select",value:K,onChange:F=>D(F.target.value),children:[(0,T.jsx)("option",{value:"",children:u("rollup_select_target_placeholder")}),(0,T.jsx)("option",{value:"_title",children:u("lookup_file_name")}),ye.map(F=>(0,T.jsx)("option",{value:F.id,children:F.name},F.id))]})]}),K&&(0,T.jsxs)("div",{className:"nb-lookup-section",children:[(0,T.jsx)("label",{className:"nb-lookup-label",children:u("rollup_select_function")}),(0,T.jsx)("select",{className:"nb-lookup-select",value:Z,onChange:F=>ke(F.target.value),children:zu.map(F=>(0,T.jsx)("option",{value:F.value,children:F.label},F.value))})]}),(0,T.jsx)("button",{className:"nb-formula-save",disabled:!ve||!K,onClick:()=>{tl()},children:u("formula_save")})]})})]}),document.body):null,Uu=ue&&de?(0,yr.createPortal)((0,T.jsxs)("div",{ref:Ze,className:"nb-formula-floating-panel",style:{top:de.y,left:de.x},children:[(0,T.jsxs)("div",{className:"nb-formula-titlebar",onMouseDown:ai,children:[(0,T.jsx)("span",{className:"nb-formula-titlebar-icon",children:e.type==="relation"?"\u{1F517}":"\u2197"}),(0,T.jsxs)("span",{className:"nb-formula-titlebar-title",children:[e.type==="relation"?u("relation_panel_title"):u("lookup_panel_title"),": ",e.name]}),(0,T.jsx)("button",{className:"nb-formula-close",onClick:wa,title:u("tooltip_close"),children:"\xD7"})]}),(0,T.jsxs)("div",{className:"nb-formula-body",children:[(0,T.jsxs)("div",{className:"nb-lookup-section",children:[(0,T.jsx)("label",{className:"nb-lookup-label",children:u("lookup_ref_table")}),(0,T.jsxs)("select",{className:"nb-lookup-select",value:Y,onChange:F=>{te(F.target.value),ie("")},children:[(0,T.jsx)("option",{value:"",children:u("lookup_select_table")}),Ie.map(F=>(0,T.jsx)("option",{value:F.path,children:F.name},F.path))]})]}),e.type!=="relation"&&(0,T.jsxs)("div",{className:"nb-lookup-section",children:[(0,T.jsx)("label",{className:"nb-lookup-label",children:u("lookup_col_to_display")}),(0,T.jsxs)("select",{className:"nb-lookup-select",value:j,onChange:F=>ie(F.target.value),disabled:!Y,children:[(0,T.jsx)("option",{value:"",children:u("lookup_select_col")}),(0,T.jsx)("option",{value:"_title",children:"\u{1F4C4} "+u("lookup_file_name")}),He.map(F=>(0,T.jsx)("option",{value:F.id,children:F.name},F.id))]})]}),e.type==="lookup"&&(0,T.jsxs)("div",{className:"nb-lookup-section",children:[(0,T.jsx)("label",{className:"nb-lookup-label",children:u("lookup_join_col")}),(0,T.jsxs)("select",{className:"nb-lookup-select",value:_e,onChange:F=>me(F.target.value),children:[(0,T.jsx)("option",{value:"",children:u("lookup_select_col")}),(0,T.jsx)("option",{value:"_title",children:"\u{1F4C4} "+u("lookup_join_col_title")}),t.filter(F=>F.id!==e.id&&F.type!=="formula"&&F.type!=="lookup").map(F=>(0,T.jsx)("option",{value:F.id,children:F.name},F.id))]}),(0,T.jsx)("p",{className:"nb-lookup-hint",children:u("lookup_hint")})]}),e.type==="relation"&&Y&&(0,T.jsxs)("div",{className:"nb-lookup-section",children:[(0,T.jsxs)("label",{className:"nb-lookup-checkbox",children:[(0,T.jsx)("input",{type:"checkbox",checked:Ae,onChange:F=>Ee(F.target.checked)}),u("relation_two_way")]}),(0,T.jsx)("p",{className:"nb-lookup-hint",children:u("relation_two_way_hint")})]}),e.type==="relation"&&Y&&Y===l?.path&&(0,T.jsxs)("div",{className:"nb-lookup-section",children:[(0,T.jsxs)("label",{className:"nb-lookup-checkbox",children:[(0,T.jsx)("input",{type:"checkbox",checked:xe,onChange:F=>{F.target.checked&&t.some(b=>b.id!==e.id&&b.isHierarchical)||Fe(F.target.checked)}}),u("hierarchy_toggle")]}),(0,T.jsx)("p",{className:"nb-lookup-hint",children:u("hierarchy_toggle_hint")})]}),(0,T.jsxs)("div",{className:"nb-formula-actions",children:[(0,T.jsx)("button",{className:"nb-formula-save",disabled:!Y||e.type==="lookup"&&(!j||!_e),onClick:()=>{Er()},children:u("formula_save")}),(0,T.jsx)("button",{className:"nb-formula-cancel",onClick:wa,children:u("formula_cancel")})]})]})]}),document.body):null,si=N&&Me?(0,yr.createPortal)((0,T.jsxs)("div",{ref:Pe,className:"nb-formula-floating-panel",style:{top:Me.y,left:Me.x,minWidth:280},children:[(0,T.jsxs)("div",{className:"nb-formula-titlebar",onMouseDown:Pu,children:[(0,T.jsx)("span",{className:"nb-formula-titlebar-icon",children:"\u{1F5BC}"}),(0,T.jsxs)("span",{className:"nb-formula-titlebar-title",children:[u("image_panel_title"),": ",e.name]}),(0,T.jsx)("button",{className:"nb-formula-close",onClick:kt,title:u("tooltip_close"),children:"\xD7"})]}),(0,T.jsxs)("div",{className:"nb-formula-body",style:{padding:12,display:"flex",flexDirection:"column",gap:10},children:[(0,T.jsx)("label",{style:{fontSize:"var(--font-ui-small)",color:"var(--text-muted)"},children:u("image_folder_label")}),(0,T.jsx)("input",{type:"text",className:"nb-header-rename-input",value:U,onChange:F=>Le(F.target.value),placeholder:u("image_folder_placeholder")}),(0,T.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,T.jsx)("button",{className:"nb-menu-item",onClick:kt,style:{flex:1},children:u("formula_cancel")}),(0,T.jsx)("button",{className:"nb-menu-item",onClick:()=>{fa()},style:{flex:1,color:"var(--interactive-accent)"},children:u("formula_save")})]})]})]}),document.body):null,Dr=$e&&ut?(0,yr.createPortal)((0,T.jsxs)("div",{ref:At,className:"nb-formula-floating-panel",style:{top:ut.y,left:ut.x,minWidth:280},children:[(0,T.jsxs)("div",{className:"nb-formula-titlebar",onMouseDown:Au,children:[(0,T.jsx)("span",{className:"nb-formula-titlebar-icon",children:"\u{1F3B5}"}),(0,T.jsxs)("span",{className:"nb-formula-titlebar-title",children:[u("audio_panel_title"),": ",e.name]}),(0,T.jsx)("button",{className:"nb-formula-close",onClick:ga,title:u("tooltip_close"),children:"\xD7"})]}),(0,T.jsxs)("div",{className:"nb-formula-body",style:{padding:12,display:"flex",flexDirection:"column",gap:10},children:[(0,T.jsx)("label",{style:{fontSize:"var(--font-ui-small)",color:"var(--text-muted)"},children:u("audio_folder_label")}),(0,T.jsx)("input",{type:"text",className:"nb-header-rename-input",value:gt,onChange:F=>It(F.target.value),placeholder:u("audio_folder_placeholder")}),(0,T.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,T.jsx)("button",{className:"nb-menu-item",onClick:ga,style:{flex:1},children:u("formula_cancel")}),(0,T.jsx)("button",{className:"nb-menu-item",onClick:()=>{Iu()},style:{flex:1,color:"var(--interactive-accent)"},children:u("formula_save")})]})]})]}),document.body):null,Mr=tn&&gn?(0,yr.createPortal)((0,T.jsxs)("div",{ref:xr,className:"nb-formula-floating-panel",style:{top:gn.y,left:gn.x,minWidth:280},children:[(0,T.jsxs)("div",{className:"nb-formula-titlebar",onMouseDown:_a,children:[(0,T.jsx)("span",{className:"nb-formula-titlebar-icon",children:"\u{1F3AC}"}),(0,T.jsxs)("span",{className:"nb-formula-titlebar-title",children:[u("video_panel_title"),": ",e.name]}),(0,T.jsx)("button",{className:"nb-formula-close",onClick:ha,title:u("tooltip_close"),children:"\xD7"})]}),(0,T.jsxs)("div",{className:"nb-formula-body",style:{padding:12,display:"flex",flexDirection:"column",gap:10},children:[(0,T.jsx)("label",{style:{fontSize:"var(--font-ui-small)",color:"var(--text-muted)"},children:u("video_folder_label")}),(0,T.jsx)("input",{type:"text",className:"nb-header-rename-input",value:kn,onChange:F=>To(F.target.value),placeholder:u("video_folder_placeholder")}),(0,T.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,T.jsx)("button",{className:"nb-menu-item",onClick:ha,style:{flex:1},children:u("formula_cancel")}),(0,T.jsx)("button",{className:"nb-menu-item",onClick:()=>{Ou()},style:{flex:1,color:"var(--interactive-accent)"},children:u("formula_save")})]})]})]}),document.body):null;return(0,T.jsxs)("div",{className:"nb-column-header",ref:L,children:[p?(0,T.jsx)("input",{ref:V,className:"nb-header-rename-input",value:g,onChange:F=>d(F.target.value),onBlur:()=>{Lo()},onKeyDown:F=>{F.key==="Enter"&&Lo(),F.key==="Escape"&&(m(!1),c(!1))},onClick:F=>F.stopPropagation()}):(0,T.jsxs)("button",{className:"nb-header-label",onClick:()=>{c(F=>!F),h(!1),Ne(!1),Et(!1),be(!1)},title:e.name,children:[(0,T.jsx)("span",{className:"nb-header-icon",children:dv[e.type]}),(0,T.jsx)("span",{className:"nb-header-name",children:e.name})]}),s&&!v&&!ue&&!q&&!Mt&&!N&&(0,T.jsxs)("div",{className:"nb-column-menu",children:[(0,T.jsxs)("button",{className:"nb-menu-item",onClick:()=>{c(!1),m(!0)},children:[(0,T.jsx)("span",{className:"nb-menu-item-icon",children:"\u270F\uFE0F"}),(0,T.jsx)("span",{children:u("rename_column")})]}),e.type==="formula"&&(0,T.jsxs)("button",{className:"nb-menu-item",onClick:()=>h(!0),children:[(0,T.jsx)("span",{className:"nb-menu-item-icon",children:"\u0192"}),(0,T.jsx)("span",{children:u("edit_formula")})]}),e.type==="lookup"&&(0,T.jsxs)("button",{className:"nb-menu-item",onClick:()=>Ne(!0),children:[(0,T.jsx)("span",{className:"nb-menu-item-icon",children:"\u2197"}),(0,T.jsx)("span",{children:u("configure_lookup")})]}),e.type==="relation"&&(0,T.jsxs)("button",{className:"nb-menu-item",onClick:()=>Ne(!0),children:[(0,T.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F517}"}),(0,T.jsx)("span",{children:u("configure_relation")})]}),e.type==="rollup"&&(0,T.jsxs)("button",{className:"nb-menu-item",onClick:()=>ce(!0),children:[(0,T.jsx)("span",{className:"nb-menu-item-icon",children:"\u03A3"}),(0,T.jsx)("span",{children:u("configure_rollup")})]}),e.type==="number"&&(0,T.jsxs)("button",{className:"nb-menu-item",onClick:()=>Et(!0),children:[(0,T.jsx)("span",{className:"nb-menu-item-icon",children:"#"}),(0,T.jsx)("span",{children:u("format_number")})]}),e.type==="image"&&(0,T.jsxs)("button",{className:"nb-menu-item",onClick:()=>be(!0),children:[(0,T.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F5BC}"}),(0,T.jsx)("span",{children:u("configure_image_folder")})]}),e.type==="audio"&&(0,T.jsxs)("button",{className:"nb-menu-item",onClick:()=>Xe(!0),children:[(0,T.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F3B5}"}),(0,T.jsx)("span",{children:u("configure_audio_folder")})]}),e.type==="video"&&(0,T.jsxs)("button",{className:"nb-menu-item",onClick:()=>fn(!0),children:[(0,T.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F3AC}"}),(0,T.jsx)("span",{children:u("configure_video_folder")})]}),(0,T.jsx)("div",{className:"nb-menu-separator"}),(0,T.jsx)("div",{className:"nb-menu-label",children:u("field_type_label")}),["text","number","select","multiselect","date","checkbox","url","email","phone","status","formula","relation","lookup","rollup","image","audio","video"].map(F=>(0,T.jsxs)("button",{className:`nb-menu-item nb-menu-type-item ${e.type===F?"nb-menu-item--active":""}`,onClick:()=>{ya(F)},children:[(0,T.jsx)("span",{className:"nb-menu-item-icon",children:dv[F]}),(0,T.jsx)("span",{children:pk()[F]})]},F)),(0,T.jsx)("div",{className:"nb-menu-separator"}),(0,T.jsxs)("button",{className:"nb-menu-item",onClick:()=>{va()},children:[(0,T.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F441}"}),(0,T.jsx)("span",{children:u("hide_field")})]}),(0,T.jsxs)("button",{className:"nb-menu-item nb-menu-item--danger",onClick:()=>{ba()},children:[(0,T.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F5D1}"}),(0,T.jsx)("span",{children:u("delete_field")})]})]}),Sa,Uu,Hu,Na,si,Dr,Mr]})}var ge=ze(yt(),1),ao=ze(vo(),1);var vu=ze(yt(),1),I=ze(Rt(),1),Xp=(0,vu.createContext)(null);function bu(){let e=(0,vu.useContext)(Xp);if(!e)throw new Error("CellContext n\xE3o encontrado");return e}function mk(e,t){if(!t)return String(e);let n={minimumFractionDigits:t.decimals,maximumFractionDigits:t.decimals,useGrouping:t.thousandsSeparator},o=new Intl.NumberFormat("pt-BR",n).format(e);return t.prefix&&(o=`${t.prefix} ${o}`),t.suffix&&(o=`${o} ${t.suffix}`),o}var fk=[{value:u("status_not_started"),color:"#9E9E9E"},{value:u("status_in_progress"),color:"#2196F3"},{value:u("status_done"),color:"#4CAF50"},{value:u("status_cancelled"),color:"#F44336"}];function Yp(e){let t=e.replace(/\D/g,"").slice(0,11);return t.length<=2?`(${t}`:t.length<=6?`(${t.slice(0,2)}) ${t.slice(2)}`:t.length<=10?`(${t.slice(0,2)}) ${t.slice(2,6)}-${t.slice(6)}`:`(${t.slice(0,2)}) ${t.slice(2,7)}-${t.slice(7)}`}function mv({value:e,href:t,isEditing:n,inputType:o,onStartEdit:r,onCommit:i,onCancel:l,validate:a}){let[s,c]=(0,ge.useState)(null),p=g=>{g.stopPropagation(),t&&window.open(t,"_blank")},m=g=>{if(g&&a){let d=a(g);if(d){c(d);return}}c(null),i(g)};return n?(0,I.jsxs)("div",{className:"nb-link-edit-wrapper",children:[(0,I.jsx)("input",{className:`nb-cell-input${s?" nb-cell-input--error":""}`,autoFocus:!0,type:o,defaultValue:e??"",onBlur:g=>m(g.target.value||null),onKeyDown:g=>{g.key==="Enter"&&m(g.target.value||null),g.key==="Escape"&&(c(null),l())}}),s&&(0,I.jsx)("span",{className:"nb-cell-error-msg",children:s})]}):(0,I.jsx)("div",{className:"nb-cell-clickable",onClick:r,children:e?(0,I.jsxs)("span",{className:"nb-cell-link-wrapper",children:[(0,I.jsx)("span",{className:"nb-cell-link",onClick:p,children:e}),(0,I.jsx)("span",{className:"nb-cell-link-icon",onClick:p,children:"\u2197"})]}):(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})})}var Qp=ge.default.memo(function({col:t,value:n,rowIndex:o,columnId:r,file:i}){let{editingCell:l,setEditingCell:a,updateCell:s,relationOptions:c}=bu(),p=Dt(),m=l?.rowIndex===o&&l?.columnId===r,g=()=>{t.type==="formula"||t.type==="lookup"||t.type==="rollup"||t.type==="checkbox"||a({rowIndex:o,columnId:r})};switch(t.type){case"title":return(0,I.jsx)(fv,{value:String(n??""),isEditing:m,onStartEdit:g,onCommit:d=>{s(o,r,d)},onCancel:()=>a(null),onOpen:i?()=>{p.workspace.getLeaf(!1).openFile(i)}:void 0});case"text":return(0,I.jsx)(fv,{value:String(n??""),isEditing:m,onStartEdit:g,onCommit:d=>{s(o,r,d)},onCancel:()=>a(null)});case"number":return(0,I.jsx)(gk,{value:n,isEditing:m,onStartEdit:g,onCommit:d=>{s(o,r,d)},onCancel:()=>a(null),format:t.numberFormat});case"select":return(0,I.jsx)(_k,{value:n,col:t,isEditing:m,onStartEdit:g,onCommit:d=>{s(o,r,d),a(null)},onCancel:()=>a(null)});case"multiselect":return(0,I.jsx)(bk,{value:Array.isArray(n)?n:[],col:t,isEditing:m,onStartEdit:g,onCommit:d=>{s(o,r,d),a(null)},onCancel:()=>a(null)});case"date":return(0,I.jsx)(wk,{value:n,isEditing:m,onStartEdit:g,onSave:d=>{s(o,r,d)},onClose:()=>a(null)});case"checkbox":return(0,I.jsx)(Ck,{value:!!n,onCommit:d=>{s(o,r,d)}});case"relation":{let d=n,v=Array.isArray(d)?d.filter(h=>typeof h=="string"):typeof d=="string"&&d?[d]:[];return(0,I.jsx)(xk,{value:v,options:c.get(r)??[],isEditing:m,onStartEdit:g,onCommit:h=>{s(o,r,h.length>0?h:null),a(null)},onCancel:()=>a(null)})}case"url":return(0,I.jsx)(mv,{value:n,href:n?String(n):null,inputType:"url",isEditing:m,onStartEdit:g,onCommit:d=>{s(o,r,d),a(null)},onCancel:()=>a(null)});case"email":return(0,I.jsx)(mv,{value:n,href:n?`mailto:${n}`:null,inputType:"email",isEditing:m,onStartEdit:g,onCommit:d=>{s(o,r,d),a(null)},onCancel:()=>a(null),validate:d=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(d)?null:u("email_invalid")});case"phone":return(0,I.jsx)(hk,{value:n,isEditing:m,onStartEdit:g,onCommit:d=>{s(o,r,d),a(null)},onCancel:()=>a(null)});case"status":return(0,I.jsx)(vk,{value:n,col:t,isEditing:m,onStartEdit:g,onCommit:d=>{s(o,r,d),a(null)},onCancel:()=>a(null)});case"formula":return(0,I.jsx)(kk,{value:n,col:t});case"lookup":return(0,I.jsx)(Sk,{value:n,col:t});case"rollup":return(0,I.jsx)(Nk,{value:n,col:t});case"image":return(0,I.jsx)(Rk,{col:t,value:n,isEditing:m,onStartEdit:g,onCommit:d=>{s(o,r,d),a(null)},onCancel:()=>a(null)});case"audio":return(0,I.jsx)(Ek,{col:t,value:n,isEditing:m,onStartEdit:g,onCommit:d=>{s(o,r,d),a(null)},onCancel:()=>a(null)});case"video":return(0,I.jsx)(Fk,{col:t,value:n,isEditing:m,onStartEdit:g,onCommit:d=>{s(o,r,d),a(null)},onCancel:()=>a(null)});default:return(0,I.jsx)("span",{className:"nb-cell-text",children:String(n??"")})}});function fv({value:e,isEditing:t,onStartEdit:n,onCommit:o,onCancel:r,onOpen:i}){let l=(0,ge.useRef)(null),[a,s]=(0,ge.useState)(e),c=(0,ge.useRef)(null);(0,ge.useEffect)(()=>{t&&(s(e),requestAnimationFrame(()=>l.current?.select()))},[t,e]),(0,ge.useEffect)(()=>()=>{c.current&&clearTimeout(c.current)},[]);let p=()=>{if(i){if(c.current!==null){clearTimeout(c.current),c.current=null;return}c.current=setTimeout(()=>{c.current=null,i()},250)}},m=()=>{c.current&&(clearTimeout(c.current),c.current=null),n()};return t?(0,I.jsx)("input",{ref:l,className:"nb-cell-input",value:a,onChange:g=>s(g.target.value),onBlur:()=>{o(a),r()},onKeyDown:g=>{g.key==="Enter"&&(o(a),r()),g.key==="Escape"&&r()}}):(0,I.jsx)("div",{className:"nb-cell-text nb-cell-clickable nb-cell-editable",onDoubleClick:m,children:i?(0,I.jsx)("span",{className:"nb-cell-title-link",onClick:p,children:e||(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})}):e||(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})})}function gk({value:e,isEditing:t,onStartEdit:n,onCommit:o,onCancel:r,format:i}){let l=(0,ge.useRef)(null),[a,s]=(0,ge.useState)(e?.toString()??"");return(0,ge.useEffect)(()=>{t&&(s(e?.toString()??""),requestAnimationFrame(()=>l.current?.select()))},[t,e]),t?(0,I.jsx)("input",{ref:l,type:"number",className:"nb-cell-input nb-cell-input--number",value:a,onChange:c=>s(c.target.value),onBlur:()=>{let c=a===""?null:Number(a);o(isNaN(c)?null:c),r()},onKeyDown:c=>{if(c.key==="Enter"){let p=a===""?null:Number(a);o(isNaN(p)?null:p),r()}c.key==="Escape"&&r()}}):(0,I.jsx)("div",{className:"nb-cell-text nb-cell-clickable nb-cell-number",onDoubleClick:n,children:e!=null?mk(e,i):(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})})}function hk({value:e,isEditing:t,onStartEdit:n,onCommit:o,onCancel:r}){let[i,l]=(0,ge.useState)("");(0,ge.useEffect)(()=>{t&&l(Yp(e??""))},[t,e]);let a=s=>{s.stopPropagation(),e&&window.open(`tel:${e}`,"_blank")};return t?(0,I.jsx)("input",{className:"nb-cell-input",autoFocus:!0,type:"tel",value:i,onChange:s=>l(Yp(s.target.value)),onBlur:()=>o(i||null),onKeyDown:s=>{s.key==="Enter"&&o(i||null),s.key==="Escape"&&r()}}):(0,I.jsx)("div",{className:"nb-cell-clickable",onClick:n,children:e?(0,I.jsxs)("span",{className:"nb-cell-link-wrapper",children:[(0,I.jsx)("span",{className:"nb-cell-link",onClick:a,children:Yp(e)}),(0,I.jsx)("span",{className:"nb-cell-link-icon",onClick:a,children:"\u{1F4DE}"})]}):(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})})}var Cr=["#e2d9f3","#d1e8ff","#d4f1c0","#fde8c8","#ffd6d6","#d6f0f0","#f0d6f0","#f0f0d6"];function Gt(e,t){let n=e.find(r=>r.value===t);if(n?.color)return n.color;let o=e.findIndex(r=>r.value===t);return Cr[o%Cr.length]??"#e8e8e8"}function wr(e){let t=e.replace("#",""),n=parseInt(t.substring(0,2),16),o=parseInt(t.substring(2,4),16),r=parseInt(t.substring(4,6),16);return(.299*n+.587*o+.114*r)/255>.5?"rgba(0,0,0,0.75)":"rgba(255,255,255,0.9)"}function _k({value:e,col:t,isEditing:n,onStartEdit:o,onCommit:r,onCancel:i}){let{updateSchema:l,schema:a}=bu(),s=(0,ge.useRef)(null),c=(0,ge.useRef)(null),p=(0,ge.useRef)(null),[m,g]=(0,ge.useState)(null),[d,v]=(0,ge.useState)(""),[h,y]=(0,ge.useState)(null),[_,f]=(0,ge.useState)(null),[w,R]=(0,ge.useState)({}),P=t.options??[],L=P.map(te=>w[te.value]?{...te,color:w[te.value]}:te),V=(0,ge.useRef)({}),W=176,re=["#9E9E9E","#F44336","#E91E63","#9C27B0","#673AB7","#3F51B5","#2196F3","#03A9F4","#00BCD4","#009688","#4CAF50","#8BC34A","#FFEB3B","#FF9800","#FF5722","#795548"],J=(te,j)=>{R(ie=>({...ie,[te]:j})),V.current[te]=j},ue=(0,ge.useCallback)(()=>{let te=V.current;if(Object.keys(te).length===0)return;let j=P.map(_e=>te[_e.value]?{..._e,color:te[_e.value]}:_e),ie=a.map(_e=>_e.id===t.id?{..._e,options:j}:_e);V.current={},R({}),l(ie)},[P,a,t.id,l]);(0,ge.useEffect)(()=>{if(!n)return;let te=j=>{let ie=s.current?.contains(j.target),_e=c.current?.contains(j.target),me=p.current?.contains(j.target);!ie&&!_e&&!me&&(ue(),i())};return document.addEventListener("mousedown",te),()=>document.removeEventListener("mousedown",te)},[n,i,ue]),(0,ge.useEffect)(()=>{if(!n){y(null);return}if(v(""),R({}),V.current={},s.current){let te=s.current.getBoundingClientRect();g({top:te.bottom,left:te.left,width:te.width})}},[n]),(0,ge.useEffect)(()=>{if(!h)return;let te=j=>{p.current?.contains(j.target)||y(null)};return document.addEventListener("mousedown",te),()=>document.removeEventListener("mousedown",te)},[h]);let Ne=async te=>{let j=te.trim();if(!j||L.some(Ae=>Ae.value===j))return;let ie=Cr[L.length%Cr.length],_e=[...L,{value:j,color:ie}],me=a.map(Ae=>Ae.id===t.id?{...Ae,options:_e}:Ae);await l(me),r(j),v("")},de=async(te,j)=>{j.stopPropagation();let ie=L.filter(me=>me.value!==te),_e=a.map(me=>me.id===t.id?{...me,options:ie}:me);await l(_e),e===te&&r(null)},Re=n&&m?(0,ao.createPortal)((0,I.jsxs)("div",{ref:c,className:"nb-select-dropdown",style:{position:"fixed",top:m.top,left:m.left,minWidth:m.width,zIndex:9999},children:[(0,I.jsx)("input",{className:"nb-select-new-input",type:"text",placeholder:u("select_create_placeholder"),value:d,autoFocus:!0,onChange:te=>v(te.target.value),onKeyDown:te=>{te.key==="Enter"&&(te.preventDefault(),Ne(d))}}),(0,I.jsx)("button",{className:"nb-select-option nb-select-clear",onClick:()=>r(null),children:u("select_clear")}),L.map(te=>(0,I.jsxs)("div",{className:"nb-select-option-row",children:[(0,I.jsx)("button",{className:`nb-select-option ${e===te.value?"nb-select-option--active":""}`,onClick:()=>r(te.value),children:(0,I.jsx)("span",{className:"nb-select-badge",style:{background:Gt(L,te.value),color:wr(Gt(L,te.value))},children:te.value})}),(0,I.jsx)("button",{className:`nb-status-color-swatch ${h===te.value?"nb-status-color-swatch--active":""}`,title:u("tooltip_change_color"),style:{background:Gt(L,te.value)},onClick:j=>{j.stopPropagation();let ie=j.currentTarget.getBoundingClientRect();f({top:ie.bottom+4,left:Math.min(ie.right-W,window.innerWidth-W-8)}),y(_e=>_e===te.value?null:te.value)}}),(0,I.jsx)("button",{className:"nb-select-option-delete",onClick:j=>{de(te.value,j)},title:u("select_clear"),children:"\xD7"})]},te.value))]}),document.body):null,Y=h&&_?(0,ao.createPortal)((0,I.jsxs)("div",{ref:p,className:"nb-status-color-picker",style:{position:"fixed",top:_.top,left:_.left,zIndex:1e4},children:[(0,I.jsx)("div",{className:"nb-status-color-grid",children:re.map(te=>(0,I.jsx)("button",{className:"nb-status-color-dot",style:{background:te},title:te,onClick:j=>{j.stopPropagation(),J(h,te)}},te))}),(0,I.jsx)("div",{className:"nb-status-color-custom",children:(0,I.jsxs)("label",{className:"nb-status-color-custom-label",children:[u("color_custom"),(0,I.jsx)("input",{type:"color",className:"nb-status-color-input",defaultValue:Gt(L,h),onChange:te=>{J(h,te.target.value)}})]})})]}),document.body):null;return(0,I.jsxs)("div",{className:"nb-cell-select-wrapper",ref:s,children:[(0,I.jsx)("div",{className:"nb-cell-clickable",onClick:o,children:e?(0,I.jsx)("span",{className:"nb-select-badge",style:{background:Gt(L,e),color:wr(Gt(L,e))},children:e}):(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})}),Re,Y]})}function vk({value:e,col:t,isEditing:n,onStartEdit:o,onCommit:r,onCancel:i}){let{updateSchema:l,schema:a}=bu(),s=(0,ge.useRef)(null),c=(0,ge.useRef)(null),[p,m]=(0,ge.useState)(null),[g,d]=(0,ge.useState)(""),[v,h]=(0,ge.useState)(null),[y,_]=(0,ge.useState)(null),f=(0,ge.useRef)(null),[w,R]=(0,ge.useState)({}),P=(0,ge.useRef)({}),L=176,V=["#9E9E9E","#F44336","#E91E63","#9C27B0","#673AB7","#3F51B5","#2196F3","#03A9F4","#00BCD4","#009688","#4CAF50","#8BC34A","#FFEB3B","#FF9800","#FF5722","#795548"],W=t.options?.length?t.options:fk,re=W.map(Y=>w[Y.value]?{...Y,color:w[Y.value]}:Y),J=(Y,te)=>{R(j=>({...j,[Y]:te})),P.current[Y]=te},ue=(0,ge.useCallback)(()=>{let Y=P.current;if(Object.keys(Y).length===0)return;let te=W.map(ie=>Y[ie.value]?{...ie,color:Y[ie.value]}:ie),j=a.map(ie=>ie.id===t.id?{...ie,options:te}:ie);P.current={},R({}),l(j)},[W,a,t.id,l]);(0,ge.useEffect)(()=>{if(!n)return;let Y=te=>{let j=s.current?.contains(te.target),ie=c.current?.contains(te.target),_e=f.current?.contains(te.target);!j&&!ie&&!_e&&(ue(),i())};return document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[n,i,ue]),(0,ge.useEffect)(()=>{if(!n){h(null);return}if(d(""),R({}),P.current={},s.current){let Y=s.current.getBoundingClientRect();m({top:Y.bottom,left:Y.left,width:Y.width})}},[n]),(0,ge.useEffect)(()=>{if(!v)return;let Y=te=>{f.current?.contains(te.target)||h(null)};return document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[v]);let Ne=async()=>{let Y=g.trim();if(!Y)return;let te=Cr[re.length%Cr.length],j={value:Y,color:te},ie=[...re,j],_e=a.map(me=>me.id===t.id?{...me,options:ie}:me);await l(_e),d(""),r(Y)},de=n&&p?(0,ao.createPortal)((0,I.jsxs)("div",{ref:c,className:"nb-select-dropdown",style:{position:"fixed",top:p.top,left:p.left,minWidth:p.width,zIndex:9999},children:[(0,I.jsx)("button",{className:"nb-select-option nb-select-clear",onClick:()=>r(null),children:"Limpar"}),re.map(Y=>(0,I.jsxs)("div",{className:"nb-status-option-row",children:[(0,I.jsx)("button",{className:`nb-select-option nb-status-option-btn ${e===Y.value?"nb-select-option--active":""}`,onClick:()=>r(Y.value),children:(0,I.jsx)("span",{className:"nb-select-badge",style:{background:Gt(re,Y.value),color:wr(Gt(re,Y.value))},children:Y.value})}),(0,I.jsx)("button",{className:`nb-status-color-swatch ${v===Y.value?"nb-status-color-swatch--active":""}`,title:u("tooltip_change_color"),style:{background:Gt(re,Y.value),color:wr(Gt(re,Y.value))},onClick:te=>{te.stopPropagation();let j=te.currentTarget.getBoundingClientRect();_({top:j.bottom+4,left:Math.min(j.right-L,window.innerWidth-L-8)}),h(ie=>ie===Y.value?null:Y.value)}}),(0,I.jsx)("button",{className:"nb-status-delete-btn",title:u("tooltip_delete_status"),onClick:te=>{te.stopPropagation();let j=re.filter(_e=>_e.value!==Y.value),ie=a.map(_e=>_e.id===t.id?{..._e,options:j}:_e);l(ie),e===Y.value&&r(null)},children:"\xD7"})]},Y.value)),(0,I.jsxs)("div",{className:"nb-status-new-row",children:[(0,I.jsx)("input",{className:"nb-status-new-input",placeholder:u("status_new_placeholder"),value:g,onChange:Y=>d(Y.target.value),onKeyDown:Y=>{Y.key==="Enter"&&(Y.preventDefault(),Ne()),Y.key==="Escape"&&i(),Y.stopPropagation()}}),(0,I.jsx)("button",{className:"nb-status-new-btn",onClick:()=>{Ne()},disabled:!g.trim(),children:"+"})]})]}),document.body):null,Re=v&&y?(0,ao.createPortal)((0,I.jsxs)("div",{ref:f,className:"nb-status-color-picker",style:{position:"fixed",top:y.top,left:y.left,zIndex:1e4},children:[(0,I.jsx)("div",{className:"nb-status-color-grid",children:V.map(Y=>(0,I.jsx)("button",{className:"nb-status-color-dot",style:{background:Y},title:Y,onClick:te=>{te.stopPropagation(),J(v,Y)}},Y))}),(0,I.jsx)("div",{className:"nb-status-color-custom",children:(0,I.jsxs)("label",{className:"nb-status-color-custom-label",children:[u("color_custom"),(0,I.jsx)("input",{type:"color",className:"nb-status-color-input",defaultValue:Gt(re,v),onChange:Y=>{J(v,Y.target.value)}})]})})]}),document.body):null;return(0,I.jsxs)("div",{className:"nb-cell-select-wrapper",ref:s,children:[(0,I.jsx)("div",{className:"nb-cell-clickable",onClick:o,children:e?(0,I.jsx)("span",{className:"nb-select-badge",style:{background:Gt(re,e),color:wr(Gt(re,e))},children:e}):(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})}),de,Re]})}function bk({value:e,col:t,isEditing:n,onStartEdit:o,onCommit:r,onCancel:i}){let{updateSchema:l,schema:a}=bu(),s=(0,ge.useRef)(null),c=(0,ge.useRef)(null),p=(0,ge.useRef)(null),[m,g]=(0,ge.useState)(null),[d,v]=(0,ge.useState)(""),[h,y]=(0,ge.useState)(null),[_,f]=(0,ge.useState)(null),[w,R]=(0,ge.useState)({}),P=(0,ge.useRef)({}),L=t.options??[],V=L.map(j=>w[j.value]?{...j,color:w[j.value]}:j),W=176,re=["#9E9E9E","#F44336","#E91E63","#9C27B0","#673AB7","#3F51B5","#2196F3","#03A9F4","#00BCD4","#009688","#4CAF50","#8BC34A","#FFEB3B","#FF9800","#FF5722","#795548"],J=(j,ie)=>{R(_e=>({..._e,[j]:ie})),P.current[j]=ie},ue=(0,ge.useCallback)(()=>{let j=P.current;if(Object.keys(j).length===0)return;let ie=L.map(me=>j[me.value]?{...me,color:j[me.value]}:me),_e=a.map(me=>me.id===t.id?{...me,options:ie}:me);P.current={},R({}),l(_e)},[L,a,t.id,l]);(0,ge.useEffect)(()=>{if(!n)return;let j=ie=>{let _e=s.current?.contains(ie.target),me=c.current?.contains(ie.target),Ae=p.current?.contains(ie.target);!_e&&!me&&!Ae&&(ue(),i())};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[n,i,ue]),(0,ge.useEffect)(()=>{if(!n){y(null);return}if(v(""),R({}),P.current={},s.current){let j=s.current.getBoundingClientRect();g({top:j.bottom,left:j.left,width:j.width})}},[n]),(0,ge.useEffect)(()=>{if(!h)return;let j=ie=>{p.current?.contains(ie.target)||y(null)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[h]);let Ne=j=>{let ie=e.includes(j)?e.filter(_e=>_e!==j):[...e,j];r(ie)},de=async j=>{let ie=j.trim();if(!ie||V.some(Ee=>Ee.value===ie))return;let _e=Cr[V.length%Cr.length],me=[...V,{value:ie,color:_e}],Ae=a.map(Ee=>Ee.id===t.id?{...Ee,options:me}:Ee);await l(Ae),r([...e,ie]),v("")},Re=async(j,ie)=>{ie.stopPropagation();let _e=V.filter(Ae=>Ae.value!==j),me=a.map(Ae=>Ae.id===t.id?{...Ae,options:_e}:Ae);await l(me),e.includes(j)&&r(e.filter(Ae=>Ae!==j))},Y=n&&m?(0,ao.createPortal)((0,I.jsxs)("div",{ref:c,className:"nb-select-dropdown",style:{position:"fixed",top:m.top,left:m.left,minWidth:m.width,zIndex:9999},children:[(0,I.jsx)("input",{className:"nb-select-new-input",type:"text",placeholder:u("select_create_placeholder"),value:d,autoFocus:!0,onChange:j=>v(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),de(d))}}),V.map(j=>(0,I.jsxs)("div",{className:"nb-select-option-row",children:[(0,I.jsxs)("button",{className:`nb-select-option ${e.includes(j.value)?"nb-select-option--active":""}`,onClick:()=>Ne(j.value),children:[(0,I.jsx)("span",{className:`nb-checkbox-indicator ${e.includes(j.value)?"nb-checkbox-indicator--checked":""}`}),(0,I.jsx)("span",{className:"nb-select-badge",style:{background:Gt(V,j.value),color:wr(Gt(V,j.value))},children:j.value})]}),(0,I.jsx)("button",{className:`nb-status-color-swatch ${h===j.value?"nb-status-color-swatch--active":""}`,title:u("tooltip_change_color"),style:{background:Gt(V,j.value),color:wr(Gt(V,j.value))},onClick:ie=>{ie.stopPropagation();let _e=ie.currentTarget.getBoundingClientRect();f({top:_e.bottom+4,left:Math.min(_e.right-W,window.innerWidth-W-8)}),y(me=>me===j.value?null:j.value)}}),(0,I.jsx)("button",{className:"nb-select-option-delete",onClick:ie=>{Re(j.value,ie)},title:u("select_clear"),children:"\xD7"})]},j.value))]}),document.body):null,te=h&&_?(0,ao.createPortal)((0,I.jsxs)("div",{ref:p,className:"nb-status-color-picker",style:{position:"fixed",top:_.top,left:_.left,zIndex:1e4},children:[(0,I.jsx)("div",{className:"nb-status-color-grid",children:re.map(j=>(0,I.jsx)("button",{className:"nb-status-color-dot",style:{background:j},title:j,onClick:ie=>{ie.stopPropagation(),J(h,j)}},j))}),(0,I.jsx)("div",{className:"nb-status-color-custom",children:(0,I.jsxs)("label",{className:"nb-status-color-custom-label",children:[u("color_custom"),(0,I.jsx)("input",{type:"color",className:"nb-status-color-input",defaultValue:Gt(V,h),onChange:j=>{J(h,j.target.value)}})]})})]}),document.body):null;return(0,I.jsxs)("div",{className:"nb-cell-select-wrapper",ref:s,children:[(0,I.jsx)("div",{className:"nb-cell-clickable nb-cell-multiselect",onClick:o,children:e.length>0?e.map(j=>(0,I.jsx)("span",{className:"nb-select-badge",style:{background:Gt(V,j),color:wr(Gt(V,j))},children:j},j)):(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})}),Y,te]})}function yk({defaultValue:e,onChange:t,onEscape:n}){let[o,r]=(0,ge.useState)(e),i=a=>{let s=a.replace(/\D/g,"").slice(0,4);return s.length<=2?s:`${s.slice(0,2)}:${s.slice(2)}`},l=a=>{let s=a.match(/^(\d{1,2}):(\d{2})$/);if(!s)return;let c=Math.min(23,parseInt(s[1])),p=Math.min(59,parseInt(s[2])),m=`${String(c).padStart(2,"0")}:${String(p).padStart(2,"0")}`;r(m),t(m)};return(0,I.jsx)("input",{type:"text",inputMode:"numeric",className:"nb-cell-input nb-cell-input--time",value:o,placeholder:"HH:mm",onChange:a=>{let s=i(a.target.value);r(s),/^\d{2}:\d{2}$/.test(s)&&l(s)},onBlur:()=>l(o),onKeyDown:a=>{a.key==="Enter"&&l(o),a.key==="Escape"&&n()}})}function wk({value:e,isEditing:t,onStartEdit:n,onSave:o,onClose:r}){let i=(0,ge.useRef)(null),l=e?e.includes("T"):!1,a=e?e.split("T")[0]:null,s=e&&l?e.split("T")[1]:null,[c,p]=(0,ge.useState)(l);(0,ge.useEffect)(()=>{t&&p(l)},[t]),(0,ge.useEffect)(()=>{if(!t)return;let h=y=>{i.current&&!i.current.contains(y.target)&&r()};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[t,r]);let m=(()=>{if(!a)return null;let[h,y,_]=a.split("-"),f=new Date(+h,+y-1,+_).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric"});return l&&s?`${f} ${s}`:f})();if(!t)return(0,I.jsx)("div",{className:"nb-cell-clickable nb-cell-date",onClick:n,children:m??(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})});let g=h=>{if(!h){o(null);return}o(c&&s?`${h}T${s}`:c?`${h}T00:00`:h)},d=h=>{let y=a??new Date().toISOString().slice(0,10);o(h?`${y}T${h}`:y)},v=()=>{let h=!c;p(h),!h&&a?o(a):h&&a&&o(`${a}T${s??"00:00"}`)};return(0,I.jsxs)("div",{ref:i,className:"nb-cell-date-editor",children:[(0,I.jsx)("input",{type:"date",className:"nb-cell-input nb-cell-input--date",defaultValue:a??"",onChange:h=>g(h.target.value),onKeyDown:h=>{h.key==="Escape"&&r()}}),c&&(0,I.jsx)(yk,{defaultValue:s??"00:00",onChange:d,onEscape:r}),(0,I.jsx)("button",{className:`nb-cell-time-toggle${c?" nb-cell-time-toggle--active":""}`,onClick:h=>{h.stopPropagation(),v()},title:c?u("calendar_remove_time"):u("calendar_add_time"),children:"\u{1F550}"})]})}function Ck({value:e,onCommit:t}){return(0,I.jsx)("div",{className:"nb-cell-checkbox-wrapper",children:(0,I.jsx)("input",{type:"checkbox",className:"nb-cell-checkbox",checked:e,onChange:n=>t(n.target.checked)})})}function kk({value:e,col:t}){let n=e==null?"\u2014":String(e);return(0,I.jsx)("div",{className:"nb-cell-formula",title:u("formula_panel_title")+": "+(t.formula??""),children:n})}function Sk({value:e,col:t}){let n=e==null?"\u2014":String(e);return(0,I.jsx)("div",{className:"nb-cell-formula nb-cell-lookup",title:u("lookup_panel_title")+" de "+(t.refDatabasePath??""),children:n})}function Nk({value:e,col:t}){let n=e==null?"\u2014":String(e);return(0,I.jsx)("div",{className:"nb-cell-formula nb-cell-rollup",title:u("rollup_panel_title")+": "+(t.rollupFunction??""),children:n})}function xk({value:e,options:t,isEditing:n,onStartEdit:o,onCommit:r,onCancel:i}){let l=(0,ge.useRef)(null),a=(0,ge.useRef)(null),[s,c]=(0,ge.useState)(""),p=(0,ge.useRef)(null),[m,g]=(0,ge.useState)(null),[d,v]=(0,ge.useState)(e);(0,ge.useEffect)(()=>{v(e)},[e]),(0,ge.useEffect)(()=>{if(!n)return;let f=w=>{let R=l.current?.contains(w.target),P=a.current?.contains(w.target);!R&&!P&&r(d)};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[n,r,d]),(0,ge.useEffect)(()=>{if(n){if(c(""),v(e),l.current){let f=l.current.getBoundingClientRect();g({top:f.bottom,left:f.left,width:f.width})}setTimeout(()=>p.current?.focus(),0)}},[n]);let h=f=>{v(w=>w.includes(f)?w.filter(R=>R!==f):[...w,f])},y=t.filter(f=>f.toLowerCase().includes(s.toLowerCase())),_=n&&m?(0,ao.createPortal)((0,I.jsxs)("div",{ref:a,className:"nb-select-dropdown nb-relation-dropdown",style:{position:"fixed",top:m.top,left:m.left,minWidth:m.width,zIndex:9999},children:[(0,I.jsx)("input",{ref:p,className:"nb-relation-search",placeholder:u("relation_search_placeholder"),value:s,onChange:f=>c(f.target.value),onKeyDown:f=>{f.key==="Escape"&&r(d)}}),d.length>0&&(0,I.jsx)("button",{className:"nb-select-option nb-select-clear",onClick:()=>v([]),children:u("relation_clear")}),y.map(f=>(0,I.jsxs)("button",{className:`nb-select-option ${d.includes(f)?"nb-select-option--active":""}`,onClick:()=>h(f),children:[d.includes(f)&&(0,I.jsx)("span",{className:"nb-relation-check",children:"\u2713"}),(0,I.jsx)("span",{className:"nb-relation-badge",children:f})]},f)),y.length===0&&(0,I.jsx)("div",{className:"nb-relation-empty",children:u("relation_no_results")})]}),document.body):null;return(0,I.jsxs)("div",{className:"nb-cell-select-wrapper",ref:l,children:[(0,I.jsx)("div",{className:"nb-cell-clickable",onClick:o,children:e.length>0?(0,I.jsx)("span",{className:"nb-relation-badges",children:e.map(f=>(0,I.jsx)("span",{className:"nb-relation-badge",children:f},f))}):(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})}),_]})}var gv=new Set(["png","jpg","jpeg","gif","svg","webp","bmp"]);function Rk({col:e,value:t,isEditing:n,onStartEdit:o,onCommit:r,onCancel:i}){let l=Dt(),[a,s]=(0,ge.useState)([]),[c,p]=(0,ge.useState)(null),m=(0,ge.useRef)(null),g=(0,ge.useRef)(null);(0,ge.useEffect)(()=>{if(!n)return;let y=e.imageSourceFolder,_=l.vault.getFiles(),f=y?_.filter(w=>gv.has(w.extension.toLowerCase())&&(w.path.startsWith(y+"/")||w.parent?.path===y)):_.filter(w=>gv.has(w.extension.toLowerCase()));if(s(f.sort((w,R)=>w.name.localeCompare(R.name))),m.current){let w=m.current.getBoundingClientRect(),R=w.left,P=w.bottom+4;R+280>window.innerWidth&&(R=window.innerWidth-288),p({x:R,y:P})}},[n,e.imageSourceFolder]),(0,ge.useEffect)(()=>{if(!n)return;let y=_=>{g.current?.contains(_.target)||m.current?.contains(_.target)||i()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[n,i]);let d=t?l.vault.getFileByPath(t):null,v=d?l.vault.getResourcePath(d):null;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("div",{ref:m,className:"nb-cell-image",onClick:o,children:v?(0,I.jsxs)("div",{className:"nb-image-cell-content",children:[(0,I.jsx)("img",{src:v,alt:"",className:"nb-image-cell-thumb"}),(0,I.jsx)("a",{className:"nb-image-cell-link",onClick:y=>{y.stopPropagation(),d&&l.workspace.getLeaf(!0).openFile(d)},title:t??"",children:d?.name??t??""})]}):(0,I.jsx)("span",{className:"nb-cell-text nb-cell-placeholder",children:u("image_select_placeholder")})}),n&&c&&(0,ao.createPortal)((0,I.jsxs)("div",{ref:g,className:"nb-image-picker",style:{position:"fixed",top:c.y,left:c.x},children:[(0,I.jsxs)("div",{className:"nb-image-picker-header",children:[(0,I.jsx)("span",{children:u("image_picker_title")}),t&&(0,I.jsx)("button",{className:"nb-image-picker-clear",onClick:y=>{y.stopPropagation(),r(null)},children:u("image_picker_clear")})]}),a.length===0?(0,I.jsx)("div",{className:"nb-image-picker-empty",children:e.imageSourceFolder?`${u("image_picker_empty_folder")} "${e.imageSourceFolder}"`:u("image_picker_empty_vault")}):(0,I.jsx)("div",{className:"nb-image-picker-grid",children:a.map(y=>{let _=l.vault.getResourcePath(y);return(0,I.jsxs)("div",{className:`nb-image-picker-item${t===y.path?" nb-image-picker-item--selected":""}`,onClick:f=>{f.stopPropagation(),r(y.path)},title:y.path,children:[(0,I.jsx)("img",{src:_,alt:y.name,className:"nb-image-picker-thumb"}),(0,I.jsx)("span",{className:"nb-image-picker-name",children:y.name})]},y.path)})})]}),document.body)]})}var hv=new Set(["mp3","wav","ogg","flac","m4a","aac","webm"]);function Ek({col:e,value:t,isEditing:n,onStartEdit:o,onCommit:r,onCancel:i}){let l=Dt(),[a,s]=(0,ge.useState)([]),[c,p]=(0,ge.useState)(null),m=(0,ge.useRef)(null),g=(0,ge.useRef)(null);(0,ge.useEffect)(()=>{if(!n)return;let h=e.audioSourceFolder,y=l.vault.getFiles(),_=h?y.filter(f=>hv.has(f.extension.toLowerCase())&&(f.path.startsWith(h+"/")||f.parent?.path===h)):y.filter(f=>hv.has(f.extension.toLowerCase()));if(s(_.sort((f,w)=>f.name.localeCompare(w.name))),m.current){let f=m.current.getBoundingClientRect();p({top:f.bottom,left:f.left,width:f.width})}},[n,e.audioSourceFolder]),(0,ge.useEffect)(()=>{if(!n)return;let h=y=>{g.current?.contains(y.target)||m.current?.contains(y.target)||i()};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[n,i]);let d=t?l.vault.getFileByPath(t):null,v=d?l.vault.getResourcePath(d):null;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("div",{ref:m,className:"nb-cell-audio",onClick:o,children:v?(0,I.jsx)("audio",{controls:!0,preload:"metadata",src:v,className:"nb-audio-player",onClick:h=>h.stopPropagation()}):(0,I.jsx)("span",{className:"nb-cell-text nb-cell-placeholder",children:u("audio_select_placeholder")})}),n&&c&&(0,ao.createPortal)((0,I.jsxs)("div",{ref:g,className:"nb-select-dropdown",style:{position:"fixed",top:c.top,left:c.left,minWidth:c.width,zIndex:9999},children:[(0,I.jsx)("button",{className:"nb-select-option nb-select-clear",onClick:h=>{h.stopPropagation(),r(null)},children:u("audio_picker_clear")}),(0,I.jsx)("div",{className:"nb-menu-separator"}),a.length===0?(0,I.jsx)("div",{className:"nb-select-option",style:{color:"var(--text-muted)",cursor:"default"},children:e.audioSourceFolder?`${u("audio_picker_empty_folder")} "${e.audioSourceFolder}"`:u("audio_picker_empty_vault")}):a.map(h=>(0,I.jsxs)("button",{className:`nb-select-option${t===h.path?" nb-select-option--active":""}`,onClick:y=>{y.stopPropagation(),r(h.path)},children:[(0,I.jsx)("span",{children:"\u{1F3B5}"}),(0,I.jsx)("span",{children:h.name})]},h.path))]}),document.body)]})}var _v=new Set(["mp4","webm","ogv","mov","mkv"]);function Fk({col:e,value:t,isEditing:n,onStartEdit:o,onCommit:r,onCancel:i}){let l=Dt(),[a,s]=(0,ge.useState)([]),[c,p]=(0,ge.useState)(null),m=(0,ge.useRef)(null),g=(0,ge.useRef)(null);(0,ge.useEffect)(()=>{if(!n)return;let _=e.videoSourceFolder,f=l.vault.getFiles(),w=_?f.filter(R=>_v.has(R.extension.toLowerCase())&&(R.path.startsWith(_+"/")||R.parent?.path===_)):f.filter(R=>_v.has(R.extension.toLowerCase()));if(s(w.sort((R,P)=>R.name.localeCompare(P.name))),m.current){let R=m.current.getBoundingClientRect();p({top:R.bottom,left:R.left,width:R.width})}},[n,e.videoSourceFolder]),(0,ge.useEffect)(()=>{if(!n)return;let _=f=>{g.current?.contains(f.target)||m.current?.contains(f.target)||i()};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[n,i]);let[d,v]=(0,ge.useState)(!1),h=t?l.vault.getFileByPath(t):null,y=h?l.vault.getResourcePath(h):null;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("div",{ref:m,className:"nb-cell-video",onClick:o,children:h?(0,I.jsxs)("div",{className:"nb-video-cell-content",children:[(0,I.jsx)("span",{className:"nb-video-cell-icon",onClick:_=>{_.stopPropagation(),v(!0)},children:"\u25B6"}),(0,I.jsx)("a",{className:"nb-video-cell-link",onClick:_=>{_.stopPropagation(),v(!0)},title:t??"",children:h.name})]}):(0,I.jsx)("span",{className:"nb-cell-text nb-cell-placeholder",children:u("video_select_placeholder")})}),d&&y&&(0,ao.createPortal)((0,I.jsx)("div",{className:"nb-video-modal-backdrop",onClick:()=>v(!1),children:(0,I.jsxs)("div",{className:"nb-video-modal",onClick:_=>_.stopPropagation(),children:[(0,I.jsx)("video",{controls:!0,autoPlay:!0,src:y,className:"nb-video-modal-player"}),(0,I.jsx)("button",{className:"nb-video-modal-close",onClick:()=>v(!1),children:"\xD7"})]})}),document.body),n&&c&&(0,ao.createPortal)((0,I.jsxs)("div",{ref:g,className:"nb-select-dropdown",style:{position:"fixed",top:c.top,left:c.left,minWidth:c.width,zIndex:9999},children:[(0,I.jsx)("button",{className:"nb-select-option nb-select-clear",onClick:_=>{_.stopPropagation(),r(null)},children:u("video_picker_clear")}),(0,I.jsx)("div",{className:"nb-menu-separator"}),a.length===0?(0,I.jsx)("div",{className:"nb-select-option",style:{color:"var(--text-muted)",cursor:"default"},children:e.videoSourceFolder?`${u("video_picker_empty_folder")} "${e.videoSourceFolder}"`:u("video_picker_empty_vault")}):a.map(_=>(0,I.jsxs)("button",{className:`nb-select-option${t===_.path?" nb-select-option--active":""}`,onClick:f=>{f.stopPropagation(),r(_.path)},children:[(0,I.jsx)("span",{children:"\u{1F3AC}"}),(0,I.jsx)("span",{children:_.name})]},_.path))]}),document.body)]})}var wu=require("obsidian"),yu=class extends wu.FuzzySuggestModal{constructor(t,n){super(t),this.onChoose=n,this.setPlaceholder("Escolha uma pasta de destino...")}getItems(){return this.app.vault.getAllLoadedFiles().filter(t=>t instanceof wu.TFolder).sort((t,n)=>t.path.localeCompare(n.path))}getItemText(t){return t.path||"/"}onChooseItem(t){this.onChoose(t)}};var vv=require("obsidian");function In(){return vv.Platform.isMobile}var kr=ze(yt(),1),Zp=ze(vo(),1);var je=ze(Rt(),1),An=()=>(0,je.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,je.jsx)("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})}),so=()=>(0,je.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,je.jsx)("line",{x1:"4",y1:"6",x2:"16",y2:"6"}),(0,je.jsx)("line",{x1:"4",y1:"12",x2:"12",y2:"12"}),(0,je.jsx)("line",{x1:"4",y1:"18",x2:"8",y2:"18"})]}),mn=()=>(0,je.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,je.jsx)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,je.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}),bv=()=>(0,je.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,je.jsx)("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})}),On=()=>(0,je.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,je.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),(0,je.jsx)("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),(0,je.jsx)("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]});function $n({search:e,actions:t,rowCount:n,rowCountLabel:o,filters:r,onFilterUpdate:i,onFilterRemove:l,onConjunctionToggle:a,actionBarRef:s,children:c}){let p=(0,kr.useRef)(null),m=s??p,[g,d]=(0,kr.useState)(!1),v=(0,kr.useRef)(null);return(0,je.jsxs)("div",{className:"nb-mobile-toolbar",children:[e&&(0,je.jsx)("div",{className:"nb-mobile-search-strip",children:(0,je.jsxs)("div",{className:"nb-mobile-search-wrapper",onClick:()=>d(!0),children:[(0,je.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"nb-mobile-search-icon",children:[(0,je.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,je.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),(0,je.jsx)("div",{className:`nb-mobile-search-input nb-mobile-search-fake${e.value?" nb-mobile-search-fake--has-value":""}`,role:"button",tabIndex:-1,children:e.value||u("filter_value_placeholder").replace("...","")+"..."})]})}),e&&g&&(0,Zp.createPortal)((0,je.jsx)("div",{className:"nb-mobile-search-overlay",onMouseDown:()=>d(!1),children:(0,je.jsxs)("div",{className:"nb-mobile-search-overlay-bar",onMouseDown:h=>h.stopPropagation(),children:[(0,je.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"nb-mobile-search-overlay-icon",children:[(0,je.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,je.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),(0,je.jsx)("input",{ref:v,className:"nb-mobile-search-overlay-input",type:"text",placeholder:u("filter_value_placeholder").replace("...","")+"...",value:e.value,onChange:h=>e.onChange(h.target.value),onKeyDown:h=>{h.key==="Enter"&&(h.currentTarget.blur(),d(!1))},autoFocus:!0}),(0,je.jsx)("button",{className:"nb-mobile-search-overlay-close",onClick:()=>d(!1),children:"\xD7"})]})}),document.body),(0,je.jsx)("div",{className:"nb-mobile-action-bar",ref:m,children:t.map(h=>(0,je.jsxs)("button",{className:`nb-mobile-action-btn${h.active?" nb-mobile-action-btn--active":""}`,onMouseDown:y=>{y.stopPropagation(),y.nativeEvent.stopImmediatePropagation()},onClick:h.onClick,children:[h.icon,(0,je.jsx)("span",{className:"nb-mobile-action-label",children:h.label}),h.badge!=null&&h.badge>0&&(0,je.jsx)("span",{className:"nb-mobile-action-badge",children:h.badge})]},h.id))}),c,(0,je.jsx)(Dk,{filters:r,rowCount:n,rowCountLabel:o,onFilterUpdate:i,onFilterRemove:l,onConjunctionToggle:a})]})}function Dk({filters:e,rowCount:t,rowCountLabel:n,onFilterUpdate:o,onFilterRemove:r,onConjunctionToggle:i}){let[l,a]=(0,kr.useState)(null);return e.length===0&&t<0?null:(0,je.jsxs)(je.Fragment,{children:[(0,je.jsxs)("div",{className:"nb-mobile-pills-strip",children:[e.map((s,c)=>(0,je.jsxs)(kr.Fragment,{children:[c>0&&(0,je.jsx)("button",{className:`nb-pill-conjunction${s.conjunction==="or"?" nb-pill-conjunction--or":""}`,onClick:()=>i(s.id),children:s.conjunction==="or"?u("conjunction_or"):u("conjunction_and")}),(0,je.jsxs)("button",{className:`nb-filter-pill${l===s.id?" nb-filter-pill--expanded":""}`,onClick:()=>a(p=>p===s.id?null:s.id),children:[(0,je.jsx)("span",{className:"nb-pill-name",children:s.columnName}),(0,je.jsx)("span",{className:"nb-pill-remove",onClick:p=>{p.stopPropagation(),r(s.id)},children:"\xD7"})]})]},s.id)),(0,je.jsxs)("span",{className:"nb-mobile-row-count",children:[t," ",n]})]}),(()=>{let s=l?e.find(c=>c.id===l):null;return s?(0,Zp.createPortal)((0,je.jsx)("div",{className:"nb-mobile-search-overlay",onMouseDown:()=>a(null),children:(0,je.jsxs)("div",{className:"nb-mobile-search-overlay-bar nb-mobile-filter-overlay-bar",onMouseDown:c=>c.stopPropagation(),children:[(0,je.jsx)("span",{className:"nb-mobile-filter-overlay-title",children:s.columnName}),(0,je.jsx)("select",{className:"nb-mobile-filter-overlay-select",value:s.operator,onChange:c=>o(s.id,c.target.value,s.value),children:Dn(s.columnType).map(c=>(0,je.jsx)("option",{value:c,children:Mn[c]},c))}),!Cn.has(s.operator)&&(0,je.jsx)("input",{className:"nb-mobile-search-overlay-input",type:"text",value:s.value,placeholder:u("filter_value_placeholder"),onChange:c=>o(s.id,s.operator,c.target.value),autoFocus:!0}),(0,je.jsx)("button",{className:"nb-mobile-search-overlay-close",onClick:()=>a(null),children:"\xD7"})]})}),document.body):null})()]})}var Do=ze(yt(),1),yv=ze(vo(),1),ni=ze(Rt(),1);function ot({open:e,onClose:t,title:n,children:o}){let[r,i]=(0,Do.useState)(!1),[l,a]=(0,Do.useState)(!1),s=(0,Do.useRef)(null),[c,p]=(0,Do.useState)("70vh");return(0,Do.useEffect)(()=>{if(e){i(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>a(!0))});return}a(!1);let m=setTimeout(()=>i(!1),250);return()=>clearTimeout(m)},[e]),(0,Do.useEffect)(()=>{if(!e)return;let m=g=>{g.key==="Escape"&&t()};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[e,t]),(0,Do.useEffect)(()=>{if(!e||!window.visualViewport)return;let m=()=>{let g=window.visualViewport.height;p(`${g*.7}px`)};return m(),window.visualViewport.addEventListener("resize",m),()=>window.visualViewport.removeEventListener("resize",m)},[e]),r?(0,yv.createPortal)((0,ni.jsx)("div",{className:`nb-bottomsheet-backdrop${l?" nb-bottomsheet-backdrop--open":""}`,onMouseDown:t,children:(0,ni.jsxs)("div",{ref:s,className:`nb-bottomsheet${l?" nb-bottomsheet--open":""}`,style:{maxHeight:c},onMouseDown:m=>m.stopPropagation(),children:[(0,ni.jsx)("div",{className:"nb-bottomsheet-handle"}),n&&(0,ni.jsx)("div",{className:"nb-bottomsheet-title",children:n}),(0,ni.jsx)("div",{className:"nb-bottomsheet-content",children:o})]})}),document.body):null}var Mk=3;function Cu(e,t){return e.find(n=>n.type==="relation"&&n.isHierarchical&&n.refDatabasePath===t)??null}function Jp(e,t){let n=e[t];return n?Array.isArray(n)?n:[String(n)]:[]}function ku(e,t,n,o,r){let i=new Map,l=new Map,a=new Set;for(let d of e)i.set(d._title,d);for(let d of e){let v=Jp(d,t);for(let h of v)if(i.has(h)&&h!==d._title){let y=l.get(h)??[];y.push(d),l.set(h,y),a.add(d._file.path);break}}for(let d of e){if(!a.has(d._file.path))continue;let v=new Set,h=d._title;for(;h;){if(v.has(h)){a.delete(d._file.path);let f=Jp(d,t)[0];if(f){let w=l.get(f);if(w){let R=w.indexOf(d);R>=0&&w.splice(R,1),w.length===0&&l.delete(f)}}break}v.add(h);let y=i.get(h);if(!y||!a.has(y._file.path))break;h=Jp(y,t).find(f=>i.has(f)&&f!==y._title)??""}}let s=e.filter(d=>!a.has(d._file.path)),c=qn(s,n),p=[],m=new Set;function g(d,v,h){if(m.has(d._title))return;m.add(d._title);let y=l.get(d._title)??[],_=y.length>0;if(p.push({row:d,depth:v,hasChildren:_,parentTitle:h}),!_||v>=Mk||!(r?!o.has(d._file.path):o.has(d._file.path)))return;let w=qn(y,n);for(let R of w)g(R,v+1,d._title)}for(let d of c)g(d,0,null);return p}var k=ze(Rt(),1);function Tk(e,t){let[n,o]=(0,se.useState)({scrollTop:0,viewportHeight:800}),r=(0,se.useRef)(null);(0,se.useEffect)(()=>{let s=e.current;if(!s)return;let c=()=>o({scrollTop:s.scrollTop,viewportHeight:s.clientHeight});c();let p=()=>{r.current||(r.current=setTimeout(()=>{r.current=null,c()},32))};s.addEventListener("scroll",p,{passive:!0});let m=new ResizeObserver(c);return m.observe(s),()=>{s.removeEventListener("scroll",p),m.disconnect(),r.current&&clearTimeout(r.current)}},[e]);let i=20,l=Math.max(0,Math.floor(n.scrollTop/t)-i),a=Math.ceil((n.scrollTop+n.viewportHeight)/t)+i;return{startIdx:l,endIdx:a,topPad:l*t}}function Lk({scrollRef:e,rowHeight:t,rows:n,stickyMap:o,isMobile:r,setEditingCell:i,setContextMenuFile:l,longPressRef:a,columns:s,onAddRow:c,hierarchyMap:p,onToggleExpand:m,onAddSubRow:g,expandedSet:d,allExpanded:v,rowDragEnabled:h,dragOverPath:y,onRowDragStart:_,onRowDragOver:f,onRowDragEnd:w,onRowDrop:R}){let{startIdx:P,endIdx:L,topPad:V}=Tk(e,t),W=n.slice(P,Math.min(n.length,L)),re=Math.max(0,(n.length-Math.min(n.length,L))*t);return(0,k.jsxs)("tbody",{className:"nb-tbody",children:[n.length===0?(0,k.jsx)("tr",{children:(0,k.jsx)("td",{colSpan:s.length+1,className:"nb-empty-rows",children:u("no_results")})}):(0,k.jsxs)(k.Fragment,{children:[V>0&&(0,k.jsx)("tr",{style:{height:V}}),W.map(J=>{let ue=J.original._file.path;return(0,k.jsxs)("tr",{className:`nb-row${y===ue?" nb-row--drag-over":""}`,onClick:()=>i(null),onContextMenu:de=>{de.preventDefault(),l(J.original._file)},onTouchStart:r?()=>{a.current=setTimeout(()=>l(J.original._file),500)}:void 0,onTouchMove:r?()=>{a.current&&(clearTimeout(a.current),a.current=null)}:void 0,onTouchEnd:r?()=>{a.current&&(clearTimeout(a.current),a.current=null)}:void 0,onDragOver:h?de=>{de.preventDefault(),f?.(ue)}:void 0,onDrop:h?de=>{de.preventDefault(),R?.(ue)}:void 0,children:[J.getVisibleCells().map(de=>{let Re=o.get(de.column.id),Y=p?.get(J.original._file.path),te=de.column.id==="_title"&&Y,j=Y?.depth??0,ie=v?!d?.has(J.original._file.path):!!d?.has(J.original._file.path),_e=de.column.id==="_select";return(0,k.jsx)("td",{"data-col-id":de.column.id,className:["nb-td",Re?"nb-td--sticky":"",Re?.isLast?"nb-td--sticky-last":""].filter(Boolean).join(" "),style:{width:de.column.getSize(),...Re?{left:Re.left,zIndex:1}:{}},onClick:me=>me.stopPropagation(),children:_e&&h?(0,k.jsxs)("div",{className:"nb-td-inner nb-td-inner--drag",children:[(0,k.jsx)("span",{className:"nb-row-drag-handle",draggable:!0,onDragStart:me=>{me.dataTransfer.effectAllowed="move",me.dataTransfer.setData("text/plain",ue),_?.(ue)},onDragEnd:()=>w?.(),children:"\u283F"}),Vi(de.column.columnDef.cell,de.getContext())]}):te?(0,k.jsxs)("div",{className:"nb-td-inner nb-hierarchy-cell",style:{paddingLeft:j*20},children:[Y.hasChildren?(0,k.jsx)("button",{className:"nb-hierarchy-toggle",onClick:me=>{me.stopPropagation(),m?.(J.original._file.path)},children:ie?"\u25BC":"\u25B6"}):(0,k.jsx)("span",{className:"nb-hierarchy-toggle-spacer"}),(0,k.jsx)("span",{style:{flex:1},children:Vi(de.column.columnDef.cell,de.getContext())}),!r&&j<3&&(0,k.jsx)("button",{className:"nb-add-subrow-btn",onClick:me=>{me.stopPropagation(),g?.(J.original._title)},title:u("add_subrow"),children:"+"})]}):(0,k.jsx)("div",{className:"nb-td-inner",children:Vi(de.column.columnDef.cell,de.getContext())})},de.id)}),(0,k.jsx)("td",{className:"nb-td nb-td-empty"})]},J.id)}),re>0&&(0,k.jsx)("tr",{style:{height:re}})]}),(0,k.jsx)("tr",{children:(0,k.jsx)("td",{colSpan:s.length+1,className:"nb-add-row-td",children:(0,k.jsx)("button",{className:"nb-add-row-btn",onClick:c,children:"+ "+u("add_row")})})})]})}function Pk(e,t,n,o){if(n===o)return null;let r=["formula","lookup","relation"];if(r.includes(o)||r.includes(n))return null;let i=e.map(l=>l[t]).filter(l=>l!=null&&l!=="");if(o==="number"){let l=i.filter(a=>{let s=String(a).trim();return s!==""&&(isNaN(Number(s))||!isFinite(Number(s)))});if(l.length>0)return`${l.length} ${u("validate_non_numeric")}${String(l[0])}"`}if(o==="date"){let l=i.filter(a=>{let s=String(a).trim();return s!==""&&isNaN(new Date(s).getTime())});if(l.length>0)return`${l.length} ${u("validate_invalid_dates")}${String(l[0])}"`}if(o==="checkbox"){let l=new Set(["true","false","1","0","yes","no","sim","n\xE3o","nao"]),a=i.filter(s=>typeof s=="boolean"?!1:!l.has(String(s).toLowerCase().trim()));if(a.length>0)return`${a.length} ${u("validate_invalid_checkbox")}${String(a[0])}"`}if(n==="multiselect"&&o==="select"){let l=i.filter(a=>Array.isArray(a)&&a.length>1);if(l.length>0)return`${l.length} ${u("validate_multiselect_to_select")}`}if(o==="email"){let l=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,a=i.filter(s=>{let c=String(s).trim();return c!==""&&!l.test(c)});if(a.length>0)return`${a.length} ${u("validate_invalid_email")}${String(a[0])}"`}if(o==="url"){let l=i.filter(a=>{let s=String(a).trim();try{return new URL(s),!1}catch{return!0}});if(l.length>0)return`${l.length} ${u("validate_invalid_url")}${String(l[0])}"`}if(o==="phone"){let l=/^[\d\s()\-+]+$/,a=i.filter(s=>{let c=String(s).trim();return c!==""&&!l.test(c)});if(a.length>0)return`${a.length} ${u("validate_invalid_phone")}${String(a[0])}"`}return null}function Ik(e){return{title:"\u{1F4C4}",text:"Aa",number:"#",select:"\u25C9",multiselect:"\u25C8",date:"\u{1F4C5}",checkbox:"\u2611",formula:"\u0192",relation:"\u{1F517}",lookup:"\u2197"}[e]??"\xB7"}var Ak=["contains","not_contains","starts_with","ends_with","is","is_not","is_empty","is_not_empty"],Ok=["is","is_not","gt","gte","lt","lte","is_empty","is_not_empty"],$k=["is","is_not","gt","gte","lt","lte","is_empty","is_not_empty"],em=["is","is_not","is_empty","is_not_empty"],zk=["is_checked","is_unchecked","is_empty","is_not_empty"];function Vk(e){switch(e){case"number":return Ok;case"date":return $k;case"select":return em;case"multiselect":return em;case"status":return em;case"checkbox":return zk;default:return Ak}}function Bk(e){switch(e){case"number":case"date":return"is";case"checkbox":return"is_checked";case"select":case"multiselect":case"status":return"is";default:return"contains"}}var wv=new Proxy({},{get:(e,t)=>({is:u("op_is"),is_not:u("op_is_not"),contains:u("op_contains"),not_contains:u("op_not_contains"),starts_with:u("op_starts_with"),ends_with:u("op_ends_with"),gt:u("op_gt"),gte:u("op_gte"),lt:u("op_lt"),lte:u("op_lte"),is_checked:u("op_is_checked"),is_unchecked:u("op_is_unchecked"),is_empty:u("op_is_empty"),is_not_empty:u("op_is_not_empty")})[t]??t}),kv=new Set(["is_empty","is_not_empty","is_checked","is_unchecked"]);function jk(e,t){if(!kv.has(t.operator)&&t.value==="")return!0;let o=t.columnId==="_title"?e._title:e[t.columnId];if(t.operator==="is_empty")return o==null||String(o??"").trim()==="";if(t.operator==="is_not_empty")return o!=null&&String(o??"").trim()!=="";if(t.operator==="is_checked")return o===!0||o==="true";if(t.operator==="is_unchecked")return o!==!0&&o!=="true";if(t.columnType==="number"){let l=parseFloat(String(o??"")),a=parseFloat(t.value);if(isNaN(l)||isNaN(a))return!1;switch(t.operator){case"is":return l===a;case"is_not":return l!==a;case"gt":return l>a;case"gte":return l>=a;case"lt":return l<a;case"lte":return l<=a;default:return!0}}if(t.columnType==="date"){let l=new Date(String(o??"")).getTime(),a=new Date(t.value).getTime();if(isNaN(l)||isNaN(a))return!1;switch(t.operator){case"is":return l===a;case"is_not":return l!==a;case"gt":return l>a;case"gte":return l>=a;case"lt":return l<a;case"lte":return l<=a;default:return!0}}if(gu(t)){let l=ca(t.value).map(s=>s.toLowerCase());if(l.length===0)return!0;let a=Array.isArray(o)?o.map(s=>s.toLowerCase()):[String(o??"").toLowerCase()];return t.operator==="is"?a.some(s=>l.includes(s)):a.every(s=>!l.includes(s))}let r=Array.isArray(o)?o.join(", ").toLowerCase():String(o??"").toLowerCase(),i=t.value.toLowerCase();switch(t.operator){case"is":return r===i;case"is_not":return r!==i;case"contains":return r.includes(i);case"not_contains":return!r.includes(i);case"starts_with":return r.startsWith(i);case"ends_with":return r.endsWith(i);default:return!0}}function Hk(e){switch(e){case"number":return"basic";case"date":return(t,n,o)=>{let r=new Date(String(t.getValue(o)??"")).getTime()||0,i=new Date(String(n.getValue(o)??"")).getTime()||0;return r-i};case"checkbox":return(t,n,o)=>{let r=t.getValue(o)?1:0,i=n.getValue(o)?1:0;return r-i};default:return"text"}}function Uk({sorts:e,schema:t,onSortChange:n,onClose:o,anchorRect:r,panelRef:i}){let[l,a]=(0,se.useState)(()=>({x:r.right-280,y:r.bottom+4})),s=y=>{y.preventDefault();let _=y.clientX-l.x,f=y.clientY-l.y,w=P=>a({x:P.clientX-_,y:P.clientY-f}),R=()=>{window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",R)};window.addEventListener("mousemove",w),window.addEventListener("mouseup",R)},c=t.filter(y=>y.type!=="formula"&&y.type!=="lookup"&&y.type!=="relation"&&y.type!=="multiselect"),p=new Set(e.map(y=>y.columnId)),m=[...p.has("_title")?[]:[{id:"_title",name:"Nome"}],...c.filter(y=>!p.has(y.id)).map(y=>({id:y.id,name:y.name}))],g=(y,_)=>{let f=[...e],w=y+_;w<0||w>=f.length||([f[y],f[w]]=[f[w],f[y]],n(f))},d=y=>{n(e.map(_=>_.columnId===y?{..._,direction:_.direction==="asc"?"desc":"asc"}:_))},v=y=>{n(e.filter(_=>_.columnId!==y))},h=y=>{y&&n([...e,{columnId:y,direction:"asc"}])};return(0,Su.createPortal)((0,k.jsxs)("div",{ref:i,className:"nb-sort-panel",style:{position:"fixed",top:l.y,left:l.x},children:[(0,k.jsxs)("div",{className:"nb-sort-panel-titlebar",onMouseDown:s,children:[(0,k.jsx)("span",{className:"nb-sort-panel-title",children:u("sort_by")}),(0,k.jsx)("button",{className:"nb-sort-panel-close",onClick:o,title:u("tooltip_close"),children:"\xD7"})]}),e.length===0&&(0,k.jsx)("div",{className:"nb-sort-panel-empty",children:u("no_active_sorts")}),e.map((y,_)=>{let f=y.columnId==="_title"?"Nome":t.find(w=>w.id===y.columnId)?.name??y.columnId;return(0,k.jsxs)("div",{className:"nb-sort-row",children:[(0,k.jsxs)("div",{className:"nb-sort-row-priority",children:[(0,k.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>g(_,-1),disabled:_===0,title:u("tooltip_move_up"),children:"\u2191"}),(0,k.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>g(_,1),disabled:_===e.length-1,title:u("tooltip_move_down"),children:"\u2193"})]}),(0,k.jsx)("span",{className:"nb-sort-row-name",children:f}),(0,k.jsx)("button",{className:"nb-sort-dir-btn",onClick:()=>d(y.columnId),children:y.direction==="asc"?u("sort_asc"):u("sort_desc")}),(0,k.jsx)("button",{className:"nb-sort-remove-btn",onClick:()=>v(y.columnId),title:u("tooltip_remove"),children:"\xD7"})]},y.columnId)}),m.length>0&&(0,k.jsx)("div",{className:"nb-sort-add-row",children:(0,k.jsxs)("select",{className:"nb-sort-add-select",value:"",onChange:y=>{h(y.target.value),y.target.value=""},children:[(0,k.jsx)("option",{value:"",children:"+ "+u("add_sort")+"..."}),m.map(y=>(0,k.jsx)("option",{value:y.id,children:y.name},y.id))]})})]}),document.body)}function Sv({onResize:e,onAutoFit:t}){return(0,k.jsx)("div",{className:"nb-col-resizer",onMouseDown:o=>{o.preventDefault(),o.stopPropagation();let r=o.currentTarget.closest("th");if(!r)return;let i=o.clientX,l=r.offsetWidth,a=l,s=p=>{a=Math.max(50,l+(p.clientX-i)),r.style.width=a+"px"},c=()=>{window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",c),e(a)};window.addEventListener("mousemove",s),window.addEventListener("mouseup",c)},onDoubleClick:o=>{o.stopPropagation(),t?.()},title:u("tooltip_resize_column")})}function Wk({id:e,size:t,children:n,stickyLeft:o,isLastPinned:r,isPinned:i,onTogglePin:l,sorted:a,onToggleSort:s,onResize:c,onAutoFit:p}){let{attributes:m,listeners:g,setNodeRef:d,setActivatorNodeRef:v,transform:h,transition:y,isDragging:_}=Wp({id:e}),f=o!==void 0;return(0,k.jsxs)("th",{ref:d,"data-col-id":e,className:["nb-th",_?"nb-th--dragging":"",f?"nb-th--sticky":"",r?"nb-th--sticky-last":""].filter(Boolean).join(" "),style:{width:t,transform:Ko.Transform.toString(h),transition:y,zIndex:_?10:f?3:void 0,...f?{left:o}:{}},children:[(0,k.jsxs)("div",{className:"nb-th-inner",children:[(0,k.jsx)("span",{ref:v,...g,...m,className:"nb-col-drag-handle",title:"Arrastar para reordenar",children:"\u283F"}),n,s&&(0,k.jsxs)("button",{className:a?"nb-sort-btn nb-sort-btn--sorted":"nb-sort-btn",onClick:w=>{w.stopPropagation(),s()},title:a==="asc"?u("sort_asc_title"):a==="desc"?u("sort_desc_title"):u("sort_none_title"),children:[(0,k.jsx)("span",{className:a==="asc"?"nb-sort-chevron--active":"nb-sort-chevron",children:"\u2303"}),(0,k.jsx)("span",{className:a==="desc"?"nb-sort-chevron--active":"nb-sort-chevron",children:"\u2304"})]}),(0,k.jsx)("span",{className:"nb-col-drag-spacer","aria-hidden":"true"}),l&&(0,k.jsx)("button",{className:`nb-pin-btn${i?" nb-pin-btn--active":""}`,onClick:w=>{w.stopPropagation(),l()},title:i?u("tooltip_unpin_column"):u("tooltip_pin_column"),children:"\u{1F4CC}"})]}),c&&(0,k.jsx)(Sv,{onResize:c,onAutoFit:p})]})}function Gk({filter:e,isActive:t,onToggle:n,onRemove:o,btnRef:r}){let{attributes:i,listeners:l,setNodeRef:a,setActivatorNodeRef:s,transform:c,transition:p,isDragging:m}=Wp({id:e.id});return(0,k.jsxs)("div",{ref:a,style:{transform:Ko.Transform.toString(c),transition:p,opacity:m?.4:1},className:"nb-filter-pill-sortable",children:[(0,k.jsx)("span",{ref:s,...l,...i,className:"nb-pill-drag-handle",title:"Arrastar para reordenar",children:(0,k.jsxs)("svg",{width:"8",height:"14",viewBox:"0 0 8 14",fill:"currentColor",children:[(0,k.jsx)("circle",{cx:"2",cy:"2.5",r:"1.2"}),(0,k.jsx)("circle",{cx:"6",cy:"2.5",r:"1.2"}),(0,k.jsx)("circle",{cx:"2",cy:"7",r:"1.2"}),(0,k.jsx)("circle",{cx:"6",cy:"7",r:"1.2"}),(0,k.jsx)("circle",{cx:"2",cy:"11.5",r:"1.2"}),(0,k.jsx)("circle",{cx:"6",cy:"11.5",r:"1.2"})]})}),(0,k.jsxs)("button",{ref:r,className:`nb-filter-pill ${t?"nb-filter-pill--active":""}`,onClick:n,children:[(0,k.jsx)("span",{className:"nb-filter-pill-icon",children:e.icon}),(0,k.jsx)("span",{className:"nb-filter-pill-name",children:e.columnName}),(0,k.jsx)("span",{className:"nb-filter-pill-remove",onClick:g=>{g.stopPropagation(),o()},title:u("tooltip_remove_filter"),children:"\xD7"})]})]})}var qk=["number","formula"];function Kk({colType:e,current:t,onSelect:n,anchorEl:o}){let r=o?.getBoundingClientRect(),i=r?r.bottom+window.scrollY:0,l=r?r.left+window.scrollX:0,a=qk.includes(e),s=[{type:"none",label:u("agg_none")},{type:"count",label:u("agg_count")},{type:"count_values",label:u("agg_count_values")},{type:"sum",label:u("agg_sum"),numericOnly:!0},{type:"avg",label:u("agg_avg"),numericOnly:!0},{type:"min",label:u("agg_min"),numericOnly:!0},{type:"max",label:u("agg_max"),numericOnly:!0}];return(0,k.jsx)("div",{className:"nb-agg-dropdown",style:{position:"absolute",top:i,left:l,zIndex:9999},children:s.filter(c=>!c.numericOnly||a).map(c=>(0,k.jsx)("button",{className:`nb-menu-item ${t===c.type?"nb-menu-item--active":""}`,onClick:()=>n(c.type),children:c.label},c.type))})}function tm({dbFile:e,manager:t,externalView:n,onViewChange:o}){let r=Dt(),i=(0,se.useRef)(null),[l,a]=(0,se.useState)(new Map),[s,c]=(0,se.useState)(null),p=(0,se.useCallback)((b,x)=>{if(i.current){let z=x.findIndex(pe=>pe._file.path===i.current);z!==-1&&x.push(...x.splice(z,1)),i.current=null}let E=new Map;for(let z of b.schema.filter(pe=>pe.type==="relation"&&pe.refDatabasePath)){let pe=r.vault.getFileByPath(z.refDatabasePath);if(!pe)continue;let Ue=t.getNotesInDatabase(pe),dt=new Set;for(let Sn of Ue){let Vt=Sn.basename.trim();Vt&&dt.add(Vt)}E.set(z.id,Array.from(dt).sort())}a(E),c((n??b.views[0])?.pinnedColumnId??null)},[r,t,n]),{rows:m,config:g,loading:d,activeFilters:v,setActiveFilters:h}=Ln({app:r,dbFile:e,manager:t,includeSubfolders:n?.includeSubfolders,externalView:n??Wn,onLoaded:p}),[y,_]=(0,se.useState)([]),[f,w]=(0,se.useState)(hr);(0,se.useEffect)(()=>{_(m)},[m]),(0,se.useEffect)(()=>{w(g)},[g]);let[R,P]=(0,se.useState)([]),[L,V]=(0,se.useState)(!1),W=(0,se.useRef)(null),[re,J]=(0,se.useState)(null),ue=(0,se.useRef)(null),[Ne,de]=(0,se.useState)(""),Re=Pn(Ne,200),[Y,te]=(0,se.useState)(null),[j,ie]=(0,se.useState)(!1),_e=(0,se.useRef)(null),[me,Ae]=(0,se.useState)({}),[Ee,xe]=(0,se.useState)(!1),[Fe,Ie]=(0,se.useState)(null),Ve=(0,se.useRef)(null),[He,Ye]=(0,se.useState)(!1),[Ze,De]=(0,se.useState)(null),q=(0,se.useRef)(null),ce=(0,se.useRef)(null),$=(0,se.useRef)(null),oe=(0,se.useRef)(null),ve=(0,se.useRef)(null),S=(0,se.useRef)(null),[K,D]=(0,se.useState)(!1),Z=(0,se.useRef)(null),[ke,ye]=(0,se.useState)(null),ft=(0,se.useRef)({}),Jt=(0,se.useRef)(null),[vt,Mt]=(0,se.useState)(null),[Et,bt]=(0,se.useState)(null),$t=(0,se.useRef)({}),[it,en]=(0,se.useState)(!1),M=(0,se.useRef)(null),Ce=(0,se.useRef)(null),[C,X]=(0,se.useState)(new Set),[H]=(0,se.useState)(!0),[ae,le]=(0,se.useState)(null),[we,N]=(0,se.useState)(null),be=I_(Vp(Wi,{activationConstraint:{distance:8}}),Vp(aa,{activationConstraint:{delay:200,tolerance:5}})),[Me,Se]=(0,se.useState)(n);(0,se.useEffect)(()=>{n&&Se(n)},[n?.id]);let U=(n?Me:void 0)??f.views[0]??Wn;(0,se.useEffect)(()=>{P(U.sorts.map(b=>({id:b.columnId,desc:b.direction==="desc"})))},[U.id]);let Le=(0,se.useMemo)(()=>{let b=n?U.columnOrder:void 0;if(!b||b.length===0)return f.schema;let x=new Map(f.schema.map(pe=>[pe.id,pe])),E=b.flatMap(pe=>x.has(pe)?[x.get(pe)]:[]),z=f.schema.filter(pe=>!b.includes(pe.id));return[...E,...z]},[n,U.columnOrder,f.schema]),Pe=(0,se.useCallback)(async b=>{if(o)Se(b),await o(b);else{if(!e)return;let x={...f,views:f.views.map((E,z)=>z===0?b:E)};w(x),await t.writeConfig(e,x)}},[o,f,e,t]),Oe=(0,se.useRef)(y),$e=(0,se.useCallback)(async(b,x,E)=>{let z=Oe.current[b];if(z)if(_(pe=>pe.map(Ue=>Ue._file.path===z._file.path?{...Ue,[x]:E}:Ue)),x==="_title")await t.renameNote(z._file,String(E));else{await t.updateNoteField(z._file,x,E,z._inlineFields);let pe=f.schema.find(Ue=>Ue.id===x);if(pe?.type==="relation"&&pe.pairedColumnId){let Ue=z[x],dt=Array.isArray(Ue)?Ue.map(Vt=>`${Vt}`):typeof Ue=="string"&&Ue!==""?[Ue]:[],Sn=Array.isArray(E)?E.map(Vt=>`${Vt}`):typeof E=="string"&&E!==""?[E]:[];await t.syncTwoWayRelation(z._file,pe,dt,Sn)}}},[t,f.schema]),Xe=(0,se.useCallback)(async b=>{if(!e)return;let x={...f,schema:b};w(x),await t.writeConfig(e,x)},[e,f,t]),ut=(0,se.useCallback)((b,x)=>{let E=f.schema.find(pe=>pe.id===b);if(!E)return!0;let z=Pk(y,b,E.type,x);return z?(new Cv.Notice(`${u("validate_type_change_prefix")}${z}`,6e3),!1):!0},[f.schema,y]),ct=(0,se.useCallback)(async b=>{let x=s===b?null:b;c(x),await Pe({...U,pinnedColumnId:x})},[s,Pe,U]),gt=(0,se.useCallback)(async b=>{P(b.map(x=>({id:x.columnId,desc:x.direction==="desc"}))),await Pe({...U,sorts:b})},[U,Pe]),It=(0,se.useCallback)(b=>{let x=U.sorts.find(z=>z.columnId===b),E;x?x.direction==="asc"?E=U.sorts.map(z=>z.columnId===b?{...z,direction:"desc"}:z):E=U.sorts.filter(z=>z.columnId!==b):E=[...U.sorts,{columnId:b,direction:"asc"}],gt(E)},[U.sorts,gt]),At=(0,se.useCallback)(async(b,x)=>{await Pe({...U,columnWidths:{...U.columnWidths,[b]:x}})},[U,Pe]),zt=(0,se.useCallback)(async b=>{let x=ve.current;if(!x)return;let E=60;x.querySelectorAll(`[data-col-id="${b}"]`).forEach(z=>{E=Math.max(E,z.scrollWidth)}),await At(b,E+16)},[At]),tn=(0,se.useMemo)(()=>{let b=new Map,x=40,E=U.columnWidths._title??260;if(b.set("_select",{left:0,isLast:!1}),!s||(b.set("_title",{left:x,isLast:s==="_title"}),s==="_title"))return b;let z=x+E;for(let pe of f.schema.filter(Ue=>Ue.visible)){let Ue=U.columnWidths[pe.id]??pe.width??150;if(b.set(pe.id,{left:z,isLast:pe.id===s}),z+=Ue,pe.id===s)break}return b},[s,f]),fn=(0,se.useCallback)(async(b,x)=>{if(!e)return;let E=await t.renameColumn(e,f,b,x);w(E)},[e,f,t]),gn=(0,se.useMemo)(()=>{let b=[];if(b.push({id:"_select",size:40,enableSorting:!1,enableColumnFilter:!1,header:()=>null,cell:({row:E})=>(0,k.jsx)("div",{className:"nb-cell-checkbox-wrapper",onClick:E.getToggleSelectedHandler(),children:(0,k.jsx)("div",{className:`nb-cell-checkbox-custom${E.getIsSelected()?" nb-cell-checkbox-custom--checked":""}`,children:E.getIsSelected()&&(0,k.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",className:"nb-cell-check-icon",children:(0,k.jsx)("polyline",{points:"20 6 9 17 4 12"})})})})}),U.includeSubfolders&&!U.hiddenColumns.includes("_folder")){let E=e?.parent?.path??"",z=E.split("/").pop()||E||"";b.push({id:"_folder",accessorFn:pe=>{let Ue=pe._file.parent?.path??"";return Ue.length>E.length?Ue.slice(E.length+1):z},size:U.columnWidths._folder??150,enableColumnFilter:!0,enableSorting:!0,sortingFn:"text",header:()=>(0,k.jsx)("div",{className:"nb-header-title",children:(0,k.jsx)("span",{children:u("folder_column")})}),cell:pe=>(0,k.jsxs)("span",{className:"nb-folder-path nb-folder-path--cell",children:[pe.getValue(),"/"]})})}b.push({id:"_title",accessorFn:E=>E._title,size:U.columnWidths._title??260,enableColumnFilter:!0,enableSorting:!0,sortingFn:"text",header:({column:E})=>{let z=E.getIsSorted();return(0,k.jsxs)("div",{className:"nb-header-title",children:[(0,k.jsx)("span",{children:"\u{1F4C4}"}),(0,k.jsx)("span",{children:u("name_column")}),(0,k.jsxs)("button",{className:`nb-sort-btn ${z?"nb-sort-btn--sorted":""}`,onClick:pe=>{pe.stopPropagation(),It("_title")},title:z==="asc"?u("sort_asc_title"):z==="desc"?u("sort_desc_title"):u("sort_none_title"),children:[(0,k.jsx)("span",{className:z==="asc"?"nb-sort-chevron--active":"nb-sort-chevron",children:"\u2303"}),(0,k.jsx)("span",{className:z==="desc"?"nb-sort-chevron--active":"nb-sort-chevron",children:"\u2304"})]})]})},cell:E=>{let z=e?.parent?.path??"",pe=E.row.original._file.parent?.path??"",Ue=U.includeSubfolders&&pe.length>z.length?pe.slice(z.length+1):"";return(0,k.jsxs)("div",{children:[(0,k.jsx)(Qp,{col:{id:"_title",name:"Nome",type:"title",visible:!0},value:E.getValue(),rowIndex:E.row.index,columnId:"_title",file:E.row.original._file}),Ue&&(0,k.jsx)("div",{className:"nb-folder-path",children:Ue})]})}});let x=Le.filter(E=>E.visible&&!U.hiddenColumns.includes(E.id));for(let E of x)b.push({id:E.id,accessorFn:z=>z[E.id],size:U.columnWidths[E.id]??E.width??150,enableColumnFilter:E.type!=="formula"&&E.type!=="lookup"&&E.type!=="relation",enableSorting:E.type!=="formula"&&E.type!=="lookup"&&E.type!=="relation"&&E.type!=="multiselect",sortingFn:Hk(E.type),header:()=>(0,k.jsx)(pv,{col:E,schema:f.schema,onUpdateSchema:Xe,onRenameColumn:fn,onChangeType:z=>ut(E.id,z),manager:t,dbFile:e}),cell:z=>(0,k.jsx)(Qp,{col:E,value:z.getValue(),rowIndex:z.row.index,columnId:E.id})});return b},[f,Le,U,Xe,fn,ut,t,e]),ln=(0,se.useMemo)(()=>{if(v.length===0)return y;let b=[],x=[];for(let E of v)E.conjunction==="or"&&x.length>0&&(b.push(x),x=[]),x.push(E);return x.length>0&&b.push(x),y.filter(E=>b.some(z=>z.every(pe=>jk(E,pe))))},[y,v]),kn=(0,se.useMemo)(()=>Cu(f.schema,e?.path??""),[f.schema,e?.path]),To=(0,se.useMemo)(()=>kn?ku(ln,kn.id,U.sorts,C,H):null,[ln,kn,U.sorts,C,H]),xr=!kn&&R.length===0&&(U.rowOrder?.length??0)>0,wo=(0,se.useMemo)(()=>To?To.map(b=>b.row):xr?av(ln,U.rowOrder):ln,[To,ln,xr,U.rowOrder]),fa=(0,se.useMemo)(()=>{if(!To)return null;let b=new Map;for(let x of To)b.set(x.row._file.path,x);return b},[To]);Oe.current=wo;let kt=f_({data:wo,columns:gn,state:{sorting:R,globalFilter:Re,rowSelection:me},onSortingChange:P,onGlobalFilterChange:de,onRowSelectionChange:Ae,enableRowSelection:!0,getCoreRowModel:d_(),getSortedRowModel:kn||xr?void 0:m_(),getFilteredRowModel:p_(),manualSorting:!!kn||xr,meta:{updateCell:$e,editingCell:Y,setEditingCell:te,schema:f.schema}}),Pu=!kn&&R.length===0,Iu=(0,se.useCallback)(b=>{le(b)},[]),ga=(0,se.useCallback)(b=>{N(b)},[]),Au=(0,se.useCallback)(()=>{le(null),N(null)},[]),Ou=(0,se.useCallback)(b=>{if(!ae||ae===b){le(null),N(null);return}let x=wo.map(dt=>dt._file.path),E=x.indexOf(ae),z=x.indexOf(b);if(E===-1||z===-1)return;let pe=[...x],[Ue]=pe.splice(E,1);pe.splice(z,0,Ue),Pe({...U,rowOrder:pe}),le(null),N(null)},[ae,wo,U,Pe]),ha=async()=>{if(!e)return;let b=await t.createNote(e);i.current=b.path},_a=(0,se.useCallback)(async b=>{if(!e||!kn)return;let x=await t.createNote(e,{[kn.id]:[b]});i.current=x.path},[e,kn,t]),Yn=(0,se.useCallback)(b=>{X(x=>{let E=new Set(x);return E.has(b)?E.delete(b):E.add(b),E})},[]);(0,se.useEffect)(()=>{if(!j)return;let b=x=>{oe.current?.contains(x.target)||_e.current&&!_e.current.contains(x.target)&&ie(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[j]),(0,se.useEffect)(()=>{if(!Ee)return;let b=x=>{oe.current?.contains(x.target)||q.current&&!q.current.contains(x.target)&&xe(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[Ee]),(0,se.useEffect)(()=>{if(!He)return;let b=x=>{oe.current?.contains(x.target)||ce.current&&!ce.current.contains(x.target)&&Ye(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[He]),(0,se.useEffect)(()=>{if(!Ze)return;let b=x=>{let E=x.target,z=document.querySelector(".nb-agg-dropdown"),pe=document.querySelector(`[data-agg-col="${Ze}"]`);!z?.contains(E)&&!pe?.contains(E)&&De(null)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[Ze]),(0,se.useEffect)(()=>{if(!L)return;let b=x=>{ue.current?.contains(x.target)||W.current&&!W.current.contains(x.target)&&V(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[L]);let Lo=(0,se.useCallback)(()=>kt.getSelectedRowModel().rows.map(b=>b.original._file),[kt]),va=(0,se.useCallback)(async()=>{let b=Lo();b.length!==0&&(await t.deleteNotes(b),Ae({}),xe(!1))},[Lo,t]),ba=(0,se.useCallback)(()=>{let b=Lo();if(b.length===0)return;new yu(r,E=>{t.moveNotes(b,E.path),Ae({})}).open(),xe(!1)},[r,Lo,t]),ya=(0,se.useCallback)(async()=>{let b=Lo();b.length!==0&&(await t.duplicateNotes(b),Ae({}),xe(!1))},[Lo,t]),el=(0,se.useCallback)(()=>{let b=Le.filter(Vt=>Vt.visible&&!U.hiddenColumns.includes(Vt.id)),x=Vt=>{let St=Vt==null?"":String(Vt);return St.includes(",")||St.includes('"')||St.includes(`
`)?'"'+St.replace(/"/g,'""')+'"':St},E=["Nome",...b.map(Vt=>Vt.name)],z=ln.map(Vt=>[Vt._title,...b.map(ko=>{let Ut=Vt[ko.id];return Array.isArray(Ut)?Ut.join(";"):Ut})].map(x).join(",")),pe=[E.join(","),...z].join(`
`),Ue=new Blob([pe],{type:"text/csv;charset=utf-8;"}),dt=URL.createObjectURL(Ue),Sn=document.createElement("a");Sn.href=dt,Sn.download=(e?.parent?.name||r.vault.getName()||"database")+".csv",Sn.click(),URL.revokeObjectURL(dt),xe(!1)},[Le,U.hiddenColumns,ln,e,r]),li=(0,se.useCallback)(async b=>{let x=b.target.files?.[0];if(!x||!e)return;let z=(await x.text()).split(/\r?\n/).filter(St=>St.trim()!=="");if(z.length<2)return;let pe=St=>{let ko=[],Ut="",Po=!1;for(let Io=0;Io<St.length;Io++){let ui=St[Io];ui==='"'?Po&&St[Io+1]==='"'?(Ut+='"',Io++):Po=!Po:ui===","&&!Po?(ko.push(Ut),Ut=""):Ut+=ui}return ko.push(Ut),ko},Ue=pe(z[0]).map(St=>St.trim().toLowerCase()),dt=new Map,Sn=new Set;Ue.forEach((St,ko)=>{if(St==="nome"||St==="title"||St==="name")return;let Ut=f.schema.find(Po=>Po.name.toLowerCase()===St);Ut&&!Sn.has(Ut.id)&&(dt.set(ko,{id:Ut.id,type:Ut.type}),Sn.add(Ut.id))});let Vt=Ue.findIndex(St=>St==="nome"||St==="title"||St==="name");for(let St of z.slice(1)){let ko=pe(St),Ut=Vt>=0?ko[Vt]?.trim():"";if(Ut&&y.some(Io=>Io._title===Ut))continue;let Po=await t.createNote(e);Ut&&await t.renameNote(Po,Ut);for(let[Io,ui]of dt){let Wu=ko[Io]?.trim()??"";if(!Wu)continue;let tb=ui.type==="multiselect"?Wu.split(";").map(nb=>nb.trim()):Wu;await t.updateNoteField(Po,ui.id,tb)}}b.target.value="",xe(!1)},[e,f.schema,t,r]);(0,se.useEffect)(()=>{if(!K)return;let b=x=>{oe.current?.contains(x.target)||Z.current&&!Z.current.contains(x.target)&&D(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[K]),(0,se.useEffect)(()=>{if(!ke){Mt(null);return}let b=ft.current[ke];if(!b)return;let x=b.getBoundingClientRect();Mt({top:x.bottom+6,left:x.left})},[ke]),(0,se.useEffect)(()=>{if(!ke)return;let b=x=>{let E=ft.current[ke],z=Jt.current,pe=E&&E.contains(x.target),Ue=z&&z.contains(x.target);!pe&&!Ue&&ye(null)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[ke]),(0,se.useEffect)(()=>{if(!Et)return;let b=x=>{let E=$t.current[Et];E&&!E.contains(x.target)&&bt(null)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[Et]);let Rr=Ik,Er=(0,se.useCallback)(async b=>{let x=b.map(E=>({id:E.id,columnId:E.columnId,operator:E.operator,value:E.value,conjunction:E.conjunction}));await Pe({...U,activePills:x})},[Pe,U]),wa=b=>{let{active:x,over:E}=b;if(!E||x.id===E.id)return;let z=v.findIndex(dt=>dt.id===x.id),pe=v.findIndex(dt=>dt.id===E.id),Ue=Gi(v,z,pe);h(Ue),Er(Ue)},ai=(b,x,E,z)=>{let pe=crypto.randomUUID(),Ue=[...v,{id:pe,columnId:b,columnName:x,columnType:z,icon:E,operator:Bk(z),value:"",conjunction:"and"}];h(Ue),Er(Ue),D(!1)},tl=b=>{let x=v.filter(E=>E.id!==b);h(x),Er(x),ke===b&&ye(null),Et===b&&bt(null)},$u=async b=>{await Pe({...U,rowHeight:b}),Ye(!1)},zu=async()=>{await Pe({...U,wrapText:!U.wrapText})},nl=async()=>{await Pe({...U,includeSubfolders:!U.includeSubfolders})},Vu=async(b,x)=>{let E={...U.aggregations??{},[b]:x};await Pe({...U,aggregations:E}),De(null)},Ca=(b,x)=>{if(x==="none")return"";let E=ln.map(dt=>b==="_title"?dt._title:dt[b]),z=ln.length;if(x==="count")return`${z} ${z===1?u("row_singular").toLowerCase():u("row_plural").toLowerCase()}`;let pe=E.filter(dt=>dt!=null&&String(dt).trim()!=="");if(x==="count_values")return`${pe.length} preenchido${pe.length!==1?"s":""}`;let Ue=pe.map(dt=>parseFloat(String(dt))).filter(dt=>!isNaN(dt));return Ue.length===0?"\u2014":x==="sum"?String(Math.round(Ue.reduce((dt,Sn)=>dt+Sn,0)*1e10)/1e10):x==="avg"?String(Math.round(Ue.reduce((dt,Sn)=>dt+Sn,0)/Ue.length*1e10)/1e10):x==="min"?String(Math.min(...Ue)):x==="max"?String(Math.max(...Ue)):""},Bu={none:u("agg_none"),count:"",count_values:"",sum:u("agg_sum"),avg:u("agg_avg"),min:u("agg_min"),max:u("agg_max")},Fr=(b,x,E)=>{let z=v.map(pe=>pe.id===b?{...pe,operator:x,value:E}:pe);h(z),Er(z)},ol=b=>{let x=v.map(E=>E.id===b?{...E,conjunction:E.conjunction==="and"?"or":"and"}:E);h(x),Er(x)},Co=v.length>=3||v.some(b=>b.columnName.length>10);(0,se.useEffect)(()=>{Co||(en(!1),Ce.current&&clearTimeout(Ce.current))},[Co]),(0,se.useEffect)(()=>()=>{Ce.current&&clearTimeout(Ce.current)},[]);let rl=()=>{Ce.current&&(clearTimeout(Ce.current),Ce.current=null)},ka=()=>{rl(),Ce.current=setTimeout(()=>en(!1),6e3)},ju=()=>{en(!0),ka(),requestAnimationFrame(()=>M.current?.focus())},Sa=()=>{rl(),en(!1)},Na=(0,se.useCallback)(async b=>{if(n){let x=U.hiddenColumns.includes(b)?U.hiddenColumns.filter(E=>E!==b):[...U.hiddenColumns,b];await Pe({...U,hiddenColumns:x})}else{let x=f.schema.map(E=>E.id===b?{...E,visible:!E.visible}:E);await Xe(x)}},[n,U,Pe,f.schema,Xe]),Hu=(0,se.useCallback)(async b=>{let{active:x,over:E}=b;if(!E||x.id===E.id)return;let z=Le.findIndex(Ue=>Ue.id===x.id),pe=Le.findIndex(Ue=>Ue.id===E.id);if(!(z===-1||pe===-1))if(n){let Ue=Gi(Le,z,pe).map(dt=>dt.id);await Pe({...U,columnOrder:Ue})}else await Xe(Gi(f.schema,z,pe))},[Le,n,U,Pe,f.schema,Xe]),Uu=async()=>{let x={id:`campo_${Date.now()}`,name:u("new_field"),type:"text",visible:!0,width:150};await Xe([...f.schema,x])},si=In();if(!e)return(0,k.jsxs)("div",{className:"nb-empty-state",children:[(0,k.jsx)("p",{children:u("no_database_open")}),(0,k.jsx)("p",{children:u("no_database_hint")})]});if(d)return(0,k.jsx)("div",{className:"nb-loading",children:u("loading")});let Dr=kt.getRowModel().rows,Mr=b=>{b!=="fields"&&ie(!1),b!=="actions"&&xe(!1),b!=="filter"&&D(!1),b!=="sort"&&V(!1)},F=si?(0,k.jsxs)($n,{actionBarRef:oe,search:{value:Ne,onChange:de},actions:[{id:"fields",label:u("fields"),icon:(0,k.jsx)(mn,{}),active:j,badge:f.schema.filter(b=>!b.visible).length||void 0,onClick:()=>{Mr("fields"),ie(b=>!b)}},{id:"actions",label:u("actions"),icon:(0,k.jsx)(bv,{}),active:Ee,badge:kt.getSelectedRowModel().rows.length||void 0,onClick:()=>{Mr("actions"),xe(b=>!b)}},{id:"subfolders",label:u("tooltip_include_subfolders"),icon:(0,k.jsx)(On,{}),active:!!U.includeSubfolders,onClick:()=>{Mr(),nl()}},{id:"sort",label:u("sort"),icon:(0,k.jsx)(so,{}),active:U.sorts.length>0,badge:U.sorts.length||void 0,onClick:()=>{Mr("sort"),!L&&ue.current&&J(ue.current.getBoundingClientRect()),V(b=>!b)}},{id:"filter",label:u("filter"),icon:(0,k.jsx)(An,{}),active:K,badge:v.length||void 0,onClick:()=>{Mr("filter"),D(b=>!b)}}],rowCount:Dr.length,rowCountLabel:Dr.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase(),filters:v,onFilterUpdate:Fr,onFilterRemove:tl,onConjunctionToggle:ol,children:[(0,k.jsx)(ot,{open:j,onClose:()=>ie(!1),title:u("fields"),children:f.schema.map(b=>(0,k.jsxs)("label",{className:"nb-field-row",children:[(0,k.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:n?b.visible&&!U.hiddenColumns.includes(b.id):b.visible,onChange:()=>{Na(b.id)}}),(0,k.jsx)("span",{className:"nb-field-icon",children:Rr(b.type)}),(0,k.jsx)("span",{className:"nb-field-name",children:b.name})]},b.id))}),(0,k.jsxs)(ot,{open:Ee,onClose:()=>xe(!1),title:u("actions"),children:[(0,k.jsxs)("button",{className:"nb-menu-item",onClick:()=>{va()},disabled:kt.getSelectedRowModel().rows.length===0,children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F5D1}"}),(0,k.jsx)("span",{children:u("delete_selected")})]}),(0,k.jsxs)("button",{className:"nb-menu-item",onClick:ba,disabled:kt.getSelectedRowModel().rows.length===0,children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C1}"}),(0,k.jsx)("span",{children:u("move_selected")})]}),(0,k.jsxs)("button",{className:"nb-menu-item",onClick:()=>{ya()},disabled:kt.getSelectedRowModel().rows.length===0,children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4CB}"}),(0,k.jsx)("span",{children:u("duplicate_selected")})]}),(0,k.jsx)("div",{className:"nb-menu-separator"}),(0,k.jsxs)("button",{className:"nb-menu-item",onClick:el,children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:"\u2B07"}),(0,k.jsx)("span",{children:u("export_csv")})]}),(0,k.jsxs)("button",{className:"nb-menu-item",onClick:()=>$.current?.click(),children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:"\u2B06"}),(0,k.jsx)("span",{children:u("import_csv")})]}),(0,k.jsx)("input",{ref:$,type:"file",accept:".csv",style:{display:"none"},onChange:b=>{li(b)}})]}),(0,k.jsxs)(ot,{open:K,onClose:()=>D(!1),title:u("filter"),children:[(0,k.jsxs)("button",{className:"nb-menu-item",onClick:()=>ai("_title","Nome","\u{1F4C4}","title"),children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,k.jsx)("span",{children:u("name_column")})]}),f.schema.map(b=>(0,k.jsxs)("button",{className:"nb-menu-item",onClick:()=>ai(b.id,b.name,Rr(b.type),b.type),children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:Rr(b.type)}),(0,k.jsx)("span",{children:b.name})]},b.id))]}),(0,k.jsxs)(ot,{open:L,onClose:()=>V(!1),title:u("sort"),children:[U.sorts.length===0&&(0,k.jsx)("div",{className:"nb-sort-panel-empty",style:{padding:"8px 0"},children:u("no_active_sorts")}),U.sorts.map((b,x)=>{let E=b.columnId==="_title"?"Nome":f.schema.find(z=>z.id===b.columnId)?.name??b.columnId;return(0,k.jsxs)("div",{className:"nb-sort-row",style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 0",minHeight:"44px"},children:[(0,k.jsxs)("div",{className:"nb-sort-row-priority",style:{display:"flex",flexDirection:"column",gap:"2px"},children:[(0,k.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>{let z=[...U.sorts];x>0&&([z[x],z[x-1]]=[z[x-1],z[x]],gt(z))},disabled:x===0,children:"\u2191"}),(0,k.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>{let z=[...U.sorts];x<z.length-1&&([z[x],z[x+1]]=[z[x+1],z[x]],gt(z))},disabled:x===U.sorts.length-1,children:"\u2193"})]}),(0,k.jsx)("span",{style:{flex:1},children:E}),(0,k.jsx)("button",{className:"nb-sort-dir-btn",onClick:()=>{gt(U.sorts.map(z=>z.columnId===b.columnId?{...z,direction:z.direction==="asc"?"desc":"asc"}:z))},children:b.direction==="asc"?u("sort_asc"):u("sort_desc")}),(0,k.jsx)("button",{className:"nb-sort-remove-btn",onClick:()=>{gt(U.sorts.filter(z=>z.columnId!==b.columnId))},children:"\xD7"})]},b.columnId)}),(()=>{let b=f.schema.filter(z=>z.type!=="formula"&&z.type!=="lookup"&&z.type!=="relation"&&z.type!=="multiselect"),x=new Set(U.sorts.map(z=>z.columnId)),E=[...x.has("_title")?[]:[{id:"_title",name:"Nome"}],...b.filter(z=>!x.has(z.id)).map(z=>({id:z.id,name:z.name}))];return E.length===0?null:(0,k.jsxs)("select",{className:"nb-mobile-filter-overlay-select",style:{width:"100%",marginTop:"8px",padding:"10px"},value:"",onChange:z=>{z.target.value&&(gt([...U.sorts,{columnId:z.target.value,direction:"asc"}]),z.target.value="")},children:[(0,k.jsx)("option",{value:"",children:"+ "+u("add_sort")+"..."}),E.map(z=>(0,k.jsx)("option",{value:z.id,children:z.name},z.id))]})})()]})]}):null;return(0,k.jsxs)("div",{className:"nb-container",children:[F||(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("div",{className:"nb-toolbar",children:[(0,k.jsxs)("div",{className:`nb-search-container${Co?it?" nb-search-container--expanded":" nb-search-container--collapsed":""}`,children:[Co&&(0,k.jsx)("button",{className:"nb-search-icon-btn",onClick:ju,title:"Buscar",children:(0,k.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,k.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,k.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}),(0,k.jsx)("input",{ref:M,className:"nb-search",type:"text",placeholder:u("relation_search_placeholder"),value:Ne,onChange:b=>{de(b.target.value),Co&&it&&ka()},onKeyDown:b=>{b.key==="Enter"&&Co&&it&&Sa()},onBlur:()=>{Co&&it&&Sa()}})]}),(0,k.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:ce,children:[(0,k.jsx)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon ${He?"nb-toolbar-btn--active":""}`,onClick:()=>Ye(b=>!b),title:u("row_height_label"),children:(0,k.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,k.jsx)("line",{x1:"21",y1:"10",x2:"3",y2:"10"}),(0,k.jsx)("line",{x1:"21",y1:"6",x2:"3",y2:"6"}),(0,k.jsx)("line",{x1:"21",y1:"14",x2:"3",y2:"14"}),(0,k.jsx)("line",{x1:"21",y1:"18",x2:"3",y2:"18"})]})}),He&&(0,k.jsxs)("div",{className:"nb-fields-dropdown nb-rowheight-dropdown",children:[(0,k.jsx)("div",{className:"nb-fields-dropdown-label",children:u("row_height_label")}),["compact","medium","tall"].map(b=>(0,k.jsxs)("button",{className:`nb-menu-item ${(U.rowHeight??"medium")===b?"nb-menu-item--active":""}`,onClick:()=>{$u(b)},children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:b==="compact"?"\u25A4":b==="medium"?"\u25A5":"\u25A6"}),(0,k.jsx)("span",{children:b==="compact"?u("height_compact"):b==="medium"?u("height_medium"):u("height_tall")})]},b))]})]}),(0,k.jsx)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon ${U.wrapText?"nb-toolbar-btn--active":""}`,onClick:()=>{zu()},title:u("tooltip_wrap_text"),children:(0,k.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,k.jsx)("path",{d:"M3 18h12a3 3 0 0 0 0-6h-3"}),(0,k.jsx)("polyline",{points:"9 15 6 18 9 21"})]})}),(0,k.jsx)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon nb-subfolder-toggle ${U.includeSubfolders?"nb-toolbar-btn--active":""}`,onClick:()=>{nl()},title:u("tooltip_include_subfolders"),children:(0,k.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,k.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),(0,k.jsx)("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),(0,k.jsx)("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]})}),(0,k.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:_e,children:[(0,k.jsxs)("button",{className:`nb-toolbar-btn ${j?"nb-toolbar-btn--active":""}`,onClick:()=>ie(b=>!b),title:u("tooltip_manage_fields"),children:[u("fields")," ",f.schema.some(b=>!b.visible)&&(0,k.jsx)("span",{className:"nb-hidden-badge",children:f.schema.filter(b=>!b.visible).length})]}),j&&(0,k.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,k.jsx)("div",{className:"nb-fields-dropdown-label",children:u("fields_label")}),f.schema.map(b=>(0,k.jsxs)("label",{className:"nb-field-row",children:[(0,k.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:n?b.visible&&!U.hiddenColumns.includes(b.id):b.visible,onChange:()=>{Na(b.id)}}),(0,k.jsx)("span",{className:"nb-field-icon",children:b.type==="text"?"Aa":b.type==="number"?"#":b.type==="select"?"\u25C9":b.type==="multiselect"?"\u25C8":b.type==="date"?"\u{1F4C5}":b.type==="checkbox"?"\u2611":b.type==="lookup"?"\u2197":b.type==="relation"?"\u{1F517}":b.type==="formula"?"\u0192":"\xB7"}),(0,k.jsx)("span",{className:"nb-field-name",children:b.name})]},b.id))]})]}),(0,k.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:q,children:[(0,k.jsxs)("button",{className:`nb-toolbar-btn ${Ee?"nb-toolbar-btn--active":""}`,onClick:()=>xe(b=>!b),title:u("tooltip_batch_actions"),children:[u("actions"),kt.getSelectedRowModel().rows.length>0&&(0,k.jsx)("span",{className:"nb-hidden-badge",children:kt.getSelectedRowModel().rows.length})]}),Ee&&(0,k.jsxs)("div",{className:"nb-fields-dropdown nb-actions-dropdown",children:[(0,k.jsxs)("button",{className:"nb-menu-item",onClick:()=>{va()},disabled:kt.getSelectedRowModel().rows.length===0,children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F5D1}"}),(0,k.jsx)("span",{children:u("delete_selected")})]}),(0,k.jsxs)("button",{className:"nb-menu-item",onClick:ba,disabled:kt.getSelectedRowModel().rows.length===0,children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C1}"}),(0,k.jsx)("span",{children:u("move_selected")})]}),(0,k.jsxs)("button",{className:"nb-menu-item",onClick:()=>{ya()},disabled:kt.getSelectedRowModel().rows.length===0,children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4CB}"}),(0,k.jsx)("span",{children:u("duplicate_selected")})]}),(0,k.jsx)("div",{className:"nb-menu-separator"}),(0,k.jsxs)("button",{className:"nb-menu-item",onClick:el,children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:"\u2B07"}),(0,k.jsx)("span",{children:u("export_csv")})]}),(0,k.jsxs)("button",{className:"nb-menu-item",onClick:()=>$.current?.click(),children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:"\u2B06"}),(0,k.jsx)("span",{children:u("import_csv")})]}),(0,k.jsx)("input",{ref:$,type:"file",accept:".csv",style:{display:"none"},onChange:b=>{li(b)}})]})]}),(0,k.jsxs)("span",{className:"nb-row-count",children:[Dr.length," ",Dr.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase()]}),(0,k.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:Z,style:{marginLeft:"auto"},children:[(0,k.jsxs)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon ${K?"nb-toolbar-btn--active":""}`,onClick:()=>D(b=>!b),title:u("filters"),children:[(0,k.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,k.jsx)("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})}),v.length>0&&(0,k.jsx)("span",{className:"nb-hidden-badge",children:v.length})]}),K&&(0,k.jsxs)("div",{className:"nb-fields-dropdown nb-filter-menu-dropdown",children:[(0,k.jsx)("div",{className:"nb-fields-dropdown-label",children:u("filter_by")}),(0,k.jsxs)("button",{className:"nb-menu-item",onClick:()=>ai("_title","Nome","\u{1F4C4}","title"),children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,k.jsx)("span",{children:u("name_column")})]}),f.schema.map(b=>(0,k.jsxs)("button",{className:"nb-menu-item",onClick:()=>ai(b.id,b.name,Rr(b.type),b.type),children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:Rr(b.type)}),(0,k.jsx)("span",{children:b.name})]},b.id)),(0,k.jsx)("div",{className:"nb-menu-separator"}),(0,k.jsxs)("button",{className:"nb-menu-item",onClick:()=>D(!1),children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:"\u26A1"}),(0,k.jsx)("span",{children:u("add_filter_advanced")})]})]})]}),(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("button",{ref:ue,className:`nb-toolbar-btn${U.sorts.length>0?" nb-toolbar-btn--active":""}`,onClick:()=>{!L&&ue.current&&J(ue.current.getBoundingClientRect()),V(b=>!b)},children:[(0,k.jsx)("span",{children:u("sort")}),U.sorts.length>0&&(0,k.jsx)("span",{className:"nb-hidden-badge",children:U.sorts.length})]}),L&&re&&(0,k.jsx)(Uk,{sorts:U.sorts,schema:f.schema,onSortChange:b=>{gt(b)},onClose:()=>V(!1),anchorRect:re,panelRef:W})]})]}),v.length>0&&!(Co&&it)&&(0,k.jsx)("div",{className:"nb-pills-row",children:(0,k.jsx)(jp,{sensors:be,collisionDetection:Bp,onDragStart:()=>ye(null),onDragEnd:wa,children:(0,k.jsx)(Up,{items:v.map(b=>b.id),strategy:Hp,children:v.map((b,x)=>(0,k.jsxs)(se.Fragment,{children:[x>0&&(0,k.jsx)("button",{className:`nb-pill-conjunction ${b.conjunction==="or"?"nb-pill-conjunction--or":""}`,onClick:()=>ol(b.id),title:"Clique para alternar entre E / OU",children:b.conjunction==="or"?u("conjunction_or"):u("conjunction_and")}),(0,k.jsx)(Gk,{filter:b,isActive:ke===b.id,onToggle:()=>ye(E=>E===b.id?null:b.id),onRemove:()=>tl(b.id),btnRef:E=>{ft.current[b.id]=E}})]},b.id))})})}),(()=>{let b=v.find(x=>x.id===ke);return!b||!vt?null:(0,Su.createPortal)((0,k.jsxs)("div",{ref:Jt,className:"nb-filter-pill-dropdown",style:{position:"fixed",top:vt.top,left:vt.left,zIndex:1e3},children:[(0,k.jsxs)("div",{className:"nb-filter-query-row",children:[(0,k.jsx)("span",{className:"nb-filter-query-name",children:b.columnName}),(0,k.jsxs)("div",{className:"nb-filter-op-wrapper",ref:x=>{$t.current[b.id]=x},children:[(0,k.jsxs)("button",{className:`nb-filter-op-btn ${Et===b.id?"nb-filter-op-btn--open":""}`,onClick:x=>{x.stopPropagation(),bt(E=>E===b.id?null:b.id)},children:[wv[b.operator],(0,k.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,k.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),Et===b.id&&(0,k.jsx)("div",{className:"nb-filter-op-dropdown",children:Vk(b.columnType).map(x=>(0,k.jsx)("button",{className:`nb-menu-item ${b.operator===x?"nb-menu-item--active":""}`,onClick:E=>{E.stopPropagation(),Fr(b.id,x,""),bt(null)},children:wv[x]},x))})]}),(0,k.jsx)("button",{className:"nb-filter-query-clear",onClick:x=>{x.stopPropagation(),tl(b.id)},title:u("tooltip_remove_filter"),children:"\xD7"})]}),!kv.has(b.operator)&&(gu(b)?(0,k.jsx)("div",{className:"nb-filter-multi-select",children:(()=>{let E=f.schema.find(pe=>pe.id===b.columnId)?.options??[],z=ca(b.value);return E.length>0?E.map(pe=>(0,k.jsxs)("label",{className:"nb-filter-multi-option",children:[(0,k.jsx)("input",{type:"checkbox",checked:z.includes(pe.value),onChange:()=>Fr(b.id,b.operator,lv(b.value,pe.value))}),(0,k.jsx)("span",{className:"nb-filter-option-badge",style:pe.color?{backgroundColor:pe.color}:void 0,children:pe.value})]},pe.value)):(0,k.jsx)("input",{className:"nb-filter-value-input",type:"text",placeholder:u("filter_value_placeholder"),value:b.value,autoFocus:!si,onChange:pe=>Fr(b.id,b.operator,pe.target.value)})})()}):(0,k.jsx)("input",{className:"nb-filter-value-input",type:b.columnType==="number"?"number":b.columnType==="date"?"date":"text",placeholder:b.columnType==="number"?u("filter_number_placeholder"):b.columnType==="date"?"":u("filter_value_placeholder"),value:b.value,autoFocus:!si,onChange:x=>Fr(b.id,b.operator,x.target.value)}))]}),document.body)})()]}),(0,k.jsxs)(Xp.Provider,{value:{editingCell:Y,setEditingCell:te,updateCell:$e,schema:f.schema,relationOptions:l,updateSchema:Xe},children:[(0,k.jsx)("div",{ref:S,className:`nb-table-wrapper${U.wrapText?" nb-table--wrap":""}`,style:{"--nb-row-height":U.rowHeight==="compact"?"28px":U.rowHeight==="tall"?"64px":"36px"},children:(0,k.jsxs)("table",{ref:ve,className:"nb-table",children:[(0,k.jsx)("thead",{className:"nb-thead",children:kt.getHeaderGroups().map(b=>{let x=Le.filter(E=>E.visible&&!U.hiddenColumns.includes(E.id)).map(E=>E.id);return(0,k.jsx)(jp,{sensors:be,collisionDetection:Bp,onDragEnd:E=>{Hu(E)},children:(0,k.jsx)(Up,{items:x,strategy:Hp,children:(0,k.jsxs)("tr",{className:"nb-header-row",children:[b.headers.map(E=>{let z=tn.get(E.id);return E.id==="_select"?(0,k.jsx)("th",{className:"nb-th nb-th-select nb-th--sticky",style:{width:E.getSize(),left:0,zIndex:3},children:(0,k.jsx)("div",{className:"nb-cell-checkbox-wrapper",onClick:kt.getToggleAllRowsSelectedHandler(),children:(0,k.jsx)("div",{className:`nb-cell-checkbox-custom${kt.getIsAllRowsSelected()?" nb-cell-checkbox-custom--checked":""}${kt.getIsSomeRowsSelected()&&!kt.getIsAllRowsSelected()?" nb-cell-checkbox-custom--indeterminate":""}`,children:(kt.getIsAllRowsSelected()||kt.getIsSomeRowsSelected())&&(0,k.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",className:"nb-cell-check-icon",children:kt.getIsAllRowsSelected()?(0,k.jsx)("polyline",{points:"20 6 9 17 4 12"}):(0,k.jsx)("line",{x1:"6",y1:"12",x2:"18",y2:"12"})})})})},E.id):E.id==="_title"?(0,k.jsxs)("th",{"data-col-id":"_title",className:["nb-th",z?"nb-th--sticky":"",z?.isLast?"nb-th--sticky-last":""].filter(Boolean).join(" "),style:{width:E.getSize(),...z?{left:z.left,zIndex:3}:{}},children:[(0,k.jsxs)("div",{className:"nb-th-inner-title",children:[(0,k.jsx)("div",{style:{flex:1},children:Vi(E.column.columnDef.header,E.getContext())}),(0,k.jsx)("button",{className:`nb-pin-btn${s==="_title"?" nb-pin-btn--active":""}`,onClick:()=>{ct("_title")},title:s==="_title"?u("tooltip_unpin_column"):u("tooltip_pin_column"),children:"\u{1F4CC}"})]}),(0,k.jsx)(Sv,{onResize:pe=>{At("_title",pe)},onAutoFit:()=>{zt("_title")}})]},E.id):(0,k.jsx)(Wk,{id:E.id,size:E.getSize(),stickyLeft:z?.left,isLastPinned:z?.isLast,isPinned:s===E.id,onTogglePin:()=>{ct(E.id)},sorted:E.column.getCanSort()?E.column.getIsSorted():void 0,onToggleSort:E.column.getCanSort()?()=>It(E.id):void 0,onResize:pe=>{At(E.id,pe)},onAutoFit:()=>{zt(E.id)},children:Vi(E.column.columnDef.header,E.getContext())},E.id)}),(0,k.jsx)("th",{className:"nb-th nb-th-add-col",children:(0,k.jsx)("button",{className:"nb-add-col-btn",onClick:()=>{Uu()},title:u("add_field"),children:"+"})})]})})},b.id)})}),(0,k.jsx)(Lk,{scrollRef:S,rowHeight:U.rowHeight==="compact"?28:U.rowHeight==="tall"?64:36,rows:Dr,stickyMap:tn,isMobile:si,setEditingCell:te,setContextMenuFile:Ie,longPressRef:Ve,columns:gn,onAddRow:()=>{ha()},hierarchyMap:fa,onToggleExpand:Yn,onAddSubRow:b=>{_a(b)},expandedSet:C,allExpanded:H,rowDragEnabled:Pu,dragOverPath:we,onRowDragStart:Iu,onRowDragOver:ga,onRowDragEnd:Au,onRowDrop:Ou}),(0,k.jsx)("tfoot",{className:"nb-tfoot",children:(0,k.jsxs)("tr",{children:[(0,k.jsx)("td",{className:"nb-td nb-agg-td nb-td--sticky",style:{left:0,zIndex:1,width:40}}),kt.getVisibleLeafColumns().filter(b=>b.id!=="_select").map(b=>{let x=tn.get(b.id),E=(U.aggregations??{})[b.id]??"none",z=Ca(b.id,E);return(0,k.jsxs)("td",{"data-agg-col":b.id,className:["nb-td","nb-agg-td",x?"nb-td--sticky":"",x?.isLast?"nb-td--sticky-last":""].filter(Boolean).join(" "),style:{width:b.getSize(),...x?{left:x.left,zIndex:1}:{}},onClick:()=>De(pe=>pe===b.id?null:b.id),children:[E!=="none"?(0,k.jsxs)("div",{className:"nb-agg-cell",children:[(0,k.jsx)("span",{className:"nb-agg-label",children:Bu[E]}),(0,k.jsx)("span",{className:"nb-agg-value",children:z})]}):(0,k.jsx)("div",{className:"nb-agg-empty"}),Ze===b.id&&(0,Su.createPortal)((0,k.jsx)(Kk,{colType:f.schema.find(pe=>pe.id===b.id)?.type??"text",current:E,onSelect:pe=>{Vu(b.id,pe)},anchorEl:document.querySelector(`[data-agg-col="${b.id}"]`)}),document.body)]},b.id)}),(0,k.jsx)("td",{className:"nb-td nb-agg-td nb-td-empty"})]})})]})}),(0,k.jsx)("div",{className:"nb-row-count-bar",children:(()=>{let b=y.length,x=kt.getFilteredRowModel().rows.length;return x!==b?(0,k.jsxs)("span",{className:"nb-row-count",children:[x," de ",b," ",b!==1?u("record_plural").toLowerCase():u("record_singular").toLowerCase()]}):(0,k.jsxs)("span",{className:"nb-row-count",children:[b," ",b!==1?u("record_plural").toLowerCase():u("record_singular").toLowerCase()]})})()})]}),(0,k.jsxs)(ot,{open:Fe!==null,onClose:()=>Ie(null),title:Fe?.basename??"",children:[(0,k.jsxs)("button",{className:"nb-menu-item",onClick:()=>{Fe&&r.workspace.getLeaf().openFile(Fe),Ie(null)},children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,k.jsx)("span",{children:u("open_note")})]}),(0,k.jsxs)("button",{className:"nb-menu-item",onClick:()=>{Fe&&t.duplicateNotes([Fe]),Ie(null)},children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4CB}"}),(0,k.jsx)("span",{children:u("duplicate_note")})]}),kn&&Fe&&(fa?.get(Fe.path)?.depth??0)<3&&(0,k.jsxs)("button",{className:"nb-menu-item",onClick:()=>{_a(Fe.basename),Ie(null)},children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:"\u21B3"}),(0,k.jsx)("span",{children:u("add_subrow")})]}),(0,k.jsx)("div",{className:"nb-menu-separator"}),(0,k.jsxs)("button",{className:"nb-menu-item nb-menu-item--danger",onClick:()=>{Fe&&t.deleteNotes([Fe]),Ie(null)},children:[(0,k.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F5D1}"}),(0,k.jsx)("span",{children:u("delete_note")})]})]})]})}var et=ze(yt(),1),Nv=ze(vo(),1);var ee=ze(Rt(),1);function Yk({sorts:e,schema:t,onSortChange:n,onClose:o,anchorRect:r,panelRef:i}){let[l,a]=(0,et.useState)({x:r.right-280,y:r.bottom+4}),s=d=>{d.preventDefault();let v=d.clientX-l.x,h=d.clientY-l.y,y=f=>a({x:f.clientX-v,y:f.clientY-h}),_=()=>{window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",_)};window.addEventListener("mousemove",y),window.addEventListener("mouseup",_)},c=t.filter(d=>d.type!=="formula"&&d.type!=="lookup"&&d.type!=="relation"&&d.type!=="multiselect"),p=new Set(e.map(d=>d.columnId)),m=[...p.has("_title")?[]:[{id:"_title",name:"Nome"}],...c.filter(d=>!p.has(d.id)).map(d=>({id:d.id,name:d.name}))],g=(d,v)=>{let h=[...e],y=d+v;y<0||y>=h.length||([h[d],h[y]]=[h[y],h[d]],n(h))};return(0,Nv.createPortal)((0,ee.jsxs)("div",{ref:i,className:"nb-sort-panel",style:{position:"fixed",top:l.y,left:l.x},children:[(0,ee.jsxs)("div",{className:"nb-sort-panel-titlebar",onMouseDown:s,children:[(0,ee.jsx)("span",{className:"nb-sort-panel-title",children:u("sort_by")}),(0,ee.jsx)("button",{className:"nb-sort-panel-close",onClick:o,title:u("tooltip_close"),children:"\xD7"})]}),e.length===0&&(0,ee.jsx)("div",{className:"nb-sort-panel-empty",children:u("no_active_sorts")}),e.map((d,v)=>{let h=d.columnId==="_title"?"Nome":t.find(y=>y.id===d.columnId)?.name??d.columnId;return(0,ee.jsxs)("div",{className:"nb-sort-row",children:[(0,ee.jsxs)("div",{className:"nb-sort-row-priority",children:[(0,ee.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>g(v,-1),disabled:v===0,title:u("tooltip_move_up"),children:"\u2191"}),(0,ee.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>g(v,1),disabled:v===e.length-1,title:u("tooltip_move_down"),children:"\u2193"})]}),(0,ee.jsx)("span",{className:"nb-sort-row-name",children:h}),(0,ee.jsx)("button",{className:"nb-sort-dir-btn",onClick:()=>n(e.map(y=>y.columnId===d.columnId?{...y,direction:y.direction==="asc"?"desc":"asc"}:y)),children:d.direction==="asc"?u("sort_asc"):u("sort_desc")}),(0,ee.jsx)("button",{className:"nb-sort-remove-btn",onClick:()=>n(e.filter(y=>y.columnId!==d.columnId)),title:u("tooltip_remove"),children:"\xD7"})]},d.columnId)}),m.length>0&&(0,ee.jsx)("div",{className:"nb-sort-add-row",children:(0,ee.jsxs)("select",{className:"nb-sort-add-select",value:"",onChange:d=>{d.target.value&&(n([...e,{columnId:d.target.value,direction:"asc"}]),d.target.value="")},children:[(0,ee.jsx)("option",{value:"",children:"+ "+u("add_sort")+"..."}),m.map(d=>(0,ee.jsx)("option",{value:d.id,children:d.name},d.id))]})})]}),document.body)}function Xk({filter:e,onUpdate:t,onRemove:n,onToggleConjunction:o,showConjunction:r}){let i=Dn(e.columnType);return(0,ee.jsxs)(et.Fragment,{children:[r&&(0,ee.jsx)("button",{className:`nb-pill-conjunction${e.conjunction==="or"?" nb-pill-conjunction--or":""}`,onClick:o,children:e.conjunction==="or"?u("conjunction_or"):u("conjunction_and")}),(0,ee.jsxs)("span",{className:"nb-filter-pill",children:[(0,ee.jsx)("span",{className:"nb-pill-icon",children:e.icon}),(0,ee.jsx)("span",{className:"nb-pill-name",children:e.columnName}),(0,ee.jsx)("select",{className:"nb-pill-op-select",value:e.operator,onChange:l=>t(l.target.value,e.value),children:i.map(l=>(0,ee.jsx)("option",{value:l,children:Mn[l]},l))}),!Cn.has(e.operator)&&(0,ee.jsx)("input",{className:"nb-pill-value-input",type:"text",value:e.value,onChange:l=>t(e.operator,l.target.value)}),(0,ee.jsx)("button",{className:"nb-pill-remove",onClick:n,children:"\xD7"})]})]})}var Qk=et.default.memo(function({row:t,depth:n,hasChildren:o,isExpanded:r,isHierarchical:i,visibleCols:l,dbFolderPath:a,includeSubfolders:s,onOpen:c,onToggleExpand:p,isMobile:m,onLongPress:g,onContextMenu:d,longPressRef:v}){let h=t._file.parent?.path??"",y=s&&h.length>a.length?h.slice(a.length+1):"";return(0,ee.jsxs)("div",{className:"nb-list-row",style:i?{paddingLeft:`${n*20+12}px`}:void 0,onClick:()=>c(t._file),onContextMenu:m?void 0:_=>{_.preventDefault(),d(t._file)},onTouchStart:m?()=>{v.current=setTimeout(()=>g(t._file),500)}:void 0,onTouchMove:m?()=>{v.current&&(clearTimeout(v.current),v.current=null)}:void 0,onTouchEnd:m?()=>{v.current&&(clearTimeout(v.current),v.current=null)}:void 0,children:[o&&(0,ee.jsx)("button",{className:"nb-hierarchy-toggle",onClick:_=>{_.stopPropagation(),p(t._file.path)},children:r?"\u25BC":"\u25B6"}),(0,ee.jsx)("span",{className:"nb-list-row-icon",children:"\u{1F4C4}"}),(0,ee.jsx)("span",{className:"nb-list-row-title",children:t._title}),y?(0,ee.jsx)("span",{className:"nb-folder-path",style:{marginLeft:4},children:y}):null,l.length>0&&(0,ee.jsx)("div",{className:"nb-list-row-props",children:l.map(_=>{let f=t[_.id];if(f==null||String(f).trim()==="")return null;let w=Array.isArray(f)?f.join(", "):String(f);return(0,ee.jsxs)("span",{className:"nb-list-prop",children:[(0,ee.jsxs)("span",{className:"nb-list-prop-name",children:[_.name,":"]}),(0,ee.jsx)("span",{className:"nb-list-prop-value",children:w})]},_.id)})})]})});function xv({dbFile:e,manager:t,externalView:n,onViewChange:o}){let r=Dt(),{rows:i,config:l,loading:a,activeFilters:s,setActiveFilters:c}=Ln({app:r,dbFile:e,manager:t,includeSubfolders:n.includeSubfolders,externalView:n}),[p,m]=(0,et.useState)(n),[g,d]=(0,et.useState)(!1),[v,h]=(0,et.useState)(!1),[y,_]=(0,et.useState)(!1),[f,w]=(0,et.useState)(null),R=(0,et.useRef)(null),P=(0,et.useRef)(null),L=(0,et.useRef)(null),V=(0,et.useRef)(null),W=(0,et.useRef)(null);(0,et.useEffect)(()=>{m(n)},[n.id]);let re=(0,et.useCallback)(async D=>{m(D),await o(D)},[o]);(0,et.useEffect)(()=>{if(!g)return;let D=Z=>{W.current?.contains(Z.target)||R.current&&!R.current.contains(Z.target)&&d(!1)};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[g]),(0,et.useEffect)(()=>{if(!v)return;let D=Z=>{W.current?.contains(Z.target)||P.current&&!P.current.contains(Z.target)&&h(!1)};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[v]),(0,et.useEffect)(()=>{if(!y)return;let D=Z=>{W.current?.contains(Z.target)||V.current?.contains(Z.target)||L.current&&!L.current.contains(Z.target)&&_(!1)};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[y]);let J=(0,et.useCallback)(async D=>{let Z=D.map(ke=>({id:ke.id,columnId:ke.columnId,operator:ke.operator,value:ke.value,conjunction:ke.conjunction}));await re({...p,activePills:Z})},[re,p]),ue=(D,Z,ke,ye)=>{let ft=[...s,{id:crypto.randomUUID(),columnId:D,columnName:Z,columnType:ye,icon:ke,operator:io(ye),value:"",conjunction:"and"}];c(ft),J(ft),d(!1)},Ne=D=>{let Z=s.filter(ke=>ke.id!==D);c(Z),J(Z)},de=(D,Z,ke)=>{let ye=s.map(ft=>ft.id===D?{...ft,operator:Z,value:ke}:ft);c(ye),J(ye)},Re=D=>{let Z=s.map(ke=>ke.id===D?{...ke,conjunction:ke.conjunction==="and"?"or":"and"}:ke);c(Z),J(Z)},Y=(0,et.useCallback)(async D=>{let Z=p.hiddenColumns.includes(D)?p.hiddenColumns.filter(ke=>ke!==D):[...p.hiddenColumns,D];await re({...p,hiddenColumns:Z})},[p,re]),te=(0,et.useCallback)(async D=>{await re({...p,sorts:D})},[p,re]),j=async()=>{e&&await t.createNote(e)},[ie,_e]=(0,et.useState)(new Set),[me]=(0,et.useState)(!0),Ae=(0,et.useMemo)(()=>Cu(l.schema,e?.path??""),[l.schema,e?.path]),Ee=(0,et.useCallback)(D=>{_e(Z=>{let ke=new Set(Z);return ke.has(D)?ke.delete(D):ke.add(D),ke})},[]),xe=Pn(s,200),Fe=(0,et.useMemo)(()=>lo(i,xe),[i,xe]),Ie=(0,et.useMemo)(()=>qn(Fe,p.sorts),[Fe,p.sorts]),Ve=(0,et.useMemo)(()=>Ae?ku(Ie,Ae.id,p.sorts,ie,me):null,[Ie,Ae,p.sorts,ie,me]),He=(0,et.useMemo)(()=>l.schema.filter(D=>D.visible&&!p.hiddenColumns.includes(D.id)),[l.schema,p.hiddenColumns]),Ye=In(),Ze=e?.parent?.path??"",De=(0,et.useCallback)(D=>{r.workspace.getLeaf().openFile(D)},[r]),[q,ce]=(0,et.useState)(null),$=(0,et.useRef)(null),oe=(0,et.useCallback)(D=>{ce(D)},[]),ve=(0,et.useCallback)(D=>{ce(D)},[]);if(!e)return(0,ee.jsx)("div",{className:"nb-empty-state",children:(0,ee.jsx)("p",{children:u("no_database_open")})});if(a)return(0,ee.jsx)("div",{className:"nb-loading",children:u("loading")});let S=D=>{D!=="fields"&&h(!1),D!=="filter"&&d(!1),D!=="sort"&&_(!1)},K=Ye?(0,ee.jsxs)($n,{actionBarRef:W,actions:[{id:"fields",label:u("fields"),icon:(0,ee.jsx)(mn,{}),active:v,onClick:()=>{S("fields"),h(D=>!D)}},{id:"subfolders",label:u("tooltip_include_subfolders"),icon:(0,ee.jsx)(On,{}),active:!!p.includeSubfolders,onClick:()=>{S(),re({...p,includeSubfolders:!p.includeSubfolders})}},{id:"sort",label:u("sort"),icon:(0,ee.jsx)(so,{}),active:p.sorts.length>0,badge:p.sorts.length||void 0,onClick:()=>{S("sort"),!y&&V.current&&w(V.current.getBoundingClientRect()),_(D=>!D)}},{id:"filter",label:u("filter"),icon:(0,ee.jsx)(An,{}),active:g,badge:s.length||void 0,onClick:()=>{S("filter"),d(D=>!D)}}],rowCount:Ie.length,rowCountLabel:Ie.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase(),filters:s,onFilterUpdate:de,onFilterRemove:Ne,onConjunctionToggle:Re,children:[(0,ee.jsx)(ot,{open:v,onClose:()=>h(!1),title:u("fields"),children:l.schema.map(D=>(0,ee.jsxs)("label",{className:"nb-field-row",children:[(0,ee.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:D.visible&&!p.hiddenColumns.includes(D.id),onChange:()=>{Y(D.id)}}),(0,ee.jsx)("span",{className:"nb-field-icon",children:Ke(D.type)}),(0,ee.jsx)("span",{className:"nb-field-name",children:D.name})]},D.id))}),(0,ee.jsxs)(ot,{open:g,onClose:()=>d(!1),title:u("filter"),children:[(0,ee.jsxs)("button",{className:"nb-menu-item",onClick:()=>ue("_title",u("name_column"),"\u{1F4C4}","title"),children:[(0,ee.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,ee.jsx)("span",{children:u("name_column")})]}),l.schema.map(D=>(0,ee.jsxs)("button",{className:"nb-menu-item",onClick:()=>ue(D.id,D.name,Ke(D.type),D.type),children:[(0,ee.jsx)("span",{className:"nb-menu-item-icon",children:Ke(D.type)}),(0,ee.jsx)("span",{children:D.name})]},D.id))]}),(0,ee.jsxs)(ot,{open:y,onClose:()=>_(!1),title:u("sort"),children:[p.sorts.length===0&&(0,ee.jsx)("div",{className:"nb-sort-panel-empty",style:{padding:"8px 0"},children:u("no_active_sorts")}),p.sorts.map((D,Z)=>{let ke=D.columnId==="_title"?"Nome":l.schema.find(ye=>ye.id===D.columnId)?.name??D.columnId;return(0,ee.jsxs)("div",{className:"nb-sort-row",style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 0",minHeight:"44px"},children:[(0,ee.jsxs)("div",{className:"nb-sort-row-priority",style:{display:"flex",flexDirection:"column",gap:"2px"},children:[(0,ee.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>{let ye=[...p.sorts];Z>0&&([ye[Z],ye[Z-1]]=[ye[Z-1],ye[Z]],te(ye))},disabled:Z===0,children:"\u2191"}),(0,ee.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>{let ye=[...p.sorts];Z<ye.length-1&&([ye[Z],ye[Z+1]]=[ye[Z+1],ye[Z]],te(ye))},disabled:Z===p.sorts.length-1,children:"\u2193"})]}),(0,ee.jsx)("span",{style:{flex:1},children:ke}),(0,ee.jsx)("button",{className:"nb-sort-dir-btn",onClick:()=>{te(p.sorts.map(ye=>ye.columnId===D.columnId?{...ye,direction:ye.direction==="asc"?"desc":"asc"}:ye))},children:D.direction==="asc"?u("sort_asc"):u("sort_desc")}),(0,ee.jsx)("button",{className:"nb-sort-remove-btn",onClick:()=>{te(p.sorts.filter(ye=>ye.columnId!==D.columnId))},children:"\xD7"})]},D.columnId)}),(()=>{let D=l.schema.filter(ye=>ye.type!=="formula"&&ye.type!=="lookup"&&ye.type!=="relation"&&ye.type!=="multiselect"),Z=new Set(p.sorts.map(ye=>ye.columnId)),ke=[...Z.has("_title")?[]:[{id:"_title",name:"Nome"}],...D.filter(ye=>!Z.has(ye.id)).map(ye=>({id:ye.id,name:ye.name}))];return ke.length===0?null:(0,ee.jsxs)("select",{className:"nb-mobile-filter-overlay-select",style:{width:"100%",marginTop:"8px",padding:"10px"},value:"",onChange:ye=>{ye.target.value&&(te([...p.sorts,{columnId:ye.target.value,direction:"asc"}]),ye.target.value="")},children:[(0,ee.jsx)("option",{value:"",children:"+ "+u("add_sort")+"..."}),ke.map(ye=>(0,ee.jsx)("option",{value:ye.id,children:ye.name},ye.id))]})})()]})]}):(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsxs)("div",{className:"nb-toolbar",children:[(0,ee.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:P,children:[(0,ee.jsx)("button",{className:`nb-toolbar-btn ${v?"nb-toolbar-btn--active":""}`,onClick:()=>h(D=>!D),children:u("fields")}),v&&(0,ee.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,ee.jsx)("div",{className:"nb-fields-dropdown-label",children:u("fields_label")}),l.schema.map(D=>(0,ee.jsxs)("label",{className:"nb-field-row",children:[(0,ee.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:D.visible&&!p.hiddenColumns.includes(D.id),onChange:()=>{Y(D.id)}}),(0,ee.jsx)("span",{className:"nb-field-icon",children:Ke(D.type)}),(0,ee.jsx)("span",{className:"nb-field-name",children:D.name})]},D.id))]})]}),(0,ee.jsx)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon nb-subfolder-toggle ${p.includeSubfolders?"nb-toolbar-btn--active":""}`,onClick:()=>{re({...p,includeSubfolders:!p.includeSubfolders})},title:u("tooltip_include_subfolders"),children:(0,ee.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ee.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),(0,ee.jsx)("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),(0,ee.jsx)("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]})}),(0,ee.jsxs)("span",{className:"nb-row-count",children:[Ie.length," ",Ie.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase()]}),(0,ee.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:R,style:{marginLeft:"auto"},children:[(0,ee.jsxs)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon ${g?"nb-toolbar-btn--active":""}`,onClick:()=>d(D=>!D),title:u("filters"),children:[(0,ee.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,ee.jsx)("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})}),s.length>0&&(0,ee.jsx)("span",{className:"nb-hidden-badge",children:s.length})]}),g&&(0,ee.jsxs)("div",{className:"nb-fields-dropdown nb-filter-menu-dropdown",children:[(0,ee.jsx)("div",{className:"nb-fields-dropdown-label",children:u("filter_by")}),(0,ee.jsxs)("button",{className:"nb-menu-item",onClick:()=>ue("_title",u("name_column"),"\u{1F4C4}","title"),children:[(0,ee.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,ee.jsx)("span",{children:u("name_column")})]}),l.schema.map(D=>(0,ee.jsxs)("button",{className:"nb-menu-item",onClick:()=>ue(D.id,D.name,Ke(D.type),D.type),children:[(0,ee.jsx)("span",{className:"nb-menu-item-icon",children:Ke(D.type)}),(0,ee.jsx)("span",{children:D.name})]},D.id))]})]}),(0,ee.jsxs)("button",{ref:V,className:`nb-toolbar-btn${p.sorts.length>0?" nb-toolbar-btn--active":""}`,onClick:()=>{!y&&V.current&&w(V.current.getBoundingClientRect()),_(D=>!D)},children:[(0,ee.jsx)("span",{children:u("sort")}),p.sorts.length>0&&(0,ee.jsx)("span",{className:"nb-hidden-badge",children:p.sorts.length})]}),y&&f&&(0,ee.jsx)(Yk,{sorts:p.sorts,schema:l.schema,onSortChange:D=>{te(D)},onClose:()=>_(!1),anchorRect:f,panelRef:L})]}),s.length>0&&(0,ee.jsx)("div",{className:"nb-filter-pills-row",children:s.map((D,Z)=>(0,ee.jsx)(Xk,{filter:D,showConjunction:Z>0,onUpdate:(ke,ye)=>de(D.id,ke,ye),onRemove:()=>Ne(D.id),onToggleConjunction:()=>Re(D.id)},D.id))})]});return(0,ee.jsxs)("div",{className:"nb-container",children:[K,(0,ee.jsxs)("div",{className:"nb-list",children:[(Ve??Ie.map(D=>({row:D,depth:0,hasChildren:!1,parentTitle:null}))).map(({row:D,depth:Z,hasChildren:ke})=>{let ye=me?!ie.has(D._file.path):ie.has(D._file.path);return(0,ee.jsx)(Qk,{row:D,depth:Z,hasChildren:ke,isExpanded:ye,isHierarchical:Ve!==null,visibleCols:He,dbFolderPath:Ze,includeSubfolders:p.includeSubfolders??!1,onOpen:De,onToggleExpand:Ee,isMobile:Ye,onLongPress:oe,onContextMenu:ve,longPressRef:$},D._file.path)}),(0,ee.jsx)("button",{className:"nb-add-row nb-list-add-row",onClick:()=>{j()},children:"+ "+u("add_entry")})]}),(0,ee.jsxs)(ot,{open:q!==null,onClose:()=>ce(null),title:q?.basename??"",children:[(0,ee.jsxs)("button",{className:"nb-menu-item",onClick:()=>{q&&r.workspace.getLeaf().openFile(q),ce(null)},children:[(0,ee.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,ee.jsx)("span",{children:u("open_note")})]}),(0,ee.jsxs)("button",{className:"nb-menu-item",onClick:()=>{q&&t.duplicateNotes([q]),ce(null)},children:[(0,ee.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4CB}"}),(0,ee.jsx)("span",{children:u("duplicate_note")})]}),(0,ee.jsx)("div",{className:"nb-menu-separator"}),(0,ee.jsxs)("button",{className:"nb-menu-item nb-menu-item--danger",onClick:()=>{q&&t.deleteNotes([q]),ce(null)},children:[(0,ee.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F5D1}"}),(0,ee.jsx)("span",{children:u("delete_note")})]})]})]})}var Be=ze(yt(),1);var Q=ze(Rt(),1),Yi="nb-card",Nu="nb-column",Zk=60,Jk=30;function eS({children:e}){let t=(0,Be.useRef)(null),[n,o]=(0,Be.useState)(!1),r=(0,Be.useRef)(Zk);return(0,Be.useEffect)(()=>{let i=t.current;if(!i)return;let l=new IntersectionObserver(([a])=>{a.isIntersecting&&(o(!0),l.disconnect())},{rootMargin:"200px 0px"});return l.observe(i),()=>l.disconnect()},[]),(0,Be.useEffect)(()=>{n&&t.current&&(r.current=t.current.offsetHeight)},[n]),n?(0,Q.jsx)("div",{ref:t,children:e}):(0,Q.jsx)("div",{ref:t,style:{minHeight:r.current}})}var tS=Be.default.memo(function({row:t,isMobile:n,visibleCols:o,dbFolderPath:r,includeSubfolders:i,onOpen:l,onDragStart:a,onTouchStart:s,onContextMenu:c}){let p=t._file.parent?.path??"",m=i&&p.length>r.length?p.slice(r.length+1):"";return(0,Q.jsxs)("div",{className:"nb-board-card",draggable:!n,onDragStart:n?void 0:g=>{g.stopPropagation(),a?.(g,t._file.path)},onTouchStart:n?g=>s?.(g,t._file):void 0,onContextMenu:n?void 0:g=>{g.preventDefault(),c?.(g,t._file)},onClick:()=>l(t._file),children:[(0,Q.jsx)("div",{className:"nb-board-card-title",children:t._title}),m?(0,Q.jsx)("div",{className:"nb-folder-path",children:m}):null,o.length>0&&(0,Q.jsx)("div",{className:"nb-board-card-props",children:o.map(g=>{let d=t[g.id];if(d==null||String(d).trim()==="")return null;let v=Array.isArray(d)?d.join(", "):String(d);return(0,Q.jsxs)("span",{className:"nb-board-card-prop",children:[(0,Q.jsxs)("span",{className:"nb-board-card-prop-name",children:[g.name,":"]}),(0,Q.jsx)("span",{className:"nb-board-card-prop-value",children:v})]},g.id)})})]})});function Rv({dbFile:e,manager:t,externalView:n,onViewChange:o}){let r=Dt(),{rows:i,config:l,loading:a,activeFilters:s,setActiveFilters:c}=Ln({app:r,dbFile:e,manager:t,includeSubfolders:n.includeSubfolders,externalView:n}),[p,m]=(0,Be.useState)(n),[g,d]=(0,Be.useState)(!1),[v,h]=(0,Be.useState)(!1),[y,_]=(0,Be.useState)(null),[f,w]=(0,Be.useState)(new Set),[R,P]=(0,Be.useState)(!1),[L,V]=(0,Be.useState)(!1),[W,re]=(0,Be.useState)(!1),[J,ue]=(0,Be.useState)(null),[Ne,de]=(0,Be.useState)(null),[Re,Y]=(0,Be.useState)(null),te=(0,Be.useRef)(null),j=(0,Be.useRef)(null),ie=(0,Be.useRef)(null),_e=(0,Be.useRef)(null);(0,Be.useEffect)(()=>{m(n)},[n.id]);let me=(0,Be.useCallback)(async M=>{m(M),await o(M)},[o]);(0,Be.useEffect)(()=>{if(!R)return;let M=Ce=>{_e.current?.contains(Ce.target)||te.current&&!te.current.contains(Ce.target)&&P(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[R]),(0,Be.useEffect)(()=>{if(!L)return;let M=Ce=>{_e.current?.contains(Ce.target)||j.current&&!j.current.contains(Ce.target)&&V(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[L]),(0,Be.useEffect)(()=>{if(!W)return;let M=Ce=>{_e.current?.contains(Ce.target)||ie.current&&!ie.current.contains(Ce.target)&&re(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[W]);let Ae=(0,Be.useMemo)(()=>l.schema.filter(M=>M.type==="select"||M.type==="status"),[l.schema]),Ee=(0,Be.useMemo)(()=>l.schema.find(M=>M.id===p.groupByColumnId)??Ae[0]??null,[l.schema,p.groupByColumnId,Ae]),xe=Pn(s,200),Fe=(0,Be.useMemo)(()=>lo(i,xe),[i,xe]),Ie=(0,Be.useMemo)(()=>qn(Fe,p.sorts),[Fe,p.sorts]),Ve=(0,Be.useMemo)(()=>l.schema.filter(M=>M.id!==Ee?.id&&M.type!=="title"&&M.visible&&!p.hiddenColumns.includes(M.id)),[l.schema,p.hiddenColumns,Ee]),He=[{value:u("status_not_started"),color:"#9E9E9E"},{value:u("status_in_progress"),color:"#2196F3"},{value:u("status_done"),color:"#4CAF50"},{value:u("status_cancelled"),color:"#F44336"}],Ye=(0,Be.useMemo)(()=>{if(!Ee)return[];let Ce=[...(Ee.type==="status"&&!Ee.options?.length?He:Ee.options??[]).map(ae=>({value:ae.value,label:ae.value,color:ae.color,rows:Ie.filter(le=>le[Ee.id]===ae.value)})),{value:"",label:u("no_value"),color:void 0,rows:Ie.filter(ae=>{let le=ae[Ee.id];return le==null||String(le).trim()===""})}],C=p.boardColumnOrder,X=Ce;if(C&&C.length>0){let ae=C.flatMap(we=>{let N=Ce.find(be=>be.value===we);return N?[N]:[]}),le=Ce.filter(we=>!C.includes(we.value));X=[...ae,...le]}let H=g?X.filter(ae=>ae.rows.length>0):X;return v&&(H=H.filter(ae=>ae.value!=="")),H},[Ee,Ie,g,v,p.boardColumnOrder]),Ze=(0,Be.useCallback)(async(M,Ce)=>{if(!e||!Ee)return;let C=r.vault.getFileByPath(M);C&&await r.fileManager.processFrontMatter(C,X=>{Ce===""?delete X[Ee.id]:X[Ee.id]=Ce})},[r,e,Ee]),De=(0,Be.useCallback)(async(M,Ce)=>{if(M===Ce)return;let C=Ye.map(le=>le.value),X=C.indexOf(M),H=C.indexOf(Ce);if(X===-1||H===-1)return;let ae=[...C];ae.splice(X,1),ae.splice(H,0,M),await me({...p,boardColumnOrder:ae})},[Ye,p,me]),q=(0,Be.useRef)(null),ce=(0,Be.useRef)(Ze);ce.current=Ze;let $=(0,Be.useRef)(De);$.current=De;let oe=(M,Ce,C)=>{let X=M.cloneNode(!0),H=M.getBoundingClientRect();return X.style.cssText=`position:fixed;z-index:9999;pointer-events:none;opacity:0.85;width:${H.width}px;transform:rotate(2deg);box-shadow:0 8px 24px rgba(0,0,0,0.2);`,X.style.left=`${Ce-H.width/2}px`,X.style.top=`${C-20}px`,document.body.appendChild(X),X},ve=(0,Be.useCallback)((M,Ce)=>{let C=M.touches[0],X=M.currentTarget,H=!1,ae=null,le=null,we=null,N=!1,be=setTimeout(()=>{N=!0,U(),Y(Ce)},500),Me=Oe=>{let $e=q.current;if(!$e)return;let Xe=$e.getBoundingClientRect(),ut=50,ct=8,gt=Oe-Xe.left<ut,It=Xe.right-Oe<ut;if(!gt&&!It){we&&(clearInterval(we),we=null);return}if(we)return;let At=It?1:-1;we=setInterval(()=>{$e.scrollLeft+=At*ct},16)},Se=()=>{we&&(clearInterval(we),we=null)},U=()=>{X.removeEventListener("touchmove",Le),X.removeEventListener("touchend",Pe),X.removeEventListener("touchcancel",Pe)},Le=Oe=>{let $e=Oe.touches[0];if(!H&&Math.abs($e.clientX-C.clientX)<12&&Math.abs($e.clientY-C.clientY)<12)return;clearTimeout(be),Oe.preventDefault(),Oe.stopPropagation(),H||(H=!0,X.classList.add("nb-touch-drag-source"),q.current?.classList.add("nb-board--dragging"),le=oe(X,$e.clientX,$e.clientY)),le&&(le.style.left=`${$e.clientX-le.offsetWidth/2}px`,le.style.top=`${$e.clientY-20}px`),X.classList.add("nb-touch-drag-hidden");let Xe=document.elementFromPoint($e.clientX,$e.clientY);X.classList.remove("nb-touch-drag-hidden"),X.classList.add("nb-touch-drag-source"),ae=Xe?.closest(".nb-board-column")?.dataset.colKey??null,ue(ae),Me($e.clientX)},Pe=()=>{clearTimeout(be),Se(),q.current?.classList.remove("nb-board--dragging"),X.classList.remove("nb-touch-drag-source","nb-touch-drag-hidden"),le?.remove(),!N&&H&&ae!==null&&ce.current(Ce.path,ae),ue(null),U()};X.addEventListener("touchmove",Le,{passive:!1}),X.addEventListener("touchend",Pe),X.addEventListener("touchcancel",Pe)},[]),S=(0,Be.useCallback)((M,Ce)=>{let C=M.touches[0],X=M.currentTarget.closest(".nb-board-column");if(!X)return;let H=!1,ae=null,le=null,we=null,N=U=>{let Le=q.current;if(!Le)return;let Pe=Le.getBoundingClientRect(),Oe=50,$e=8,Xe=U-Pe.left<Oe,ut=Pe.right-U<Oe;if(!Xe&&!ut){we&&(clearInterval(we),we=null);return}if(we)return;let ct=ut?1:-1;we=setInterval(()=>{Le.scrollLeft+=ct*$e},16)},be=()=>{we&&(clearInterval(we),we=null)},Me=U=>{let Le=U.touches[0];if(!H&&Math.abs(Le.clientX-C.clientX)<12&&Math.abs(Le.clientY-C.clientY)<12)return;U.preventDefault(),U.stopPropagation(),H||(H=!0,X.classList.add("nb-touch-drag-source"),q.current?.classList.add("nb-board--dragging"),le=oe(X,Le.clientX,Le.clientY)),le&&(le.style.left=`${Le.clientX-le.offsetWidth/2}px`,le.style.top=`${Le.clientY-20}px`),X.classList.add("nb-touch-drag-hidden");let Pe=document.elementFromPoint(Le.clientX,Le.clientY);X.classList.remove("nb-touch-drag-hidden"),X.classList.add("nb-touch-drag-source"),ae=Pe?.closest(".nb-board-column")?.dataset.colKey??null,de(ae),N(Le.clientX)},Se=()=>{be(),q.current?.classList.remove("nb-board--dragging"),X.classList.remove("nb-touch-drag-source","nb-touch-drag-hidden"),le?.remove(),H&&ae!==null&&$.current(Ce,ae),de(null),X.removeEventListener("touchmove",Me),X.removeEventListener("touchend",Se),X.removeEventListener("touchcancel",Se)};X.addEventListener("touchmove",Me,{passive:!1}),X.addEventListener("touchend",Se),X.addEventListener("touchcancel",Se)},[]),K=(0,Be.useCallback)(async M=>{if(!e||!Ee)return;let Ce=await t.createNote(e);M!==""&&await r.fileManager.processFrontMatter(Ce,C=>{C[Ee.id]=M})},[r,e,t,Ee]),D=(0,Be.useCallback)(async M=>{let Ce=M.map(C=>({id:C.id,columnId:C.columnId,operator:C.operator,value:C.value,conjunction:C.conjunction}));await me({...p,activePills:Ce})},[me,p]),Z=(M,Ce,C,X)=>{let H=[...s,{id:crypto.randomUUID(),columnId:M,columnName:Ce,columnType:X,icon:C,operator:io(X),value:"",conjunction:"and"}];c(H),D(H),re(!1)},ke=M=>{let Ce=s.filter(C=>C.id!==M);c(Ce),D(Ce)},ye=(M,Ce,C)=>{let X=s.map(H=>H.id===M?{...H,operator:Ce,value:C}:H);c(X),D(X)},ft=M=>{let Ce=s.map(C=>C.id===M?{...C,conjunction:C.conjunction==="and"?"or":"and"}:C);c(Ce),D(Ce)},Jt=(0,Be.useCallback)(async M=>{let Ce=p.hiddenColumns.includes(M)?p.hiddenColumns.filter(C=>C!==M):[...p.hiddenColumns,M];await me({...p,hiddenColumns:Ce})},[p,me]),vt=In(),Mt=e?.parent?.path??"",Et=(0,Be.useCallback)(M=>{r.workspace.getLeaf().openFile(M)},[r]),bt=(0,Be.useCallback)((M,Ce)=>{M.dataTransfer.effectAllowed="move",M.dataTransfer.setData("nb-drag-type",Yi),M.dataTransfer.setData("nb-row-path",Ce),M.dataTransfer.setData(Yi,"")},[]),$t=(0,Be.useCallback)((M,Ce)=>{Y(Ce)},[]);if(!e)return(0,Q.jsx)("div",{className:"nb-empty-state",children:(0,Q.jsx)("p",{children:u("no_database_open")})});if(a)return(0,Q.jsx)("div",{className:"nb-loading",children:u("loading")});if(Ae.length===0)return(0,Q.jsxs)("div",{className:"nb-empty-state",children:[(0,Q.jsx)("p",{children:u("board_no_select_col")}),(0,Q.jsx)("p",{children:u("board_add_select_hint")})]});let it=M=>{M!=="fields"&&P(!1),M!=="groupby"&&V(!1),M!=="filter"&&re(!1)},en=vt?(0,Q.jsxs)($n,{actionBarRef:_e,actions:[{id:"fields",label:u("fields"),icon:(0,Q.jsx)(mn,{}),active:R,onClick:()=>{it("fields"),P(M=>!M)}},{id:"groupby",label:u("group_by"),icon:(0,Q.jsx)(so,{}),active:L,onClick:()=>{it("groupby"),V(M=>!M)}},{id:"subfolders",label:u("tooltip_include_subfolders"),icon:(0,Q.jsx)(On,{}),active:!!p.includeSubfolders,onClick:()=>{it(),me({...p,includeSubfolders:!p.includeSubfolders})}},{id:"filter",label:u("filter"),icon:(0,Q.jsx)(An,{}),active:W,badge:s.length||void 0,onClick:()=>{it("filter"),re(M=>!M)}}],rowCount:Fe.length,rowCountLabel:Fe.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase(),filters:s,onFilterUpdate:ye,onFilterRemove:ke,onConjunctionToggle:ft,children:[(0,Q.jsx)(ot,{open:R,onClose:()=>P(!1),title:u("fields_in_card"),children:l.schema.filter(M=>M.id!==Ee?.id&&M.type!=="title").map(M=>(0,Q.jsxs)("label",{className:"nb-field-row",children:[(0,Q.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:M.visible&&!p.hiddenColumns.includes(M.id),onChange:()=>{Jt(M.id)}}),(0,Q.jsx)("span",{className:"nb-field-icon",children:Ke(M.type)}),(0,Q.jsx)("span",{className:"nb-field-name",children:M.name})]},M.id))}),(0,Q.jsx)(ot,{open:L,onClose:()=>V(!1),title:u("group_by"),children:Ae.map(M=>(0,Q.jsxs)("button",{className:`nb-menu-item${p.groupByColumnId===M.id?" nb-menu-item--active":""}`,onClick:()=>{me({...p,groupByColumnId:M.id}),V(!1)},children:[(0,Q.jsx)("span",{className:"nb-menu-item-icon",children:Ke(M.type)}),(0,Q.jsx)("span",{children:M.name})]},M.id))}),(0,Q.jsxs)(ot,{open:W,onClose:()=>re(!1),title:u("filter"),children:[(0,Q.jsxs)("button",{className:"nb-menu-item",onClick:()=>Z("_title",u("name_column"),"\u{1F4C4}","title"),children:[(0,Q.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,Q.jsx)("span",{children:u("name_column")})]}),l.schema.map(M=>(0,Q.jsxs)("button",{className:"nb-menu-item",onClick:()=>Z(M.id,M.name,Ke(M.type),M.type),children:[(0,Q.jsx)("span",{className:"nb-menu-item-icon",children:Ke(M.type)}),(0,Q.jsx)("span",{children:M.name})]},M.id))]}),(0,Q.jsxs)("div",{className:"nb-mobile-toggles-row",children:[(0,Q.jsxs)("label",{className:"nb-mobile-toggle",children:[(0,Q.jsx)("input",{type:"checkbox",checked:g,onChange:M=>d(M.target.checked)}),(0,Q.jsx)("span",{children:u("hide_empty_cols")})]}),(0,Q.jsxs)("label",{className:"nb-mobile-toggle",children:[(0,Q.jsx)("input",{type:"checkbox",checked:v,onChange:M=>h(M.target.checked)}),(0,Q.jsx)("span",{children:u("hide_no_value_cols")})]})]})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("div",{className:"nb-toolbar",children:[(0,Q.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:te,children:[(0,Q.jsx)("button",{className:`nb-toolbar-btn${R?" nb-toolbar-btn--active":""}`,onClick:()=>P(M=>!M),children:u("fields")}),R&&(0,Q.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,Q.jsx)("div",{className:"nb-fields-dropdown-label",children:u("fields_in_card")}),l.schema.filter(M=>M.id!==Ee?.id&&M.type!=="title").map(M=>(0,Q.jsxs)("label",{className:"nb-field-row",children:[(0,Q.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:M.visible&&!p.hiddenColumns.includes(M.id),onChange:()=>{Jt(M.id)}}),(0,Q.jsx)("span",{className:"nb-field-icon",children:Ke(M.type)}),(0,Q.jsx)("span",{className:"nb-field-name",children:M.name})]},M.id))]})]}),(0,Q.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:j,children:[(0,Q.jsxs)("button",{className:`nb-toolbar-btn${L?" nb-toolbar-btn--active":""}`,onClick:()=>V(M=>!M),children:[u("group_by"),": ",(0,Q.jsx)("strong",{children:Ee?.name??"\u2014"})]}),L&&(0,Q.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,Q.jsx)("div",{className:"nb-fields-dropdown-label",children:u("group_by_label")}),Ae.map(M=>(0,Q.jsxs)("button",{className:`nb-menu-item${p.groupByColumnId===M.id?" nb-menu-item--active":""}`,onClick:()=>{me({...p,groupByColumnId:M.id}),V(!1)},children:[(0,Q.jsx)("span",{className:"nb-menu-item-icon",children:Ke(M.type)}),(0,Q.jsx)("span",{children:M.name})]},M.id))]})]}),(0,Q.jsxs)("label",{className:"nb-toolbar-btn nb-toolbar-toggle",children:[(0,Q.jsx)("input",{type:"checkbox",checked:g,onChange:M=>d(M.target.checked)}),u("hide_empty_cols")]}),(0,Q.jsxs)("label",{className:"nb-toolbar-btn nb-toolbar-toggle",children:[(0,Q.jsx)("input",{type:"checkbox",checked:v,onChange:M=>h(M.target.checked)}),u("hide_no_value_cols")]}),(0,Q.jsx)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon nb-subfolder-toggle ${p.includeSubfolders?"nb-toolbar-btn--active":""}`,onClick:()=>{me({...p,includeSubfolders:!p.includeSubfolders})},title:u("tooltip_include_subfolders"),children:(0,Q.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Q.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),(0,Q.jsx)("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),(0,Q.jsx)("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]})}),(0,Q.jsxs)("span",{className:"nb-row-count",children:[Fe.length," ",Fe.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase()]}),(0,Q.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:ie,style:{marginLeft:"auto"},children:[(0,Q.jsxs)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon${W?" nb-toolbar-btn--active":""}`,onClick:()=>re(M=>!M),title:u("filters"),children:[(0,Q.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,Q.jsx)("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})}),s.length>0&&(0,Q.jsx)("span",{className:"nb-hidden-badge",children:s.length})]}),W&&(0,Q.jsxs)("div",{className:"nb-fields-dropdown nb-filter-menu-dropdown",children:[(0,Q.jsx)("div",{className:"nb-fields-dropdown-label",children:u("filter_by")}),(0,Q.jsxs)("button",{className:"nb-menu-item",onClick:()=>Z("_title",u("name_column"),"\u{1F4C4}","title"),children:[(0,Q.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,Q.jsx)("span",{children:u("name_column")})]}),l.schema.map(M=>(0,Q.jsxs)("button",{className:"nb-menu-item",onClick:()=>Z(M.id,M.name,Ke(M.type),M.type),children:[(0,Q.jsx)("span",{className:"nb-menu-item-icon",children:Ke(M.type)}),(0,Q.jsx)("span",{children:M.name})]},M.id))]})]})]}),s.length>0&&(0,Q.jsx)("div",{className:"nb-filter-pills-row",children:s.map((M,Ce)=>(0,Q.jsxs)(Be.Fragment,{children:[Ce>0&&(0,Q.jsx)("button",{className:`nb-pill-conjunction${M.conjunction==="or"?" nb-pill-conjunction--or":""}`,onClick:()=>ft(M.id),children:M.conjunction==="or"?u("conjunction_or"):u("conjunction_and")}),(0,Q.jsxs)("span",{className:"nb-filter-pill",children:[(0,Q.jsx)("span",{className:"nb-pill-icon",children:M.icon}),(0,Q.jsx)("span",{className:"nb-pill-name",children:M.columnName}),(0,Q.jsx)("select",{className:"nb-pill-op-select",value:M.operator,onChange:C=>ye(M.id,C.target.value,M.value),children:Dn(M.columnType).map(C=>(0,Q.jsx)("option",{value:C,children:Mn[C]},C))}),!Cn.has(M.operator)&&(0,Q.jsx)("input",{className:"nb-pill-value-input",type:"text",value:M.value,onChange:C=>ye(M.id,M.operator,C.target.value)}),(0,Q.jsx)("button",{className:"nb-pill-remove",onClick:()=>ke(M.id),children:"\xD7"})]})]},M.id))})]});return(0,Q.jsxs)("div",{className:"nb-container",children:[en,(0,Q.jsx)("div",{className:"nb-board",ref:q,children:Ye.map(M=>{let Ce=M.value||"__no_value__";return(0,Q.jsxs)("div",{"data-col-key":Ce,className:`nb-board-column${J===Ce?" nb-board-column--card-over":""}${Ne===Ce?" nb-board-column--col-over":""}${(()=>{let H=p.boardColumnLimits?.[M.value];return H&&H>0&&M.rows.length>=H?" nb-board-column--over-limit":""})()}`,onDragOver:H=>{H.preventDefault(),(H.dataTransfer.types.includes(Yi)?Yi:Nu)===Yi?ue(Ce):de(Ce)},onDragLeave:H=>{let ae=H.relatedTarget;H.currentTarget.contains(ae)||(ue(null),de(null))},onDrop:async H=>{H.preventDefault(),ue(null),de(null);let ae=H.dataTransfer.getData("nb-drag-type");if(ae===Yi){let le=H.dataTransfer.getData("nb-row-path");le&&await Ze(le,M.value)}else if(ae===Nu){let le=H.dataTransfer.getData("nb-col-value");le!==void 0&&await De(le,M.value)}},children:[(0,Q.jsxs)("div",{className:"nb-board-column-header",draggable:!vt,onDragStart:vt?void 0:H=>{H.stopPropagation(),H.dataTransfer.effectAllowed="move",H.dataTransfer.setData("nb-drag-type",Nu),H.dataTransfer.setData("nb-col-value",M.value),H.dataTransfer.setData(Nu,"")},onDragEnd:vt?void 0:()=>de(null),title:u("board_drag_reorder"),children:[(0,Q.jsx)("span",{className:"nb-board-column-drag-handle",onTouchStart:vt?H=>S(H,M.value):void 0,children:"\u283F"}),M.color?(0,Q.jsx)("span",{className:"nb-board-column-badge",style:{background:M.color},children:M.label}):(0,Q.jsx)("span",{className:"nb-board-column-name",children:M.label}),(()=>{let H=p.boardColumnLimits?.[M.value],ae=M.rows.length,le=H!==void 0&&H>0&&ae>=H;return(0,Q.jsx)("span",{className:`nb-board-column-count ${le?"nb-board-column-count--over":""}`,onClick:we=>{we.stopPropagation(),_(y===M.value?null:M.value)},title:u("board_set_limit"),children:H&&H>0?`${ae}/${H}`:ae})})()]}),y===M.value&&(0,Q.jsx)("div",{className:"nb-board-limit-input-wrapper",children:(0,Q.jsx)("input",{className:"nb-board-limit-input",type:"number",min:"0",placeholder:u("board_limit_placeholder"),defaultValue:p.boardColumnLimits?.[M.value]??"",autoFocus:!0,onKeyDown:H=>{if(H.key==="Enter"||H.key==="Escape"){let ae=parseInt(H.target.value),le={...p.boardColumnLimits};isNaN(ae)||ae<=0?delete le[M.value]:le[M.value]=ae,me({...p,boardColumnLimits:le}),_(null)}},onBlur:H=>{let ae=parseInt(H.target.value),le={...p.boardColumnLimits};isNaN(ae)||ae<=0?delete le[M.value]:le[M.value]=ae,me({...p,boardColumnLimits:le}),_(null)}})}),(0,Q.jsx)("div",{className:"nb-board-cards",children:(()=>{let H=p.boardColumnLimits?.[M.value],ae=f.has(M.value),le=H&&H>0&&!ae?M.rows.slice(0,H):M.rows,we=M.rows.length-le.length;return(0,Q.jsxs)(Q.Fragment,{children:[le.map(N=>{let be=le.length>=Jk,Me=(0,Q.jsx)(tS,{row:N,isMobile:vt,visibleCols:Ve,dbFolderPath:Mt,includeSubfolders:p.includeSubfolders??!1,onOpen:Et,onDragStart:bt,onTouchStart:ve,onContextMenu:$t},N._file.path);return be?(0,Q.jsx)(eS,{children:Me},N._file.path):(0,Q.jsx)(Be.Fragment,{children:Me},N._file.path)}),we>0&&(0,Q.jsx)("button",{className:"nb-board-show-more",onClick:()=>w(N=>{let be=new Set(N);return be.add(M.value),be}),children:`+${we} ${u("board_show_more")}`}),ae&&H&&H>0&&M.rows.length>H&&(0,Q.jsx)("button",{className:"nb-board-show-more",onClick:()=>w(N=>{let be=new Set(N);return be.delete(M.value),be}),children:u("board_show_less")})]})})()}),(0,Q.jsx)("button",{className:"nb-board-add-card",onClick:()=>{K(M.value)},children:"+ "+u("add_card")})]},Ce)})}),(0,Q.jsxs)(ot,{open:Re!==null,onClose:()=>Y(null),title:Re?.basename??"",children:[(0,Q.jsxs)("button",{className:"nb-menu-item",onClick:()=>{Re&&r.workspace.getLeaf().openFile(Re),Y(null)},children:[(0,Q.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,Q.jsx)("span",{children:u("open_note")})]}),(0,Q.jsxs)("button",{className:"nb-menu-item",onClick:()=>{Re&&t.duplicateNotes([Re]),Y(null)},children:[(0,Q.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4CB}"}),(0,Q.jsx)("span",{children:u("duplicate_note")})]}),(0,Q.jsx)("div",{className:"nb-menu-separator"}),(0,Q.jsxs)("button",{className:"nb-menu-item nb-menu-item--danger",onClick:()=>{Re&&t.deleteNotes([Re]),Y(null)},children:[(0,Q.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F5D1}"}),(0,Q.jsx)("span",{children:u("delete_note")})]})]})]})}var nt=ze(yt(),1),Fv=ze(vo(),1);var G=ze(Rt(),1),Ev=()=>({small:u("size_small"),medium:u("size_medium"),large:u("size_large")}),nS={small:"repeat(auto-fill, minmax(160px, 1fr))",medium:"repeat(auto-fill, minmax(220px, 1fr))",large:"repeat(auto-fill, minmax(300px, 1fr))"};function oS({sorts:e,schema:t,onSortChange:n,onClose:o,anchorRect:r,panelRef:i}){let[l,a]=(0,nt.useState)({x:r.right-280,y:r.bottom+4}),s=d=>{d.preventDefault();let v=d.clientX-l.x,h=d.clientY-l.y,y=f=>a({x:f.clientX-v,y:f.clientY-h}),_=()=>{window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",_)};window.addEventListener("mousemove",y),window.addEventListener("mouseup",_)},c=t.filter(d=>d.type!=="formula"&&d.type!=="lookup"&&d.type!=="relation"&&d.type!=="multiselect"),p=new Set(e.map(d=>d.columnId)),m=[...p.has("_title")?[]:[{id:"_title",name:"Nome"}],...c.filter(d=>!p.has(d.id)).map(d=>({id:d.id,name:d.name}))],g=(d,v)=>{let h=[...e],y=d+v;y<0||y>=h.length||([h[d],h[y]]=[h[y],h[d]],n(h))};return(0,Fv.createPortal)((0,G.jsxs)("div",{ref:i,className:"nb-sort-panel",style:{position:"fixed",top:l.y,left:l.x},children:[(0,G.jsxs)("div",{className:"nb-sort-panel-titlebar",onMouseDown:s,children:[(0,G.jsx)("span",{className:"nb-sort-panel-title",children:u("sort_by")}),(0,G.jsx)("button",{className:"nb-sort-panel-close",onClick:o,title:u("tooltip_close"),children:"\xD7"})]}),e.length===0&&(0,G.jsx)("div",{className:"nb-sort-panel-empty",children:u("no_active_sorts")}),e.map((d,v)=>{let h=d.columnId==="_title"?"Nome":t.find(y=>y.id===d.columnId)?.name??d.columnId;return(0,G.jsxs)("div",{className:"nb-sort-row",children:[(0,G.jsxs)("div",{className:"nb-sort-row-priority",children:[(0,G.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>g(v,-1),disabled:v===0,title:u("tooltip_move_up"),children:"\u2191"}),(0,G.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>g(v,1),disabled:v===e.length-1,title:u("tooltip_move_down"),children:"\u2193"})]}),(0,G.jsx)("span",{className:"nb-sort-row-name",children:h}),(0,G.jsx)("button",{className:"nb-sort-dir-btn",onClick:()=>n(e.map(y=>y.columnId===d.columnId?{...y,direction:y.direction==="asc"?"desc":"asc"}:y)),children:d.direction==="asc"?u("sort_asc"):u("sort_desc")}),(0,G.jsx)("button",{className:"nb-sort-remove-btn",onClick:()=>n(e.filter(y=>y.columnId!==d.columnId)),title:u("tooltip_remove"),children:"\xD7"})]},d.columnId)}),m.length>0&&(0,G.jsx)("div",{className:"nb-sort-add-row",children:(0,G.jsxs)("select",{className:"nb-sort-add-select",value:"",onChange:d=>{d.target.value&&(n([...e,{columnId:d.target.value,direction:"asc"}]),d.target.value="")},children:[(0,G.jsx)("option",{value:"",children:"+ "+u("add_sort")+"..."}),m.map(d=>(0,G.jsx)("option",{value:d.id,children:d.name},d.id))]})})]}),document.body)}var rS=nt.default.memo(function({row:t,cardSize:n,coverField:o,visibleCols:r,dbFolderPath:i,includeSubfolders:l,onOpen:a}){let s=Dt(),c=o?.type==="image"?t[o.id]??null:null,p=c?s.vault.getFileByPath(c):null,m=p?s.vault.getResourcePath(p):null,g=o&&o.type!=="image"?o.type==="title"?t._title:String(t[o.id]??""):null,d=t._file.parent?.path??"",v=l&&d.length>i.length?d.slice(i.length+1):"";return(0,G.jsxs)("div",{className:`nb-gallery-card nb-gallery-card--${n}`,onClick:()=>a(t._file),children:[m?(0,G.jsx)("div",{className:"nb-gallery-cover nb-gallery-cover--image",children:(0,G.jsx)("img",{src:m,alt:""})}):g?(0,G.jsx)("div",{className:"nb-gallery-cover nb-gallery-cover--text",children:(0,G.jsx)("span",{children:g})}):(0,G.jsx)("div",{className:"nb-gallery-cover nb-gallery-cover--empty",children:(0,G.jsx)("span",{className:"nb-gallery-cover-icon",children:"\u{1F4C4}"})}),(0,G.jsxs)("div",{className:"nb-gallery-body",children:[(0,G.jsx)("div",{className:"nb-gallery-title",children:t._title}),v?(0,G.jsx)("div",{className:"nb-folder-path",children:v}):null,r.length>0&&(0,G.jsx)("div",{className:"nb-gallery-props",children:r.map(h=>{let y=t[h.id];if(y==null||String(y).trim()==="")return null;let _=Array.isArray(y)?y.join(", "):String(y);return(0,G.jsxs)("span",{className:"nb-gallery-prop",children:[(0,G.jsxs)("span",{className:"nb-gallery-prop-name",children:[h.name,":"]}),(0,G.jsx)("span",{className:"nb-gallery-prop-value",children:_})]},h.id)})})]})]})});function Dv({dbFile:e,manager:t,externalView:n,onViewChange:o}){let r=Dt(),{rows:i,config:l,loading:a,activeFilters:s,setActiveFilters:c}=Ln({app:r,dbFile:e,manager:t,includeSubfolders:n.includeSubfolders,externalView:n}),[p,m]=(0,nt.useState)(n),[g,d]=(0,nt.useState)(!1),[v,h]=(0,nt.useState)(!1),[y,_]=(0,nt.useState)(!1),[f,w]=(0,nt.useState)(!1),[R,P]=(0,nt.useState)(!1),[L,V]=(0,nt.useState)(null),W=(0,nt.useRef)(null),re=(0,nt.useRef)(null),J=(0,nt.useRef)(null),ue=(0,nt.useRef)(null),Ne=(0,nt.useRef)(null),de=(0,nt.useRef)(null),Re=(0,nt.useRef)(null);(0,nt.useEffect)(()=>{m(n)},[n.id]);let Y=(0,nt.useCallback)(async S=>{m(S),await o(S)},[o]);(0,nt.useEffect)(()=>{if(!g)return;let S=K=>{Re.current?.contains(K.target)||W.current&&!W.current.contains(K.target)&&d(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[g]),(0,nt.useEffect)(()=>{if(!v)return;let S=K=>{Re.current?.contains(K.target)||re.current&&!re.current.contains(K.target)&&h(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[v]),(0,nt.useEffect)(()=>{if(!y)return;let S=K=>{Re.current?.contains(K.target)||J.current&&!J.current.contains(K.target)&&_(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[y]),(0,nt.useEffect)(()=>{if(!f)return;let S=K=>{Re.current?.contains(K.target)||ue.current&&!ue.current.contains(K.target)&&w(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[f]),(0,nt.useEffect)(()=>{if(!R)return;let S=K=>{Re.current?.contains(K.target)||de.current?.contains(K.target)||Ne.current&&!Ne.current.contains(K.target)&&P(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[R]);let te=Pn(s,200),j=(0,nt.useMemo)(()=>lo(i,te),[i,te]),ie=(0,nt.useMemo)(()=>qn(j,p.sorts),[j,p.sorts]),_e=(0,nt.useMemo)(()=>l.schema.filter(S=>S.visible&&!p.hiddenColumns.includes(S.id)),[l.schema,p.hiddenColumns]),me=(0,nt.useMemo)(()=>l.schema.find(S=>S.id===p.galleryCoverField)??null,[l.schema,p.galleryCoverField]),Ae=p.galleryCardSize??"medium",Ee=nS[Ae],xe=(0,nt.useCallback)(async S=>{let K=S.map(D=>({id:D.id,columnId:D.columnId,operator:D.operator,value:D.value,conjunction:D.conjunction}));await Y({...p,activePills:K})},[Y,p]),Fe=(S,K,D,Z)=>{let ke=[...s,{id:crypto.randomUUID(),columnId:S,columnName:K,columnType:Z,icon:D,operator:io(Z),value:"",conjunction:"and"}];c(ke),xe(ke),d(!1)},Ie=S=>{let K=s.filter(D=>D.id!==S);c(K),xe(K)},Ve=(S,K,D)=>{let Z=s.map(ke=>ke.id===S?{...ke,operator:K,value:D}:ke);c(Z),xe(Z)},He=S=>{let K=s.map(D=>D.id===S?{...D,conjunction:D.conjunction==="and"?"or":"and"}:D);c(K),xe(K)},Ye=(0,nt.useCallback)(async S=>{let K=p.hiddenColumns.includes(S)?p.hiddenColumns.filter(D=>D!==S):[...p.hiddenColumns,S];await Y({...p,hiddenColumns:K})},[p,Y]),Ze=(0,nt.useCallback)(async S=>{await Y({...p,sorts:S})},[p,Y]),De=async()=>{e&&await t.createNote(e)},q=In(),ce=e?.parent?.path??"",$=(0,nt.useCallback)(S=>{r.workspace.getLeaf().openFile(S)},[r]);if(!e)return(0,G.jsx)("div",{className:"nb-empty-state",children:(0,G.jsx)("p",{children:u("no_database_open")})});if(a)return(0,G.jsx)("div",{className:"nb-loading",children:u("loading")});let oe=S=>{S!=="fields"&&h(!1),S!=="cover"&&_(!1),S!=="filter"&&d(!1),S!=="sort"&&P(!1)},ve=q?(0,G.jsxs)($n,{actionBarRef:Re,actions:[{id:"fields",label:u("fields"),icon:(0,G.jsx)(mn,{}),active:v,onClick:()=>{oe("fields"),h(S=>!S)}},{id:"cover",label:u("cover"),icon:(0,G.jsx)(mn,{}),active:y,onClick:()=>{oe("cover"),_(S=>!S)}},{id:"subfolders",label:u("tooltip_include_subfolders"),icon:(0,G.jsx)(On,{}),active:!!p.includeSubfolders,onClick:()=>{oe(),Y({...p,includeSubfolders:!p.includeSubfolders})}},{id:"sort",label:u("sort"),icon:(0,G.jsx)(so,{}),active:p.sorts.length>0,badge:p.sorts.length||void 0,onClick:()=>{oe("sort"),!R&&de.current&&V(de.current.getBoundingClientRect()),P(S=>!S)}},{id:"filter",label:u("filter"),icon:(0,G.jsx)(An,{}),active:g,badge:s.length||void 0,onClick:()=>{oe("filter"),d(S=>!S)}}],rowCount:ie.length,rowCountLabel:ie.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase(),filters:s,onFilterUpdate:Ve,onFilterRemove:Ie,onConjunctionToggle:He,children:[(0,G.jsx)(ot,{open:v,onClose:()=>h(!1),title:u("fields"),children:l.schema.map(S=>(0,G.jsxs)("label",{className:"nb-field-row",children:[(0,G.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:S.visible&&!p.hiddenColumns.includes(S.id),onChange:()=>{Ye(S.id)}}),(0,G.jsx)("span",{className:"nb-field-icon",children:Ke(S.type)}),(0,G.jsx)("span",{className:"nb-field-name",children:S.name})]},S.id))}),(0,G.jsxs)(ot,{open:y,onClose:()=>_(!1),title:u("cover"),children:[(0,G.jsxs)("button",{className:`nb-menu-item${p.galleryCoverField?"":" nb-menu-item--active"}`,onClick:()=>{Y({...p,galleryCoverField:void 0}),_(!1)},children:[(0,G.jsx)("span",{className:"nb-menu-item-icon",children:"\u2014"}),(0,G.jsx)("span",{children:u("no_cover")})]}),l.schema.filter(S=>S.type==="text"||S.type==="title"||S.type==="image").map(S=>(0,G.jsxs)("button",{className:`nb-menu-item${p.galleryCoverField===S.id?" nb-menu-item--active":""}`,onClick:()=>{Y({...p,galleryCoverField:S.id}),_(!1)},children:[(0,G.jsx)("span",{className:"nb-menu-item-icon",children:Ke(S.type)}),(0,G.jsx)("span",{children:S.name})]},S.id))]}),(0,G.jsxs)(ot,{open:g,onClose:()=>d(!1),title:u("filter"),children:[(0,G.jsxs)("button",{className:"nb-menu-item",onClick:()=>Fe("_title","Nome","\u{1F4C4}","title"),children:[(0,G.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,G.jsx)("span",{children:u("name_column")})]}),l.schema.map(S=>(0,G.jsxs)("button",{className:"nb-menu-item",onClick:()=>Fe(S.id,S.name,Ke(S.type),S.type),children:[(0,G.jsx)("span",{className:"nb-menu-item-icon",children:Ke(S.type)}),(0,G.jsx)("span",{children:S.name})]},S.id))]}),(0,G.jsxs)(ot,{open:R,onClose:()=>P(!1),title:u("sort"),children:[p.sorts.length===0&&(0,G.jsx)("div",{className:"nb-sort-panel-empty",style:{padding:"8px 0"},children:u("no_active_sorts")}),p.sorts.map((S,K)=>{let D=S.columnId==="_title"?"Nome":l.schema.find(Z=>Z.id===S.columnId)?.name??S.columnId;return(0,G.jsxs)("div",{className:"nb-sort-row",style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 0",minHeight:"44px"},children:[(0,G.jsxs)("div",{className:"nb-sort-row-priority",style:{display:"flex",flexDirection:"column",gap:"2px"},children:[(0,G.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>{let Z=[...p.sorts];K>0&&([Z[K],Z[K-1]]=[Z[K-1],Z[K]],Ze(Z))},disabled:K===0,children:"\u2191"}),(0,G.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>{let Z=[...p.sorts];K<Z.length-1&&([Z[K],Z[K+1]]=[Z[K+1],Z[K]],Ze(Z))},disabled:K===p.sorts.length-1,children:"\u2193"})]}),(0,G.jsx)("span",{style:{flex:1},children:D}),(0,G.jsx)("button",{className:"nb-sort-dir-btn",onClick:()=>{Ze(p.sorts.map(Z=>Z.columnId===S.columnId?{...Z,direction:Z.direction==="asc"?"desc":"asc"}:Z))},children:S.direction==="asc"?u("sort_asc"):u("sort_desc")}),(0,G.jsx)("button",{className:"nb-sort-remove-btn",onClick:()=>{Ze(p.sorts.filter(Z=>Z.columnId!==S.columnId))},children:"\xD7"})]},S.columnId)}),(()=>{let S=l.schema.filter(Z=>Z.type!=="formula"&&Z.type!=="lookup"&&Z.type!=="relation"&&Z.type!=="multiselect"),K=new Set(p.sorts.map(Z=>Z.columnId)),D=[...K.has("_title")?[]:[{id:"_title",name:"Nome"}],...S.filter(Z=>!K.has(Z.id)).map(Z=>({id:Z.id,name:Z.name}))];return D.length===0?null:(0,G.jsxs)("select",{className:"nb-mobile-filter-overlay-select",style:{width:"100%",marginTop:"8px",padding:"10px"},value:"",onChange:Z=>{Z.target.value&&(Ze([...p.sorts,{columnId:Z.target.value,direction:"asc"}]),Z.target.value="")},children:[(0,G.jsx)("option",{value:"",children:"+ "+u("add_sort")+"..."}),D.map(Z=>(0,G.jsx)("option",{value:Z.id,children:Z.name},Z.id))]})})()]})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)("div",{className:"nb-toolbar",children:[(0,G.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:re,children:[(0,G.jsx)("button",{className:`nb-toolbar-btn${v?" nb-toolbar-btn--active":""}`,onClick:()=>h(S=>!S),children:u("fields")}),v&&(0,G.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,G.jsx)("div",{className:"nb-fields-dropdown-label",children:u("fields_label")}),l.schema.map(S=>(0,G.jsxs)("label",{className:"nb-field-row",children:[(0,G.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:S.visible&&!p.hiddenColumns.includes(S.id),onChange:()=>{Ye(S.id)}}),(0,G.jsx)("span",{className:"nb-field-icon",children:Ke(S.type)}),(0,G.jsx)("span",{className:"nb-field-name",children:S.name})]},S.id))]})]}),(0,G.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:J,children:[(0,G.jsxs)("button",{className:`nb-toolbar-btn${y?" nb-toolbar-btn--active":""}`,onClick:()=>_(S=>!S),children:[u("cover"),": ",(0,G.jsx)("strong",{children:me?.name??u("no_cover")})]}),y&&(0,G.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,G.jsx)("div",{className:"nb-fields-dropdown-label",children:u("cover_field_label")}),(0,G.jsxs)("button",{className:`nb-menu-item${p.galleryCoverField?"":" nb-menu-item--active"}`,onClick:()=>{Y({...p,galleryCoverField:void 0}),_(!1)},children:[(0,G.jsx)("span",{className:"nb-menu-item-icon",children:"\u2014"}),(0,G.jsx)("span",{children:u("no_cover")})]}),l.schema.filter(S=>S.type==="text"||S.type==="title"||S.type==="image").map(S=>(0,G.jsxs)("button",{className:`nb-menu-item${p.galleryCoverField===S.id?" nb-menu-item--active":""}`,onClick:()=>{Y({...p,galleryCoverField:S.id}),_(!1)},children:[(0,G.jsx)("span",{className:"nb-menu-item-icon",children:Ke(S.type)}),(0,G.jsx)("span",{children:S.name})]},S.id))]})]}),(0,G.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:ue,children:[(0,G.jsx)("button",{className:`nb-toolbar-btn${f?" nb-toolbar-btn--active":""}`,onClick:()=>w(S=>!S),children:Ev()[Ae]}),f&&(0,G.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,G.jsx)("div",{className:"nb-fields-dropdown-label",children:u("card_size_label")}),["small","medium","large"].map(S=>(0,G.jsx)("button",{className:`nb-menu-item${Ae===S?" nb-menu-item--active":""}`,onClick:()=>{Y({...p,galleryCardSize:S}),w(!1)},children:Ev()[S]},S))]})]}),(0,G.jsx)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon nb-subfolder-toggle ${p.includeSubfolders?"nb-toolbar-btn--active":""}`,onClick:()=>{Y({...p,includeSubfolders:!p.includeSubfolders})},title:u("tooltip_include_subfolders"),children:(0,G.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,G.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),(0,G.jsx)("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),(0,G.jsx)("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]})}),(0,G.jsxs)("span",{className:"nb-row-count",children:[ie.length," ",ie.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase()]}),(0,G.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:W,style:{marginLeft:"auto"},children:[(0,G.jsxs)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon${g?" nb-toolbar-btn--active":""}`,onClick:()=>d(S=>!S),title:u("filters"),children:[(0,G.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,G.jsx)("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})}),s.length>0&&(0,G.jsx)("span",{className:"nb-hidden-badge",children:s.length})]}),g&&(0,G.jsxs)("div",{className:"nb-fields-dropdown nb-filter-menu-dropdown",children:[(0,G.jsx)("div",{className:"nb-fields-dropdown-label",children:u("filter_by")}),(0,G.jsxs)("button",{className:"nb-menu-item",onClick:()=>Fe("_title","Nome","\u{1F4C4}","title"),children:[(0,G.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,G.jsx)("span",{children:u("name_column")})]}),l.schema.map(S=>(0,G.jsxs)("button",{className:"nb-menu-item",onClick:()=>Fe(S.id,S.name,Ke(S.type),S.type),children:[(0,G.jsx)("span",{className:"nb-menu-item-icon",children:Ke(S.type)}),(0,G.jsx)("span",{children:S.name})]},S.id))]})]}),(0,G.jsxs)("button",{ref:de,className:`nb-toolbar-btn${p.sorts.length>0?" nb-toolbar-btn--active":""}`,onClick:()=>{!R&&de.current&&V(de.current.getBoundingClientRect()),P(S=>!S)},children:[(0,G.jsx)("span",{children:u("sort")}),p.sorts.length>0&&(0,G.jsx)("span",{className:"nb-hidden-badge",children:p.sorts.length})]}),R&&L&&(0,G.jsx)(oS,{sorts:p.sorts,schema:l.schema,onSortChange:S=>{Ze(S)},onClose:()=>P(!1),anchorRect:L,panelRef:Ne})]}),s.length>0&&(0,G.jsx)("div",{className:"nb-filter-pills-row",children:s.map((S,K)=>(0,G.jsxs)(nt.Fragment,{children:[K>0&&(0,G.jsx)("button",{className:`nb-pill-conjunction${S.conjunction==="or"?" nb-pill-conjunction--or":""}`,onClick:()=>He(S.id),children:S.conjunction==="or"?u("conjunction_or"):u("conjunction_and")}),(0,G.jsxs)("span",{className:"nb-filter-pill",children:[(0,G.jsx)("span",{className:"nb-pill-icon",children:S.icon}),(0,G.jsx)("span",{className:"nb-pill-name",children:S.columnName}),(0,G.jsx)("select",{className:"nb-pill-op-select",value:S.operator,onChange:D=>Ve(S.id,D.target.value,S.value),children:Dn(S.columnType).map(D=>(0,G.jsx)("option",{value:D,children:Mn[D]},D))}),!Cn.has(S.operator)&&(0,G.jsx)("input",{className:"nb-pill-value-input",type:"text",value:S.value,onChange:D=>Ve(S.id,S.operator,D.target.value)}),(0,G.jsx)("button",{className:"nb-pill-remove",onClick:()=>Ie(S.id),children:"\xD7"})]})]},S.id))})]});return(0,G.jsxs)("div",{className:"nb-container",children:[ve,(0,G.jsxs)("div",{className:"nb-gallery",style:{gridTemplateColumns:Ee},children:[ie.map(S=>(0,G.jsx)(rS,{row:S,cardSize:Ae,coverField:me,visibleCols:_e,dbFolderPath:ce,includeSubfolders:p.includeSubfolders??!1,onOpen:$},S._file.path)),(0,G.jsx)("div",{className:"nb-gallery-card nb-gallery-card--add",onClick:()=>{De()},children:(0,G.jsx)("div",{className:"nb-gallery-add-inner",children:"+ "+u("add_entry")})})]})]})}var Je=ze(yt(),1);var B=ze(Rt(),1),Mv=()=>[u("day_sun"),u("day_mon"),u("day_tue"),u("day_wed"),u("day_thu"),u("day_fri"),u("day_sat")],Tv=()=>[u("month_january"),u("month_february"),u("month_march"),u("month_april"),u("month_may"),u("month_june"),u("month_july"),u("month_august"),u("month_september"),u("month_october"),u("month_november"),u("month_december")];function iS(e,t){let n=new Date(e,t,1).getDay(),o=new Date(e,t+1,0).getDate(),r=[];for(let i=0;i<n;i++)r.push(null);for(let i=1;i<=o;i++)r.push(i);for(;r.length%7!==0;)r.push(null);return r}function lS(e,t,n){let o=new Date(e,t,n),r=o.getDay(),i=new Date(o);i.setDate(o.getDate()-r);let l=[];for(let a=0;a<7;a++){let s=new Date(i);s.setDate(i.getDate()+a),l.push(s)}return l}function Lv(e){if(e.length===0)return"";let t=e[0],n=e[6],r=[u("month_january"),u("month_february"),u("month_march"),u("month_april"),u("month_may"),u("month_june"),u("month_july"),u("month_august"),u("month_september"),u("month_october"),u("month_november"),u("month_december")];return t.getMonth()===n.getMonth()?`${r[t.getMonth()]} ${t.getDate()} \u2013 ${n.getDate()}, ${t.getFullYear()}`:t.getFullYear()===n.getFullYear()?`${r[t.getMonth()]} ${t.getDate()} \u2013 ${r[n.getMonth()]} ${n.getDate()}, ${t.getFullYear()}`:`${r[t.getMonth()]} ${t.getDate()}, ${t.getFullYear()} \u2013 ${r[n.getMonth()]} ${n.getDate()}, ${n.getFullYear()}`}function Xi(e,t,n){return`${e}-${t}-${n}`}function nm(e,t){return`${String(e).padStart(2,"0")}:${String(t).padStart(2,"0")}`}function aS(e,t){let n=Sr(e[t]);return!n||n.hour===void 0||n.minute===void 0?null:nm(n.hour,n.minute)}function Sr(e){if(!e||typeof e!="string")return null;let t=e.indexOf("T"),o=(t>=0?e.slice(0,t):e).split("-");if(o.length!==3)return null;let r=parseInt(o[0]),i=parseInt(o[1])-1,l=parseInt(o[2]);if(isNaN(r)||isNaN(i)||isNaN(l))return null;if(t>=0){let s=e.slice(t+1).split(":");if(s.length>=2){let c=parseInt(s[0]),p=parseInt(s[1]);if(!isNaN(c)&&!isNaN(p))return{year:r,month:i,day:l,hour:c,minute:p}}}return{year:r,month:i,day:l}}function Pv({dbFile:e,manager:t,externalView:n,onViewChange:o}){let r=Dt(),i=new Date,{rows:l,config:a,loading:s,activeFilters:c,setActiveFilters:p}=Ln({app:r,dbFile:e,manager:t,includeSubfolders:n.includeSubfolders,externalView:n}),[m,g]=(0,Je.useState)(n),[d,v]=(0,Je.useState)(i.getFullYear()),[h,y]=(0,Je.useState)(i.getMonth()),[_,f]=(0,Je.useState)(i.getDate()),[w,R]=(0,Je.useState)(!1),[P,L]=(0,Je.useState)(!1),[V,W]=(0,Je.useState)(!1),[re,J]=(0,Je.useState)(null),[ue,Ne]=(0,Je.useState)(null),[de,Re]=(0,Je.useState)(null),Y=(0,Je.useRef)(null),te=(0,Je.useRef)(null),[j,ie]=(0,Je.useState)(()=>{let C=new Date;return C.getHours()*60+C.getMinutes()}),_e=(0,Je.useRef)(null),me=(0,Je.useRef)(null),Ae=(0,Je.useRef)(null),Ee=(0,Je.useRef)(null);(0,Je.useEffect)(()=>{g(n)},[n.id]),(0,Je.useEffect)(()=>{let X=setInterval(()=>{let H=new Date;ie(H.getHours()*60+H.getMinutes())},6e4);return()=>clearInterval(X)},[]);let xe=(0,Je.useCallback)(async C=>{g(C),await o(C)},[o]),Fe=m.calendarViewMode??"month";(0,Je.useEffect)(()=>{if(!w)return;let C=X=>{Ee.current?.contains(X.target)||_e.current&&!_e.current.contains(X.target)&&R(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[w]),(0,Je.useEffect)(()=>{if(!P)return;let C=X=>{Ee.current?.contains(X.target)||me.current&&!me.current.contains(X.target)&&L(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[P]),(0,Je.useEffect)(()=>{if(!V)return;let C=X=>{Ee.current?.contains(X.target)||Ae.current&&!Ae.current.contains(X.target)&&W(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[V]);let Ie=Pn(c,200),Ve=(0,Je.useMemo)(()=>lo(l,Ie),[l,Ie]),He=(0,Je.useMemo)(()=>a.schema.find(C=>C.id===m.calendarDateField)??null,[a.schema,m.calendarDateField]),Ye=(0,Je.useMemo)(()=>a.schema.filter(C=>C.visible&&!m.hiddenColumns.includes(C.id)),[a.schema,m.hiddenColumns]),Ze=(0,Je.useMemo)(()=>iS(d,h),[d,h]),De=(0,Je.useMemo)(()=>Fe==="week"?lS(d,h,_):[],[Fe,d,h,_]),q=(0,Je.useMemo)(()=>{let C=new Map;if(!He)return C;for(let X of Ve){let H=Sr(X[He.id]);if(!H)continue;let ae=Xi(H.year,H.month,H.day);if(Fe==="week"){if(De.some(we=>we.getFullYear()===H.year&&we.getMonth()===H.month&&we.getDate()===H.day)){let we=C.get(ae)??[];we.push(X),C.set(ae,we)}}else if(H.year===d&&H.month===h){let le=C.get(ae)??[];le.push(X),C.set(ae,le)}}for(let[X,H]of C)H.sort((ae,le)=>{let we=Sr(ae[He.id]),N=Sr(le[He.id]),be=(we?.hour??-1)*60+(we?.minute??-1),Me=(N?.hour??-1)*60+(N?.minute??-1);return be-Me}),C.set(X,H);return C},[Ve,He,d,h,_,Fe,De]),ce=(0,Je.useMemo)(()=>He?Ve.filter(C=>{let X=C[He.id];return!X||String(X).trim()===""}):[],[Ve,He]),$=(0,Je.useMemo)(()=>{if(Fe!=="week"||!He)return null;let C=null;for(let[,X]of q)for(let H of X){let ae=Sr(H[He.id]);if(ae&&ae.hour!==void 0&&ae.minute!==void 0){let le=ae.hour*60+ae.minute;(C===null||le<C)&&(C=le)}}return C},[Fe,He,q]),oe=Fe==="week"&&De.length>0?De[0].toISOString():"";(0,Je.useEffect)(()=>{if(Fe!=="week"||s)return;let C=setTimeout(()=>{let X=te.current;if(!X||X.scrollHeight<=X.clientHeight)return;let ae=48*24,we=($!==null?Math.min($,j):j)/1440*ae,N=X.clientHeight;X.scrollTo({top:Math.max(0,we-N*.25),behavior:"smooth"})},100);return()=>clearTimeout(C)},[Fe,oe,s]);let ve=(0,Je.useCallback)(async C=>{let X=C.map(H=>({id:H.id,columnId:H.columnId,operator:H.operator,value:H.value,conjunction:H.conjunction}));await xe({...m,activePills:X})},[xe,m]),S=(C,X,H,ae)=>{let le=[...c,{id:crypto.randomUUID(),columnId:C,columnName:X,columnType:ae,icon:H,operator:io(ae),value:"",conjunction:"and"}];p(le),ve(le),R(!1)},K=C=>{let X=c.filter(H=>H.id!==C);p(X),ve(X)},D=(C,X,H)=>{let ae=c.map(le=>le.id===C?{...le,operator:X,value:H}:le);p(ae),ve(ae)},Z=C=>{let X=c.map(H=>H.id===C?{...H,conjunction:H.conjunction==="and"?"or":"and"}:H);p(X),ve(X)},ke=(0,Je.useCallback)(async C=>{let X=m.hiddenColumns.includes(C)?m.hiddenColumns.filter(H=>H!==C):[...m.hiddenColumns,C];await xe({...m,hiddenColumns:X})},[m,xe]),ye=()=>{if(Fe==="week"){let C=new Date(d,h,_-7);v(C.getFullYear()),y(C.getMonth()),f(C.getDate())}else h===0?(y(11),v(C=>C-1)):y(C=>C-1)},ft=()=>{if(Fe==="week"){let C=new Date(d,h,_+7);v(C.getFullYear()),y(C.getMonth()),f(C.getDate())}else h===11?(y(0),v(C=>C+1)):y(C=>C+1)},Jt=()=>{v(i.getFullYear()),y(i.getMonth()),f(i.getDate())},vt=async(C,X,H)=>{if(!e||!He)return;let ae=await t.createNote(e),le=`${C}-${String(X+1).padStart(2,"0")}-${String(H).padStart(2,"0")}`;await r.fileManager.processFrontMatter(ae,we=>{we[He.id]=le})},Mt=(C,X)=>{C.dataTransfer.setData("nb-cal-path",X._file.path),C.dataTransfer.effectAllowed="move",C.stopPropagation()},Et=(C,X)=>{C.dataTransfer.types.includes("nb-cal-path")&&(C.preventDefault(),C.dataTransfer.dropEffect="move",J(X))},bt=C=>{C.currentTarget.contains(C.relatedTarget)||J(null)},$t=async(C,X,H,ae)=>{C.preventDefault(),C.stopPropagation(),J(null);let le=C.dataTransfer.getData("nb-cal-path");if(!le||!He)return;let we=r.vault.getFileByPath(le);if(!we)return;let N=`${X}-${String(H+1).padStart(2,"0")}-${String(ae).padStart(2,"0")}`;await r.fileManager.processFrontMatter(we,be=>{let Me=be[He.id];typeof Me=="string"&&Me.includes("T")?be[He.id]=`${N}T${Me.split("T")[1]}`:be[He.id]=N})},it=In();if(!e)return(0,B.jsx)("div",{className:"nb-empty-state",children:(0,B.jsx)("p",{children:u("no_database_open")})});if(s)return(0,B.jsx)("div",{className:"nb-loading",children:u("loading")});let en=i.getFullYear()===d&&i.getMonth()===h?i.getDate():null,M=C=>{C!=="datefield"&&W(!1),C!=="fields"&&L(!1),C!=="filter"&&R(!1)},Ce=it?(0,B.jsxs)($n,{actionBarRef:Ee,actions:[{id:"datefield",label:u("date_field"),icon:(0,B.jsx)(mn,{}),active:V,onClick:()=>{M("datefield"),W(C=>!C)}},{id:"fields",label:u("fields"),icon:(0,B.jsx)(mn,{}),active:P,onClick:()=>{M("fields"),L(C=>!C)}},{id:"subfolders",label:u("tooltip_include_subfolders"),icon:(0,B.jsx)(On,{}),active:!!m.includeSubfolders,onClick:()=>{M(),xe({...m,includeSubfolders:!m.includeSubfolders})}},{id:"filter",label:u("filter"),icon:(0,B.jsx)(An,{}),active:w,badge:c.length||void 0,onClick:()=>{M("filter"),R(C=>!C)}}],rowCount:Ve.length,rowCountLabel:Ve.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase(),filters:c,onFilterUpdate:D,onFilterRemove:K,onConjunctionToggle:Z,children:[(0,B.jsxs)(ot,{open:V,onClose:()=>W(!1),title:u("date_field"),children:[(0,B.jsxs)("button",{className:`nb-menu-item${m.calendarDateField?"":" nb-menu-item--active"}`,onClick:()=>{xe({...m,calendarDateField:void 0}),W(!1)},children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u2014"}),(0,B.jsx)("span",{children:u("none_value")})]}),a.schema.filter(C=>C.type==="date").map(C=>(0,B.jsxs)("button",{className:`nb-menu-item${m.calendarDateField===C.id?" nb-menu-item--active":""}`,onClick:()=>{xe({...m,calendarDateField:C.id}),W(!1)},children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C5}"}),(0,B.jsx)("span",{children:C.name})]},C.id))]}),(0,B.jsx)(ot,{open:P,onClose:()=>L(!1),title:u("fields"),children:a.schema.map(C=>(0,B.jsxs)("label",{className:"nb-field-row",children:[(0,B.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:C.visible&&!m.hiddenColumns.includes(C.id),onChange:()=>{ke(C.id)}}),(0,B.jsx)("span",{className:"nb-field-icon",children:Ke(C.type)}),(0,B.jsx)("span",{className:"nb-field-name",children:C.name})]},C.id))}),(0,B.jsxs)(ot,{open:w,onClose:()=>R(!1),title:u("filter"),children:[(0,B.jsxs)("button",{className:"nb-menu-item",onClick:()=>S("_title","Nome","\u{1F4C4}","title"),children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,B.jsx)("span",{children:u("name_column")})]}),a.schema.map(C=>(0,B.jsxs)("button",{className:"nb-menu-item",onClick:()=>S(C.id,C.name,Ke(C.type),C.type),children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:Ke(C.type)}),(0,B.jsx)("span",{children:C.name})]},C.id))]}),(0,B.jsx)("div",{className:"nb-cal-view-toggle",style:{margin:"4px 12px"},children:["month","week"].map(C=>(0,B.jsx)("button",{className:`nb-cal-view-btn${Fe===C?" nb-cal-view-btn--active":""}`,onClick:()=>{xe({...m,calendarViewMode:C})},children:C==="month"?u("calendar_view_month"):u("calendar_view_week")},C))}),(0,B.jsxs)("div",{className:"nb-cal-nav",style:{padding:"4px 12px"},children:[(0,B.jsx)("button",{className:"nb-toolbar-btn nb-cal-nav-arrow",onClick:ye,title:Fe==="week"?u("calendar_prev_week"):u("calendar_prev_month"),children:"\u2039"}),(0,B.jsx)("button",{className:"nb-toolbar-btn nb-cal-today-btn",onClick:Jt,children:u("calendar_today")}),(0,B.jsx)("span",{className:"nb-cal-month-label",children:Fe==="week"?Lv(De):`${Tv()[h]} ${d}`}),(0,B.jsx)("button",{className:"nb-toolbar-btn nb-cal-nav-arrow",onClick:ft,title:Fe==="week"?u("calendar_next_week"):u("calendar_next_month"),children:"\u203A"})]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("div",{className:"nb-toolbar",children:[(0,B.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:Ae,children:[(0,B.jsxs)("button",{className:`nb-toolbar-btn${V?" nb-toolbar-btn--active":""}`,onClick:()=>W(C=>!C),children:[u("date_field"),": ",(0,B.jsx)("strong",{children:He?.name??u("none_value")})]}),V&&(0,B.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,B.jsx)("div",{className:"nb-fields-dropdown-label",children:u("date_field_label")}),(0,B.jsxs)("button",{className:`nb-menu-item${m.calendarDateField?"":" nb-menu-item--active"}`,onClick:()=>{xe({...m,calendarDateField:void 0}),W(!1)},children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u2014"}),(0,B.jsx)("span",{children:u("none_value")})]}),a.schema.filter(C=>C.type==="date").map(C=>(0,B.jsxs)("button",{className:`nb-menu-item${m.calendarDateField===C.id?" nb-menu-item--active":""}`,onClick:()=>{xe({...m,calendarDateField:C.id}),W(!1)},children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C5}"}),(0,B.jsx)("span",{children:C.name})]},C.id))]})]}),(0,B.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:me,children:[(0,B.jsx)("button",{className:`nb-toolbar-btn${P?" nb-toolbar-btn--active":""}`,onClick:()=>L(C=>!C),children:"Campos"}),P&&(0,B.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,B.jsx)("div",{className:"nb-fields-dropdown-label",children:u("fields_label")}),a.schema.map(C=>(0,B.jsxs)("label",{className:"nb-field-row",children:[(0,B.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:C.visible&&!m.hiddenColumns.includes(C.id),onChange:()=>{ke(C.id)}}),(0,B.jsx)("span",{className:"nb-field-icon",children:Ke(C.type)}),(0,B.jsx)("span",{className:"nb-field-name",children:C.name})]},C.id))]})]}),(0,B.jsx)("div",{className:"nb-cal-view-toggle",children:["month","week"].map(C=>(0,B.jsx)("button",{className:`nb-cal-view-btn${Fe===C?" nb-cal-view-btn--active":""}`,onClick:()=>{xe({...m,calendarViewMode:C})},children:C==="month"?u("calendar_view_month"):u("calendar_view_week")},C))}),(0,B.jsxs)("div",{className:"nb-cal-nav",children:[(0,B.jsx)("button",{className:"nb-toolbar-btn nb-cal-nav-arrow",onClick:ye,title:Fe==="week"?u("calendar_prev_week"):u("calendar_prev_month"),children:"\u2039"}),(0,B.jsx)("button",{className:"nb-toolbar-btn nb-cal-today-btn",onClick:Jt,children:u("calendar_today")}),(0,B.jsx)("span",{className:"nb-cal-month-label",children:Fe==="week"?Lv(De):`${Tv()[h]} ${d}`}),(0,B.jsx)("button",{className:"nb-toolbar-btn nb-cal-nav-arrow",onClick:ft,title:Fe==="week"?u("calendar_next_week"):u("calendar_next_month"),children:"\u203A"})]}),(0,B.jsx)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon nb-subfolder-toggle ${m.includeSubfolders?"nb-toolbar-btn--active":""}`,onClick:()=>{xe({...m,includeSubfolders:!m.includeSubfolders})},title:u("tooltip_include_subfolders"),children:(0,B.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,B.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),(0,B.jsx)("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),(0,B.jsx)("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]})}),(0,B.jsxs)("span",{className:"nb-row-count",children:[Ve.length," ",Ve.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase()]}),(0,B.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:_e,style:{marginLeft:"auto"},children:[(0,B.jsxs)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon${w?" nb-toolbar-btn--active":""}`,onClick:()=>R(C=>!C),title:u("filters"),children:[(0,B.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,B.jsx)("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})}),c.length>0&&(0,B.jsx)("span",{className:"nb-hidden-badge",children:c.length})]}),w&&(0,B.jsxs)("div",{className:"nb-fields-dropdown nb-filter-menu-dropdown",children:[(0,B.jsx)("div",{className:"nb-fields-dropdown-label",children:u("filter_by")}),(0,B.jsxs)("button",{className:"nb-menu-item",onClick:()=>S("_title","Nome","\u{1F4C4}","title"),children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,B.jsx)("span",{children:u("name_column")})]}),a.schema.map(C=>(0,B.jsxs)("button",{className:"nb-menu-item",onClick:()=>S(C.id,C.name,Ke(C.type),C.type),children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:Ke(C.type)}),(0,B.jsx)("span",{children:C.name})]},C.id))]})]})]}),c.length>0&&(0,B.jsx)("div",{className:"nb-filter-pills-row",children:c.map((C,X)=>(0,B.jsxs)(Je.Fragment,{children:[X>0&&(0,B.jsx)("button",{className:`nb-pill-conjunction${C.conjunction==="or"?" nb-pill-conjunction--or":""}`,onClick:()=>Z(C.id),children:C.conjunction==="or"?u("conjunction_or"):u("conjunction_and")}),(0,B.jsxs)("span",{className:"nb-filter-pill",children:[(0,B.jsx)("span",{className:"nb-pill-icon",children:C.icon}),(0,B.jsx)("span",{className:"nb-pill-name",children:C.columnName}),(0,B.jsx)("select",{className:"nb-pill-op-select",value:C.operator,onChange:H=>D(C.id,H.target.value,C.value),children:Dn(C.columnType).map(H=>(0,B.jsx)("option",{value:H,children:Mn[H]},H))}),!Cn.has(C.operator)&&(0,B.jsx)("input",{className:"nb-pill-value-input",type:"text",value:C.value,onChange:H=>D(C.id,C.operator,H.target.value)}),(0,B.jsx)("button",{className:"nb-pill-remove",onClick:()=>K(C.id),children:"\xD7"})]})]},C.id))})]});return(0,B.jsxs)("div",{className:"nb-container",children:[Ce,He?(0,B.jsxs)(B.Fragment,{children:[Fe==="week"?(0,B.jsxs)("div",{className:"nb-cal-week-container",children:[(0,B.jsxs)("div",{className:"nb-cal-week-allday",children:[(0,B.jsx)("div",{className:"nb-cal-week-time-gutter nb-cal-week-allday-label",children:u("calendar_all_day")}),De.map(C=>{let X=Xi(C.getFullYear(),C.getMonth(),C.getDate()),H=(q.get(X)??[]).filter(ae=>{let le=Sr(ae[He.id]);return!le||le.hour===void 0});return(0,B.jsx)("div",{className:"nb-cal-week-allday-cell",onClick:()=>{vt(C.getFullYear(),C.getMonth(),C.getDate())},onDragOver:ae=>Et(ae,C.getDate()),onDragLeave:bt,onDrop:ae=>{$t(ae,C.getFullYear(),C.getMonth(),C.getDate())},children:H.map(ae=>(0,B.jsx)("div",{className:"nb-cal-card nb-cal-card--allday",draggable:!0,onDragStart:le=>Mt(le,ae),onClick:le=>{le.stopPropagation(),r.workspace.getLeaf().openFile(ae._file)},children:(0,B.jsx)("span",{className:"nb-cal-card-title",children:ae._title})},ae._file.path))},X)})]}),(0,B.jsxs)("div",{className:"nb-cal-week-header",children:[(0,B.jsx)("div",{className:"nb-cal-week-time-gutter"}),De.map(C=>{let X=C.getFullYear()===i.getFullYear()&&C.getMonth()===i.getMonth()&&C.getDate()===i.getDate();return(0,B.jsxs)("div",{className:`nb-cal-week-day-header${X?" nb-cal-week-day-header--today":""}`,children:[Mv()[C.getDay()]," ",C.getDate()]},C.toISOString())})]}),(0,B.jsxs)("div",{className:"nb-cal-week-body",ref:te,children:[De.some(C=>C.getFullYear()===i.getFullYear()&&C.getMonth()===i.getMonth()&&C.getDate()===i.getDate())&&(0,B.jsx)("div",{className:"nb-cal-now-line",style:{top:`${j/1440*48*24}px`}}),(0,B.jsx)("div",{className:"nb-cal-week-time-gutter",children:Array.from({length:24},(C,X)=>(0,B.jsx)("div",{className:"nb-cal-week-hour-label",children:nm(X,0)},X))}),De.map(C=>{let X=Xi(C.getFullYear(),C.getMonth(),C.getDate()),H=C.getFullYear()===i.getFullYear()&&C.getMonth()===i.getMonth()&&C.getDate()===i.getDate(),ae=(q.get(X)??[]).filter(le=>{let we=Sr(le[He.id]);return we&&we.hour!==void 0});return(0,B.jsxs)("div",{className:`nb-cal-week-day-col${H?" nb-cal-week-day-col--today":""}`,onClick:()=>{vt(C.getFullYear(),C.getMonth(),C.getDate())},onDragOver:le=>Et(le,C.getDate()),onDragLeave:bt,onDrop:le=>{$t(le,C.getFullYear(),C.getMonth(),C.getDate())},children:[Array.from({length:24},(le,we)=>(0,B.jsx)("div",{className:"nb-cal-week-hour-slot"},we)),ae.map(le=>{let we=Sr(le[He.id]);if(!we||we.hour===void 0||we.minute===void 0)return null;let N=(we.hour*60+we.minute)/1440*100;return(0,B.jsx)("div",{className:"nb-cal-card nb-cal-card--timed",draggable:!0,onDragStart:be=>Mt(be,le),onClick:be=>{be.stopPropagation(),r.workspace.getLeaf().openFile(le._file)},style:{top:`${N}%`},children:(0,B.jsxs)("div",{className:"nb-cal-card-title-row",children:[(0,B.jsx)("span",{className:"nb-cal-time-badge",children:nm(we.hour,we.minute)}),(0,B.jsx)("span",{className:"nb-cal-card-title",children:le._title})]})},le._file.path)})]},X)})]})]}):(0,B.jsxs)("div",{className:"nb-cal-grid",children:[Mv().map(C=>(0,B.jsx)("div",{className:"nb-cal-day-header",children:C},C)),Ze.map((C,X)=>{if(C===null)return(0,B.jsx)("div",{className:"nb-cal-cell nb-cal-cell--outside"},`empty-${X}`);let H=C===en,ae=C===re,le=q.get(Xi(d,h,C))??[];return(0,B.jsxs)("div",{className:`nb-cal-cell${H?" nb-cal-cell--today":""}${ae?" nb-cal-cell--drag-over":""}`,onClick:it?void 0:()=>{vt(d,h,C)},onDragOver:we=>Et(we,C),onDragLeave:bt,onDrop:we=>{$t(we,d,h,C)},title:it?void 0:u("calendar_click_to_create"),onTouchStart:it?()=>{Y.current=setTimeout(()=>{Re({year:d,month:h,day:C})},500)}:void 0,onTouchMove:it?()=>{Y.current&&(clearTimeout(Y.current),Y.current=null)}:void 0,onTouchEnd:it?()=>{Y.current&&(clearTimeout(Y.current),Y.current=null)}:void 0,children:[(0,B.jsx)("div",{className:"nb-cal-cell-header",children:(0,B.jsx)("span",{className:`nb-cal-day-num${H?" nb-cal-day-num--today":""}`,children:C})}),(0,B.jsx)("div",{className:"nb-cal-cell-body",children:(()=>{let N=it&&le.length>1?le.slice(0,1):le,be=it?le.length-N.length:0,Me=Xi(d,h,C);return(0,B.jsxs)(B.Fragment,{children:[N.map(Se=>(0,B.jsxs)("div",{className:"nb-cal-card",draggable:!it,onDragStart:it?void 0:U=>Mt(U,Se),onClick:U=>{U.stopPropagation(),r.workspace.getLeaf().openFile(Se._file)},children:[(0,B.jsxs)("div",{className:"nb-cal-card-title-row",children:[He&&(()=>{let U=aS(Se,He.id);return U?(0,B.jsx)("span",{className:"nb-cal-time-badge",children:U}):null})(),(0,B.jsx)("span",{className:"nb-cal-card-title",children:Se._title})]}),!it&&(()=>{let U=e?.parent?.path??"",Le=Se._file.parent?.path??"",Pe=m.includeSubfolders&&Le.length>U.length?Le.slice(U.length+1):"";return Pe?(0,B.jsx)("div",{className:"nb-folder-path",children:Pe}):null})(),!it&&Ye.length>0&&(0,B.jsx)("div",{className:"nb-cal-card-props",children:Ye.map(U=>{let Le=Se[U.id];if(Le==null||String(Le).trim()==="")return null;let Pe=Array.isArray(Le)?Le.join(", "):String(Le);return(0,B.jsx)("span",{className:"nb-cal-card-prop",children:Pe},U.id)})})]},Se._file.path)),be>0&&(0,B.jsxs)("button",{className:"nb-cal-more-badge",onClick:Se=>{Se.stopPropagation(),Ne(Me)},children:["+",be]})]})})()})]},C)})]}),ce.length>0&&(0,B.jsxs)("div",{className:"nb-cal-no-date",children:[(0,B.jsxs)("div",{className:"nb-cal-no-date-title",children:[u("calendar_no_date_section")," (",ce.length,")"]}),(0,B.jsx)("div",{className:"nb-cal-no-date-list",children:ce.map(C=>(0,B.jsxs)("div",{className:"nb-cal-card nb-cal-card--no-date",draggable:!0,onDragStart:X=>Mt(X,C),onClick:()=>{r.workspace.getLeaf().openFile(C._file)},children:[(0,B.jsx)("span",{className:"nb-cal-card-title",children:C._title}),(()=>{let X=e?.parent?.path??"",H=C._file.parent?.path??"",ae=m.includeSubfolders&&H.length>X.length?H.slice(X.length+1):"";return ae?(0,B.jsx)("div",{className:"nb-folder-path",children:ae}):null})()]},C._file.path))})]})]}):(0,B.jsx)("div",{className:"nb-cal-no-field",children:(0,B.jsx)("p",{children:u("calendar_no_date_field")})}),(0,B.jsx)(ot,{open:ue!==null,onClose:()=>Ne(null),title:ue??"",children:(ue!==null?q.get(ue)??[]:[]).map(C=>(0,B.jsxs)("button",{className:"nb-menu-item",onClick:()=>{r.workspace.getLeaf().openFile(C._file),Ne(null)},children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,B.jsx)("span",{children:C._title})]},C._file.path))}),(0,B.jsx)(ot,{open:de!==null,onClose:()=>Re(null),title:de?`${de.day}/${de.month+1}/${de.year}`:"",children:de&&(()=>{let C=Xi(de.year,de.month,de.day),X=q.get(C)??[];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("button",{className:"nb-menu-item",onClick:()=>{vt(de.year,de.month,de.day),Re(null)},children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u2795"}),(0,B.jsx)("span",{children:u("add_card")})]}),X.length>0&&(0,B.jsx)("div",{className:"nb-menu-separator"}),X.map(H=>(0,B.jsxs)(Je.Fragment,{children:[(0,B.jsxs)("button",{className:"nb-menu-item",onClick:()=>{r.workspace.getLeaf().openFile(H._file),Re(null)},children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,B.jsx)("span",{children:H._title})]}),(0,B.jsxs)("div",{className:"nb-cal-day-actions",children:[(0,B.jsxs)("button",{className:"nb-menu-item",onClick:()=>{t.duplicateNotes([H._file]),Re(null)},children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4CB}"}),(0,B.jsx)("span",{children:u("duplicate_note")})]}),(0,B.jsxs)("button",{className:"nb-menu-item nb-menu-item--danger",onClick:()=>{t.deleteNotes([H._file]),Re(null)},children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F5D1}"}),(0,B.jsx)("span",{children:u("delete_note")})]})]})]},H._file.path))]})})()})]})}var qe=ze(yt(),1);var A=ze(Rt(),1),Iv=200,im=34,Av=28,xu=56,om=()=>[u("month_short_jan"),u("month_short_feb"),u("month_short_mar"),u("month_short_apr"),u("month_short_may"),u("month_short_jun"),u("month_short_jul"),u("month_short_aug"),u("month_short_sep"),u("month_short_oct"),u("month_short_nov"),u("month_short_dec")],sS={days:30,weeks:80,months:100},uS={days:730,weeks:156,months:48},Ov=()=>({days:u("zoom_days"),weeks:u("zoom_weeks"),months:u("zoom_months")});function Mo(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)}function lm(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function Qi(e){if(!e||typeof e!="string")return null;let t=e.split("-");if(t.length!==3)return null;let n=parseInt(t[0]),o=parseInt(t[1])-1,r=parseInt(t[2]);return isNaN(n)||isNaN(o)||isNaN(r)?null:new Date(n,o,r)}function cS(e,t){if(e==="months")return new Date(t.getFullYear()-1,0,1);if(e==="weeks"){let n=Mo(t,-546);return Mo(n,-n.getDay())}return new Date(t.getFullYear()-1,0,1)}function rm(e,t,n,o){if(t==="days")return Math.round((e.getTime()-n.getTime())/864e5)*o;if(t==="weeks")return(e.getTime()-n.getTime())/864e5/7*o;let r=(e.getFullYear()-n.getFullYear())*12+(e.getMonth()-n.getMonth()),i=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();return(r+(e.getDate()-1)/i)*o}function $v(e,t,n,o){return t==="days"?Mo(n,Math.round(e/o)):t==="weeks"?Mo(n,Math.round(e/o*7)):lm(n,Math.floor(e/o))}function dS(e,t,n,o){let r=[],i=[];if(e==="months"){for(let s=0;s<o;s++){let c=lm(t,s);r.push({key:`m${s}`,left:s*n,width:n,label:om()[c.getMonth()]})}let l=-1,a=0;for(let s=0;s<=o;s++){let c=s<o?lm(t,s).getFullYear():-1;c!==l&&l!==-1&&(i.push({key:`y${l}`,left:a,width:s*n-a,label:String(l)}),a=s*n),(l===-1||c!==l)&&(l=c)}}else if(e==="weeks"){for(let s=0;s<o;s++){let c=Mo(t,s*7);r.push({key:`w${s}`,left:s*n,width:n,label:`${String(c.getDate()).padStart(2,"0")}/${String(c.getMonth()+1).padStart(2,"0")}`})}let l="",a=0;for(let s=0;s<=o;s++){let c=s<o?Mo(t,s*7):null,p=c?`${c.getFullYear()}-${c.getMonth()}`:"";if(p!==l&&l!==""){let m=Mo(t,Math.round(a/n)*7);i.push({key:l,left:a,width:s*n-a,label:`${om()[m.getMonth()]} ${m.getFullYear()}`}),a=s*n}(l===""||p!==l)&&(l=p)}}else{for(let s=0;s<o;s++){let c=Mo(t,s);r.push({key:`d${s}`,left:s*n,width:n,label:String(c.getDate())})}let l="",a=0;for(let s=0;s<=o;s++){let c=s<o?Mo(t,s):null,p=c?`${c.getFullYear()}-${c.getMonth()}`:"";if(p!==l&&l!==""){let m=Mo(t,Math.round(a/n));i.push({key:l,left:a,width:s*n-a,label:`${om()[m.getMonth()]} ${m.getFullYear()}`}),a=s*n}(l===""||p!==l)&&(l=p)}}return{top:i,bottom:r}}var pS=qe.default.memo(function({row:t,barLeft:n,barWidth:o,isMobile:r,visibleCols:i,dbFolderPath:l,includeSubfolders:a,origBarLeft:s,origBarWidth:c,startFieldId:p,endFieldId:m,onOpen:g,onContextMenu:d,onResizeStart:v}){let h=t._file.parent?.path??"",y=a&&h.length>l.length?h.slice(l.length+1):"";return(0,A.jsxs)("div",{className:"nb-tl-bar",style:{left:n,width:o,top:(im-22)/2,height:22},onClick:()=>{r?d(t._file):g(t._file)},onContextMenu:r?void 0:_=>{_.preventDefault(),d(t._file)},title:r?void 0:t._title,children:[(0,A.jsx)("div",{className:"nb-tl-bar-handle nb-tl-bar-handle--left",onMouseDown:_=>{_.stopPropagation(),_.preventDefault(),v(t._file.path,"left",_.clientX,s,c,p,m)}}),(0,A.jsx)("span",{className:"nb-tl-bar-title",children:t._title}),y?(0,A.jsx)("span",{className:"nb-folder-path",style:{marginLeft:4},children:y}):null,i.map(_=>{let f=t[_.id];if(!f||String(f).trim()==="")return null;let w=Array.isArray(f)?f.join(", "):String(f);return(0,A.jsxs)("span",{className:"nb-tl-bar-field",children:[" \xB7 ",w]},_.id)}),(0,A.jsx)("div",{className:"nb-tl-bar-handle nb-tl-bar-handle--right",onMouseDown:_=>{_.stopPropagation(),_.preventDefault(),v(t._file.path,"right",_.clientX,s,c,p,m)}})]})});function zv({dbFile:e,manager:t,externalView:n,onViewChange:o}){let r=Dt(),i=(0,qe.useMemo)(()=>new Date,[]),{rows:l,config:a,loading:s,activeFilters:c,setActiveFilters:p}=Ln({app:r,dbFile:e,manager:t,includeSubfolders:n.includeSubfolders,externalView:n}),[m,g]=(0,qe.useState)(n),[d,v]=(0,qe.useState)(!1),[h,y]=(0,qe.useState)(!1),[_,f]=(0,qe.useState)(!1),[w,R]=(0,qe.useState)(!1),[P,L]=(0,qe.useState)(!1),[V,W]=(0,qe.useState)(!0),[re,J]=(0,qe.useState)(null),[ue,Ne]=(0,qe.useState)(0),[de,Re]=(0,qe.useState)(null),Y=(0,qe.useRef)(null),te=(0,qe.useRef)(null),j=(0,qe.useRef)(null),ie=(0,qe.useRef)(null),_e=(0,qe.useRef)(null),me=(0,qe.useRef)(null),Ae=(0,qe.useRef)(null),Ee=(0,qe.useRef)(!1);(0,qe.useEffect)(()=>{g(n)},[n.id]);let xe=(0,qe.useCallback)(async N=>{g(N),await o(N)},[o]),Fe=(N,be,Me)=>(0,qe.useEffect)(()=>{if(!N)return;let Se=U=>{Ae.current?.contains(U.target)||be.current&&!be.current.contains(U.target)&&Me(!1)};return document.addEventListener("mousedown",Se),()=>document.removeEventListener("mousedown",Se)},[N]);Fe(d,Y,v),Fe(h,te,y),Fe(_,j,f),Fe(w,ie,R),Fe(P,_e,L);let Ie=m.timelineZoom??"months",Ve=sS[Ie],He=uS[Ie],Ye=(0,qe.useMemo)(()=>cS(Ie,i),[Ie,i]),Ze=He*Ve,De=(0,qe.useMemo)(()=>dS(Ie,Ye,Ve,He),[Ie,Ye,Ve,He]),q=(0,qe.useMemo)(()=>rm(i,Ie,Ye,Ve),[i,Ie,Ye,Ve]);(0,qe.useEffect)(()=>{if(!re)return;let N=Se=>Ne(Se.clientX-re.startX),be=async Se=>{let U=Se.clientX-re.startX;if(J(null),Ne(0),document.body.classList.remove("nb-tl-resizing"),Math.abs(U)<2)return;Ee.current=!0,setTimeout(()=>{Ee.current=!1},200);let{handle:Le,origBarLeft:Pe,origBarWidth:Oe,startFieldId:$e,endFieldId:Xe,filePath:ut}=re,ct=Pe,gt=Oe;if(Le==="left"?(ct=Pe+U,gt=Oe-U):gt=Oe+U,gt<Ve)return;let It=zt=>`${zt.getFullYear()}-${String(zt.getMonth()+1).padStart(2,"0")}-${String(zt.getDate()).padStart(2,"0")}`,At=r.vault.getAbstractFileByPath(ut);At&&await r.fileManager.processFrontMatter(At,zt=>{Le==="left"&&$e&&(zt[$e]=It($v(ct,Ie,Ye,Ve))),Le==="right"&&Xe&&(zt[Xe]=It($v(ct+gt-Ve,Ie,Ye,Ve)))})};document.body.classList.add("nb-tl-resizing");let Me=Se=>{be(Se)};return window.addEventListener("mousemove",N),window.addEventListener("mouseup",Me),()=>{window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",Me)}},[re,Ie,Ye,Ve,r]),(0,qe.useEffect)(()=>{requestAnimationFrame(()=>{if(!me.current)return;let N=Math.max(0,q-me.current.clientWidth*.3);me.current.scrollLeft=N})},[Ie]);let ce=Pn(c,200),$=(0,qe.useMemo)(()=>lo(l,ce),[l,ce]),oe=(0,qe.useMemo)(()=>qn($,m.sorts),[$,m.sorts]),ve=(0,qe.useMemo)(()=>a.schema.find(N=>N.id===m.timelineStartField)??null,[a.schema,m.timelineStartField]),S=(0,qe.useMemo)(()=>a.schema.find(N=>N.id===m.timelineEndField)??null,[a.schema,m.timelineEndField]),K=(0,qe.useMemo)(()=>a.schema.find(N=>N.id===m.timelineGroupByField)??null,[a.schema,m.timelineGroupByField]),D=(0,qe.useMemo)(()=>a.schema.filter(N=>N.visible&&!m.hiddenColumns.includes(N.id)&&N.id!==m.timelineStartField&&N.id!==m.timelineEndField),[a.schema,m.hiddenColumns,m.timelineStartField,m.timelineEndField]),Z=(0,qe.useMemo)(()=>ve?$.filter(N=>!Qi(N[ve.id])):[],[$,ve]),ke=(0,qe.useMemo)(()=>{let N=Oe=>{if(!ve)return{kind:"row",row:Oe,barLeft:null,barWidth:null};let $e=Qi(Oe[ve.id]);if(!$e)return{kind:"row",row:Oe,barLeft:null,barWidth:null};let ut=(S?Qi(Oe[S.id]):null)??$e,ct=Math.max(0,rm($e,Ie,Ye,Ve)),gt=rm(ut,Ie,Ye,Ve)+Ve;return{kind:"row",row:Oe,barLeft:ct,barWidth:Math.max(8,gt-ct)}},be=ve?oe.filter(Oe=>!!Qi(Oe[ve.id])):oe,Me=m.sorts.length>0||!ve?be:[...be].sort((Oe,$e)=>{let Xe=Qi(Oe[ve.id]),ut=Qi($e[ve.id]);return!Xe&&!ut?0:Xe?ut?Xe.getTime()-ut.getTime():-1:1});if(!K)return Me.map(N);let Se=new Map;for(let Oe of Me){let $e=String(Oe[K.id]??"");Se.has($e)||Se.set($e,[]),Se.get($e).push(Oe)}let U=K.options?.map(Oe=>Oe.value)??[],Le=[...Se.keys()].sort((Oe,$e)=>{let Xe=U.indexOf(Oe),ut=U.indexOf($e);return Xe!==-1&&ut!==-1?Xe-ut:Xe!==-1?-1:ut!==-1||!Oe?1:$e?Oe.localeCompare($e):-1}),Pe=[];for(let Oe of Le){let $e=K.options?.find(Xe=>Xe.value===Oe);Pe.push({kind:"group",label:Oe||u("no_value"),color:$e?.color});for(let Xe of Se.get(Oe))Pe.push(N(Xe))}return Pe},[oe,ve,S,K,Ie,Ye,Ve,m.sorts]),ye=(0,qe.useCallback)(async N=>{await xe({...m,activePills:N.map(be=>({id:be.id,columnId:be.columnId,operator:be.operator,value:be.value,conjunction:be.conjunction}))})},[xe,m]),ft=(N,be,Me,Se)=>{let U=[...c,{id:crypto.randomUUID(),columnId:N,columnName:be,columnType:Se,icon:Me,operator:io(Se),value:"",conjunction:"and"}];p(U),ye(U),v(!1)},Jt=N=>{let be=c.filter(Me=>Me.id!==N);p(be),ye(be)},vt=(N,be,Me)=>{let Se=c.map(U=>U.id===N?{...U,operator:be,value:Me}:U);p(Se),ye(Se)},Mt=N=>{let be=c.map(Me=>Me.id===N?{...Me,conjunction:Me.conjunction==="and"?"or":"and"}:Me);p(be),ye(be)},Et=(0,qe.useCallback)(async N=>{let be=m.hiddenColumns.includes(N)?m.hiddenColumns.filter(Me=>Me!==N):[...m.hiddenColumns,N];await xe({...m,hiddenColumns:be})},[m,xe]),bt=()=>me.current?.scrollBy({left:-(me.current.clientWidth*.6),behavior:"smooth"}),$t=()=>me.current?.scrollBy({left:me.current.clientWidth*.6,behavior:"smooth"}),it=()=>{me.current&&me.current.scrollTo({left:Math.max(0,q-me.current.clientWidth*.3),behavior:"smooth"})},en=In(),M=e?.parent?.path??"",Ce=(0,qe.useCallback)(N=>{r.workspace.getLeaf().openFile(N)},[r]),C=(0,qe.useCallback)(N=>{Re(N)},[]),X=(0,qe.useCallback)((N,be,Me,Se,U,Le,Pe)=>{J({filePath:N,handle:be,startX:Me,origBarLeft:Se,origBarWidth:U,startFieldId:Le,endFieldId:Pe}),Ne(0)},[]);if(!e)return(0,A.jsx)("div",{className:"nb-empty-state",children:(0,A.jsx)("p",{children:u("no_database_open")})});if(s)return(0,A.jsx)("div",{className:"nb-loading",children:u("loading")});let H=q>=0&&q<=Ze,ae=({label:N,valueKey:be,open:Me,setOpen:Se,menuRef:U})=>{let Le=a.schema.find(Pe=>Pe.id===m[be])?.name??u("none_value");return(0,A.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:U,children:[(0,A.jsxs)("button",{className:`nb-toolbar-btn${Me?" nb-toolbar-btn--active":""}`,onClick:()=>Se(!Me),children:[N,": ",(0,A.jsx)("strong",{children:Le})]}),Me&&(0,A.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,A.jsx)("div",{className:"nb-fields-dropdown-label",children:N}),(0,A.jsxs)("button",{className:`nb-menu-item${m[be]?"":" nb-menu-item--active"}`,onClick:()=>{xe({...m,[be]:void 0}),Se(!1)},children:[(0,A.jsx)("span",{className:"nb-menu-item-icon",children:"\u2014"}),(0,A.jsx)("span",{children:u("none_value")})]}),a.schema.filter(Pe=>Pe.type==="date").map(Pe=>(0,A.jsxs)("button",{className:`nb-menu-item${m[be]===Pe.id?" nb-menu-item--active":""}`,onClick:()=>{xe({...m,[be]:Pe.id}),Se(!1)},children:[(0,A.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C5}"}),(0,A.jsx)("span",{children:Pe.name})]},Pe.id))]})]})},le=N=>{N!=="start"&&f(!1),N!=="end"&&R(!1),N!=="group"&&L(!1),N!=="fields"&&y(!1),N!=="filter"&&v(!1)},we=en?(0,A.jsxs)($n,{actionBarRef:Ae,actions:[{id:"start",label:u("start_field"),icon:(0,A.jsx)(mn,{}),active:_,onClick:()=>{le("start"),f(N=>!N)}},{id:"end",label:u("end_field"),icon:(0,A.jsx)(mn,{}),active:w,onClick:()=>{le("end"),R(N=>!N)}},{id:"group",label:u("group_field"),icon:(0,A.jsx)(so,{}),active:P,onClick:()=>{le("group"),L(N=>!N)}},{id:"fields",label:u("fields"),icon:(0,A.jsx)(mn,{}),active:h,onClick:()=>{le("fields"),y(N=>!N)}},{id:"subfolders",label:u("tooltip_include_subfolders"),icon:(0,A.jsx)(On,{}),active:!!m.includeSubfolders,onClick:()=>{le(),xe({...m,includeSubfolders:!m.includeSubfolders})}},{id:"filter",label:u("filter"),icon:(0,A.jsx)(An,{}),active:d,badge:c.length||void 0,onClick:()=>{le("filter"),v(N=>!N)}}],rowCount:$.length,rowCountLabel:$.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase(),filters:c,onFilterUpdate:vt,onFilterRemove:Jt,onConjunctionToggle:Mt,children:[(0,A.jsxs)(ot,{open:_,onClose:()=>f(!1),title:u("start_field"),children:[(0,A.jsxs)("button",{className:`nb-menu-item${m.timelineStartField?"":" nb-menu-item--active"}`,onClick:()=>{xe({...m,timelineStartField:void 0}),f(!1)},children:[(0,A.jsx)("span",{className:"nb-menu-item-icon",children:"\u2014"}),(0,A.jsx)("span",{children:u("none_value")})]}),a.schema.filter(N=>N.type==="date").map(N=>(0,A.jsxs)("button",{className:`nb-menu-item${m.timelineStartField===N.id?" nb-menu-item--active":""}`,onClick:()=>{xe({...m,timelineStartField:N.id}),f(!1)},children:[(0,A.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C5}"}),(0,A.jsx)("span",{children:N.name})]},N.id))]}),(0,A.jsxs)(ot,{open:w,onClose:()=>R(!1),title:u("end_field"),children:[(0,A.jsxs)("button",{className:`nb-menu-item${m.timelineEndField?"":" nb-menu-item--active"}`,onClick:()=>{xe({...m,timelineEndField:void 0}),R(!1)},children:[(0,A.jsx)("span",{className:"nb-menu-item-icon",children:"\u2014"}),(0,A.jsx)("span",{children:u("none_value")})]}),a.schema.filter(N=>N.type==="date").map(N=>(0,A.jsxs)("button",{className:`nb-menu-item${m.timelineEndField===N.id?" nb-menu-item--active":""}`,onClick:()=>{xe({...m,timelineEndField:N.id}),R(!1)},children:[(0,A.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C5}"}),(0,A.jsx)("span",{children:N.name})]},N.id))]}),(0,A.jsxs)(ot,{open:P,onClose:()=>L(!1),title:u("group_field"),children:[(0,A.jsxs)("button",{className:`nb-menu-item${m.timelineGroupByField?"":" nb-menu-item--active"}`,onClick:()=>{xe({...m,timelineGroupByField:void 0}),L(!1)},children:[(0,A.jsx)("span",{className:"nb-menu-item-icon",children:"\u2014"}),(0,A.jsx)("span",{children:u("none_value")})]}),a.schema.filter(N=>N.type==="select"||N.type==="status").map(N=>(0,A.jsxs)("button",{className:`nb-menu-item${m.timelineGroupByField===N.id?" nb-menu-item--active":""}`,onClick:()=>{xe({...m,timelineGroupByField:N.id}),L(!1)},children:[(0,A.jsx)("span",{className:"nb-menu-item-icon",children:Ke(N.type)}),(0,A.jsx)("span",{children:N.name})]},N.id))]}),(0,A.jsx)(ot,{open:h,onClose:()=>y(!1),title:u("fields"),children:a.schema.map(N=>(0,A.jsxs)("label",{className:"nb-field-row",children:[(0,A.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:N.visible&&!m.hiddenColumns.includes(N.id),onChange:()=>{Et(N.id)}}),(0,A.jsx)("span",{className:"nb-field-icon",children:Ke(N.type)}),(0,A.jsx)("span",{className:"nb-field-name",children:N.name})]},N.id))}),(0,A.jsxs)(ot,{open:d,onClose:()=>v(!1),title:u("filter"),children:[(0,A.jsxs)("button",{className:"nb-menu-item",onClick:()=>ft("_title","Nome","\u{1F4C4}","title"),children:[(0,A.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,A.jsx)("span",{children:u("name_column")})]}),a.schema.map(N=>(0,A.jsxs)("button",{className:"nb-menu-item",onClick:()=>ft(N.id,N.name,Ke(N.type),N.type),children:[(0,A.jsx)("span",{className:"nb-menu-item-icon",children:Ke(N.type)}),(0,A.jsx)("span",{children:N.name})]},N.id))]}),(0,A.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"4px 12px"},children:[(0,A.jsxs)("div",{className:"nb-cal-nav",children:[(0,A.jsx)("button",{className:"nb-toolbar-btn nb-cal-nav-arrow",onClick:bt,title:u("timeline_scroll_prev"),children:"\u2039"}),(0,A.jsx)("button",{className:"nb-toolbar-btn nb-cal-today-btn",onClick:it,children:u("calendar_today")}),(0,A.jsx)("button",{className:"nb-toolbar-btn nb-cal-nav-arrow",onClick:$t,title:u("timeline_scroll_next"),children:"\u203A"})]}),(0,A.jsx)("div",{className:"nb-tl-zoom-group",children:["days","weeks","months"].map(N=>(0,A.jsx)("button",{className:`nb-tl-zoom-btn${Ie===N?" nb-tl-zoom-btn--active":""}`,onClick:()=>{xe({...m,timelineZoom:N})},children:Ov()[N]},N))})]})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"nb-toolbar",children:[(0,A.jsx)(ae,{label:u("start_field"),valueKey:"timelineStartField",open:_,setOpen:f,menuRef:j}),(0,A.jsx)(ae,{label:u("end_field"),valueKey:"timelineEndField",open:w,setOpen:R,menuRef:ie}),(0,A.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:_e,children:[(0,A.jsxs)("button",{className:`nb-toolbar-btn${P?" nb-toolbar-btn--active":""}`,onClick:()=>L(N=>!N),children:[u("group_field"),": ",(0,A.jsx)("strong",{children:K?.name??u("none_value")})]}),P&&(0,A.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,A.jsx)("div",{className:"nb-fields-dropdown-label",children:u("group_by_label")}),(0,A.jsxs)("button",{className:`nb-menu-item${m.timelineGroupByField?"":" nb-menu-item--active"}`,onClick:()=>{xe({...m,timelineGroupByField:void 0}),L(!1)},children:[(0,A.jsx)("span",{className:"nb-menu-item-icon",children:"\u2014"}),(0,A.jsx)("span",{children:u("none_value")})]}),a.schema.filter(N=>N.type==="select"||N.type==="status").map(N=>(0,A.jsxs)("button",{className:`nb-menu-item${m.timelineGroupByField===N.id?" nb-menu-item--active":""}`,onClick:()=>{xe({...m,timelineGroupByField:N.id}),L(!1)},children:[(0,A.jsx)("span",{className:"nb-menu-item-icon",children:Ke(N.type)}),(0,A.jsx)("span",{children:N.name})]},N.id))]})]}),(0,A.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:te,children:[(0,A.jsx)("button",{className:`nb-toolbar-btn${h?" nb-toolbar-btn--active":""}`,onClick:()=>y(N=>!N),children:u("fields")}),h&&(0,A.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,A.jsx)("div",{className:"nb-fields-dropdown-label",children:u("fields_on_bars")}),a.schema.map(N=>(0,A.jsxs)("label",{className:"nb-field-row",children:[(0,A.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:N.visible&&!m.hiddenColumns.includes(N.id),onChange:()=>{Et(N.id)}}),(0,A.jsx)("span",{className:"nb-field-icon",children:Ke(N.type)}),(0,A.jsx)("span",{className:"nb-field-name",children:N.name})]},N.id))]})]}),(0,A.jsxs)("div",{className:"nb-cal-nav",children:[(0,A.jsx)("button",{className:"nb-toolbar-btn nb-cal-nav-arrow",onClick:bt,title:u("timeline_scroll_prev"),children:"\u2039"}),(0,A.jsx)("button",{className:"nb-toolbar-btn nb-cal-today-btn",onClick:it,children:u("calendar_today")}),(0,A.jsx)("button",{className:"nb-toolbar-btn nb-cal-nav-arrow",onClick:$t,title:u("timeline_scroll_next"),children:"\u203A"})]}),(0,A.jsx)("div",{className:"nb-tl-zoom-group",children:["days","weeks","months"].map(N=>(0,A.jsx)("button",{className:`nb-tl-zoom-btn${Ie===N?" nb-tl-zoom-btn--active":""}`,onClick:()=>{xe({...m,timelineZoom:N})},children:Ov()[N]},N))}),(0,A.jsx)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon nb-subfolder-toggle ${m.includeSubfolders?"nb-toolbar-btn--active":""}`,onClick:()=>{xe({...m,includeSubfolders:!m.includeSubfolders})},title:u("tooltip_include_subfolders"),children:(0,A.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,A.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),(0,A.jsx)("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),(0,A.jsx)("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]})}),(0,A.jsxs)("span",{className:"nb-row-count",children:[$.length," ",$.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase()]}),(0,A.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:Y,style:{marginLeft:"auto"},children:[(0,A.jsxs)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon${d?" nb-toolbar-btn--active":""}`,onClick:()=>v(N=>!N),title:u("filters"),children:[(0,A.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,A.jsx)("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})}),c.length>0&&(0,A.jsx)("span",{className:"nb-hidden-badge",children:c.length})]}),d&&(0,A.jsxs)("div",{className:"nb-fields-dropdown nb-filter-menu-dropdown",children:[(0,A.jsx)("div",{className:"nb-fields-dropdown-label",children:u("filter_by")}),(0,A.jsxs)("button",{className:"nb-menu-item",onClick:()=>ft("_title","Nome","\u{1F4C4}","title"),children:[(0,A.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,A.jsx)("span",{children:u("name_column")})]}),a.schema.map(N=>(0,A.jsxs)("button",{className:"nb-menu-item",onClick:()=>ft(N.id,N.name,Ke(N.type),N.type),children:[(0,A.jsx)("span",{className:"nb-menu-item-icon",children:Ke(N.type)}),(0,A.jsx)("span",{children:N.name})]},N.id))]})]})]}),c.length>0&&(0,A.jsx)("div",{className:"nb-filter-pills-row",children:c.map((N,be)=>(0,A.jsxs)(qe.Fragment,{children:[be>0&&(0,A.jsx)("button",{className:`nb-pill-conjunction${N.conjunction==="or"?" nb-pill-conjunction--or":""}`,onClick:()=>Mt(N.id),children:N.conjunction==="or"?u("conjunction_or"):u("conjunction_and")}),(0,A.jsxs)("span",{className:"nb-filter-pill",children:[(0,A.jsx)("span",{className:"nb-pill-icon",children:N.icon}),(0,A.jsx)("span",{className:"nb-pill-name",children:N.columnName}),(0,A.jsx)("select",{className:"nb-pill-op-select",value:N.operator,onChange:Me=>vt(N.id,Me.target.value,N.value),children:Dn(N.columnType).map(Me=>(0,A.jsx)("option",{value:Me,children:Mn[Me]},Me))}),!Cn.has(N.operator)&&(0,A.jsx)("input",{className:"nb-pill-value-input",type:"text",value:N.value,onChange:Me=>vt(N.id,N.operator,Me.target.value)}),(0,A.jsx)("button",{className:"nb-pill-remove",onClick:()=>Jt(N.id),children:"\xD7"})]})]},N.id))})]});return(0,A.jsxs)("div",{className:"nb-container",children:[we,ve?(0,A.jsx)("div",{className:"nb-tl-body",ref:me,children:(0,A.jsxs)("div",{className:"nb-tl-canvas-wrapper",style:{width:Iv+Ze},children:[(0,A.jsxs)("div",{className:"nb-tl-sidebar",style:{width:Iv},children:[(0,A.jsx)("div",{className:"nb-tl-sidebar-corner",style:{height:xu}}),ke.map((N,be)=>N.kind==="group"?(0,A.jsxs)("div",{className:"nb-tl-sidebar-row nb-tl-sidebar-group",style:{height:Av},children:[N.color&&(0,A.jsx)("span",{className:"nb-tl-group-dot",style:{background:N.color}}),(0,A.jsx)("span",{children:N.label})]},`sg-${be}`):(0,A.jsxs)("div",{className:"nb-tl-sidebar-row",style:{height:im},onClick:()=>{r.workspace.getLeaf().openFile(N.row._file)},children:[(0,A.jsx)("span",{className:"nb-tl-row-label",children:N.row._title}),(()=>{let Me=e?.parent?.path??"",Se=N.row._file.parent?.path??"",U=m.includeSubfolders&&Se.length>Me.length?Se.slice(Me.length+1):"";return U?(0,A.jsx)("div",{className:"nb-folder-path",children:U}):null})()]},N.row._file.path))]}),(0,A.jsxs)("div",{className:"nb-tl-right",style:{width:Ze},children:[(0,A.jsxs)("div",{className:"nb-tl-header",style:{height:xu},children:[(0,A.jsx)("div",{className:"nb-tl-header-row",style:{height:xu/2,borderBottom:"1px solid var(--background-modifier-border)"},children:De.top.map(N=>(0,A.jsx)("div",{className:"nb-tl-header-top-cell",style:{left:N.left,width:N.width},children:N.label},N.key))}),(0,A.jsx)("div",{className:"nb-tl-header-row",style:{height:xu/2},children:De.bottom.map(N=>(0,A.jsx)("div",{className:"nb-tl-header-bottom-cell",style:{left:N.left,width:N.width},children:N.label},N.key))})]}),(0,A.jsxs)("div",{style:{position:"relative",width:Ze},children:[H&&(0,A.jsx)("div",{className:"nb-tl-today-line",style:{left:q}}),ke.map((N,be)=>N.kind==="group"?(0,A.jsx)("div",{className:"nb-tl-group-row",style:{height:Av}},`gr-${be}`):(0,A.jsx)("div",{className:`nb-tl-row${be%2===0?"":" nb-tl-row--odd"}`,style:{height:im},children:N.barLeft!==null&&N.barWidth!==null&&(()=>{let Me=re?.filePath===N.row._file.path,Se=N.barLeft,U=N.barWidth;return Me&&re&&(re.handle==="left"?(Se=N.barLeft+ue,U=N.barWidth-ue):U=N.barWidth+ue),U=Math.max(8,U),(0,A.jsx)(pS,{row:N.row,barLeft:Se,barWidth:U,origBarLeft:N.barLeft,origBarWidth:N.barWidth,isMobile:en,visibleCols:D,dbFolderPath:M,includeSubfolders:m.includeSubfolders??!1,startFieldId:ve?.id??null,endFieldId:S?.id??null,onOpen:Ce,onContextMenu:C,onResizeStart:X})})()},N.row._file.path))]})]})]})}):(0,A.jsx)("div",{className:"nb-cal-no-field",children:(0,A.jsx)("p",{children:u("timeline_no_start_field")})}),Z.length>0&&(0,A.jsxs)("div",{className:"nb-tl-no-interval",children:[(0,A.jsxs)("div",{className:"nb-tl-no-interval-title",onClick:()=>W(N=>!N),children:[V?"\u25BE":"\u25B8"," ",u("timeline_no_interval")," (",Z.length,")"]}),V&&(0,A.jsx)("div",{className:"nb-tl-no-interval-list",children:Z.map(N=>(0,A.jsx)("div",{className:"nb-cal-card nb-cal-card--no-date",onClick:()=>{r.workspace.getLeaf().openFile(N._file)},children:(0,A.jsx)("span",{className:"nb-cal-card-title",children:N._title})},N._file.path))})]}),(0,A.jsxs)(ot,{open:de!==null,onClose:()=>Re(null),title:de?.basename??"",children:[(0,A.jsxs)("button",{className:"nb-menu-item",onClick:()=>{de&&r.workspace.getLeaf().openFile(de),Re(null)},children:[(0,A.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,A.jsx)("span",{children:u("open_note")})]}),(0,A.jsxs)("button",{className:"nb-menu-item",onClick:()=>{de&&t.duplicateNotes([de]),Re(null)},children:[(0,A.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4CB}"}),(0,A.jsx)("span",{children:u("duplicate_note")})]}),(0,A.jsx)("div",{className:"nb-menu-separator"}),(0,A.jsxs)("button",{className:"nb-menu-item nb-menu-item--danger",onClick:()=>{de&&t.deleteNotes([de]),Re(null)},children:[(0,A.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F5D1}"}),(0,A.jsx)("span",{children:u("delete_note")})]})]})]})}var st=ze(yt(),1),Bv=ze(vo(),1);var O=ze(Rt(),1),da=["#4c6ef5","#7950f2","#e64980","#f76707","#fab005","#40c057","#15aabf","#be4bdb","#fd7e14","#20c997","#228be6","#845ef7","#f06595","#ff922b","#fcc419","#51cf66","#22b8cf","#cc5de8","#ff6b6b","#38d9a9"];function jv(e){let t=Math.abs(e);return t>=1e6?(e/1e6).toFixed(1).replace(/\.0$/,"")+"M":t>=1e4?(e/1e3).toFixed(0)+"k":t>=1e3?(e/1e3).toFixed(1).replace(/\.0$/,"")+"k":Number.isInteger(e)?String(e):e.toFixed(1)}function am(e){return Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:2})}function Hv(e,t){if(e<=t&&Number.isInteger(e))return Array.from({length:Math.floor(e)+1},(a,s)=>s);let n=e/t,o=Math.pow(10,Math.floor(Math.log10(n))),r=n/o,i=r<=1.5?o:r<=3?2*o:r<=7?5*o:10*o,l=[];for(let a=0;a<=e+i*.01;a+=i)l.push(Math.round(a*1e3)/1e3);return l[l.length-1]<e&&l.push(l[l.length-1]+i),l}function mS(e,t,n,o,r){let i=new Map;for(let s of e){let c=t==="_title"?s._title:s[t],p=Array.isArray(c)?c:[c==null?u("no_value"):String(c)];for(let m of p){let g=m.trim()||u("no_value"),d=i.get(g)??[];d.push(s),i.set(g,d)}}let l=[],a=0;for(let[s,c]of i){let p;if(!n||n==="_count")p=c.length;else{let m=c.map(g=>{let d=g[n];return typeof d=="number"?d:parseFloat(d==null?"":String(d))}).filter(g=>!isNaN(g));switch(o){case"sum":p=m.reduce((g,d)=>g+d,0);break;case"avg":p=m.length>0?m.reduce((g,d)=>g+d,0)/m.length:0;break;case"min":p=m.length>0?Math.min(...m):0;break;case"max":p=m.length>0?Math.max(...m):0;break;default:p=m.reduce((g,d)=>g+d,0);break}}l.push({label:s,value:p,color:da[a%da.length]}),a++}return l}function fS({data:e,width:t,height:n}){if(e.length===0)return(0,O.jsx)("text",{x:t/2,y:n/2,textAnchor:"middle",fill:"var(--text-muted)",children:u("no_results")});let o={top:20,right:20,bottom:60,left:60},r=t-o.left-o.right,i=n-o.top-o.bottom,l=Math.max(...e.map(v=>v.value),1),a=Math.min(Math.max(r/e.length-4,8),60),s=e.length*(a+4),c=Math.max((r-s)/2,0),p=Hv(l,5),m=p[p.length-1]||l,[g,d]=(0,st.useState)(null);return(0,O.jsxs)("g",{transform:`translate(${o.left},${o.top})`,children:[p.map((v,h)=>{let y=i-v/m*i;return(0,O.jsxs)("g",{children:[(0,O.jsx)("line",{x1:0,y1:y,x2:r,y2:y,stroke:"var(--background-modifier-border)",strokeDasharray:"2,2"}),(0,O.jsx)("text",{x:-8,y:y+4,textAnchor:"end",fontSize:11,fill:"var(--text-muted)",children:jv(v)})]},h)}),e.map((v,h)=>{let y=v.value/m*i,_=c+h*(a+4),f=i-y,w=`${v.label}: ${am(v.value)}`,R=Math.max(w.length*7,60);return(0,O.jsxs)("g",{onMouseEnter:()=>d(h),onMouseLeave:()=>d(null),children:[(0,O.jsx)("rect",{x:_,y:f,width:a,height:y,rx:2,fill:v.color,opacity:g===null||g===h?1:.4,style:{transition:"opacity 0.15s, height 0.3s, y 0.3s"}}),(0,O.jsx)("text",{x:_+a/2,y:i+14,textAnchor:"end",fontSize:11,fill:"var(--text-normal)",transform:`rotate(-35, ${_+a/2}, ${i+14})`,children:v.label.length>12?v.label.slice(0,11)+"\u2026":v.label}),g===h&&(0,O.jsxs)("g",{children:[(0,O.jsx)("rect",{x:_+a/2-R/2,y:f-28,width:R,height:22,rx:4,fill:"var(--background-primary)",stroke:"var(--background-modifier-border)"}),(0,O.jsx)("text",{x:_+a/2,y:f-13,textAnchor:"middle",fontSize:12,fontWeight:"600",fill:"var(--text-normal)",children:w})]})]},h)}),(0,O.jsx)("line",{x1:0,y1:0,x2:0,y2:i,stroke:"var(--background-modifier-border)"}),(0,O.jsx)("line",{x1:0,y1:i,x2:r,y2:i,stroke:"var(--background-modifier-border)"})]})}function gS({data:e,width:t,height:n}){if(e.length===0)return(0,O.jsx)("text",{x:t/2,y:n/2,textAnchor:"middle",fill:"var(--text-muted)",children:u("no_results")});let o=e.reduce((d,v)=>d+v.value,0);if(o===0)return(0,O.jsx)("text",{x:t/2,y:n/2,textAnchor:"middle",fill:"var(--text-muted)",children:u("no_results")});let r=t*.4,i=n/2,l=Math.min(r,i)-20,[a,s]=(0,st.useState)(null),c=-Math.PI/2,p=e.map((d,v)=>{let h=d.value/o*2*Math.PI,y=c;c+=h;let _=c,f=r+l*Math.cos(y),w=i+l*Math.sin(y),R=r+l*Math.cos(_),P=i+l*Math.sin(_),L=h>Math.PI?1:0,V=y+h/2,W=l+16,re=r+W*Math.cos(V),J=i+W*Math.sin(V),ue=e.length===1?`M ${r+l} ${i} A ${l} ${l} 0 1 1 ${r+l-.001} ${i}`:`M ${r} ${i} L ${f} ${w} A ${l} ${l} 0 ${L} 1 ${R} ${P} Z`,Ne=a===v,de=Ne?"scale(1.04)":"scale(1)",Re=(d.value/o*100).toFixed(1);return(0,O.jsxs)("g",{onMouseEnter:()=>s(v),onMouseLeave:()=>s(null),style:{transformOrigin:`${r}px ${i}px`,transform:de,transition:"transform 0.15s"},children:[(0,O.jsx)("path",{d:ue,fill:d.color,opacity:a===null||Ne?1:.5,stroke:"var(--background-primary)",strokeWidth:2}),h>.3&&(0,O.jsxs)("text",{x:re,y:J,textAnchor:"middle",fontSize:11,fill:"var(--text-muted)",children:[Re,"%"]})]},v)}),m=t*.75,g=e.slice(0,12);return(0,O.jsxs)("g",{children:[p,g.map((d,v)=>(0,O.jsxs)("g",{transform:`translate(${m}, ${30+v*22})`,onMouseEnter:()=>s(v),onMouseLeave:()=>s(null),style:{cursor:"default"},children:[(0,O.jsx)("rect",{width:12,height:12,rx:2,fill:d.color}),(0,O.jsxs)("text",{x:18,y:10,fontSize:12,fill:"var(--text-normal)",children:[d.label.length>16?d.label.slice(0,15)+"\u2026":d.label," (",am(d.value),")"]})]},v)),e.length>12&&(0,O.jsxs)("text",{x:m,y:304,fontSize:11,fill:"var(--text-muted)",children:["+",e.length-12," ",u("board_show_more").toLowerCase()]})]})}function hS({data:e,width:t,height:n}){if(e.length===0)return(0,O.jsx)("text",{x:t/2,y:n/2,textAnchor:"middle",fill:"var(--text-muted)",children:u("no_results")});let o={top:20,right:20,bottom:60,left:60},r=t-o.left-o.right,i=n-o.top-o.bottom,l=Math.max(...e.map(_=>_.value),1),a=30,s=r-a*2,c=e.length>1?s/(e.length-1):0,p=Hv(l,5),m=p[p.length-1]||l,[g,d]=(0,st.useState)(null),v=e.map((_,f)=>({x:a+(e.length===1?s/2:f*c),y:i-_.value/m*i})),h=v.map(_=>`${_.x},${_.y}`).join(" "),y=`M ${v[0].x} ${i} `+v.map(_=>`L ${_.x} ${_.y}`).join(" ")+` L ${v[v.length-1].x} ${i} Z`;return(0,O.jsxs)("g",{transform:`translate(${o.left},${o.top})`,children:[p.map((_,f)=>{let w=i-_/m*i;return(0,O.jsxs)("g",{children:[(0,O.jsx)("line",{x1:0,y1:w,x2:r,y2:w,stroke:"var(--background-modifier-border)",strokeDasharray:"2,2"}),(0,O.jsx)("text",{x:-8,y:w+4,textAnchor:"end",fontSize:11,fill:"var(--text-muted)",children:jv(_)})]},f)}),(0,O.jsx)("path",{d:y,fill:da[0],opacity:.1}),(0,O.jsx)("polyline",{points:h,fill:"none",stroke:da[0],strokeWidth:2.5,strokeLinejoin:"round",strokeLinecap:"round"}),e.map((_,f)=>{let w=`${_.label}: ${am(_.value)}`,R=Math.max(w.length*7,60);return(0,O.jsxs)("g",{onMouseEnter:()=>d(f),onMouseLeave:()=>d(null),children:[(0,O.jsx)("circle",{cx:v[f].x,cy:v[f].y,r:g===f?6:4,fill:da[0],stroke:"var(--background-primary)",strokeWidth:2,style:{transition:"r 0.15s"}}),(0,O.jsx)("text",{x:v[f].x,y:i+14,textAnchor:"end",fontSize:11,fill:"var(--text-normal)",transform:`rotate(-35, ${v[f].x}, ${i+14})`,children:_.label.length>12?_.label.slice(0,11)+"\u2026":_.label}),g===f&&(0,O.jsxs)("g",{children:[(0,O.jsx)("rect",{x:v[f].x-R/2,y:v[f].y-28,width:R,height:22,rx:4,fill:"var(--background-primary)",stroke:"var(--background-modifier-border)"}),(0,O.jsx)("text",{x:v[f].x,y:v[f].y-13,textAnchor:"middle",fontSize:12,fontWeight:"600",fill:"var(--text-normal)",children:w})]})]},f)}),(0,O.jsx)("line",{x1:0,y1:0,x2:0,y2:i,stroke:"var(--background-modifier-border)"}),(0,O.jsx)("line",{x1:0,y1:i,x2:r,y2:i,stroke:"var(--background-modifier-border)"})]})}function _S({sorts:e,schema:t,onSortChange:n,onClose:o,anchorRect:r,panelRef:i}){let[l,a]=(0,st.useState)({x:r.right-280,y:r.bottom+4}),s=d=>{d.preventDefault();let v=d.clientX-l.x,h=d.clientY-l.y,y=f=>a({x:f.clientX-v,y:f.clientY-h}),_=()=>{window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",_)};window.addEventListener("mousemove",y),window.addEventListener("mouseup",_)},c=t.filter(d=>d.type!=="formula"&&d.type!=="lookup"&&d.type!=="relation"&&d.type!=="multiselect"),p=new Set(e.map(d=>d.columnId)),m=[...p.has("_title")?[]:[{id:"_title",name:"Nome"}],...c.filter(d=>!p.has(d.id)).map(d=>({id:d.id,name:d.name}))],g=(d,v)=>{let h=[...e],y=d+v;y<0||y>=h.length||([h[d],h[y]]=[h[y],h[d]],n(h))};return(0,Bv.createPortal)((0,O.jsxs)("div",{ref:i,className:"nb-sort-panel",style:{position:"fixed",top:l.y,left:l.x},children:[(0,O.jsxs)("div",{className:"nb-sort-panel-titlebar",onMouseDown:s,children:[(0,O.jsx)("span",{className:"nb-sort-panel-title",children:u("sort_by")}),(0,O.jsx)("button",{className:"nb-sort-panel-close",onClick:o,title:u("tooltip_close"),children:"\xD7"})]}),e.length===0&&(0,O.jsx)("div",{className:"nb-sort-panel-empty",children:u("no_active_sorts")}),e.map((d,v)=>{let h=d.columnId==="_title"?"Nome":t.find(y=>y.id===d.columnId)?.name??d.columnId;return(0,O.jsxs)("div",{className:"nb-sort-row",children:[(0,O.jsxs)("div",{className:"nb-sort-row-priority",children:[(0,O.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>g(v,-1),disabled:v===0,title:u("tooltip_move_up"),children:"\u2191"}),(0,O.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>g(v,1),disabled:v===e.length-1,title:u("tooltip_move_down"),children:"\u2193"})]}),(0,O.jsx)("span",{className:"nb-sort-row-name",children:h}),(0,O.jsx)("button",{className:"nb-sort-dir-btn",onClick:()=>n(e.map(y=>y.columnId===d.columnId?{...y,direction:y.direction==="asc"?"desc":"asc"}:y)),children:d.direction==="asc"?u("sort_asc"):u("sort_desc")}),(0,O.jsx)("button",{className:"nb-sort-remove-btn",onClick:()=>n(e.filter(y=>y.columnId!==d.columnId)),title:u("tooltip_remove"),children:"\xD7"})]},d.columnId)}),m.length>0&&(0,O.jsx)("div",{className:"nb-sort-add-row",children:(0,O.jsxs)("select",{className:"nb-sort-add-select",value:"",onChange:d=>{d.target.value&&(n([...e,{columnId:d.target.value,direction:"asc"}]),d.target.value="")},children:[(0,O.jsx)("option",{value:"",children:"+ "+u("add_sort")+"..."}),m.map(d=>(0,O.jsx)("option",{value:d.id,children:d.name},d.id))]})})]}),document.body)}function vS({filter:e,onUpdate:t,onRemove:n,onToggleConjunction:o,showConjunction:r}){let i=Dn(e.columnType);return(0,O.jsxs)(st.Fragment,{children:[r&&(0,O.jsx)("button",{className:`nb-pill-conjunction${e.conjunction==="or"?" nb-pill-conjunction--or":""}`,onClick:o,children:e.conjunction==="or"?u("conjunction_or"):u("conjunction_and")}),(0,O.jsxs)("span",{className:"nb-filter-pill",children:[(0,O.jsx)("span",{className:"nb-pill-icon",children:e.icon}),(0,O.jsx)("span",{className:"nb-pill-name",children:e.columnName}),(0,O.jsx)("select",{className:"nb-pill-op-select",value:e.operator,onChange:l=>t(l.target.value,e.value),children:i.map(l=>(0,O.jsx)("option",{value:l,children:Mn[l]},l))}),!Cn.has(e.operator)&&(0,O.jsx)("input",{className:"nb-pill-value-input",type:"text",value:e.value,onChange:l=>t(e.operator,l.target.value)}),(0,O.jsx)("button",{className:"nb-pill-remove",onClick:n,children:"\xD7"})]})]})}function Vv(){return(0,O.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,O.jsx)("rect",{x:"3",y:"12",width:"4",height:"9"}),(0,O.jsx)("rect",{x:"10",y:"5",width:"4",height:"16"}),(0,O.jsx)("rect",{x:"17",y:"9",width:"4",height:"12"})]})}function bS(){return(0,O.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,O.jsx)("polyline",{points:"3 18 9 11 13 15 21 5"})})}function yS(){return(0,O.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,O.jsx)("path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83"}),(0,O.jsx)("path",{d:"M22 12A10 10 0 0 0 12 2v10z"})]})}function Uv({dbFile:e,manager:t,externalView:n,onViewChange:o}){let r=Dt(),{rows:i,config:l,loading:a,activeFilters:s,setActiveFilters:c}=Ln({app:r,dbFile:e,manager:t,includeSubfolders:n.includeSubfolders,externalView:n}),[p,m]=(0,st.useState)(n),[g,d]=(0,st.useState)(!1),[v,h]=(0,st.useState)(!1),[y,_]=(0,st.useState)(null),[f,w]=(0,st.useState)(!1),R=(0,st.useRef)(null),P=(0,st.useRef)(null),L=(0,st.useRef)(null),V=(0,st.useRef)(null),W=(0,st.useRef)(null),re=(0,st.useRef)(null),[J,ue]=(0,st.useState)({width:600,height:400});(0,st.useEffect)(()=>{m(n)},[n.id]);let Ne=(0,st.useCallback)(async $=>{m($),await o($)},[o]),de=p.chartType??"bar",Re=p.chartXAxis??"",Y=p.chartYAxis??"_count",te=p.chartAggregation??"count";(0,st.useEffect)(()=>{let $=re.current;if(!$)return;let oe=new ResizeObserver(ve=>{for(let S of ve){let K=S.contentRect.width,D=Math.max(S.contentRect.height,300);ue({width:Math.max(K,300),height:Math.min(D,600)})}});return oe.observe($),()=>oe.disconnect()},[a]),(0,st.useEffect)(()=>{if(!g)return;let $=oe=>{W.current?.contains(oe.target)||R.current&&!R.current.contains(oe.target)&&d(!1)};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[g]),(0,st.useEffect)(()=>{if(!v)return;let $=oe=>{W.current?.contains(oe.target)||L.current?.contains(oe.target)||P.current&&!P.current.contains(oe.target)&&h(!1)};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[v]),(0,st.useEffect)(()=>{if(!f)return;let $=oe=>{W.current?.contains(oe.target)||V.current&&!V.current.contains(oe.target)&&w(!1)};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[f]);let j=(0,st.useCallback)(async $=>{let oe=$.map(ve=>({id:ve.id,columnId:ve.columnId,operator:ve.operator,value:ve.value,conjunction:ve.conjunction}));await Ne({...p,activePills:oe})},[Ne,p]),ie=($,oe,ve,S)=>{let K=[...s,{id:crypto.randomUUID(),columnId:$,columnName:oe,columnType:S,icon:ve,operator:io(S),value:"",conjunction:"and"}];c(K),j(K),d(!1)},_e=$=>{let oe=s.filter(ve=>ve.id!==$);c(oe),j(oe)},me=($,oe,ve)=>{let S=s.map(K=>K.id===$?{...K,operator:oe,value:ve}:K);c(S),j(S)},Ae=$=>{let oe=s.map(ve=>ve.id===$?{...ve,conjunction:ve.conjunction==="and"?"or":"and"}:ve);c(oe),j(oe)},Ee=(0,st.useCallback)(async $=>{await Ne({...p,sorts:$})},[p,Ne]),xe=Pn(s,200),Fe=(0,st.useMemo)(()=>lo(i,xe),[i,xe]),Ie=(0,st.useMemo)(()=>qn(Fe,p.sorts),[Fe,p.sorts]),Ve=(0,st.useMemo)(()=>{if(!Re)return[];let $=mS(Ie,Re,Y==="_count"?void 0:Y,te,l.schema);return p.sorts.length===0&&$.sort((oe,ve)=>ve.value-oe.value),$},[Ie,Re,Y,te,l.schema,p.sorts.length]),He=(0,st.useMemo)(()=>{let $=l.schema.filter(oe=>oe.visible&&["text","select","multiselect","status","date","checkbox"].includes(oe.type));return[{id:"_title",name:u("name_column"),type:"title"},...$]},[l.schema]),Ye=(0,st.useMemo)(()=>{let $=l.schema.filter(oe=>oe.visible&&oe.type==="number");return[{id:"_count",name:u("chart_count_records"),type:"count"},...$]},[l.schema]),Ze=In();if(!e)return(0,O.jsx)("div",{className:"nb-empty-state",children:(0,O.jsx)("p",{children:u("no_database_open")})});if(a)return(0,O.jsx)("div",{className:"nb-loading",children:u("loading")});let De=$=>{$!=="filter"&&d(!1),$!=="sort"&&h(!1),$!=="config"&&w(!1)},q=(0,O.jsxs)("div",{className:"nb-chart-config-body",children:[(0,O.jsxs)("div",{className:"nb-chart-config-row",children:[(0,O.jsx)("label",{className:"nb-chart-config-label",children:u("chart_type")}),(0,O.jsx)("div",{className:"nb-chart-type-btns",children:["bar","line","pie"].map($=>(0,O.jsxs)("button",{className:`nb-chart-type-btn${de===$?" nb-chart-type-btn--active":""}`,onClick:()=>{Ne({...p,chartType:$})},title:u(`chart_type_${$}`),children:[$==="bar"&&(0,O.jsx)(Vv,{}),$==="line"&&(0,O.jsx)(bS,{}),$==="pie"&&(0,O.jsx)(yS,{})]},$))})]}),(0,O.jsxs)("div",{className:"nb-chart-config-row",children:[(0,O.jsx)("label",{className:"nb-chart-config-label",children:u("chart_x_axis")}),(0,O.jsxs)("select",{className:"nb-chart-config-select",value:Re,onChange:$=>{Ne({...p,chartXAxis:$.target.value})},children:[(0,O.jsx)("option",{value:"",children:u("chart_select_column")}),He.map($=>(0,O.jsx)("option",{value:$.id,children:$.name},$.id))]})]}),(0,O.jsxs)("div",{className:"nb-chart-config-row",children:[(0,O.jsx)("label",{className:"nb-chart-config-label",children:u("chart_y_axis")}),(0,O.jsx)("select",{className:"nb-chart-config-select",value:Y,onChange:$=>{Ne({...p,chartYAxis:$.target.value})},children:Ye.map($=>(0,O.jsx)("option",{value:$.id,children:$.name},$.id))})]}),Y!=="_count"&&(0,O.jsxs)("div",{className:"nb-chart-config-row",children:[(0,O.jsx)("label",{className:"nb-chart-config-label",children:u("chart_aggregation")}),(0,O.jsxs)("select",{className:"nb-chart-config-select",value:te,onChange:$=>{Ne({...p,chartAggregation:$.target.value})},children:[(0,O.jsx)("option",{value:"sum",children:u("agg_sum")}),(0,O.jsx)("option",{value:"avg",children:u("agg_avg")}),(0,O.jsx)("option",{value:"min",children:u("agg_min")}),(0,O.jsx)("option",{value:"max",children:u("agg_max")})]})]})]}),ce=Ze?(0,O.jsxs)($n,{actionBarRef:W,actions:[{id:"config",label:u("chart_configure"),icon:(0,O.jsx)(Vv,{}),active:f,onClick:()=>{De("config"),w($=>!$)}},{id:"subfolders",label:u("tooltip_include_subfolders"),icon:(0,O.jsx)(On,{}),active:!!p.includeSubfolders,onClick:()=>{De(),Ne({...p,includeSubfolders:!p.includeSubfolders})}},{id:"sort",label:u("sort"),icon:(0,O.jsx)(so,{}),active:p.sorts.length>0,badge:p.sorts.length||void 0,onClick:()=>{De("sort"),!v&&L.current&&_(L.current.getBoundingClientRect()),h($=>!$)}},{id:"filter",label:u("filter"),icon:(0,O.jsx)(An,{}),active:g,badge:s.length||void 0,onClick:()=>{De("filter"),d($=>!$)}}],rowCount:Ie.length,rowCountLabel:Ie.length===1?u("record_singular").toLowerCase():u("record_plural").toLowerCase(),filters:s,onFilterUpdate:me,onFilterRemove:_e,onConjunctionToggle:Ae,children:[(0,O.jsx)(ot,{open:f,onClose:()=>w(!1),title:u("chart_configure"),children:q}),(0,O.jsxs)(ot,{open:g,onClose:()=>d(!1),title:u("filter"),children:[(0,O.jsxs)("button",{className:"nb-menu-item",onClick:()=>ie("_title",u("name_column"),"\u{1F4C4}","title"),children:[(0,O.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,O.jsx)("span",{children:u("name_column")})]}),l.schema.map($=>(0,O.jsxs)("button",{className:"nb-menu-item",onClick:()=>ie($.id,$.name,Ke($.type),$.type),children:[(0,O.jsx)("span",{className:"nb-menu-item-icon",children:Ke($.type)}),(0,O.jsx)("span",{children:$.name})]},$.id))]}),(0,O.jsxs)(ot,{open:v,onClose:()=>h(!1),title:u("sort"),children:[p.sorts.length===0&&(0,O.jsx)("div",{className:"nb-sort-panel-empty",style:{padding:"8px 0"},children:u("no_active_sorts")}),p.sorts.map(($,oe)=>{let ve=$.columnId==="_title"?"Nome":l.schema.find(S=>S.id===$.columnId)?.name??$.columnId;return(0,O.jsxs)("div",{className:"nb-sort-row",style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 0",minHeight:"44px"},children:[(0,O.jsxs)("div",{className:"nb-sort-row-priority",style:{display:"flex",flexDirection:"column",gap:"2px"},children:[(0,O.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>{let S=[...p.sorts];oe>0&&([S[oe],S[oe-1]]=[S[oe-1],S[oe]],Ee(S))},disabled:oe===0,children:"\u2191"}),(0,O.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>{let S=[...p.sorts];oe<S.length-1&&([S[oe],S[oe+1]]=[S[oe+1],S[oe]],Ee(S))},disabled:oe===p.sorts.length-1,children:"\u2193"})]}),(0,O.jsx)("span",{style:{flex:1},children:ve}),(0,O.jsx)("button",{className:"nb-sort-dir-btn",onClick:()=>{Ee(p.sorts.map(S=>S.columnId===$.columnId?{...S,direction:S.direction==="asc"?"desc":"asc"}:S))},children:$.direction==="asc"?u("sort_asc"):u("sort_desc")}),(0,O.jsx)("button",{className:"nb-sort-remove-btn",onClick:()=>{Ee(p.sorts.filter(S=>S.columnId!==$.columnId))},children:"\xD7"})]},$.columnId)}),(()=>{let $=l.schema.filter(S=>S.type!=="formula"&&S.type!=="lookup"&&S.type!=="relation"&&S.type!=="multiselect"),oe=new Set(p.sorts.map(S=>S.columnId)),ve=[...oe.has("_title")?[]:[{id:"_title",name:"Nome"}],...$.filter(S=>!oe.has(S.id)).map(S=>({id:S.id,name:S.name}))];return ve.length===0?null:(0,O.jsxs)("select",{className:"nb-mobile-filter-overlay-select",style:{width:"100%",marginTop:"8px",padding:"10px"},value:"",onChange:S=>{S.target.value&&(Ee([...p.sorts,{columnId:S.target.value,direction:"asc"}]),S.target.value="")},children:[(0,O.jsx)("option",{value:"",children:"+ "+u("add_sort")+"..."}),ve.map(S=>(0,O.jsx)("option",{value:S.id,children:S.name},S.id))]})})()]})]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)("div",{className:"nb-toolbar",children:[(0,O.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:V,children:[(0,O.jsx)("button",{className:`nb-toolbar-btn ${f?"nb-toolbar-btn--active":""}`,onClick:()=>w($=>!$),children:u("chart_configure")}),f&&(0,O.jsxs)("div",{className:"nb-fields-dropdown nb-chart-config-dropdown",children:[(0,O.jsx)("div",{className:"nb-fields-dropdown-label",children:u("chart_configure")}),q]})]}),(0,O.jsx)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon nb-subfolder-toggle ${p.includeSubfolders?"nb-toolbar-btn--active":""}`,onClick:()=>{Ne({...p,includeSubfolders:!p.includeSubfolders})},title:u("tooltip_include_subfolders"),children:(0,O.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,O.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),(0,O.jsx)("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),(0,O.jsx)("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]})}),(0,O.jsxs)("span",{className:"nb-row-count",children:[Ie.length," ",Ie.length===1?u("record_singular").toLowerCase():u("record_plural").toLowerCase()]}),(0,O.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:R,style:{marginLeft:"auto"},children:[(0,O.jsxs)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon ${g?"nb-toolbar-btn--active":""}`,onClick:()=>d($=>!$),title:u("filters"),children:[(0,O.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,O.jsx)("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})}),s.length>0&&(0,O.jsx)("span",{className:"nb-hidden-badge",children:s.length})]}),g&&(0,O.jsxs)("div",{className:"nb-fields-dropdown nb-filter-menu-dropdown",children:[(0,O.jsx)("div",{className:"nb-fields-dropdown-label",children:u("filter_by")}),(0,O.jsxs)("button",{className:"nb-menu-item",onClick:()=>ie("_title",u("name_column"),"\u{1F4C4}","title"),children:[(0,O.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,O.jsx)("span",{children:u("name_column")})]}),l.schema.map($=>(0,O.jsxs)("button",{className:"nb-menu-item",onClick:()=>ie($.id,$.name,Ke($.type),$.type),children:[(0,O.jsx)("span",{className:"nb-menu-item-icon",children:Ke($.type)}),(0,O.jsx)("span",{children:$.name})]},$.id))]})]}),(0,O.jsxs)("button",{ref:L,className:`nb-toolbar-btn${p.sorts.length>0?" nb-toolbar-btn--active":""}`,onClick:()=>{!v&&L.current&&_(L.current.getBoundingClientRect()),h($=>!$)},children:[(0,O.jsx)("span",{children:u("sort")}),p.sorts.length>0&&(0,O.jsx)("span",{className:"nb-hidden-badge",children:p.sorts.length})]}),v&&y&&(0,O.jsx)(_S,{sorts:p.sorts,schema:l.schema,onSortChange:$=>{Ee($)},onClose:()=>h(!1),anchorRect:y,panelRef:P})]}),s.length>0&&(0,O.jsx)("div",{className:"nb-filter-pills-row",children:s.map(($,oe)=>(0,O.jsx)(vS,{filter:$,showConjunction:oe>0,onUpdate:(ve,S)=>me($.id,ve,S),onRemove:()=>_e($.id),onToggleConjunction:()=>Ae($.id)},$.id))})]});return Re?(0,O.jsxs)("div",{className:"nb-container",children:[ce,(0,O.jsx)("div",{className:"nb-chart-wrapper",ref:re,children:(0,O.jsxs)("svg",{className:"nb-chart-svg",width:J.width,height:J.height,viewBox:`0 0 ${J.width} ${J.height}`,children:[de==="bar"&&(0,O.jsx)(fS,{data:Ve,width:J.width,height:J.height}),de==="pie"&&(0,O.jsx)(gS,{data:Ve,width:J.width,height:J.height}),de==="line"&&(0,O.jsx)(hS,{data:Ve,width:J.width,height:J.height})]})})]}):(0,O.jsxs)("div",{className:"nb-container",children:[ce,(0,O.jsxs)("div",{className:"nb-chart-empty",children:[(0,O.jsx)("p",{children:u("chart_no_config")}),(0,O.jsx)("p",{className:"nb-chart-empty-hint",children:u("chart_no_config_hint")})]})]})}var rt=ze(Rt(),1),Ru={table:"\u229E",list:"\u2261",board:"\u25A6",gallery:"\u229F",calendar:"\u{1F4C5}",timeline:"\u25AC",chart:"\u{1F4CA}"},Nr=()=>({table:u("view_table"),list:u("view_list"),board:u("view_board"),gallery:u("view_gallery"),calendar:u("view_calendar"),timeline:u("view_timeline"),chart:u("view_chart")});function Eu({dbFile:e,manager:t,externalView:n,onViewChange:o,embedState:r,onEmbedStateChange:i}){let l=Dt(),[a,s]=(0,_t.useState)(hr),[c,p]=(0,_t.useState)(""),[m,g]=(0,_t.useState)(!1),d=(0,_t.useRef)(null),[v,h]=(0,_t.useState)(r?.views??[]),[y,_]=(0,_t.useState)(r?.activeViewId??""),[f,w]=(0,_t.useState)(!!r),[R,P]=(0,_t.useState)(!1),L=(0,_t.useRef)(null),V=!!n,W=!!i&&!V,re=!V&&!W,[J,ue]=(0,_t.useState)(null),[Ne,de]=(0,_t.useState)(""),Re=(0,_t.useRef)(null),[Y,te]=(0,_t.useState)(null),[j,ie]=(0,_t.useState)(null);(0,_t.useEffect)(()=>{if(!e||V)return;let q=t.readConfig(e);if(s(q),re)p(ce=>ce&&q.views.some($=>$.id===ce)?ce:q.views[0]?.id??"");else if(W&&!f){let ce=q.views.map(oe=>({...oe,id:crypto.randomUUID()})),$={activeViewId:ce[0]?.id??"",views:ce};h(ce),_(ce[0]?.id??""),w(!0),i($)}},[e,t,V]),(0,_t.useEffect)(()=>{if(!e||!re)return;let q=ce=>{ce===e&&s(t.readConfig(e))};return l.metadataCache.on("changed",q),()=>l.metadataCache.off("changed",q)},[e,t,l,re]),(0,_t.useEffect)(()=>{if(!m)return;let q=ce=>{d.current&&!d.current.contains(ce.target)&&g(!1)};return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[m]),(0,_t.useEffect)(()=>{if(!R)return;let q=ce=>{L.current&&!L.current.contains(ce.target)&&P(!1)};return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[R]);let _e=(q,ce)=>{ue(q),de(ce),requestAnimationFrame(()=>{Re.current?.select()})},me=(0,_t.useCallback)(async(q,ce,$)=>{if(!J)return;let oe=ce.trim();if(oe){let ve=q.map(S=>S.id===J?{...S,name:oe}:S);await $(ve)}ue(null)},[J]),Ae=(q,ce,$)=>{let oe=q.findIndex(D=>D.id===ce),ve=q.findIndex(D=>D.id===$);if(oe<0||ve<0)return q;let S=[...q],[K]=S.splice(oe,1);return S.splice(ve,0,K),S},Ee=async q=>{if(ie(null),!Y||Y===q||!e){te(null);return}let ce=Ae(a.views,Y,q),$={...a,views:ce};s($),te(null),await t.writeConfig(e,$)},xe=async q=>{if(ie(null),!Y||Y===q){te(null);return}let ce=Ae(v,Y,q);h(ce),te(null),await i({activeViewId:y,views:ce})};function Fe(q,ce,$){let oe={key:$,dbFile:e,manager:t,externalView:q,onViewChange:ce};return q.type==="list"?(0,rt.jsx)(xv,{...oe}):q.type==="board"?(0,rt.jsx)(Rv,{...oe}):q.type==="gallery"?(0,rt.jsx)(Dv,{...oe}):q.type==="calendar"?(0,rt.jsx)(Pv,{...oe}):q.type==="timeline"?(0,rt.jsx)(zv,{...oe}):q.type==="chart"?(0,rt.jsx)(Uv,{...oe}):(0,rt.jsx)(tm,{dbFile:e,manager:t,externalView:q,onViewChange:ce},$)}if(V)return Fe(n,o);if(W){let q=v.find(K=>K.id===y)??v[0]??Wn,ce=async K=>{let D=v.map(Z=>Z.id===K.id?K:Z);h(D),await i({activeViewId:y,views:D})},$=async K=>{let D={...Wn,id:crypto.randomUUID(),type:K,name:Nr()[K]??K,filters:[],sorts:[],hiddenColumns:[],columnWidths:{}},Z=[...v,D];h(Z),_(D.id),P(!1),await i({activeViewId:D.id,views:Z})},oe=async K=>{if(v.length<=1)return;let D=v.filter(ke=>ke.id!==K),Z=y===K?D[0].id:y;h(D),_(Z),await i({activeViewId:Z,views:D})},ve=K=>{_(K),i({activeViewId:K,views:v})},S=async K=>{h(K),await i({activeViewId:y,views:K})};return(0,rt.jsxs)(_t.Fragment,{children:[(0,rt.jsxs)("div",{className:"nb-view-tabs nb-view-tabs--embed",children:[v.map(K=>(0,rt.jsxs)("button",{className:`nb-view-tab${K.id===y?" nb-view-tab--active":""}${j===K.id&&Y!==K.id?" nb-view-tab--drag-over":""}`,draggable:!0,onDragStart:()=>te(K.id),onDragOver:D=>{D.preventDefault(),ie(K.id)},onDragLeave:()=>ie(null),onDrop:()=>{xe(K.id)},onDragEnd:()=>{te(null),ie(null)},onClick:()=>J!==K.id&&ve(K.id),children:[(0,rt.jsx)("span",{className:"nb-view-tab-icon",children:Ru[K.type]??"\u25A1"}),J===K.id?(0,rt.jsx)("input",{ref:Re,className:"nb-view-tab-rename-input",value:Ne,onChange:D=>de(D.target.value),onBlur:()=>{me(v,Ne,S)},onKeyDown:D=>{D.key==="Enter"&&(D.preventDefault(),me(v,Ne,S)),D.key==="Escape"&&(D.preventDefault(),ue(null))},onClick:D=>D.stopPropagation()}):(0,rt.jsx)("span",{onDoubleClick:D=>{D.stopPropagation(),_e(K.id,K.name??Nr()[K.type]??K.type)},title:u("rename_view_hint"),children:K.name??Nr()[K.type]??K.type}),v.length>1&&J!==K.id&&(0,rt.jsx)("span",{className:"nb-view-tab-remove",onClick:D=>{D.stopPropagation(),oe(K.id)},title:u("remove_view"),children:"\xD7"})]},K.id)),(0,rt.jsxs)("div",{className:"nb-view-tab-add",ref:L,children:[(0,rt.jsx)("button",{className:"nb-view-tab-add-btn",onClick:()=>P(K=>!K),title:u("add_view"),children:"+"}),R&&(0,rt.jsxs)("div",{className:"nb-view-add-menu nb-fields-dropdown",children:[(0,rt.jsx)("div",{className:"nb-fields-dropdown-label",children:u("add_view")}),["table","list","board","gallery","calendar","timeline","chart"].map(K=>(0,rt.jsxs)("button",{className:"nb-menu-item",onClick:()=>{$(K)},children:[(0,rt.jsx)("span",{className:"nb-menu-item-icon",children:Ru[K]}),(0,rt.jsx)("span",{children:Nr()[K]})]},K))]})]})]}),Fe(q,ce,y)]})}let Ie=(0,_t.useCallback)(async q=>{if(!e)return;let ce=a.views.map(oe=>oe.id===q.id?q:oe),$={...a,views:ce};s($),await t.writeConfig(e,$)},[a,e,t]),Ve=(0,_t.useCallback)(async q=>{if(!e)return;let ce=a.views.length===1,$=ce?a.schema.map(D=>({...D,visible:!0})):a.schema,oe=ce?{...a.views[0],hiddenColumns:[...a.views[0].hiddenColumns??[],...a.schema.filter(D=>!D.visible).map(D=>D.id)]}:a.views[0],ve={...Wn,id:crypto.randomUUID(),type:q,name:Nr()[q]??q,filters:[],sorts:[],hiddenColumns:[],columnWidths:{}},S=ce?[oe,ve]:[...a.views,ve],K={schema:$,views:S};s(K),p(ve.id),g(!1),await t.writeConfig(e,K)},[a,e,t]),He=(0,_t.useCallback)(async q=>{if(!e||a.views.length<=1)return;let ce=a.views.filter(oe=>oe.id!==q),$={...a,views:ce};s($),c===q&&p(ce[0].id),await t.writeConfig(e,$)},[a,e,t,c]),Ye=a.views.find(q=>q.id===c)??a.views[0]??Wn,Ze=a.views.length===1&&Ye.type==="table",De=async q=>{if(!e)return;let ce={...a,views:q};s(ce),await t.writeConfig(e,ce)};return(0,rt.jsxs)(_t.Fragment,{children:[(0,rt.jsxs)("div",{className:"nb-view-tabs",children:[a.views.map(q=>(0,rt.jsxs)("button",{className:`nb-view-tab${q.id===c?" nb-view-tab--active":""}${j===q.id&&Y!==q.id?" nb-view-tab--drag-over":""}`,draggable:!0,onDragStart:()=>te(q.id),onDragOver:ce=>{ce.preventDefault(),ie(q.id)},onDragLeave:()=>ie(null),onDrop:()=>{Ee(q.id)},onDragEnd:()=>{te(null),ie(null)},onClick:()=>J!==q.id&&p(q.id),children:[(0,rt.jsx)("span",{className:"nb-view-tab-icon",children:Ru[q.type]??"\u25A1"}),J===q.id?(0,rt.jsx)("input",{ref:Re,className:"nb-view-tab-rename-input",value:Ne,onChange:ce=>de(ce.target.value),onBlur:()=>{me(a.views,Ne,De)},onKeyDown:ce=>{ce.key==="Enter"&&(ce.preventDefault(),me(a.views,Ne,De)),ce.key==="Escape"&&(ce.preventDefault(),ue(null))},onClick:ce=>ce.stopPropagation()}):(0,rt.jsx)("span",{onDoubleClick:ce=>{ce.stopPropagation(),_e(q.id,q.name??Nr()[q.type]??q.type)},title:u("rename_view_hint"),children:q.name??Nr()[q.type]??q.type}),a.views.length>1&&J!==q.id&&(0,rt.jsx)("span",{className:"nb-view-tab-remove",onClick:ce=>{ce.stopPropagation(),He(q.id)},title:u("remove_view"),children:"\xD7"})]},q.id)),(0,rt.jsxs)("div",{className:"nb-view-tab-add",ref:d,children:[(0,rt.jsx)("button",{className:"nb-view-tab-add-btn",onClick:()=>g(q=>!q),title:u("add_view"),children:"+"}),m&&(0,rt.jsxs)("div",{className:"nb-view-add-menu nb-fields-dropdown",children:[(0,rt.jsx)("div",{className:"nb-fields-dropdown-label",children:u("add_view")}),["table","list","board","gallery","calendar","timeline","chart"].map(q=>(0,rt.jsxs)("button",{className:"nb-menu-item",onClick:()=>{Ve(q)},children:[(0,rt.jsx)("span",{className:"nb-menu-item-icon",children:Ru[q]}),(0,rt.jsx)("span",{children:Nr()[q]})]},q))]})]})]}),Ye.type==="table"?(0,rt.jsx)(tm,{dbFile:e,manager:t,externalView:Ze?void 0:Ye,onViewChange:Ze?void 0:Ie},c):Fe(Ye,Ie,c)]})}var pa="notion-bases-view",oi=class extends Wv.ItemView{constructor(n,o){super(n);this.root=null;this.dbFilePath="";this.plugin=o}getViewType(){return pa}getDisplayText(){return this.dbFilePath?this.app.vault.getFileByPath(this.dbFilePath)?.parent?.name??u("view_fallback_name"):u("plugin_display_name")}getIcon(){return"table"}async setState(n,o){n.dbFilePath&&(this.dbFilePath=n.dbFilePath),await super.setState(n,o),this.render()}getState(){return{dbFilePath:this.dbFilePath}}setDatabaseFile(n){this.dbFilePath=n.path,this.render()}getDatabaseFilePath(){return this.dbFilePath}async onOpen(){}async onClose(){this.root?.unmount(),this.root=null}render(){let n=this.containerEl.children[1];if(!n)return;this.root&&(this.root.unmount(),this.root=null),n.empty(),n.addClass("notion-bases-view-container");let o=this.dbFilePath?this.app.vault.getFileByPath(this.dbFilePath)??null:null,r=this.plugin.manager;this.root=(0,Gv.createRoot)(n),this.root.render((0,sm.createElement)(Ql.Provider,{value:this.app},(0,sm.createElement)(Eu,{dbFile:o,manager:r})))}};var Kn=require("obsidian");var wS=/^(`{3,}|~{3,})/,CS=/`[^`]+`/g,kS=/^([A-Za-z0-9\u00C0-\u024F_ -]+)::\s*(.*)$/,qv=/\[([A-Za-z0-9\u00C0-\u024F_ -]+)::\s*([^\]]*)\]/g,Kv=/\(([A-Za-z0-9\u00C0-\u024F_ -]+)::\s*([^)]*)\)/g;function SS(e){let t=e.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);return t?e.slice(t[0].length):e}function Yv(e){let t=e.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);return t?t[0].split(/\r?\n/).length-1:0}function um(e){return e.replace(/[*_~]/g,"").trim().toLowerCase().replace(/\s+/g,"-")}var NS=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2})?)?$/,xS=/^\[\[.+\]\]$/,RS=/^-?\d+(\.\d+)?$/;function cm(e){let t=e.trim();return t===""?null:t==="true"?!0:t==="false"?!1:RS.test(t)?Number(t):(NS.test(t)||xS.test(t),t)}function dm(e){let n=SS(e).split(/\r?\n/),o=[],r=!1,i="";for(let l=0;l<n.length;l++){let a=n[l],s=a.match(wS);if(s){r?a.trim().startsWith(i)&&(r=!1,i=""):(r=!0,i=s[1][0]);continue}if(r)continue;let c=a.replace(CS,""),p=c.match(kS);if(p){let g=p[1].trim(),d=p[2];o.push({key:um(g),rawKey:g,value:cm(d),format:"standalone",rawValue:d,lineNumber:l,fullMatch:`${g}:: ${d}`})}let m;for(qv.lastIndex=0;(m=qv.exec(c))!==null;){let g=m[1].trim(),d=m[2];o.push({key:um(g),rawKey:g,value:cm(d),format:"bracketed",rawValue:d,lineNumber:l,fullMatch:`[${m[1]}:: ${d}]`})}for(Kv.lastIndex=0;(m=Kv.exec(c))!==null;){let g=m[1].trim(),d=m[2];o.push({key:um(g),rawKey:g,value:cm(d),format:"parenthesized",rawValue:d,lineNumber:l,fullMatch:`(${m[1]}:: ${d})`})}}return o}var Fu="notion-bases",Du=class{constructor(t,n){this.app=t;this.databaseFileName=n;this.readInlineFields=!1}isDatabaseFile(t){return this.app.metadataCache.getFileCache(t)?.frontmatter?.[Fu]===!0}getDatabaseFileInFolder(t){let n=(0,Kn.normalizePath)(t?`${t}/${this.databaseFileName}`:this.databaseFileName);return this.app.vault.getFileByPath(n)??null}readConfig(t){let o=this.app.metadataCache.getFileCache(t)?.frontmatter;return!o||!o[Fu]?structuredClone(hr):{schema:(Array.isArray(o.schema)?o.schema:[]).filter(l=>l.id&&typeof l.id=="string"&&!l.id.startsWith("notion-bases")&&l.type&&!l.options?.some(a=>a.value==="[object Object]")),views:Array.isArray(o.views)&&o.views.length>0?o.views:[Wn]}}async writeConfig(t,n){await this.app.fileManager.processFrontMatter(t,o=>{o[Fu]=!0,o.schema=n.schema,o.views=n.views})}getNotesInDatabase(t,n){let o=t.parent??this.app.vault.getRoot();if(!o)return[];if(n){let r=[],i=l=>{for(let a of l.children)a instanceof Kn.TFile&&a.extension==="md"&&a.path!==t.path?r.push(a):a instanceof Kn.TFolder&&i(a)};return i(o),r.sort((l,a)=>l.basename.localeCompare(a.basename))}return o.children.filter(r=>r instanceof Kn.TFile&&r.extension==="md"&&r.path!==t.path).sort((r,i)=>r.basename.localeCompare(i.basename))}getNoteDataSync(t,n){let r=this.app.metadataCache.getFileCache(t)?.frontmatter??{},i={_file:t,_title:t.basename};for(let l of n)l.type==="formula"||l.type==="lookup"||l.type==="rollup"||(i[l.id]=r[l.id]??null);return i}async getNoteData(t,n){let o=this.getNoteDataSync(t,n);if(this.readInlineFields){let r=await this.app.vault.cachedRead(t),i=dm(r),l=Yv(r),a={};for(let s of i){let c=n.find(p=>p.id===s.key);c&&o[c.id]==null&&(c.type==="multiselect"&&typeof s.value=="string"?o[c.id]=s.value.split(",").map(p=>p.trim()).filter(Boolean):o[c.id]=s.value,a[c.id]={format:s.format,rawKey:s.rawKey,rawValue:s.rawValue,lineNumber:l+s.lineNumber,fullMatch:s.fullMatch})}Object.keys(a).length>0&&(o._inlineFields=a)}return o}async updateNoteField(t,n,o,r){let i=r?.[n];i&&this.readInlineFields?o==null||o===""?await this.removeInlineField(t,i):await this.updateInlineField(t,o,i):await this.updateFrontmatterField(t,n,o)}async updateFrontmatterField(t,n,o){await this.app.fileManager.processFrontMatter(t,r=>{o==null||o===""?delete r[n]:r[n]=o})}async updateInlineField(t,n,o){let r=await this.app.vault.read(t),i=r.indexOf(o.fullMatch);if(i===-1){await this.app.fileManager.processFrontMatter(t,c=>{c[o.rawKey]=n});return}let l=this.serializeInlineValue(n),a;switch(o.format){case"standalone":a=`${o.rawKey}:: ${l}`;break;case"bracketed":a=`[${o.rawKey}:: ${l}]`;break;case"parenthesized":a=`(${o.rawKey}:: ${l})`;break}let s=r.slice(0,i)+a+r.slice(i+o.fullMatch.length);await this.app.vault.modify(t,s)}async removeInlineField(t,n){let o=await this.app.vault.read(t),r=o.indexOf(n.fullMatch);if(r===-1)return;let i;if(n.format==="standalone"){let l=o.lastIndexOf(`
`,r-1)+1,a=o.indexOf(`
`,r+n.fullMatch.length);a===-1?a=o.length:a+=1,i=o.slice(0,l)+o.slice(a)}else i=o.slice(0,r)+o.slice(r+n.fullMatch.length);await this.app.vault.modify(t,i)}serializeInlineValue(t){return t==null?"":Array.isArray(t)?t.join(", "):typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):JSON.stringify(t)}async syncTwoWayRelation(t,n,o,r){if(!n.pairedColumnId||!n.refDatabasePath)return;let i=this.app.vault.getFileByPath(n.refDatabasePath);if(!i)return;let l=this.getNotesInDatabase(i),a=t.basename,s=r.filter(p=>!o.includes(p)),c=o.filter(p=>!r.includes(p));for(let p of l){let g=this.app.metadataCache.getFileCache(p)?.frontmatter??{},d=n.refColumnId==="_title"?p.basename:String(g[n.refColumnId]??"");s.includes(d)&&await this.app.fileManager.processFrontMatter(p,v=>{let h=Array.isArray(v[n.pairedColumnId])?v[n.pairedColumnId]:v[n.pairedColumnId]?[String(v[n.pairedColumnId])]:[];h.includes(a)||(v[n.pairedColumnId]=[...h,a])}),c.includes(d)&&await this.app.fileManager.processFrontMatter(p,v=>{let y=(Array.isArray(v[n.pairedColumnId])?v[n.pairedColumnId]:v[n.pairedColumnId]?[String(v[n.pairedColumnId])]:[]).filter(_=>_!==a);y.length>0?v[n.pairedColumnId]=y:delete v[n.pairedColumnId]})}}async renameNote(t,n){if(!n.trim()||n===t.basename)return;let o=(0,Kn.normalizePath)(`${t.parent?.path??""}/${n.trim()}.md`);await this.app.fileManager.renameFile(t,o)}async createNote(t,n){let o=t.parent?.path??"",r=(0,Kn.normalizePath)(`${o}/${u("db_untitled_note")}`),i=`${r}.md`,l=1;for(;this.app.vault.getFileByPath(i);)i=`${r} ${l++}.md`;let a=await this.app.vault.create(i,`---
---
`);return n&&Object.keys(n).length>0&&await this.app.fileManager.processFrontMatter(a,s=>{for(let[c,p]of Object.entries(n))s[c]=p}),a}getAllDatabases(){return this.app.vault.getMarkdownFiles().filter(t=>this.isDatabaseFile(t))}resolveLookupsForRows(t,n){let o=n.filter(i=>i.type==="lookup"&&i.refDatabasePath&&i.refColumnId&&i.refMatchColumnId);if(o.length===0)return t;let r=new Map;for(let i of o){let l=i.refDatabasePath;if(!r.has(l)){let a=this.app.vault.getFileByPath(l);if(!a){r.set(l,[]);continue}let s=this.readConfig(a),p=this.getNotesInDatabase(a).map(m=>this.getNoteDataSync(m,s.schema));r.set(l,p)}}return t.map(i=>{let l={...i};for(let a of o){let s=r.get(a.refDatabasePath)??[],c=a.refMatchColumnId==="_title"?i._title:i[a.refMatchColumnId],p=String(c??"");if(!p){l[a.id]=null;continue}let m=s.find(g=>g._title===p);l[a.id]=m?m[a.refColumnId]??null:null}return l})}resolveRollupsForRows(t,n){let o=n.filter(i=>i.type==="rollup"&&i.rollupRelationColumnId&&i.rollupTargetColumnId&&i.rollupFunction);if(o.length===0)return t;let r=new Map;for(let i of o){let l=n.find(s=>s.id===i.rollupRelationColumnId);if(!l||l.type!=="relation"||!l.refDatabasePath)continue;let a=l.refDatabasePath;if(!r.has(a)){let s=this.app.vault.getFileByPath(a);if(!s){r.set(a,[]);continue}let c=this.readConfig(s),p=this.getNotesInDatabase(s);r.set(a,p.map(m=>this.getNoteDataSync(m,c.schema)))}}return t.map(i=>{let l={...i};for(let a of o){let s=n.find(h=>h.id===a.rollupRelationColumnId);if(!s||!s.refDatabasePath){l[a.id]=null;continue}let c=r.get(s.refDatabasePath)??[],p=i[s.id],m=Array.isArray(p)?p.filter(h=>typeof h=="string"):typeof p=="string"&&p?[p]:[];if(m.length===0){l[a.id]=null;continue}let g=c.filter(h=>m.includes(h._title)),d=a.rollupTargetColumnId,v=g.map(h=>d==="_title"?h._title:h[d]).filter(h=>h!=null);l[a.id]=this.applyRollupFunction(v,a.rollupFunction)}return l})}applyRollupFunction(t,n){if(t.length===0)return null;switch(n){case"count":return t.length;case"count_values":return new Set(t.map(o=>String(o))).size;case"list":return t.map(o=>String(o)).join(", ");case"sum":{let o=t.map(Number).filter(r=>!isNaN(r));return o.length>0?o.reduce((r,i)=>r+i,0):null}case"avg":{let o=t.map(Number).filter(r=>!isNaN(r));return o.length>0?Math.round(o.reduce((r,i)=>r+i,0)/o.length*100)/100:null}case"min":{let o=t.map(Number).filter(r=>!isNaN(r));return o.length>0?Math.min(...o):null}case"max":{let o=t.map(Number).filter(r=>!isNaN(r));return o.length>0?Math.max(...o):null}default:return null}}async deleteNotes(t){for(let n of t)await this.app.fileManager.trashFile(n)}async duplicateNotes(t){for(let n of t){let o=n.parent?.path??"",r=(0,Kn.normalizePath)(`${o}/${n.basename} ${u("db_copy_suffix")}.md`),i=2;for(;this.app.vault.getFileByPath(r);)r=(0,Kn.normalizePath)(`${o}/${n.basename} ${u("db_copy_suffix_n").replace("$n",String(i++))}.md`);let l=await this.app.vault.read(n);await this.app.vault.create(r,l)}}async moveNotes(t,n){for(let o of t){let r=(0,Kn.normalizePath)(`${n}/${o.name}`);await this.app.fileManager.renameFile(o,r)}}async createDatabase(t){let n=(0,Kn.normalizePath)(t?`${t}/${this.databaseFileName}`:this.databaseFileName);if(this.app.vault.getFileByPath(n))throw new Error(u("db_already_exists").replace("$folder",t||"/"));let o=["---",`${Fu}: true`,"schema: []","views:"," - id: default"," type: table"," filters: []"," sorts: []"," hiddenColumns: []"," columnWidths: {}","---","","> [!tip] Notion Bases","> "+u("db_tip_body"),""].join(`
`);return this.app.vault.create(n,o)}async inferSchema(t){let n=new Map;for(let o of t){let i=this.app.metadataCache.getFileCache(o)?.frontmatter;if(i)for(let[l,a]of Object.entries(i))l==="position"||l.startsWith("notion-bases")||(n.has(l)||n.set(l,[]),a!=null&&n.get(l).push(a))}if(this.readInlineFields)for(let o of t){let r=await this.app.vault.cachedRead(o),i=dm(r);for(let l of i)n.has(l.key)||n.set(l.key,[]),l.value!==null&&l.value!==void 0&&n.get(l.key).push(l.value)}return Array.from(n.entries()).map(([o,r])=>{let i=this.inferType(o,r),l=i==="select"||i==="multiselect"||i==="status"?this.extractOptions(r,i):void 0;return{id:o,name:this.toDisplayName(o),type:i,visible:!0,width:i==="title"||i==="text"?200:140,options:l}})}inferType(t,n){if(t==="tags")return"multiselect";if(["date","created","modified","due"].includes(t)||t.endsWith("_date")||t.endsWith("_at")||t.endsWith("At"))return"date";if(["status","priority","type","category","stage"].includes(t))return"select";if(["done","completed","archived","published","pinned"].includes(t))return"checkbox";if(["audio","sound","music","recording"].includes(t)||t.endsWith("_audio")||t.endsWith("_sound"))return"audio";if(["video","clip","movie"].includes(t)||t.endsWith("_video")||t.endsWith("_clip"))return"video";let o=n.filter(i=>i!=null);return o.length===0?"text":o.every(i=>typeof i=="boolean")?"checkbox":o.every(i=>typeof i=="number")?"number":o.every(i=>Array.isArray(i))?"multiselect":new Set(o.map(String)).size<=8?"select":"text"}extractOptions(t,n){let o=new Set;for(let r of t)if(n==="multiselect"&&Array.isArray(r))for(let i of r)o.add(String(i));else r!=null&&o.add(String(r));return Array.from(o).map(r=>({value:r}))}toDisplayName(t){return t.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,n=>n.toUpperCase())}async renameColumn(t,n,o,r){let i=this.uniqueSlug(r,n.schema,o);if(i!==o){let c=this.getNotesInDatabase(t);for(let p of c){let m=this.app.metadataCache.getFileCache(p);m?.frontmatter&&o in m.frontmatter&&await this.app.fileManager.processFrontMatter(p,g=>{g[i]=g[o],delete g[o]})}}let a=n.schema.map(c=>c.id===o?{...c,id:i,name:r}:c),s={...n,schema:a};return await this.writeConfig(t,s),s}slugify(t){return t.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").replace(/_+/g,"_")||"campo"}uniqueSlug(t,n,o){let r=this.slugify(t),i=new Set(n.filter(a=>a.id!==o).map(a=>a.id));if(!i.has(r))return r;let l=2;for(;i.has(`${r}_${l}`);)l++;return`${r}_${l}`}};var Zi=require("obsidian");var Xv={databaseFileName:"_database.md",defaultRowHeight:36,embedViews:{},readInlineFields:!1},Mu=class extends Zi.PluginSettingTab{constructor(t,n){super(t,n),this.plugin=n}display(){let{containerEl:t}=this;t.empty(),new Zi.Setting(t).setName(u("settings_db_filename_name")).setDesc(u("settings_db_filename_desc")).addText(n=>n.setPlaceholder("_database.md").setValue(this.plugin.settings.databaseFileName).onChange(async o=>{this.plugin.settings.databaseFileName=o||"_database.md",await this.plugin.saveSettings()})),new Zi.Setting(t).setName(u("settings_inline_fields_name")).setDesc(u("settings_inline_fields_desc")).addToggle(n=>n.setValue(this.plugin.settings.readInlineFields).onChange(async o=>{this.plugin.settings.readInlineFields=o,this.plugin.manager.readInlineFields=o,await this.plugin.saveSettings()})),new Zi.Setting(t).setName(u("settings_row_height_name")).setDesc(u("settings_row_height_desc")).addSlider(n=>n.setLimits(28,80,4).setValue(this.plugin.settings.defaultRowHeight).setDynamicTooltip().onChange(async o=>{this.plugin.settings.defaultRowHeight=o,await this.plugin.saveSettings()}))}};var Qv=require("obsidian");var ma=class extends Qv.FuzzySuggestModal{constructor(t,n,o){super(t),this.onChoose=o,this.setPlaceholder(u("picker_placeholder")),this.entries=n.map(r=>{let i=!r.parent?.path||r.parent.path==="/";return{file:r,label:i?u("picker_root"):r.parent?.name??"/",sublabel:i?"":r.parent?.path??"/"}})}getItems(){return this.entries}getItemText(t){return`${t.label} ${t.sublabel}`}renderSuggestion(t,n){n.createEl("div",{text:t.item.label,cls:"nb-picker-title"}),n.createEl("small",{text:t.item.sublabel,cls:"nb-picker-path"})}onChooseItem(t){this.onChoose(t.file)}};var ri=require("obsidian");var ES=new Set(["text","number","select","multiselect","status","date","checkbox","url","email","phone"]),Tu=class extends ri.Modal{constructor(n,o,r,i){super(n);this.values={};this.titleValue="";this.manager=o,this.dbFile=r,this.schema=i}onOpen(){let{contentEl:n}=this;n.empty(),n.addClass("nb-quick-add-modal"),n.createEl("h3",{text:u("quick_add_title")});let o=this.dbFile.parent?.name??this.dbFile.path;n.createEl("p",{text:o,cls:"nb-quick-add-db-name"}),new ri.Setting(n).setName(u("quick_add_note_title")).addText(s=>{s.setPlaceholder(u("quick_add_note_title_placeholder")),s.onChange(c=>{this.titleValue=c}),s.inputEl.addClass("nb-quick-add-title-input"),setTimeout(()=>s.inputEl.focus(),50)});let r=this.schema.filter(s=>s.type!=="title"&&s.visible&&ES.has(s.type)&&!s.formula&&!s.isHierarchical);if(r.length===0)n.createEl("p",{text:u("quick_add_no_visible_fields"),cls:"nb-quick-add-empty"});else for(let s of r)this.renderField(n,s);let i=n.createDiv({cls:"nb-quick-add-buttons"});i.createEl("button",{text:u("quick_add_create"),cls:"nb-quick-add-btn"}).addEventListener("click",()=>{this.handleCreate(!1)}),i.createEl("button",{text:u("quick_add_create_and_open"),cls:"nb-quick-add-btn nb-quick-add-btn--primary"}).addEventListener("click",()=>{this.handleCreate(!0)})}onClose(){this.contentEl.empty()}renderField(n,o){let r=new ri.Setting(n).setName(o.name);switch(o.type){case"text":case"url":case"email":case"phone":r.addText(i=>{i.setPlaceholder(o.name),i.onChange(l=>{this.values[o.id]=l||null})});break;case"number":r.addText(i=>{i.setPlaceholder("0"),i.inputEl.type="number",i.onChange(l=>{this.values[o.id]=l?Number(l):null})});break;case"date":r.addText(i=>{i.inputEl.type="date",i.onChange(l=>{this.values[o.id]=l||null})});break;case"checkbox":r.addToggle(i=>{i.onChange(l=>{this.values[o.id]=l})});break;case"select":case"status":r.addDropdown(i=>{i.addOption("","");for(let l of o.options??[])i.addOption(l.value,l.value);i.onChange(l=>{this.values[o.id]=l||null})});break;case"multiselect":r.addText(i=>{let l=(o.options??[]).map(a=>a.value);i.setPlaceholder(l.join(", ")),i.onChange(a=>{this.values[o.id]=a?a.split(",").map(s=>s.trim()).filter(Boolean):null})});break}}async handleCreate(n){let o={};for(let[r,i]of Object.entries(this.values))i!=null&&i!==""&&!(Array.isArray(i)&&i.length===0)&&(o[r]=i);try{let r=await this.manager.createNote(this.dbFile,o);if(this.titleValue.trim()){let i=r.parent?.path??"",l=i?`${i}/${this.titleValue.trim()}.md`:`${this.titleValue.trim()}.md`;await this.app.fileManager.renameFile(r,l)}if(this.close(),n){let i=this.titleValue.trim()?this.app.vault.getFileByPath((r.parent?.path?`${r.parent.path}/`:"")+`${this.titleValue.trim()}.md`)??r:r;await this.app.workspace.getLeaf("tab").openFile(i)}}catch(r){new ri.Notice(String(r))}}};var Zv=require("obsidian"),pm=ze(yt(),1),Jv=ze(fp(),1);var ii="notion-bases-embeds",mm=class extends Zv.MarkdownRenderChild{constructor(n,o,r,i,l,a){super(n);this.plugin=o;this.folderPath=r;this.embedId=i;this.sourcePath=l;this.forcedType=a;this.root=null}onload(){let n=this.plugin.manager,o=n.getDatabaseFileInFolder(this.folderPath);if(!o){this.containerEl.createEl("div",{text:`Database not found: "${this.folderPath||"/"}"`,cls:"nb-embed-error"});return}let r=this.plugin.app.vault.getFileByPath(this.sourcePath),l=(r?this.plugin.app.metadataCache.getFileCache(r)?.frontmatter:void 0)?.[ii]?.[this.embedId],a;if(this.forcedType){let s=l&&typeof l=="object"&&!("activeViewId"in l)?l:void 0,p=this.plugin.app.metadataCache.getFileCache(o)?.frontmatter?.views?.[0],m;s?m={...s,id:this.embedId,type:this.forcedType}:m=p?{...p,id:this.embedId,type:this.forcedType}:{...Wn,id:this.embedId,type:this.forcedType},a={dbFile:o,manager:n,externalView:m,onViewChange:async d=>{let v=this.plugin.app.vault.getFileByPath(this.sourcePath);v&&await this.plugin.app.fileManager.processFrontMatter(v,h=>{h[ii]||(h[ii]={}),h[ii][this.embedId]=d})}}}else{let s=l&&typeof l=="object"&&"activeViewId"in l&&Array.isArray(l.views)?l:void 0;a={dbFile:o,manager:n,embedState:s,onEmbedStateChange:async p=>{let m=this.plugin.app.vault.getFileByPath(this.sourcePath);m&&await this.plugin.app.fileManager.processFrontMatter(m,g=>{g[ii]||(g[ii]={}),g[ii][this.embedId]=p})}}}this.root=(0,Jv.createRoot)(this.containerEl),this.root.render((0,pm.createElement)(Ql.Provider,{value:this.plugin.app},(0,pm.createElement)(Eu,a)))}onunload(){this.root?.unmount(),this.root=null}};function eb(e){e.registerMarkdownCodeBlockProcessor("nb-database",(t,n,o)=>{let r=t.trim().split(`
`),i="",l="",a;for(let s of r){let c=s.match(/^path:\s*(.+)$/);c&&(i=c[1].trim());let p=s.match(/^id:\s*(.+)$/);p&&(l=p[1].trim());let m=s.match(/^type:\s*(.+)$/);if(m){let g=m[1].trim();(g==="table"||g==="list")&&(a=g)}}if(!l){l="nb"+Math.random().toString(36).slice(2,10);let s=e.app.vault.getFileByPath(o.sourcePath);s&&e.app.vault.process(s,c=>{let p="```nb-database\n"+t.trimEnd(),m=c.indexOf(p);if(m===-1)return c;let g=m+15;return c.slice(0,g)+`id: ${l}
`+c.slice(g)}).catch(console.error)}n.addClass("nb-embed-container"),o.addChild(new mm(n,e,i,l,o.sourcePath,a))})}var Lu=class extends Ji.Plugin{constructor(){super(...arguments);this._redirecting=!1}async onload(){await this.loadSettings(),this.manager=new Du(this.app,this.settings.databaseFileName),this.manager.readInlineFields=this.settings.readInlineFields,this.registerView(pa,n=>new oi(n,this)),this.addRibbonIcon("table","Notion bases",()=>{this.openDatabasePicker()}),this.addCommand({id:"open-database",name:u("cmd_open_database"),callback:async()=>{await this.openOrCreateDatabase()}}),this.addCommand({id:"create-database",name:u("cmd_create_database"),callback:async()=>{let o=this.app.workspace.getActiveFile()?.parent?.path??"";await this.createAndOpenDatabase(o)}}),this.addCommand({id:"quick-add",name:u("cmd_quick_add"),callback:()=>{this.openQuickAdd()}}),this.registerEvent(this.app.workspace.on("active-leaf-change",async n=>{if(!n||this._redirecting||n.view.getViewType()!=="markdown")return;let o=n.view.file??void 0;if(!o||!this.manager.isDatabaseFile(o))return;let r=this.findDatabaseLeaf(o.path);if(r&&r!==n){this.app.workspace.revealLeaf(r),n.detach();return}if(!r){this._redirecting=!0;try{await this.openDatabaseInLeaf(n,o)}finally{this._redirecting=!1}}})),eb(this),this.addSettingTab(new Mu(this.app,this))}onunload(){}async loadSettings(){this.settings=Object.assign({},Xv,await this.loadData())}async saveSettings(){await this.saveData(this.settings)}openQuickAdd(){let n=this.manager.getAllDatabases().sort((o,r)=>(o.parent?.path??"").localeCompare(r.parent?.path??""));if(n.length===0){new Ji.Notice(u("no_databases_found"));return}new ma(this.app,n,o=>{let r=this.manager.readConfig(o);new Tu(this.app,this.manager,o,r.schema).open()}).open()}openDatabasePicker(){let n=this.manager.getAllDatabases().sort((o,r)=>(o.parent?.path??"").localeCompare(r.parent?.path??""));if(n.length===0){new Ji.Notice(u("no_databases_found"));return}new ma(this.app,n,o=>{let r=this.findDatabaseLeaf(o.path);if(r){this.app.workspace.revealLeaf(r);return}let i=this.app.workspace.getLeaf("tab");this.openDatabaseInLeaf(i,o)}).open()}async openOrCreateDatabase(){let n=this.app.workspace.getActiveFile(),o=n?.parent?.path??"";if(!n){let i=this.app.workspace.getActiveViewOfType(oi)?.leaf??null;if(i?.view instanceof oi){let l=i.view.getDatabaseFilePath();o=this.app.vault.getFileByPath(l)?.parent?.path??""}}let r=this.manager.getDatabaseFileInFolder(o);if(r){let i=this.findDatabaseLeaf(r.path);if(i){this.app.workspace.revealLeaf(i);return}let l=this.app.workspace.getLeaf("tab");await this.openDatabaseInLeaf(l,r)}else await this.createAndOpenDatabase(o)}async createAndOpenDatabase(n){try{let o=await this.manager.createDatabase(n),r=this.app.workspace.getLeaf("tab");await this.openDatabaseInLeaf(r,o)}catch(o){new Ji.Notice(String(o))}}async openDatabaseInLeaf(n,o){await n.setViewState({type:pa,state:{dbFilePath:o.path},active:!0}),this.app.workspace.revealLeaf(n);let r=n.view;r instanceof oi&&r.getDatabaseFilePath()!==o.path&&r.setDatabaseFile(o)}findDatabaseLeaf(n){let o=null;return this.app.workspace.iterateAllLeaves(r=>{if(o||r.view.getViewType()!==pa)return;r.view.getState().dbFilePath===n&&(o=r)}),o}};
/*! Bundled license information:
react/cjs/react.production.min.js:
(**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
scheduler/cjs/scheduler.production.min.js:
(**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
react-dom/cjs/react-dom.production.min.js:
(**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
react/cjs/react-jsx-runtime.production.min.js:
(**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
@tanstack/table-core/build/lib/index.mjs:
(**
* table-core
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*)
@tanstack/react-table/build/lib/index.mjs:
(**
* react-table
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*)
*/