diff --git a/.env.example b/.env.example index df092b3..e3e8f2f 100644 --- a/.env.example +++ b/.env.example @@ -11,8 +11,11 @@ JWT_SECRET=dev-secret-change-me SERVER_PORT=8080 ENV=development -# Base URL (used for public iCal feed URLs; defaults to http://localhost:$SERVER_PORT) -# BASE_URL=https://api.example.com +# Base URL for iCal feed URLs and availability URLs. +# Defaults to http://localhost:$SERVER_PORT if unset. +# Set to your public API URL for Google Calendar and external subscriptions. +# Example: BASE_URL=https://api.example.com +BASE_URL=http://localhost:8080 # CORS (comma-separated origins; defaults to localhost:5173 for dev) # CORS_ORIGINS=https://app.example.com,https://www.example.com diff --git a/cmd/server/main.go b/cmd/server/main.go index d1c9509..9f2cc29 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -25,6 +25,7 @@ import ( func main() { cfg := config.Load() + log.Printf("BASE_URL=%s", cfg.BaseURL) ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() @@ -86,19 +87,36 @@ func main() { reminderSvc := service.NewReminderService(queries, calSvc, sched) attendeeSvc := service.NewAttendeeService(queries, calSvc) + taskWebhookSvc := service.NewTaskWebhookService(queries) + taskSvc := service.NewTaskService(queries, auditSvc, taskWebhookSvc) + projectSvc := service.NewProjectService(queries, auditSvc) + tagSvc := service.NewTagService(queries) + taskDepSvc := service.NewTaskDependencyService(queries) + var taskReminderScheduler service.TaskReminderScheduler = scheduler.NoopScheduler{} + if realSched, ok := sched.(*scheduler.Scheduler); ok { + taskReminderScheduler = realSched + } + taskReminderSvc := service.NewTaskReminderService(queries, taskReminderScheduler) + h := api.Handlers{ - Auth: handlers.NewAuthHandler(authSvc, userSvc), - User: handlers.NewUserHandler(userSvc), - Calendar: handlers.NewCalendarHandler(calSvc), - Sharing: handlers.NewSharingHandler(calSvc), - Event: handlers.NewEventHandler(eventSvc), - Reminder: handlers.NewReminderHandler(reminderSvc), - Attendee: handlers.NewAttendeeHandler(attendeeSvc), - Contact: handlers.NewContactHandler(contactSvc), - Availability: handlers.NewAvailabilityHandler(availSvc), - Booking: handlers.NewBookingHandler(bookingSvc), - APIKey: handlers.NewAPIKeyHandler(apiKeySvc), - ICS: handlers.NewICSHandler(calSvc, eventSvc, queries), + Auth: handlers.NewAuthHandler(authSvc, userSvc), + User: handlers.NewUserHandler(userSvc), + Calendar: handlers.NewCalendarHandler(calSvc), + Sharing: handlers.NewSharingHandler(calSvc), + Event: handlers.NewEventHandler(eventSvc), + Reminder: handlers.NewReminderHandler(reminderSvc), + Attendee: handlers.NewAttendeeHandler(attendeeSvc), + Contact: handlers.NewContactHandler(contactSvc), + Availability: handlers.NewAvailabilityHandler(availSvc), + Booking: handlers.NewBookingHandler(bookingSvc), + APIKey: handlers.NewAPIKeyHandler(apiKeySvc), + ICS: handlers.NewICSHandler(calSvc, eventSvc, queries), + Task: handlers.NewTaskHandler(taskSvc), + Project: handlers.NewProjectHandler(projectSvc), + Tag: handlers.NewTagHandler(tagSvc), + TaskDependency: handlers.NewTaskDependencyHandler(taskDepSvc), + TaskReminder: handlers.NewTaskReminderHandler(taskReminderSvc), + TaskWebhook: handlers.NewTaskWebhookHandler(taskWebhookSvc), } authMW := middleware.NewAuthMiddleware(jwtManager, queries) diff --git a/frontend/dist/assets/index-C8iK5eUL.css b/frontend/dist/assets/index-C8iK5eUL.css new file mode 100644 index 0000000..3fff362 --- /dev/null +++ b/frontend/dist/assets/index-C8iK5eUL.css @@ -0,0 +1 @@ +/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-900:oklch(41.4% .112 45.904);--color-green-50:oklch(98.2% .018 155.826);--color-green-400:oklch(79.2% .209 151.711);--color-green-700:oklch(52.7% .154 150.069);--color-green-900:oklch(39.3% .095 152.535);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-900:oklch(37.9% .146 265.522);--color-purple-600:oklch(55.8% .288 302.321);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-xl:36rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-1\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.right-0{right:calc(var(--spacing) * 0)}.right-1{right:calc(var(--spacing) * 1)}.right-4{right:calc(var(--spacing) * 4)}.left-0\.5{left:calc(var(--spacing) * .5)}.left-1{left:calc(var(--spacing) * 1)}.left-3{left:calc(var(--spacing) * 3)}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.-mt-2{margin-top:calc(var(--spacing) * -2)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-40{height:calc(var(--spacing) * 40)}.h-64{height:calc(var(--spacing) * 64)}.h-full{height:100%}.h-screen{height:100vh}.max-h-\[90vh\]{max-height:90vh}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-\[80px\]{min-height:80px}.min-h-\[200px\]{min-height:200px}.min-h-screen{min-height:100vh}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-28{width:calc(var(--spacing) * 28)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[180px\]{min-width:180px}.min-w-\[200px\]{min-width:200px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-110{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.animate-spin{animation:var(--animate-spin)}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.auto-rows-fr{grid-auto-rows:minmax(0,1fr)}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-gray-100>:not(:last-child)){border-color:var(--color-gray-100)}:where(.divide-gray-200>:not(:last-child)){border-color:var(--color-gray-200)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-blue-400{border-color:var(--color-blue-400)}.border-blue-600{border-color:var(--color-blue-600)}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-gray-400{border-color:var(--color-gray-400)}.border-red-200{border-color:var(--color-red-200)}.border-t-transparent{border-top-color:#0000}.bg-amber-100{background-color:var(--color-amber-100)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-blue-50\/50{background-color:#eff6ff80}@supports (color:color-mix(in lab,red,red)){.bg-blue-50\/50{background-color:color-mix(in oklab,var(--color-blue-50) 50%,transparent)}}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-50\/50{background-color:#f9fafb80}@supports (color:color-mix(in lab,red,red)){.bg-gray-50\/50{background-color:color-mix(in oklab,var(--color-gray-50) 50%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-green-50{background-color:var(--color-green-50)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-600{background-color:var(--color-red-600)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from:var(--color-blue-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-600{--tw-gradient-to:var(--color-purple-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-0{padding-inline:calc(var(--spacing) * 0)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-10{padding-left:calc(var(--spacing) * 10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.text-amber-600{color:var(--color-amber-600)}.text-amber-700{color:var(--color-amber-700)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-700{color:var(--color-green-700)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.text-white\!{color:var(--color-white)!important}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.placeholder-gray-400::placeholder{color:var(--color-gray-400)}.opacity-0{opacity:0}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-blue-600\/20{--tw-shadow-color:#155dfc33}@supports (color:color-mix(in lab,red,red)){.shadow-blue-600\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-blue-600) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-gray-200\/50{--tw-shadow-color:#e5e7eb80}@supports (color:color-mix(in lab,red,red)){.shadow-gray-200\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-gray-200) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-white{--tw-ring-offset-color:var(--color-white)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:text-gray-600:is(:where(.group):hover *){color:var(--color-gray-600)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-gray-400::placeholder{color:var(--color-gray-400)}@media(hover:hover){.hover\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:bg-blue-50:hover{background-color:var(--color-blue-50)}.hover\:bg-blue-50\/50:hover{background-color:#eff6ff80}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-50\/50:hover{background-color:color-mix(in oklab,var(--color-blue-50) 50%,transparent)}}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\:bg-gray-300:hover{background-color:var(--color-gray-300)}.hover\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\:bg-red-600:hover{background-color:var(--color-red-600)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.hover\:text-gray-600:hover{color:var(--color-gray-600)}.hover\:text-gray-700:hover{color:var(--color-gray-700)}.hover\:text-gray-900:hover{color:var(--color-gray-900)}.hover\:text-red-700:hover{color:var(--color-red-700)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-blue-600\/30:hover{--tw-shadow-color:#155dfc4d}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-blue-600\/30:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-blue-600) 30%, transparent) var(--tw-shadow-alpha), transparent)}}}.focus\:border-blue-500:focus{border-color:var(--color-blue-500)}.focus\:border-transparent:focus{border-color:#0000}.focus\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-blue-500:focus{--tw-ring-color:var(--color-blue-500)}.focus\:ring-red-500:focus{--tw-ring-color:var(--color-red-500)}.active\:cursor-grabbing:active{cursor:grabbing}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:block{display:block}.sm\:flex{display:flex}.sm\:hidden{display:none}}@media(min-width:64rem){.lg\:block{display:block}.lg\:hidden{display:none}}:where(.dark\:divide-gray-700:where(.dark,.dark *)>:not(:last-child)){border-color:var(--color-gray-700)}:where(.dark\:divide-gray-700\/50:where(.dark,.dark *)>:not(:last-child)){border-color:#36415380}@supports (color:color-mix(in lab,red,red)){:where(.dark\:divide-gray-700\/50:where(.dark,.dark *)>:not(:last-child)){border-color:color-mix(in oklab,var(--color-gray-700) 50%,transparent)}}.dark\:border-blue-500:where(.dark,.dark *){border-color:var(--color-blue-500)}.dark\:border-gray-600:where(.dark,.dark *){border-color:var(--color-gray-600)}.dark\:border-gray-700:where(.dark,.dark *){border-color:var(--color-gray-700)}.dark\:border-gray-700\/30:where(.dark,.dark *){border-color:#3641534d}@supports (color:color-mix(in lab,red,red)){.dark\:border-gray-700\/30:where(.dark,.dark *){border-color:color-mix(in oklab,var(--color-gray-700) 30%,transparent)}}.dark\:border-gray-700\/50:where(.dark,.dark *){border-color:#36415380}@supports (color:color-mix(in lab,red,red)){.dark\:border-gray-700\/50:where(.dark,.dark *){border-color:color-mix(in oklab,var(--color-gray-700) 50%,transparent)}}.dark\:border-gray-800:where(.dark,.dark *){border-color:var(--color-gray-800)}.dark\:border-red-800:where(.dark,.dark *){border-color:var(--color-red-800)}.dark\:bg-amber-900\/40:where(.dark,.dark *){background-color:#7b330666}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-900\/40:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-amber-900) 40%,transparent)}}.dark\:bg-black\/60:where(.dark,.dark *){background-color:#0009}@supports (color:color-mix(in lab,red,red)){.dark\:bg-black\/60:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.dark\:bg-blue-900\/20:where(.dark,.dark *){background-color:#1c398e33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-blue-900\/20:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-blue-900) 20%,transparent)}}.dark\:bg-blue-900\/30:where(.dark,.dark *){background-color:#1c398e4d}@supports (color:color-mix(in lab,red,red)){.dark\:bg-blue-900\/30:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-blue-900) 30%,transparent)}}.dark\:bg-blue-900\/40:where(.dark,.dark *){background-color:#1c398e66}@supports (color:color-mix(in lab,red,red)){.dark\:bg-blue-900\/40:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-blue-900) 40%,transparent)}}.dark\:bg-gray-600:where(.dark,.dark *){background-color:var(--color-gray-600)}.dark\:bg-gray-700:where(.dark,.dark *){background-color:var(--color-gray-700)}.dark\:bg-gray-700\/50:where(.dark,.dark *){background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.dark\:bg-gray-700\/50:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-gray-700) 50%,transparent)}}.dark\:bg-gray-800:where(.dark,.dark *){background-color:var(--color-gray-800)}.dark\:bg-gray-800\/50:where(.dark,.dark *){background-color:#1e293980}@supports (color:color-mix(in lab,red,red)){.dark\:bg-gray-800\/50:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-gray-800) 50%,transparent)}}.dark\:bg-gray-900:where(.dark,.dark *){background-color:var(--color-gray-900)}.dark\:bg-gray-900\/30:where(.dark,.dark *){background-color:#1018284d}@supports (color:color-mix(in lab,red,red)){.dark\:bg-gray-900\/30:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-gray-900) 30%,transparent)}}.dark\:bg-green-900\/20:where(.dark,.dark *){background-color:#0d542b33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-green-900\/20:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-green-900) 20%,transparent)}}.dark\:bg-red-900\/20:where(.dark,.dark *){background-color:#82181a33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-red-900\/20:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-red-900) 20%,transparent)}}.dark\:bg-red-900\/30:where(.dark,.dark *){background-color:#82181a4d}@supports (color:color-mix(in lab,red,red)){.dark\:bg-red-900\/30:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-red-900) 30%,transparent)}}.dark\:bg-red-900\/40:where(.dark,.dark *){background-color:#82181a66}@supports (color:color-mix(in lab,red,red)){.dark\:bg-red-900\/40:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-red-900) 40%,transparent)}}.dark\:text-amber-300:where(.dark,.dark *){color:var(--color-amber-300)}.dark\:text-amber-400:where(.dark,.dark *){color:var(--color-amber-400)}.dark\:text-blue-300:where(.dark,.dark *){color:var(--color-blue-300)}.dark\:text-blue-400:where(.dark,.dark *){color:var(--color-blue-400)}.dark\:text-gray-100:where(.dark,.dark *){color:var(--color-gray-100)}.dark\:text-gray-200:where(.dark,.dark *){color:var(--color-gray-200)}.dark\:text-gray-300:where(.dark,.dark *){color:var(--color-gray-300)}.dark\:text-gray-400:where(.dark,.dark *){color:var(--color-gray-400)}.dark\:text-gray-500:where(.dark,.dark *){color:var(--color-gray-500)}.dark\:text-gray-600:where(.dark,.dark *){color:var(--color-gray-600)}.dark\:text-green-400:where(.dark,.dark *){color:var(--color-green-400)}.dark\:text-red-300:where(.dark,.dark *){color:var(--color-red-300)}.dark\:text-red-400:where(.dark,.dark *){color:var(--color-red-400)}.dark\:text-white:where(.dark,.dark *){color:var(--color-white)}.dark\:shadow-black\/20:where(.dark,.dark *){--tw-shadow-color:#0003}@supports (color:color-mix(in lab,red,red)){.dark\:shadow-black\/20:where(.dark,.dark *){--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.dark\:ring-offset-gray-800:where(.dark,.dark *){--tw-ring-offset-color:var(--color-gray-800)}@media(hover:hover){.dark\:group-hover\:text-gray-400:where(.dark,.dark *):is(:where(.group):hover *){color:var(--color-gray-400)}.dark\:hover\:bg-blue-900\/10:where(.dark,.dark *):hover{background-color:#1c398e1a}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-blue-900\/10:where(.dark,.dark *):hover{background-color:color-mix(in oklab,var(--color-blue-900) 10%,transparent)}}.dark\:hover\:bg-blue-900\/20:where(.dark,.dark *):hover{background-color:#1c398e33}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-blue-900\/20:where(.dark,.dark *):hover{background-color:color-mix(in oklab,var(--color-blue-900) 20%,transparent)}}.dark\:hover\:bg-gray-500:where(.dark,.dark *):hover{background-color:var(--color-gray-500)}.dark\:hover\:bg-gray-700:where(.dark,.dark *):hover{background-color:var(--color-gray-700)}.dark\:hover\:bg-gray-700\/50:where(.dark,.dark *):hover{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-gray-700\/50:where(.dark,.dark *):hover{background-color:color-mix(in oklab,var(--color-gray-700) 50%,transparent)}}.dark\:hover\:bg-gray-800:where(.dark,.dark *):hover{background-color:var(--color-gray-800)}.dark\:hover\:bg-gray-800\/50:where(.dark,.dark *):hover{background-color:#1e293980}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-gray-800\/50:where(.dark,.dark *):hover{background-color:color-mix(in oklab,var(--color-gray-800) 50%,transparent)}}.dark\:hover\:bg-red-900\/20:where(.dark,.dark *):hover{background-color:#82181a33}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-red-900\/20:where(.dark,.dark *):hover{background-color:color-mix(in oklab,var(--color-red-900) 20%,transparent)}}.dark\:hover\:text-gray-300:where(.dark,.dark *):hover{color:var(--color-gray-300)}.dark\:hover\:text-red-400:where(.dark,.dark *):hover{color:var(--color-red-400)}.dark\:hover\:text-white:where(.dark,.dark *):hover{color:var(--color-white)}}.dark\:focus\:border-blue-400:where(.dark,.dark *):focus{border-color:var(--color-blue-400)}}html,body,#root{height:100%}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes slide-up{0%{opacity:0;transform:translateY(12px)scale(.98)}to{opacity:1;transform:translateY(0)scale(1)}}@keyframes scale-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.animate-fade-in{animation:.15s ease-out fade-in}.animate-slide-up{animation:.2s ease-out slide-up}.animate-scale-in{animation:.15s ease-out scale-in}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}.dark ::-webkit-scrollbar-thumb{background:#4b5563}input[type=time]::-webkit-calendar-picker-indicator{filter:var(--tw-brightness, )}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}} diff --git a/frontend/dist/assets/index-D1jwjSlk.css b/frontend/dist/assets/index-D1jwjSlk.css deleted file mode 100644 index 75b477b..0000000 --- a/frontend/dist/assets/index-D1jwjSlk.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-900:oklch(39.6% .141 25.723);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-600:oklch(66.6% .179 58.318);--color-green-50:oklch(98.2% .018 155.826);--color-green-400:oklch(79.2% .209 151.711);--color-green-700:oklch(52.7% .154 150.069);--color-green-900:oklch(39.3% .095 152.535);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-900:oklch(37.9% .146 265.522);--color-purple-600:oklch(55.8% .288 302.321);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-xl:36rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-1\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.right-0{right:calc(var(--spacing) * 0)}.right-1{right:calc(var(--spacing) * 1)}.right-4{right:calc(var(--spacing) * 4)}.left-0\.5{left:calc(var(--spacing) * .5)}.left-1{left:calc(var(--spacing) * 1)}.left-3{left:calc(var(--spacing) * 3)}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.-mt-2{margin-top:calc(var(--spacing) * -2)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-40{height:calc(var(--spacing) * 40)}.h-full{height:100%}.h-screen{height:100vh}.max-h-\[90vh\]{max-height:90vh}.min-h-\[80px\]{min-height:80px}.min-h-screen{min-height:100vh}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-28{width:calc(var(--spacing) * 28)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[180px\]{min-width:180px}.min-w-\[200px\]{min-width:200px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-110{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.auto-rows-fr{grid-auto-rows:minmax(0,1fr)}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-gray-100>:not(:last-child)){border-color:var(--color-gray-100)}:where(.divide-gray-200>:not(:last-child)){border-color:var(--color-gray-200)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-blue-600{border-color:var(--color-blue-600)}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-gray-400{border-color:var(--color-gray-400)}.border-t-transparent{border-top-color:#0000}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-50\/50{background-color:#f9fafb80}@supports (color:color-mix(in lab,red,red)){.bg-gray-50\/50{background-color:color-mix(in oklab,var(--color-gray-50) 50%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-green-50{background-color:var(--color-green-50)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-600{background-color:var(--color-red-600)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from:var(--color-blue-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-600{--tw-gradient-to:var(--color-purple-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-0{padding-inline:calc(var(--spacing) * 0)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-10{padding-left:calc(var(--spacing) * 10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.text-amber-600{color:var(--color-amber-600)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-700{color:var(--color-green-700)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-white{color:var(--color-white)}.text-white\!{color:var(--color-white)!important}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.placeholder-gray-400::placeholder{color:var(--color-gray-400)}.opacity-0{opacity:0}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-blue-600\/20{--tw-shadow-color:#155dfc33}@supports (color:color-mix(in lab,red,red)){.shadow-blue-600\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-blue-600) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-gray-200\/50{--tw-shadow-color:#e5e7eb80}@supports (color:color-mix(in lab,red,red)){.shadow-gray-200\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-gray-200) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-white{--tw-ring-offset-color:var(--color-white)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-gray-400::placeholder{color:var(--color-gray-400)}@media(hover:hover){.hover\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:bg-blue-50:hover{background-color:var(--color-blue-50)}.hover\:bg-blue-50\/50:hover{background-color:#eff6ff80}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-50\/50:hover{background-color:color-mix(in oklab,var(--color-blue-50) 50%,transparent)}}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\:bg-gray-300:hover{background-color:var(--color-gray-300)}.hover\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\:bg-red-600:hover{background-color:var(--color-red-600)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.hover\:text-gray-600:hover{color:var(--color-gray-600)}.hover\:text-gray-700:hover{color:var(--color-gray-700)}.hover\:text-gray-900:hover{color:var(--color-gray-900)}.hover\:text-red-700:hover{color:var(--color-red-700)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-blue-600\/30:hover{--tw-shadow-color:#155dfc4d}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-blue-600\/30:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-blue-600) 30%, transparent) var(--tw-shadow-alpha), transparent)}}}.focus\:border-blue-500:focus{border-color:var(--color-blue-500)}.focus\:border-transparent:focus{border-color:#0000}.focus\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-blue-500:focus{--tw-ring-color:var(--color-blue-500)}.focus\:ring-red-500:focus{--tw-ring-color:var(--color-red-500)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:block{display:block}.sm\:flex{display:flex}.sm\:hidden{display:none}}@media(min-width:64rem){.lg\:block{display:block}.lg\:hidden{display:none}}:where(.dark\:divide-gray-700:where(.dark,.dark *)>:not(:last-child)){border-color:var(--color-gray-700)}:where(.dark\:divide-gray-700\/50:where(.dark,.dark *)>:not(:last-child)){border-color:#36415380}@supports (color:color-mix(in lab,red,red)){:where(.dark\:divide-gray-700\/50:where(.dark,.dark *)>:not(:last-child)){border-color:color-mix(in oklab,var(--color-gray-700) 50%,transparent)}}.dark\:border-gray-600:where(.dark,.dark *){border-color:var(--color-gray-600)}.dark\:border-gray-700:where(.dark,.dark *){border-color:var(--color-gray-700)}.dark\:border-gray-700\/30:where(.dark,.dark *){border-color:#3641534d}@supports (color:color-mix(in lab,red,red)){.dark\:border-gray-700\/30:where(.dark,.dark *){border-color:color-mix(in oklab,var(--color-gray-700) 30%,transparent)}}.dark\:border-gray-700\/50:where(.dark,.dark *){border-color:#36415380}@supports (color:color-mix(in lab,red,red)){.dark\:border-gray-700\/50:where(.dark,.dark *){border-color:color-mix(in oklab,var(--color-gray-700) 50%,transparent)}}.dark\:border-gray-800:where(.dark,.dark *){border-color:var(--color-gray-800)}.dark\:bg-black\/60:where(.dark,.dark *){background-color:#0009}@supports (color:color-mix(in lab,red,red)){.dark\:bg-black\/60:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.dark\:bg-blue-900\/30:where(.dark,.dark *){background-color:#1c398e4d}@supports (color:color-mix(in lab,red,red)){.dark\:bg-blue-900\/30:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-blue-900) 30%,transparent)}}.dark\:bg-blue-900\/40:where(.dark,.dark *){background-color:#1c398e66}@supports (color:color-mix(in lab,red,red)){.dark\:bg-blue-900\/40:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-blue-900) 40%,transparent)}}.dark\:bg-gray-600:where(.dark,.dark *){background-color:var(--color-gray-600)}.dark\:bg-gray-700:where(.dark,.dark *){background-color:var(--color-gray-700)}.dark\:bg-gray-700\/50:where(.dark,.dark *){background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.dark\:bg-gray-700\/50:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-gray-700) 50%,transparent)}}.dark\:bg-gray-800:where(.dark,.dark *){background-color:var(--color-gray-800)}.dark\:bg-gray-800\/50:where(.dark,.dark *){background-color:#1e293980}@supports (color:color-mix(in lab,red,red)){.dark\:bg-gray-800\/50:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-gray-800) 50%,transparent)}}.dark\:bg-gray-900:where(.dark,.dark *){background-color:var(--color-gray-900)}.dark\:bg-gray-900\/30:where(.dark,.dark *){background-color:#1018284d}@supports (color:color-mix(in lab,red,red)){.dark\:bg-gray-900\/30:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-gray-900) 30%,transparent)}}.dark\:bg-green-900\/20:where(.dark,.dark *){background-color:#0d542b33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-green-900\/20:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-green-900) 20%,transparent)}}.dark\:bg-red-900\/20:where(.dark,.dark *){background-color:#82181a33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-red-900\/20:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-red-900) 20%,transparent)}}.dark\:bg-red-900\/30:where(.dark,.dark *){background-color:#82181a4d}@supports (color:color-mix(in lab,red,red)){.dark\:bg-red-900\/30:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-red-900) 30%,transparent)}}.dark\:text-amber-400:where(.dark,.dark *){color:var(--color-amber-400)}.dark\:text-blue-400:where(.dark,.dark *){color:var(--color-blue-400)}.dark\:text-gray-200:where(.dark,.dark *){color:var(--color-gray-200)}.dark\:text-gray-300:where(.dark,.dark *){color:var(--color-gray-300)}.dark\:text-gray-400:where(.dark,.dark *){color:var(--color-gray-400)}.dark\:text-gray-500:where(.dark,.dark *){color:var(--color-gray-500)}.dark\:text-gray-600:where(.dark,.dark *){color:var(--color-gray-600)}.dark\:text-green-400:where(.dark,.dark *){color:var(--color-green-400)}.dark\:text-red-400:where(.dark,.dark *){color:var(--color-red-400)}.dark\:text-white:where(.dark,.dark *){color:var(--color-white)}.dark\:shadow-black\/20:where(.dark,.dark *){--tw-shadow-color:#0003}@supports (color:color-mix(in lab,red,red)){.dark\:shadow-black\/20:where(.dark,.dark *){--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.dark\:ring-offset-gray-800:where(.dark,.dark *){--tw-ring-offset-color:var(--color-gray-800)}@media(hover:hover){.dark\:hover\:bg-blue-900\/10:where(.dark,.dark *):hover{background-color:#1c398e1a}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-blue-900\/10:where(.dark,.dark *):hover{background-color:color-mix(in oklab,var(--color-blue-900) 10%,transparent)}}.dark\:hover\:bg-blue-900\/20:where(.dark,.dark *):hover{background-color:#1c398e33}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-blue-900\/20:where(.dark,.dark *):hover{background-color:color-mix(in oklab,var(--color-blue-900) 20%,transparent)}}.dark\:hover\:bg-gray-500:where(.dark,.dark *):hover{background-color:var(--color-gray-500)}.dark\:hover\:bg-gray-700:where(.dark,.dark *):hover{background-color:var(--color-gray-700)}.dark\:hover\:bg-gray-700\/50:where(.dark,.dark *):hover{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-gray-700\/50:where(.dark,.dark *):hover{background-color:color-mix(in oklab,var(--color-gray-700) 50%,transparent)}}.dark\:hover\:bg-gray-800:where(.dark,.dark *):hover{background-color:var(--color-gray-800)}.dark\:hover\:bg-gray-800\/50:where(.dark,.dark *):hover{background-color:#1e293980}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-gray-800\/50:where(.dark,.dark *):hover{background-color:color-mix(in oklab,var(--color-gray-800) 50%,transparent)}}.dark\:hover\:bg-red-900\/20:where(.dark,.dark *):hover{background-color:#82181a33}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-red-900\/20:where(.dark,.dark *):hover{background-color:color-mix(in oklab,var(--color-red-900) 20%,transparent)}}.dark\:hover\:text-gray-300:where(.dark,.dark *):hover{color:var(--color-gray-300)}.dark\:hover\:text-red-400:where(.dark,.dark *):hover{color:var(--color-red-400)}.dark\:hover\:text-white:where(.dark,.dark *):hover{color:var(--color-white)}}.dark\:focus\:border-blue-400:where(.dark,.dark *):focus{border-color:var(--color-blue-400)}}html,body,#root{height:100%}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes slide-up{0%{opacity:0;transform:translateY(12px)scale(.98)}to{opacity:1;transform:translateY(0)scale(1)}}@keyframes scale-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.animate-fade-in{animation:.15s ease-out fade-in}.animate-slide-up{animation:.2s ease-out slide-up}.animate-scale-in{animation:.15s ease-out scale-in}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}.dark ::-webkit-scrollbar-thumb{background:#4b5563}input[type=time]::-webkit-calendar-picker-indicator{filter:var(--tw-brightness, )}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}} diff --git a/frontend/dist/assets/index-DLhHVFKH.js b/frontend/dist/assets/index-DLhHVFKH.js deleted file mode 100644 index 688fba5..0000000 --- a/frontend/dist/assets/index-DLhHVFKH.js +++ /dev/null @@ -1,43 +0,0 @@ -import{r as Mg,a as Eg,b as N,u as Ds,L as K0,R as Tg,c as nl,N as Os,O as ws,d as ks,B as Ag}from"./vendor-BI0H_s0W.js";import{s as Us,e as Hs,a as Ba,b as Un,c as J0,i as W0,d as ui,f as Oe,p as tt,g as _l,h as $0,j as F0,k as ai,l as I0,m as P0,n as Cg,o as _g,q as Dg}from"./date-huy51PAD.js";(function(){const j=document.createElement("link").relList;if(j&&j.supports&&j.supports("modulepreload"))return;for(const M of document.querySelectorAll('link[rel="modulepreload"]'))r(M);new MutationObserver(M=>{for(const _ of M)if(_.type==="childList")for(const H of _.addedNodes)H.tagName==="LINK"&&H.rel==="modulepreload"&&r(H)}).observe(document,{childList:!0,subtree:!0});function O(M){const _={};return M.integrity&&(_.integrity=M.integrity),M.referrerPolicy&&(_.referrerPolicy=M.referrerPolicy),M.crossOrigin==="use-credentials"?_.credentials="include":M.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function r(M){if(M.ep)return;M.ep=!0;const _=O(M);fetch(M.href,_)}})();var zs={exports:{}},On={};/** - * @license React - * react-jsx-runtime.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var q0;function Og(){if(q0)return On;q0=1;var f=Symbol.for("react.transitional.element"),j=Symbol.for("react.fragment");function O(r,M,_){var H=null;if(_!==void 0&&(H=""+_),M.key!==void 0&&(H=""+M.key),"key"in M){_={};for(var Y in M)Y!=="key"&&(_[Y]=M[Y])}else _=M;return M=_.ref,{$$typeof:f,type:r,key:H,ref:M!==void 0?M:null,props:_}}return On.Fragment=j,On.jsx=O,On.jsxs=O,On}var Y0;function wg(){return Y0||(Y0=1,zs.exports=Og()),zs.exports}var i=wg(),Ms={exports:{}},wn={},Es={exports:{}},Ts={};/** - * @license React - * scheduler.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var L0;function Ug(){return L0||(L0=1,(function(f){function j(b,C){var Q=b.length;b.push(C);e:for(;0>>1,ie=b[se];if(0>>1;seM(z,Q))EM(me,z)?(b[se]=me,b[E]=Q,se=E):(b[se]=z,b[te]=Q,se=te);else if(EM(me,Q))b[se]=me,b[E]=Q,se=E;else break e}}return C}function M(b,C){var Q=b.sortIndex-C.sortIndex;return Q!==0?Q:b.id-C.id}if(f.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var _=performance;f.unstable_now=function(){return _.now()}}else{var H=Date,Y=H.now();f.unstable_now=function(){return H.now()-Y}}var R=[],B=[],Z=1,A=null,k=3,D=!1,w=!1,T=!1,U=!1,J=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,ee=typeof setImmediate<"u"?setImmediate:null;function $(b){for(var C=O(B);C!==null;){if(C.callback===null)r(B);else if(C.startTime<=b)r(B),C.sortIndex=C.expirationTime,j(R,C);else break;C=O(B)}}function xe(b){if(T=!1,$(b),!w)if(O(R)!==null)w=!0,ge||(ge=!0,ke());else{var C=O(B);C!==null&&Re(xe,C.startTime-b)}}var ge=!1,Ne=-1,Te=5,W=-1;function Ae(){return U?!0:!(f.unstable_now()-Wb&&Ae());){var se=A.callback;if(typeof se=="function"){A.callback=null,k=A.priorityLevel;var ie=se(A.expirationTime<=b);if(b=f.unstable_now(),typeof ie=="function"){A.callback=ie,$(b),C=!0;break t}A===O(R)&&r(R),$(b)}else r(R);A=O(R)}if(A!==null)C=!0;else{var G=O(B);G!==null&&Re(xe,G.startTime-b),C=!1}}break e}finally{A=null,k=Q,D=!1}C=void 0}}finally{C?ke():ge=!1}}}var ke;if(typeof ee=="function")ke=function(){ee(He)};else if(typeof MessageChannel<"u"){var Qe=new MessageChannel,Ve=Qe.port2;Qe.port1.onmessage=He,ke=function(){Ve.postMessage(null)}}else ke=function(){J(He,0)};function Re(b,C){Ne=J(function(){b(f.unstable_now())},C)}f.unstable_IdlePriority=5,f.unstable_ImmediatePriority=1,f.unstable_LowPriority=4,f.unstable_NormalPriority=3,f.unstable_Profiling=null,f.unstable_UserBlockingPriority=2,f.unstable_cancelCallback=function(b){b.callback=null},f.unstable_forceFrameRate=function(b){0>b||125se?(b.sortIndex=Q,j(B,b),O(R)===null&&b===O(B)&&(T?(P(Ne),Ne=-1):T=!0,Re(xe,Q-se))):(b.sortIndex=ie,j(R,b),w||D||(w=!0,ge||(ge=!0,ke()))),b},f.unstable_shouldYield=Ae,f.unstable_wrapCallback=function(b){var C=k;return function(){var Q=k;k=C;try{return b.apply(this,arguments)}finally{k=Q}}}})(Ts)),Ts}var R0;function Hg(){return R0||(R0=1,Es.exports=Ug()),Es.exports}/** - * @license React - * react-dom-client.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var G0;function Bg(){if(G0)return wn;G0=1;var f=Hg(),j=Mg(),O=Eg();function r(e){var t="https://react.dev/errors/"+e;if(1ie||(e.current=se[ie],se[ie]=null,ie--)}function z(e,t){ie++,se[ie]=e.current,e.current=t}var E=G(null),me=G(null),Ke=G(null),ul=G(null);function qt(e,t){switch(z(Ke,t),z(me,e),z(E,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?c0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=c0(t),e=s0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}te(E),z(E,e)}function Ct(){te(E),te(me),te(Ke)}function V(e){e.memoizedState!==null&&z(ul,e);var t=E.current,l=s0(t,e.type);t!==l&&(z(me,e),z(E,l))}function ze(e){me.current===e&&(te(E),te(me)),ul.current===e&&(te(ul),An._currentValue=Q)}var Pe,Yt;function lt(e){if(Pe===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Pe=t&&t[1]||"",Yt=-1)":-1n||d[a]!==h[n]){var v=` -`+d[a].replace(" at new "," at ");return e.displayName&&v.includes("")&&(v=v.replace("",e.displayName)),v}while(1<=a&&0<=n);break}}}finally{ci=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?lt(l):""}function lo(e,t){switch(e.tag){case 26:case 27:case 5:return lt(e.type);case 16:return lt("Lazy");case 13:return e.child!==t&&t!==null?lt("Suspense Fallback"):lt("Suspense");case 19:return lt("SuspenseList");case 0:case 15:return si(e.type,!1);case 11:return si(e.type.render,!1);case 1:return si(e.type,!0);case 31:return lt("Activity");default:return""}}function Bs(e){try{var t="",l=null;do t+=lo(e,l),l=e,e=e.return;while(e);return t}catch(a){return` -Error generating stack: `+a.message+` -`+a.stack}}var ri=Object.prototype.hasOwnProperty,fi=f.unstable_scheduleCallback,di=f.unstable_cancelCallback,ao=f.unstable_shouldYield,no=f.unstable_requestPaint,ft=f.unstable_now,uo=f.unstable_getCurrentPriorityLevel,qs=f.unstable_ImmediatePriority,Ys=f.unstable_UserBlockingPriority,Bn=f.unstable_NormalPriority,io=f.unstable_LowPriority,Ls=f.unstable_IdlePriority,co=f.log,so=f.unstable_setDisableYieldValue,La=null,dt=null;function il(e){if(typeof co=="function"&&so(e),dt&&typeof dt.setStrictMode=="function")try{dt.setStrictMode(La,e)}catch{}}var ot=Math.clz32?Math.clz32:oo,ro=Math.log,fo=Math.LN2;function oo(e){return e>>>=0,e===0?32:31-(ro(e)/fo|0)|0}var qn=256,Yn=262144,Ln=4194304;function Ol(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Rn(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var n=0,u=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var s=a&134217727;return s!==0?(a=s&~u,a!==0?n=Ol(a):(c&=s,c!==0?n=Ol(c):l||(l=s&~e,l!==0&&(n=Ol(l))))):(s=a&~u,s!==0?n=Ol(s):c!==0?n=Ol(c):l||(l=a&~e,l!==0&&(n=Ol(l)))),n===0?0:t!==0&&t!==n&&(t&u)===0&&(u=n&-n,l=t&-t,u>=l||u===32&&(l&4194048)!==0)?t:n}function Ra(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function mo(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Rs(){var e=Ln;return Ln<<=1,(Ln&62914560)===0&&(Ln=4194304),e}function oi(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Ga(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function go(e,t,l,a,n,u){var c=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var s=e.entanglements,d=e.expirationTimes,h=e.hiddenUpdates;for(l=c&~l;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var po=/[\n"\\]/g;function St(e){return e.replace(po,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function bi(e,t,l,a,n,u,c,s){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),t!=null?c==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+pt(t)):e.value!==""+pt(t)&&(e.value=""+pt(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?vi(e,c,pt(t)):l!=null?vi(e,c,pt(l)):a!=null&&e.removeAttribute("value"),n==null&&u!=null&&(e.defaultChecked=!!u),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.name=""+pt(s):e.removeAttribute("name")}function er(e,t,l,a,n,u,c,s){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||l!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){xi(e);return}l=l!=null?""+pt(l):"",t=t!=null?""+pt(t):l,s||t===e.value||(e.value=t),e.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=s?e.checked:!!a,e.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),xi(e)}function vi(e,t,l){t==="number"&&Xn(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function aa(e,t,l,a){if(e=e.options,t){t={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ki=!1;if(Gt)try{var Va={};Object.defineProperty(Va,"passive",{get:function(){ki=!0}}),window.addEventListener("test",Va,Va),window.removeEventListener("test",Va,Va)}catch{ki=!1}var sl=null,zi=null,Vn=null;function cr(){if(Vn)return Vn;var e,t=zi,l=t.length,a,n="value"in sl?sl.value:sl.textContent,u=n.length;for(e=0;e=Wa),mr=" ",gr=!1;function hr(e,t){switch(e){case"keyup":return Jo.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yr(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ca=!1;function $o(e,t){switch(e){case"compositionend":return yr(t);case"keypress":return t.which!==32?null:(gr=!0,mr);case"textInput":return e=t.data,e===mr&&gr?null:e;default:return null}}function Fo(e,t){if(ca)return e==="compositionend"||!Ci&&hr(e,t)?(e=cr(),Vn=zi=sl=null,ca=!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)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=kr(l)}}function Mr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mr(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Er(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Xn(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Xn(e.document)}return t}function Oi(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")}var um=Gt&&"documentMode"in document&&11>=document.documentMode,sa=null,wi=null,Pa=null,Ui=!1;function Tr(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Ui||sa==null||sa!==Xn(a)||(a=sa,"selectionStart"in a&&Oi(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Pa&&Ia(Pa,a)||(Pa=a,a=Yu(wi,"onSelect"),0>=c,n-=c,wt=1<<32-ot(t)+n|l<I?(ue=L,L=null):ue=L.sibling;var de=y(m,L,g[I],p);if(de===null){L===null&&(L=ue);break}e&&L&&de.alternate===null&&t(m,L),o=u(de,o,I),fe===null?X=de:fe.sibling=de,fe=de,L=ue}if(I===g.length)return l(m,L),ce&&Xt(m,I),X;if(L===null){for(;II?(ue=L,L=null):ue=L.sibling;var Cl=y(m,L,de.value,p);if(Cl===null){L===null&&(L=ue);break}e&&L&&Cl.alternate===null&&t(m,L),o=u(Cl,o,I),fe===null?X=Cl:fe.sibling=Cl,fe=Cl,L=ue}if(de.done)return l(m,L),ce&&Xt(m,I),X;if(L===null){for(;!de.done;I++,de=g.next())de=S(m,de.value,p),de!==null&&(o=u(de,o,I),fe===null?X=de:fe.sibling=de,fe=de);return ce&&Xt(m,I),X}for(L=a(L);!de.done;I++,de=g.next())de=x(L,m,I,de.value,p),de!==null&&(e&&de.alternate!==null&&L.delete(de.key===null?I:de.key),o=u(de,o,I),fe===null?X=de:fe.sibling=de,fe=de);return e&&L.forEach(function(zg){return t(m,zg)}),ce&&Xt(m,I),X}function pe(m,o,g,p){if(typeof g=="object"&&g!==null&&g.type===T&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case D:e:{for(var X=g.key;o!==null;){if(o.key===X){if(X=g.type,X===T){if(o.tag===7){l(m,o.sibling),p=n(o,g.props.children),p.return=m,m=p;break e}}else if(o.elementType===X||typeof X=="object"&&X!==null&&X.$$typeof===Te&&Xl(X)===o.type){l(m,o.sibling),p=n(o,g.props),un(p,g),p.return=m,m=p;break e}l(m,o);break}else t(m,o);o=o.sibling}g.type===T?(p=Yl(g.props.children,m.mode,p,g.key),p.return=m,m=p):(p=lu(g.type,g.key,g.props,null,m.mode,p),un(p,g),p.return=m,m=p)}return c(m);case w:e:{for(X=g.key;o!==null;){if(o.key===X)if(o.tag===4&&o.stateNode.containerInfo===g.containerInfo&&o.stateNode.implementation===g.implementation){l(m,o.sibling),p=n(o,g.children||[]),p.return=m,m=p;break e}else{l(m,o);break}else t(m,o);o=o.sibling}p=Gi(g,m.mode,p),p.return=m,m=p}return c(m);case Te:return g=Xl(g),pe(m,o,g,p)}if(Re(g))return q(m,o,g,p);if(ke(g)){if(X=ke(g),typeof X!="function")throw Error(r(150));return g=X.call(g),K(m,o,g,p)}if(typeof g.then=="function")return pe(m,o,ru(g),p);if(g.$$typeof===ee)return pe(m,o,uu(m,g),p);fu(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,o!==null&&o.tag===6?(l(m,o.sibling),p=n(o,g),p.return=m,m=p):(l(m,o),p=Ri(g,m.mode,p),p.return=m,m=p),c(m)):l(m,o)}return function(m,o,g,p){try{nn=0;var X=pe(m,o,g,p);return va=null,X}catch(L){if(L===ba||L===cu)throw L;var fe=gt(29,L,null,m.mode);return fe.lanes=p,fe.return=m,fe}finally{}}}var Vl=Fr(!0),Ir=Fr(!1),ml=!1;function ec(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function tc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function gl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function hl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(oe&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=tu(e),Ur(e,null,l),t}return eu(e,a,t,l),tu(e)}function cn(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Qs(e,l)}}function lc(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,u=null;if(l=l.firstBaseUpdate,l!==null){do{var c={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};u===null?n=u=c:u=u.next=c,l=l.next}while(l!==null);u===null?n=u=t:u=u.next=t}else n=u=t;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var ac=!1;function sn(){if(ac){var e=xa;if(e!==null)throw e}}function rn(e,t,l,a){ac=!1;var n=e.updateQueue;ml=!1;var u=n.firstBaseUpdate,c=n.lastBaseUpdate,s=n.shared.pending;if(s!==null){n.shared.pending=null;var d=s,h=d.next;d.next=null,c===null?u=h:c.next=h,c=d;var v=e.alternate;v!==null&&(v=v.updateQueue,s=v.lastBaseUpdate,s!==c&&(s===null?v.firstBaseUpdate=h:s.next=h,v.lastBaseUpdate=d))}if(u!==null){var S=n.baseState;c=0,v=h=d=null,s=u;do{var y=s.lane&-536870913,x=y!==s.lane;if(x?(ne&y)===y:(a&y)===y){y!==0&&y===ya&&(ac=!0),v!==null&&(v=v.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var q=e,K=s;y=t;var pe=l;switch(K.tag){case 1:if(q=K.payload,typeof q=="function"){S=q.call(pe,S,y);break e}S=q;break e;case 3:q.flags=q.flags&-65537|128;case 0:if(q=K.payload,y=typeof q=="function"?q.call(pe,S,y):q,y==null)break e;S=A({},S,y);break e;case 2:ml=!0}}y=s.callback,y!==null&&(e.flags|=64,x&&(e.flags|=8192),x=n.callbacks,x===null?n.callbacks=[y]:x.push(y))}else x={lane:y,tag:s.tag,payload:s.payload,callback:s.callback,next:null},v===null?(h=v=x,d=S):v=v.next=x,c|=y;if(s=s.next,s===null){if(s=n.shared.pending,s===null)break;x=s,s=x.next,x.next=null,n.lastBaseUpdate=x,n.shared.pending=null}}while(!0);v===null&&(d=S),n.baseState=d,n.firstBaseUpdate=h,n.lastBaseUpdate=v,u===null&&(n.shared.lanes=0),pl|=c,e.lanes=c,e.memoizedState=S}}function Pr(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function ef(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;eu?u:8;var c=b.T,s={};b.T=s,jc(e,!1,t,l);try{var d=n(),h=b.S;if(h!==null&&h(s,d),d!==null&&typeof d=="object"&&typeof d.then=="function"){var v=gm(d,a);on(e,t,v,vt(e))}else on(e,t,a,vt(e))}catch(S){on(e,t,{then:function(){},status:"rejected",reason:S},vt())}finally{C.p=u,c!==null&&s.types!==null&&(c.types=s.types),b.T=c}}function pm(){}function pc(e,t,l,a){if(e.tag!==5)throw Error(r(476));var n=Of(e).queue;Df(e,n,t,Q,l===null?pm:function(){return wf(e),l(a)})}function Of(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jt,lastRenderedState:Q},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jt,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function wf(e){var t=Of(e);t.next===null&&(t=e.alternate.memoizedState),on(e,t.next.queue,{},vt())}function Sc(){return $e(An)}function Uf(){return Ue().memoizedState}function Hf(){return Ue().memoizedState}function Sm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=vt();e=gl(l);var a=hl(t,e,l);a!==null&&(rt(a,t,l),cn(a,t,l)),t={cache:$i()},e.payload=t;return}t=t.return}}function jm(e,t,l){var a=vt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},pu(e)?qf(t,l):(l=Yi(e,t,l,a),l!==null&&(rt(l,e,a),Yf(l,t,a)))}function Bf(e,t,l){var a=vt();on(e,t,l,a)}function on(e,t,l,a){var n={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(pu(e))qf(t,n);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var c=t.lastRenderedState,s=u(c,l);if(n.hasEagerState=!0,n.eagerState=s,mt(s,c))return eu(e,t,n,0),je===null&&Pn(),!1}catch{}finally{}if(l=Yi(e,t,n,a),l!==null)return rt(l,e,a),Yf(l,t,a),!0}return!1}function jc(e,t,l,a){if(a={lane:2,revertLane:es(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},pu(e)){if(t)throw Error(r(479))}else t=Yi(e,l,a,2),t!==null&&rt(t,e,2)}function pu(e){var t=e.alternate;return e===F||t!==null&&t===F}function qf(e,t){Sa=mu=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function Yf(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Qs(e,l)}}var mn={readContext:$e,use:yu,useCallback:_e,useContext:_e,useEffect:_e,useImperativeHandle:_e,useLayoutEffect:_e,useInsertionEffect:_e,useMemo:_e,useReducer:_e,useRef:_e,useState:_e,useDebugValue:_e,useDeferredValue:_e,useTransition:_e,useSyncExternalStore:_e,useId:_e,useHostTransitionStatus:_e,useFormState:_e,useActionState:_e,useOptimistic:_e,useMemoCache:_e,useCacheRefresh:_e};mn.useEffectEvent=_e;var Lf={readContext:$e,use:yu,useCallback:function(e,t){return et().memoizedState=[e,t===void 0?null:t],e},useContext:$e,useEffect:Nf,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,bu(4194308,4,Ef.bind(null,t,e),l)},useLayoutEffect:function(e,t){return bu(4194308,4,e,t)},useInsertionEffect:function(e,t){bu(4,2,e,t)},useMemo:function(e,t){var l=et();t=t===void 0?null:t;var a=e();if(Kl){il(!0);try{e()}finally{il(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=et();if(l!==void 0){var n=l(t);if(Kl){il(!0);try{l(t)}finally{il(!1)}}}else n=t;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=jm.bind(null,F,e),[a.memoizedState,e]},useRef:function(e){var t=et();return e={current:e},t.memoizedState=e},useState:function(e){e=hc(e);var t=e.queue,l=Bf.bind(null,F,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:bc,useDeferredValue:function(e,t){var l=et();return vc(l,e,t)},useTransition:function(){var e=hc(!1);return e=Df.bind(null,F,e.queue,!0,!1),et().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=F,n=et();if(ce){if(l===void 0)throw Error(r(407));l=l()}else{if(l=t(),je===null)throw Error(r(349));(ne&127)!==0||cf(a,t,l)}n.memoizedState=l;var u={value:l,getSnapshot:t};return n.queue=u,Nf(rf.bind(null,a,u,e),[e]),a.flags|=2048,Na(9,{destroy:void 0},sf.bind(null,a,u,l,t),null),l},useId:function(){var e=et(),t=je.identifierPrefix;if(ce){var l=Ut,a=wt;l=(a&~(1<<32-ot(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=gu++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?c.createElement(n,{is:a.is}):c.createElement(n)}}u[Je]=t,u[at]=a;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)u.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=u;e:switch(Ie(u,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&$t(t)}}return Ee(t),Hc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&$t(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(r(166));if(e=Ke.current,ga(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,n=We,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[Je]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||u0(e.nodeValue,l)),e||dl(t,!0)}else e=Lu(e).createTextNode(a),e[Je]=t,t.stateNode=e}return Ee(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=ga(t),l!==null){if(e===null){if(!a)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[Je]=t}else Ll(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ee(t),e=!1}else l=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(yt(t),t):(yt(t),null);if((t.flags&128)!==0)throw Error(r(558))}return Ee(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=ga(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(r(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));n[Je]=t}else Ll(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ee(t),n=!1}else n=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(yt(t),t):(yt(t),null)}return yt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==n&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),zu(t,t.updateQueue),Ee(t),null);case 4:return Ct(),e===null&&ns(t.stateNode.containerInfo),Ee(t),null;case 10:return Vt(t.type),Ee(t),null;case 19:if(te(we),a=t.memoizedState,a===null)return Ee(t),null;if(n=(t.flags&128)!==0,u=a.rendering,u===null)if(n)hn(a,!1);else{if(De!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=ou(e),u!==null){for(t.flags|=128,hn(a,!1),e=u.updateQueue,t.updateQueue=e,zu(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Hr(l,e),l=l.sibling;return z(we,we.current&1|2),ce&&Xt(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&ft()>Cu&&(t.flags|=128,n=!0,hn(a,!1),t.lanes=4194304)}else{if(!n)if(e=ou(u),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,zu(t,e),hn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!ce)return Ee(t),null}else 2*ft()-a.renderingStartTime>Cu&&l!==536870912&&(t.flags|=128,n=!0,hn(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(e=a.last,e!==null?e.sibling=u:t.child=u,a.last=u)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ft(),e.sibling=null,l=we.current,z(we,n?l&1|2:l&1),ce&&Xt(t,a.treeForkCount),e):(Ee(t),null);case 22:case 23:return yt(t),uc(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(Ee(t),t.subtreeFlags&6&&(t.flags|=8192)):Ee(t),l=t.updateQueue,l!==null&&zu(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&te(Ql),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Vt(Be),Ee(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function Em(e,t){switch(Xi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vt(Be),Ct(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ze(t),null;case 31:if(t.memoizedState!==null){if(yt(t),t.alternate===null)throw Error(r(340));Ll()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(yt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ll()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return te(we),null;case 4:return Ct(),null;case 10:return Vt(t.type),null;case 22:case 23:return yt(t),uc(),e!==null&&te(Ql),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Vt(Be),null;case 25:return null;default:return null}}function fd(e,t){switch(Xi(t),t.tag){case 3:Vt(Be),Ct();break;case 26:case 27:case 5:ze(t);break;case 4:Ct();break;case 31:t.memoizedState!==null&&yt(t);break;case 13:yt(t);break;case 19:te(we);break;case 10:Vt(t.type);break;case 22:case 23:yt(t),uc(),e!==null&&te(Ql);break;case 24:Vt(Be)}}function yn(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&e)===e){a=void 0;var u=l.create,c=l.inst;a=u(),c.destroy=a}l=l.next}while(l!==n)}}catch(s){ye(t,t.return,s)}}function bl(e,t,l){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&e)===e){var c=a.inst,s=c.destroy;if(s!==void 0){c.destroy=void 0,n=t;var d=l,h=s;try{h()}catch(v){ye(n,d,v)}}}a=a.next}while(a!==u)}}catch(v){ye(t,t.return,v)}}function dd(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{ef(t,l)}catch(a){ye(e,e.return,a)}}}function od(e,t,l){l.props=Jl(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){ye(e,t,a)}}function xn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(n){ye(e,t,n)}}function Ht(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){ye(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){ye(e,t,n)}else l.current=null}function md(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){ye(e,e.return,n)}}function Bc(e,t,l){try{var a=e.stateNode;Wm(a,e.type,l,t),a[at]=t}catch(n){ye(e,e.return,n)}}function gd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&zl(e.type)||e.tag===4}function qc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gd(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.tag===27&&zl(e.type)||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 Yc(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Rt));else if(a!==4&&(a===27&&zl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Yc(e,t,l),e=e.sibling;e!==null;)Yc(e,t,l),e=e.sibling}function Mu(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&zl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Mu(e,t,l),e=e.sibling;e!==null;)Mu(e,t,l),e=e.sibling}function hd(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Ie(t,a,l),t[Je]=e,t[at]=l}catch(u){ye(e,e.return,u)}}var Ft=!1,Le=!1,Lc=!1,yd=typeof WeakSet=="function"?WeakSet:Set,Ze=null;function Tm(e,t){if(e=e.containerInfo,cs=Ku,e=Er(e),Oi(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{l.nodeType,u.nodeType}catch{l=null;break e}var c=0,s=-1,d=-1,h=0,v=0,S=e,y=null;t:for(;;){for(var x;S!==l||n!==0&&S.nodeType!==3||(s=c+n),S!==u||a!==0&&S.nodeType!==3||(d=c+a),S.nodeType===3&&(c+=S.nodeValue.length),(x=S.firstChild)!==null;)y=S,S=x;for(;;){if(S===e)break t;if(y===l&&++h===n&&(s=c),y===u&&++v===a&&(d=c),(x=S.nextSibling)!==null)break;S=y,y=S.parentNode}S=x}l=s===-1||d===-1?null:{start:s,end:d}}else l=null}l=l||{start:0,end:0}}else l=null;for(ss={focusedElem:e,selectionRange:l},Ku=!1,Ze=t;Ze!==null;)if(t=Ze,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ze=e;else for(;Ze!==null;){switch(t=Ze,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l title"))),Ie(u,a,l),u[Je]=e,Xe(u),a=u;break e;case"link":var c=j0("link","href",n).get(a+(l.href||""));if(c){for(var s=0;spe&&(c=pe,pe=K,K=c);var m=zr(s,K),o=zr(s,pe);if(m&&o&&(x.rangeCount!==1||x.anchorNode!==m.node||x.anchorOffset!==m.offset||x.focusNode!==o.node||x.focusOffset!==o.offset)){var g=S.createRange();g.setStart(m.node,m.offset),x.removeAllRanges(),K>pe?(x.addRange(g),x.extend(o.node,o.offset)):(g.setEnd(o.node,o.offset),x.addRange(g))}}}}for(S=[],x=s;x=x.parentNode;)x.nodeType===1&&S.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;sl?32:l,b.T=null,l=Kc,Kc=null;var u=jl,c=ll;if(Ge=0,Ta=jl=null,ll=0,(oe&6)!==0)throw Error(r(331));var s=oe;if(oe|=4,Ed(u.current),kd(u,u.current,c,l),oe=s,Nn(0,!1),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(La,u)}catch{}return!0}finally{C.p=n,b.T=a,Zd(e,t)}}function Kd(e,t,l){t=Nt(l,t),t=Mc(e.stateNode,t,2),e=hl(e,t,2),e!==null&&(Ga(e,2),Bt(e))}function ye(e,t,l){if(e.tag===3)Kd(e,e,l);else for(;t!==null;){if(t.tag===3){Kd(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Sl===null||!Sl.has(a))){e=Nt(l,e),l=Jf(2),a=hl(t,l,2),a!==null&&(Wf(l,a,t,e),Ga(a,2),Bt(a));break}}t=t.return}}function Fc(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new _m;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(l)||(Qc=!0,n.add(l),e=Hm.bind(null,e,t,l),t.then(e,e))}function Hm(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,je===e&&(ne&l)===l&&(De===4||De===3&&(ne&62914560)===ne&&300>ft()-Au?(oe&2)===0&&Aa(e,0):Xc|=l,Ea===ne&&(Ea=0)),Bt(e)}function Jd(e,t){t===0&&(t=Rs()),e=ql(e,t),e!==null&&(Ga(e,t),Bt(e))}function Bm(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),Jd(e,l)}function qm(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(r(314))}a!==null&&a.delete(t),Jd(e,l)}function Ym(e,t){return fi(e,t)}var Hu=null,_a=null,Ic=!1,Bu=!1,Pc=!1,kl=0;function Bt(e){e!==_a&&e.next===null&&(_a===null?Hu=_a=e:_a=_a.next=e),Bu=!0,Ic||(Ic=!0,Rm())}function Nn(e,t){if(!Pc&&Bu){Pc=!0;do for(var l=!1,a=Hu;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var u=0;else{var c=a.suspendedLanes,s=a.pingedLanes;u=(1<<31-ot(42|e)+1)-1,u&=n&~(c&~s),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(l=!0,Id(a,u))}else u=ne,u=Rn(a,a===je?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Ra(a,u)||(l=!0,Id(a,u));a=a.next}while(l);Pc=!1}}function Lm(){Wd()}function Wd(){Bu=Ic=!1;var e=0;kl!==0&&Fm()&&(e=kl);for(var t=ft(),l=null,a=Hu;a!==null;){var n=a.next,u=$d(a,t);u===0?(a.next=null,l===null?Hu=n:l.next=n,n===null&&(_a=l)):(l=a,(e!==0||(u&3)!==0)&&(Bu=!0)),a=n}Ge!==0&&Ge!==5||Nn(e),kl!==0&&(kl=0)}function $d(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,u=e.pendingLanes&-62914561;0s)break;var v=d.transferSize,S=d.initiatorType;v&&i0(S)&&(d=d.responseEnd,c+=v*(d"u"?null:document;function b0(e,t,l){var a=Da;if(a&&typeof t=="string"&&t){var n=St(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),x0.has(n)||(x0.add(n),e={rel:e,crossOrigin:l,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),Ie(t,"link",e),Xe(t),a.head.appendChild(t)))}}function ig(e){al.D(e),b0("dns-prefetch",e,null)}function cg(e,t){al.C(e,t),b0("preconnect",e,t)}function sg(e,t,l){al.L(e,t,l);var a=Da;if(a&&e&&t){var n='link[rel="preload"][as="'+St(t)+'"]';t==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+St(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+St(l.imageSizes)+'"]')):n+='[href="'+St(e)+'"]';var u=n;switch(t){case"style":u=Oa(e);break;case"script":u=wa(e)}At.has(u)||(e=A({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),At.set(u,e),a.querySelector(n)!==null||t==="style"&&a.querySelector(En(u))||t==="script"&&a.querySelector(Tn(u))||(t=a.createElement("link"),Ie(t,"link",e),Xe(t),a.head.appendChild(t)))}}function rg(e,t){al.m(e,t);var l=Da;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+St(a)+'"][href="'+St(e)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=wa(e)}if(!At.has(u)&&(e=A({rel:"modulepreload",href:e},t),At.set(u,e),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Tn(u)))return}a=l.createElement("link"),Ie(a,"link",e),Xe(a),l.head.appendChild(a)}}}function fg(e,t,l){al.S(e,t,l);var a=Da;if(a&&e){var n=ta(a).hoistableStyles,u=Oa(e);t=t||"default";var c=n.get(u);if(!c){var s={loading:0,preload:null};if(c=a.querySelector(En(u)))s.loading=5;else{e=A({rel:"stylesheet",href:e,"data-precedence":t},l),(l=At.get(u))&&hs(e,l);var d=c=a.createElement("link");Xe(d),Ie(d,"link",e),d._p=new Promise(function(h,v){d.onload=h,d.onerror=v}),d.addEventListener("load",function(){s.loading|=1}),d.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Gu(c,t,a)}c={type:"stylesheet",instance:c,count:1,state:s},n.set(u,c)}}}function dg(e,t){al.X(e,t);var l=Da;if(l&&e){var a=ta(l).hoistableScripts,n=wa(e),u=a.get(n);u||(u=l.querySelector(Tn(n)),u||(e=A({src:e,async:!0},t),(t=At.get(n))&&ys(e,t),u=l.createElement("script"),Xe(u),Ie(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function og(e,t){al.M(e,t);var l=Da;if(l&&e){var a=ta(l).hoistableScripts,n=wa(e),u=a.get(n);u||(u=l.querySelector(Tn(n)),u||(e=A({src:e,async:!0,type:"module"},t),(t=At.get(n))&&ys(e,t),u=l.createElement("script"),Xe(u),Ie(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function v0(e,t,l,a){var n=(n=Ke.current)?Ru(n):null;if(!n)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Oa(l.href),l=ta(n).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Oa(l.href);var u=ta(n).hoistableStyles,c=u.get(e);if(c||(n=n.ownerDocument||n,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,c),(u=n.querySelector(En(e)))&&!u._p&&(c.instance=u,c.state.loading=5),At.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},At.set(e,l),u||mg(n,e,l,c.state))),t&&a===null)throw Error(r(528,""));return c}if(t&&a!==null)throw Error(r(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=wa(l),l=ta(n).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Oa(e){return'href="'+St(e)+'"'}function En(e){return'link[rel="stylesheet"]['+e+"]"}function p0(e){return A({},e,{"data-precedence":e.precedence,precedence:null})}function mg(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),Ie(t,"link",l),Xe(t),e.head.appendChild(t))}function wa(e){return'[src="'+St(e)+'"]'}function Tn(e){return"script[async]"+e}function S0(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+St(l.href)+'"]');if(a)return t.instance=a,Xe(a),a;var n=A({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Xe(a),Ie(a,"style",n),Gu(a,l.precedence,e),t.instance=a;case"stylesheet":n=Oa(l.href);var u=e.querySelector(En(n));if(u)return t.state.loading|=4,t.instance=u,Xe(u),u;a=p0(l),(n=At.get(n))&&hs(a,n),u=(e.ownerDocument||e).createElement("link"),Xe(u);var c=u;return c._p=new Promise(function(s,d){c.onload=s,c.onerror=d}),Ie(u,"link",a),t.state.loading|=4,Gu(u,l.precedence,e),t.instance=u;case"script":return u=wa(l.src),(n=e.querySelector(Tn(u)))?(t.instance=n,Xe(n),n):(a=l,(n=At.get(u))&&(a=A({},l),ys(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),Xe(n),Ie(n,"link",a),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Gu(a,l.precedence,e));return t.instance}function Gu(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,c=0;c title"):null)}function gg(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function k0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function hg(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var n=Oa(a.href),u=t.querySelector(En(n));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Xu.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=u,Xe(u);return}u=t.ownerDocument||t,a=p0(a),(n=At.get(n))&&hs(a,n),u=u.createElement("link"),Xe(u);var c=u;c._p=new Promise(function(s,d){c.onload=s,c.onerror=d}),Ie(u,"link",a),l.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Xu.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var xs=0;function yg(e,t){return e.stylesheets&&e.count===0&&Vu(e,e.stylesheets),0xs?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function Xu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zu=null;function Vu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zu=new Map,t.forEach(xg,e),Zu=null,Xu.call(e))}function xg(e,t){if(!(t.state.loading&4)){var l=Zu.get(e);if(l)var a=l.get(null);else{l=new Map,Zu.set(e,l);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(j){console.error(j)}}return f(),Ms.exports=Bg(),Ms.exports}var Yg=qg();const X0="".replace(/\/$/,"");let Hn=localStorage.getItem("access_token"),Fl=localStorage.getItem("refresh_token"),ei=null;function As(f){return X0?`${X0}${f.startsWith("/")?f:`/${f}`}`:f}function Cs(f,j){Hn=f,Fl=j,localStorage.setItem("access_token",f),localStorage.setItem("refresh_token",j)}function _s(){Hn=null,Fl=null,localStorage.removeItem("access_token"),localStorage.removeItem("refresh_token")}function Lg(){return Fl}async function Rg(){if(!Fl)throw new Error("No refresh token");const f=await fetch(As("/auth/refresh"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:Fl})});if(!f.ok)throw _s(),window.dispatchEvent(new CustomEvent("auth:logout")),new Error("Refresh failed");const j=await f.json();Cs(j.access_token,j.refresh_token)}async function re(f,j={}){var M;const O={...j.headers};Hn&&(O.Authorization=`Bearer ${Hn}`),j.body instanceof FormData||(O["Content-Type"]="application/json");let r=await fetch(As(f),{...j,headers:O});if(r.status===401&&Fl&&(ei||(ei=Rg().finally(()=>{ei=null})),await ei,O.Authorization=`Bearer ${Hn}`,r=await fetch(As(f),{...j,headers:O})),!r.ok){const _=await r.json().catch(()=>({}));throw{status:r.status,..._}}return(M=r.headers.get("content-type"))!=null&&M.includes("text/calendar")?await r.text():r.json()}const Se={register:(f,j,O)=>re("/auth/register",{method:"POST",body:JSON.stringify({email:f,password:j,timezone:O})}),login:(f,j)=>re("/auth/login",{method:"POST",body:JSON.stringify({email:f,password:j})}),logout:()=>re("/auth/logout",{method:"POST",body:JSON.stringify({refresh_token:Fl})}),me:()=>re("/auth/me"),updateMe:f=>re("/users/me",{method:"PUT",body:JSON.stringify(f)}),deleteMe:()=>re("/users/me",{method:"DELETE"}),listApiKeys:()=>re("/api-keys"),createApiKey:f=>re("/api-keys",{method:"POST",body:JSON.stringify(f)}),revokeApiKey:f=>re(`/api-keys/${f}`,{method:"DELETE"}),listCalendars:()=>re("/calendars?limit=100"),createCalendar:f=>re("/calendars",{method:"POST",body:JSON.stringify(f)}),getCalendar:f=>re(`/calendars/${f}`),updateCalendar:(f,j)=>re(`/calendars/${f}`,{method:"PUT",body:JSON.stringify(j)}),deleteCalendar:f=>re(`/calendars/${f}`,{method:"DELETE"}),shareCalendar:(f,j)=>re(`/calendars/${f}/share`,{method:"POST",body:JSON.stringify(j)}),listMembers:f=>re(`/calendars/${f}/members`),removeMember:(f,j)=>re(`/calendars/${f}/members/${j}`,{method:"DELETE"}),addCalendarFromUrl:f=>re("/calendars/add-from-url",{method:"POST",body:JSON.stringify(f)}),importCalendarUrl:f=>re("/calendars/import-url",{method:"POST",body:JSON.stringify(f)}),listSubscriptions:f=>re(`/calendars/${f}/subscriptions`),addSubscription:(f,j)=>re(`/calendars/${f}/subscriptions`,{method:"POST",body:JSON.stringify(j)}),deleteSubscription:(f,j)=>re(`/calendars/${f}/subscriptions/${j}`,{method:"DELETE"}),syncSubscription:(f,j)=>re(`/calendars/${f}/subscriptions/${j}/sync`,{method:"POST"}),listEvents:f=>{const j=new URLSearchParams({start:f.start,end:f.end});return f.calendar_id&&j.set("calendar_id",f.calendar_id),f.search&&j.set("search",f.search),j.set("limit","500"),re(`/events?${j}`)},createEvent:f=>re("/events",{method:"POST",body:JSON.stringify(f)}),getEvent:f=>re(`/events/${f}`),updateEvent:(f,j)=>re(`/events/${f}`,{method:"PUT",body:JSON.stringify(j)}),deleteEvent:f=>re(`/events/${f}`,{method:"DELETE"}),listContacts:f=>{const j=new URLSearchParams({limit:"200"});return f&&j.set("search",f),re(`/contacts?${j}`)},createContact:f=>re("/contacts",{method:"POST",body:JSON.stringify(f)}),getContact:f=>re(`/contacts/${f}`),updateContact:(f,j)=>re(`/contacts/${f}`,{method:"PUT",body:JSON.stringify(j)}),deleteContact:f=>re(`/contacts/${f}`,{method:"DELETE"})},eo=N.createContext(null);function Gg({children:f}){const[j,O]=N.useState(null),[r,M]=N.useState(!0);N.useEffect(()=>{localStorage.getItem("access_token")?Se.me().then(A=>O(A.user)).catch(()=>{_s(),O(null)}).finally(()=>M(!1)):M(!1);const Z=()=>{O(null)};return window.addEventListener("auth:logout",Z),()=>window.removeEventListener("auth:logout",Z)},[]);const _=N.useCallback(async(B,Z)=>{const A=await Se.login(B,Z);Cs(A.access_token,A.refresh_token),O(A.user)},[]),H=N.useCallback(async(B,Z,A)=>{const k=await Se.register(B,Z,A);Cs(k.access_token,k.refresh_token),O(k.user)},[]),Y=N.useCallback(async()=>{try{Lg()&&await Se.logout()}finally{_s(),O(null)}},[]),R=N.useCallback(async()=>{const B=await Se.me();O(B.user)},[]);return i.jsx(eo.Provider,{value:{user:j,loading:r,login:_,register:H,logout:Y,refreshUser:R},children:f})}function Ya(){const f=N.useContext(eo);if(!f)throw new Error("useAuth must be used within AuthProvider");return f}const to=N.createContext(null);function Qg(){const f=localStorage.getItem("theme");return f||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}function Xg({children:f}){const[j,O]=N.useState(Qg);N.useEffect(()=>{document.documentElement.classList.toggle("dark",j==="dark"),localStorage.setItem("theme",j)},[j]);const r=N.useCallback(()=>{O(M=>M==="light"?"dark":"light")},[]);return i.jsx(to.Provider,{value:{theme:j,toggle:r},children:f})}function ii(){const f=N.useContext(to);if(!f)throw new Error("useTheme must be used within ThemeProvider");return f}class Zg extends N.Component{constructor(j){super(j),this.state={hasError:!1}}static getDerivedStateFromError(j){return{hasError:!0,error:j}}render(){return this.state.hasError?this.props.fallback?this.props.fallback:i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 p-4",children:i.jsxs("div",{className:"max-w-md w-full text-center",children:[i.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:i.jsx("svg",{className:"w-8 h-8 text-red-600 dark:text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),i.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:"Something went wrong"}),i.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:"An unexpected error occurred. Please refresh the page to try again."}),i.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-lg transition-colors",children:"Refresh page"})]})}):this.props.children}}function Vg(){const{login:f}=Ya(),{theme:j,toggle:O}=ii(),r=Ds(),[M,_]=N.useState(""),[H,Y]=N.useState(""),[R,B]=N.useState(""),[Z,A]=N.useState(!1),k=async D=>{D.preventDefault(),B(""),A(!0);try{await f(M,H),r("/")}catch(w){B(w.error||"Invalid credentials")}finally{A(!1)}};return i.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 px-4 transition-colors",children:[i.jsx("div",{className:"absolute top-4 right-4",children:i.jsx("button",{onClick:O,className:"p-2 rounded-xl bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:j==="dark"?i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})})}),i.jsxs("div",{className:"w-full max-w-sm",children:[i.jsxs("div",{className:"text-center mb-8",children:[i.jsx("div",{className:"inline-flex items-center justify-center w-14 h-14 bg-blue-600 rounded-2xl mb-4 shadow-lg shadow-blue-600/20",children:i.jsx("svg",{className:"w-8 h-8 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),i.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Welcome back"}),i.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1 text-sm",children:"Sign in to your calendar"})]}),i.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-2xl shadow-xl shadow-gray-200/50 dark:shadow-black/20 border border-gray-100 dark:border-gray-700 p-6",children:i.jsxs("form",{onSubmit:k,className:"space-y-4",children:[R&&i.jsx("div",{className:"text-sm text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 px-3 py-2.5 rounded-xl",children:R}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1.5",children:"Email"}),i.jsx("input",{type:"email",value:M,onChange:D=>_(D.target.value),className:"w-full px-3.5 py-2.5 rounded-xl border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all text-sm",placeholder:"you@example.com",required:!0,autoFocus:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1.5",children:"Password"}),i.jsx("input",{type:"password",value:H,onChange:D=>Y(D.target.value),className:"w-full px-3.5 py-2.5 rounded-xl border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all text-sm",placeholder:"Min. 10 characters",required:!0,minLength:10})]}),i.jsx("button",{type:"submit",disabled:Z,className:"w-full py-2.5 bg-blue-600 hover:bg-blue-700 disabled:opacity-50 text-white rounded-xl font-medium transition-colors text-sm",children:Z?"Signing in...":"Sign in"})]})}),i.jsxs("p",{className:"text-center mt-6 text-sm text-gray-500 dark:text-gray-400",children:["Don't have an account?"," ",i.jsx(K0,{to:"/register",className:"text-blue-600 dark:text-blue-400 hover:underline font-medium",children:"Create one"})]})]})]})}function Kg(){const{register:f}=Ya(),{theme:j,toggle:O}=ii(),r=Ds(),[M,_]=N.useState(""),[H,Y]=N.useState(""),[R,B]=N.useState(""),[Z,A]=N.useState(""),[k,D]=N.useState(!1),w=async T=>{if(T.preventDefault(),A(""),H!==R){A("Passwords don't match");return}D(!0);try{const U=Intl.DateTimeFormat().resolvedOptions().timeZone;await f(M,H,U),r("/")}catch(U){A(U.error||"Registration failed")}finally{D(!1)}};return i.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 px-4 transition-colors",children:[i.jsx("div",{className:"absolute top-4 right-4",children:i.jsx("button",{onClick:O,className:"p-2 rounded-xl bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:j==="dark"?i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})})}),i.jsxs("div",{className:"w-full max-w-sm",children:[i.jsxs("div",{className:"text-center mb-8",children:[i.jsx("div",{className:"inline-flex items-center justify-center w-14 h-14 bg-blue-600 rounded-2xl mb-4 shadow-lg shadow-blue-600/20",children:i.jsx("svg",{className:"w-8 h-8 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),i.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Create account"}),i.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1 text-sm",children:"Get started with your calendar"})]}),i.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-2xl shadow-xl shadow-gray-200/50 dark:shadow-black/20 border border-gray-100 dark:border-gray-700 p-6",children:i.jsxs("form",{onSubmit:w,className:"space-y-4",children:[Z&&i.jsx("div",{className:"text-sm text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 px-3 py-2.5 rounded-xl",children:Z}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1.5",children:"Email"}),i.jsx("input",{type:"email",value:M,onChange:T=>_(T.target.value),className:"w-full px-3.5 py-2.5 rounded-xl border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all text-sm",placeholder:"you@example.com",required:!0,autoFocus:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1.5",children:"Password"}),i.jsx("input",{type:"password",value:H,onChange:T=>Y(T.target.value),className:"w-full px-3.5 py-2.5 rounded-xl border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all text-sm",placeholder:"Min. 10 characters",required:!0,minLength:10})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1.5",children:"Confirm password"}),i.jsx("input",{type:"password",value:R,onChange:T=>B(T.target.value),className:"w-full px-3.5 py-2.5 rounded-xl border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all text-sm",placeholder:"Repeat your password",required:!0,minLength:10})]}),i.jsx("button",{type:"submit",disabled:k,className:"w-full py-2.5 bg-blue-600 hover:bg-blue-700 disabled:opacity-50 text-white rounded-xl font-medium transition-colors text-sm",children:k?"Creating account...":"Create account"})]})}),i.jsxs("p",{className:"text-center mt-6 text-sm text-gray-500 dark:text-gray-400",children:["Already have an account?"," ",i.jsx(K0,{to:"/login",className:"text-blue-600 dark:text-blue-400 hover:underline font-medium",children:"Sign in"})]})]})]})}function Dl(f){return f.is_occurrence&&f.occurrence_start_time?f.occurrence_start_time:f.start_time}function ni(f){return f.is_occurrence&&f.occurrence_end_time?f.occurrence_end_time:f.end_time}function Jg({currentDate:f,events:j,calendars:O,visibleCalendarIds:r,onDateClick:M,onEventClick:_}){const H=Us(f),Y=Hs(f),R=Ba(H),B=Un(Y),Z=J0({start:R,end:B}),A=new Map(O.map(w=>[w.id,w.color])),k=j.filter(w=>r.has(w.calendar_id)),D=w=>k.filter(T=>{const U=tt(Dl(T)),J=tt(ni(T));return _l(U,w)||_l(J,w)||Uw});return i.jsxs("div",{className:"flex flex-col h-full",children:[i.jsx("div",{className:"grid grid-cols-7 border-b border-gray-200 dark:border-gray-700",children:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(w=>i.jsx("div",{className:"py-2 text-center text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide",children:w},w))}),i.jsx("div",{className:"grid grid-cols-7 flex-1 auto-rows-fr",children:Z.map((w,T)=>{const U=W0(w,f),J=ui(w),P=D(w);return i.jsxs("div",{className:`min-h-[80px] border-b border-r border-gray-100 dark:border-gray-700/50 p-1 cursor-pointer transition-colors hover:bg-gray-50 dark:hover:bg-gray-800/50 - ${T%7===0?"border-l":""} - ${U?"":"bg-gray-50/50 dark:bg-gray-900/30"}`,onClick:()=>M(w),children:[i.jsx("div",{className:"flex justify-center mb-1",children:i.jsx("span",{className:`text-xs w-6 h-6 flex items-center justify-center rounded-full font-medium - ${J?"bg-blue-600 text-white":""} - ${!J&&U?"text-gray-700 dark:text-gray-300":""} - ${!J&&!U?"text-gray-400 dark:text-gray-600":""}`,children:Oe(w,"d")})}),i.jsxs("div",{className:"space-y-0.5 overflow-hidden",children:[P.slice(0,3).map(ee=>i.jsxs("button",{onClick:$=>{$.stopPropagation(),_(ee)},className:"w-full text-left text-[10px] leading-tight px-1.5 py-0.5 rounded truncate text-white font-medium transition-opacity hover:opacity-80",style:{backgroundColor:A.get(ee.calendar_id)||"#3B82F6"},children:[!ee.all_day&&i.jsxs("span",{className:"opacity-80",children:[Oe(tt(Dl(ee)),"h:mm")," "]}),ee.title]},ee.id+w.toISOString())),P.length>3&&i.jsxs("div",{className:"text-[10px] text-gray-500 dark:text-gray-400 text-center font-medium",children:["+",P.length-3," more"]})]})]},w.toISOString())})})]})}const Z0=Array.from({length:24},(f,j)=>j),ti=60;function Wg({currentDate:f,events:j,calendars:O,visibleCalendarIds:r,onTimeClick:M,onEventClick:_}){const H=Ba(f),Y=Array.from({length:7},(T,U)=>$0(H,U)),R=new Map(O.map(T=>[T.id,T.color])),B=j.filter(T=>r.has(T.calendar_id)),Z=B.filter(T=>T.all_day),A=B.filter(T=>!T.all_day),k=T=>A.filter(U=>_l(tt(Dl(U)),T)),D=T=>Z.filter(U=>{const J=tt(Dl(U)),P=tt(ni(U));return _l(J,T)||_l(P,T)||JT}),w=T=>{const U=tt(Dl(T)),J=F0(U),P=ai(U,J),ee=tt(ni(T)),$=Math.max(ai(ee,U),15);return{top:`${P}px`,height:`${$}px`,minHeight:"20px"}};return i.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[i.jsxs("div",{className:"flex border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:[i.jsx("div",{className:"w-16 flex-shrink-0"}),Y.map(T=>{const U=ui(T);return i.jsxs("div",{className:"flex-1 text-center py-2 border-l border-gray-100 dark:border-gray-700/50",children:[i.jsx("div",{className:"text-[10px] font-semibold text-gray-500 dark:text-gray-400 uppercase",children:Oe(T,"EEE")}),i.jsx("div",{className:`text-lg font-semibold mt-0.5 ${U?"bg-blue-600 text-white w-8 h-8 rounded-full flex items-center justify-center mx-auto":"text-gray-700 dark:text-gray-300"}`,children:Oe(T,"d")})]},T.toISOString())})]}),Z.length>0&&i.jsxs("div",{className:"flex border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:[i.jsx("div",{className:"w-16 flex-shrink-0 text-[10px] text-gray-400 dark:text-gray-500 text-right pr-2 py-1",children:"all-day"}),Y.map(T=>i.jsx("div",{className:"flex-1 border-l border-gray-100 dark:border-gray-700/50 p-0.5 space-y-0.5",children:D(T).map(U=>i.jsx("button",{onClick:()=>_(U),className:"w-full text-left text-[10px] px-1.5 py-0.5 rounded text-white font-medium truncate hover:opacity-80",style:{backgroundColor:R.get(U.calendar_id)||"#3B82F6"},children:U.title},U.id))},T.toISOString()))]}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsxs("div",{className:"flex relative",style:{height:`${24*ti}px`},children:[i.jsx("div",{className:"w-16 flex-shrink-0 relative",children:Z0.map(T=>i.jsx("div",{className:"absolute w-full text-right pr-2 text-[10px] text-gray-400 dark:text-gray-500 -mt-2",style:{top:`${T*ti}px`},children:T===0?"":Oe(new Date(2e3,0,1,T),"h a")},T))}),Y.map(T=>i.jsxs("div",{className:"flex-1 relative border-l border-gray-100 dark:border-gray-700/50",children:[Z0.map(U=>i.jsx("div",{className:"absolute w-full border-t border-gray-100 dark:border-gray-700/30 cursor-pointer hover:bg-blue-50/50 dark:hover:bg-blue-900/10",style:{top:`${U*ti}px`,height:`${ti}px`},onClick:()=>{const J=new Date(T);J.setHours(U,0,0,0),M(J)}},U)),k(T).map(U=>{const J=w(U);return i.jsxs("button",{onClick:P=>{P.stopPropagation(),_(U)},className:"absolute left-0.5 right-1 rounded-md px-1.5 py-0.5 text-[11px] text-white font-medium overflow-hidden hover:opacity-90 z-10 shadow-sm",style:{...J,backgroundColor:R.get(U.calendar_id)||"#3B82F6"},children:[i.jsx("div",{className:"truncate",children:U.title}),i.jsx("div",{className:"opacity-75 truncate text-[10px]",children:Oe(tt(U.start_time),"h:mm a")})]},U.id)})]},T.toISOString()))]})})]})}const V0=Array.from({length:24},(f,j)=>j),Ha=64;function $g({currentDate:f,events:j,calendars:O,visibleCalendarIds:r,onTimeClick:M,onEventClick:_}){const H=new Map(O.map(k=>[k.id,k.color])),Y=j.filter(k=>r.has(k.calendar_id)),R=Y.filter(k=>k.all_day&&_l(tt(Dl(k)),f)),B=Y.filter(k=>!k.all_day&&_l(tt(Dl(k)),f)),Z=ui(f),A=k=>{const D=tt(Dl(k)),w=F0(D),T=ai(D,w),U=tt(ni(k)),J=Math.max(ai(U,D),15);return{top:`${T*(Ha/60)}px`,height:`${J*(Ha/60)}px`,minHeight:"24px"}};return i.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[i.jsxs("div",{className:"text-center py-3 border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:[i.jsx("div",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase",children:Oe(f,"EEEE")}),i.jsx("div",{className:`text-2xl font-bold mt-1 ${Z?"bg-blue-600 text-white w-10 h-10 rounded-full flex items-center justify-center mx-auto":"text-gray-800 dark:text-gray-200"}`,children:Oe(f,"d")})]}),R.length>0&&i.jsx("div",{className:"px-4 py-2 border-b border-gray-200 dark:border-gray-700 space-y-1 flex-shrink-0",children:R.map(k=>i.jsx("button",{onClick:()=>_(k),className:"block w-full text-left text-sm px-3 py-1.5 rounded-lg text-white font-medium hover:opacity-80",style:{backgroundColor:H.get(k.calendar_id)||"#3B82F6"},children:k.title},k.id))}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsxs("div",{className:"flex relative",style:{height:`${24*Ha}px`},children:[i.jsx("div",{className:"w-20 flex-shrink-0 relative",children:V0.map(k=>i.jsx("div",{className:"absolute w-full text-right pr-3 text-xs text-gray-400 dark:text-gray-500 -mt-2",style:{top:`${k*Ha}px`},children:k===0?"":Oe(new Date(2e3,0,1,k),"h a")},k))}),i.jsxs("div",{className:"flex-1 relative border-l border-gray-200 dark:border-gray-700",children:[V0.map(k=>i.jsx("div",{className:"absolute w-full border-t border-gray-100 dark:border-gray-700/30 cursor-pointer hover:bg-blue-50/50 dark:hover:bg-blue-900/10",style:{top:`${k*Ha}px`,height:`${Ha}px`},onClick:()=>{const D=new Date(f);D.setHours(k,0,0,0),M(D)}},k)),B.map(k=>{const D=A(k);return i.jsxs("button",{onClick:w=>{w.stopPropagation(),_(k)},className:"absolute left-1 right-4 rounded-lg px-3 py-1.5 text-white font-medium overflow-hidden hover:opacity-90 z-10 shadow-sm",style:{...D,backgroundColor:H.get(k.calendar_id)||"#3B82F6"},children:[i.jsx("div",{className:"text-sm truncate",children:k.title}),i.jsxs("div",{className:"text-xs opacity-80",children:[Oe(tt(k.start_time),"h:mm a")," -"," ",Oe(tt(k.end_time),"h:mm a")]}),k.location&&i.jsx("div",{className:"text-xs opacity-70 truncate",children:k.location})]},k.id)})]})]})})]})}function qa({open:f,onClose:j,title:O,children:r,wide:M}){return N.useEffect(()=>{if(!f)return;const _=H=>{H.key==="Escape"&&j()};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[f,j]),f?i.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center animate-fade-in",onClick:j,children:[i.jsx("div",{className:"absolute inset-0 bg-black/40 dark:bg-black/60"}),i.jsxs("div",{className:`relative bg-white dark:bg-gray-800 rounded-2xl shadow-2xl animate-slide-up - ${M?"w-full max-w-2xl":"w-full max-w-md"} max-h-[90vh] overflow-y-auto mx-4`,onClick:_=>_.stopPropagation(),children:[i.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 dark:border-gray-700",children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:O}),i.jsx("button",{onClick:j,className:"p-1 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),i.jsx("div",{className:"p-6",children:r})]})]}):null}function Fg({open:f,onClose:j,onSaved:O,event:r,calendars:M,defaultDate:_,defaultCalendarId:H}){var ie;const Y=!!r,R=M.filter(G=>G.role!=="viewer"),[B,Z]=N.useState(""),[A,k]=N.useState(""),[D,w]=N.useState(""),[T,U]=N.useState(""),[J,P]=N.useState(""),[ee,$]=N.useState("09:00"),[xe,ge]=N.useState(""),[Ne,Te]=N.useState("10:00"),[W,Ae]=N.useState(!1),[He,ke]=N.useState(!1),[Qe,Ve]=N.useState(""),[Re,b]=N.useState(!1);N.useEffect(()=>{var G;if(f)if(Ve(""),b(!1),r){Z(r.title),k(r.description||""),w(r.location||""),U(r.calendar_id),Ae(r.all_day);const te=new Date(r.start_time),z=new Date(r.end_time);P(Oe(te,"yyyy-MM-dd")),$(Oe(te,"HH:mm")),ge(Oe(z,"yyyy-MM-dd")),Te(Oe(z,"HH:mm"))}else{Z(""),k(""),w(""),U(H||((G=R[0])==null?void 0:G.id)||""),Ae(!1);const z=Oe(_||new Date,"yyyy-MM-dd");P(z),ge(z),$("09:00"),Te("10:00")}},[f,r,_,H]);const C=async G=>{if(G.preventDefault(),!(!B.trim()||!T)){ke(!0),Ve("");try{const te=Intl.DateTimeFormat().resolvedOptions().timeZone,z=W?`${J}T00:00:00`:`${J}T${ee}:00`,E=W?`${xe}T23:59:59`:`${xe}T${Ne}:00`,me={title:B.trim(),description:A.trim()||void 0,location:D.trim()||void 0,start_time:new Date(z).toISOString(),end_time:new Date(E).toISOString(),timezone:te,all_day:W};Y?await Se.updateEvent(r.id,me):await Se.createEvent({...me,calendar_id:T}),O(),j()}catch(te){Ve(te.error||"Failed to save event")}finally{ke(!1)}}},Q=async()=>{if(r){ke(!0);try{await Se.deleteEvent(r.id),O(),j()}catch(G){Ve(G.error||"Failed to delete event")}finally{ke(!1)}}},se=((ie=M.find(G=>G.id===T))==null?void 0:ie.color)||"#3B82F6";return i.jsx(qa,{open:f,onClose:j,title:Y?"Edit Event":"New Event",children:i.jsxs("form",{onSubmit:C,className:"space-y-4",children:[Qe&&i.jsx("div",{className:"text-sm text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 px-3 py-2 rounded-lg",children:Qe}),i.jsx("div",{children:i.jsx("input",{type:"text",placeholder:"Event title",value:B,onChange:G=>Z(G.target.value),className:"w-full text-lg font-medium bg-transparent border-0 border-b-2 border-gray-200 dark:border-gray-600 focus:border-blue-500 dark:focus:border-blue-400 focus:ring-0 px-0 py-2 text-gray-900 dark:text-white placeholder-gray-400 outline-none transition-colors",autoFocus:!0,required:!0})}),!Y&&i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Calendar"}),i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-3 h-3 rounded-full",style:{backgroundColor:se}}),i.jsx("select",{value:T,onChange:G=>U(G.target.value),className:"w-full pl-8 pr-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",children:R.map(G=>i.jsx("option",{value:G.id,children:G.name},G.id))})]})]}),i.jsx("div",{className:"flex items-center gap-3",children:i.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-700 dark:text-gray-300 cursor-pointer",children:[i.jsx("input",{type:"checkbox",checked:W,onChange:G=>Ae(G.target.checked),className:"rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"}),"All day"]})}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Start"}),i.jsx("input",{type:"date",value:J,onChange:G=>{P(G.target.value),G.target.value>xe&&ge(G.target.value)},className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",required:!0}),!W&&i.jsx("input",{type:"time",value:ee,onChange:G=>$(G.target.value),className:"w-full mt-2 px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",required:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"End"}),i.jsx("input",{type:"date",value:xe,onChange:G=>ge(G.target.value),min:J,className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",required:!0}),!W&&i.jsx("input",{type:"time",value:Ne,onChange:G=>Te(G.target.value),className:"w-full mt-2 px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",required:!0})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Location"}),i.jsx("input",{type:"text",placeholder:"Add location",value:D,onChange:G=>w(G.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none placeholder-gray-400"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Description"}),i.jsx("textarea",{placeholder:"Add description",value:A,onChange:G=>k(G.target.value),rows:3,className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none resize-none placeholder-gray-400"})]}),i.jsxs("div",{className:"flex items-center justify-between pt-2",children:[i.jsxs("div",{children:[Y&&!Re&&i.jsx("button",{type:"button",onClick:()=>b(!0),className:"text-sm text-red-500 hover:text-red-700 dark:hover:text-red-400 transition-colors",children:"Delete event"}),Y&&Re&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm text-red-500",children:"Delete?"}),i.jsx("button",{type:"button",onClick:Q,className:"text-sm text-white bg-red-500 hover:bg-red-600 px-3 py-1 rounded-lg transition-colors",disabled:He,children:"Yes"}),i.jsx("button",{type:"button",onClick:()=>b(!1),className:"text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 transition-colors",children:"No"})]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{type:"button",onClick:j,className:"px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:"Cancel"}),i.jsx("button",{type:"submit",disabled:He||!B.trim(),className:"px-4 py-2 text-sm text-white bg-blue-600 hover:bg-blue-700 disabled:opacity-50 rounded-lg transition-colors font-medium",children:He?"Saving...":Y?"Update":"Create"})]})]})]})})}const li=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#06B6D4","#F97316","#6366F1","#14B8A6","#84CC16","#A855F7"];function Ig(f){navigator.clipboard.writeText(f)}function Pg({open:f,onClose:j,onSaved:O,calendar:r}){const M=!!r,[_,H]=N.useState(""),[Y,R]=N.useState(li[0]),[B,Z]=N.useState(!0),[A,k]=N.useState(10),[D,w]=N.useState(0),[T,U]=N.useState(!1),[J,P]=N.useState(""),[ee,$]=N.useState(!1),[xe,ge]=N.useState([]),[Ne,Te]=N.useState(!1),[W,Ae]=N.useState(""),[He,ke]=N.useState(!1),[Qe,Ve]=N.useState(null),[Re,b]=N.useState(!1),C=N.useCallback(async()=>{if(r!=null&&r.id){Te(!0);try{const E=await Se.listSubscriptions(r.id);ge(E.items||[])}catch{ge([])}finally{Te(!1)}}},[r==null?void 0:r.id]);N.useEffect(()=>{f&&(P(""),$(!1),Ae(""),r?(H(r.name),R(r.color),Z(r.count_for_availability??!0),k(r.default_reminder_minutes??10),w(r.sort_order??0),C()):(H(""),R(li[Math.floor(Math.random()*li.length)]),Z(!0),k(10),w(0),ge([])))},[f,r,C]);const Q=async E=>{if(E.preventDefault(),!!_.trim()){U(!0),P("");try{M?await Se.updateCalendar(r.id,{name:_.trim(),color:Y,count_for_availability:B,default_reminder_minutes:A===""?void 0:A,sort_order:D===""?void 0:D}):await Se.createCalendar({name:_.trim(),color:Y}),O(),j()}catch(me){P(me.error||"Failed to save calendar")}finally{U(!1)}}},se=async()=>{if(r){U(!0);try{await Se.deleteCalendar(r.id),O(),j()}catch(E){P(E.error||"Failed to delete calendar")}finally{U(!1)}}},ie=async E=>{if(E.preventDefault(),!(!(r!=null&&r.id)||!W.trim())){ke(!0);try{await Se.addSubscription(r.id,{url:W.trim()}),Ae(""),C(),O()}catch(me){P(me.error||"Failed to add subscription")}finally{ke(!1)}}},G=async E=>{if(r!=null&&r.id)try{await Se.deleteSubscription(r.id,E),C(),O()}catch(me){P(me.error||"Failed to remove subscription")}},te=async E=>{if(r!=null&&r.id){Ve(E);try{await Se.syncSubscription(r.id,E),C(),O()}catch(me){P(me.error||"Failed to sync")}finally{Ve(null)}}},z=E=>{Ig(E),b(!0),setTimeout(()=>b(!1),1500)};return i.jsx(qa,{open:f,onClose:j,title:M?"Edit Calendar":"New Calendar",children:i.jsxs("form",{onSubmit:Q,className:"space-y-5",children:[J&&i.jsx("div",{className:"text-sm text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 px-3 py-2 rounded-lg",children:J}),i.jsx("div",{children:i.jsx("input",{type:"text",placeholder:"Calendar name",value:_,onChange:E=>H(E.target.value),className:"w-full text-lg font-medium bg-transparent border-0 border-b-2 border-gray-200 dark:border-gray-600 focus:border-blue-500 dark:focus:border-blue-400 focus:ring-0 px-0 py-2 text-gray-900 dark:text-white placeholder-gray-400 outline-none transition-colors",autoFocus:!0,required:!0,maxLength:80})}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-2",children:"Color"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:li.map(E=>i.jsx("button",{type:"button",onClick:()=>R(E),className:`w-8 h-8 rounded-full transition-all ${Y===E?"ring-2 ring-offset-2 ring-offset-white dark:ring-offset-gray-800 scale-110":"hover:scale-110"}`,style:{backgroundColor:E,outlineColor:Y===E?E:void 0}},E))})]}),M&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"checkbox",id:"count_for_availability",checked:B,onChange:E=>Z(E.target.checked),className:"rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"}),i.jsx("label",{htmlFor:"count_for_availability",className:"text-sm text-gray-700 dark:text-gray-300",children:"Include in availability / Count as busy"})]}),(r==null?void 0:r.availability_url)&&i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Availability URL"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",readOnly:!0,value:r.availability_url,className:"flex-1 px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 text-sm text-gray-600 dark:text-gray-400 truncate"}),i.jsx("button",{type:"button",onClick:()=>z(r.availability_url),className:"px-3 py-2 text-sm text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-colors",children:Re?"Copied!":"Copy"})]}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Share with Calendly, Cal.com, etc. to block busy times"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Default reminder (min)"}),i.jsx("input",{type:"number",min:0,max:10080,value:A,onChange:E=>k(E.target.value===""?"":parseInt(E.target.value,10)||0),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Sort order"}),i.jsx("input",{type:"number",value:D,onChange:E=>w(E.target.value===""?"":parseInt(E.target.value,10)||0),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]})]}),(r==null?void 0:r.role)==="owner"||(r==null?void 0:r.role)==="editor"?i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-2",children:"Subscribed URLs"}),Ne?i.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Loading..."}):xe.length===0?i.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"No subscriptions. Add a URL to import events from an external calendar."}):i.jsx("ul",{className:"space-y-2 mb-2",children:xe.map(E=>i.jsxs("li",{className:"flex items-center justify-between gap-2 p-2 rounded-lg bg-gray-50 dark:bg-gray-800 text-sm",children:[i.jsx("span",{className:"truncate text-gray-700 dark:text-gray-300",title:E.source_url,children:E.source_url}),i.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[i.jsx("button",{type:"button",onClick:()=>te(E.id),disabled:Qe===E.id,className:"px-2 py-1 text-xs text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded transition-colors disabled:opacity-50",children:Qe===E.id?"Syncing...":"Sync"}),i.jsx("button",{type:"button",onClick:()=>G(E.id),className:"px-2 py-1 text-xs text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 rounded transition-colors",children:"Remove"})]})]},E.id))}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"url",placeholder:"https://... or webcal://...",value:W,onChange:E=>Ae(E.target.value),onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),ie(E))},className:"flex-1 px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none placeholder-gray-400"}),i.jsx("button",{type:"button",onClick:ie,disabled:He||!W.trim(),className:"px-3 py-2 text-sm text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-colors font-medium disabled:opacity-50",children:He?"Adding...":"Add"})]})]}):null]}),i.jsxs("div",{className:"flex items-center justify-between pt-2",children:[i.jsxs("div",{children:[M&&(r==null?void 0:r.role)==="owner"&&!ee&&i.jsx("button",{type:"button",onClick:()=>$(!0),className:"text-sm text-red-500 hover:text-red-700 dark:hover:text-red-400 transition-colors",children:"Delete calendar"}),M&&ee&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm text-red-500",children:"Delete?"}),i.jsx("button",{type:"button",onClick:se,className:"text-sm text-white bg-red-500 hover:bg-red-600 px-3 py-1 rounded-lg transition-colors",disabled:T,children:"Yes"}),i.jsx("button",{type:"button",onClick:()=>$(!1),className:"text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 transition-colors",children:"No"})]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{type:"button",onClick:j,className:"px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:"Cancel"}),i.jsx("button",{type:"submit",disabled:T||!_.trim(),className:"px-4 py-2 text-sm text-white bg-blue-600 hover:bg-blue-700 disabled:opacity-50 rounded-lg transition-colors font-medium",children:T?"Saving...":M?"Update":"Create"})]})]})]})})}function eh({open:f,onClose:j,onSaved:O,targetCalendarId:r,calendars:M}){var ee;const _=!r,[H,Y]=N.useState(""),[R,B]=N.useState(""),[Z,A]=N.useState("#3B82F6"),[k,D]=N.useState(r||((ee=M[0])==null?void 0:ee.id)||""),[w,T]=N.useState(!1),[U,J]=N.useState(""),P=async $=>{if($.preventDefault(),!!H.trim()){T(!0),J("");try{_?await Se.addCalendarFromUrl({url:H.trim(),name:R.trim()||void 0,color:Z||void 0}):await Se.importCalendarUrl({calendar_id:k,url:H.trim()}),O(),j(),Y(""),B("")}catch(xe){J(xe.error||"Failed to add calendar")}finally{T(!1)}}};return i.jsx(qa,{open:f,onClose:j,title:_?"Add calendar from URL":"Import from URL",children:i.jsxs("form",{onSubmit:P,className:"space-y-4",children:[U&&i.jsx("div",{className:"text-sm text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 px-3 py-2 rounded-lg break-words",children:U}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Calendar URL"}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1.5",children:'Google Calendar: Settings → your calendar → Integrate calendar → copy "Secret address in iCal format"'}),i.jsx("input",{type:"text",placeholder:"https://... or webcal://...",value:H,onChange:$=>Y($.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none placeholder-gray-400",required:!0})]}),_&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Calendar name"}),i.jsx("input",{type:"text",placeholder:"Imported Calendar",value:R,onChange:$=>B($.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none placeholder-gray-400"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Color"}),i.jsx("input",{type:"color",value:Z,onChange:$=>A($.target.value),className:"w-full h-10 rounded-lg border border-gray-200 dark:border-gray-600 cursor-pointer"})]})]}),!_&&M.length>1&&i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Import into"}),i.jsx("select",{value:k,onChange:$=>D($.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",children:M.map($=>i.jsx("option",{value:$.id,children:$.name},$.id))})]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[i.jsx("button",{type:"button",onClick:j,className:"px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:"Cancel"}),i.jsx("button",{type:"submit",disabled:w||!H.trim(),className:"px-4 py-2 text-sm text-white bg-blue-600 hover:bg-blue-700 disabled:opacity-50 rounded-lg transition-colors font-medium",children:w?"Adding...":_?"Create calendar":"Import"})]})]})})}function th({selectedDate:f,onDateSelect:j}){const[O,r]=N.useState(f),M=Us(O),_=Hs(O),H=Ba(M),Y=Un(_),R=J0({start:H,end:Y});return i.jsxs("div",{className:"select-none",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("button",{onClick:()=>r(B=>I0(B)),className:"p-1 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-500 dark:text-gray-400 transition-colors",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),i.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:Oe(O,"MMMM yyyy")}),i.jsx("button",{onClick:()=>r(B=>P0(B,1)),className:"p-1 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-500 dark:text-gray-400 transition-colors",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]}),i.jsxs("div",{className:"grid grid-cols-7 gap-0",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(B=>i.jsx("div",{className:"text-center text-[10px] font-medium text-gray-400 dark:text-gray-500 py-1",children:B},B)),R.map(B=>{const Z=W0(B,O),A=_l(B,f),k=ui(B);return i.jsx("button",{onClick:()=>j(B),className:`text-[11px] w-7 h-7 rounded-full flex items-center justify-center mx-auto transition-colors - ${Z?"text-gray-700 dark:text-gray-300":"text-gray-300 dark:text-gray-600"} - ${A?"bg-blue-600 text-white! font-semibold":""} - ${k&&!A?"bg-blue-100 dark:bg-blue-900/40 text-blue-600 dark:text-blue-400 font-semibold":""} - ${A?"":"hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:Oe(B,"d")},B.toISOString())})]})]})}function lh(){var ul,qt,Ct;const{user:f,logout:j}=Ya(),{theme:O,toggle:r}=ii(),[M,_]=N.useState(new Date),[H,Y]=N.useState("month"),[R,B]=N.useState([]),[Z,A]=N.useState([]),[k,D]=N.useState(new Set),[w,T]=N.useState(!0),[U,J]=N.useState(!1),[P,ee]=N.useState(!1),[$,xe]=N.useState(!1),[ge,Ne]=N.useState(null),[Te,W]=N.useState(null),[Ae,He]=N.useState(),[ke,Qe]=N.useState(!1),[Ve,Re]=N.useState(!0),b=N.useCallback(async()=>{try{const ze=(await Se.listCalendars()).items||[];B(ze),D(Pe=>{if(Pe.size===0)return new Set(ze.map(lt=>lt.id));const Yt=new Set(Pe);for(const lt of ze)Pe.has(lt.id)||Yt.add(lt.id);return Yt})}catch{}},[]),C=N.useCallback(async()=>{const V=H==="month"?Ba(Us(M)):H==="week"?Ba(M):M,ze=H==="month"?Un(Hs(M)):H==="week"?Un(M):M,Pe=new Date(V);Pe.setDate(Pe.getDate()-1);const Yt=new Date(ze);Yt.setDate(Yt.getDate()+1);try{const lt=await Se.listEvents({start:Pe.toISOString(),end:Yt.toISOString()});A(lt.items||[])}catch{}Re(!1)},[M,H]);N.useEffect(()=>{b()},[b]),N.useEffect(()=>{R.length>0&&C()},[C,R]);const Q=V=>{_(H==="month"?ze=>V===1?P0(ze,1):I0(ze):H==="week"?ze=>V===1?Cg(ze,1):_g(ze):ze=>V===1?$0(ze,1):Dg(ze))},se=()=>_(new Date),ie=V=>{D(ze=>{const Pe=new Set(ze);return Pe.has(V)?Pe.delete(V):Pe.add(V),Pe})},G=V=>{H==="month"?(_(V),Y("day")):(He(V),Ne(null),J(!0))},te=V=>{He(V),Ne(null),J(!0)},z=V=>{Ne(V),J(!0)},E=()=>{C()},me=()=>{b().then(C)},Ke=H==="month"?Oe(M,"MMMM yyyy"):H==="week"?`${Oe(Ba(M),"MMM d")} - ${Oe(Un(M),"MMM d, yyyy")}`:Oe(M,"EEEE, MMMM d, yyyy");return i.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-gray-900 transition-colors",children:[i.jsxs("header",{className:"flex items-center justify-between px-4 py-2.5 border-b border-gray-200 dark:border-gray-700 flex-shrink-0 bg-white dark:bg-gray-900",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{onClick:()=>T(V=>!V),className:"p-2 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-600 dark:text-gray-400 transition-colors lg:hidden",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),i.jsx("button",{onClick:()=>T(V=>!V),className:"p-2 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-600 dark:text-gray-400 transition-colors hidden lg:block",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:i.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),i.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white hidden sm:block",children:"Calendar"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:se,className:"px-3 py-1.5 text-sm font-medium border border-gray-300 dark:border-gray-600 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",children:"Today"}),i.jsxs("div",{className:"flex items-center",children:[i.jsx("button",{onClick:()=>Q(-1),className:"p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-600 dark:text-gray-400 transition-colors",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),i.jsx("button",{onClick:()=>Q(1),className:"p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-600 dark:text-gray-400 transition-colors",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]}),i.jsx("h2",{className:"text-base font-semibold text-gray-900 dark:text-white min-w-[180px] text-center hidden sm:block",children:Ke})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"hidden sm:flex items-center bg-gray-100 dark:bg-gray-800 rounded-lg p-0.5",children:["month","week","day"].map(V=>i.jsx("button",{onClick:()=>Y(V),className:`px-3 py-1 text-xs font-medium rounded-md transition-colors capitalize ${H===V?"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white"}`,children:V},V))}),i.jsx("button",{onClick:r,className:"p-2 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-600 dark:text-gray-400 transition-colors",children:O==="dark"?i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})}),i.jsxs("div",{className:"relative",children:[i.jsx("button",{onClick:()=>Qe(V=>!V),className:"w-8 h-8 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white text-sm font-semibold",children:((qt=(ul=f==null?void 0:f.email)==null?void 0:ul[0])==null?void 0:qt.toUpperCase())||"U"}),ke&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>Qe(!1)}),i.jsxs("div",{className:"absolute right-0 mt-2 w-56 bg-white dark:bg-gray-800 rounded-xl shadow-lg border border-gray-200 dark:border-gray-700 py-1 z-50 animate-scale-in",children:[i.jsxs("div",{className:"px-4 py-2.5 border-b border-gray-100 dark:border-gray-700",children:[i.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white truncate",children:f==null?void 0:f.email}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:f==null?void 0:f.timezone})]}),i.jsx("button",{onClick:()=>{Qe(!1),j()},className:"w-full text-left px-4 py-2 text-sm text-red-600 dark:text-red-400 hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors",children:"Sign out"})]})]})]})]})]}),i.jsxs("div",{className:"sm:hidden text-center py-2 border-b border-gray-100 dark:border-gray-800 flex-shrink-0",children:[i.jsx("span",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:Ke}),i.jsx("div",{className:"flex items-center justify-center gap-1 mt-1",children:["month","week","day"].map(V=>i.jsx("button",{onClick:()=>Y(V),className:`px-2.5 py-0.5 text-xs font-medium rounded-md transition-colors capitalize ${H===V?"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400":"text-gray-500 dark:text-gray-400"}`,children:V},V))})]}),i.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[w&&i.jsxs("aside",{className:"w-64 border-r border-gray-200 dark:border-gray-700 flex-shrink-0 overflow-y-auto bg-white dark:bg-gray-900 flex flex-col",children:[i.jsx("div",{className:"p-4",children:i.jsxs("button",{onClick:()=>{Ne(null),He(new Date),J(!0)},className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium text-sm shadow-lg shadow-blue-600/20 transition-all hover:shadow-blue-600/30",children:[i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"New Event"]})}),i.jsx("div",{className:"px-4 pb-4",children:i.jsx(th,{selectedDate:M,onDateSelect:V=>_(V)})}),i.jsxs("div",{className:"px-4 pb-4 flex-1",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("h3",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"My Calendars"}),i.jsxs("div",{className:"flex gap-0.5",children:[i.jsx("button",{onClick:()=>xe(!0),className:"p-1 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",title:"Add from URL",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})})}),i.jsx("button",{onClick:()=>{W(null),ee(!0)},className:"p-1 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",title:"New calendar",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})})]})]}),i.jsx("div",{className:"space-y-0.5",children:R.map(V=>i.jsxs("div",{className:"flex items-center gap-2 py-1.5 px-1 rounded-lg group hover:bg-gray-50 dark:hover:bg-gray-800/50",children:[i.jsx("button",{onClick:()=>ie(V.id),className:"flex-shrink-0",children:i.jsx("div",{className:"w-4 h-4 rounded border-2 transition-colors flex items-center justify-center",style:{borderColor:V.color,backgroundColor:k.has(V.id)?V.color:"transparent"},children:k.has(V.id)&&i.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})})}),i.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 flex-1 truncate",children:V.name}),V.role==="owner"&&i.jsx("button",{onClick:()=>{W(V),ee(!0)},className:"p-0.5 rounded opacity-0 group-hover:opacity-100 hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-400 transition-all",children:i.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})})})]},V.id))})]})]}),i.jsx("main",{className:"flex-1 overflow-hidden",children:Ve?i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsx("div",{className:"w-8 h-8 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"})}):H==="month"?i.jsx(Jg,{currentDate:M,events:Z,calendars:R,visibleCalendarIds:k,onDateClick:G,onEventClick:z}):H==="week"?i.jsx(Wg,{currentDate:M,events:Z,calendars:R,visibleCalendarIds:k,onTimeClick:te,onEventClick:z}):i.jsx($g,{currentDate:M,events:Z,calendars:R,visibleCalendarIds:k,onTimeClick:te,onEventClick:z})})]}),i.jsx(Fg,{open:U,onClose:()=>J(!1),onSaved:E,event:ge,calendars:R,defaultDate:Ae,defaultCalendarId:(Ct=R.find(V=>V.role==="owner"))==null?void 0:Ct.id}),i.jsx(Pg,{open:P,onClose:()=>ee(!1),onSaved:me,calendar:Te}),i.jsx(eh,{open:$,onClose:()=>xe(!1),onSaved:me,targetCalendarId:null,calendars:R})]})}function ah(){const[f,j]=N.useState([]),[O,r]=N.useState(""),[M,_]=N.useState(!0),[H,Y]=N.useState(!1),[R,B]=N.useState(null),Z=N.useCallback(async()=>{try{const D=await Se.listContacts(O||void 0);j(D.items||[])}finally{_(!1)}},[O]);N.useEffect(()=>{Z()},[Z]);const A=()=>{B(null),Y(!0)},k=D=>{B(D),Y(!0)};return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:[i.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Contacts"}),i.jsxs("button",{onClick:A,className:"flex items-center gap-2 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-xl transition-colors",children:[i.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add contact"]})]}),i.jsx("div",{className:"px-6 py-3 border-b border-gray-100 dark:border-gray-700/50 flex-shrink-0",children:i.jsxs("div",{className:"relative",children:[i.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),i.jsx("input",{type:"text",placeholder:"Search contacts...",value:O,onChange:D=>r(D.target.value),className:"w-full pl-10 pr-4 py-2 rounded-xl border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]})}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:M?i.jsx("div",{className:"flex items-center justify-center h-40",children:i.jsx("div",{className:"w-6 h-6 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"})}):f.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-gray-400 dark:text-gray-500",children:[i.jsx("svg",{className:"w-12 h-12 mb-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})}),i.jsx("span",{className:"text-sm",children:"No contacts yet"})]}):i.jsx("div",{className:"divide-y divide-gray-100 dark:divide-gray-700/50",children:f.map(D=>{var w,T;return i.jsxs("button",{onClick:()=>k(D),className:"w-full flex items-center gap-4 px-6 py-3.5 hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors text-left",children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white font-semibold text-sm flex-shrink-0",children:(((w=D.first_name)==null?void 0:w[0])||((T=D.email)==null?void 0:T[0])||"?").toUpperCase()}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white truncate",children:[D.first_name,D.last_name].filter(Boolean).join(" ")||D.email||"Unnamed"}),i.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:[D.email,D.company].filter(Boolean).join(" - ")})]}),D.phone&&i.jsx("span",{className:"text-xs text-gray-400 dark:text-gray-500 flex-shrink-0",children:D.phone})]},D.id)})})}),i.jsx(nh,{open:H,onClose:()=>Y(!1),onSaved:Z,contact:R})]})}function nh({open:f,onClose:j,onSaved:O,contact:r}){const M=!!r,[_,H]=N.useState(""),[Y,R]=N.useState(""),[B,Z]=N.useState(""),[A,k]=N.useState(""),[D,w]=N.useState(""),[T,U]=N.useState(""),[J,P]=N.useState(!1),[ee,$]=N.useState(""),[xe,ge]=N.useState(!1);N.useEffect(()=>{f&&($(""),ge(!1),r?(H(r.first_name||""),R(r.last_name||""),Z(r.email||""),k(r.phone||""),w(r.company||""),U(r.notes||"")):(H(""),R(""),Z(""),k(""),w(""),U("")))},[f,r]);const Ne=async W=>{W.preventDefault(),P(!0),$("");try{const Ae={first_name:_.trim()||void 0,last_name:Y.trim()||void 0,email:B.trim()||void 0,phone:A.trim()||void 0,company:D.trim()||void 0,notes:T.trim()||void 0};M?await Se.updateContact(r.id,Ae):await Se.createContact(Ae),O(),j()}catch(Ae){$(Ae.error||"Failed to save contact")}finally{P(!1)}},Te=async()=>{if(r){P(!0);try{await Se.deleteContact(r.id),O(),j()}catch(W){$(W.error||"Failed to delete")}finally{P(!1)}}};return i.jsx(qa,{open:f,onClose:j,title:M?"Edit Contact":"New Contact",children:i.jsxs("form",{onSubmit:Ne,className:"space-y-4",children:[ee&&i.jsx("div",{className:"text-sm text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 px-3 py-2 rounded-lg",children:ee}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"First name"}),i.jsx("input",{type:"text",value:_,onChange:W=>H(W.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",autoFocus:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Last name"}),i.jsx("input",{type:"text",value:Y,onChange:W=>R(W.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Email"}),i.jsx("input",{type:"email",value:B,onChange:W=>Z(W.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Phone"}),i.jsx("input",{type:"tel",value:A,onChange:W=>k(W.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Company"}),i.jsx("input",{type:"text",value:D,onChange:W=>w(W.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Notes"}),i.jsx("textarea",{value:T,onChange:W=>U(W.target.value),rows:2,className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none resize-none"})]}),i.jsxs("div",{className:"flex items-center justify-between pt-2",children:[i.jsxs("div",{children:[M&&!xe&&i.jsx("button",{type:"button",onClick:()=>ge(!0),className:"text-sm text-red-500 hover:text-red-700 dark:hover:text-red-400 transition-colors",children:"Delete"}),M&&xe&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm text-red-500",children:"Delete?"}),i.jsx("button",{type:"button",onClick:Te,className:"text-sm text-white bg-red-500 hover:bg-red-600 px-3 py-1 rounded-lg transition-colors",disabled:J,children:"Yes"}),i.jsx("button",{type:"button",onClick:()=>ge(!1),className:"text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 transition-colors",children:"No"})]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{type:"button",onClick:j,className:"px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:"Cancel"}),i.jsx("button",{type:"submit",disabled:J,className:"px-4 py-2 text-sm text-white bg-blue-600 hover:bg-blue-700 disabled:opacity-50 rounded-lg transition-colors font-medium",children:J?"Saving...":M?"Update":"Create"})]})]})]})})}const uh=[{key:"calendars",label:"Calendars",permissions:["read","write"]},{key:"events",label:"Events",permissions:["read","write"]},{key:"contacts",label:"Contacts",permissions:["read","write"]},{key:"availability",label:"Availability",permissions:["read"]},{key:"booking",label:"Booking",permissions:["write"]}];function ih(){const{user:f,loading:j,refreshUser:O,logout:r}=Ya(),{theme:M,toggle:_}=ii(),H=Ds(),[Y,R]=N.useState("general"),[B,Z]=N.useState(!1),[A,k]=N.useState(""),[D,w]=N.useState({}),[T,U]=N.useState([]),[J,P]=N.useState(!1),[ee,$]=N.useState(!1),[xe,ge]=N.useState(""),[Ne,Te]=N.useState({calendars:["read","write"],events:["read","write"],contacts:["read","write"],availability:["read"],booking:["write"]}),[W,Ae]=N.useState(null),[He,ke]=N.useState(null),[Qe,Ve]=N.useState(""),[Re,b]=N.useState(!1);N.useEffect(()=>{f&&w({timezone:f.timezone,week_start_day:f.week_start_day,date_format:f.date_format,time_format:f.time_format,default_event_duration_minutes:f.default_event_duration_minutes,default_reminder_minutes:f.default_reminder_minutes,show_weekends:f.show_weekends,working_hours_start:f.working_hours_start,working_hours_end:f.working_hours_end,notifications_email:f.notifications_email})},[f]),N.useEffect(()=>{Y==="api-keys"&&(P(!0),Se.listApiKeys().then(z=>U(z.items)).catch(()=>k("Failed to load API keys")).finally(()=>P(!1)))},[Y]);const C=async()=>{Z(!0),k("");try{const z=await Se.updateMe(D);await O(),k("Settings saved"),setTimeout(()=>k(""),2e3)}catch(z){k(z.error||"Failed to save")}finally{Z(!1)}},Q=async()=>{if(!xe.trim()){k("Name is required");return}Z(!0),k("");try{const z=await Se.createApiKey({name:xe.trim(),scopes:Ne});Ae(z),U(E=>[z,...E]),$(!1),ge("")}catch(z){k(z.error||"Failed to create API key")}finally{Z(!1)}},se=async z=>{ke(z);try{await Se.revokeApiKey(z),U(E=>E.map(me=>me.id===z?{...me,revoked_at:new Date().toISOString()}:me))}catch(E){k(E.error||"Failed to revoke")}finally{ke(null)}},ie=async()=>{if(Qe==="delete"){b(!0),k("");try{await Se.deleteMe(),await r(),H("/login")}catch(z){k(z.error||"Failed to delete account")}finally{b(!1)}}},G=()=>{W!=null&&W.token&&(navigator.clipboard.writeText(W.token),k("Token copied to clipboard"),setTimeout(()=>k(""),2e3))};if(j||!f)return null;const te=[{id:"general",label:"General"},{id:"calendars",label:"Calendars"},{id:"notifications",label:"Notifications"},{id:"api-keys",label:"API Keys"},{id:"account",label:"Account"}];return i.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:[i.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Settings"}),i.jsx("button",{onClick:_,className:"p-2 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400 transition-colors",children:M==="dark"?i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})})]}),i.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[i.jsx("nav",{className:"w-48 border-r border-gray-200 dark:border-gray-700 p-4 flex-shrink-0",children:te.map(z=>i.jsx("button",{onClick:()=>R(z.id),className:`block w-full text-left px-3 py-2 rounded-lg text-sm font-medium transition-colors ${Y===z.id?"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400":"text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800"}`,children:z.label},z.id))}),i.jsxs("main",{className:"flex-1 overflow-y-auto p-6",children:[A&&i.jsx("div",{className:`mb-4 px-4 py-2 rounded-lg text-sm ${A==="Settings saved"||A==="Token copied to clipboard"?"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-400":"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400"}`,children:A}),Y==="general"&&i.jsxs("div",{className:"space-y-6 max-w-xl",children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"General"}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Timezone"}),i.jsx("input",{type:"text",value:D.timezone||"",onChange:z=>w(E=>({...E,timezone:z.target.value})),placeholder:"America/New_York",className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Week starts on"}),i.jsxs("select",{value:D.week_start_day??0,onChange:z=>w(E=>({...E,week_start_day:parseInt(z.target.value,10)})),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",children:[i.jsx("option",{value:0,children:"Sunday"}),i.jsx("option",{value:1,children:"Monday"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Date format"}),i.jsxs("select",{value:D.date_format||"MM/dd/yyyy",onChange:z=>w(E=>({...E,date_format:z.target.value})),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",children:[i.jsx("option",{value:"MM/dd/yyyy",children:"MM/DD/YYYY"}),i.jsx("option",{value:"dd/MM/yyyy",children:"DD/MM/YYYY"}),i.jsx("option",{value:"yyyy-MM-dd",children:"YYYY-MM-DD"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Time format"}),i.jsxs("select",{value:D.time_format||"12h",onChange:z=>w(E=>({...E,time_format:z.target.value})),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",children:[i.jsx("option",{value:"12h",children:"12-hour"}),i.jsx("option",{value:"24h",children:"24-hour"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Default event duration (minutes)"}),i.jsx("input",{type:"number",min:15,max:480,value:D.default_event_duration_minutes??60,onChange:z=>w(E=>({...E,default_event_duration_minutes:parseInt(z.target.value,10)||60})),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Default reminder (minutes before)"}),i.jsx("input",{type:"number",min:0,max:10080,value:D.default_reminder_minutes??10,onChange:z=>w(E=>({...E,default_reminder_minutes:parseInt(z.target.value,10)||10})),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"checkbox",id:"show_weekends",checked:D.show_weekends??!0,onChange:z=>w(E=>({...E,show_weekends:z.target.checked})),className:"rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"}),i.jsx("label",{htmlFor:"show_weekends",className:"text-sm text-gray-700 dark:text-gray-300",children:"Show weekends"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Working hours start"}),i.jsx("input",{type:"time",value:D.working_hours_start||"09:00",onChange:z=>w(E=>({...E,working_hours_start:z.target.value})),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Working hours end"}),i.jsx("input",{type:"time",value:D.working_hours_end||"17:00",onChange:z=>w(E=>({...E,working_hours_end:z.target.value})),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]})]})]}),Y==="calendars"&&i.jsxs("div",{className:"space-y-4",children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Calendars"}),i.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Manage your calendars from the main calendar view. Use the sidebar to add new calendars or add from URL."})]}),Y==="notifications"&&i.jsxs("div",{className:"space-y-6 max-w-xl",children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Notifications"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"checkbox",id:"notifications_email",checked:D.notifications_email??!0,onChange:z=>w(E=>({...E,notifications_email:z.target.checked})),className:"rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"}),i.jsx("label",{htmlFor:"notifications_email",className:"text-sm text-gray-700 dark:text-gray-300",children:"Email reminders for events"})]})]}),Y==="api-keys"&&i.jsxs("div",{className:"space-y-6 max-w-2xl",children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"API Keys"}),i.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"API keys allow programmatic access to your calendar. Use them for integrations, scripts, or AI agents. Keep keys secure and never share them."}),i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:[T.length," key",T.length!==1?"s":""]}),i.jsx("button",{onClick:()=>{$(!0),Ae(null),k("")},className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-lg transition-colors",children:"Create API key"})]}),J?i.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[i.jsx("span",{className:"w-4 h-4 border-2 border-gray-400 border-t-transparent rounded-full animate-spin"}),"Loading..."]}):i.jsx("div",{className:"space-y-6 max-w-2xl",children:T.length===0?i.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 py-4",children:"No API keys yet. Create one to get started."}):i.jsx("ul",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:T.map(z=>i.jsxs("li",{className:"py-4 flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"font-medium text-gray-900 dark:text-white truncate",children:z.name}),i.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:["Created ",new Date(z.created_at).toLocaleDateString(),z.revoked_at&&i.jsx("span",{className:"ml-2 text-amber-600 dark:text-amber-400",children:"• Revoked"})]})]}),!z.revoked_at&&i.jsx("button",{onClick:()=>se(z.id),disabled:He===z.id,className:"px-3 py-1.5 text-sm text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors disabled:opacity-50",children:He===z.id?"Revoking...":"Revoke"})]},z.id))})})]}),Y==="account"&&i.jsxs("div",{className:"space-y-6 max-w-xl",children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Account"}),i.jsxs("div",{className:"rounded-lg border border-gray-200 dark:border-gray-600 p-4 dark:bg-gray-800/50",children:[i.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-2",children:["Signed in as ",i.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:f.email})]}),i.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:["Account created ",new Date(f.created_at).toLocaleDateString()]})]}),i.jsxs("div",{className:"pt-6 border-t border-gray-200 dark:border-gray-700",children:[i.jsx("h3",{className:"text-sm font-medium text-red-600 dark:text-red-400 mb-2",children:"Danger zone"}),i.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:"Deleting your account will permanently remove all your calendars, events, contacts, and revoke all API keys. This action cannot be undone."}),i.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[i.jsxs("div",{className:"flex-1 min-w-[200px]",children:[i.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Type ",i.jsx("span",{className:"font-mono text-red-600 dark:text-red-400",children:"delete"})," to confirm"]}),i.jsx("input",{type:"text",value:Qe,onChange:z=>Ve(z.target.value),placeholder:"delete",className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-red-500 outline-none placeholder:text-gray-400"})]}),i.jsx("button",{onClick:ie,disabled:Qe!=="delete"||Re,className:"px-4 py-2 bg-red-600 hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed text-white text-sm font-medium rounded-lg transition-colors",children:Re?"Deleting...":"Delete account"})]})]})]}),(Y==="general"||Y==="notifications")&&i.jsx("div",{className:"mt-8",children:i.jsx("button",{onClick:C,disabled:B,className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 disabled:opacity-50 text-white text-sm font-medium rounded-lg transition-colors",children:B?"Saving...":"Save changes"})})]})]}),i.jsx(qa,{open:ee,onClose:()=>{$(!1),ge("")},title:"Create API key",wide:!0,children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Name"}),i.jsx("input",{type:"text",value:xe,onChange:z=>ge(z.target.value),placeholder:"e.g. My integration",className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Scopes"}),i.jsx("div",{className:"space-y-3",children:uh.map(({key:z,label:E,permissions:me})=>i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("span",{className:"w-28 text-sm text-gray-600 dark:text-gray-400",children:E}),i.jsx("div",{className:"flex gap-4",children:me.map(Ke=>{const qt=(Ne[z]||[]).includes(Ke);return i.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[i.jsx("input",{type:"checkbox",checked:qt,onChange:Ct=>{const V=Ct.target.checked?[...Ne[z]||[],Ke]:(Ne[z]||[]).filter(ze=>ze!==Ke);Te(ze=>({...ze,[z]:V}))},className:"rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"}),i.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 capitalize",children:Ke})]},Ke)})})]},z))})]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[i.jsx("button",{onClick:()=>$(!1),className:"px-4 py-2 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:"Cancel"}),i.jsx("button",{onClick:Q,disabled:B||!xe.trim(),className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 disabled:opacity-50 text-white text-sm font-medium rounded-lg transition-colors",children:B?"Creating...":"Create"})]})]})}),i.jsx(qa,{open:!!(W!=null&&W.token),onClose:()=>Ae(null),title:"API key created",children:i.jsxs("div",{className:"space-y-4",children:[i.jsx("p",{className:"text-sm text-amber-600 dark:text-amber-400",children:"Copy this token now. It will not be shown again."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",readOnly:!0,value:(W==null?void 0:W.token)||"",className:"flex-1 px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-100 dark:bg-gray-700 text-sm font-mono text-gray-900 dark:text-white"}),i.jsx("button",{onClick:G,className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-lg transition-colors",children:"Copy"})]}),i.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:["Use in requests: ",i.jsx("code",{className:"bg-gray-100 dark:bg-gray-700 px-1 rounded",children:"X-API-Key: "})]}),i.jsx("div",{className:"flex justify-end",children:i.jsx("button",{onClick:()=>Ae(null),className:"px-4 py-2 bg-gray-200 dark:bg-gray-600 hover:bg-gray-300 dark:hover:bg-gray-500 text-gray-900 dark:text-white text-sm font-medium rounded-lg transition-colors",children:"Done"})})]})})]})}function ch(){const{user:f,loading:j}=Ya();return j?i.jsx("div",{className:"h-screen flex items-center justify-center bg-white dark:bg-gray-900",children:i.jsx("div",{className:"w-8 h-8 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"})}):f?i.jsx(ws,{}):i.jsx(Os,{to:"/login",replace:!0})}function sh(){const{user:f,loading:j}=Ya();return j?i.jsx("div",{className:"h-screen flex items-center justify-center bg-white dark:bg-gray-900",children:i.jsx("div",{className:"w-8 h-8 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"})}):f?i.jsx(Os,{to:"/",replace:!0}):i.jsx(ws,{})}function rh(){return i.jsxs("div",{className:"h-screen flex bg-white dark:bg-gray-900 transition-colors",children:[i.jsxs("nav",{className:"w-14 flex-shrink-0 flex flex-col items-center py-4 gap-1 border-r border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900",children:[i.jsx(ks,{to:"/",end:!0,className:({isActive:f})=>`p-2.5 rounded-xl transition-colors ${f?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-300"}`,title:"Calendar",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),i.jsx(ks,{to:"/contacts",className:({isActive:f})=>`p-2.5 rounded-xl transition-colors ${f?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-300"}`,title:"Contacts",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})})}),i.jsx(ks,{to:"/settings",className:({isActive:f})=>`p-2.5 rounded-xl transition-colors ${f?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-300"}`,title:"Settings",children:i.jsxs("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})})]}),i.jsx("div",{className:"flex-1 overflow-hidden",children:i.jsx(ws,{})})]})}function fh(){return i.jsxs(Tg,{children:[i.jsxs(nl,{element:i.jsx(sh,{}),children:[i.jsx(nl,{path:"/login",element:i.jsx(Vg,{})}),i.jsx(nl,{path:"/register",element:i.jsx(Kg,{})})]}),i.jsx(nl,{element:i.jsx(ch,{}),children:i.jsxs(nl,{element:i.jsx(rh,{}),children:[i.jsx(nl,{path:"/",element:i.jsx(lh,{})}),i.jsx(nl,{path:"/contacts",element:i.jsx(ah,{})}),i.jsx(nl,{path:"/settings",element:i.jsx(ih,{})})]})}),i.jsx(nl,{path:"*",element:i.jsx(Os,{to:"/",replace:!0})})]})}Yg.createRoot(document.getElementById("root")).render(i.jsx(N.StrictMode,{children:i.jsx(Zg,{children:i.jsx(Ag,{children:i.jsx(Xg,{children:i.jsx(Gg,{children:i.jsx(fh,{})})})})})})); diff --git a/frontend/dist/assets/index-DXAGcZdG.js b/frontend/dist/assets/index-DXAGcZdG.js new file mode 100644 index 0000000..9bbdb51 --- /dev/null +++ b/frontend/dist/assets/index-DXAGcZdG.js @@ -0,0 +1,43 @@ +import{r as Mm,a as Em,b as v,u as _s,L as J0,R as Cm,c as qt,N as ws,O as Os,d as ei,B as Am}from"./vendor-BI0H_s0W.js";import{s as Us,e as Hs,a as qa,b as Un,c as W0,i as $0,d as ii,f as _e,p as tt,g as Dl,h as F0,j as I0,k as ni,l as P0,m as ef,n as Dm,o as _m,q as wm}from"./date-huy51PAD.js";(function(){const x=document.createElement("link").relList;if(x&&x.supports&&x.supports("modulepreload"))return;for(const T of document.querySelectorAll('link[rel="modulepreload"]'))d(T);new MutationObserver(T=>{for(const C of T)if(C.type==="childList")for(const H of C.addedNodes)H.tagName==="LINK"&&H.rel==="modulepreload"&&d(H)}).observe(document,{childList:!0,subtree:!0});function w(T){const C={};return T.integrity&&(C.integrity=T.integrity),T.referrerPolicy&&(C.referrerPolicy=T.referrerPolicy),T.crossOrigin==="use-credentials"?C.credentials="include":T.crossOrigin==="anonymous"?C.credentials="omit":C.credentials="same-origin",C}function d(T){if(T.ep)return;T.ep=!0;const C=w(T);fetch(T.href,C)}})();var zs={exports:{}},wn={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var q0;function Om(){if(q0)return wn;q0=1;var r=Symbol.for("react.transitional.element"),x=Symbol.for("react.fragment");function w(d,T,C){var H=null;if(C!==void 0&&(H=""+C),T.key!==void 0&&(H=""+T.key),"key"in T){C={};for(var q in T)q!=="key"&&(C[q]=T[q])}else C=T;return T=C.ref,{$$typeof:r,type:d,key:H,ref:T!==void 0?T:null,props:C}}return wn.Fragment=x,wn.jsx=w,wn.jsxs=w,wn}var Y0;function Um(){return Y0||(Y0=1,zs.exports=Om()),zs.exports}var i=Um(),Ts={exports:{}},On={},Ms={exports:{}},Es={};/** + * @license React + * scheduler.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var L0;function Hm(){return L0||(L0=1,(function(r){function x(p,O){var V=p.length;p.push(O);e:for(;0>>1,oe=p[me];if(0>>1;meT(M,V))AT(ve,M)?(p[me]=ve,p[A]=V,me=A):(p[me]=M,p[ne]=V,me=ne);else if(AT(ve,V))p[me]=ve,p[A]=V,me=A;else break e}}return O}function T(p,O){var V=p.sortIndex-O.sortIndex;return V!==0?V:p.id-O.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var C=performance;r.unstable_now=function(){return C.now()}}else{var H=Date,q=H.now();r.unstable_now=function(){return H.now()-q}}var Y=[],B=[],R=1,D=null,j=3,U=!1,E=!1,z=!1,_=!1,X=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,te=typeof setImmediate<"u"?setImmediate:null;function J(p){for(var O=w(B);O!==null;){if(O.callback===null)d(B);else if(O.startTime<=p)d(B),O.sortIndex=O.expirationTime,x(Y,O);else break;O=w(B)}}function ge(p){if(z=!1,J(p),!E)if(w(Y)!==null)E=!0,ce||(ce=!0,pe());else{var O=w(B);O!==null&&Re(ge,O.startTime-p)}}var ce=!1,be=-1,P=5,Z=-1;function Ne(){return _?!0:!(r.unstable_now()-Zp&&Ne());){var me=D.callback;if(typeof me=="function"){D.callback=null,j=D.priorityLevel;var oe=me(D.expirationTime<=p);if(p=r.unstable_now(),typeof oe=="function"){D.callback=oe,J(p),O=!0;break t}D===w(Y)&&d(Y),J(p)}else d(Y);D=w(Y)}if(D!==null)O=!0;else{var Q=w(B);Q!==null&&Re(ge,Q.startTime-p),O=!1}}break e}finally{D=null,j=V,U=!1}O=void 0}}finally{O?pe():ce=!1}}}var pe;if(typeof te=="function")pe=function(){te(ee)};else if(typeof MessageChannel<"u"){var Qe=new MessageChannel,Ve=Qe.port2;Qe.port1.onmessage=ee,pe=function(){Ve.postMessage(null)}}else pe=function(){X(ee,0)};function Re(p,O){be=X(function(){p(r.unstable_now())},O)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(p){p.callback=null},r.unstable_forceFrameRate=function(p){0>p||125me?(p.sortIndex=V,x(B,p),w(Y)===null&&p===w(B)&&(z?(I(be),be=-1):z=!0,Re(ge,V-me))):(p.sortIndex=oe,x(Y,p),E||U||(E=!0,ce||(ce=!0,pe()))),p},r.unstable_shouldYield=Ne,r.unstable_wrapCallback=function(p){var O=j;return function(){var V=j;j=O;try{return p.apply(this,arguments)}finally{j=V}}}})(Es)),Es}var R0;function Bm(){return R0||(R0=1,Ms.exports=Hm()),Ms.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var G0;function qm(){if(G0)return On;G0=1;var r=Bm(),x=Mm(),w=Em();function d(e){var t="https://react.dev/errors/"+e;if(1oe||(e.current=me[oe],me[oe]=null,oe--)}function M(e,t){oe++,me[oe]=e.current,e.current=t}var A=Q(null),ve=Q(null),Ke=Q(null),ul=Q(null);function Yt(e,t){switch(M(Ke,t),M(ve,e),M(A,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?c0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=c0(t),e=s0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ne(A),M(A,e)}function At(){ne(A),ne(ve),ne(Ke)}function W(e){e.memoizedState!==null&&M(ul,e);var t=A.current,l=s0(t,e.type);t!==l&&(M(ve,e),M(A,l))}function Ee(e){ve.current===e&&(ne(A),ne(ve)),ul.current===e&&(ne(ul),Cn._currentValue=V)}var Pe,Lt;function lt(e){if(Pe===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Pe=t&&t[1]||"",Lt=-1)":-1n||o[a]!==h[n]){var S=` +`+o[a].replace(" at new "," at ");return e.displayName&&S.includes("")&&(S=S.replace("",e.displayName)),S}while(1<=a&&0<=n);break}}}finally{si=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?lt(l):""}function af(e,t){switch(e.tag){case 26:case 27:case 5:return lt(e.type);case 16:return lt("Lazy");case 13:return e.child!==t&&t!==null?lt("Suspense Fallback"):lt("Suspense");case 19:return lt("SuspenseList");case 0:case 15:return ri(e.type,!1);case 11:return ri(e.type.render,!1);case 1:return ri(e.type,!0);case 31:return lt("Activity");default:return""}}function Bs(e){try{var t="",l=null;do t+=af(e,l),l=e,e=e.return;while(e);return t}catch(a){return` +Error generating stack: `+a.message+` +`+a.stack}}var di=Object.prototype.hasOwnProperty,oi=r.unstable_scheduleCallback,fi=r.unstable_cancelCallback,nf=r.unstable_shouldYield,uf=r.unstable_requestPaint,dt=r.unstable_now,cf=r.unstable_getCurrentPriorityLevel,qs=r.unstable_ImmediatePriority,Ys=r.unstable_UserBlockingPriority,Bn=r.unstable_NormalPriority,sf=r.unstable_LowPriority,Ls=r.unstable_IdlePriority,rf=r.log,df=r.unstable_setDisableYieldValue,La=null,ot=null;function il(e){if(typeof rf=="function"&&df(e),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(La,e)}catch{}}var ft=Math.clz32?Math.clz32:gf,of=Math.log,ff=Math.LN2;function gf(e){return e>>>=0,e===0?32:31-(of(e)/ff|0)|0}var qn=256,Yn=262144,Ln=4194304;function wl(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Rn(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var n=0,u=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var s=a&134217727;return s!==0?(a=s&~u,a!==0?n=wl(a):(c&=s,c!==0?n=wl(c):l||(l=s&~e,l!==0&&(n=wl(l))))):(s=a&~u,s!==0?n=wl(s):c!==0?n=wl(c):l||(l=a&~e,l!==0&&(n=wl(l)))),n===0?0:t!==0&&t!==n&&(t&u)===0&&(u=n&-n,l=t&-t,u>=l||u===32&&(l&4194048)!==0)?t:n}function Ra(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function mf(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Rs(){var e=Ln;return Ln<<=1,(Ln&62914560)===0&&(Ln=4194304),e}function gi(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Ga(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function hf(e,t,l,a,n,u){var c=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var s=e.entanglements,o=e.expirationTimes,h=e.hiddenUpdates;for(l=c&~l;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Sf=/[\n"\\]/g;function St(e){return e.replace(Sf,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function vi(e,t,l,a,n,u,c,s){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),t!=null?c==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+pt(t)):e.value!==""+pt(t)&&(e.value=""+pt(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?pi(e,c,pt(t)):l!=null?pi(e,c,pt(l)):a!=null&&e.removeAttribute("value"),n==null&&u!=null&&(e.defaultChecked=!!u),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.name=""+pt(s):e.removeAttribute("name")}function er(e,t,l,a,n,u,c,s){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||l!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){bi(e);return}l=l!=null?""+pt(l):"",t=t!=null?""+pt(t):l,s||t===e.value||(e.value=t),e.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=s?e.checked:!!a,e.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),bi(e)}function pi(e,t,l){t==="number"&&Xn(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function na(e,t,l,a){if(e=e.options,t){t={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zi=!1;if(Qt)try{var Va={};Object.defineProperty(Va,"passive",{get:function(){zi=!0}}),window.addEventListener("test",Va,Va),window.removeEventListener("test",Va,Va)}catch{zi=!1}var sl=null,Ti=null,Vn=null;function cr(){if(Vn)return Vn;var e,t=Ti,l=t.length,a,n="value"in sl?sl.value:sl.textContent,u=n.length;for(e=0;e=Wa),gr=" ",mr=!1;function hr(e,t){switch(e){case"keyup":return Wf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yr(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var sa=!1;function Ff(e,t){switch(e){case"compositionend":return yr(t);case"keypress":return t.which!==32?null:(mr=!0,gr);case"textInput":return e=t.data,e===gr&&mr?null:e;default:return null}}function If(e,t){if(sa)return e==="compositionend"||!Di&&hr(e,t)?(e=cr(),Vn=Ti=sl=null,sa=!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)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=kr(l)}}function Tr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tr(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Xn(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Xn(e.document)}return t}function Oi(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")}var ig=Qt&&"documentMode"in document&&11>=document.documentMode,ra=null,Ui=null,Pa=null,Hi=!1;function Er(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Hi||ra==null||ra!==Xn(a)||(a=ra,"selectionStart"in a&&Oi(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Pa&&Ia(Pa,a)||(Pa=a,a=Yu(Ui,"onSelect"),0>=c,n-=c,Ot=1<<32-ft(t)+n|l<ae?(re=G,G=null):re=G.sibling;var ye=y(g,G,m[ae],N);if(ye===null){G===null&&(G=re);break}e&&G&&ye.alternate===null&&t(g,G),f=u(ye,f,ae),he===null?K=ye:he.sibling=ye,he=ye,G=re}if(ae===m.length)return l(g,G),fe&&Zt(g,ae),K;if(G===null){for(;aeae?(re=G,G=null):re=G.sibling;var Al=y(g,G,ye.value,N);if(Al===null){G===null&&(G=re);break}e&&G&&Al.alternate===null&&t(g,G),f=u(Al,f,ae),he===null?K=Al:he.sibling=Al,he=Al,G=re}if(ye.done)return l(g,G),fe&&Zt(g,ae),K;if(G===null){for(;!ye.done;ae++,ye=m.next())ye=k(g,ye.value,N),ye!==null&&(f=u(ye,f,ae),he===null?K=ye:he.sibling=ye,he=ye);return fe&&Zt(g,ae),K}for(G=a(G);!ye.done;ae++,ye=m.next())ye=b(G,g,ae,ye.value,N),ye!==null&&(e&&ye.alternate!==null&&G.delete(ye.key===null?ae:ye.key),f=u(ye,f,ae),he===null?K=ye:he.sibling=ye,he=ye);return e&&G.forEach(function(Tm){return t(g,Tm)}),fe&&Zt(g,ae),K}function Te(g,f,m,N){if(typeof m=="object"&&m!==null&&m.type===z&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case U:e:{for(var K=m.key;f!==null;){if(f.key===K){if(K=m.type,K===z){if(f.tag===7){l(g,f.sibling),N=n(f,m.props.children),N.return=g,g=N;break e}}else if(f.elementType===K||typeof K=="object"&&K!==null&&K.$$typeof===P&&Xl(K)===f.type){l(g,f.sibling),N=n(f,m.props),un(N,m),N.return=g,g=N;break e}l(g,f);break}else t(g,f);f=f.sibling}m.type===z?(N=Yl(m.props.children,g.mode,N,m.key),N.return=g,g=N):(N=lu(m.type,m.key,m.props,null,g.mode,N),un(N,m),N.return=g,g=N)}return c(g);case E:e:{for(K=m.key;f!==null;){if(f.key===K)if(f.tag===4&&f.stateNode.containerInfo===m.containerInfo&&f.stateNode.implementation===m.implementation){l(g,f.sibling),N=n(f,m.children||[]),N.return=g,g=N;break e}else{l(g,f);break}else t(g,f);f=f.sibling}N=Qi(m,g.mode,N),N.return=g,g=N}return c(g);case P:return m=Xl(m),Te(g,f,m,N)}if(Re(m))return L(g,f,m,N);if(pe(m)){if(K=pe(m),typeof K!="function")throw Error(d(150));return m=K.call(m),$(g,f,m,N)}if(typeof m.then=="function")return Te(g,f,ru(m),N);if(m.$$typeof===te)return Te(g,f,uu(g,m),N);du(g,m)}return typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint"?(m=""+m,f!==null&&f.tag===6?(l(g,f.sibling),N=n(f,m),N.return=g,g=N):(l(g,f),N=Gi(m,g.mode,N),N.return=g,g=N),c(g)):l(g,f)}return function(g,f,m,N){try{nn=0;var K=Te(g,f,m,N);return pa=null,K}catch(G){if(G===va||G===cu)throw G;var he=mt(29,G,null,g.mode);return he.lanes=N,he.return=g,he}finally{}}}var Vl=Fr(!0),Ir=Fr(!1),gl=!1;function tc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ml(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function hl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(xe&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=tu(e),Ur(e,null,l),t}return eu(e,a,t,l),tu(e)}function cn(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Qs(e,l)}}function ac(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,u=null;if(l=l.firstBaseUpdate,l!==null){do{var c={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};u===null?n=u=c:u=u.next=c,l=l.next}while(l!==null);u===null?n=u=t:u=u.next=t}else n=u=t;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var nc=!1;function sn(){if(nc){var e=ba;if(e!==null)throw e}}function rn(e,t,l,a){nc=!1;var n=e.updateQueue;gl=!1;var u=n.firstBaseUpdate,c=n.lastBaseUpdate,s=n.shared.pending;if(s!==null){n.shared.pending=null;var o=s,h=o.next;o.next=null,c===null?u=h:c.next=h,c=o;var S=e.alternate;S!==null&&(S=S.updateQueue,s=S.lastBaseUpdate,s!==c&&(s===null?S.firstBaseUpdate=h:s.next=h,S.lastBaseUpdate=o))}if(u!==null){var k=n.baseState;c=0,S=h=o=null,s=u;do{var y=s.lane&-536870913,b=y!==s.lane;if(b?(se&y)===y:(a&y)===y){y!==0&&y===xa&&(nc=!0),S!==null&&(S=S.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var L=e,$=s;y=t;var Te=l;switch($.tag){case 1:if(L=$.payload,typeof L=="function"){k=L.call(Te,k,y);break e}k=L;break e;case 3:L.flags=L.flags&-65537|128;case 0:if(L=$.payload,y=typeof L=="function"?L.call(Te,k,y):L,y==null)break e;k=D({},k,y);break e;case 2:gl=!0}}y=s.callback,y!==null&&(e.flags|=64,b&&(e.flags|=8192),b=n.callbacks,b===null?n.callbacks=[y]:b.push(y))}else b={lane:y,tag:s.tag,payload:s.payload,callback:s.callback,next:null},S===null?(h=S=b,o=k):S=S.next=b,c|=y;if(s=s.next,s===null){if(s=n.shared.pending,s===null)break;b=s,s=b.next,b.next=null,n.lastBaseUpdate=b,n.shared.pending=null}}while(!0);S===null&&(o=k),n.baseState=o,n.firstBaseUpdate=h,n.lastBaseUpdate=S,u===null&&(n.shared.lanes=0),pl|=c,e.lanes=c,e.memoizedState=k}}function Pr(e,t){if(typeof e!="function")throw Error(d(191,e));e.call(t)}function ed(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;eu?u:8;var c=p.T,s={};p.T=s,Nc(e,!1,t,l);try{var o=n(),h=p.S;if(h!==null&&h(s,o),o!==null&&typeof o=="object"&&typeof o.then=="function"){var S=hg(o,a);fn(e,t,S,vt(e))}else fn(e,t,a,vt(e))}catch(k){fn(e,t,{then:function(){},status:"rejected",reason:k},vt())}finally{O.p=u,c!==null&&s.types!==null&&(c.types=s.types),p.T=c}}function Sg(){}function Sc(e,t,l,a){if(e.tag!==5)throw Error(d(476));var n=_d(e).queue;Dd(e,n,t,V,l===null?Sg:function(){return wd(e),l(a)})}function _d(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wt,lastRenderedState:V},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wt,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function wd(e){var t=_d(e);t.next===null&&(t=e.alternate.memoizedState),fn(e,t.next.queue,{},vt())}function jc(){return $e(Cn)}function Od(){return He().memoizedState}function Ud(){return He().memoizedState}function jg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=vt();e=ml(l);var a=hl(t,e,l);a!==null&&(rt(a,t,l),cn(a,t,l)),t={cache:Fi()},e.payload=t;return}t=t.return}}function Ng(e,t,l){var a=vt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},pu(e)?Bd(t,l):(l=Li(e,t,l,a),l!==null&&(rt(l,e,a),qd(l,t,a)))}function Hd(e,t,l){var a=vt();fn(e,t,l,a)}function fn(e,t,l,a){var n={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(pu(e))Bd(t,n);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var c=t.lastRenderedState,s=u(c,l);if(n.hasEagerState=!0,n.eagerState=s,gt(s,c))return eu(e,t,n,0),Me===null&&Pn(),!1}catch{}finally{}if(l=Li(e,t,n,a),l!==null)return rt(l,e,a),qd(l,t,a),!0}return!1}function Nc(e,t,l,a){if(a={lane:2,revertLane:ts(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},pu(e)){if(t)throw Error(d(479))}else t=Li(e,l,a,2),t!==null&&rt(t,e,2)}function pu(e){var t=e.alternate;return e===le||t!==null&&t===le}function Bd(e,t){ja=gu=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function qd(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Qs(e,l)}}var gn={readContext:$e,use:yu,useCallback:we,useContext:we,useEffect:we,useImperativeHandle:we,useLayoutEffect:we,useInsertionEffect:we,useMemo:we,useReducer:we,useRef:we,useState:we,useDebugValue:we,useDeferredValue:we,useTransition:we,useSyncExternalStore:we,useId:we,useHostTransitionStatus:we,useFormState:we,useActionState:we,useOptimistic:we,useMemoCache:we,useCacheRefresh:we};gn.useEffectEvent=we;var Yd={readContext:$e,use:yu,useCallback:function(e,t){return et().memoizedState=[e,t===void 0?null:t],e},useContext:$e,useEffect:jd,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,bu(4194308,4,Td.bind(null,t,e),l)},useLayoutEffect:function(e,t){return bu(4194308,4,e,t)},useInsertionEffect:function(e,t){bu(4,2,e,t)},useMemo:function(e,t){var l=et();t=t===void 0?null:t;var a=e();if(Kl){il(!0);try{e()}finally{il(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=et();if(l!==void 0){var n=l(t);if(Kl){il(!0);try{l(t)}finally{il(!1)}}}else n=t;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=Ng.bind(null,le,e),[a.memoizedState,e]},useRef:function(e){var t=et();return e={current:e},t.memoizedState=e},useState:function(e){e=yc(e);var t=e.queue,l=Hd.bind(null,le,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:vc,useDeferredValue:function(e,t){var l=et();return pc(l,e,t)},useTransition:function(){var e=yc(!1);return e=Dd.bind(null,le,e.queue,!0,!1),et().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=le,n=et();if(fe){if(l===void 0)throw Error(d(407));l=l()}else{if(l=t(),Me===null)throw Error(d(349));(se&127)!==0||id(a,t,l)}n.memoizedState=l;var u={value:l,getSnapshot:t};return n.queue=u,jd(sd.bind(null,a,u,e),[e]),a.flags|=2048,ka(9,{destroy:void 0},cd.bind(null,a,u,l,t),null),l},useId:function(){var e=et(),t=Me.identifierPrefix;if(fe){var l=Ut,a=Ot;l=(a&~(1<<32-ft(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=mu++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?c.createElement(n,{is:a.is}):c.createElement(n)}}u[Je]=t,u[at]=a;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)u.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=u;e:switch(Ie(u,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Ft(t)}}return Ae(t),Bc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Ft(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(d(166));if(e=Ke.current,ha(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,n=We,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[Je]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||u0(e.nodeValue,l)),e||ol(t,!0)}else e=Lu(e).createTextNode(a),e[Je]=t,t.stateNode=e}return Ae(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=ha(t),l!==null){if(e===null){if(!a)throw Error(d(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(557));e[Je]=t}else Ll(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ae(t),e=!1}else l=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(yt(t),t):(yt(t),null);if((t.flags&128)!==0)throw Error(d(558))}return Ae(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=ha(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(d(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(d(317));n[Je]=t}else Ll(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ae(t),n=!1}else n=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(yt(t),t):(yt(t),null)}return yt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==n&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),zu(t,t.updateQueue),Ae(t),null);case 4:return At(),e===null&&us(t.stateNode.containerInfo),Ae(t),null;case 10:return Kt(t.type),Ae(t),null;case 19:if(ne(Ue),a=t.memoizedState,a===null)return Ae(t),null;if(n=(t.flags&128)!==0,u=a.rendering,u===null)if(n)hn(a,!1);else{if(Oe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=fu(e),u!==null){for(t.flags|=128,hn(a,!1),e=u.updateQueue,t.updateQueue=e,zu(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Hr(l,e),l=l.sibling;return M(Ue,Ue.current&1|2),fe&&Zt(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&dt()>Au&&(t.flags|=128,n=!0,hn(a,!1),t.lanes=4194304)}else{if(!n)if(e=fu(u),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,zu(t,e),hn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!fe)return Ae(t),null}else 2*dt()-a.renderingStartTime>Au&&l!==536870912&&(t.flags|=128,n=!0,hn(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(e=a.last,e!==null?e.sibling=u:t.child=u,a.last=u)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=dt(),e.sibling=null,l=Ue.current,M(Ue,n?l&1|2:l&1),fe&&Zt(t,a.treeForkCount),e):(Ae(t),null);case 22:case 23:return yt(t),ic(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(Ae(t),t.subtreeFlags&6&&(t.flags|=8192)):Ae(t),l=t.updateQueue,l!==null&&zu(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&ne(Ql),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Kt(Be),Ae(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function Eg(e,t){switch(Zi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Kt(Be),At(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ee(t),null;case 31:if(t.memoizedState!==null){if(yt(t),t.alternate===null)throw Error(d(340));Ll()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(yt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(d(340));Ll()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ne(Ue),null;case 4:return At(),null;case 10:return Kt(t.type),null;case 22:case 23:return yt(t),ic(),e!==null&&ne(Ql),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Kt(Be),null;case 25:return null;default:return null}}function ro(e,t){switch(Zi(t),t.tag){case 3:Kt(Be),At();break;case 26:case 27:case 5:Ee(t);break;case 4:At();break;case 31:t.memoizedState!==null&&yt(t);break;case 13:yt(t);break;case 19:ne(Ue);break;case 10:Kt(t.type);break;case 22:case 23:yt(t),ic(),e!==null&&ne(Ql);break;case 24:Kt(Be)}}function yn(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&e)===e){a=void 0;var u=l.create,c=l.inst;a=u(),c.destroy=a}l=l.next}while(l!==n)}}catch(s){je(t,t.return,s)}}function bl(e,t,l){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&e)===e){var c=a.inst,s=c.destroy;if(s!==void 0){c.destroy=void 0,n=t;var o=l,h=s;try{h()}catch(S){je(n,o,S)}}}a=a.next}while(a!==u)}}catch(S){je(t,t.return,S)}}function oo(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{ed(t,l)}catch(a){je(e,e.return,a)}}}function fo(e,t,l){l.props=Jl(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){je(e,t,a)}}function xn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(n){je(e,t,n)}}function Ht(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){je(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){je(e,t,n)}else l.current=null}function go(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){je(e,e.return,n)}}function qc(e,t,l){try{var a=e.stateNode;$g(a,e.type,l,t),a[at]=t}catch(n){je(e,e.return,n)}}function mo(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&zl(e.type)||e.tag===4}function Yc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||mo(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.tag===27&&zl(e.type)||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 Lc(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Gt));else if(a!==4&&(a===27&&zl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Lc(e,t,l),e=e.sibling;e!==null;)Lc(e,t,l),e=e.sibling}function Tu(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&zl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Tu(e,t,l),e=e.sibling;e!==null;)Tu(e,t,l),e=e.sibling}function ho(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Ie(t,a,l),t[Je]=e,t[at]=l}catch(u){je(e,e.return,u)}}var It=!1,Le=!1,Rc=!1,yo=typeof WeakSet=="function"?WeakSet:Set,Ze=null;function Cg(e,t){if(e=e.containerInfo,ss=Ku,e=Mr(e),Oi(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{l.nodeType,u.nodeType}catch{l=null;break e}var c=0,s=-1,o=-1,h=0,S=0,k=e,y=null;t:for(;;){for(var b;k!==l||n!==0&&k.nodeType!==3||(s=c+n),k!==u||a!==0&&k.nodeType!==3||(o=c+a),k.nodeType===3&&(c+=k.nodeValue.length),(b=k.firstChild)!==null;)y=k,k=b;for(;;){if(k===e)break t;if(y===l&&++h===n&&(s=c),y===u&&++S===a&&(o=c),(b=k.nextSibling)!==null)break;k=y,y=k.parentNode}k=b}l=s===-1||o===-1?null:{start:s,end:o}}else l=null}l=l||{start:0,end:0}}else l=null;for(rs={focusedElem:e,selectionRange:l},Ku=!1,Ze=t;Ze!==null;)if(t=Ze,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ze=e;else for(;Ze!==null;){switch(t=Ze,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l title"))),Ie(u,a,l),u[Je]=e,Xe(u),a=u;break e;case"link":var c=j0("link","href",n).get(a+(l.href||""));if(c){for(var s=0;sTe&&(c=Te,Te=$,$=c);var g=zr(s,$),f=zr(s,Te);if(g&&f&&(b.rangeCount!==1||b.anchorNode!==g.node||b.anchorOffset!==g.offset||b.focusNode!==f.node||b.focusOffset!==f.offset)){var m=k.createRange();m.setStart(g.node,g.offset),b.removeAllRanges(),$>Te?(b.addRange(m),b.extend(f.node,f.offset)):(m.setEnd(f.node,f.offset),b.addRange(m))}}}}for(k=[],b=s;b=b.parentNode;)b.nodeType===1&&k.push({element:b,left:b.scrollLeft,top:b.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;sl?32:l,p.T=null,l=Jc,Jc=null;var u=jl,c=al;if(Ge=0,Ca=jl=null,al=0,(xe&6)!==0)throw Error(d(331));var s=xe;if(xe|=4,Mo(u.current),ko(u,u.current,c,l),xe=s,Nn(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(La,u)}catch{}return!0}finally{O.p=n,p.T=a,Zo(e,t)}}function Ko(e,t,l){t=Nt(l,t),t=Mc(e.stateNode,t,2),e=hl(e,t,2),e!==null&&(Ga(e,2),Bt(e))}function je(e,t,l){if(e.tag===3)Ko(e,e,l);else for(;t!==null;){if(t.tag===3){Ko(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Sl===null||!Sl.has(a))){e=Nt(l,e),l=Kd(2),a=hl(t,l,2),a!==null&&(Jd(l,a,t,e),Ga(a,2),Bt(a));break}}t=t.return}}function Ic(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new _g;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(l)||(Xc=!0,n.add(l),e=Bg.bind(null,e,t,l),t.then(e,e))}function Bg(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Me===e&&(se&l)===l&&(Oe===4||Oe===3&&(se&62914560)===se&&300>dt()-Cu?(xe&2)===0&&Aa(e,0):Zc|=l,Ea===se&&(Ea=0)),Bt(e)}function Jo(e,t){t===0&&(t=Rs()),e=ql(e,t),e!==null&&(Ga(e,t),Bt(e))}function qg(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),Jo(e,l)}function Yg(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(d(314))}a!==null&&a.delete(t),Jo(e,l)}function Lg(e,t){return oi(e,t)}var Hu=null,_a=null,Pc=!1,Bu=!1,es=!1,kl=0;function Bt(e){e!==_a&&e.next===null&&(_a===null?Hu=_a=e:_a=_a.next=e),Bu=!0,Pc||(Pc=!0,Gg())}function Nn(e,t){if(!es&&Bu){es=!0;do for(var l=!1,a=Hu;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var u=0;else{var c=a.suspendedLanes,s=a.pingedLanes;u=(1<<31-ft(42|e)+1)-1,u&=n&~(c&~s),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(l=!0,Io(a,u))}else u=se,u=Rn(a,a===Me?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Ra(a,u)||(l=!0,Io(a,u));a=a.next}while(l);es=!1}}function Rg(){Wo()}function Wo(){Bu=Pc=!1;var e=0;kl!==0&&Ig()&&(e=kl);for(var t=dt(),l=null,a=Hu;a!==null;){var n=a.next,u=$o(a,t);u===0?(a.next=null,l===null?Hu=n:l.next=n,n===null&&(_a=l)):(l=a,(e!==0||(u&3)!==0)&&(Bu=!0)),a=n}Ge!==0&&Ge!==5||Nn(e),kl!==0&&(kl=0)}function $o(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,u=e.pendingLanes&-62914561;0s)break;var S=o.transferSize,k=o.initiatorType;S&&i0(k)&&(o=o.responseEnd,c+=S*(o"u"?null:document;function b0(e,t,l){var a=wa;if(a&&typeof t=="string"&&t){var n=St(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),x0.has(n)||(x0.add(n),e={rel:e,crossOrigin:l,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),Ie(t,"link",e),Xe(t),a.head.appendChild(t)))}}function cm(e){nl.D(e),b0("dns-prefetch",e,null)}function sm(e,t){nl.C(e,t),b0("preconnect",e,t)}function rm(e,t,l){nl.L(e,t,l);var a=wa;if(a&&e&&t){var n='link[rel="preload"][as="'+St(t)+'"]';t==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+St(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+St(l.imageSizes)+'"]')):n+='[href="'+St(e)+'"]';var u=n;switch(t){case"style":u=Oa(e);break;case"script":u=Ua(e)}Ct.has(u)||(e=D({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Ct.set(u,e),a.querySelector(n)!==null||t==="style"&&a.querySelector(Mn(u))||t==="script"&&a.querySelector(En(u))||(t=a.createElement("link"),Ie(t,"link",e),Xe(t),a.head.appendChild(t)))}}function dm(e,t){nl.m(e,t);var l=wa;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+St(a)+'"][href="'+St(e)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Ua(e)}if(!Ct.has(u)&&(e=D({rel:"modulepreload",href:e},t),Ct.set(u,e),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(En(u)))return}a=l.createElement("link"),Ie(a,"link",e),Xe(a),l.head.appendChild(a)}}}function om(e,t,l){nl.S(e,t,l);var a=wa;if(a&&e){var n=la(a).hoistableStyles,u=Oa(e);t=t||"default";var c=n.get(u);if(!c){var s={loading:0,preload:null};if(c=a.querySelector(Mn(u)))s.loading=5;else{e=D({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Ct.get(u))&&ys(e,l);var o=c=a.createElement("link");Xe(o),Ie(o,"link",e),o._p=new Promise(function(h,S){o.onload=h,o.onerror=S}),o.addEventListener("load",function(){s.loading|=1}),o.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Gu(c,t,a)}c={type:"stylesheet",instance:c,count:1,state:s},n.set(u,c)}}}function fm(e,t){nl.X(e,t);var l=wa;if(l&&e){var a=la(l).hoistableScripts,n=Ua(e),u=a.get(n);u||(u=l.querySelector(En(n)),u||(e=D({src:e,async:!0},t),(t=Ct.get(n))&&xs(e,t),u=l.createElement("script"),Xe(u),Ie(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function gm(e,t){nl.M(e,t);var l=wa;if(l&&e){var a=la(l).hoistableScripts,n=Ua(e),u=a.get(n);u||(u=l.querySelector(En(n)),u||(e=D({src:e,async:!0,type:"module"},t),(t=Ct.get(n))&&xs(e,t),u=l.createElement("script"),Xe(u),Ie(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function v0(e,t,l,a){var n=(n=Ke.current)?Ru(n):null;if(!n)throw Error(d(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Oa(l.href),l=la(n).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Oa(l.href);var u=la(n).hoistableStyles,c=u.get(e);if(c||(n=n.ownerDocument||n,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,c),(u=n.querySelector(Mn(e)))&&!u._p&&(c.instance=u,c.state.loading=5),Ct.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Ct.set(e,l),u||mm(n,e,l,c.state))),t&&a===null)throw Error(d(528,""));return c}if(t&&a!==null)throw Error(d(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ua(l),l=la(n).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,e))}}function Oa(e){return'href="'+St(e)+'"'}function Mn(e){return'link[rel="stylesheet"]['+e+"]"}function p0(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function mm(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),Ie(t,"link",l),Xe(t),e.head.appendChild(t))}function Ua(e){return'[src="'+St(e)+'"]'}function En(e){return"script[async]"+e}function S0(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+St(l.href)+'"]');if(a)return t.instance=a,Xe(a),a;var n=D({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Xe(a),Ie(a,"style",n),Gu(a,l.precedence,e),t.instance=a;case"stylesheet":n=Oa(l.href);var u=e.querySelector(Mn(n));if(u)return t.state.loading|=4,t.instance=u,Xe(u),u;a=p0(l),(n=Ct.get(n))&&ys(a,n),u=(e.ownerDocument||e).createElement("link"),Xe(u);var c=u;return c._p=new Promise(function(s,o){c.onload=s,c.onerror=o}),Ie(u,"link",a),t.state.loading|=4,Gu(u,l.precedence,e),t.instance=u;case"script":return u=Ua(l.src),(n=e.querySelector(En(u)))?(t.instance=n,Xe(n),n):(a=l,(n=Ct.get(u))&&(a=D({},l),xs(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),Xe(n),Ie(n,"link",a),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Gu(a,l.precedence,e));return t.instance}function Gu(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,c=0;c title"):null)}function hm(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function k0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function ym(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var n=Oa(a.href),u=t.querySelector(Mn(n));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Xu.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=u,Xe(u);return}u=t.ownerDocument||t,a=p0(a),(n=Ct.get(n))&&ys(a,n),u=u.createElement("link"),Xe(u);var c=u;c._p=new Promise(function(s,o){c.onload=s,c.onerror=o}),Ie(u,"link",a),l.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Xu.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var bs=0;function xm(e,t){return e.stylesheets&&e.count===0&&Vu(e,e.stylesheets),0bs?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function Xu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zu=null;function Vu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zu=new Map,t.forEach(bm,e),Zu=null,Xu.call(e))}function bm(e,t){if(!(t.state.loading&4)){var l=Zu.get(e);if(l)var a=l.get(null);else{l=new Map,Zu.set(e,l);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(x){console.error(x)}}return r(),Ts.exports=qm(),Ts.exports}var Lm=Ym();const X0="".replace(/\/$/,"");let Hn=localStorage.getItem("access_token"),Fl=localStorage.getItem("refresh_token"),ti=null;function Cs(r){return X0?`${X0}${r.startsWith("/")?r:`/${r}`}`:r}function As(r,x){Hn=r,Fl=x,localStorage.setItem("access_token",r),localStorage.setItem("refresh_token",x)}function Ds(){Hn=null,Fl=null,localStorage.removeItem("access_token"),localStorage.removeItem("refresh_token")}function Rm(){return Fl}async function Gm(){if(!Fl)throw new Error("No refresh token");const r=await fetch(Cs("/auth/refresh"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:Fl})});if(!r.ok)throw Ds(),window.dispatchEvent(new CustomEvent("auth:logout")),new Error("Refresh failed");const x=await r.json();As(x.access_token,x.refresh_token)}async function F(r,x={}){var T;const w={...x.headers};Hn&&(w.Authorization=`Bearer ${Hn}`),x.body instanceof FormData||(w["Content-Type"]="application/json");let d=await fetch(Cs(r),{...x,headers:w});if(d.status===401&&Fl&&(ti||(ti=Gm().finally(()=>{ti=null})),await ti,w.Authorization=`Bearer ${Hn}`,d=await fetch(Cs(r),{...x,headers:w})),!d.ok){const C=await d.json().catch(()=>({}));throw{status:d.status,...C}}return(T=d.headers.get("content-type"))!=null&&T.includes("text/calendar")?await d.text():d.json()}const de={register:(r,x,w)=>F("/auth/register",{method:"POST",body:JSON.stringify({email:r,password:x,timezone:w})}),login:(r,x)=>F("/auth/login",{method:"POST",body:JSON.stringify({email:r,password:x})}),logout:()=>F("/auth/logout",{method:"POST",body:JSON.stringify({refresh_token:Fl})}),me:()=>F("/auth/me"),updateMe:r=>F("/users/me",{method:"PUT",body:JSON.stringify(r)}),deleteMe:()=>F("/users/me",{method:"DELETE"}),listApiKeys:()=>F("/api-keys"),createApiKey:r=>F("/api-keys",{method:"POST",body:JSON.stringify(r)}),revokeApiKey:r=>F(`/api-keys/${r}`,{method:"DELETE"}),listCalendars:()=>F("/calendars?limit=100"),createCalendar:r=>F("/calendars",{method:"POST",body:JSON.stringify(r)}),getCalendar:r=>F(`/calendars/${r}`),updateCalendar:(r,x)=>F(`/calendars/${r}`,{method:"PUT",body:JSON.stringify(x)}),deleteCalendar:r=>F(`/calendars/${r}`,{method:"DELETE"}),shareCalendar:(r,x)=>F(`/calendars/${r}/share`,{method:"POST",body:JSON.stringify(x)}),listMembers:r=>F(`/calendars/${r}/members`),removeMember:(r,x)=>F(`/calendars/${r}/members/${x}`,{method:"DELETE"}),addCalendarFromUrl:r=>F("/calendars/add-from-url",{method:"POST",body:JSON.stringify(r)}),importCalendarUrl:r=>F("/calendars/import-url",{method:"POST",body:JSON.stringify(r)}),listSubscriptions:r=>F(`/calendars/${r}/subscriptions`),addSubscription:(r,x)=>F(`/calendars/${r}/subscriptions`,{method:"POST",body:JSON.stringify(x)}),deleteSubscription:(r,x)=>F(`/calendars/${r}/subscriptions/${x}`,{method:"DELETE"}),syncSubscription:(r,x)=>F(`/calendars/${r}/subscriptions/${x}/sync`,{method:"POST"}),listEvents:r=>{const x=new URLSearchParams({start:r.start,end:r.end});return r.calendar_id&&x.set("calendar_id",r.calendar_id),r.search&&x.set("search",r.search),x.set("limit","500"),F(`/events?${x}`)},createEvent:r=>F("/events",{method:"POST",body:JSON.stringify(r)}),getEvent:r=>F(`/events/${r}`),updateEvent:(r,x)=>F(`/events/${r}`,{method:"PUT",body:JSON.stringify(x)}),deleteEvent:r=>F(`/events/${r}`,{method:"DELETE"}),listContacts:r=>{const x=new URLSearchParams({limit:"200"});return r&&x.set("search",r),F(`/contacts?${x}`)},createContact:r=>F("/contacts",{method:"POST",body:JSON.stringify(r)}),getContact:r=>F(`/contacts/${r}`),updateContact:(r,x)=>F(`/contacts/${r}`,{method:"PUT",body:JSON.stringify(x)}),deleteContact:r=>F(`/contacts/${r}`,{method:"DELETE"}),listTasks:r=>{const x=new URLSearchParams({limit:"100"});return r!=null&&r.status&&x.set("status",r.status),r!=null&&r.priority&&x.set("priority",r.priority),r!=null&&r.project_id&&x.set("project_id",r.project_id),r!=null&&r.due_from&&x.set("due_from",r.due_from),r!=null&&r.due_to&&x.set("due_to",r.due_to),r!=null&&r.limit&&x.set("limit",String(r.limit)),r!=null&&r.cursor&&x.set("cursor",r.cursor),F(`/tasks?${x}`)},createTask:r=>F("/tasks",{method:"POST",body:JSON.stringify(r)}),getTask:r=>F(`/tasks/${r}`),updateTask:(r,x)=>F(`/tasks/${r}`,{method:"PUT",body:JSON.stringify(x)}),deleteTask:(r,x)=>F(`/tasks/${r}${x?"?permanent=true":""}`,{method:"DELETE"}),markTaskComplete:r=>F(`/tasks/${r}/complete`,{method:"POST"}),markTaskUncomplete:(r,x)=>F(`/tasks/${r}/uncomplete`,{method:"POST",body:JSON.stringify(x?{status:x}:{})}),listTaskSubtasks:r=>F(`/tasks/${r}/subtasks`),listProjects:()=>F("/projects"),createProject:r=>F("/projects",{method:"POST",body:JSON.stringify(r)}),getProject:r=>F(`/projects/${r}`),updateProject:(r,x)=>F(`/projects/${r}`,{method:"PUT",body:JSON.stringify(x)}),deleteProject:r=>F(`/projects/${r}`,{method:"DELETE"}),listTags:()=>F("/tags"),createTag:r=>F("/tags",{method:"POST",body:JSON.stringify(r)})},tf=v.createContext(null);function Qm({children:r}){const[x,w]=v.useState(null),[d,T]=v.useState(!0);v.useEffect(()=>{localStorage.getItem("access_token")?de.me().then(D=>w(D.user)).catch(()=>{Ds(),w(null)}).finally(()=>T(!1)):T(!1);const R=()=>{w(null)};return window.addEventListener("auth:logout",R),()=>window.removeEventListener("auth:logout",R)},[]);const C=v.useCallback(async(B,R)=>{const D=await de.login(B,R);As(D.access_token,D.refresh_token),w(D.user)},[]),H=v.useCallback(async(B,R,D)=>{const j=await de.register(B,R,D);As(j.access_token,j.refresh_token),w(j.user)},[]),q=v.useCallback(async()=>{try{Rm()&&await de.logout()}finally{Ds(),w(null)}},[]),Y=v.useCallback(async()=>{const B=await de.me();w(B.user)},[]);return i.jsx(tf.Provider,{value:{user:x,loading:d,login:C,register:H,logout:q,refreshUser:Y},children:r})}function Ya(){const r=v.useContext(tf);if(!r)throw new Error("useAuth must be used within AuthProvider");return r}const lf=v.createContext(null);function Xm(){const r=localStorage.getItem("theme");return r||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}function Zm({children:r}){const[x,w]=v.useState(Xm);v.useEffect(()=>{document.documentElement.classList.toggle("dark",x==="dark"),localStorage.setItem("theme",x)},[x]);const d=v.useCallback(()=>{w(T=>T==="light"?"dark":"light")},[]);return i.jsx(lf.Provider,{value:{theme:x,toggle:d},children:r})}function ci(){const r=v.useContext(lf);if(!r)throw new Error("useTheme must be used within ThemeProvider");return r}class Vm extends v.Component{constructor(x){super(x),this.state={hasError:!1}}static getDerivedStateFromError(x){return{hasError:!0,error:x}}render(){return this.state.hasError?this.props.fallback?this.props.fallback:i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 p-4",children:i.jsxs("div",{className:"max-w-md w-full text-center",children:[i.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:i.jsx("svg",{className:"w-8 h-8 text-red-600 dark:text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),i.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:"Something went wrong"}),i.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:"An unexpected error occurred. Please refresh the page to try again."}),i.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-lg transition-colors",children:"Refresh page"})]})}):this.props.children}}function Km(){const{login:r}=Ya(),{theme:x,toggle:w}=ci(),d=_s(),[T,C]=v.useState(""),[H,q]=v.useState(""),[Y,B]=v.useState(""),[R,D]=v.useState(!1),j=async U=>{U.preventDefault(),B(""),D(!0);try{await r(T,H),d("/")}catch(E){B(E.error||"Invalid credentials")}finally{D(!1)}};return i.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 px-4 transition-colors",children:[i.jsx("div",{className:"absolute top-4 right-4",children:i.jsx("button",{onClick:w,className:"p-2 rounded-xl bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:x==="dark"?i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})})}),i.jsxs("div",{className:"w-full max-w-sm",children:[i.jsxs("div",{className:"text-center mb-8",children:[i.jsx("div",{className:"inline-flex items-center justify-center w-14 h-14 bg-blue-600 rounded-2xl mb-4 shadow-lg shadow-blue-600/20",children:i.jsx("svg",{className:"w-8 h-8 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),i.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Welcome back"}),i.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1 text-sm",children:"Sign in to your calendar"})]}),i.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-2xl shadow-xl shadow-gray-200/50 dark:shadow-black/20 border border-gray-100 dark:border-gray-700 p-6",children:i.jsxs("form",{onSubmit:j,className:"space-y-4",children:[Y&&i.jsx("div",{className:"text-sm text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 px-3 py-2.5 rounded-xl",children:Y}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1.5",children:"Email"}),i.jsx("input",{type:"email",value:T,onChange:U=>C(U.target.value),className:"w-full px-3.5 py-2.5 rounded-xl border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all text-sm",placeholder:"you@example.com",required:!0,autoFocus:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1.5",children:"Password"}),i.jsx("input",{type:"password",value:H,onChange:U=>q(U.target.value),className:"w-full px-3.5 py-2.5 rounded-xl border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all text-sm",placeholder:"Min. 10 characters",required:!0,minLength:10})]}),i.jsx("button",{type:"submit",disabled:R,className:"w-full py-2.5 bg-blue-600 hover:bg-blue-700 disabled:opacity-50 text-white rounded-xl font-medium transition-colors text-sm",children:R?"Signing in...":"Sign in"})]})}),i.jsxs("p",{className:"text-center mt-6 text-sm text-gray-500 dark:text-gray-400",children:["Don't have an account?"," ",i.jsx(J0,{to:"/register",className:"text-blue-600 dark:text-blue-400 hover:underline font-medium",children:"Create one"})]})]})]})}function Jm(){const{register:r}=Ya(),{theme:x,toggle:w}=ci(),d=_s(),[T,C]=v.useState(""),[H,q]=v.useState(""),[Y,B]=v.useState(""),[R,D]=v.useState(""),[j,U]=v.useState(!1),E=async z=>{if(z.preventDefault(),D(""),H!==Y){D("Passwords don't match");return}U(!0);try{const _=Intl.DateTimeFormat().resolvedOptions().timeZone;await r(T,H,_),d("/")}catch(_){D(_.error||"Registration failed")}finally{U(!1)}};return i.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 px-4 transition-colors",children:[i.jsx("div",{className:"absolute top-4 right-4",children:i.jsx("button",{onClick:w,className:"p-2 rounded-xl bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:x==="dark"?i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})})}),i.jsxs("div",{className:"w-full max-w-sm",children:[i.jsxs("div",{className:"text-center mb-8",children:[i.jsx("div",{className:"inline-flex items-center justify-center w-14 h-14 bg-blue-600 rounded-2xl mb-4 shadow-lg shadow-blue-600/20",children:i.jsx("svg",{className:"w-8 h-8 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),i.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Create account"}),i.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1 text-sm",children:"Get started with your calendar"})]}),i.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-2xl shadow-xl shadow-gray-200/50 dark:shadow-black/20 border border-gray-100 dark:border-gray-700 p-6",children:i.jsxs("form",{onSubmit:E,className:"space-y-4",children:[R&&i.jsx("div",{className:"text-sm text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 px-3 py-2.5 rounded-xl",children:R}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1.5",children:"Email"}),i.jsx("input",{type:"email",value:T,onChange:z=>C(z.target.value),className:"w-full px-3.5 py-2.5 rounded-xl border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all text-sm",placeholder:"you@example.com",required:!0,autoFocus:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1.5",children:"Password"}),i.jsx("input",{type:"password",value:H,onChange:z=>q(z.target.value),className:"w-full px-3.5 py-2.5 rounded-xl border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all text-sm",placeholder:"Min. 10 characters",required:!0,minLength:10})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1.5",children:"Confirm password"}),i.jsx("input",{type:"password",value:Y,onChange:z=>B(z.target.value),className:"w-full px-3.5 py-2.5 rounded-xl border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all text-sm",placeholder:"Repeat your password",required:!0,minLength:10})]}),i.jsx("button",{type:"submit",disabled:j,className:"w-full py-2.5 bg-blue-600 hover:bg-blue-700 disabled:opacity-50 text-white rounded-xl font-medium transition-colors text-sm",children:j?"Creating account...":"Create account"})]})}),i.jsxs("p",{className:"text-center mt-6 text-sm text-gray-500 dark:text-gray-400",children:["Already have an account?"," ",i.jsx(J0,{to:"/login",className:"text-blue-600 dark:text-blue-400 hover:underline font-medium",children:"Sign in"})]})]})]})}function _l(r){return r.is_occurrence&&r.occurrence_start_time?r.occurrence_start_time:r.start_time}function ui(r){return r.is_occurrence&&r.occurrence_end_time?r.occurrence_end_time:r.end_time}function Wm({currentDate:r,events:x,calendars:w,visibleCalendarIds:d,onDateClick:T,onEventClick:C}){const H=Us(r),q=Hs(r),Y=qa(H),B=Un(q),R=W0({start:Y,end:B}),D=new Map(w.map(E=>[E.id,E.color])),j=x.filter(E=>d.has(E.calendar_id)),U=E=>j.filter(z=>{const _=tt(_l(z)),X=tt(ui(z));return Dl(_,E)||Dl(X,E)||_E});return i.jsxs("div",{className:"flex flex-col h-full",children:[i.jsx("div",{className:"grid grid-cols-7 border-b border-gray-200 dark:border-gray-700",children:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(E=>i.jsx("div",{className:"py-2 text-center text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide",children:E},E))}),i.jsx("div",{className:"grid grid-cols-7 flex-1 auto-rows-fr",children:R.map((E,z)=>{const _=$0(E,r),X=ii(E),I=U(E);return i.jsxs("div",{className:`min-h-[80px] border-b border-r border-gray-100 dark:border-gray-700/50 p-1 cursor-pointer transition-colors hover:bg-gray-50 dark:hover:bg-gray-800/50 + ${z%7===0?"border-l":""} + ${_?"":"bg-gray-50/50 dark:bg-gray-900/30"}`,onClick:()=>T(E),children:[i.jsx("div",{className:"flex justify-center mb-1",children:i.jsx("span",{className:`text-xs w-6 h-6 flex items-center justify-center rounded-full font-medium + ${X?"bg-blue-600 text-white":""} + ${!X&&_?"text-gray-700 dark:text-gray-300":""} + ${!X&&!_?"text-gray-400 dark:text-gray-600":""}`,children:_e(E,"d")})}),i.jsxs("div",{className:"space-y-0.5 overflow-hidden",children:[I.slice(0,3).map(te=>i.jsxs("button",{onClick:J=>{J.stopPropagation(),C(te)},className:"w-full text-left text-[10px] leading-tight px-1.5 py-0.5 rounded truncate text-white font-medium transition-opacity hover:opacity-80",style:{backgroundColor:D.get(te.calendar_id)||"#3B82F6"},children:[!te.all_day&&i.jsxs("span",{className:"opacity-80",children:[_e(tt(_l(te)),"h:mm")," "]}),te.title]},te.id+E.toISOString())),I.length>3&&i.jsxs("div",{className:"text-[10px] text-gray-500 dark:text-gray-400 text-center font-medium",children:["+",I.length-3," more"]})]})]},E.toISOString())})})]})}const Z0=Array.from({length:24},(r,x)=>x),li=60;function $m({currentDate:r,events:x,calendars:w,visibleCalendarIds:d,onTimeClick:T,onEventClick:C}){const H=qa(r),q=Array.from({length:7},(z,_)=>F0(H,_)),Y=new Map(w.map(z=>[z.id,z.color])),B=x.filter(z=>d.has(z.calendar_id)),R=B.filter(z=>z.all_day),D=B.filter(z=>!z.all_day),j=z=>D.filter(_=>Dl(tt(_l(_)),z)),U=z=>R.filter(_=>{const X=tt(_l(_)),I=tt(ui(_));return Dl(X,z)||Dl(I,z)||Xz}),E=z=>{const _=tt(_l(z)),X=I0(_),I=ni(_,X),te=tt(ui(z)),J=Math.max(ni(te,_),15);return{top:`${I}px`,height:`${J}px`,minHeight:"20px"}};return i.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[i.jsxs("div",{className:"flex border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:[i.jsx("div",{className:"w-16 flex-shrink-0"}),q.map(z=>{const _=ii(z);return i.jsxs("div",{className:"flex-1 text-center py-2 border-l border-gray-100 dark:border-gray-700/50",children:[i.jsx("div",{className:"text-[10px] font-semibold text-gray-500 dark:text-gray-400 uppercase",children:_e(z,"EEE")}),i.jsx("div",{className:`text-lg font-semibold mt-0.5 ${_?"bg-blue-600 text-white w-8 h-8 rounded-full flex items-center justify-center mx-auto":"text-gray-700 dark:text-gray-300"}`,children:_e(z,"d")})]},z.toISOString())})]}),R.length>0&&i.jsxs("div",{className:"flex border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:[i.jsx("div",{className:"w-16 flex-shrink-0 text-[10px] text-gray-400 dark:text-gray-500 text-right pr-2 py-1",children:"all-day"}),q.map(z=>i.jsx("div",{className:"flex-1 border-l border-gray-100 dark:border-gray-700/50 p-0.5 space-y-0.5",children:U(z).map(_=>i.jsx("button",{onClick:()=>C(_),className:"w-full text-left text-[10px] px-1.5 py-0.5 rounded text-white font-medium truncate hover:opacity-80",style:{backgroundColor:Y.get(_.calendar_id)||"#3B82F6"},children:_.title},_.id))},z.toISOString()))]}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsxs("div",{className:"flex relative",style:{height:`${24*li}px`},children:[i.jsx("div",{className:"w-16 flex-shrink-0 relative",children:Z0.map(z=>i.jsx("div",{className:"absolute w-full text-right pr-2 text-[10px] text-gray-400 dark:text-gray-500 -mt-2",style:{top:`${z*li}px`},children:z===0?"":_e(new Date(2e3,0,1,z),"h a")},z))}),q.map(z=>i.jsxs("div",{className:"flex-1 relative border-l border-gray-100 dark:border-gray-700/50",children:[Z0.map(_=>i.jsx("div",{className:"absolute w-full border-t border-gray-100 dark:border-gray-700/30 cursor-pointer hover:bg-blue-50/50 dark:hover:bg-blue-900/10",style:{top:`${_*li}px`,height:`${li}px`},onClick:()=>{const X=new Date(z);X.setHours(_,0,0,0),T(X)}},_)),j(z).map(_=>{const X=E(_);return i.jsxs("button",{onClick:I=>{I.stopPropagation(),C(_)},className:"absolute left-0.5 right-1 rounded-md px-1.5 py-0.5 text-[11px] text-white font-medium overflow-hidden hover:opacity-90 z-10 shadow-sm",style:{...X,backgroundColor:Y.get(_.calendar_id)||"#3B82F6"},children:[i.jsx("div",{className:"truncate",children:_.title}),i.jsx("div",{className:"opacity-75 truncate text-[10px]",children:_e(tt(_.start_time),"h:mm a")})]},_.id)})]},z.toISOString()))]})})]})}const V0=Array.from({length:24},(r,x)=>x),Ba=64;function Fm({currentDate:r,events:x,calendars:w,visibleCalendarIds:d,onTimeClick:T,onEventClick:C}){const H=new Map(w.map(j=>[j.id,j.color])),q=x.filter(j=>d.has(j.calendar_id)),Y=q.filter(j=>j.all_day&&Dl(tt(_l(j)),r)),B=q.filter(j=>!j.all_day&&Dl(tt(_l(j)),r)),R=ii(r),D=j=>{const U=tt(_l(j)),E=I0(U),z=ni(U,E),_=tt(ui(j)),X=Math.max(ni(_,U),15);return{top:`${z*(Ba/60)}px`,height:`${X*(Ba/60)}px`,minHeight:"24px"}};return i.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[i.jsxs("div",{className:"text-center py-3 border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:[i.jsx("div",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase",children:_e(r,"EEEE")}),i.jsx("div",{className:`text-2xl font-bold mt-1 ${R?"bg-blue-600 text-white w-10 h-10 rounded-full flex items-center justify-center mx-auto":"text-gray-800 dark:text-gray-200"}`,children:_e(r,"d")})]}),Y.length>0&&i.jsx("div",{className:"px-4 py-2 border-b border-gray-200 dark:border-gray-700 space-y-1 flex-shrink-0",children:Y.map(j=>i.jsx("button",{onClick:()=>C(j),className:"block w-full text-left text-sm px-3 py-1.5 rounded-lg text-white font-medium hover:opacity-80",style:{backgroundColor:H.get(j.calendar_id)||"#3B82F6"},children:j.title},j.id))}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsxs("div",{className:"flex relative",style:{height:`${24*Ba}px`},children:[i.jsx("div",{className:"w-20 flex-shrink-0 relative",children:V0.map(j=>i.jsx("div",{className:"absolute w-full text-right pr-3 text-xs text-gray-400 dark:text-gray-500 -mt-2",style:{top:`${j*Ba}px`},children:j===0?"":_e(new Date(2e3,0,1,j),"h a")},j))}),i.jsxs("div",{className:"flex-1 relative border-l border-gray-200 dark:border-gray-700",children:[V0.map(j=>i.jsx("div",{className:"absolute w-full border-t border-gray-100 dark:border-gray-700/30 cursor-pointer hover:bg-blue-50/50 dark:hover:bg-blue-900/10",style:{top:`${j*Ba}px`,height:`${Ba}px`},onClick:()=>{const U=new Date(r);U.setHours(j,0,0,0),T(U)}},j)),B.map(j=>{const U=D(j);return i.jsxs("button",{onClick:E=>{E.stopPropagation(),C(j)},className:"absolute left-1 right-4 rounded-lg px-3 py-1.5 text-white font-medium overflow-hidden hover:opacity-90 z-10 shadow-sm",style:{...U,backgroundColor:H.get(j.calendar_id)||"#3B82F6"},children:[i.jsx("div",{className:"text-sm truncate",children:j.title}),i.jsxs("div",{className:"text-xs opacity-80",children:[_e(tt(j.start_time),"h:mm a")," -"," ",_e(tt(j.end_time),"h:mm a")]}),j.location&&i.jsx("div",{className:"text-xs opacity-70 truncate",children:j.location})]},j.id)})]})]})})]})}function Il({open:r,onClose:x,title:w,children:d,wide:T}){return v.useEffect(()=>{if(!r)return;const C=H=>{H.key==="Escape"&&x()};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[r,x]),r?i.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center animate-fade-in",onClick:x,children:[i.jsx("div",{className:"absolute inset-0 bg-black/40 dark:bg-black/60"}),i.jsxs("div",{className:`relative bg-white dark:bg-gray-800 rounded-2xl shadow-2xl animate-slide-up + ${T?"w-full max-w-2xl":"w-full max-w-md"} max-h-[90vh] overflow-y-auto mx-4`,onClick:C=>C.stopPropagation(),children:[i.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 dark:border-gray-700",children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:w}),i.jsx("button",{onClick:x,className:"p-1 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),i.jsx("div",{className:"p-6",children:d})]})]}):null}function Im({open:r,onClose:x,onSaved:w,event:d,calendars:T,defaultDate:C,defaultCalendarId:H}){var oe;const q=!!d,Y=T.filter(Q=>Q.role!=="viewer"),[B,R]=v.useState(""),[D,j]=v.useState(""),[U,E]=v.useState(""),[z,_]=v.useState(""),[X,I]=v.useState(""),[te,J]=v.useState("09:00"),[ge,ce]=v.useState(""),[be,P]=v.useState("10:00"),[Z,Ne]=v.useState(!1),[ee,pe]=v.useState(!1),[Qe,Ve]=v.useState(""),[Re,p]=v.useState(!1);v.useEffect(()=>{var Q;if(r)if(Ve(""),p(!1),d){R(d.title),j(d.description||""),E(d.location||""),_(d.calendar_id),Ne(d.all_day);const ne=new Date(d.start_time),M=new Date(d.end_time);I(_e(ne,"yyyy-MM-dd")),J(_e(ne,"HH:mm")),ce(_e(M,"yyyy-MM-dd")),P(_e(M,"HH:mm"))}else{R(""),j(""),E(""),_(H||((Q=Y[0])==null?void 0:Q.id)||""),Ne(!1);const M=_e(C||new Date,"yyyy-MM-dd");I(M),ce(M),J("09:00"),P("10:00")}},[r,d,C,H]);const O=async Q=>{if(Q.preventDefault(),!(!B.trim()||!z)){pe(!0),Ve("");try{const ne=Intl.DateTimeFormat().resolvedOptions().timeZone,M=Z?`${X}T00:00:00`:`${X}T${te}:00`,A=Z?`${ge}T23:59:59`:`${ge}T${be}:00`,ve={title:B.trim(),description:D.trim()||void 0,location:U.trim()||void 0,start_time:new Date(M).toISOString(),end_time:new Date(A).toISOString(),timezone:ne,all_day:Z};q?await de.updateEvent(d.id,ve):await de.createEvent({...ve,calendar_id:z}),w(),x()}catch(ne){Ve(ne.error||"Failed to save event")}finally{pe(!1)}}},V=async()=>{if(d){pe(!0);try{await de.deleteEvent(d.id),w(),x()}catch(Q){Ve(Q.error||"Failed to delete event")}finally{pe(!1)}}},me=((oe=T.find(Q=>Q.id===z))==null?void 0:oe.color)||"#3B82F6";return i.jsx(Il,{open:r,onClose:x,title:q?"Edit Event":"New Event",children:i.jsxs("form",{onSubmit:O,className:"space-y-4",children:[Qe&&i.jsx("div",{className:"text-sm text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 px-3 py-2 rounded-lg",children:Qe}),i.jsx("div",{children:i.jsx("input",{type:"text",placeholder:"Event title",value:B,onChange:Q=>R(Q.target.value),className:"w-full text-lg font-medium bg-transparent border-0 border-b-2 border-gray-200 dark:border-gray-600 focus:border-blue-500 dark:focus:border-blue-400 focus:ring-0 px-0 py-2 text-gray-900 dark:text-white placeholder-gray-400 outline-none transition-colors",autoFocus:!0,required:!0})}),!q&&i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Calendar"}),i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-3 h-3 rounded-full",style:{backgroundColor:me}}),i.jsx("select",{value:z,onChange:Q=>_(Q.target.value),className:"w-full pl-8 pr-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",children:Y.map(Q=>i.jsx("option",{value:Q.id,children:Q.name},Q.id))})]})]}),i.jsx("div",{className:"flex items-center gap-3",children:i.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-700 dark:text-gray-300 cursor-pointer",children:[i.jsx("input",{type:"checkbox",checked:Z,onChange:Q=>Ne(Q.target.checked),className:"rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"}),"All day"]})}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Start"}),i.jsx("input",{type:"date",value:X,onChange:Q=>{I(Q.target.value),Q.target.value>ge&&ce(Q.target.value)},className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",required:!0}),!Z&&i.jsx("input",{type:"time",value:te,onChange:Q=>J(Q.target.value),className:"w-full mt-2 px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",required:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"End"}),i.jsx("input",{type:"date",value:ge,onChange:Q=>ce(Q.target.value),min:X,className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",required:!0}),!Z&&i.jsx("input",{type:"time",value:be,onChange:Q=>P(Q.target.value),className:"w-full mt-2 px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",required:!0})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Location"}),i.jsx("input",{type:"text",placeholder:"Add location",value:U,onChange:Q=>E(Q.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none placeholder-gray-400"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Description"}),i.jsx("textarea",{placeholder:"Add description",value:D,onChange:Q=>j(Q.target.value),rows:3,className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none resize-none placeholder-gray-400"})]}),i.jsxs("div",{className:"flex items-center justify-between pt-2",children:[i.jsxs("div",{children:[q&&!Re&&i.jsx("button",{type:"button",onClick:()=>p(!0),className:"text-sm text-red-500 hover:text-red-700 dark:hover:text-red-400 transition-colors",children:"Delete event"}),q&&Re&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm text-red-500",children:"Delete?"}),i.jsx("button",{type:"button",onClick:V,className:"text-sm text-white bg-red-500 hover:bg-red-600 px-3 py-1 rounded-lg transition-colors",disabled:ee,children:"Yes"}),i.jsx("button",{type:"button",onClick:()=>p(!1),className:"text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 transition-colors",children:"No"})]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{type:"button",onClick:x,className:"px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:"Cancel"}),i.jsx("button",{type:"submit",disabled:ee||!B.trim(),className:"px-4 py-2 text-sm text-white bg-blue-600 hover:bg-blue-700 disabled:opacity-50 rounded-lg transition-colors font-medium",children:ee?"Saving...":q?"Update":"Create"})]})]})]})})}const ai=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#06B6D4","#F97316","#6366F1","#14B8A6","#84CC16","#A855F7"];function Pm(r){navigator.clipboard.writeText(r)}function eh({open:r,onClose:x,onSaved:w,calendar:d}){const T=!!d,[C,H]=v.useState(""),[q,Y]=v.useState(ai[0]),[B,R]=v.useState(!0),[D,j]=v.useState(10),[U,E]=v.useState(0),[z,_]=v.useState(!1),[X,I]=v.useState(""),[te,J]=v.useState(!1),[ge,ce]=v.useState([]),[be,P]=v.useState(!1),[Z,Ne]=v.useState(""),[ee,pe]=v.useState(!1),[Qe,Ve]=v.useState(null),[Re,p]=v.useState(!1),O=v.useCallback(async()=>{if(d!=null&&d.id){P(!0);try{const A=await de.listSubscriptions(d.id);ce(A.items||[])}catch{ce([])}finally{P(!1)}}},[d==null?void 0:d.id]);v.useEffect(()=>{r&&(I(""),J(!1),Ne(""),d?(H(d.name),Y(d.color),R(d.count_for_availability??!0),j(d.default_reminder_minutes??10),E(d.sort_order??0),O()):(H(""),Y(ai[Math.floor(Math.random()*ai.length)]),R(!0),j(10),E(0),ce([])))},[r,d,O]);const V=async A=>{if(A.preventDefault(),!!C.trim()){_(!0),I("");try{T?await de.updateCalendar(d.id,{name:C.trim(),color:q,count_for_availability:B,default_reminder_minutes:D===""?void 0:D,sort_order:U===""?void 0:U}):await de.createCalendar({name:C.trim(),color:q}),w(),x()}catch(ve){I(ve.error||"Failed to save calendar")}finally{_(!1)}}},me=async()=>{if(d){_(!0);try{await de.deleteCalendar(d.id),w(),x()}catch(A){I(A.error||"Failed to delete calendar")}finally{_(!1)}}},oe=async A=>{if(A.preventDefault(),!(!(d!=null&&d.id)||!Z.trim())){pe(!0);try{await de.addSubscription(d.id,{url:Z.trim()}),Ne(""),O(),w()}catch(ve){I(ve.error||"Failed to add subscription")}finally{pe(!1)}}},Q=async A=>{if(d!=null&&d.id)try{await de.deleteSubscription(d.id,A),O(),w()}catch(ve){I(ve.error||"Failed to remove subscription")}},ne=async A=>{if(d!=null&&d.id){Ve(A);try{await de.syncSubscription(d.id,A),O(),w()}catch(ve){I(ve.error||"Failed to sync")}finally{Ve(null)}}},M=A=>{Pm(A),p(!0),setTimeout(()=>p(!1),1500)};return i.jsx(Il,{open:r,onClose:x,title:T?"Edit Calendar":"New Calendar",children:i.jsxs("form",{onSubmit:V,className:"space-y-5",children:[X&&i.jsx("div",{className:"text-sm text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 px-3 py-2 rounded-lg",children:X}),i.jsx("div",{children:i.jsx("input",{type:"text",placeholder:"Calendar name",value:C,onChange:A=>H(A.target.value),className:"w-full text-lg font-medium bg-transparent border-0 border-b-2 border-gray-200 dark:border-gray-600 focus:border-blue-500 dark:focus:border-blue-400 focus:ring-0 px-0 py-2 text-gray-900 dark:text-white placeholder-gray-400 outline-none transition-colors",autoFocus:!0,required:!0,maxLength:80})}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-2",children:"Color"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:ai.map(A=>i.jsx("button",{type:"button",onClick:()=>Y(A),className:`w-8 h-8 rounded-full transition-all ${q===A?"ring-2 ring-offset-2 ring-offset-white dark:ring-offset-gray-800 scale-110":"hover:scale-110"}`,style:{backgroundColor:A,outlineColor:q===A?A:void 0}},A))})]}),T&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"checkbox",id:"count_for_availability",checked:B,onChange:A=>R(A.target.checked),className:"rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"}),i.jsx("label",{htmlFor:"count_for_availability",className:"text-sm text-gray-700 dark:text-gray-300",children:"Include in availability / Count as busy"})]}),(d==null?void 0:d.availability_url)&&i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Availability URL"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",readOnly:!0,value:d.availability_url,className:"flex-1 px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 text-sm text-gray-600 dark:text-gray-400 truncate"}),i.jsx("button",{type:"button",onClick:()=>M(d.availability_url),className:"px-3 py-2 text-sm text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-colors",children:Re?"Copied!":"Copy"})]}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Share with Calendly, Cal.com, etc. to block busy times"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Default reminder (min)"}),i.jsx("input",{type:"number",min:0,max:10080,value:D,onChange:A=>j(A.target.value===""?"":parseInt(A.target.value,10)||0),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Sort order"}),i.jsx("input",{type:"number",value:U,onChange:A=>E(A.target.value===""?"":parseInt(A.target.value,10)||0),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]})]}),(d==null?void 0:d.role)==="owner"||(d==null?void 0:d.role)==="editor"?i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-2",children:"Subscribed URLs"}),be?i.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Loading..."}):ge.length===0?i.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"No subscriptions. Add a URL to import events from an external calendar."}):i.jsx("ul",{className:"space-y-2 mb-2",children:ge.map(A=>i.jsxs("li",{className:"flex items-center justify-between gap-2 p-2 rounded-lg bg-gray-50 dark:bg-gray-800 text-sm",children:[i.jsx("span",{className:"truncate text-gray-700 dark:text-gray-300",title:A.source_url,children:A.source_url}),i.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[i.jsx("button",{type:"button",onClick:()=>ne(A.id),disabled:Qe===A.id,className:"px-2 py-1 text-xs text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded transition-colors disabled:opacity-50",children:Qe===A.id?"Syncing...":"Sync"}),i.jsx("button",{type:"button",onClick:()=>Q(A.id),className:"px-2 py-1 text-xs text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 rounded transition-colors",children:"Remove"})]})]},A.id))}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"url",placeholder:"https://... or webcal://...",value:Z,onChange:A=>Ne(A.target.value),onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),oe(A))},className:"flex-1 px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none placeholder-gray-400"}),i.jsx("button",{type:"button",onClick:oe,disabled:ee||!Z.trim(),className:"px-3 py-2 text-sm text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-colors font-medium disabled:opacity-50",children:ee?"Adding...":"Add"})]})]}):null]}),i.jsxs("div",{className:"flex items-center justify-between pt-2",children:[i.jsxs("div",{children:[T&&(d==null?void 0:d.role)==="owner"&&!te&&i.jsx("button",{type:"button",onClick:()=>J(!0),className:"text-sm text-red-500 hover:text-red-700 dark:hover:text-red-400 transition-colors",children:"Delete calendar"}),T&&te&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm text-red-500",children:"Delete?"}),i.jsx("button",{type:"button",onClick:me,className:"text-sm text-white bg-red-500 hover:bg-red-600 px-3 py-1 rounded-lg transition-colors",disabled:z,children:"Yes"}),i.jsx("button",{type:"button",onClick:()=>J(!1),className:"text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 transition-colors",children:"No"})]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{type:"button",onClick:x,className:"px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:"Cancel"}),i.jsx("button",{type:"submit",disabled:z||!C.trim(),className:"px-4 py-2 text-sm text-white bg-blue-600 hover:bg-blue-700 disabled:opacity-50 rounded-lg transition-colors font-medium",children:z?"Saving...":T?"Update":"Create"})]})]})]})})}function th({open:r,onClose:x,onSaved:w,targetCalendarId:d,calendars:T}){var te;const C=!d,[H,q]=v.useState(""),[Y,B]=v.useState(""),[R,D]=v.useState("#3B82F6"),[j,U]=v.useState(d||((te=T[0])==null?void 0:te.id)||""),[E,z]=v.useState(!1),[_,X]=v.useState(""),I=async J=>{if(J.preventDefault(),!!H.trim()){z(!0),X("");try{C?await de.addCalendarFromUrl({url:H.trim(),name:Y.trim()||void 0,color:R||void 0}):await de.importCalendarUrl({calendar_id:j,url:H.trim()}),w(),x(),q(""),B("")}catch(ge){X(ge.error||"Failed to add calendar")}finally{z(!1)}}};return i.jsx(Il,{open:r,onClose:x,title:C?"Add calendar from URL":"Import from URL",children:i.jsxs("form",{onSubmit:I,className:"space-y-4",children:[_&&i.jsx("div",{className:"text-sm text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 px-3 py-2 rounded-lg break-words",children:_}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Calendar URL"}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1.5",children:'Google Calendar: Settings → your calendar → Integrate calendar → copy "Secret address in iCal format"'}),i.jsx("input",{type:"text",placeholder:"https://... or webcal://...",value:H,onChange:J=>q(J.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none placeholder-gray-400",required:!0})]}),C&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Calendar name"}),i.jsx("input",{type:"text",placeholder:"Imported Calendar",value:Y,onChange:J=>B(J.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none placeholder-gray-400"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Color"}),i.jsx("input",{type:"color",value:R,onChange:J=>D(J.target.value),className:"w-full h-10 rounded-lg border border-gray-200 dark:border-gray-600 cursor-pointer"})]})]}),!C&&T.length>1&&i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Import into"}),i.jsx("select",{value:j,onChange:J=>U(J.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",children:T.map(J=>i.jsx("option",{value:J.id,children:J.name},J.id))})]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[i.jsx("button",{type:"button",onClick:x,className:"px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:"Cancel"}),i.jsx("button",{type:"submit",disabled:E||!H.trim(),className:"px-4 py-2 text-sm text-white bg-blue-600 hover:bg-blue-700 disabled:opacity-50 rounded-lg transition-colors font-medium",children:E?"Adding...":C?"Create calendar":"Import"})]})]})})}function lh({selectedDate:r,onDateSelect:x}){const[w,d]=v.useState(r),T=Us(w),C=Hs(w),H=qa(T),q=Un(C),Y=W0({start:H,end:q});return i.jsxs("div",{className:"select-none",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("button",{onClick:()=>d(B=>P0(B)),className:"p-1 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-500 dark:text-gray-400 transition-colors",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),i.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:_e(w,"MMMM yyyy")}),i.jsx("button",{onClick:()=>d(B=>ef(B,1)),className:"p-1 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-500 dark:text-gray-400 transition-colors",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]}),i.jsxs("div",{className:"grid grid-cols-7 gap-0",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(B=>i.jsx("div",{className:"text-center text-[10px] font-medium text-gray-400 dark:text-gray-500 py-1",children:B},B)),Y.map(B=>{const R=$0(B,w),D=Dl(B,r),j=ii(B);return i.jsx("button",{onClick:()=>x(B),className:`text-[11px] w-7 h-7 rounded-full flex items-center justify-center mx-auto transition-colors + ${R?"text-gray-700 dark:text-gray-300":"text-gray-300 dark:text-gray-600"} + ${D?"bg-blue-600 text-white! font-semibold":""} + ${j&&!D?"bg-blue-100 dark:bg-blue-900/40 text-blue-600 dark:text-blue-400 font-semibold":""} + ${D?"":"hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:_e(B,"d")},B.toISOString())})]})]})}function ah(){var ul,Yt,At;const{user:r,logout:x}=Ya(),{theme:w,toggle:d}=ci(),[T,C]=v.useState(new Date),[H,q]=v.useState("month"),[Y,B]=v.useState([]),[R,D]=v.useState([]),[j,U]=v.useState(new Set),[E,z]=v.useState(!0),[_,X]=v.useState(!1),[I,te]=v.useState(!1),[J,ge]=v.useState(!1),[ce,be]=v.useState(null),[P,Z]=v.useState(null),[Ne,ee]=v.useState(),[pe,Qe]=v.useState(!1),[Ve,Re]=v.useState(!0),p=v.useCallback(async()=>{try{const Ee=(await de.listCalendars()).items||[];B(Ee),U(Pe=>{if(Pe.size===0)return new Set(Ee.map(lt=>lt.id));const Lt=new Set(Pe);for(const lt of Ee)Pe.has(lt.id)||Lt.add(lt.id);return Lt})}catch{}},[]),O=v.useCallback(async()=>{const W=H==="month"?qa(Us(T)):H==="week"?qa(T):T,Ee=H==="month"?Un(Hs(T)):H==="week"?Un(T):T,Pe=new Date(W);Pe.setDate(Pe.getDate()-1);const Lt=new Date(Ee);Lt.setDate(Lt.getDate()+1);try{const lt=await de.listEvents({start:Pe.toISOString(),end:Lt.toISOString()});D(lt.items||[])}catch{}Re(!1)},[T,H]);v.useEffect(()=>{p()},[p]),v.useEffect(()=>{Y.length>0&&O()},[O,Y]);const V=W=>{C(H==="month"?Ee=>W===1?ef(Ee,1):P0(Ee):H==="week"?Ee=>W===1?Dm(Ee,1):_m(Ee):Ee=>W===1?F0(Ee,1):wm(Ee))},me=()=>C(new Date),oe=W=>{U(Ee=>{const Pe=new Set(Ee);return Pe.has(W)?Pe.delete(W):Pe.add(W),Pe})},Q=W=>{H==="month"?(C(W),q("day")):(ee(W),be(null),X(!0))},ne=W=>{ee(W),be(null),X(!0)},M=W=>{be(W),X(!0)},A=()=>{O()},ve=()=>{p().then(O)},Ke=H==="month"?_e(T,"MMMM yyyy"):H==="week"?`${_e(qa(T),"MMM d")} - ${_e(Un(T),"MMM d, yyyy")}`:_e(T,"EEEE, MMMM d, yyyy");return i.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-gray-900 transition-colors",children:[i.jsxs("header",{className:"flex items-center justify-between px-4 py-2.5 border-b border-gray-200 dark:border-gray-700 flex-shrink-0 bg-white dark:bg-gray-900",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{onClick:()=>z(W=>!W),className:"p-2 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-600 dark:text-gray-400 transition-colors lg:hidden",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),i.jsx("button",{onClick:()=>z(W=>!W),className:"p-2 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-600 dark:text-gray-400 transition-colors hidden lg:block",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:i.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),i.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white hidden sm:block",children:"Calendar"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:me,className:"px-3 py-1.5 text-sm font-medium border border-gray-300 dark:border-gray-600 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",children:"Today"}),i.jsxs("div",{className:"flex items-center",children:[i.jsx("button",{onClick:()=>V(-1),className:"p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-600 dark:text-gray-400 transition-colors",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),i.jsx("button",{onClick:()=>V(1),className:"p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-600 dark:text-gray-400 transition-colors",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]}),i.jsx("h2",{className:"text-base font-semibold text-gray-900 dark:text-white min-w-[180px] text-center hidden sm:block",children:Ke})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"hidden sm:flex items-center bg-gray-100 dark:bg-gray-800 rounded-lg p-0.5",children:["month","week","day"].map(W=>i.jsx("button",{onClick:()=>q(W),className:`px-3 py-1 text-xs font-medium rounded-md transition-colors capitalize ${H===W?"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white"}`,children:W},W))}),i.jsx("button",{onClick:d,className:"p-2 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-600 dark:text-gray-400 transition-colors",children:w==="dark"?i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})}),i.jsxs("div",{className:"relative",children:[i.jsx("button",{onClick:()=>Qe(W=>!W),className:"w-8 h-8 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white text-sm font-semibold",children:((Yt=(ul=r==null?void 0:r.email)==null?void 0:ul[0])==null?void 0:Yt.toUpperCase())||"U"}),pe&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>Qe(!1)}),i.jsxs("div",{className:"absolute right-0 mt-2 w-56 bg-white dark:bg-gray-800 rounded-xl shadow-lg border border-gray-200 dark:border-gray-700 py-1 z-50 animate-scale-in",children:[i.jsxs("div",{className:"px-4 py-2.5 border-b border-gray-100 dark:border-gray-700",children:[i.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white truncate",children:r==null?void 0:r.email}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:r==null?void 0:r.timezone})]}),i.jsx("button",{onClick:()=>{Qe(!1),x()},className:"w-full text-left px-4 py-2 text-sm text-red-600 dark:text-red-400 hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors",children:"Sign out"})]})]})]})]})]}),i.jsxs("div",{className:"sm:hidden text-center py-2 border-b border-gray-100 dark:border-gray-800 flex-shrink-0",children:[i.jsx("span",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:Ke}),i.jsx("div",{className:"flex items-center justify-center gap-1 mt-1",children:["month","week","day"].map(W=>i.jsx("button",{onClick:()=>q(W),className:`px-2.5 py-0.5 text-xs font-medium rounded-md transition-colors capitalize ${H===W?"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400":"text-gray-500 dark:text-gray-400"}`,children:W},W))})]}),i.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[E&&i.jsxs("aside",{className:"w-64 border-r border-gray-200 dark:border-gray-700 flex-shrink-0 overflow-y-auto bg-white dark:bg-gray-900 flex flex-col",children:[i.jsx("div",{className:"p-4",children:i.jsxs("button",{onClick:()=>{be(null),ee(new Date),X(!0)},className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium text-sm shadow-lg shadow-blue-600/20 transition-all hover:shadow-blue-600/30",children:[i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"New Event"]})}),i.jsx("div",{className:"px-4 pb-4",children:i.jsx(lh,{selectedDate:T,onDateSelect:W=>C(W)})}),i.jsxs("div",{className:"px-4 pb-4 flex-1",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("h3",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"My Calendars"}),i.jsxs("div",{className:"flex gap-0.5",children:[i.jsx("button",{onClick:()=>ge(!0),className:"p-1 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",title:"Add from URL",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})})}),i.jsx("button",{onClick:()=>{Z(null),te(!0)},className:"p-1 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",title:"New calendar",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})})]})]}),i.jsx("div",{className:"space-y-0.5",children:Y.map(W=>i.jsxs("div",{className:"flex items-center gap-2 py-1.5 px-1 rounded-lg group hover:bg-gray-50 dark:hover:bg-gray-800/50",children:[i.jsx("button",{onClick:()=>oe(W.id),className:"flex-shrink-0",children:i.jsx("div",{className:"w-4 h-4 rounded border-2 transition-colors flex items-center justify-center",style:{borderColor:W.color,backgroundColor:j.has(W.id)?W.color:"transparent"},children:j.has(W.id)&&i.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})})}),i.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 flex-1 truncate",children:W.name}),W.role==="owner"&&i.jsx("button",{onClick:()=>{Z(W),te(!0)},className:"p-0.5 rounded opacity-0 group-hover:opacity-100 hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-400 transition-all",children:i.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})})})]},W.id))})]})]}),i.jsx("main",{className:"flex-1 overflow-hidden",children:Ve?i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsx("div",{className:"w-8 h-8 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"})}):H==="month"?i.jsx(Wm,{currentDate:T,events:R,calendars:Y,visibleCalendarIds:j,onDateClick:Q,onEventClick:M}):H==="week"?i.jsx($m,{currentDate:T,events:R,calendars:Y,visibleCalendarIds:j,onTimeClick:ne,onEventClick:M}):i.jsx(Fm,{currentDate:T,events:R,calendars:Y,visibleCalendarIds:j,onTimeClick:ne,onEventClick:M})})]}),i.jsx(Im,{open:_,onClose:()=>X(!1),onSaved:A,event:ce,calendars:Y,defaultDate:Ne,defaultCalendarId:(At=Y.find(W=>W.role==="owner"))==null?void 0:At.id}),i.jsx(eh,{open:I,onClose:()=>te(!1),onSaved:ve,calendar:P}),i.jsx(th,{open:J,onClose:()=>ge(!1),onSaved:ve,targetCalendarId:null,calendars:Y})]})}function nh(){const[r,x]=v.useState([]),[w,d]=v.useState(""),[T,C]=v.useState(!0),[H,q]=v.useState(!1),[Y,B]=v.useState(null),R=v.useCallback(async()=>{try{const U=await de.listContacts(w||void 0);x(U.items||[])}finally{C(!1)}},[w]);v.useEffect(()=>{R()},[R]);const D=()=>{B(null),q(!0)},j=U=>{B(U),q(!0)};return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:[i.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Contacts"}),i.jsxs("button",{onClick:D,className:"flex items-center gap-2 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-xl transition-colors",children:[i.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add contact"]})]}),i.jsx("div",{className:"px-6 py-3 border-b border-gray-100 dark:border-gray-700/50 flex-shrink-0",children:i.jsxs("div",{className:"relative",children:[i.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),i.jsx("input",{type:"text",placeholder:"Search contacts...",value:w,onChange:U=>d(U.target.value),className:"w-full pl-10 pr-4 py-2 rounded-xl border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]})}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:T?i.jsx("div",{className:"flex items-center justify-center h-40",children:i.jsx("div",{className:"w-6 h-6 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"})}):r.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-gray-400 dark:text-gray-500",children:[i.jsx("svg",{className:"w-12 h-12 mb-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})}),i.jsx("span",{className:"text-sm",children:"No contacts yet"})]}):i.jsx("div",{className:"divide-y divide-gray-100 dark:divide-gray-700/50",children:r.map(U=>{var E,z;return i.jsxs("button",{onClick:()=>j(U),className:"w-full flex items-center gap-4 px-6 py-3.5 hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors text-left",children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white font-semibold text-sm flex-shrink-0",children:(((E=U.first_name)==null?void 0:E[0])||((z=U.email)==null?void 0:z[0])||"?").toUpperCase()}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white truncate",children:[U.first_name,U.last_name].filter(Boolean).join(" ")||U.email||"Unnamed"}),i.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:[U.email,U.company].filter(Boolean).join(" - ")})]}),U.phone&&i.jsx("span",{className:"text-xs text-gray-400 dark:text-gray-500 flex-shrink-0",children:U.phone})]},U.id)})})}),i.jsx(uh,{open:H,onClose:()=>q(!1),onSaved:R,contact:Y})]})}function uh({open:r,onClose:x,onSaved:w,contact:d}){const T=!!d,[C,H]=v.useState(""),[q,Y]=v.useState(""),[B,R]=v.useState(""),[D,j]=v.useState(""),[U,E]=v.useState(""),[z,_]=v.useState(""),[X,I]=v.useState(!1),[te,J]=v.useState(""),[ge,ce]=v.useState(!1);v.useEffect(()=>{r&&(J(""),ce(!1),d?(H(d.first_name||""),Y(d.last_name||""),R(d.email||""),j(d.phone||""),E(d.company||""),_(d.notes||"")):(H(""),Y(""),R(""),j(""),E(""),_("")))},[r,d]);const be=async Z=>{Z.preventDefault(),I(!0),J("");try{const Ne={first_name:C.trim()||void 0,last_name:q.trim()||void 0,email:B.trim()||void 0,phone:D.trim()||void 0,company:U.trim()||void 0,notes:z.trim()||void 0};T?await de.updateContact(d.id,Ne):await de.createContact(Ne),w(),x()}catch(Ne){J(Ne.error||"Failed to save contact")}finally{I(!1)}},P=async()=>{if(d){I(!0);try{await de.deleteContact(d.id),w(),x()}catch(Z){J(Z.error||"Failed to delete")}finally{I(!1)}}};return i.jsx(Il,{open:r,onClose:x,title:T?"Edit Contact":"New Contact",children:i.jsxs("form",{onSubmit:be,className:"space-y-4",children:[te&&i.jsx("div",{className:"text-sm text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 px-3 py-2 rounded-lg",children:te}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"First name"}),i.jsx("input",{type:"text",value:C,onChange:Z=>H(Z.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",autoFocus:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Last name"}),i.jsx("input",{type:"text",value:q,onChange:Z=>Y(Z.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Email"}),i.jsx("input",{type:"email",value:B,onChange:Z=>R(Z.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Phone"}),i.jsx("input",{type:"tel",value:D,onChange:Z=>j(Z.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Company"}),i.jsx("input",{type:"text",value:U,onChange:Z=>E(Z.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Notes"}),i.jsx("textarea",{value:z,onChange:Z=>_(Z.target.value),rows:2,className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none resize-none"})]}),i.jsxs("div",{className:"flex items-center justify-between pt-2",children:[i.jsxs("div",{children:[T&&!ge&&i.jsx("button",{type:"button",onClick:()=>ce(!0),className:"text-sm text-red-500 hover:text-red-700 dark:hover:text-red-400 transition-colors",children:"Delete"}),T&&ge&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm text-red-500",children:"Delete?"}),i.jsx("button",{type:"button",onClick:P,className:"text-sm text-white bg-red-500 hover:bg-red-600 px-3 py-1 rounded-lg transition-colors",disabled:X,children:"Yes"}),i.jsx("button",{type:"button",onClick:()=>ce(!1),className:"text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 transition-colors",children:"No"})]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{type:"button",onClick:x,className:"px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:"Cancel"}),i.jsx("button",{type:"submit",disabled:X,className:"px-4 py-2 text-sm text-white bg-blue-600 hover:bg-blue-700 disabled:opacity-50 rounded-lg transition-colors font-medium",children:X?"Saving...":T?"Update":"Create"})]})]})]})})}const K0={low:"bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400",medium:"bg-blue-100 dark:bg-blue-900/40 text-blue-700 dark:text-blue-300",high:"bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300",critical:"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300"};function ih({task:r,onDragStart:x,onClick:w}){var T;const d=K0[r.priority]||K0.medium;return i.jsx("div",{draggable:!!x,onDragStart:C=>x==null?void 0:x(C,r),onClick:w,className:"group cursor-pointer rounded-lg border border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-800 p-3 shadow-sm hover:shadow-md transition-shadow",children:i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx("div",{className:"mt-0.5 cursor-grab active:cursor-grabbing text-gray-400 dark:text-gray-500 group-hover:text-gray-600 dark:group-hover:text-gray-400",children:i.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:i.jsx("path",{d:"M7 2a2 2 0 012 2v12a2 2 0 01-2 2h6a2 2 0 01-2-2V4a2 2 0 012-2h6z"})})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"font-medium text-gray-900 dark:text-gray-100 truncate",children:r.title}),r.due_date&&i.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:["Due ",_e(new Date(r.due_date),"MMM d, yyyy")]}),i.jsxs("div",{className:"flex flex-wrap gap-1 mt-2",children:[i.jsx("span",{className:`text-xs px-2 py-0.5 rounded ${d}`,children:r.priority}),(T=r.tags)==null?void 0:T.map(C=>i.jsx("span",{className:"text-xs px-2 py-0.5 rounded",style:{backgroundColor:`${C.color}20`,color:C.color},children:C.name},C.id))]})]})]})})}const ch=[{id:"todo",title:"To Do",status:"todo"},{id:"in_progress",title:"In Progress",status:"in_progress"},{id:"done",title:"Done",status:"done"}],sh={id:"archived",title:"Archived",status:"archived"};function rh({tasks:r,onTaskClick:x,onStatusChange:w,showArchived:d=!1}){const[T,C]=v.useState(null),[H,q]=v.useState(null),Y=d?[sh]:ch,B=Y.reduce((E,z)=>(E[z.status]=r.filter(_=>_.status===z.status),E),{}),R=(E,z)=>{C(z),E.dataTransfer.setData("text/plain",z.id),E.dataTransfer.effectAllowed="move"},D=(E,z)=>{E.preventDefault(),E.dataTransfer.dropEffect="move",q(z)},j=()=>{q(null)},U=(E,z)=>{E.preventDefault(),q(null);const _=E.dataTransfer.getData("text/plain");_&&T&&T.status!==z&&w(_,z),C(null)};return i.jsx("div",{className:"flex gap-4 overflow-x-auto pb-4 flex-1 min-h-0",children:Y.map(E=>{var z;return i.jsxs("div",{onDragOver:_=>D(_,E.status),onDragLeave:j,onDrop:_=>U(_,E.status),className:`flex-shrink-0 w-72 flex flex-col rounded-lg border-2 transition-colors ${H===E.status?"border-blue-400 dark:border-blue-500 bg-blue-50/50 dark:bg-blue-900/20":"border-gray-200 dark:border-gray-600"}`,children:[i.jsxs("div",{className:"p-3 border-b border-gray-200 dark:border-gray-600",children:[i.jsx("h3",{className:"font-semibold text-gray-900 dark:text-gray-100",children:E.title}),i.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:[((z=B[E.status])==null?void 0:z.length)??0," tasks"]})]}),i.jsx("div",{className:"flex-1 p-3 overflow-y-auto space-y-2 min-h-[200px]",children:(B[E.status]??[]).map(_=>i.jsx(ih,{task:_,onDragStart:R,onClick:()=>x(_)},_.id))})]},E.id)})})}const dh=["todo","in_progress","done"],oh=["low","medium","high","critical"];function fh({open:r,onClose:x,onSaved:w,task:d,projects:T,tags:C}){const H=!!d,[q,Y]=v.useState(""),[B,R]=v.useState(""),[D,j]=v.useState("todo"),[U,E]=v.useState("medium"),[z,_]=v.useState(""),[X,I]=v.useState(""),[te,J]=v.useState(!1),[ge,ce]=v.useState(""),[be,P]=v.useState(!1);v.useEffect(()=>{r&&(ce(""),P(!1),d?(Y(d.title),R(d.description||""),j(d.status),E(d.priority),_(d.due_date?_e(new Date(d.due_date),"yyyy-MM-dd"):""),I(d.project_id||"")):(Y(""),R(""),j("todo"),E("medium"),_(""),I("")))},[r,d]);const Z=async ee=>{if(ee.preventDefault(),!!q.trim()){J(!0),ce("");try{H?await de.updateTask(d.id,{title:q.trim(),description:B||void 0,status:D,priority:U,due_date:z||void 0,project_id:X||void 0}):await de.createTask({title:q.trim(),description:B||void 0,status:D,priority:U,due_date:z||void 0,project_id:X||void 0}),w(),x()}catch(pe){ce((pe==null?void 0:pe.error)||"Failed to save task")}finally{J(!1)}}},Ne=async()=>{if(d){J(!0);try{await de.deleteTask(d.id),w(),x()}catch{ce("Failed to delete task")}finally{J(!1)}}};return i.jsx(Il,{open:r,onClose:x,title:H?"Edit Task":"New Task",wide:!0,children:i.jsxs("form",{onSubmit:Z,className:"space-y-4",children:[ge&&i.jsx("div",{className:"p-3 rounded-lg bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 text-sm",children:ge}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Title"}),i.jsx("input",{type:"text",value:q,onChange:ee=>Y(ee.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100",placeholder:"Task title",required:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Description"}),i.jsx("textarea",{value:B,onChange:ee=>R(ee.target.value),rows:3,className:"w-full px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100",placeholder:"Markdown supported"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Status"}),i.jsx("select",{value:D,onChange:ee=>j(ee.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100",children:dh.map(ee=>i.jsx("option",{value:ee,children:ee.replace("_"," ")},ee))})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Priority"}),i.jsx("select",{value:U,onChange:ee=>E(ee.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100",children:oh.map(ee=>i.jsx("option",{value:ee,children:ee},ee))})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Due Date"}),i.jsx("input",{type:"date",value:z,onChange:ee=>_(ee.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Project"}),i.jsxs("select",{value:X,onChange:ee=>I(ee.target.value),className:"w-full px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100",children:[i.jsx("option",{value:"",children:"None"}),T.map(ee=>i.jsx("option",{value:ee.id,children:ee.name},ee.id))]})]})]}),i.jsxs("div",{className:"flex justify-between pt-4",children:[i.jsx("div",{children:H&&i.jsx("button",{type:"button",onClick:()=>P(!0),className:"text-red-600 dark:text-red-400 hover:underline text-sm",children:"Delete task"})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{type:"button",onClick:x,className:"px-4 py-2 rounded-lg border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700",children:"Cancel"}),i.jsx("button",{type:"submit",disabled:te||!q.trim(),className:"px-4 py-2 rounded-lg bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50",children:te?"Saving...":H?"Save":"Create"})]})]}),be&&i.jsxs("div",{className:"mt-4 p-4 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800",children:[i.jsx("p",{className:"text-red-700 dark:text-red-300 text-sm mb-2",children:"Delete this task? This cannot be undone."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{type:"button",onClick:()=>P(!1),className:"px-3 py-1 rounded bg-gray-200 dark:bg-gray-600 text-sm",children:"Cancel"}),i.jsx("button",{type:"button",onClick:Ne,disabled:te,className:"px-3 py-1 rounded bg-red-600 text-white text-sm hover:bg-red-700 disabled:opacity-50",children:"Delete"})]})]})]})})}function gh({projects:r,selectedProjectId:x,onSelectProject:w,showArchived:d,onToggleArchived:T}){return i.jsxs("div",{className:"w-56 flex-shrink-0 border-r border-gray-200 dark:border-gray-700 flex flex-col",children:[i.jsx("div",{className:"p-3 border-b border-gray-200 dark:border-gray-700",children:i.jsx("h3",{className:"font-semibold text-gray-900 dark:text-gray-100 text-sm",children:"Projects"})}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-2",children:[i.jsx("button",{onClick:()=>w(null),className:`w-full text-left px-3 py-2 rounded-lg text-sm transition-colors ${x===null?"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:"All Tasks"}),r.map(C=>i.jsxs("button",{onClick:()=>w(C.id),className:`w-full text-left px-3 py-2 rounded-lg text-sm transition-colors flex items-center gap-2 ${x===C.id?"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:[i.jsx("span",{className:"w-3 h-3 rounded-full flex-shrink-0",style:{backgroundColor:C.color}}),C.name]},C.id)),i.jsx("div",{className:"mt-2 pt-2 border-t border-gray-200 dark:border-gray-700",children:i.jsxs("label",{className:"flex items-center gap-2 px-3 py-2 cursor-pointer text-sm text-gray-600 dark:text-gray-400",children:[i.jsx("input",{type:"checkbox",checked:d,onChange:T,className:"rounded border-gray-300 dark:border-gray-600"}),"Show archived"]})})]})]})}function mh(){const[r,x]=v.useState([]),[w,d]=v.useState([]),[T,C]=v.useState([]),[H,q]=v.useState(!0),[Y,B]=v.useState(!1),[R,D]=v.useState(null),[j,U]=v.useState(null),[E,z]=v.useState(!1),_=v.useCallback(async()=>{try{const P={};j&&(P.project_id=j);const Z=await de.listTasks(P);x(Z.items||[])}catch{x([])}},[j]),X=v.useCallback(async()=>{try{const P=await de.listProjects();d(P.items||[])}catch{d([])}},[]),I=v.useCallback(async()=>{try{const P=await de.listTags();C(P.items||[])}catch{C([])}},[]);v.useEffect(()=>{q(!0),Promise.all([_(),X(),I()]).finally(()=>q(!1))},[_,X,I]);const te=P=>{D(P),B(!0)},J=async(P,Z)=>{try{Z==="done"?await de.markTaskComplete(P):await de.markTaskUncomplete(P,Z),_()}catch{x(Ne=>Ne)}},ge=()=>{_()},ce=()=>{B(!1),D(null)},be=E?r.filter(P=>P.status==="archived"):r.filter(P=>P.status!=="archived");return i.jsxs("div",{className:"h-full flex flex-col bg-gray-50 dark:bg-gray-900",children:[i.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:[i.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:"To-do List"}),i.jsx("button",{onClick:()=>{D(null),B(!0)},className:"px-4 py-2 rounded-lg bg-blue-600 text-white hover:bg-blue-700 transition-colors",children:"New Task"})]}),i.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[i.jsx(gh,{projects:w,selectedProjectId:j,onSelectProject:U,showArchived:E,onToggleArchived:()=>z(P=>!P)}),i.jsx("div",{className:"flex-1 overflow-hidden p-4",children:H?i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx("div",{className:"w-8 h-8 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"})}):i.jsx(rh,{tasks:be,onTaskClick:te,onStatusChange:J,showArchived:E})})]}),i.jsx(fh,{open:Y,onClose:ce,onSaved:ge,task:R,projects:w,tags:T})]})}const hh=[{key:"calendars",label:"Calendars",permissions:["read","write"]},{key:"events",label:"Events",permissions:["read","write"]},{key:"contacts",label:"Contacts",permissions:["read","write"]},{key:"availability",label:"Availability",permissions:["read"]},{key:"booking",label:"Booking",permissions:["write"]}];function yh(){const{user:r,loading:x,refreshUser:w,logout:d}=Ya(),{theme:T,toggle:C}=ci(),H=_s(),[q,Y]=v.useState("general"),[B,R]=v.useState(!1),[D,j]=v.useState(""),[U,E]=v.useState({}),[z,_]=v.useState([]),[X,I]=v.useState(!1),[te,J]=v.useState(!1),[ge,ce]=v.useState(""),[be,P]=v.useState({calendars:["read","write"],events:["read","write"],contacts:["read","write"],availability:["read"],booking:["write"]}),[Z,Ne]=v.useState(null),[ee,pe]=v.useState(null),[Qe,Ve]=v.useState(""),[Re,p]=v.useState(!1);v.useEffect(()=>{r&&E({timezone:r.timezone,week_start_day:r.week_start_day,date_format:r.date_format,time_format:r.time_format,default_event_duration_minutes:r.default_event_duration_minutes,default_reminder_minutes:r.default_reminder_minutes,show_weekends:r.show_weekends,working_hours_start:r.working_hours_start,working_hours_end:r.working_hours_end,notifications_email:r.notifications_email})},[r]),v.useEffect(()=>{q==="api-keys"&&(I(!0),de.listApiKeys().then(M=>_(M.items)).catch(()=>j("Failed to load API keys")).finally(()=>I(!1)))},[q]);const O=async()=>{R(!0),j("");try{const M=await de.updateMe(U);await w(),j("Settings saved"),setTimeout(()=>j(""),2e3)}catch(M){j(M.error||"Failed to save")}finally{R(!1)}},V=async()=>{if(!ge.trim()){j("Name is required");return}R(!0),j("");try{const M=await de.createApiKey({name:ge.trim(),scopes:be});Ne(M),_(A=>[M,...A]),J(!1),ce("")}catch(M){j(M.error||"Failed to create API key")}finally{R(!1)}},me=async M=>{pe(M);try{await de.revokeApiKey(M),_(A=>A.map(ve=>ve.id===M?{...ve,revoked_at:new Date().toISOString()}:ve))}catch(A){j(A.error||"Failed to revoke")}finally{pe(null)}},oe=async()=>{if(Qe==="delete"){p(!0),j("");try{await de.deleteMe(),await d(),H("/login")}catch(M){j(M.error||"Failed to delete account")}finally{p(!1)}}},Q=()=>{Z!=null&&Z.token&&(navigator.clipboard.writeText(Z.token),j("Token copied to clipboard"),setTimeout(()=>j(""),2e3))};if(x||!r)return null;const ne=[{id:"general",label:"General"},{id:"calendars",label:"Calendars"},{id:"notifications",label:"Notifications"},{id:"api-keys",label:"API Keys"},{id:"account",label:"Account"}];return i.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:[i.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Settings"}),i.jsx("button",{onClick:C,className:"p-2 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400 transition-colors",children:T==="dark"?i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})})]}),i.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[i.jsx("nav",{className:"w-48 border-r border-gray-200 dark:border-gray-700 p-4 flex-shrink-0",children:ne.map(M=>i.jsx("button",{onClick:()=>Y(M.id),className:`block w-full text-left px-3 py-2 rounded-lg text-sm font-medium transition-colors ${q===M.id?"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400":"text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800"}`,children:M.label},M.id))}),i.jsxs("main",{className:"flex-1 overflow-y-auto p-6",children:[D&&i.jsx("div",{className:`mb-4 px-4 py-2 rounded-lg text-sm ${D==="Settings saved"||D==="Token copied to clipboard"?"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-400":"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400"}`,children:D}),q==="general"&&i.jsxs("div",{className:"space-y-6 max-w-xl",children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"General"}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Timezone"}),i.jsx("input",{type:"text",value:U.timezone||"",onChange:M=>E(A=>({...A,timezone:M.target.value})),placeholder:"America/New_York",className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Week starts on"}),i.jsxs("select",{value:U.week_start_day??0,onChange:M=>E(A=>({...A,week_start_day:parseInt(M.target.value,10)})),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",children:[i.jsx("option",{value:0,children:"Sunday"}),i.jsx("option",{value:1,children:"Monday"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Date format"}),i.jsxs("select",{value:U.date_format||"MM/dd/yyyy",onChange:M=>E(A=>({...A,date_format:M.target.value})),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",children:[i.jsx("option",{value:"MM/dd/yyyy",children:"MM/DD/YYYY"}),i.jsx("option",{value:"dd/MM/yyyy",children:"DD/MM/YYYY"}),i.jsx("option",{value:"yyyy-MM-dd",children:"YYYY-MM-DD"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Time format"}),i.jsxs("select",{value:U.time_format||"12h",onChange:M=>E(A=>({...A,time_format:M.target.value})),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none",children:[i.jsx("option",{value:"12h",children:"12-hour"}),i.jsx("option",{value:"24h",children:"24-hour"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Default event duration (minutes)"}),i.jsx("input",{type:"number",min:15,max:480,value:U.default_event_duration_minutes??60,onChange:M=>E(A=>({...A,default_event_duration_minutes:parseInt(M.target.value,10)||60})),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Default reminder (minutes before)"}),i.jsx("input",{type:"number",min:0,max:10080,value:U.default_reminder_minutes??10,onChange:M=>E(A=>({...A,default_reminder_minutes:parseInt(M.target.value,10)||10})),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"checkbox",id:"show_weekends",checked:U.show_weekends??!0,onChange:M=>E(A=>({...A,show_weekends:M.target.checked})),className:"rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"}),i.jsx("label",{htmlFor:"show_weekends",className:"text-sm text-gray-700 dark:text-gray-300",children:"Show weekends"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Working hours start"}),i.jsx("input",{type:"time",value:U.working_hours_start||"09:00",onChange:M=>E(A=>({...A,working_hours_start:M.target.value})),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Working hours end"}),i.jsx("input",{type:"time",value:U.working_hours_end||"17:00",onChange:M=>E(A=>({...A,working_hours_end:M.target.value})),className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]})]})]}),q==="calendars"&&i.jsxs("div",{className:"space-y-4",children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Calendars"}),i.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Manage your calendars from the main calendar view. Use the sidebar to add new calendars or add from URL."})]}),q==="notifications"&&i.jsxs("div",{className:"space-y-6 max-w-xl",children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Notifications"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"checkbox",id:"notifications_email",checked:U.notifications_email??!0,onChange:M=>E(A=>({...A,notifications_email:M.target.checked})),className:"rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"}),i.jsx("label",{htmlFor:"notifications_email",className:"text-sm text-gray-700 dark:text-gray-300",children:"Email reminders for events"})]})]}),q==="api-keys"&&i.jsxs("div",{className:"space-y-6 max-w-2xl",children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"API Keys"}),i.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"API keys allow programmatic access to your calendar. Use them for integrations, scripts, or AI agents. Keep keys secure and never share them."}),i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:[z.length," key",z.length!==1?"s":""]}),i.jsx("button",{onClick:()=>{J(!0),Ne(null),j("")},className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-lg transition-colors",children:"Create API key"})]}),X?i.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[i.jsx("span",{className:"w-4 h-4 border-2 border-gray-400 border-t-transparent rounded-full animate-spin"}),"Loading..."]}):i.jsx("div",{className:"space-y-6 max-w-2xl",children:z.length===0?i.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 py-4",children:"No API keys yet. Create one to get started."}):i.jsx("ul",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:z.map(M=>i.jsxs("li",{className:"py-4 flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"font-medium text-gray-900 dark:text-white truncate",children:M.name}),i.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:["Created ",new Date(M.created_at).toLocaleDateString(),M.revoked_at&&i.jsx("span",{className:"ml-2 text-amber-600 dark:text-amber-400",children:"• Revoked"})]})]}),!M.revoked_at&&i.jsx("button",{onClick:()=>me(M.id),disabled:ee===M.id,className:"px-3 py-1.5 text-sm text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors disabled:opacity-50",children:ee===M.id?"Revoking...":"Revoke"})]},M.id))})})]}),q==="account"&&i.jsxs("div",{className:"space-y-6 max-w-xl",children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Account"}),i.jsxs("div",{className:"rounded-lg border border-gray-200 dark:border-gray-600 p-4 dark:bg-gray-800/50",children:[i.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-2",children:["Signed in as ",i.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:r.email})]}),i.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:["Account created ",new Date(r.created_at).toLocaleDateString()]})]}),i.jsxs("div",{className:"pt-6 border-t border-gray-200 dark:border-gray-700",children:[i.jsx("h3",{className:"text-sm font-medium text-red-600 dark:text-red-400 mb-2",children:"Danger zone"}),i.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:"Deleting your account will permanently remove all your calendars, events, contacts, and revoke all API keys. This action cannot be undone."}),i.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[i.jsxs("div",{className:"flex-1 min-w-[200px]",children:[i.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Type ",i.jsx("span",{className:"font-mono text-red-600 dark:text-red-400",children:"delete"})," to confirm"]}),i.jsx("input",{type:"text",value:Qe,onChange:M=>Ve(M.target.value),placeholder:"delete",className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-red-500 outline-none placeholder:text-gray-400"})]}),i.jsx("button",{onClick:oe,disabled:Qe!=="delete"||Re,className:"px-4 py-2 bg-red-600 hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed text-white text-sm font-medium rounded-lg transition-colors",children:Re?"Deleting...":"Delete account"})]})]})]}),(q==="general"||q==="notifications")&&i.jsx("div",{className:"mt-8",children:i.jsx("button",{onClick:O,disabled:B,className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 disabled:opacity-50 text-white text-sm font-medium rounded-lg transition-colors",children:B?"Saving...":"Save changes"})})]})]}),i.jsx(Il,{open:te,onClose:()=>{J(!1),ce("")},title:"Create API key",wide:!0,children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Name"}),i.jsx("input",{type:"text",value:ge,onChange:M=>ce(M.target.value),placeholder:"e.g. My integration",className:"w-full px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 outline-none"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Scopes"}),i.jsx("div",{className:"space-y-3",children:hh.map(({key:M,label:A,permissions:ve})=>i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("span",{className:"w-28 text-sm text-gray-600 dark:text-gray-400",children:A}),i.jsx("div",{className:"flex gap-4",children:ve.map(Ke=>{const Yt=(be[M]||[]).includes(Ke);return i.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[i.jsx("input",{type:"checkbox",checked:Yt,onChange:At=>{const W=At.target.checked?[...be[M]||[],Ke]:(be[M]||[]).filter(Ee=>Ee!==Ke);P(Ee=>({...Ee,[M]:W}))},className:"rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"}),i.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 capitalize",children:Ke})]},Ke)})})]},M))})]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[i.jsx("button",{onClick:()=>J(!1),className:"px-4 py-2 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:"Cancel"}),i.jsx("button",{onClick:V,disabled:B||!ge.trim(),className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 disabled:opacity-50 text-white text-sm font-medium rounded-lg transition-colors",children:B?"Creating...":"Create"})]})]})}),i.jsx(Il,{open:!!(Z!=null&&Z.token),onClose:()=>Ne(null),title:"API key created",children:i.jsxs("div",{className:"space-y-4",children:[i.jsx("p",{className:"text-sm text-amber-600 dark:text-amber-400",children:"Copy this token now. It will not be shown again."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",readOnly:!0,value:(Z==null?void 0:Z.token)||"",className:"flex-1 px-3 py-2 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-100 dark:bg-gray-700 text-sm font-mono text-gray-900 dark:text-white"}),i.jsx("button",{onClick:Q,className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-lg transition-colors",children:"Copy"})]}),i.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:["Use in requests: ",i.jsx("code",{className:"bg-gray-100 dark:bg-gray-700 px-1 rounded",children:"X-API-Key: "})]}),i.jsx("div",{className:"flex justify-end",children:i.jsx("button",{onClick:()=>Ne(null),className:"px-4 py-2 bg-gray-200 dark:bg-gray-600 hover:bg-gray-300 dark:hover:bg-gray-500 text-gray-900 dark:text-white text-sm font-medium rounded-lg transition-colors",children:"Done"})})]})})]})}function xh(){const{user:r,loading:x}=Ya();return x?i.jsx("div",{className:"h-screen flex items-center justify-center bg-white dark:bg-gray-900",children:i.jsx("div",{className:"w-8 h-8 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"})}):r?i.jsx(Os,{}):i.jsx(ws,{to:"/login",replace:!0})}function bh(){const{user:r,loading:x}=Ya();return x?i.jsx("div",{className:"h-screen flex items-center justify-center bg-white dark:bg-gray-900",children:i.jsx("div",{className:"w-8 h-8 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"})}):r?i.jsx(ws,{to:"/",replace:!0}):i.jsx(Os,{})}function vh(){return i.jsxs("div",{className:"h-screen flex bg-white dark:bg-gray-900 transition-colors",children:[i.jsxs("nav",{className:"w-14 flex-shrink-0 flex flex-col items-center py-4 gap-1 border-r border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900",children:[i.jsx(ei,{to:"/",end:!0,className:({isActive:r})=>`p-2.5 rounded-xl transition-colors ${r?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-300"}`,title:"Calendar",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),i.jsx(ei,{to:"/todo",className:({isActive:r})=>`p-2.5 rounded-xl transition-colors ${r?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-300"}`,title:"To-do",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})})}),i.jsx(ei,{to:"/contacts",className:({isActive:r})=>`p-2.5 rounded-xl transition-colors ${r?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-300"}`,title:"Contacts",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})})}),i.jsx(ei,{to:"/settings",className:({isActive:r})=>`p-2.5 rounded-xl transition-colors ${r?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-300"}`,title:"Settings",children:i.jsxs("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})})]}),i.jsx("div",{className:"flex-1 overflow-hidden",children:i.jsx(Os,{})})]})}function ph(){return i.jsxs(Cm,{children:[i.jsxs(qt,{element:i.jsx(bh,{}),children:[i.jsx(qt,{path:"/login",element:i.jsx(Km,{})}),i.jsx(qt,{path:"/register",element:i.jsx(Jm,{})})]}),i.jsx(qt,{element:i.jsx(xh,{}),children:i.jsxs(qt,{element:i.jsx(vh,{}),children:[i.jsx(qt,{path:"/",element:i.jsx(ah,{})}),i.jsx(qt,{path:"/todo",element:i.jsx(mh,{})}),i.jsx(qt,{path:"/contacts",element:i.jsx(nh,{})}),i.jsx(qt,{path:"/settings",element:i.jsx(yh,{})})]})}),i.jsx(qt,{path:"*",element:i.jsx(ws,{to:"/",replace:!0})})]})}Lm.createRoot(document.getElementById("root")).render(i.jsx(v.StrictMode,{children:i.jsx(Vm,{children:i.jsx(Am,{children:i.jsx(Zm,{children:i.jsx(Qm,{children:i.jsx(ph,{})})})})})})); diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 375740e..ef4d178 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -5,10 +5,10 @@ Calendar - + - +
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 61a7060..c171cf7 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -4,6 +4,7 @@ import Login from "./pages/Login"; import Register from "./pages/Register"; import CalendarPage from "./pages/CalendarPage"; import ContactsPage from "./pages/ContactsPage"; +import TodoPage from "./pages/TodoPage"; import SettingsPage from "./pages/SettingsPage"; function ProtectedRoute() { @@ -53,6 +54,21 @@ function AppLayout() { + + `p-2.5 rounded-xl transition-colors ${ + isActive + ? "bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400" + : "text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-300" + }` + } + title="To-do" + > + + + + @@ -104,6 +120,7 @@ export default function App() { }> }> } /> + } /> } /> } /> diff --git a/frontend/src/api.ts b/frontend/src/api.ts index a7ffccf..877da8f 100644 --- a/frontend/src/api.ts +++ b/frontend/src/api.ts @@ -9,6 +9,9 @@ import type { Contact, ListResponse, PageInfo, + Project, + Tag, + Task, User, } from "./types"; @@ -295,4 +298,93 @@ export const api = { deleteContact: (id: string) => request<{ ok: boolean }>(`/contacts/${id}`, { method: "DELETE" }), + + // Tasks + listTasks: (params?: { + status?: string; + priority?: string; + project_id?: string; + due_from?: string; + due_to?: string; + limit?: number; + cursor?: string; + }) => { + const sp = new URLSearchParams({ limit: "100" }); + if (params?.status) sp.set("status", params.status); + if (params?.priority) sp.set("priority", params.priority); + if (params?.project_id) sp.set("project_id", params.project_id); + if (params?.due_from) sp.set("due_from", params.due_from); + if (params?.due_to) sp.set("due_to", params.due_to); + if (params?.limit) sp.set("limit", String(params.limit)); + if (params?.cursor) sp.set("cursor", params.cursor); + return request>(`/tasks?${sp}`); + }, + + createTask: (data: { + title: string; + description?: string; + status?: string; + priority?: string; + due_date?: string; + project_id?: string; + parent_id?: string; + }) => + request<{ task: Task }>("/tasks", { + method: "POST", + body: JSON.stringify(data), + }), + + getTask: (id: string) => request<{ task: Task }>(`/tasks/${id}`), + + updateTask: (id: string, data: Partial) => + request<{ task: Task }>(`/tasks/${id}`, { + method: "PUT", + body: JSON.stringify(data), + }), + + deleteTask: (id: string, permanent?: boolean) => { + const q = permanent ? "?permanent=true" : ""; + return request<{ ok: boolean }>(`/tasks/${id}${q}`, { method: "DELETE" }); + }, + + markTaskComplete: (id: string) => + request<{ task: Task }>(`/tasks/${id}/complete`, { method: "POST" }), + + markTaskUncomplete: (id: string, status?: string) => + request<{ task: Task }>(`/tasks/${id}/uncomplete`, { + method: "POST", + body: JSON.stringify(status ? { status } : {}), + }), + + listTaskSubtasks: (id: string) => + request>(`/tasks/${id}/subtasks`), + + // Projects + listProjects: () => request>("/projects"), + + createProject: (data: { name: string; color?: string }) => + request<{ project: Project }>("/projects", { + method: "POST", + body: JSON.stringify(data), + }), + + getProject: (id: string) => request<{ project: Project }>(`/projects/${id}`), + + updateProject: (id: string, data: Partial) => + request<{ project: Project }>(`/projects/${id}`, { + method: "PUT", + body: JSON.stringify(data), + }), + + deleteProject: (id: string) => + request<{ ok: boolean }>(`/projects/${id}`, { method: "DELETE" }), + + // Tags + listTags: () => request>("/tags"), + + createTag: (data: { name: string; color?: string }) => + request<{ tag: Tag }>("/tags", { + method: "POST", + body: JSON.stringify(data), + }), }; diff --git a/frontend/src/components/KanbanBoard.tsx b/frontend/src/components/KanbanBoard.tsx new file mode 100644 index 0000000..8384396 --- /dev/null +++ b/frontend/src/components/KanbanBoard.tsx @@ -0,0 +1,100 @@ +import { useState } from "react"; +import type { Task } from "../types"; +import TaskCard from "./TaskCard"; + +const KANBAN_COLUMNS = [ + { id: "todo", title: "To Do", status: "todo" as const }, + { id: "in_progress", title: "In Progress", status: "in_progress" as const }, + { id: "done", title: "Done", status: "done" as const }, +]; + +const ARCHIVED_COLUMN = { id: "archived", title: "Archived", status: "archived" as const }; + +interface KanbanBoardProps { + tasks: Task[]; + onTaskClick: (task: Task) => void; + onStatusChange: (taskId: string, newStatus: string) => void; + showArchived?: boolean; +} + +export default function KanbanBoard({ + tasks, + onTaskClick, + onStatusChange, + showArchived = false, +}: KanbanBoardProps) { + const [draggedTask, setDraggedTask] = useState(null); + const [dragOverColumn, setDragOverColumn] = useState(null); + + const columns = showArchived ? [ARCHIVED_COLUMN] : KANBAN_COLUMNS; + const tasksByStatus = columns.reduce( + (acc, col) => { + acc[col.status] = tasks.filter((t) => t.status === col.status); + return acc; + }, + {} as Record + ); + + const handleDragStart = (e: React.DragEvent, task: Task) => { + setDraggedTask(task); + e.dataTransfer.setData("text/plain", task.id); + e.dataTransfer.effectAllowed = "move"; + }; + + const handleDragOver = (e: React.DragEvent, status: string) => { + e.preventDefault(); + e.dataTransfer.dropEffect = "move"; + setDragOverColumn(status); + }; + + const handleDragLeave = () => { + setDragOverColumn(null); + }; + + const handleDrop = (e: React.DragEvent, status: string) => { + e.preventDefault(); + setDragOverColumn(null); + const taskId = e.dataTransfer.getData("text/plain"); + if (taskId && draggedTask && draggedTask.status !== status) { + onStatusChange(taskId, status); + } + setDraggedTask(null); + }; + + return ( +
+ {columns.map((col) => ( +
handleDragOver(e, col.status)} + onDragLeave={handleDragLeave} + onDrop={(e) => handleDrop(e, col.status)} + className={`flex-shrink-0 w-72 flex flex-col rounded-lg border-2 transition-colors ${ + dragOverColumn === col.status + ? "border-blue-400 dark:border-blue-500 bg-blue-50/50 dark:bg-blue-900/20" + : "border-gray-200 dark:border-gray-600" + }`} + > +
+

+ {col.title} +

+

+ {tasksByStatus[col.status]?.length ?? 0} tasks +

+
+
+ {(tasksByStatus[col.status] ?? []).map((task) => ( + onTaskClick(task)} + /> + ))} +
+
+ ))} +
+ ); +} diff --git a/frontend/src/components/ProjectSidebar.tsx b/frontend/src/components/ProjectSidebar.tsx new file mode 100644 index 0000000..a3662dd --- /dev/null +++ b/frontend/src/components/ProjectSidebar.tsx @@ -0,0 +1,67 @@ +import type { Project } from "../types"; + +interface ProjectSidebarProps { + projects: Project[]; + selectedProjectId: string | null; + onSelectProject: (id: string | null) => void; + showArchived: boolean; + onToggleArchived: () => void; +} + +export default function ProjectSidebar({ + projects, + selectedProjectId, + onSelectProject, + showArchived, + onToggleArchived, +}: ProjectSidebarProps) { + return ( +
+
+

+ Projects +

+
+
+ + {projects.map((p) => ( + + ))} +
+ +
+
+
+ ); +} diff --git a/frontend/src/components/TaskCard.tsx b/frontend/src/components/TaskCard.tsx new file mode 100644 index 0000000..427db95 --- /dev/null +++ b/frontend/src/components/TaskCard.tsx @@ -0,0 +1,69 @@ +import type { Task } from "../types"; +import { format } from "date-fns"; + +const priorityColors: Record = { + low: "bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400", + medium: "bg-blue-100 dark:bg-blue-900/40 text-blue-700 dark:text-blue-300", + high: "bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300", + critical: "bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300", +}; + +interface TaskCardProps { + task: Task; + onDragStart?: (e: React.DragEvent, task: Task) => void; + onClick?: () => void; +} + +export default function TaskCard({ + task, + onDragStart, + onClick, +}: TaskCardProps) { + const priorityClass = priorityColors[task.priority] || priorityColors.medium; + + return ( +
onDragStart?.(e, task)} + onClick={onClick} + className="group cursor-pointer rounded-lg border border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-800 p-3 shadow-sm hover:shadow-md transition-shadow" + > +
+
+ + + +
+
+

+ {task.title} +

+ {task.due_date && ( +

+ Due {format(new Date(task.due_date), "MMM d, yyyy")} +

+ )} +
+ + {task.priority} + + {task.tags?.map((tag) => ( + + {tag.name} + + ))} +
+
+
+
+ ); +} diff --git a/frontend/src/components/TaskModal.tsx b/frontend/src/components/TaskModal.tsx new file mode 100644 index 0000000..51eaa57 --- /dev/null +++ b/frontend/src/components/TaskModal.tsx @@ -0,0 +1,271 @@ +import { useState, useEffect } from "react"; +import { format } from "date-fns"; +import type { Task, Project, Tag } from "../types"; +import { api } from "../api"; +import Modal from "./Modal"; + +interface TaskModalProps { + open: boolean; + onClose: () => void; + onSaved: () => void; + task?: Task | null; + projects: Project[]; + tags: Tag[]; +} + +const STATUS_OPTIONS = ["todo", "in_progress", "done"] as const; +const PRIORITY_OPTIONS = ["low", "medium", "high", "critical"] as const; + +export default function TaskModal({ + open, + onClose, + onSaved, + task, + projects, + tags, +}: TaskModalProps) { + const isEdit = !!task; + const [title, setTitle] = useState(""); + const [description, setDescription] = useState(""); + const [status, setStatus] = useState("todo"); + const [priority, setPriority] = useState("medium"); + const [dueDate, setDueDate] = useState(""); + const [projectId, setProjectId] = useState(""); + const [saving, setSaving] = useState(false); + const [error, setError] = useState(""); + const [showDelete, setShowDelete] = useState(false); + + useEffect(() => { + if (!open) return; + setError(""); + setShowDelete(false); + if (task) { + setTitle(task.title); + setDescription(task.description || ""); + setStatus(task.status); + setPriority(task.priority); + setDueDate(task.due_date ? format(new Date(task.due_date), "yyyy-MM-dd") : ""); + setProjectId(task.project_id || ""); + } else { + setTitle(""); + setDescription(""); + setStatus("todo"); + setPriority("medium"); + setDueDate(""); + setProjectId(""); + } + }, [open, task]); + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + if (!title.trim()) return; + setSaving(true); + setError(""); + try { + if (isEdit) { + await api.updateTask(task!.id, { + title: title.trim(), + description: description || undefined, + status, + priority, + due_date: dueDate || undefined, + project_id: projectId || undefined, + }); + } else { + await api.createTask({ + title: title.trim(), + description: description || undefined, + status, + priority, + due_date: dueDate || undefined, + project_id: projectId || undefined, + }); + } + onSaved(); + onClose(); + } catch (err: unknown) { + setError((err as { error?: string })?.error || "Failed to save task"); + } finally { + setSaving(false); + } + }; + + const handleDelete = async () => { + if (!task) return; + setSaving(true); + try { + await api.deleteTask(task.id); + onSaved(); + onClose(); + } catch { + setError("Failed to delete task"); + } finally { + setSaving(false); + } + }; + + return ( + +
+ {error && ( +
+ {error} +
+ )} + +
+ + setTitle(e.target.value)} + className="w-full px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100" + placeholder="Task title" + required + /> +
+ +
+ +