diff --git a/dist/assets/css/index-DXaaJsOA.css b/dist/assets/css/index-DXaaJsOA.css deleted file mode 100644 index 2a353c9..0000000 --- a/dist/assets/css/index-DXaaJsOA.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:1rem;padding-left:1rem}@media (min-width: 475px){.container{max-width:475px}}@media (min-width: 640px){.container{max-width:640px;padding-right:1.5rem;padding-left:1.5rem}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px;padding-right:2rem;padding-left:2rem}}@media (min-width: 1280px){.container{max-width:1280px;padding-right:2.5rem;padding-left:2.5rem}}@media (min-width: 1536px){.container{max-width:1536px;padding-right:3rem;padding-left:3rem}}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-y-0{top:0;bottom:0}.-bottom-2{bottom:-.5rem}.bottom-0{bottom:0}.bottom-14{bottom:3.5rem}.bottom-24{bottom:6rem}.bottom-4{bottom:1rem}.left-0{left:0}.left-1\/2{left:50%}.left-3{left:.75rem}.left-4{left:1rem}.left-6{left:1.5rem}.right-0{right:0}.right-1{right:.25rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.top-12{top:3rem}.top-4{top:1rem}.top-\[65px\]{top:65px}.top-full{top:100%}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.order-first{order:-9999}.col-span-1{grid-column:span 1 / span 1}.col-span-2{grid-column:span 2 / span 2}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-top:.5rem;margin-bottom:.5rem}.-mt-8{margin-top:-2rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-8{margin-left:2rem}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-20{height:5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-\[calc\(100vh-200px\)\]{height:calc(100vh - 200px)}.h-\[calc\(100vh-65px\)\]{height:calc(100vh - 65px)}.h-full{height:100%}.h-px{height:1px}.max-h-32{max-height:8rem}.max-h-40{max-height:10rem}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(80vh-120px\)\]{max-height:calc(80vh - 120px)}.min-h-\[44px\]{min-height:44px}.min-h-\[72px\]{min-height:72px}.min-h-screen{min-height:100vh}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\/3{width:66.666667%}.w-20{width:5rem}.w-3{width:.75rem}.w-32{width:8rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-8{width:2rem}.w-80{width:20rem}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[140px\]{min-width:140px}.min-w-\[80px\]{min-width:80px}.min-w-fit{min-width:-moz-fit-content;min-width:fit-content}.min-w-max{min-width:-moz-max-content;min-width:max-content}.max-w-24{max-width:6rem}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-7xl{max-width:80rem}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.touch-manipulation{touch-action:manipulation}.resize-none{resize:none}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity, 1))}.justify-self-end{justify-self:end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-200\/50{border-color:#bfdbfe80}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity, 1))}.border-blue-400{--tw-border-opacity: 1;border-color:rgb(96 165 250 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-blue-600{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity, 1))}.border-emerald-200\/50{border-color:#a7f3d080}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-200\/50{border-color:#e5e7eb80}.border-gray-200\/80{border-color:#e5e7ebcc}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-gray-300\/50{border-color:#d1d5db80}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-green-200\/50{border-color:#bbf7d080}.border-green-400{--tw-border-opacity: 1;border-color:rgb(74 222 128 / var(--tw-border-opacity, 1))}.border-green-400\/30{border-color:#4ade804d}.border-indigo-200\/50{border-color:#c7d2fe80}.border-orange-200{--tw-border-opacity: 1;border-color:rgb(254 215 170 / var(--tw-border-opacity, 1))}.border-orange-200\/50{border-color:#fed7aa80}.border-orange-400{--tw-border-opacity: 1;border-color:rgb(251 146 60 / var(--tw-border-opacity, 1))}.border-purple-200\/50{border-color:#e9d5ff80}.border-purple-400{--tw-border-opacity: 1;border-color:rgb(192 132 252 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-red-400\/30{border-color:#f871714d}.border-red-400\/50{border-color:#f8717180}.border-teal-200\/50{border-color:#99f6e480}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.border-white\/20{border-color:#fff3}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-yellow-200\/50{border-color:#fef08a80}.border-yellow-300{--tw-border-opacity: 1;border-color:rgb(253 224 71 / var(--tw-border-opacity, 1))}.border-yellow-400\/30{border-color:#facc154d}.border-t-transparent{border-top-color:transparent}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/20{background-color:#0003}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/60{background-color:#0009}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-200{--tw-bg-opacity: 1;background-color:rgb(191 219 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-green-400\/20{background-color:#4ade8033}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-500\/10{background-color:#22c55e1a}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-indigo-50{--tw-bg-opacity: 1;background-color:rgb(238 242 255 / var(--tw-bg-opacity, 1))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-orange-50{--tw-bg-opacity: 1;background-color:rgb(255 247 237 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-50{--tw-bg-opacity: 1;background-color:rgb(250 245 255 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/20{background-color:#ef444433}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-teal-50{--tw-bg-opacity: 1;background-color:rgb(240 253 250 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/10{background-color:#ffffff1a}.bg-white\/20{background-color:#fff3}.bg-white\/50{background-color:#ffffff80}.bg-white\/70{background-color:#ffffffb3}.bg-white\/80{background-color:#fffc}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-yellow-300\/90{background-color:#fde047e6}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/20{background-color:#eab30833}.bg-yellow-600{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity, 1))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-50{--tw-gradient-from: #eff6ff var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 246 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-blue-600{--tw-gradient-from: #2563eb var(--tw-gradient-from-position);--tw-gradient-to: rgb(37 99 235 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-emerald-50{--tw-gradient-from: #ecfdf5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(236 253 245 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-50{--tw-gradient-from: #f0fdf4 var(--tw-gradient-from-position);--tw-gradient-to: rgb(240 253 244 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #22c55e var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-50{--tw-gradient-from: #eef2ff var(--tw-gradient-from-position);--tw-gradient-to: rgb(238 242 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-orange-50{--tw-gradient-from: #fff7ed var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 247 237 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-50{--tw-gradient-from: #faf5ff var(--tw-gradient-from-position);--tw-gradient-to: rgb(250 245 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-teal-50{--tw-gradient-from: #f0fdfa var(--tw-gradient-from-position);--tw-gradient-to: rgb(240 253 250 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-yellow-50{--tw-gradient-from: #fefce8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(254 252 232 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-blue-300{--tw-gradient-to: rgb(147 197 253 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #93c5fd var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-white{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #fff var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-blue-50{--tw-gradient-to: #eff6ff var(--tw-gradient-to-position)}.to-cyan-50{--tw-gradient-to: #ecfeff var(--tw-gradient-to-position)}.to-emerald-50{--tw-gradient-to: #ecfdf5 var(--tw-gradient-to-position)}.to-emerald-600{--tw-gradient-to: #059669 var(--tw-gradient-to-position)}.to-indigo-100{--tw-gradient-to: #e0e7ff var(--tw-gradient-to-position)}.to-indigo-50{--tw-gradient-to: #eef2ff var(--tw-gradient-to-position)}.to-orange-50{--tw-gradient-to: #fff7ed var(--tw-gradient-to-position)}.to-pink-50{--tw-gradient-to: #fdf2f8 var(--tw-gradient-to-position)}.to-purple-50{--tw-gradient-to: #faf5ff var(--tw-gradient-to-position)}.to-purple-600{--tw-gradient-to: #9333ea var(--tw-gradient-to-position)}.to-red-50{--tw-gradient-to: #fef2f2 var(--tw-gradient-to-position)}.to-teal-50{--tw-gradient-to: #f0fdfa var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.fill-white{fill:#fff}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-12{padding:3rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-24{padding-bottom:6rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-8{padding-bottom:2rem}.pl-10{padding-left:2.5rem}.pl-12{padding-left:3rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-10{padding-right:2.5rem}.pr-12{padding-right:3rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-\[0\.3em\]{letter-spacing:.3em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-blue-100{--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.text-blue-200{--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-emerald-900{--tw-text-opacity: 1;color:rgb(6 78 59 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-200{--tw-text-opacity: 1;color:rgb(187 247 208 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-green-900{--tw-text-opacity: 1;color:rgb(20 83 45 / var(--tw-text-opacity, 1))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-indigo-800{--tw-text-opacity: 1;color:rgb(55 48 163 / var(--tw-text-opacity, 1))}.text-indigo-900{--tw-text-opacity: 1;color:rgb(49 46 129 / var(--tw-text-opacity, 1))}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-orange-700{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-orange-900{--tw-text-opacity: 1;color:rgb(124 45 18 / var(--tw-text-opacity, 1))}.text-purple-500{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-purple-700{--tw-text-opacity: 1;color:rgb(126 34 206 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-purple-900{--tw-text-opacity: 1;color:rgb(88 28 135 / var(--tw-text-opacity, 1))}.text-red-200{--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-red-900{--tw-text-opacity: 1;color:rgb(127 29 29 / var(--tw-text-opacity, 1))}.text-teal-500{--tw-text-opacity: 1;color:rgb(20 184 166 / var(--tw-text-opacity, 1))}.text-teal-700{--tw-text-opacity: 1;color:rgb(15 118 110 / var(--tw-text-opacity, 1))}.text-teal-900{--tw-text-opacity: 1;color:rgb(19 78 74 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-100{--tw-text-opacity: 1;color:rgb(254 249 195 / var(--tw-text-opacity, 1))}.text-yellow-200{--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.text-yellow-300{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(113 63 18 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.placeholder-blue-200::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(191 219 254 / var(--tw-placeholder-opacity, 1))}.placeholder-blue-200::placeholder{--tw-placeholder-opacity: 1;color:rgb(191 219 254 / var(--tw-placeholder-opacity, 1))}.placeholder-blue-200\/50::-moz-placeholder{color:#bfdbfe80}.placeholder-blue-200\/50::placeholder{color:#bfdbfe80}.placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.opacity-0{opacity:0}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-blue-500\/30{--tw-shadow-color: rgb(59 130 246 / .3);--tw-shadow: var(--tw-shadow-colored)}.shadow-blue-500\/50{--tw-shadow-color: rgb(59 130 246 / .5);--tw-shadow: var(--tw-shadow-colored)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-blue-500{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.ring-offset-2{--tw-ring-offset-width: 2px}.drop-shadow-2xl{--tw-drop-shadow: drop-shadow(0 25px 25px rgb(0 0 0 / .15));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)}.filter{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)}.backdrop-blur-lg{--tw-backdrop-blur: blur(16px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*{box-sizing:border-box}html,body{overflow-x:hidden;width:100%;max-width:100vw}#root{width:100%;max-width:100vw;overflow-x:hidden}@keyframes fade-in{0%{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-up{0%{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}.animate-fade-in{animation:fade-in .8s ease-out}.animate-slide-up{animation:slide-up .6s ease-out .2s both}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-blue-200\/50:hover{border-color:#bfdbfe80}.hover\:border-blue-500:hover{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.hover\:border-gray-300:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.hover\:border-gray-400:hover{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity, 1))}.hover\:bg-blue-200:hover{--tw-bg-opacity: 1;background-color:rgb(191 219 254 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-50:hover{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-300:hover{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-700:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.hover\:bg-green-200:hover{--tw-bg-opacity: 1;background-color:rgb(187 247 208 / var(--tw-bg-opacity, 1))}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-orange-600:hover{--tw-bg-opacity: 1;background-color:rgb(234 88 12 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-200:hover{--tw-bg-opacity: 1;background-color:rgb(233 213 255 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-white\/10:hover{background-color:#ffffff1a}.hover\:bg-white\/15:hover{background-color:#ffffff26}.hover\:bg-white\/20:hover{background-color:#fff3}.hover\:bg-yellow-200:hover{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.hover\:bg-yellow-700:hover{--tw-bg-opacity: 1;background-color:rgb(161 98 7 / var(--tw-bg-opacity, 1))}.hover\:from-blue-600:hover{--tw-gradient-from: #2563eb var(--tw-gradient-from-position);--tw-gradient-to: rgb(37 99 235 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-green-600:hover{--tw-gradient-from: #16a34a var(--tw-gradient-from-position);--tw-gradient-to: rgb(22 163 74 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-emerald-700:hover{--tw-gradient-to: #047857 var(--tw-gradient-to-position)}.hover\:to-purple-700:hover{--tw-gradient-to: #7e22ce var(--tw-gradient-to-position)}.hover\:text-blue-200:hover{--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.hover\:text-blue-500:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.hover\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\:text-gray-800:hover{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.hover\:text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:border-red-500:focus{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-4:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(96 165 250 / var(--tw-ring-opacity, 1))}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.focus\:ring-blue-500\/20:focus{--tw-ring-color: rgb(59 130 246 / .2)}.focus\:ring-blue-500\/50:focus{--tw-ring-color: rgb(59 130 246 / .5)}.focus\:ring-red-500\/20:focus{--tw-ring-color: rgb(239 68 68 / .2)}.focus\:ring-yellow-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(250 204 21 / var(--tw-ring-opacity, 1))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus\:ring-offset-transparent:focus{--tw-ring-offset-color: transparent}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-blue-400:disabled{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.disabled\:bg-gray-400:disabled{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:opacity-100{opacity:1}.dark\:divide-gray-700:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(55 65 81 / var(--tw-divide-opacity, 1))}.dark\:border-blue-600:is(.dark *){--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity, 1))}.dark\:border-blue-700\/50:is(.dark *){border-color:#1d4ed880}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))}.dark\:border-emerald-700\/50:is(.dark *){border-color:#04785780}.dark\:border-gray-600:is(.dark *){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\:border-gray-600\/50:is(.dark *){border-color:#4b556380}.dark\:border-gray-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:border-gray-700\/50:is(.dark *){border-color:#37415180}.dark\:border-gray-700\/80:is(.dark *){border-color:#374151cc}.dark\:border-green-700\/50:is(.dark *){border-color:#15803d80}.dark\:border-green-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity, 1))}.dark\:border-indigo-700\/50:is(.dark *){border-color:#4338ca80}.dark\:border-orange-700\/50:is(.dark *){border-color:#c2410c80}.dark\:border-purple-700\/50:is(.dark *){border-color:#7e22ce80}.dark\:border-red-600:is(.dark *){--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1))}.dark\:border-red-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(153 27 27 / var(--tw-border-opacity, 1))}.dark\:border-red-900\/30:is(.dark *){border-color:#7f1d1d4d}.dark\:border-teal-700\/50:is(.dark *){border-color:#0f766e80}.dark\:border-yellow-700\/50:is(.dark *){border-color:#a1620780}.dark\:bg-blue-800\/50:is(.dark *){background-color:#1e40af80}.dark\:bg-blue-900\/20:is(.dark *){background-color:#1e3a8a33}.dark\:bg-blue-900\/30:is(.dark *){background-color:#1e3a8a4d}.dark\:bg-gray-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-700\/30:is(.dark *){background-color:#3741514d}.dark\:bg-gray-700\/50:is(.dark *){background-color:#37415180}.dark\:bg-gray-700\/70:is(.dark *){background-color:#374151b3}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800\/50:is(.dark *){background-color:#1f293780}.dark\:bg-gray-800\/70:is(.dark *){background-color:#1f2937b3}.dark\:bg-gray-800\/80:is(.dark *){background-color:#1f2937cc}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-900\/80:is(.dark *){background-color:#111827cc}.dark\:bg-green-800\/50:is(.dark *){background-color:#16653480}.dark\:bg-green-900\/20:is(.dark *){background-color:#14532d33}.dark\:bg-green-900\/30:is(.dark *){background-color:#14532d4d}.dark\:bg-indigo-900\/20:is(.dark *){background-color:#312e8133}.dark\:bg-orange-900\/20:is(.dark *){background-color:#7c2d1233}.dark\:bg-orange-900\/30:is(.dark *){background-color:#7c2d124d}.dark\:bg-purple-900\/20:is(.dark *){background-color:#581c8733}.dark\:bg-purple-900\/30:is(.dark *){background-color:#581c874d}.dark\:bg-red-800\/50:is(.dark *){background-color:#991b1b80}.dark\:bg-red-900\/20:is(.dark *){background-color:#7f1d1d33}.dark\:bg-red-900\/30:is(.dark *){background-color:#7f1d1d4d}.dark\:bg-teal-900\/20:is(.dark *){background-color:#134e4a33}.dark\:bg-yellow-900\/20:is(.dark *){background-color:#713f1233}.dark\:bg-yellow-900\/30:is(.dark *){background-color:#713f124d}.dark\:from-blue-900\/20:is(.dark *){--tw-gradient-from: rgb(30 58 138 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(30 58 138 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-emerald-900\/20:is(.dark *){--tw-gradient-from: rgb(6 78 59 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 78 59 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-gray-900:is(.dark *){--tw-gradient-from: #111827 var(--tw-gradient-from-position);--tw-gradient-to: rgb(17 24 39 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-green-900\/20:is(.dark *){--tw-gradient-from: rgb(20 83 45 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(20 83 45 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-indigo-900\/20:is(.dark *){--tw-gradient-from: rgb(49 46 129 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(49 46 129 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-orange-900\/20:is(.dark *){--tw-gradient-from: rgb(124 45 18 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(124 45 18 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-purple-900\/20:is(.dark *){--tw-gradient-from: rgb(88 28 135 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(88 28 135 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-teal-900\/20:is(.dark *){--tw-gradient-from: rgb(19 78 74 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(19 78 74 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-yellow-900\/20:is(.dark *){--tw-gradient-from: rgb(113 63 18 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(113 63 18 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:via-gray-800:is(.dark *){--tw-gradient-to: rgb(31 41 55 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #1f2937 var(--tw-gradient-via-position), var(--tw-gradient-to)}.dark\:to-blue-900\/20:is(.dark *){--tw-gradient-to: rgb(30 58 138 / .2) var(--tw-gradient-to-position)}.dark\:to-cyan-900\/20:is(.dark *){--tw-gradient-to: rgb(22 78 99 / .2) var(--tw-gradient-to-position)}.dark\:to-emerald-900\/20:is(.dark *){--tw-gradient-to: rgb(6 78 59 / .2) var(--tw-gradient-to-position)}.dark\:to-gray-900:is(.dark *){--tw-gradient-to: #111827 var(--tw-gradient-to-position)}.dark\:to-indigo-900\/20:is(.dark *){--tw-gradient-to: rgb(49 46 129 / .2) var(--tw-gradient-to-position)}.dark\:to-orange-900\/20:is(.dark *){--tw-gradient-to: rgb(124 45 18 / .2) var(--tw-gradient-to-position)}.dark\:to-pink-900\/20:is(.dark *){--tw-gradient-to: rgb(131 24 67 / .2) var(--tw-gradient-to-position)}.dark\:to-purple-900\/20:is(.dark *){--tw-gradient-to: rgb(88 28 135 / .2) var(--tw-gradient-to-position)}.dark\:to-red-900\/20:is(.dark *){--tw-gradient-to: rgb(127 29 29 / .2) var(--tw-gradient-to-position)}.dark\:to-teal-900\/20:is(.dark *){--tw-gradient-to: rgb(19 78 74 / .2) var(--tw-gradient-to-position)}.dark\:text-blue-100:is(.dark *){--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-emerald-100:is(.dark *){--tw-text-opacity: 1;color:rgb(209 250 229 / var(--tw-text-opacity, 1))}.dark\:text-gray-200:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:text-gray-300:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-500:is(.dark *){--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.dark\:text-green-100:is(.dark *){--tw-text-opacity: 1;color:rgb(220 252 231 / var(--tw-text-opacity, 1))}.dark\:text-green-200:is(.dark *){--tw-text-opacity: 1;color:rgb(187 247 208 / var(--tw-text-opacity, 1))}.dark\:text-green-300:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-indigo-100:is(.dark *){--tw-text-opacity: 1;color:rgb(224 231 255 / var(--tw-text-opacity, 1))}.dark\:text-indigo-200:is(.dark *){--tw-text-opacity: 1;color:rgb(199 210 254 / var(--tw-text-opacity, 1))}.dark\:text-orange-100:is(.dark *){--tw-text-opacity: 1;color:rgb(255 237 213 / var(--tw-text-opacity, 1))}.dark\:text-orange-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 215 170 / var(--tw-text-opacity, 1))}.dark\:text-orange-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 186 116 / var(--tw-text-opacity, 1))}.dark\:text-orange-400:is(.dark *){--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.dark\:text-purple-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 232 255 / var(--tw-text-opacity, 1))}.dark\:text-purple-200:is(.dark *){--tw-text-opacity: 1;color:rgb(233 213 255 / var(--tw-text-opacity, 1))}.dark\:text-purple-300:is(.dark *){--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.dark\:text-purple-400:is(.dark *){--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.dark\:text-red-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 226 226 / var(--tw-text-opacity, 1))}.dark\:text-red-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.dark\:text-red-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-teal-100:is(.dark *){--tw-text-opacity: 1;color:rgb(204 251 241 / var(--tw-text-opacity, 1))}.dark\:text-teal-300:is(.dark *){--tw-text-opacity: 1;color:rgb(94 234 212 / var(--tw-text-opacity, 1))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:text-yellow-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 249 195 / var(--tw-text-opacity, 1))}.dark\:text-yellow-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:placeholder-gray-400:is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.dark\:placeholder-gray-400:is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.dark\:ring-offset-gray-800:is(.dark *){--tw-ring-offset-color: #1f2937}.dark\:hover\:border-blue-400:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(96 165 250 / var(--tw-border-opacity, 1))}.dark\:hover\:border-gray-500:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.dark\:hover\:bg-blue-900\/20:hover:is(.dark *){background-color:#1e3a8a33}.dark\:hover\:bg-blue-900\/50:hover:is(.dark *){background-color:#1e3a8a80}.dark\:hover\:bg-gray-600:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-700\/50:hover:is(.dark *){background-color:#37415180}.dark\:hover\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-green-900\/50:hover:is(.dark *){background-color:#14532d80}.dark\:hover\:bg-purple-900\/50:hover:is(.dark *){background-color:#581c8780}.dark\:hover\:bg-red-900\/20:hover:is(.dark *){background-color:#7f1d1d33}.dark\:hover\:text-blue-400:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:hover\:text-gray-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:hover\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 475px){.xs\:inline{display:inline}.xs\:hidden{display:none}}@media (min-width: 640px){.sm\:top-\[73px\]{top:73px}.sm\:order-none{order:0}.sm\:mx-auto{margin-left:auto;margin-right:auto}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:h-2{height:.5rem}.sm\:h-4{height:1rem}.sm\:h-5{height:1.25rem}.sm\:h-6{height:1.5rem}.sm\:h-\[calc\(100vh-73px\)\]{height:calc(100vh - 73px)}.sm\:min-h-0{min-height:0px}.sm\:min-h-\[80px\]{min-height:80px}.sm\:w-2{width:.5rem}.sm\:w-4{width:1rem}.sm\:w-48{width:12rem}.sm\:w-5{width:1.25rem}.sm\:w-6{width:1.5rem}.sm\:w-80{width:20rem}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:max-w-32{max-width:8rem}.sm\:max-w-md{max-width:28rem}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:justify-start{justify-content:flex-start}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.sm\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.sm\:rounded-lg{border-radius:.5rem}.sm\:p-2{padding:.5rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:p-8{padding:2rem}.sm\:px-10{padding-left:2.5rem;padding-right:2.5rem}.sm\:px-2{padding-left:.5rem;padding-right:.5rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-1{padding-top:.25rem;padding-bottom:.25rem}.sm\:py-2{padding-top:.5rem;padding-bottom:.5rem}.sm\:py-3{padding-top:.75rem;padding-bottom:.75rem}.sm\:py-4{padding-top:1rem;padding-bottom:1rem}.sm\:py-6{padding-top:1.5rem;padding-bottom:1.5rem}.sm\:pl-10{padding-left:2.5rem}.sm\:pr-4{padding-right:1rem}.sm\:pt-6{padding-top:1.5rem}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 768px){.md\:block{display:block}.md\:hidden{display:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:sticky{position:sticky}.lg\:z-auto{z-index:auto}.lg\:ml-0{margin-left:0}.lg\:hidden{display:none}.lg\:min-h-\[88px\]{min-height:88px}.lg\:w-80{width:20rem}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:gap-4{gap:1rem}.lg\:space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.lg\:p-6{padding:1.5rem}.lg\:p-8{padding:2rem}.lg\:px-4{padding-left:1rem;padding-right:1rem}.lg\:px-6{padding-left:1.5rem;padding-right:1.5rem}.lg\:px-8{padding-left:2rem;padding-right:2rem}.lg\:py-8{padding-top:2rem;padding-bottom:2rem}.lg\:pt-8{padding-top:2rem}.lg\:text-2xl{font-size:1.5rem;line-height:2rem}.lg\:text-3xl{font-size:1.875rem;line-height:2.25rem}}@media (min-width: 1280px){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:text-4xl{font-size:2.25rem;line-height:2.5rem}} diff --git a/dist/assets/js/Auth-KZISTjMo.js b/dist/assets/js/Auth-KZISTjMo.js deleted file mode 100644 index af4ff6c..0000000 --- a/dist/assets/js/Auth-KZISTjMo.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./query-vendor-BLVqILA6.js";import{r as h,d as P,u as S}from"./router-vendor-D4by-_6Z.js";import{s as j,u as y}from"./index-doec96Hx.js";import{N as $}from"./NeuralNetworkBackground-CER-dIFD.js";import"./react-vendor-CqRd3GwO.js";import"./ui-vendor-CyRvbSfR.js";import"./supabase-vendor-CnnNSQLo.js";import"./state-vendor-DHadhBU5.js";const M=()=>{const[n,l]=h.useState(!1),[m,i]=h.useState(null),d=async o=>{try{l(!0),i(null);const{data:s,error:t}=await j.auth.signInWithOAuth({provider:o,options:{redirectTo:`${window.location.origin}/auth/callback`,queryParams:{access_type:"offline",prompt:"consent"}}});if(t)throw t;return{data:s,error:null}}catch(s){const t=s instanceof Error?s.message:"Erro ao fazer login";return i({message:t,provider:o}),{data:null,error:t}}finally{l(!1)}};return{loading:n,error:m,signInWithGoogle:()=>d("google"),signInWithMicrosoft:()=>d("azure"),signInWithProvider:d,linkProvider:async o=>{try{l(!0),i(null);const{data:s,error:t}=await j.auth.linkIdentity({provider:o});if(t)throw t;return{data:s,error:null}}catch(s){const t=s instanceof Error?s.message:"Erro ao vincular conta";return i({message:t,provider:o}),{data:null,error:t}}finally{l(!1)}},unlinkProvider:async o=>{try{l(!0),i(null);const{data:{user:s}}=await j.auth.getUser();if(!s)throw new Error("Usuário não autenticado");const t=s.identities?.find(v=>v.provider===o);if(!t)throw new Error(`Conta ${o} não vinculada`);const{data:u,error:g}=await j.auth.unlinkIdentity(t);if(g)throw g;return{data:u,error:null}}catch(s){const t=s instanceof Error?s.message:"Erro ao desvincular conta";return i({message:t,provider:o}),{data:null,error:t}}finally{l(!1)}},hasProvider:async o=>{const{data:{user:s}}=await j.auth.getUser();return s?.identities?.some(t=>t.provider===o)??!1}}},F=({mode:n="login",onSuccess:l,onError:m})=>{const{loading:i,signInWithGoogle:d,signInWithMicrosoft:x,linkProvider:r}=M(),f=async()=>{const{error:o}=n==="login"?await d():await r("google");o?m?.(o):l?.()},c=async()=>{const{error:o}=n==="login"?await x():await r("azure");o?m?.(o):l?.()},b=n==="login"?"Entrar com":"Vincular";return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("button",{onClick:f,disabled:i,className:"w-full flex items-center justify-center gap-3 px-4 py-3 bg-white border-2 border-gray-300 rounded-lg hover:bg-gray-50 hover:border-gray-400 transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed group",children:[e.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",children:[e.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),e.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),e.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),e.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),e.jsxs("span",{className:"font-medium text-gray-700",children:[b," Google"]})]}),e.jsxs("button",{onClick:c,disabled:i,className:"w-full flex items-center justify-center gap-3 px-4 py-3 bg-white border-2 border-gray-300 rounded-lg hover:bg-gray-50 hover:border-gray-400 transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 23 23",children:[e.jsx("path",{fill:"#f3f3f3",d:"M0 0h23v23H0z"}),e.jsx("path",{fill:"#f35325",d:"M1 1h10v10H1z"}),e.jsx("path",{fill:"#81bc06",d:"M12 1h10v10H12z"}),e.jsx("path",{fill:"#05a6f0",d:"M1 12h10v10H1z"}),e.jsx("path",{fill:"#ffba08",d:"M12 12h10v10H12z"})]}),e.jsxs("span",{className:"font-medium text-gray-700",children:[b," Microsoft"]})]}),n==="login"&&e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-gray-300"})}),e.jsx("div",{className:"relative flex justify-center text-sm",children:e.jsx("span",{className:"px-2 bg-white text-gray-500",children:"ou"})})]})]})},z=({onSuccess:n,onSwitchToRegister:l})=>{const{login:m,loading:i,error:d,clearError:x}=y(),[r,f]=h.useState({email:"",password:""}),[c,b]=h.useState(!1),o=async t=>{if(t.preventDefault(),x(),!r.email||!r.password)return;(await m(r)).success&&n&&n()},s=t=>{const{name:u,value:g}=t.target;f(v=>({...v,[u]:g}))};return e.jsx("div",{className:"w-full max-w-md mx-auto",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:"Entrar"}),e.jsx("p",{className:"text-blue-200",children:"Acesse sua conta"})]}),d&&e.jsx("div",{className:"mb-4 p-3 bg-red-500/20 border border-red-400/30 rounded-xl backdrop-blur-sm",children:e.jsx("p",{className:"text-red-200 text-sm",children:d})}),e.jsx(F,{mode:"login",onSuccess:n,onError:t=>{}}),e.jsxs("form",{onSubmit:o,className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-white mb-2",children:"Email"}),e.jsx("input",{type:"email",id:"email",name:"email",value:r.email,onChange:s,required:!0,className:"w-full px-4 py-3 bg-white/10 border border-white/20 rounded-xl text-white placeholder-blue-200 focus:outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent backdrop-blur-sm transition-all duration-200",placeholder:"seu@email.com"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-white mb-2",children:"Senha"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:c?"text":"password",id:"password",name:"password",value:r.password,onChange:s,required:!0,className:"w-full px-4 py-3 bg-white/10 border border-white/20 rounded-xl text-white placeholder-blue-200 focus:outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent backdrop-blur-sm transition-all duration-200 pr-12",placeholder:"Sua senha"}),e.jsx("button",{type:"button",onClick:()=>b(!c),className:"absolute inset-y-0 right-0 pr-4 flex items-center text-blue-200 hover:text-white transition-colors duration-200",children:c?"🙈":"👁️"})]})]}),e.jsx("button",{type:"submit",disabled:i||!r.email||!r.password,className:"w-full bg-gradient-to-r from-blue-500 to-purple-600 text-white py-3 px-6 rounded-xl hover:from-blue-600 hover:to-purple-700 focus:outline-none focus:ring-2 focus:ring-blue-400 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 shadow-lg hover:shadow-xl font-semibold",children:i?e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Entrando..."]}):"Entrar"})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx("button",{type:"button",className:"text-blue-300 hover:text-white text-sm font-medium transition-colors duration-200",onClick:()=>{alert("Funcionalidade de recuperação de senha será implementada em breve")},children:"Esqueceu sua senha?"})}),l&&e.jsx("div",{className:"mt-4 text-center",children:e.jsxs("p",{className:"text-blue-200 text-sm",children:["Não tem uma conta?"," ",e.jsx("button",{type:"button",onClick:l,className:"text-blue-300 hover:text-white font-medium transition-colors duration-200",children:"Cadastre-se"})]})})]})})},D=({onSuccess:n,onSwitchToLogin:l})=>{const{register:m,loading:i,error:d,clearError:x}=y(),[r,f]=h.useState({nome:"",email:"",password:"",confirmPassword:"",cpf:"",telefone:""}),[c,b]=h.useState(!1),[o,s]=h.useState(!1),[t,u]=h.useState({}),g=()=>{const a={};return r.nome.trim()||(a.nome="Nome é obrigatório"),r.email.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r.email)||(a.email="Email inválido"):a.email="Email é obrigatório",r.password?r.password.length<6&&(a.password="Senha deve ter pelo menos 6 caracteres"):a.password="Senha é obrigatória",r.password!==r.confirmPassword&&(a.confirmPassword="Senhas não coincidem"),r.cpf&&!/^\d{11}$/.test(r.cpf.replace(/\D/g,""))&&(a.cpf="CPF deve ter 11 dígitos"),r.telefone&&!/^\d{10,11}$/.test(r.telefone.replace(/\D/g,""))&&(a.telefone="Telefone deve ter 10 ou 11 dígitos"),u(a),Object.keys(a).length===0},v=async a=>{if(a.preventDefault(),x(),u({}),!g())return;(await m({nome:r.nome,email:r.email,password:r.password,cpf:r.cpf||void 0,telefone:r.telefone||void 0})).success&&(alert("Cadastro realizado com sucesso! Verifique seu email para confirmar a conta."),n&&n())},w=a=>{const{name:p,value:E}=a.target;f(N=>({...N,[p]:E})),t[p]&&u(N=>({...N,[p]:""}))},k=a=>a.replace(/\D/g,"").replace(/(\d{3})(\d{3})(\d{3})(\d{2})/,"$1.$2.$3-$4"),C=a=>{const p=a.replace(/\D/g,"");return p.length<=10?p.replace(/(\d{2})(\d{4})(\d{4})/,"($1) $2-$3"):p.replace(/(\d{2})(\d{5})(\d{4})/,"($1) $2-$3")};return e.jsx("div",{className:"w-full max-w-md mx-auto",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:"Cadastrar"}),e.jsx("p",{className:"text-blue-200",children:"Crie sua conta"})]}),d&&e.jsx("div",{className:"mb-4 p-3 bg-red-500/20 border border-red-400/30 rounded-xl backdrop-blur-sm",children:e.jsx("p",{className:"text-red-200 text-sm",children:d})}),e.jsxs("form",{onSubmit:v,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"nome",className:"block text-sm font-medium text-white mb-2",children:"Nome Completo *"}),e.jsx("input",{type:"text",id:"nome",name:"nome",value:r.nome,onChange:w,required:!0,className:`w-full px-4 py-3 bg-white/10 border rounded-xl text-white placeholder-blue-200 focus:outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent backdrop-blur-sm transition-all duration-200 ${t.nome?"border-red-400/50":"border-white/20"}`,placeholder:"Seu nome completo"}),t.nome&&e.jsx("p",{className:"text-red-300 text-xs mt-1",children:t.nome})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-white mb-2",children:"Email *"}),e.jsx("input",{type:"email",id:"email",name:"email",value:r.email,onChange:w,required:!0,className:`w-full px-4 py-3 bg-white/10 border rounded-xl text-white placeholder-blue-200 focus:outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent backdrop-blur-sm transition-all duration-200 ${t.email?"border-red-400/50":"border-white/20"}`,placeholder:"seu@email.com"}),t.email&&e.jsx("p",{className:"text-red-300 text-xs mt-1",children:t.email})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"cpf",className:"block text-sm font-medium text-white mb-2",children:"CPF"}),e.jsx("input",{type:"text",id:"cpf",name:"cpf",value:k(r.cpf),onChange:a=>w({...a,target:{...a.target,value:a.target.value.replace(/\D/g,"")}}),maxLength:14,className:`w-full px-4 py-3 bg-white/10 border rounded-xl text-white placeholder-blue-200 focus:outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent backdrop-blur-sm transition-all duration-200 ${t.cpf?"border-red-400/50":"border-white/20"}`,placeholder:"000.000.000-00"}),t.cpf&&e.jsx("p",{className:"text-red-300 text-xs mt-1",children:t.cpf})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"telefone",className:"block text-sm font-medium text-white mb-2",children:"Telefone"}),e.jsx("input",{type:"text",id:"telefone",name:"telefone",value:C(r.telefone),onChange:a=>w({...a,target:{...a.target,value:a.target.value.replace(/\D/g,"")}}),maxLength:15,className:`w-full px-4 py-3 bg-white/10 border rounded-xl text-white placeholder-blue-200 focus:outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent backdrop-blur-sm transition-all duration-200 ${t.telefone?"border-red-400/50":"border-white/20"}`,placeholder:"(11) 99999-9999"}),t.telefone&&e.jsx("p",{className:"text-red-300 text-xs mt-1",children:t.telefone})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-white mb-2",children:"Senha *"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:c?"text":"password",id:"password",name:"password",value:r.password,onChange:w,required:!0,className:`w-full px-4 py-3 bg-white/10 border rounded-xl text-white placeholder-blue-200 focus:outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent backdrop-blur-sm transition-all duration-200 pr-10 ${t.password?"border-red-400/50":"border-white/20"}`,placeholder:"Mínimo 6 caracteres"}),e.jsx("button",{type:"button",onClick:()=>b(!c),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-blue-200 hover:text-white",children:c?"🙈":"👁️"})]}),t.password&&e.jsx("p",{className:"text-red-300 text-xs mt-1",children:t.password})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-white mb-2",children:"Confirmar Senha *"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:o?"text":"password",id:"confirmPassword",name:"confirmPassword",value:r.confirmPassword,onChange:w,required:!0,className:`w-full px-4 py-3 bg-white/10 border rounded-xl text-white placeholder-blue-200 focus:outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent backdrop-blur-sm transition-all duration-200 pr-10 ${t.confirmPassword?"border-red-400/50":"border-white/20"}`,placeholder:"Confirme sua senha"}),e.jsx("button",{type:"button",onClick:()=>s(!o),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-blue-200 hover:text-white",children:o?"🙈":"👁️"})]}),t.confirmPassword&&e.jsx("p",{className:"text-red-300 text-xs mt-1",children:t.confirmPassword})]}),e.jsx("button",{type:"submit",disabled:i,className:"w-full bg-gradient-to-r from-blue-500 to-purple-600 text-white py-3 px-4 rounded-xl hover:from-blue-600 hover:to-purple-700 focus:outline-none focus:ring-2 focus:ring-blue-400 focus:ring-offset-2 focus:ring-offset-transparent disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 font-medium backdrop-blur-sm",children:i?e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Cadastrando..."]}):"Cadastrar"})]}),l&&e.jsx("div",{className:"mt-4 text-center",children:e.jsxs("p",{className:"text-blue-200 text-sm",children:["Já tem uma conta?"," ",e.jsx("button",{type:"button",onClick:l,className:"text-white hover:text-blue-200 font-medium underline transition-colors duration-200",children:"Entrar"})]})})]})})},L="/assets/png/tracksteel-logo-CJR9ckUT.png",R=()=>{const n=P(),l=S(),{isAuthenticated:m,loading:i,bypassLogin:d}=y(),[x,r]=h.useState("login");h.useEffect(()=>{if(m&&!i){const s=l.state?.from?.pathname||"/dashboard";n(s,{replace:!0})}},[m,i,n,l]),h.useEffect(()=>{const s=l.pathname;s.includes("register")||s.includes("cadastro")?r("register"):r("login")},[l.pathname]);const f=()=>{const s=l.state?.from?.pathname||"/dashboard";n(s,{replace:!0})},c=async()=>{try{if((await d()).success){const t=l.state?.from?.pathname||"/dashboard";n(t,{replace:!0})}}catch{}},b=()=>{r("login"),n("/login",{replace:!0})},o=()=>{r("register"),n("/register",{replace:!0})};return i?e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-600",children:"Carregando..."})]})}):e.jsxs("div",{className:"min-h-screen relative flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8 overflow-hidden",children:[e.jsx($,{}),e.jsxs("div",{className:"relative z-10 max-w-md w-full space-y-8 animate-fade-in",children:[e.jsx("div",{className:"text-center",children:e.jsxs("div",{className:"mx-auto mb-6",children:[e.jsx("div",{className:"bg-white/10 backdrop-blur-md rounded-xl shadow-lg border border-white/20 p-6 mb-4 inline-block",children:e.jsxs("div",{className:"w-40 h-30 flex items-center justify-center",children:[e.jsx("img",{src:L,alt:"TrackSteel Logo",width:"160",height:"120",className:"mx-auto drop-shadow-2xl",onLoad:()=>{},onError:s=>{const t=s.target;t.style.display="none";const u=t.nextElementSibling;u&&(u.style.display="block")}}),e.jsx("div",{className:"hidden text-white text-center",style:{display:"none"},children:e.jsxs("svg",{className:"w-40 h-30 mx-auto mb-2",viewBox:"0 0 160 120",fill:"none",children:[e.jsx("rect",{width:"160",height:"120",rx:"8",fill:"rgba(255,255,255,0.1)",stroke:"rgba(255,255,255,0.3)"}),e.jsx("text",{x:"80",y:"65",textAnchor:"middle",className:"fill-white text-lg font-bold",children:"LOGO"})]})})]})}),e.jsx("div",{className:"mt-4",children:e.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-blue-300 to-transparent w-32 mx-auto"})})]})}),e.jsxs("div",{className:"flex bg-white/10 backdrop-blur-sm border border-white/20 rounded-xl p-1 mb-6",children:[e.jsx("button",{onClick:()=>r("login"),className:`flex-1 py-3 px-4 rounded-lg text-sm font-semibold transition-all duration-200 ${x==="login"?"bg-white/20 text-white shadow-lg":"text-blue-200 hover:text-white hover:bg-white/10"}`,children:"Entrar"}),e.jsx("button",{onClick:()=>r("register"),className:`flex-1 py-3 px-4 rounded-lg text-sm font-semibold transition-all duration-200 ${x==="register"?"bg-white/20 text-white shadow-lg":"text-blue-200 hover:text-white hover:bg-white/10"}`,children:"Cadastrar"})]}),e.jsx("div",{className:"mb-6",children:e.jsxs("div",{className:"bg-yellow-500/20 border border-yellow-400/30 rounded-xl backdrop-blur-sm p-4",children:[e.jsxs("div",{className:"flex items-center mb-2",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx("svg",{className:"h-5 w-5 text-yellow-300",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),e.jsx("div",{className:"ml-3",children:e.jsx("h3",{className:"text-sm font-semibold text-yellow-200",children:"Modo Desenvolvimento"})})]}),e.jsxs("div",{className:"ml-8",children:[e.jsx("p",{className:"text-sm text-yellow-100 mb-3",children:"Botão temporário para acesso direto ao sistema sem autenticação."}),e.jsx("button",{onClick:c,className:"bg-yellow-300/90 hover:bg-yellow-200 text-yellow-900 font-medium py-2 px-4 rounded-lg text-sm transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-yellow-400 focus:ring-offset-2 shadow-lg hover:shadow-xl",children:"🚧 Entrar sem Login (DEV)"})]})]})}),e.jsx("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl shadow-2xl border border-white/20 p-8 transition-all duration-300 hover:bg-white/15 animate-slide-up",children:x==="login"?e.jsx(z,{onSuccess:f,onSwitchToRegister:o}):e.jsx(D,{onSuccess:f,onSwitchToLogin:b})}),e.jsx("div",{className:"text-center text-sm text-gray-300",children:e.jsx("p",{className:"italic",children:"Desenvolvido por TrackSteel"})})]})]})};export{R as default}; diff --git a/dist/assets/js/AuthCallback-DlZVcD4W.js b/dist/assets/js/AuthCallback-DlZVcD4W.js deleted file mode 100644 index 76f4214..0000000 --- a/dist/assets/js/AuthCallback-DlZVcD4W.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./query-vendor-BLVqILA6.js";import{d as w,r as t}from"./router-vendor-D4by-_6Z.js";import{s as i}from"./index-doec96Hx.js";import{a0 as j,c as b,a2 as N}from"./ui-vendor-CyRvbSfR.js";import"./react-vendor-CqRd3GwO.js";import"./supabase-vendor-CnnNSQLo.js";import"./state-vendor-DHadhBU5.js";const _=()=>{const o=w(),[s,c]=t.useState("loading"),[g,n]=t.useState("Processando autenticação..."),l=t.useCallback(async()=>{try{const a=new URLSearchParams(window.location.search),d=a.get("error"),x=a.get("error_description");if(d)throw new Error(x||d);const{data:{session:r},error:m}=await i.auth.getSession();if(m)throw m;if(!r)throw new Error("Nenhuma sessão encontrada");const{data:u,error:h}=await i.from("usuarios").select("id, organizacao_id").eq("id",r.user.id).single();if(!u&&h?.code==="PGRST116"){const{error:p}=await i.from("usuarios").insert({id:r.user.id,email:r.user.email,nome:r.user.user_metadata.full_name||r.user.email?.split("@")[0]})}c("success"),n("Login realizado com sucesso!");const f=u?.organizacao_id;setTimeout(()=>{o(f?"/":"/selecionar-organizacao")},1e3)}catch(a){c("error"),n(a instanceof Error?a.message:"Erro ao processar autenticação"),setTimeout(()=>{o("/login")},3e3)}},[o]);return t.useEffect(()=>{l()},[l]),e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 flex items-center justify-center p-4",children:e.jsx("div",{className:"bg-white rounded-2xl shadow-xl p-8 max-w-md w-full",children:e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[s==="loading"&&e.jsx(j,{className:"w-16 h-16 text-blue-500 animate-spin"}),s==="success"&&e.jsx(b,{className:"w-16 h-16 text-green-500"}),s==="error"&&e.jsx(N,{className:"w-16 h-16 text-red-500"}),e.jsxs("div",{className:"text-center",children:[e.jsxs("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:[s==="loading"&&"Processando...",s==="success"&&"Sucesso!",s==="error"&&"Erro"]}),e.jsx("p",{className:"text-gray-600",children:g})]}),s==="loading"&&e.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2 overflow-hidden",children:e.jsx("div",{className:"bg-blue-500 h-2 rounded-full animate-pulse w-2/3"})}),s!=="loading"&&e.jsx("p",{className:"text-sm text-gray-500",children:s==="success"?"Redirecionando para o sistema...":"Redirecionando para o login..."})]})})})};export{_ as AuthCallback}; diff --git a/dist/assets/js/Cadastros-QZZ_REjv.js b/dist/assets/js/Cadastros-QZZ_REjv.js deleted file mode 100644 index 2fa79c1..0000000 --- a/dist/assets/js/Cadastros-QZZ_REjv.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./query-vendor-BLVqILA6.js";import{r as d,L as y}from"./router-vendor-D4by-_6Z.js";import{T as A}from"./ThemeToggle-Cryh6OOS.js";import{P,B as u,U as T,W as R,S as $,d as U,A as l,m as r,E as x,e as g,f as L,g as m,h as b,M as z,i as F,j as I,k as O,l as G}from"./ui-vendor-CyRvbSfR.js";import"./react-vendor-CqRd3GwO.js";const p=[{id:"1",nome:"Edifício Residencial Aurora",endereco:"Rua das Flores, 123 - Centro",cliente:"Construtora ABC Ltda",responsavel:"João Silva",data_inicio:"2024-01-01",data_previsao:"2024-12-31",status:"em_andamento",progresso:45,orcamento:25e5},{id:"2",nome:"Centro Comercial Plaza",endereco:"Av. Principal, 456 - Bairro Novo",cliente:"Investimentos XYZ S.A.",responsavel:"Maria Santos",data_inicio:"2024-02-15",data_previsao:"2025-06-30",status:"em_andamento",progresso:25,orcamento:5e6}],j=[{id:"1",nome:"João Silva",email:"joao.silva@empresa.com",telefone:"(11) 99999-9999",funcao:"Engenheiro Civil",empresa:"Construtora ABC",status:"ativo",data_cadastro:"2024-01-01",ultimo_acesso:"2024-01-15"},{id:"2",nome:"Maria Santos",email:"maria.santos@empresa.com",telefone:"(11) 88888-8888",funcao:"Arquiteta",empresa:"Construtora ABC",status:"ativo",data_cadastro:"2024-01-05",ultimo_acesso:"2024-01-14"}],v=[{id:"1",nome:"Betoneira 400L",tipo:"Betoneira",modelo:"BT-400",fabricante:"Menegotti",ano_fabricacao:2022,numero_serie:"BT400-2022-001",status:"em_uso",obra_atual:"Edifício Residencial Aurora",proximo_manutencao:"2024-03-01"},{id:"2",nome:"Guindaste 20T",tipo:"Guindaste",modelo:"GR-20",fabricante:"Liebherr",ano_fabricacao:2021,numero_serie:"GR20-2021-005",status:"disponivel",proximo_manutencao:"2024-02-15"}],i={obras:{planejamento:{label:"Planejamento",color:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300"},em_andamento:{label:"Em Andamento",color:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300"},pausada:{label:"Pausada",color:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-300"},concluida:{label:"Concluída",color:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300"}},usuarios:{ativo:{label:"Ativo",color:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300"},inativo:{label:"Inativo",color:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-300"}},equipamentos:{disponivel:{label:"Disponível",color:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300"},em_uso:{label:"Em Uso",color:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300"},manutencao:{label:"Manutenção",color:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-300"},inativo:{label:"Inativo",color:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-300"}}};function Y(){const[s,k]=d.useState("obras"),[f,N]=d.useState(""),[h,w]=d.useState(!1),[t,n]=d.useState(null),_=[{id:"obras",label:"Obras",icon:u,count:p.length},{id:"usuarios",label:"Usuários",icon:T,count:j.length},{id:"equipamentos",label:"Equipamentos",icon:R,count:v.length}],C=a=>new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(a),o=a=>new Date(a).toLocaleDateString("pt-BR"),E=({obra:a})=>e.jsxs(r.div,{layout:!0,initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg hover:shadow-xl transition-all duration-300",children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white text-lg mb-2",children:a.nome}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300",children:[e.jsx(I,{className:"w-4 h-4"}),a.endereco]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300",children:[e.jsx(O,{className:"w-4 h-4"}),a.cliente]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300",children:[e.jsx(G,{className:"w-4 h-4"}),o(a.data_inicio)," - ",o(a.data_previsao)]})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:()=>n(t===a.id?null:a.id),className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",title:"Mais opções","aria-label":"Mais opções",children:e.jsx(x,{className:"w-5 h-5 text-gray-400 dark:text-gray-500"})}),e.jsx(l,{children:t===a.id&&e.jsx(r.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"absolute right-0 top-full mt-2 w-48 bg-white dark:bg-gray-800 rounded-xl shadow-lg border border-gray-200 dark:border-gray-700 z-10",children:e.jsxs("div",{className:"p-2",children:[e.jsxs(y,{to:`/obra/${a.id}`,className:"w-full flex items-center gap-2 px-3 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:[e.jsx(g,{className:"w-4 h-4"}),"Visualizar"]}),e.jsxs("button",{className:"w-full flex items-center gap-2 px-3 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:[e.jsx(m,{className:"w-4 h-4"}),"Editar"]}),e.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors",children:[e.jsx(b,{className:"w-4 h-4"}),"Excluir"]})]})})})]})]}),e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("span",{className:`px-3 py-1 rounded-full text-xs font-medium ${i.obras[a.status].color}`,children:i.obras[a.status].label}),e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:C(a.orcamento)})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Progresso"}),e.jsxs("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:[a.progresso,"%"]})]}),e.jsx("div",{className:"w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2",children:e.jsx(r.div,{initial:{width:0},animate:{width:`${a.progresso}%`},transition:{duration:.5,ease:"easeOut"},className:"h-2 bg-blue-500 rounded-full"})})]}),e.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-300",children:[e.jsx("strong",{children:"Responsável:"})," ",a.responsavel]})]}),S=({usuario:a})=>e.jsxs(r.div,{layout:!0,initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg hover:shadow-xl transition-all duration-300",children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full flex items-center justify-center text-white font-semibold",children:a.nome.split(" ").map(c=>c[0]).join("").toUpperCase()}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white text-lg",children:a.nome}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:a.funcao})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:()=>n(t===a.id?null:a.id),className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",title:"Mais opções","aria-label":"Mais opções",children:e.jsx(x,{className:"w-5 h-5 text-gray-400 dark:text-gray-500"})}),e.jsx(l,{children:t===a.id&&e.jsx(r.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"absolute right-0 top-full mt-2 w-48 bg-white dark:bg-gray-800 rounded-xl shadow-lg border border-gray-200 dark:border-gray-700 z-10",children:e.jsxs("div",{className:"p-2",children:[e.jsxs("button",{className:"w-full flex items-center gap-2 px-3 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:[e.jsx(g,{className:"w-4 h-4"}),"Visualizar"]}),e.jsxs("button",{className:"w-full flex items-center gap-2 px-3 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:[e.jsx(m,{className:"w-4 h-4"}),"Editar"]}),e.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors",children:[e.jsx(b,{className:"w-4 h-4"}),"Excluir"]})]})})})]})]}),e.jsxs("div",{className:"space-y-2 mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300",children:[e.jsx(z,{className:"w-4 h-4"}),a.email]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300",children:[e.jsx(F,{className:"w-4 h-4"}),a.telefone]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300",children:[e.jsx(u,{className:"w-4 h-4"}),a.empresa]})]}),e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("span",{className:`px-3 py-1 rounded-full text-xs font-medium ${i.usuarios[a.status].color}`,children:i.usuarios[a.status].label}),e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["Último acesso: ",o(a.ultimo_acesso)]})]}),e.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:["Cadastrado em: ",o(a.data_cadastro)]})]}),M=({equipamento:a})=>e.jsxs(r.div,{layout:!0,initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg hover:shadow-xl transition-all duration-300",children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white text-lg mb-2",children:a.nome}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:[e.jsx("strong",{children:"Tipo:"})," ",a.tipo]}),e.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:[e.jsx("strong",{children:"Modelo:"})," ",a.modelo]}),e.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:[e.jsx("strong",{children:"Fabricante:"})," ",a.fabricante]})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:()=>n(t===a.id?null:a.id),className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",title:"Mais opções","aria-label":"Mais opções",children:e.jsx(x,{className:"w-5 h-5 text-gray-400 dark:text-gray-500"})}),e.jsx(l,{children:t===a.id&&e.jsx(r.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"absolute right-0 top-full mt-2 w-48 bg-white dark:bg-gray-800 rounded-xl shadow-lg border border-gray-200 dark:border-gray-700 z-10",children:e.jsxs("div",{className:"p-2",children:[e.jsxs("button",{className:"w-full flex items-center gap-2 px-3 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:[e.jsx(g,{className:"w-4 h-4"}),"Visualizar"]}),e.jsxs("button",{className:"w-full flex items-center gap-2 px-3 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:[e.jsx(L,{className:"w-4 h-4"}),"Manutenção"]}),e.jsxs("button",{className:"w-full flex items-center gap-2 px-3 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:[e.jsx(m,{className:"w-4 h-4"}),"Editar"]}),e.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors",children:[e.jsx(b,{className:"w-4 h-4"}),"Excluir"]})]})})})]})]}),e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("span",{className:`px-3 py-1 rounded-full text-xs font-medium ${i.equipamentos[a.status].color}`,children:i.equipamentos[a.status].label}),e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-300",children:a.ano_fabricacao})]}),a.obra_atual&&e.jsx("div",{className:"mb-3",children:e.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:[e.jsx("strong",{children:"Obra atual:"})," ",a.obra_atual]})}),e.jsxs("div",{className:"space-y-1 text-xs text-gray-500 dark:text-gray-400",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Série:"})," ",a.numero_serie]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Próxima manutenção:"})," ",o(a.proximo_manutencao)]})]})]}),B=()=>{switch(s){case"obras":return e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6",children:e.jsx(l,{children:p.map(a=>e.jsx(E,{obra:a},a.id))})});case"usuarios":return e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6",children:e.jsx(l,{children:j.map(a=>e.jsx(S,{usuario:a},a.id))})});case"equipamentos":return e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6",children:e.jsx(l,{children:v.map(a=>e.jsx(M,{equipamento:a},a.id))})});default:return null}};return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900",children:[e.jsx("div",{className:"bg-white/80 dark:bg-gray-800/80 backdrop-blur-md border-b border-gray-200/50 dark:border-gray-700/50",children:e.jsxs("div",{className:"px-6 py-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-2",children:"Cadastros"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:"Gerencie obras, usuários e equipamentos"})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(A,{}),e.jsxs(y,{to:`/cadastros/${s}/new`,className:"flex items-center gap-2 px-6 py-3 bg-blue-600 text-white rounded-xl hover:bg-blue-700 transition-colors shadow-lg",children:[e.jsx(P,{className:"w-5 h-5"}),"Novo ",s==="obras"?"Obra":s==="usuarios"?"Usuário":"Equipamento"]})]})]}),e.jsx("div",{className:"flex space-x-1 bg-gray-100 dark:bg-gray-700 p-1 rounded-xl mb-6 overflow-x-auto scrollbar-hide",children:_.map(a=>{const c=a.icon;return e.jsxs("button",{onClick:()=>k(a.id),className:`flex-1 min-w-[140px] flex items-center justify-center gap-2 px-4 py-3 rounded-lg font-medium transition-all duration-200 whitespace-nowrap ${s===a.id?"bg-white dark:bg-gray-800 text-blue-600 dark:text-blue-400 shadow-sm":"text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white"}`,children:[e.jsx(c,{className:"w-5 h-5 shrink-0"}),a.label,e.jsx("span",{className:`px-2 py-1 rounded-full text-xs shrink-0 ${s===a.id?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"bg-gray-200 dark:bg-gray-600 text-gray-600 dark:text-gray-300"}`,children:a.count})]},a.id)})}),e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx($,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400 dark:text-gray-500"}),e.jsx("input",{type:"text",placeholder:`Buscar ${s}...`,value:f,onChange:a=>N(a.target.value),className:"w-full pl-10 pr-4 py-3 bg-white/50 dark:bg-gray-700/50 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all"})]}),e.jsxs("button",{onClick:()=>w(!h),className:`flex items-center gap-2 px-4 py-3 rounded-xl border transition-colors ${h?"bg-blue-100 dark:bg-blue-900/30 border-blue-300 dark:border-blue-600 text-blue-700 dark:text-blue-300":"bg-white/50 dark:bg-gray-700/50 border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-600"}`,children:[e.jsx(U,{className:"w-5 h-5"}),"Filtros"]})]})]})}),e.jsx("div",{className:"px-6 py-6",children:B()})]})}export{Y as default}; diff --git a/dist/assets/js/Configuracoes-LYuviA0-.js b/dist/assets/js/Configuracoes-LYuviA0-.js deleted file mode 100644 index 4d4d257..0000000 --- a/dist/assets/js/Configuracoes-LYuviA0-.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./query-vendor-BLVqILA6.js";import{r as o,L as ce}from"./router-vendor-D4by-_6Z.js";import{T as xe}from"./ThemeToggle-Cryh6OOS.js";import{u as me,a as ge,c as ue,b as he,d as be,e as pe,f as ye}from"./configStore-DS-p50om.js";import{W as T,S as L,P as w,A as S,m as N,y as I,h as D,X as A,w as E,q as U,z as O,D as re,G as te,I as se,T as M,Z as q,J as le,b as P,U as F,K as oe,N as de,O as G,x as B,f as _,Q as z,V as $,Y as ie,_ as ne,$ as R,R as fe,c as H,M as K,a0 as je,a1 as ve,a2 as Ne,o as ke,a3 as we,a4 as Ce,a5 as Se}from"./ui-vendor-CyRvbSfR.js";import{u as Ee}from"./useInviteCode-BxOSdQOT.js";import{useCurrentUser as Ie}from"./useUserStore-VOdYc7Zm.js";import"./react-vendor-CqRd3GwO.js";import"./index-doec96Hx.js";import"./supabase-vendor-CnnNSQLo.js";import"./state-vendor-DHadhBU5.js";function De({isOpen:s,onClose:m,item:c,onSave:j}){const[r,y]=o.useState(c?.nome||""),[f,n]=o.useState(c?.descricao||""),[d,u]=o.useState({}),g=t=>{t.preventDefault();const x={};if(r.trim()||(x.nome="Nome é obrigatório"),Object.keys(x).length>0){u(x);return}j({nome:r.trim(),descricao:f.trim()||void 0}),m(),y(""),n(""),u({})},h=()=>{m(),y(""),n(""),u({})};return s?e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:e.jsxs(N.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white dark:bg-gray-800 rounded-2xl shadow-2xl w-full max-w-md",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:[c?"Editar":"Novo"," Tipo de Atividade"]}),e.jsx("button",{onClick:h,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:e.jsx(A,{className:"w-5 h-5 text-gray-500"})})]}),e.jsxs("form",{onSubmit:g,className:"p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Nome *"}),e.jsx("input",{type:"text",value:r,onChange:t=>y(t.target.value),className:`w-full px-4 py-3 rounded-xl border transition-colors ${d.nome?"border-red-300 focus:border-red-500 focus:ring-red-500/20":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500/20"} bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-4 focus:outline-none`,placeholder:"Ex: Escavação, Fundação, Concretagem..."}),d.nome&&e.jsxs("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400 flex items-center gap-1",children:[e.jsx(E,{className:"w-4 h-4"}),d.nome]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Descrição"}),e.jsx("textarea",{value:f,onChange:t=>n(t.target.value),rows:3,className:"w-full px-4 py-3 rounded-xl border border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500/20 bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-4 focus:outline-none resize-none",placeholder:"Descrição opcional da atividade..."})]}),e.jsxs("div",{className:"flex gap-3 pt-4",children:[e.jsx("button",{type:"button",onClick:h,className:"flex-1 px-4 py-3 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-xl font-medium transition-colors",children:"Cancelar"}),e.jsxs("button",{type:"submit",className:"flex-1 px-4 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center justify-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"Salvar"]})]})]})]})}):null}function Te(){const{items:s,add:m,update:c,delete:j}=me(),[r,y]=o.useState(""),[f,n]=o.useState(!1),[d,u]=o.useState(null),g=s.filter(a=>a.nome.toLowerCase().includes(r.toLowerCase())),h=()=>{u(null),n(!0)},t=a=>{u(a),n(!0)},x=a=>{confirm("Tem certeza que deseja excluir este tipo de atividade?")&&j(a)},i=a=>{d?c(d.id,a):m(a)};return e.jsxs("div",{className:"p-6 h-full",children:[e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 bg-blue-100 dark:bg-blue-900/30 rounded-lg",children:e.jsx(T,{className:"w-6 h-6 text-blue-600 dark:text-blue-400"})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Tipos de Atividades"})]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:"Configure os tipos de atividades disponíveis para seleção nos RDOs"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(L,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 dark:text-gray-500 w-5 h-5"}),e.jsx("input",{type:"text",placeholder:"Buscar tipos de atividades...",value:r,onChange:a=>y(a.target.value),className:"w-full pl-12 pr-4 py-3 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-4 focus:ring-blue-500/20 focus:border-blue-500 focus:outline-none text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400"})]}),e.jsxs("button",{onClick:h,className:"px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center gap-2 whitespace-nowrap",children:[e.jsx(w,{className:"w-5 h-5"}),"Nova Atividade"]})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700/50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Nome"}),e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Descrição"}),e.jsx("th",{className:"px-6 py-4 text-right text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Ações"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:e.jsx(S,{children:g.map(a=>e.jsxs(N.tr,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors",children:[e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:a.nome})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 max-w-xs truncate",children:a.descricao||"-"})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{onClick:()=>t(a),className:"p-2 text-gray-400 dark:text-gray-500 hover:text-blue-600 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-colors",title:"Editar",children:e.jsx(I,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>x(a.id),className:"p-2 text-gray-400 dark:text-gray-500 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors",title:"Excluir",children:e.jsx(D,{className:"w-4 h-4"})})]})})]},a.id))})})]})}),g.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(T,{className:"w-12 h-12 text-gray-300 dark:text-gray-600 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:r?"Nenhum resultado encontrado":"Nenhuma atividade cadastrada"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-6",children:r?"Tente ajustar os termos da busca":"Comece adicionando um novo tipo de atividade"}),!r&&e.jsxs("button",{onClick:h,className:"px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors inline-flex items-center gap-2",children:[e.jsx(w,{className:"w-5 h-5"}),"Nova Atividade"]})]})]})]}),e.jsx(De,{isOpen:f,onClose:()=>n(!1),item:d,onSave:i})]})}const Oe=[{value:"sun",label:"Sol",icon:se},{value:"cloud",label:"Nuvem",icon:O},{value:"rain",label:"Chuva",icon:te},{value:"snow",label:"Neve",icon:re}];function Me({isOpen:s,onClose:m,item:c,onSave:j}){const[r,y]=o.useState(c?.nome||""),[f,n]=o.useState(c?.descricao||""),[d,u]=o.useState(c?.icone||"cloud"),[g,h]=o.useState({}),t=i=>{i.preventDefault();const a={};if(r.trim()||(a.nome="Nome é obrigatório"),Object.keys(a).length>0){h(a);return}j({nome:r.trim(),descricao:f.trim()||void 0,icone:d}),m(),y(""),n(""),u("cloud"),h({})},x=()=>{m(),y(""),n(""),u("cloud"),h({})};return s?e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:e.jsxs(N.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white dark:bg-gray-800 rounded-2xl shadow-2xl w-full max-w-md",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:[c?"Editar":"Nova"," Condição Climática"]}),e.jsx("button",{onClick:x,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:e.jsx(A,{className:"w-5 h-5 text-gray-500"})})]}),e.jsxs("form",{onSubmit:t,className:"p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Nome *"}),e.jsx("input",{type:"text",value:r,onChange:i=>y(i.target.value),className:`w-full px-4 py-3 rounded-xl border transition-colors ${g.nome?"border-red-300 focus:border-red-500 focus:ring-red-500/20":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500/20"} bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-4 focus:outline-none`,placeholder:"Ex: Ensolarado, Nublado, Chuva..."}),g.nome&&e.jsxs("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400 flex items-center gap-1",children:[e.jsx(E,{className:"w-4 h-4"}),g.nome]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Ícone"}),e.jsx("div",{className:"grid grid-cols-4 gap-2",children:Oe.map(i=>{const a=i.icon;return e.jsxs("button",{type:"button",onClick:()=>u(i.value),className:`p-3 rounded-xl border-2 transition-colors flex flex-col items-center gap-1 ${d===i.value?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-200 dark:border-gray-600 hover:border-gray-300 dark:hover:border-gray-500"}`,children:[e.jsx(a,{className:`w-5 h-5 ${d===i.value?"text-blue-600 dark:text-blue-400":"text-gray-500"}`}),e.jsx("span",{className:`text-xs ${d===i.value?"text-blue-600 dark:text-blue-400":"text-gray-500"}`,children:i.label})]},i.value)})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Descrição"}),e.jsx("textarea",{value:f,onChange:i=>n(i.target.value),rows:3,className:"w-full px-4 py-3 rounded-xl border border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500/20 bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-4 focus:outline-none resize-none",placeholder:"Descrição opcional da condição climática..."})]}),e.jsxs("div",{className:"flex gap-3 pt-4",children:[e.jsx("button",{type:"button",onClick:x,className:"flex-1 px-4 py-3 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-xl font-medium transition-colors",children:"Cancelar"}),e.jsxs("button",{type:"submit",className:"flex-1 px-4 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center justify-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"Salvar"]})]})]})]})}):null}function X(s){return{sun:se,cloud:O,rain:te,snow:re}[s]||O}function $e(){const{items:s,add:m,update:c,delete:j}=ge(),[r,y]=o.useState(""),[f,n]=o.useState(!1),[d,u]=o.useState(null),g=s.filter(a=>a.nome.toLowerCase().includes(r.toLowerCase())),h=()=>{u(null),n(!0)},t=a=>{u(a),n(!0)},x=a=>{confirm("Tem certeza que deseja excluir esta condição climática?")&&j(a)},i=a=>{d?c(d.id,a):m(a)};return e.jsxs("div",{className:"p-6 h-full",children:[e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 bg-blue-100 dark:bg-blue-900/30 rounded-lg",children:e.jsx(O,{className:"w-6 h-6 text-blue-600 dark:text-blue-400"})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Condições Climáticas"})]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:"Configure as condições climáticas disponíveis para seleção nos RDOs"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(L,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 dark:text-gray-500 w-5 h-5"}),e.jsx("input",{type:"text",placeholder:"Buscar condições climáticas...",value:r,onChange:a=>y(a.target.value),className:"w-full pl-12 pr-4 py-3 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-4 focus:ring-blue-500/20 focus:border-blue-500 focus:outline-none text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400"})]}),e.jsxs("button",{onClick:h,className:"px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center gap-2 whitespace-nowrap",children:[e.jsx(w,{className:"w-5 h-5"}),"Nova Condição"]})]}),e.jsx("div",{className:"hidden md:block bg-white dark:bg-gray-800 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700/50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Condição"}),e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Descrição"}),e.jsx("th",{className:"px-6 py-4 text-right text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Ações"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:e.jsx(S,{children:g.map(a=>{const l=X(a.icone||"cloud");return e.jsxs(N.tr,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors",children:[e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(l,{className:"w-5 h-5 text-blue-600 dark:text-blue-400"}),e.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:a.nome})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300",children:a.descricao||"-"})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{onClick:()=>t(a),className:"p-2 text-gray-400 dark:text-gray-500 hover:text-blue-600 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-colors",title:"Editar",children:e.jsx(I,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>x(a.id),className:"p-2 text-gray-400 dark:text-gray-500 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors",title:"Excluir",children:e.jsx(D,{className:"w-4 h-4"})})]})})]},a.id)})})})]})})}),e.jsxs("div",{className:"block md:hidden space-y-4",children:[e.jsx(S,{children:g.map(a=>{const l=X(a.icone||"cloud");return e.jsxs(N.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"bg-white dark:bg-gray-800 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700 p-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx(l,{className:"w-6 h-6 text-blue-600 dark:text-blue-400"}),e.jsx("div",{className:"flex-1",children:e.jsx("h3",{className:"text-base font-medium text-gray-900 dark:text-white",children:a.nome})})]}),a.descricao&&e.jsx("div",{className:"mb-4",children:e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 leading-relaxed",children:a.descricao})}),e.jsxs("div",{className:"flex items-center justify-end gap-2 pt-3 border-t border-gray-200 dark:border-gray-700",children:[e.jsxs("button",{onClick:()=>t(a),className:"flex items-center gap-2 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:[e.jsx(I,{className:"w-4 h-4"}),"Editar"]}),e.jsxs("button",{onClick:()=>x(a.id),className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors",children:[e.jsx(D,{className:"w-4 h-4"}),"Excluir"]})]})]},a.id)})}),g.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(O,{className:"w-12 h-12 text-gray-300 dark:text-gray-600 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:r?"Nenhum resultado encontrado":"Nenhuma condição cadastrada"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-6",children:r?"Tente ajustar os termos da busca":"Comece adicionando uma nova condição climática"}),!r&&e.jsxs("button",{onClick:h,className:"px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors inline-flex items-center gap-2",children:[e.jsx(w,{className:"w-5 h-5"}),"Nova Condição"]})]})]})]}),e.jsx(Me,{isOpen:f,onClose:()=>n(!1),item:d,onSave:i})]})}const Le=[{value:"baixa",label:"Baixa",color:"text-green-600",bgColor:"bg-green-100"},{value:"media",label:"Média",color:"text-yellow-600",bgColor:"bg-yellow-100"},{value:"alta",label:"Alta",color:"text-orange-600",bgColor:"bg-orange-100"},{value:"critica",label:"Crítica",color:"text-red-600",bgColor:"bg-red-100"}],Ae=[{value:"alert-triangle",label:"Alerta",icon:M},{value:"clock",label:"Tempo",icon:P},{value:"shield",label:"Segurança",icon:le},{value:"zap",label:"Urgente",icon:q}];function Ue({isOpen:s,onClose:m,item:c,onSave:j}){const[r,y]=o.useState(c?.nome||""),[f,n]=o.useState(c?.descricao||""),[d,u]=o.useState(c?.severidade||"media"),[g,h]=o.useState(c?.cor||"alert-triangle"),[t,x]=o.useState({}),i=l=>{l.preventDefault();const v={};if(r.trim()||(v.nome="Nome é obrigatório"),Object.keys(v).length>0){x(v);return}j({nome:r.trim(),descricao:f.trim()||void 0,severidade:d,cor:g}),m(),y(""),n(""),u("media"),h("alert-triangle"),x({})},a=()=>{m(),y(""),n(""),u("media"),h("alert-triangle"),x({})};return s?e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:e.jsxs(N.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white dark:bg-gray-800 rounded-2xl shadow-2xl w-full max-w-md",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:[c?"Editar":"Novo"," Tipo de Ocorrência"]}),e.jsx("button",{onClick:a,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:e.jsx(A,{className:"w-5 h-5 text-gray-500"})})]}),e.jsxs("form",{onSubmit:i,className:"p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Nome *"}),e.jsx("input",{type:"text",value:r,onChange:l=>y(l.target.value),className:`w-full px-4 py-3 rounded-xl border transition-colors ${t.nome?"border-red-300 focus:border-red-500 focus:ring-red-500/20":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500/20"} bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-4 focus:outline-none`,placeholder:"Ex: Acidente, Atraso, Problema técnico..."}),t.nome&&e.jsxs("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400 flex items-center gap-1",children:[e.jsx(E,{className:"w-4 h-4"}),t.nome]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Severidade"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:Le.map(l=>e.jsxs("button",{type:"button",onClick:()=>u(l.value),className:`p-3 rounded-xl border-2 transition-colors flex items-center justify-center gap-2 ${d===l.value?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-200 dark:border-gray-600 hover:border-gray-300 dark:hover:border-gray-500"}`,children:[e.jsx("div",{className:`w-3 h-3 rounded-full ${l.bgColor}`}),e.jsx("span",{className:`text-sm font-medium ${d===l.value?"text-blue-600 dark:text-blue-400":"text-gray-700 dark:text-gray-300"}`,children:l.label})]},l.value))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Ícone"}),e.jsx("div",{className:"grid grid-cols-4 gap-2",children:Ae.map(l=>{const v=l.icon;return e.jsxs("button",{type:"button",onClick:()=>h(l.value),className:`p-3 rounded-xl border-2 transition-colors flex flex-col items-center gap-1 ${g===l.value?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-200 dark:border-gray-600 hover:border-gray-300 dark:hover:border-gray-500"}`,children:[e.jsx(v,{className:`w-5 h-5 ${g===l.value?"text-blue-600 dark:text-blue-400":"text-gray-500"}`}),e.jsx("span",{className:`text-xs ${g===l.value?"text-blue-600 dark:text-blue-400":"text-gray-500"}`,children:l.label})]},l.value)})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Descrição"}),e.jsx("textarea",{value:f,onChange:l=>n(l.target.value),rows:3,className:"w-full px-4 py-3 rounded-xl border border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500/20 bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-4 focus:outline-none resize-none",placeholder:"Descrição opcional do tipo de ocorrência..."})]}),e.jsxs("div",{className:"flex gap-3 pt-4",children:[e.jsx("button",{type:"button",onClick:a,className:"flex-1 px-4 py-3 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-xl font-medium transition-colors",children:"Cancelar"}),e.jsxs("button",{type:"submit",className:"flex-1 px-4 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center justify-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"Salvar"]})]})]})]})}):null}function Z(s){return{"alert-triangle":M,clock:P,shield:le,zap:q}[s]||M}function J(s){const m={baixa:{label:"Baixa",color:"text-green-700",bgColor:"bg-green-100"},media:{label:"Média",color:"text-yellow-700",bgColor:"bg-yellow-100"},alta:{label:"Alta",color:"text-orange-700",bgColor:"bg-orange-100"},critica:{label:"Crítica",color:"text-red-700",bgColor:"bg-red-100"}};return m[s]||m.media}function qe(){const{items:s,add:m,update:c,delete:j}=ue(),[r,y]=o.useState(""),[f,n]=o.useState(!1),[d,u]=o.useState(null),g=s.filter(a=>a.nome.toLowerCase().includes(r.toLowerCase())),h=()=>{u(null),n(!0)},t=a=>{u(a),n(!0)},x=a=>{confirm("Tem certeza que deseja excluir este tipo de ocorrência?")&&j(a)},i=a=>{d?c(d.id,a):m(a)};return e.jsxs("div",{className:"p-6 h-full",children:[e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 bg-orange-100 dark:bg-orange-900/30 rounded-lg",children:e.jsx(M,{className:"w-6 h-6 text-orange-600 dark:text-orange-400"})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Tipos de Ocorrências"})]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:"Configure os tipos de ocorrências e incidentes disponíveis para registro nos RDOs"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(L,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 dark:text-gray-500 w-5 h-5"}),e.jsx("input",{type:"text",placeholder:"Buscar tipos de ocorrências...",value:r,onChange:a=>y(a.target.value),className:"w-full pl-12 pr-4 py-3 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-4 focus:ring-blue-500/20 focus:border-blue-500 focus:outline-none text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400"})]}),e.jsxs("button",{onClick:h,className:"px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center gap-2 whitespace-nowrap",children:[e.jsx(w,{className:"w-5 h-5"}),"Nova Ocorrência"]})]}),e.jsx("div",{className:"hidden md:block bg-white dark:bg-gray-800 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700/50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Ocorrência"}),e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Severidade"}),e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Descrição"}),e.jsx("th",{className:"px-6 py-4 text-right text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Ações"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:e.jsx(S,{children:g.map(a=>{const l=Z(a.cor||"alert-triangle"),v=J(a.severidade||"media");return e.jsxs(N.tr,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors",children:[e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(l,{className:"w-5 h-5 text-orange-600 dark:text-orange-400"}),e.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:a.nome})]})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${v.bgColor} ${v.color}`,children:v.label})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300",children:a.descricao||"-"})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{onClick:()=>t(a),className:"p-2 text-gray-400 dark:text-gray-500 hover:text-blue-600 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-colors",title:"Editar",children:e.jsx(I,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>x(a.id),className:"p-2 text-gray-400 dark:text-gray-500 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors",title:"Excluir",children:e.jsx(D,{className:"w-4 h-4"})})]})})]},a.id)})})})]})})}),e.jsxs("div",{className:"block md:hidden space-y-4",children:[e.jsx(S,{children:g.map(a=>{const l=Z(a.cor||"alert-triangle"),v=J(a.severidade||"media");return e.jsxs(N.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"bg-white dark:bg-gray-800 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700 p-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx(l,{className:"w-6 h-6 text-orange-600 dark:text-orange-400"}),e.jsx("div",{className:"flex-1",children:e.jsx("h3",{className:"text-base font-medium text-gray-900 dark:text-white",children:a.nome})}),e.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${v.bgColor} ${v.color}`,children:v.label})]}),a.descricao&&e.jsx("div",{className:"mb-4",children:e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 leading-relaxed",children:a.descricao})}),e.jsxs("div",{className:"flex items-center justify-end gap-2 pt-3 border-t border-gray-200 dark:border-gray-700",children:[e.jsxs("button",{onClick:()=>t(a),className:"flex items-center gap-2 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:[e.jsx(I,{className:"w-4 h-4"}),"Editar"]}),e.jsxs("button",{onClick:()=>x(a.id),className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors",children:[e.jsx(D,{className:"w-4 h-4"}),"Excluir"]})]})]},a.id)})}),g.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(M,{className:"w-12 h-12 text-gray-300 dark:text-gray-600 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:r?"Nenhum resultado encontrado":"Nenhuma ocorrência cadastrada"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-6",children:r?"Tente ajustar os termos da busca":"Comece adicionando um novo tipo de ocorrência"}),!r&&e.jsxs("button",{onClick:h,className:"px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors inline-flex items-center gap-2",children:[e.jsx(w,{className:"w-5 h-5"}),"Nova Ocorrência"]})]})]})]}),e.jsx(Ue,{isOpen:f,onClose:()=>n(!1),item:d,onSave:i})]})}const Be=[{value:"operacional",label:"Operacional",icon:G},{value:"tecnico",label:"Técnico",icon:T},{value:"administrativo",label:"Administrativo",icon:de},{value:"gerencial",label:"Gerencial",icon:oe}];function ze({isOpen:s,onClose:m,item:c,onSave:j}){const[r,y]=o.useState(c?.nome||""),[f,n]=o.useState(c?.descricao||""),[d,u]=o.useState(c?.categoria||"operacional"),[g,h]=o.useState(c?.salarioBase?.toString()||""),[t,x]=o.useState({}),i=l=>{l.preventDefault();const v={};if(r.trim()||(v.nome="Nome é obrigatório"),g&&(isNaN(Number(g))||Number(g)<0)&&(v.salarioBase="Salário deve ser um número válido"),Object.keys(v).length>0){x(v);return}j({nome:r.trim(),descricao:f.trim()||void 0,categoria:d,salarioBase:g?Number(g):void 0}),m(),y(""),n(""),u("operacional"),h(""),x({})},a=()=>{m(),y(""),n(""),u("operacional"),h(""),x({})};return s?e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:e.jsxs(N.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white dark:bg-gray-800 rounded-2xl shadow-2xl w-full max-w-md",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:[c?"Editar":"Nova"," Função/Cargo"]}),e.jsx("button",{onClick:a,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:e.jsx(A,{className:"w-5 h-5 text-gray-500"})})]}),e.jsxs("form",{onSubmit:i,className:"p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Nome *"}),e.jsx("input",{type:"text",value:r,onChange:l=>y(l.target.value),className:`w-full px-4 py-3 rounded-xl border ${t.nome?"border-red-300 dark:border-red-600 focus:border-red-500 focus:ring-red-500/20":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500/20"} bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-4 focus:outline-none`,placeholder:"Ex: Pedreiro, Servente, Encarregado..."}),t.nome&&e.jsxs("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400 flex items-center gap-1",children:[e.jsx(E,{className:"w-4 h-4"}),t.nome]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Categoria"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:Be.map(l=>{const v=l.icon;return e.jsxs("button",{type:"button",onClick:()=>u(l.value),className:`p-3 rounded-xl border-2 transition-colors flex items-center gap-2 ${d===l.value?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-200 dark:border-gray-600 hover:border-gray-300 dark:hover:border-gray-500"}`,children:[e.jsx(v,{className:`w-4 h-4 ${d===l.value?"text-blue-600 dark:text-blue-400":"text-gray-500"}`}),e.jsx("span",{className:`text-sm font-medium ${d===l.value?"text-blue-600 dark:text-blue-400":"text-gray-700 dark:text-gray-300"}`,children:l.label})]},l.value)})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Salário Base (R$)"}),e.jsx("input",{type:"number",step:"0.01",min:"0",value:g,onChange:l=>h(l.target.value),className:`w-full px-4 py-3 rounded-xl border ${t.salarioBase?"border-red-300 dark:border-red-600 focus:border-red-500 focus:ring-red-500/20":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500/20"} bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-4 focus:outline-none`,placeholder:"Ex: 1500.00"}),t.salarioBase&&e.jsxs("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400 flex items-center gap-1",children:[e.jsx(E,{className:"w-4 h-4"}),t.salarioBase]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Descrição"}),e.jsx("textarea",{value:f,onChange:l=>n(l.target.value),rows:3,className:"w-full px-4 py-3 rounded-xl border border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500/20 bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-4 focus:outline-none resize-none",placeholder:"Descrição opcional da função/cargo..."})]}),e.jsxs("div",{className:"flex gap-3 pt-4",children:[e.jsx("button",{type:"button",onClick:a,className:"flex-1 px-4 py-3 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-xl font-medium transition-colors",children:"Cancelar"}),e.jsxs("button",{type:"submit",className:"flex-1 px-4 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center justify-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"Salvar"]})]})]})]})}):null}function Re(s){return{operacional:G,tecnico:T,administrativo:de,gerencial:oe}[s]||G}function Q(s){return{operacional:"Operacional",tecnico:"Técnico",administrativo:"Administrativo",gerencial:"Gerencial"}[s]||"Operacional"}function Fe(s){return new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(s)}function _e(){const{items:s,add:m,update:c,delete:j}=he(),[r,y]=o.useState(""),[f,n]=o.useState(!1),[d,u]=o.useState(null),g=s.filter(a=>a.nome.toLowerCase().includes(r.toLowerCase())||Q(a.categoria||"").toLowerCase().includes(r.toLowerCase())),h=()=>{u(null),n(!0)},t=a=>{u(a),n(!0)},x=a=>{confirm("Tem certeza que deseja excluir esta função/cargo?")&&j(a)},i=a=>{d?c(d.id,a):m(a)};return e.jsxs("div",{className:"p-6 h-full",children:[e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 bg-purple-100 dark:bg-purple-900/30 rounded-lg",children:e.jsx(F,{className:"w-6 h-6 text-purple-600 dark:text-purple-400"})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Funções/Cargos"})]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:"Configure as funções e cargos disponíveis para a equipe nos RDOs"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(L,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 dark:text-gray-500 w-5 h-5"}),e.jsx("input",{type:"text",placeholder:"Buscar funções/cargos...",value:r,onChange:a=>y(a.target.value),className:"w-full pl-12 pr-4 py-3 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-4 focus:ring-blue-500/20 focus:border-blue-500 focus:outline-none text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400"})]}),e.jsxs("button",{onClick:h,className:"px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center gap-2 whitespace-nowrap",children:[e.jsx(w,{className:"w-5 h-5"}),"Nova Função"]})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700/50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Função/Cargo"}),e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Categoria"}),e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Salário Base"}),e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Descrição"}),e.jsx("th",{className:"px-6 py-4 text-right text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Ações"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:e.jsx(S,{children:g.map(a=>{const l=Re(a.categoria||"operacional");return e.jsxs(N.tr,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors",children:[e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(l,{className:"w-5 h-5 text-purple-600 dark:text-purple-400"}),e.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:a.nome})]})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-purple-100 text-purple-800 dark:bg-purple-900/20 dark:text-purple-300",children:Q(a.categoria||"operacional")})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("div",{className:"text-sm text-gray-900 dark:text-white font-medium",children:a.salarioBase?Fe(a.salarioBase):"-"})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 max-w-xs truncate",children:a.descricao||"-"})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{onClick:()=>t(a),className:"p-2 text-gray-400 dark:text-gray-500 hover:text-blue-600 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-colors",title:"Editar",children:e.jsx(I,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>x(a.id),className:"p-2 text-gray-400 dark:text-gray-500 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors",title:"Excluir",children:e.jsx(D,{className:"w-4 h-4"})})]})})]},a.id)})})})]})}),g.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(F,{className:"w-12 h-12 text-gray-300 dark:text-gray-600 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:r?"Nenhum resultado encontrado":"Nenhuma função cadastrada"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-6",children:r?"Tente ajustar os termos da busca":"Comece adicionando uma nova função/cargo"}),!r&&e.jsxs("button",{onClick:h,className:"px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors inline-flex items-center gap-2",children:[e.jsx(w,{className:"w-5 h-5"}),"Nova Função"]})]})]})]}),e.jsx(ze,{isOpen:f,onClose:()=>n(!1),item:d,onSave:i})]})}const He=[{value:"pesado",label:"Pesado",icon:B},{value:"ferramenta",label:"Ferramenta",icon:z},{value:"eletrico",label:"Elétrico",icon:q},{value:"mecanico",label:"Mecânico",icon:T},{value:"outros",label:"Outros",icon:_}];function Ge({isOpen:s,onClose:m,item:c,onSave:j}){const[r,y]=o.useState(c?.nome||""),[f,n]=o.useState(c?.descricao||""),[d,u]=o.useState(c?.categoria||"ferramenta"),[g,h]=o.useState(c?.capacidade||""),[t,x]=o.useState(c?.valorHora?.toString()||""),[i,a]=o.useState({}),l=b=>{b.preventDefault();const k={};if(r.trim()||(k.nome="Nome é obrigatório"),t&&(isNaN(Number(t))||Number(t)<0)&&(k.valorHora="Valor deve ser um número válido"),Object.keys(k).length>0){a(k);return}j({nome:r.trim(),descricao:f.trim()||void 0,categoria:d,capacidade:g.trim()||void 0,valorHora:t?Number(t):void 0}),m(),y(""),n(""),u("ferramenta"),h(""),x(""),a({})},v=()=>{m(),y(""),n(""),u("ferramenta"),h(""),x(""),a({})};return s?e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:e.jsxs(N.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white dark:bg-gray-800 rounded-2xl shadow-2xl w-full max-w-md",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:[c?"Editar":"Novo"," Equipamento"]}),e.jsx("button",{onClick:v,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:e.jsx(A,{className:"w-5 h-5 text-gray-500"})})]}),e.jsxs("form",{onSubmit:l,className:"p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Nome *"}),e.jsx("input",{type:"text",value:r,onChange:b=>y(b.target.value),className:`w-full px-4 py-3 rounded-xl border transition-colors ${i.nome?"border-red-300 focus:border-red-500 focus:ring-red-500/20":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500/20"} bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-4 focus:outline-none`,placeholder:"Ex: Betoneira 400L, Guindaste 20T..."}),i.nome&&e.jsxs("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400 flex items-center gap-1",children:[e.jsx(E,{className:"w-4 h-4"}),i.nome]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Categoria"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:He.map(b=>{const k=b.icon;return e.jsxs("button",{type:"button",onClick:()=>u(b.value),className:`p-3 rounded-xl border-2 transition-colors flex items-center gap-2 ${d===b.value?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-200 dark:border-gray-600 hover:border-gray-300 dark:hover:border-gray-500"}`,children:[e.jsx(k,{className:`w-4 h-4 ${d===b.value?"text-blue-600 dark:text-blue-400":"text-gray-500"}`}),e.jsx("span",{className:`text-sm font-medium ${d===b.value?"text-blue-600 dark:text-blue-400":"text-gray-700 dark:text-gray-300"}`,children:b.label})]},b.value)})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Capacidade/Especificação"}),e.jsx("input",{type:"text",value:g,onChange:b=>h(b.target.value),className:"w-full px-4 py-3 rounded-xl border border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500/20 bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-4 focus:outline-none",placeholder:"Ex: 400L, 20T, 220V, 1500W..."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Valor por Hora (R$)"}),e.jsx("input",{type:"number",step:"0.01",min:"0",value:t,onChange:b=>x(b.target.value),className:`w-full px-4 py-3 rounded-xl border transition-colors ${i.valorHora?"border-red-300 focus:border-red-500 focus:ring-red-500/20":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500/20"} bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-4 focus:outline-none`,placeholder:"Ex: 25.00"}),i.valorHora&&e.jsxs("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400 flex items-center gap-1",children:[e.jsx(E,{className:"w-4 h-4"}),i.valorHora]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Descrição"}),e.jsx("textarea",{value:f,onChange:b=>n(b.target.value),rows:3,className:"w-full px-4 py-3 rounded-xl border border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500/20 bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-4 focus:outline-none resize-none",placeholder:"Descrição opcional do equipamento..."})]}),e.jsxs("div",{className:"flex gap-3 pt-4",children:[e.jsx("button",{type:"button",onClick:v,className:"flex-1 px-4 py-3 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-xl font-medium transition-colors",children:"Cancelar"}),e.jsxs("button",{type:"submit",className:"flex-1 px-4 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center justify-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"Salvar"]})]})]})]})}):null}function Pe(s){return{pesado:B,ferramenta:z,eletrico:q,mecanico:T,outros:_}[s]||z}function Y(s){return{pesado:"Pesado",ferramenta:"Ferramenta",eletrico:"Elétrico",mecanico:"Mecânico",outros:"Outros"}[s]||"Ferramenta"}function Ve(s){return new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(s)}function We(){const{items:s,add:m,update:c,delete:j}=be(),[r,y]=o.useState(""),[f,n]=o.useState(!1),[d,u]=o.useState(null),g=s.filter(a=>a.nome.toLowerCase().includes(r.toLowerCase())||Y(a.categoria||"").toLowerCase().includes(r.toLowerCase())||a.capacidade&&a.capacidade.toLowerCase().includes(r.toLowerCase())),h=()=>{u(null),n(!0)},t=a=>{u(a),n(!0)},x=a=>{confirm("Tem certeza que deseja excluir este equipamento?")&&j(a)},i=a=>{d?c(d.id,a):m(a)};return e.jsxs("div",{className:"p-6 h-full",children:[e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 bg-orange-100 dark:bg-orange-900/30 rounded-lg",children:e.jsx(B,{className:"w-6 h-6 text-orange-600 dark:text-orange-400"})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Tipos de Equipamentos"})]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:"Configure os equipamentos disponíveis para uso nos RDOs"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(L,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 dark:text-gray-500 w-5 h-5"}),e.jsx("input",{type:"text",placeholder:"Buscar equipamentos...",value:r,onChange:a=>y(a.target.value),className:"w-full pl-12 pr-4 py-3 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-4 focus:ring-blue-500/20 focus:border-blue-500 focus:outline-none text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400"})]}),e.jsxs("button",{onClick:h,className:"px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center gap-2 whitespace-nowrap",children:[e.jsx(w,{className:"w-5 h-5"}),"Novo Equipamento"]})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700/50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Equipamento"}),e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Categoria"}),e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Capacidade"}),e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Valor/Hora"}),e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Descrição"}),e.jsx("th",{className:"px-6 py-4 text-right text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Ações"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:e.jsx(S,{children:g.map(a=>{const l=Pe(a.categoria||"ferramenta");return e.jsxs(N.tr,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors",children:[e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(l,{className:"w-5 h-5 text-orange-600 dark:text-orange-400"}),e.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:a.nome})]})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-orange-100 text-orange-800 dark:bg-orange-900/20 dark:text-orange-300",children:Y(a.categoria||"ferramenta")})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("div",{className:"text-sm text-gray-900 dark:text-white",children:a.capacidade||"-"})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("div",{className:"text-sm text-gray-900 dark:text-white font-medium",children:a.valorHora?Ve(a.valorHora):"-"})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 max-w-xs truncate",children:a.descricao||"-"})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{onClick:()=>t(a),className:"p-2 text-gray-400 dark:text-gray-500 hover:text-blue-600 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-colors",title:"Editar",children:e.jsx(I,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>x(a.id),className:"p-2 text-gray-400 dark:text-gray-500 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors",title:"Excluir",children:e.jsx(D,{className:"w-4 h-4"})})]})})]},a.id)})})})]})}),g.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(B,{className:"w-12 h-12 text-gray-300 dark:text-gray-600 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:r?"Nenhum resultado encontrado":"Nenhum equipamento cadastrado"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-6",children:r?"Tente ajustar os termos da busca":"Comece adicionando um novo equipamento"}),!r&&e.jsxs("button",{onClick:h,className:"px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors inline-flex items-center gap-2",children:[e.jsx(w,{className:"w-5 h-5"}),"Novo Equipamento"]})]})]})]}),e.jsx(Ge,{isOpen:f,onClose:()=>n(!1),item:d,onSave:i})]})}const Ke=[{value:"agregados",label:"Agregados",icon:ne},{value:"cimento",label:"Cimento",icon:$},{value:"liquidos",label:"Líquidos",icon:ie},{value:"eletricos",label:"Elétricos",icon:q},{value:"ferragens",label:"Ferragens",icon:z}],Xe=["kg","m³","m²","m","L","un","cx","sc","t","pç"];function Ze({isOpen:s,onClose:m,item:c,onSave:j}){const[r,y]=o.useState(c?.nome||""),[f,n]=o.useState(c?.descricao||""),[d,u]=o.useState(c?.categoria||"agregados"),[g,h]=o.useState(c?.unidade||"kg"),[t,x]=o.useState(c?.valorUnitario?.toString()||""),[i,a]=o.useState({}),l=b=>{b.preventDefault();const k={};if(r.trim()||(k.nome="Nome é obrigatório"),t&&(isNaN(Number(t))||Number(t)<0)&&(k.valorUnitario="Valor deve ser um número válido"),Object.keys(k).length>0){a(k);return}j({nome:r.trim(),descricao:f.trim()||void 0,categoria:d,unidade:g,valorUnitario:t?Number(t):void 0}),m(),y(""),n(""),u("agregados"),h("kg"),x(""),a({})},v=()=>{m(),y(""),n(""),u("agregados"),h("kg"),x(""),a({})};return s?e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:e.jsxs(N.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white dark:bg-gray-800 rounded-2xl shadow-2xl w-full max-w-md",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:[c?"Editar":"Novo"," Material"]}),e.jsx("button",{onClick:v,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:e.jsx(A,{className:"w-5 h-5 text-gray-500"})})]}),e.jsxs("form",{onSubmit:l,className:"p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Nome *"}),e.jsx("input",{type:"text",value:r,onChange:b=>y(b.target.value),className:`w-full px-4 py-3 rounded-xl border transition-colors ${i.nome?"border-red-300 focus:border-red-500 focus:ring-red-500/20":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500/20"} bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-4 focus:outline-none`,placeholder:"Ex: Cimento Portland, Areia Média, Brita 1..."}),i.nome&&e.jsxs("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400 flex items-center gap-1",children:[e.jsx(E,{className:"w-4 h-4"}),i.nome]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Categoria"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:Ke.map(b=>{const k=b.icon;return e.jsxs("button",{type:"button",onClick:()=>u(b.value),className:`p-3 rounded-xl border-2 transition-colors flex items-center gap-2 ${d===b.value?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-200 dark:border-gray-600 hover:border-gray-300 dark:hover:border-gray-500"}`,children:[e.jsx(k,{className:`w-4 h-4 ${d===b.value?"text-blue-600 dark:text-blue-400":"text-gray-500"}`}),e.jsx("span",{className:`text-sm font-medium ${d===b.value?"text-blue-600 dark:text-blue-400":"text-gray-700 dark:text-gray-300"}`,children:b.label})]},b.value)})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Unidade"}),e.jsx("select",{value:g,onChange:b=>h(b.target.value),className:"w-full px-4 py-3 rounded-xl border border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500/20 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-4 focus:outline-none",children:Xe.map(b=>e.jsx("option",{value:b,children:b},b))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Valor Unitário (R$)"}),e.jsx("input",{type:"number",step:"0.01",min:"0",value:t,onChange:b=>x(b.target.value),className:`w-full px-4 py-3 rounded-xl border transition-colors ${i.valorUnitario?"border-red-300 focus:border-red-500 focus:ring-red-500/20":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500/20"} bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-4 focus:outline-none`,placeholder:"0.00"}),i.valorUnitario&&e.jsxs("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400 flex items-center gap-1",children:[e.jsx(E,{className:"w-4 h-4"}),i.valorUnitario]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Descrição"}),e.jsx("textarea",{value:f,onChange:b=>n(b.target.value),rows:3,className:"w-full px-4 py-3 rounded-xl border border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500/20 bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-4 focus:outline-none resize-none",placeholder:"Descrição opcional do material..."})]}),e.jsxs("div",{className:"flex gap-3 pt-4",children:[e.jsx("button",{type:"button",onClick:v,className:"flex-1 px-4 py-3 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-xl font-medium transition-colors",children:"Cancelar"}),e.jsxs("button",{type:"submit",className:"flex-1 px-4 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center justify-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"Salvar"]})]})]})]})}):null}function Je(s){return{agregados:ne,cimento:$,liquidos:ie,eletricos:q,ferragens:z}[s]||$}function ee(s){return{agregados:"Agregados",cimento:"Cimento",liquidos:"Líquidos",eletricos:"Elétricos",ferragens:"Ferragens"}[s]||"Agregados"}function Qe(s){return new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(s)}function Ye(){const{items:s,add:m,update:c,delete:j}=pe(),[r,y]=o.useState(""),[f,n]=o.useState(!1),[d,u]=o.useState(null),g=s.filter(a=>a.nome.toLowerCase().includes(r.toLowerCase())||ee(a.categoria||"").toLowerCase().includes(r.toLowerCase())||a.unidade&&a.unidade.toLowerCase().includes(r.toLowerCase())),h=()=>{u(null),n(!0)},t=a=>{u(a),n(!0)},x=a=>{confirm("Tem certeza que deseja excluir este material?")&&j(a)},i=a=>{d?c(d.id,a):m(a)};return e.jsxs("div",{className:"p-6 h-full",children:[e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 bg-green-100 dark:bg-green-900/30 rounded-lg",children:e.jsx($,{className:"w-6 h-6 text-green-600 dark:text-green-400"})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Materiais"})]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:"Configure os materiais disponíveis para uso nos RDOs"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(L,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 dark:text-gray-500 w-5 h-5"}),e.jsx("input",{type:"text",placeholder:"Buscar materiais...",value:r,onChange:a=>y(a.target.value),className:"w-full pl-12 pr-4 py-3 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-4 focus:ring-blue-500/20 focus:border-blue-500 focus:outline-none text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400"})]}),e.jsxs("button",{onClick:h,className:"px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center gap-2 whitespace-nowrap",children:[e.jsx(w,{className:"w-5 h-5"}),"Novo Material"]})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700/50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Material"}),e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Categoria"}),e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Unidade"}),e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Valor Unitário"}),e.jsx("th",{className:"px-6 py-4 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Descrição"}),e.jsx("th",{className:"px-6 py-4 text-right text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Ações"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:e.jsx(S,{children:g.map(a=>{const l=Je(a.categoria||"agregados");return e.jsxs(N.tr,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors",children:[e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(l,{className:"w-5 h-5 text-green-600 dark:text-green-400"}),e.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:a.nome})]})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900/20 dark:text-green-300",children:ee(a.categoria||"agregados")})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("div",{className:"text-sm text-gray-900 dark:text-white font-medium",children:a.unidade||"-"})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("div",{className:"text-sm text-gray-900 dark:text-white font-medium",children:a.valorUnitario?Qe(a.valorUnitario):"-"})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 max-w-xs truncate",children:a.descricao||"-"})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{onClick:()=>t(a),className:"p-2 text-gray-400 dark:text-gray-500 hover:text-blue-600 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-colors",title:"Editar",children:e.jsx(I,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>x(a.id),className:"p-2 text-gray-400 dark:text-gray-500 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors",title:"Excluir",children:e.jsx(D,{className:"w-4 h-4"})})]})})]},a.id)})})})]})}),g.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx($,{className:"w-12 h-12 text-gray-300 dark:text-gray-600 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:r?"Nenhum resultado encontrado":"Nenhum material cadastrado"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-6",children:r?"Tente ajustar os termos da busca":"Comece adicionando um novo material"}),!r&&e.jsxs("button",{onClick:h,className:"px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors inline-flex items-center gap-2",children:[e.jsx(w,{className:"w-5 h-5"}),"Novo Material"]})]})]})]}),e.jsx(Ze,{isOpen:f,onClose:()=>n(!1),item:d,onSave:i})]})}const ea=()=>{const s=Ie(),{loading:m,gerarConvite:c,listarConvites:j}=Ee(),[r,y]=o.useState([]),[f,n]=o.useState(!1),[d,u]=o.useState(null),[g,h]=o.useState(""),[t,x]=o.useState({emailConvidado:"",role:"usuario",maxUsos:1,expiraEmDias:7}),i=o.useCallback(async()=>{if(!s?.organizacao_id)return;const p=await j(s.organizacao_id);y(p)},[s?.organizacao_id,j]);o.useEffect(()=>{i()},[i]);const a=async()=>{if(!s?.organizacao_id)return;const p=await c(s.organizacao_id,{emailConvidado:t.emailConvidado||void 0,role:t.role,maxUsos:t.maxUsos,expiraEmDias:t.expiraEmDias});p.success&&(h(`Código gerado: ${p.codigo}`),n(!1),x({emailConvidado:"",role:"usuario",maxUsos:1,expiraEmDias:7}),i(),setTimeout(()=>h(""),5e3))},l=p=>{navigator.clipboard.writeText(p),u(p),setTimeout(()=>u(null),2e3)},v=p=>({admin:"Administrador",engenheiro:"Engenheiro",mestre_obra:"Mestre de Obra",usuario:"Usuário"})[p]||p,b=p=>new Date(p).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}),k=p=>p?new Date(p)n(!f),className:"flex items-center gap-2 bg-blue-600 text-white px-4 py-2 rounded-xl hover:bg-blue-700 transition-colors shadow-lg",children:[e.jsx(w,{className:"w-5 h-5"}),"Novo Convite"]})]})]}),g&&e.jsxs("div",{className:"flex items-center gap-2 p-4 bg-green-100 dark:bg-green-900/30 border border-green-200 dark:border-green-800 rounded-xl",children:[e.jsx(H,{className:"w-5 h-5 text-green-600 dark:text-green-400"}),e.jsx("p",{className:"text-green-800 dark:text-green-200 font-medium",children:g})]}),f&&e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl border border-gray-200/50 dark:border-gray-700/50 p-6 shadow-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Gerar Novo Código de Convite"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:[e.jsx(K,{className:"w-4 h-4 inline mr-1"}),"Email do Convidado (opcional)"]}),e.jsx("input",{type:"email",value:t.emailConvidado,onChange:p=>x(C=>({...C,emailConvidado:p.target.value})),placeholder:"Deixe vazio para qualquer email",className:"w-full px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-xl text-gray-900 dark:text-white placeholder-gray-400 focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:[e.jsx(F,{className:"w-4 h-4 inline mr-1"}),"Cargo"]}),e.jsxs("select",{value:t.role,onChange:p=>x(C=>({...C,role:p.target.value})),title:"Cargo do convidado",className:"w-full px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-xl text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[e.jsx("option",{value:"usuario",children:"Usuário"}),e.jsx("option",{value:"engenheiro",children:"Engenheiro"}),e.jsx("option",{value:"mestre_obra",children:"Mestre de Obra"}),e.jsx("option",{value:"admin",children:"Administrador"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Máximo de Usos"}),e.jsx("input",{type:"number",value:t.maxUsos,onChange:p=>x(C=>({...C,maxUsos:parseInt(p.target.value)||1})),min:1,max:100,title:"Máximo de usos",placeholder:"1",className:"w-full px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-xl text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:[e.jsx(P,{className:"w-4 h-4 inline mr-1"}),"Expira em (dias)"]}),e.jsx("input",{type:"number",value:t.expiraEmDias,onChange:p=>x(C=>({...C,expiraEmDias:parseInt(p.target.value)||7})),min:1,max:365,title:"Dias para expiração",placeholder:"7",className:"w-full px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-xl text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]})]}),e.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[e.jsx("button",{onClick:()=>n(!1),className:"px-4 py-2 text-gray-600 dark:text-gray-300 hover:text-gray-800 dark:hover:text-white transition-colors",children:"Cancelar"}),e.jsxs("button",{onClick:a,disabled:m,className:"flex items-center gap-2 bg-gradient-to-r from-blue-500 to-purple-600 text-white px-6 py-2 rounded-xl hover:from-blue-600 hover:to-purple-700 transition-all shadow-lg font-semibold disabled:opacity-50",children:[m?e.jsx(je,{className:"w-5 h-5 animate-spin"}):e.jsx(R,{className:"w-5 h-5"}),"Gerar Código"]})]})]}),e.jsx("div",{className:"space-y-3",children:r.length===0?e.jsxs("div",{className:"text-center py-12 bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl border border-gray-200/50 dark:border-gray-700/50",children:[e.jsx(R,{className:"w-12 h-12 text-gray-400 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-lg",children:"Nenhum convite gerado ainda."}),e.jsx("p",{className:"text-gray-400 dark:text-gray-500 text-sm mt-1",children:'Clique em "Novo Convite" para gerar um código.'})]}):r.map(p=>{const C=k(p.expira_em),V=p.max_usos>0&&p.usos_atuais>=p.max_usos,W=!p.ativo||C||V;return e.jsxs("div",{className:`p-4 bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl border transition-all duration-200 ${W?"border-gray-300/50 dark:border-gray-700/50 opacity-60":"border-blue-200/50 dark:border-blue-700/50 hover:shadow-lg"}`,children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("code",{className:"text-xl font-mono font-bold text-gray-900 dark:text-white tracking-wider bg-gray-100 dark:bg-gray-700 px-4 py-2 rounded-xl",children:p.codigo}),e.jsx("button",{onClick:()=>l(p.codigo),className:"p-2 text-gray-500 hover:text-blue-600 dark:hover:text-blue-400 transition-colors",title:"Copiar código",children:d===p.codigo?e.jsx(H,{className:"w-5 h-5 text-green-500"}):e.jsx(ve,{className:"w-5 h-5"})})]}),e.jsx("div",{className:"flex items-center gap-2",children:W?e.jsxs("span",{className:"inline-flex items-center gap-1 px-3 py-1 bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300 rounded-full text-sm font-medium",children:[e.jsx(Ne,{className:"w-4 h-4"}),C?"Expirado":V?"Esgotado":"Inativo"]}):e.jsxs("span",{className:"inline-flex items-center gap-1 px-3 py-1 bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300 rounded-full text-sm font-medium",children:[e.jsx(H,{className:"w-4 h-4"}),"Ativo"]})})]}),e.jsxs("div",{className:"mt-3 grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm text-gray-600 dark:text-gray-400",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Cargo:"})," ",v(p.role)]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Usos:"})," ",p.usos_atuais,"/",p.max_usos===0?"∞":p.max_usos]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Criado:"})," ",b(p.created_at)]}),p.expira_em&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Expira:"})," ",b(p.expira_em)]})]}),p.email_convidado&&e.jsxs("div",{className:"mt-2 text-sm text-blue-600 dark:text-blue-400",children:[e.jsx(K,{className:"w-4 h-4 inline mr-1"}),"Restrito a: ",p.email_convidado]})]},p.id)})})]})},ae=[{id:"atividades",label:"Tipos de Atividades",icon:T,description:"Configure os tipos de atividades disponíveis para os RDOs",component:Te},{id:"clima",label:"Condições Climáticas",icon:O,description:"Gerencie as opções de condições climáticas",component:$e},{id:"ocorrencias",label:"Tipos de Ocorrências",icon:M,description:"Configure os tipos de ocorrências e incidentes",component:qe},{id:"funcoes",label:"Funções/Cargos",icon:F,description:"Gerencie as funções e cargos da equipe",component:_e},{id:"equipamentos",label:"Tipos de Equipamentos",icon:B,description:"Configure os tipos de equipamentos disponíveis",component:We},{id:"materiais",label:"Materiais",icon:$,description:"Gerencie os tipos de materiais utilizados",component:Ye},{id:"convites",label:"Convites",icon:R,description:"Gerencie convites para novos membros da organização",component:ea}];function ma(){const[s,m]=o.useState("atividades"),[c,j]=o.useState(!1),{exportConfig:r,importConfig:y,resetToDefaults:f}=ye(),n=()=>{const t=r(),x=new Blob([t],{type:"application/json"}),i=URL.createObjectURL(x),a=document.createElement("a");a.href=i,a.download=`rdo-configuracoes-${new Date().toISOString().split("T")[0]}.json`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)},d=t=>{const x=t.target.files?.[0];if(x){const i=new FileReader;i.onload=a=>{const l=a.target?.result;y(l),alert("Configurações importadas com sucesso!")},i.readAsText(x)}},u=()=>{confirm("Tem certeza que deseja restaurar todas as configurações para os valores padrão? Esta ação não pode ser desfeita.")&&(f(),alert("Configurações restauradas para os valores padrão!"))},h=ae.find(t=>t.id===s)?.component;return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900 w-full overflow-x-hidden",children:[e.jsx("div",{className:"bg-white/80 dark:bg-gray-800/80 backdrop-blur-md border-b border-gray-200/50 dark:border-gray-700/50 w-full",children:e.jsx("div",{className:"px-3 sm:px-4 lg:px-6 py-4",children:e.jsxs("div",{className:"flex items-center justify-between min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 lg:gap-4 min-w-0 flex-1",children:[e.jsx(ce,{to:"/",className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-xl transition-colors flex-shrink-0",children:e.jsx(ke,{className:"w-5 h-5 text-gray-600 dark:text-gray-400"})}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[e.jsx("div",{className:"p-2 bg-blue-100 dark:bg-blue-900/30 rounded-lg flex-shrink-0",children:e.jsx(_,{className:"w-5 h-5 sm:w-6 sm:h-6 text-blue-600 dark:text-blue-400"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-lg sm:text-xl lg:text-2xl font-bold text-gray-900 dark:text-white truncate",children:"Configurações"}),e.jsx("p",{className:"text-xs sm:text-sm text-gray-600 dark:text-gray-300 hidden sm:block",children:"Gerencie as listas de seleção do sistema"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 flex-shrink-0",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>j(!c),className:"flex items-center gap-1 sm:gap-2 px-3 sm:px-4 py-2.5 sm:py-2 bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl border border-gray-200/50 dark:border-gray-700/50 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors text-sm font-medium text-gray-700 dark:text-gray-300 min-h-[44px] sm:min-h-0",children:[e.jsx(_,{className:"w-4 h-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Gerenciar"})]}),e.jsx(S,{children:c&&e.jsxs(N.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"absolute right-0 top-full mt-2 w-56 sm:w-48 bg-white dark:bg-gray-800 rounded-xl shadow-lg border border-gray-200 dark:border-gray-700 py-2 z-50",children:[e.jsxs("button",{onClick:n,className:"w-full flex items-center gap-3 px-4 py-3 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors min-h-[44px]",children:[e.jsx(we,{className:"w-4 h-4"}),"Exportar Configurações"]}),e.jsxs("label",{className:"w-full flex items-center gap-3 px-4 py-3 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors cursor-pointer min-h-[44px]",children:[e.jsx(Ce,{className:"w-4 h-4"}),"Importar Configurações",e.jsx("input",{type:"file",accept:".json",onChange:d,className:"hidden"})]}),e.jsx("hr",{className:"my-2 border-gray-200 dark:border-gray-700"}),e.jsxs("button",{onClick:u,className:"w-full flex items-center gap-3 px-4 py-3 text-sm text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors min-h-[44px]",children:[e.jsx(Se,{className:"w-4 h-4"}),"Restaurar Padrões"]})]})})]}),e.jsx(xe,{})]})]})})}),e.jsx("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md border-b border-gray-200/50 dark:border-gray-700/50",children:e.jsx("div",{className:"p-3 sm:p-4 lg:p-6",children:e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-2 sm:gap-3 lg:gap-4",children:ae.map(t=>{const x=t.icon;return e.jsxs("button",{onClick:()=>m(t.id),className:`flex flex-col items-center justify-center gap-1.5 sm:gap-2 p-3 sm:p-4 rounded-xl transition-all duration-200 min-h-[72px] sm:min-h-[80px] lg:min-h-[88px] touch-manipulation ${s===t.id?"bg-blue-600 text-white shadow-lg scale-105":"bg-white/50 dark:bg-gray-700/50 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 hover:scale-102"}`,children:[e.jsx(x,{className:`w-5 h-5 sm:w-6 sm:h-6 flex-shrink-0 ${s===t.id?"text-white":"text-gray-500 dark:text-gray-400"}`}),e.jsx("span",{className:`font-medium text-xs sm:text-sm text-center leading-tight ${s===t.id?"text-white":"text-gray-900 dark:text-white"}`,children:t.label.replace("Tipos de ","").replace("Condições ","")})]},t.id)})})})}),e.jsx("div",{className:"flex-1 overflow-auto h-[calc(100vh-200px)]",children:e.jsx(S,{mode:"wait",children:e.jsx(N.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.2},className:"h-full",children:h&&e.jsx(h,{})},s)})})]})}export{ma as default}; diff --git a/dist/assets/js/CreateObra-BwwQt_hK.js b/dist/assets/js/CreateObra-BwwQt_hK.js deleted file mode 100644 index 0069ebe..0000000 --- a/dist/assets/js/CreateObra-BwwQt_hK.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./query-vendor-BLVqILA6.js";import{u as p,o as u,s}from"./form-vendor-vQotxSmE.js";import{a as y}from"./zod-7IfHMaWP.js";import{o as h,m as i,B as f,j,l as k,k as v,a0 as N,q as w,t as l}from"./ui-vendor-CyRvbSfR.js";import{T as _}from"./ThemeToggle-Cryh6OOS.js";import{u as S,s as z}from"./index-doec96Hx.js";import{useCurrentUser as E}from"./useUserStore-VOdYc7Zm.js";import{d as O,L as m}from"./router-vendor-D4by-_6Z.js";import"./react-vendor-CqRd3GwO.js";import"./supabase-vendor-CnnNSQLo.js";import"./state-vendor-DHadhBU5.js";const C=u({nome:s().min(3,"Nome deve ter pelo menos 3 caracteres"),descricao:s().optional(),endereco:s().optional(),cidade:s().optional(),estado:s().optional(),data_inicio:s().optional(),data_prevista_fim:s().optional(),responsavel_id:s().optional()});function V(){const g=O(),{user:T}=S(),d=E(),{register:r,handleSubmit:b,formState:{errors:n,isSubmitting:c}}=p({resolver:y(C),defaultValues:{data_inicio:new Date().toISOString().split("T")[0]}}),x=async a=>{try{if(!d?.organizacao_id){l.error("Erro: Organização não identificada. Tente fazer login novamente.");return}const t={nome:a.nome,descricao:a.descricao,endereco:a.endereco,cidade:a.cidade,estado:a.estado,data_inicio:a.data_inicio||null,data_prevista_fim:a.data_prevista_fim||null,status:"ativa",progresso_geral:0,configuracoes:{},responsavel_id:a.responsavel_id||d.id,organizacao_id:d.organizacao_id},{error:o}=await z.from("obras").insert(t);if(o)throw o;l.success("Obra criada com sucesso!"),g("/cadastros")}catch(t){const o=t instanceof Error?t.message:"Erro desconhecido";l.error(`Erro ao criar obra: ${o}`)}};return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900",children:[e.jsx("div",{className:"bg-white/80 dark:bg-gray-800/80 backdrop-blur-md border-b border-gray-200/50 dark:border-gray-700/50 sticky top-0 z-10",children:e.jsxs("div",{className:"px-4 sm:px-6 py-4 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(m,{to:"/cadastros",className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-xl",children:e.jsx(h,{className:"w-5 h-5 text-gray-600 dark:text-gray-300"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Nova Obra"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:"Cadastre um novo empreendimento"})]})]}),e.jsx(_,{})]})}),e.jsx("div",{className:"max-w-4xl mx-auto p-4 sm:p-8",children:e.jsxs("form",{onSubmit:b(x),className:"space-y-6",children:[e.jsxs(i.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4 pb-4 border-b border-gray-100 dark:border-gray-700",children:[e.jsx("div",{className:"p-2 bg-blue-100 dark:bg-blue-900/30 rounded-lg",children:e.jsx(f,{className:"w-5 h-5 text-blue-600 dark:text-blue-400"})}),e.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:"Dados Principais"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Nome da Obra *"}),e.jsx("input",{type:"text",...r("nome"),className:"w-full p-3 bg-white/50 dark:bg-gray-700/50 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-2 focus:ring-blue-500 transition-all",placeholder:"Ex: Edifício Residencial Aurora"}),n.nome&&e.jsx("p",{className:"text-red-500 text-sm mt-1",children:n.nome.message})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Descrição"}),e.jsx("textarea",{...r("descricao"),rows:3,className:"w-full p-3 bg-white/50 dark:bg-gray-700/50 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-2 focus:ring-blue-500 transition-all",placeholder:"Breve descrição do projeto..."})]})]})]}),e.jsxs(i.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4 pb-4 border-b border-gray-100 dark:border-gray-700",children:[e.jsx("div",{className:"p-2 bg-green-100 dark:bg-green-900/30 rounded-lg",children:e.jsx(j,{className:"w-5 h-5 text-green-600 dark:text-green-400"})}),e.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:"Localização"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Endereço"}),e.jsx("input",{type:"text",...r("endereco"),className:"w-full p-3 bg-white/50 dark:bg-gray-700/50 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-2 focus:ring-blue-500 transition-all",placeholder:"Rua, número, bairro..."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Cidade"}),e.jsx("input",{type:"text",...r("cidade"),className:"w-full p-3 bg-white/50 dark:bg-gray-700/50 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-2 focus:ring-blue-500 transition-all"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Estado"}),e.jsx("input",{type:"text",...r("estado"),className:"w-full p-3 bg-white/50 dark:bg-gray-700/50 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-2 focus:ring-blue-500 transition-all",placeholder:"UF",maxLength:2})]})]})]}),e.jsxs(i.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4 pb-4 border-b border-gray-100 dark:border-gray-700",children:[e.jsx("div",{className:"p-2 bg-purple-100 dark:bg-purple-900/30 rounded-lg",children:e.jsx(k,{className:"w-5 h-5 text-purple-600 dark:text-purple-400"})}),e.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:"Prazos e Responsáveis"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Data de Início"}),e.jsx("input",{type:"date",...r("data_inicio"),className:"w-full p-3 bg-white/50 dark:bg-gray-700/50 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-2 focus:ring-blue-500 transition-all"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Previsão de Término"}),e.jsx("input",{type:"date",...r("data_prevista_fim"),className:"w-full p-3 bg-white/50 dark:bg-gray-700/50 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-2 focus:ring-blue-500 transition-all"})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"ID do Responsável (Opcional)"}),e.jsxs("div",{className:"relative",children:[e.jsx(v,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"}),e.jsx("input",{type:"text",...r("responsavel_id"),className:"w-full pl-10 p-3 bg-white/50 dark:bg-gray-700/50 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-2 focus:ring-blue-500 transition-all",placeholder:"UUID do usuário responsável"})]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Se vazio, será atribuído ao seu usuário."})]})]})]}),e.jsxs("div",{className:"flex gap-4 pt-4",children:[e.jsx(m,{to:"/cadastros",className:"flex-1 py-3 px-4 rounded-xl border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800 flex items-center justify-center gap-2 font-medium transition-colors",children:"Cancelar"}),e.jsx("button",{type:"submit",disabled:c,className:"flex-1 py-3 px-4 rounded-xl bg-blue-600 text-white hover:bg-blue-700 flex items-center justify-center gap-2 font-medium shadow-lg shadow-blue-500/30 transition-all disabled:opacity-50 disabled:cursor-not-allowed",children:c?e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"w-5 h-5 animate-spin"}),"Salvando..."]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"w-5 h-5"}),"Salvar Obra"]})})]})]})})]})}export{V as default}; diff --git a/dist/assets/js/CreateRDO-Bhe5_7xI.js b/dist/assets/js/CreateRDO-Bhe5_7xI.js deleted file mode 100644 index 3f59b45..0000000 --- a/dist/assets/js/CreateRDO-Bhe5_7xI.js +++ /dev/null @@ -1 +0,0 @@ -var Y=Object.defineProperty;var K=(p,t,a)=>t in p?Y(p,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):p[t]=a;var T=(p,t,a)=>K(p,typeof t!="symbol"?t+"":t,a);import{j as e}from"./query-vendor-BLVqILA6.js";import{r as h,c as X,d as Z,L as ee}from"./router-vendor-D4by-_6Z.js";import{u as te,o as ae,s as B}from"./form-vendor-vQotxSmE.js";import{a as re}from"./zod-7IfHMaWP.js";import{t as A,n as G,X as se,j as oe,R as ie,o as ne,F as de,A as q,m as I,W as le,h as P,P as V,p as ce,U as ue,q as ge,r as me,s as he,u as pe}from"./ui-vendor-CyRvbSfR.js";import{T as xe}from"./ThemeToggle-Cryh6OOS.js";import{u as be,a as ye,b as fe}from"./configStore-DS-p50om.js";import{s as w}from"./index-doec96Hx.js";import{D as we}from"./state-vendor-DHadhBU5.js";import"./react-vendor-CqRd3GwO.js";import"./supabase-vendor-CnnNSQLo.js";const ve=({onCapture:p,onClose:t})=>{const a=h.useRef(null),s=h.useRef(null),[r,n]=h.useState(null),[u,f]=h.useState(null),[l,c]=h.useState(!0),[O,R]=h.useState("environment"),D=h.useCallback(async()=>{try{r&&r.getTracks().forEach(g=>g.stop()),c(!0);const d=await navigator.mediaDevices.getUserMedia({video:{facingMode:O}});n(d),a.current&&(a.current.srcObject=d),c(!1)}catch{A.error("Não foi possível acessar a câmera. Verifique as permissões."),c(!1)}},[O]);h.useEffect(()=>(D(),"geolocation"in navigator&&navigator.geolocation.getCurrentPosition(d=>{f({lat:d.coords.latitude,lng:d.coords.longitude})},d=>{A.warning("Localização não permitida. A foto ficará sem coordenadas.")}),()=>{r&&r.getTracks().forEach(d=>d.stop())}),[D]);const k=()=>{R(d=>d==="user"?"environment":"user")},N=()=>{if(!a.current||!s.current)return;const d=a.current,g=s.current,m=g.getContext("2d");if(!m)return;g.width=d.videoWidth,g.height=d.videoHeight,m.drawImage(d,0,0,g.width,g.height);const b=20,v=Math.max(16,g.width/25),C=v*1.5*3+b*2;m.fillStyle="rgba(0, 0, 0, 0.6)",m.fillRect(0,g.height-C,g.width,C),m.fillStyle="#ffffff",m.font=`${v}px sans-serif`,m.textBaseline="bottom";const $=new Date().toLocaleString("pt-BR");if(m.fillText($,b,g.height-C+b+v),u){const _=`Lat: ${u.lat.toFixed(5)} | Lng: ${u.lng.toFixed(5)}`;m.fillText(_,b,g.height-C+b+(v+10)*2)}else m.fillText("Localização não disponível",b,g.height-C+b+(v+10)*2);m.font=`bold ${v*.8}px sans-serif`,m.fillStyle="#dddddd",m.fillText("RDO App - Registro Fotográfico",b,g.height-b),g.toBlob(_=>{if(_){const U=new File([_],`foto_rdo_${Date.now()}.jpg`,{type:"image/jpeg"});p(U)}},"image/jpeg",.85)};return e.jsxs("div",{className:"fixed inset-0 z-50 bg-black flex flex-col",children:[e.jsxs("div",{className:"flex justify-between items-center p-4 bg-black/50 absolute top-0 w-full z-10",children:[e.jsxs("h3",{className:"text-white font-semibold flex items-center gap-2",children:[e.jsx(G,{className:"w-5 h-5"})," Nova Foto"]}),e.jsx("button",{onClick:t,className:"p-2 bg-gray-800 rounded-full text-white",title:"Fechar câmera","aria-label":"Fechar câmera",children:e.jsx(se,{className:"w-6 h-6"})})]}),e.jsxs("div",{className:"flex-1 relative flex items-center justify-center bg-black overflow-hidden",children:[l&&e.jsx("p",{className:"text-white absolute",children:"Iniciando câmera..."}),e.jsx("video",{ref:a,autoPlay:!0,playsInline:!0,className:"w-full h-full object-cover"}),e.jsx("canvas",{ref:s,className:"hidden"}),e.jsxs("div",{className:"absolute bottom-24 left-4 right-4 text-white text-xs opacity-70 bg-black/40 p-2 rounded pointer-events-none",children:[e.jsx("p",{children:new Date().toLocaleTimeString()}),u&&e.jsxs("p",{className:"flex items-center gap-1 mt-1",children:[e.jsx(oe,{className:"w-3 h-3"}),u.lat.toFixed(4),", ",u.lng.toFixed(4)]})]})]}),e.jsxs("div",{className:"p-6 bg-black flex justify-around items-center",children:[e.jsx("button",{onClick:k,className:"p-3 bg-gray-800 rounded-full text-white hover:bg-gray-700 transition",title:"Trocar câmera","aria-label":"Trocar câmera",children:e.jsx(ie,{className:"w-6 h-6"})}),e.jsx("button",{onClick:N,className:"w-16 h-16 bg-white rounded-full border-4 border-gray-300 hover:scale-105 transition shadow-lg",title:"Tirar foto","aria-label":"Tirar foto"}),e.jsx("div",{className:"w-12"})," "]})]})},je=()=>{const[p,t]=h.useState(!1),[a,s]=h.useState(null),r=async()=>{try{const{data:l,error:c}=await w.from("tipos_atividade").select("*").eq("ativo",!0).order("nome");if(c)throw c;return l||[]}catch(l){throw l}},n=async()=>{try{const{data:l,error:c}=await w.from("condicoes_climaticas").select("*").eq("ativo",!0).order("nome");if(c)throw c;return l||[]}catch(l){throw l}},u=async()=>{try{const{data:l,error:c}=await w.from("funcionarios").select("*").eq("ativo",!0).order("nome");if(c)throw c;return l||[]}catch(l){throw l}},f=async()=>{try{t(!0),s(null),await Promise.all([r(),n(),u()])}catch(l){const c=l instanceof Error?l.message:"Erro desconhecido";s(c)}finally{t(!1)}};return h.useEffect(()=>{f()},[]),{loading:p,error:a,loadAllData:f,loadTiposAtividade:r,loadCondicoesClimaticas:n,loadFuncionarios:u}};class ke extends we{constructor(){super("RDO_Offline_DB");T(this,"pendingRDOs");T(this,"syncQueue");T(this,"cache");this.version(1).stores({pendingRDOs:"++id, uuid, status, createdAt",syncQueue:"++id, table, type, timestamp",cache:"key"})}}const j=new ke;class W{static detectConflict(t,a){if(!t.updated_at||!a.updated_at)return!1;const s=new Date(t.updated_at).getTime(),r=new Date(a.updated_at).getTime();return Math.abs(s-r)>1e3}static resolveLastWriteWins(t){return{resolved:!0,data:t.localTimestamp>t.remoteTimestamp?t.localVersion:t.remoteVersion,strategy:"last-write-wins",requiresManualReview:!1}}static resolveMerge(t){const a={...t.remoteVersion},s=[];for(const r in t.localVersion){const n=t.localVersion[r],u=t.remoteVersion[r];JSON.stringify(n)!==JSON.stringify(u)&&(t.localTimestamp>t.remoteTimestamp&&(a[r]=n),s.push(r))}return{resolved:!0,data:a,strategy:"merge",requiresManualReview:s.length>3}}static requireManualResolution(t){return{resolved:!1,data:t.localVersion,strategy:"manual",requiresManualReview:!0}}static resolve(t){switch(t.strategy){case"last-write-wins":return this.resolveLastWriteWins(t);case"merge":return this.resolveMerge(t);case"manual":return this.requireManualResolution(t);default:return this.resolveLastWriteWins(t)}}static createConflict(t,a,s,r="last-write-wins"){return{id:a.id,table:t,localVersion:a,remoteVersion:s,localTimestamp:a.updated_at?new Date(a.updated_at).getTime():Date.now(),remoteTimestamp:s.updated_at?new Date(s.updated_at).getTime():Date.now(),strategy:r}}}class H{static saveUnresolvedConflict(t){const a=this.getUnresolvedConflicts();a.push({...t,savedAt:Date.now()}),localStorage.setItem(this.STORAGE_KEY,JSON.stringify(a))}static getUnresolvedConflicts(){const t=localStorage.getItem(this.STORAGE_KEY);return t?JSON.parse(t):[]}static removeConflict(t){const s=this.getUnresolvedConflicts().filter(r=>r.id!==t);localStorage.setItem(this.STORAGE_KEY,JSON.stringify(s))}static clearAll(){localStorage.removeItem(this.STORAGE_KEY)}static count(){return this.getUnresolvedConflicts().length}}T(H,"STORAGE_KEY","rdo_unresolved_conflicts");const S={maxRetries:5,initialDelay:1e3,maxDelay:3e4,backoffMultiplier:2};class Ne{constructor(){T(this,"isSyncing",!1);T(this,"syncListeners",[]);window.addEventListener("online",()=>this.processQueue())}onSyncStatusChange(t){return this.syncListeners.push(t),()=>{this.syncListeners=this.syncListeners.filter(a=>a!==t)}}notifyListeners(t){this.syncListeners.forEach(a=>a(t))}get isOnline(){return navigator.onLine}async processQueue(){if(!(!this.isOnline||this.isSyncing))try{this.isSyncing=!0,this.notifyListeners({status:"syncing",message:"Sincronizando dados...",progress:0}),await this.processSyncQueue(),await this.processPendingRDOs(),this.notifyListeners({status:"success",message:"Sincronização concluída",progress:100})}catch(t){this.notifyListeners({status:"error",message:`Erro: ${t instanceof Error?t.message:"Desconhecido"}`,progress:0})}finally{this.isSyncing=!1}}async processSyncQueue(){const t=await j.syncQueue.orderBy("timestamp").toArray();if(t.length!==0)for(const[a,s]of t.entries()){const r=(a+1)/t.length*50;this.notifyListeners({status:"syncing",message:`Sincronizando operação ${a+1}/${t.length}`,progress:r}),await this.syncOperation(s)}}async syncOperation(t){let a=0,s=S.initialDelay;for(;a<=S.maxRetries;)try{await this.executeSyncOperation(t),await j.syncQueue.delete(t.id);return}catch(r){if(a++,a>S.maxRetries)throw await j.syncQueue.update(t.id,{retryCount:a}),r;await this.sleep(Math.min(s,S.maxDelay)),s*=S.backoffMultiplier}}async executeSyncOperation(t){const{type:a,table:s,data:r}=t;switch(a){case"INSERT":{const{error:n}=await w.from(s).insert(r);if(n)throw n;break}case"UPDATE":{r.id&&await this.checkAndResolveConflict(s,r);const{error:n}=await w.from(s).update(r).eq("id",r.id);if(n)throw n;break}case"DELETE":{const{error:n}=await w.from(s).delete().eq("id",r.id);if(n)throw n;break}}}async checkAndResolveConflict(t,a){const{data:s,error:r}=await w.from(t).select("*").eq("id",a.id).single();if(!(r||!s)&&W.detectConflict(a,s)){const n=W.createConflict(t,a,s,"last-write-wins"),u=W.resolve(n);u.requiresManualReview?H.saveUnresolvedConflict(n):Object.assign(a,u.data)}}async processPendingRDOs(){const t=await j.pendingRDOs.where("status").equals("pending").toArray();if(t.length!==0)for(const[a,s]of t.entries()){const r=50+(a+1)/t.length*50;this.notifyListeners({status:"syncing",message:`Sincronizando RDO ${a+1}/${t.length}`,progress:r}),await this.syncRDO(s)}}async syncRDO(t){let a=0,s=S.initialDelay;for(;a<=S.maxRetries;)try{await j.pendingRDOs.update(t.id,{status:"syncing"}),this.validateRDOPayload(t.payload);const{payload:r}=t,n={...r.rdo};delete n.atividades,delete n.mao_obra,delete n.equipamentos,delete n.ocorrencias,delete n.fotos;const{data:u,error:f}=await w.from("rdos").upsert(n).select().single();if(f)throw f;if(!u)throw new Error("Não foi possível recuperar o RDO inserido");const l=u.id,c=[],O=r.atividades;if(Array.isArray(O)&&O.length){const k=O.map(N=>({...N,rdo_id:l}));c.push(w.from("rdo_atividades").upsert(k))}const R=r.mao_obra;if(Array.isArray(R)&&R.length){const k=R.map(N=>({...N,rdo_id:l}));c.push(w.from("rdo_mao_obra").upsert(k))}const D=r.fotos;if(Array.isArray(D)&&D.length){const k=D.map(async d=>{const g=`${Date.now()}_${d.name.replace(/[^a-zA-Z0-9.]/g,"_")}`,m=`${l}/${g}`,{error:b}=await w.storage.from("rdo-photos").upload(m,d);if(b)throw b;const{data:{publicUrl:v}}=w.storage.from("rdo-photos").getPublicUrl(m);return{rdo_id:l,nome_arquivo:d.name,tipo_arquivo:d.type,tamanho_bytes:d.size,url_storage:v}}),N=await Promise.all(k);c.push(w.from("rdo_anexos").upsert(N))}await Promise.all(c),await j.pendingRDOs.delete(t.id);return}catch(r){if(a++,a>S.maxRetries)throw await j.pendingRDOs.update(t.id,{status:"failed"}),r;await this.sleep(Math.min(s,S.maxDelay)),s*=S.backoffMultiplier}}validateRDOPayload(t){if(!t.rdo)throw new Error('Payload inválido: campo "rdo" ausente');const a=t.rdo;if(!a.obra_id)throw new Error('Payload inválido: "obra_id" ausente');if(!a.data_relatorio)throw new Error('Payload inválido: "data_relatorio" ausente')}sleep(t){return new Promise(a=>setTimeout(a,t))}async forceSync(){await this.processQueue()}async getSyncStats(){const t=await j.pendingRDOs.count(),a=await j.syncQueue.count(),s=H.count();return{pendingRDOs:t,pendingOperations:a,unresolvedConflicts:s,isOnline:this.isOnline,isSyncing:this.isSyncing}}}const Se=new Ne,Oe=ae({data_relatorio:B().min(1,"Data é obrigatória"),condicoes_climaticas:B().min(1,"Condições climáticas são obrigatórias"),observacoes_gerais:B().optional()});function Fe(){const{id:p}=X(),t=Z(),{items:a}=be(),{items:s}=ye(),{items:r}=fe(),{loading:n,error:u}=je(),[f,l]=h.useState({basicas:!0,atividades:!0,maoObra:!0,equipamentos:!1,inspecaoQualidade:!0,ocorrencias:!1,anexos:!1}),[c,O]=h.useState([]),[R,D]=h.useState([]),[k,N]=h.useState([]),[d,g]=h.useState([]),[m,b]=h.useState(!1),[v,z]=h.useState([]),{register:C,handleSubmit:$,formState:{errors:_}}=te({resolver:re(Oe),defaultValues:{data_relatorio:new Date().toISOString().split("T")[0]}}),U=o=>{l(i=>({...i,[o]:!i[o]}))},M=(o,i)=>{o(y=>[...y,i])},F=(o,i)=>{o(y=>y.filter(L=>L.id!==i))},J=async o=>{const i=A.loading("Processando RDO..."),y={rdo:{...o,obra_id:p,status:"pendente"},atividades:c.map(x=>({tipo_atividade:x.tipo,descricao:x.descricao,localizacao:x.localizacao})),mao_obra:R.map(x=>({funcao:x.funcao,quantidade:x.quantidade,horas_trabalhadas:x.horas})),fotos:v};try{if(navigator.onLine){const x=crypto.randomUUID(),L=await j.pendingRDOs.add({uuid:x,payload:y,createdAt:new Date().toISOString(),status:"pending",updatedAt:new Date().toISOString()});await Se.processQueue();const Q=await j.pendingRDOs.get(L);if(Q&&Q.status==="failed")throw new Error("Falha na sincronização");Q?A.success("RDO salvo e sincronizando em segundo plano.",{id:i}):A.success("RDO sincronizado com sucesso!",{id:i})}else throw new Error("Offline")}catch(x){x.message==="Offline"?(await j.pendingRDOs.add({uuid:crypto.randomUUID(),payload:y,createdAt:new Date().toISOString(),status:"pending",updatedAt:new Date().toISOString()}),A.info("Sem internet. RDO salvo no dispositivo.",{id:i,duration:5e3})):A.warning("RDO salvo localmente, mas houve erro na sincronização. Tentaremos novamente depois.",{id:i,duration:5e3})}t(`/obra/${p}`)},E=({title:o,icon:i,section:y,count:x})=>e.jsxs("button",{type:"button",onClick:()=>U(y),className:"w-full flex items-center justify-between p-4 bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl border border-gray-200/50 dark:border-gray-700/50 shadow-lg hover:shadow-xl transition-all duration-300",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-blue-100 dark:bg-blue-900/30 rounded-lg",children:e.jsx(i,{className:"w-5 h-5 text-blue-600 dark:text-blue-400"})}),e.jsxs("h3",{className:"font-semibold text-gray-900 dark:text-white",children:[o," ",x!==void 0&&`(${x})`]})]}),f[y]?e.jsx(he,{className:"w-5 h-5 text-gray-400"}):e.jsx(pe,{className:"w-5 h-5 text-gray-400"})]});return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900",children:[e.jsxs("div",{className:"bg-white/80 dark:bg-gray-800/80 backdrop-blur-md border-b border-gray-200/50 dark:border-gray-700/50 sticky top-0 z-10",children:[e.jsxs("div",{className:"px-4 sm:px-6 py-4 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(ee,{to:`/obra/${p}`,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-xl",title:"Voltar para a obra",children:e.jsx(ne,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Criar RDO"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:"Obra: Edifício Aurora"})]})]}),e.jsx(xe,{})]}),n&&e.jsx("div",{className:"mx-4 mb-4 p-3 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg",children:e.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"🔄 Carregando dados do Supabase..."})}),u&&e.jsx("div",{className:"mx-4 mb-4 p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg",children:e.jsxs("p",{className:"text-red-700 dark:text-red-300 text-sm",children:["❌ Erro ao carregar dados: ",u]})})]}),e.jsxs("form",{onSubmit:$(J),className:"p-4 sm:p-6 space-y-4",children:[e.jsx(E,{title:"Informações Básicas",icon:de,section:"basicas"}),e.jsx(q,{children:f.basicas&&e.jsxs(I.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-900 dark:text-white mb-2",children:"Data"}),e.jsx("input",{type:"date",...C("data_relatorio"),defaultValue:new Date().toISOString().split("T")[0],className:"w-full p-3 bg-white/50 dark:bg-gray-700/50 border border-gray-300 dark:border-gray-600 rounded-xl"}),_.data_relatorio&&e.jsx("p",{className:"text-red-500 text-sm mt-1",children:_.data_relatorio.message})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-900 dark:text-white mb-2",children:"Clima"}),e.jsx("select",{...C("condicoes_climaticas"),"aria-label":"Condições Climáticas",title:"Selecione as condições climáticas",className:"w-full p-3 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-xl text-gray-900 dark:text-white",children:s.map(o=>e.jsx("option",{value:o.nome,className:"bg-white dark:bg-gray-700 text-gray-900 dark:text-white",children:o.nome},o.id))})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-900 dark:text-white mb-2",children:"Observações Gerais"}),e.jsx("textarea",{...C("observacoes_gerais"),rows:3,className:"w-full p-3 bg-white/50 dark:bg-gray-700/50 border border-gray-300 dark:border-gray-600 rounded-xl"})]})]})}),e.jsx(E,{title:"Atividades Executadas",icon:le,section:"atividades",count:c.length}),e.jsx(q,{children:f.atividades&&e.jsxs(I.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg space-y-4",children:[c.map((o,i)=>e.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg space-y-2",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"font-medium text-sm",children:["Atividade ",i+1]}),e.jsx("button",{type:"button",onClick:()=>F(O,o.id),title:"Remover atividade",children:e.jsx(P,{className:"w-4 h-4 text-red-500"})})]}),e.jsxs("select",{className:"w-full p-2 border rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white border-gray-300 dark:border-gray-600",defaultValue:"","aria-label":"Tipo de Atividade",title:"Selecione o tipo de atividade",children:[e.jsx("option",{value:"",disabled:!0,className:"text-gray-500 dark:text-gray-400",children:"Selecione o tipo"}),a.map(y=>e.jsx("option",{value:y.nome,className:"bg-white dark:bg-gray-700 text-gray-900 dark:text-white",children:y.nome},y.id))]}),e.jsx("input",{type:"text",placeholder:"Localização (Ex: Eixo A, 1º Pavimento)",className:"w-full p-2 border rounded"}),e.jsx("textarea",{placeholder:"Descrição detalhada da atividade",rows:2,className:"w-full p-2 border rounded"})]},o.id)),e.jsxs("button",{type:"button",onClick:()=>{alert("Botão Adicionar Atividade clicado!");const o={id:Date.now().toString(),tipo:"",descricao:"",localizacao:""};M(O,o)},className:"w-full flex items-center justify-center gap-2 py-2 px-4 bg-blue-100 text-blue-700 rounded-xl",children:[e.jsx(V,{className:"w-5 h-5"})," Adicionar Atividade"]})]})}),e.jsx(E,{title:"Inspeção de Qualidade",icon:ce,section:"inspecaoQualidade",count:k.length+d.length}),e.jsx(q,{children:f.inspecaoQualidade&&e.jsxs(I.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg space-y-4",children:[e.jsx("h4",{className:"font-semibold",children:"Inspeção de Solda"}),k.map((o,i)=>e.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg grid grid-cols-3 gap-2 items-center",children:[e.jsx("input",{type:"text",placeholder:`Junta #${i+1}`,className:"col-span-1 p-2 border rounded"}),e.jsxs("select",{className:"col-span-1 p-2 border rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white border-gray-300 dark:border-gray-600","aria-label":"Status da Solda",title:"Selecione o status da solda",children:[e.jsx("option",{className:"bg-white dark:bg-gray-700 text-gray-900 dark:text-white",children:"Aprovado"}),e.jsx("option",{className:"bg-white dark:bg-gray-700 text-gray-900 dark:text-white",children:"Reprovado"}),e.jsx("option",{className:"bg-white dark:bg-gray-700 text-gray-900 dark:text-white",children:"Pendente"})]}),e.jsx("button",{type:"button",onClick:()=>F(N,o.id),className:"justify-self-end",title:"Remover inspeção de solda",children:e.jsx(P,{className:"w-4 h-4 text-red-500"})})]},o.id)),e.jsxs("button",{type:"button",onClick:()=>{alert("Botão Adicionar Inspeção de Solda clicado!");const o={id:Date.now().toString(),junta:"",status:"pendente"};M(N,o)},className:"w-full text-sm flex items-center justify-center gap-2 py-2 px-4 bg-gray-100 text-gray-700 rounded-xl",children:[e.jsx(V,{className:"w-4 h-4"})," Adicionar Inspeção de Solda"]}),e.jsx("h4",{className:"font-semibold mt-4",children:"Verificação de Torque de Parafusos"}),d.map((o,i)=>e.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg grid grid-cols-3 gap-2 items-center",children:[e.jsx("input",{type:"text",placeholder:`Parafuso/Lote #${i+1}`,className:"col-span-1 p-2 border rounded"}),e.jsxs("select",{className:"col-span-1 p-2 border rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white border-gray-300 dark:border-gray-600","aria-label":"Status do Torque",title:"Selecione o status do torque",children:[e.jsx("option",{className:"bg-white dark:bg-gray-700 text-gray-900 dark:text-white",children:"Conforme"}),e.jsx("option",{className:"bg-white dark:bg-gray-700 text-gray-900 dark:text-white",children:"Não Conforme"})]}),e.jsx("button",{type:"button",onClick:()=>F(g,o.id),className:"justify-self-end",title:"Remover verificação de torque",children:e.jsx(P,{className:"w-4 h-4 text-red-500"})})]},o.id)),e.jsxs("button",{type:"button",onClick:()=>{alert("Botão Adicionar Verificação de Torque clicado!");const o={id:Date.now().toString(),parafuso:"",torque_aplicado:0,status:"conforme"};M(g,o)},className:"w-full text-sm flex items-center justify-center gap-2 py-2 px-4 bg-gray-100 text-gray-700 rounded-xl",children:[e.jsx(V,{className:"w-4 h-4"})," Adicionar Verificação de Torque"]})]})}),e.jsx(E,{title:"Mão de Obra",icon:ue,section:"maoObra",count:R.length}),e.jsx(q,{children:f.maoObra&&e.jsxs(I.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg space-y-4",children:[R.map(o=>e.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg grid grid-cols-4 gap-2 items-center",children:[e.jsxs("select",{className:"col-span-2 p-2 border rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white border-gray-300 dark:border-gray-600","aria-label":"Função da Mão de Obra",title:"Selecione a função",children:[e.jsx("option",{value:"",disabled:!0,className:"text-gray-500 dark:text-gray-400",children:"Selecione a função"}),r.map(i=>e.jsx("option",{value:i.nome,className:"bg-white dark:bg-gray-700 text-gray-900 dark:text-white",children:i.nome},i.id))]}),e.jsx("input",{type:"number",placeholder:"Qtd",className:"p-2 border rounded"}),e.jsx("button",{type:"button",onClick:()=>F(D,o.id),className:"justify-self-end",title:"Remover mão de obra",children:e.jsx(P,{className:"w-4 h-4 text-red-500"})})]},o.id)),e.jsxs("button",{type:"button",onClick:()=>M(D,{id:Date.now().toString(),funcao:"",quantidade:1,horas:8}),className:"w-full flex items-center justify-center gap-2 py-2 px-4 bg-blue-100 text-blue-700 rounded-xl",children:[e.jsx(V,{className:"w-5 h-5"})," Adicionar Mão de Obra"]})]})}),e.jsx(E,{title:"Registros Fotográficos",icon:G,section:"anexos",count:v.length}),e.jsx(q,{children:f.anexos&&e.jsx(I.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg space-y-4",children:e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[v.map((o,i)=>e.jsxs("div",{className:"relative group aspect-square rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700",children:[e.jsx("img",{src:URL.createObjectURL(o),alt:`Foto ${i+1}`,className:"w-full h-full object-cover"}),e.jsx("button",{type:"button",onClick:()=>z(y=>y.filter((x,L)=>L!==i)),className:"absolute top-1 right-1 p-1 bg-red-500 rounded-full text-white opacity-0 group-hover:opacity-100 transition-opacity",title:"Remover foto","aria-label":"Remover foto",children:e.jsx(P,{className:"w-4 h-4"})}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-black/50 text-white text-xs p-1 truncate",children:o.name})]},i)),e.jsxs("button",{type:"button",onClick:()=>b(!0),className:"flex flex-col items-center justify-center gap-2 aspect-square rounded-lg border-2 border-dashed border-gray-300 dark:border-gray-600 hover:border-blue-500 dark:hover:border-blue-400 text-gray-500 hover:text-blue-500 transition-colors bg-gray-50 dark:bg-gray-800/50",children:[e.jsx(G,{className:"w-8 h-8"}),e.jsx("span",{className:"text-sm font-medium",children:"Tirar Foto"})]})]})})}),e.jsxs("div",{className:"flex gap-4 pt-4",children:[e.jsxs("button",{type:"button",className:"flex-1 py-3 px-4 rounded-xl bg-gray-600 text-white hover:bg-gray-700 flex items-center justify-center gap-2",children:[e.jsx(ge,{className:"w-5 h-5"})," Salvar Rascunho"]}),e.jsxs("button",{type:"submit",className:"flex-1 py-3 px-4 rounded-xl bg-blue-600 text-white hover:bg-blue-700 flex items-center justify-center gap-2",children:[e.jsx(me,{className:"w-5 h-5"})," Enviar RDO"]})]})]}),m&&e.jsx(ve,{onCapture:o=>{z(i=>[...i,o]),b(!1)},onClose:()=>b(!1)})]})}export{Fe as default}; diff --git a/dist/assets/js/CreateTask-BlEDuvPM.js b/dist/assets/js/CreateTask-BlEDuvPM.js deleted file mode 100644 index e20ffaa..0000000 --- a/dist/assets/js/CreateTask-BlEDuvPM.js +++ /dev/null @@ -1 +0,0 @@ -import{j as a}from"./query-vendor-BLVqILA6.js";import{c as f,d as v,r as c,L as j}from"./router-vendor-D4by-_6Z.js";import{T as w}from"./ThemeToggle-Cryh6OOS.js";import{o as N,m as z,F as _,w as i,k as C,l as b,ab as $,j as D,X as T,q as S}from"./ui-vendor-CyRvbSfR.js";import"./react-vendor-CqRd3GwO.js";function u(d){const s=d.replace(/\D/g,"");return s.length<=2?s:s.length<=4?`${s.slice(0,2)}/${s.slice(2)}`:s.length<=8?`${s.slice(0,2)}/${s.slice(2,4)}/${s.slice(4,8)}`:`${s.slice(0,2)}/${s.slice(2,4)}/${s.slice(4,8)}`}const P=[{value:"baixa",label:"Baixa",color:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300"},{value:"media",label:"Média",color:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-300"},{value:"alta",label:"Alta",color:"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-300"},{value:"critica",label:"Crítica",color:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-300"}],I=["Estrutura","Elétrica","Hidráulica","Acabamento","Impermeabilização","Pintura","Alvenaria","Cobertura","Fundação","Outros"];function R(){const{id:d}=f(),s=v(),[g,x]=c.useState(!1),[r,m]=c.useState({}),[t,p]=c.useState({titulo:"",descricao:"",responsavel:"",prioridade:"media",data_inicio:"",data_prazo:"",categoria:"",localizacao:""}),o=(e,l)=>{p(n=>({...n,[e]:l})),r[e]&&m(n=>({...n,[e]:void 0}))},h=()=>{const e={};if(t.titulo.trim()||(e.titulo="Título é obrigatório"),t.descricao.trim()||(e.descricao="Descrição é obrigatória"),t.responsavel.trim()||(e.responsavel="Responsável é obrigatório"),t.data_inicio||(e.data_inicio="Data de início é obrigatória"),t.data_prazo||(e.data_prazo="Data prazo é obrigatória"),t.categoria||(e.categoria="Categoria é obrigatória"),t.data_inicio&&t.data_prazo){const l=new Date(t.data_inicio);new Date(t.data_prazo)<=l&&(e.data_prazo="Data prazo deve ser posterior à data de início")}return m(e),Object.keys(e).length===0},y=async e=>{if(e.preventDefault(),!!h()){x(!0);try{await new Promise(l=>setTimeout(l,1e3)),s(`/obra/${d}/tarefas`)}catch{}finally{x(!1)}}},k=()=>{s(`/obra/${d}/tarefas`)};return a.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900",children:[a.jsx("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md border-b border-gray-200/50 dark:border-gray-700/50 sticky top-0 z-10",children:a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"flex items-center justify-between h-16",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(j,{to:`/obra/${d}/tarefas`,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:a.jsx(N,{className:"w-5 h-5 text-gray-600 dark:text-gray-300"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Nova Tarefa"}),a.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Obra #",d]})]})]}),a.jsx(w,{})]})})}),a.jsx("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:a.jsx(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-8 border border-gray-200/50 dark:border-gray-700/50 shadow-lg",children:a.jsxs("form",{onSubmit:y,className:"space-y-6",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[a.jsx(_,{className:"w-4 h-4 inline mr-2"}),"Título *"]}),a.jsx("input",{type:"text",value:t.titulo,onChange:e=>o("titulo",e.target.value),className:`w-full px-4 py-3 rounded-xl border ${r.titulo?"border-red-300 dark:border-red-600":"border-gray-300 dark:border-gray-600"} bg-white/50 dark:bg-gray-700/50 backdrop-blur-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400`,placeholder:"Digite o título da tarefa"}),r.titulo&&a.jsxs("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400 flex items-center gap-1",children:[a.jsx(i,{className:"w-4 h-4"}),r.titulo]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Descrição *"}),a.jsx("textarea",{value:t.descricao,onChange:e=>o("descricao",e.target.value),rows:4,className:`w-full px-4 py-3 rounded-xl border ${r.descricao?"border-red-300 dark:border-red-600":"border-gray-300 dark:border-gray-600"} bg-white/50 dark:bg-gray-700/50 backdrop-blur-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all resize-none text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400`,placeholder:"Descreva detalhadamente a tarefa a ser executada"}),r.descricao&&a.jsxs("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400 flex items-center gap-1",children:[a.jsx(i,{className:"w-4 h-4"}),r.descricao]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[a.jsx(C,{className:"w-4 h-4 inline mr-2"}),"Responsável *"]}),a.jsx("input",{type:"text",value:t.responsavel,onChange:e=>o("responsavel",e.target.value),className:`w-full px-4 py-3 rounded-xl border ${r.responsavel?"border-red-300 dark:border-red-600":"border-gray-300 dark:border-gray-600"} bg-white/50 dark:bg-gray-700/50 backdrop-blur-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400`,placeholder:"Nome do responsável"}),r.responsavel&&a.jsxs("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400 flex items-center gap-1",children:[a.jsx(i,{className:"w-4 h-4"}),r.responsavel]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Prioridade"}),a.jsx("select",{value:t.prioridade,onChange:e=>o("prioridade",e.target.value),className:"w-full px-4 py-3 rounded-xl border border-gray-300 dark:border-gray-600 bg-white/50 dark:bg-gray-700/50 backdrop-blur-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all text-gray-900 dark:text-white",children:P.map(e=>a.jsx("option",{value:e.value,children:e.label},e.value))})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[a.jsx(b,{className:"w-4 h-4 inline mr-2"}),"Data de Início *"]}),a.jsx("input",{type:"text",value:t.data_inicio,onChange:e=>o("data_inicio",e.target.value),className:`w-full px-4 py-3 rounded-xl border ${r.data_inicio?"border-red-300 dark:border-red-600":"border-gray-300 dark:border-gray-600"} bg-white/50 dark:bg-gray-700/50 backdrop-blur-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400`,placeholder:"dd/mm/aaaa",maxLength:10,onInput:e=>{const l=u(e.currentTarget.value);e.currentTarget.value=l,o("data_inicio",l)}}),r.data_inicio&&a.jsxs("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400 flex items-center gap-1",children:[a.jsx(i,{className:"w-4 h-4"}),r.data_inicio]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[a.jsx(b,{className:"w-4 h-4 inline mr-2"}),"Data Prazo *"]}),a.jsx("input",{type:"text",value:t.data_prazo,onChange:e=>o("data_prazo",e.target.value),className:`w-full px-4 py-3 rounded-xl border ${r.data_prazo?"border-red-300 dark:border-red-600":"border-gray-300 dark:border-gray-600"} bg-white/50 dark:bg-gray-700/50 backdrop-blur-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400`,placeholder:"dd/mm/aaaa",maxLength:10,onInput:e=>{const l=u(e.currentTarget.value);e.currentTarget.value=l,o("data_prazo",l)}}),r.data_prazo&&a.jsxs("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400 flex items-center gap-1",children:[a.jsx(i,{className:"w-4 h-4"}),r.data_prazo]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[a.jsx($,{className:"w-4 h-4 inline mr-2"}),"Categoria *"]}),a.jsxs("select",{value:t.categoria,onChange:e=>o("categoria",e.target.value),className:`w-full px-4 py-3 rounded-xl border ${r.categoria?"border-red-300 dark:border-red-600":"border-gray-300 dark:border-gray-600"} bg-white/50 dark:bg-gray-700/50 backdrop-blur-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all text-gray-900 dark:text-white`,children:[a.jsx("option",{value:"",children:"Selecione uma categoria"}),I.map(e=>a.jsx("option",{value:e,children:e},e))]}),r.categoria&&a.jsxs("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400 flex items-center gap-1",children:[a.jsx(i,{className:"w-4 h-4"}),r.categoria]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[a.jsx(D,{className:"w-4 h-4 inline mr-2"}),"Localização"]}),a.jsx("input",{type:"text",value:t.localizacao,onChange:e=>o("localizacao",e.target.value),className:"w-full px-4 py-3 rounded-xl border border-gray-300 dark:border-gray-600 bg-white/50 dark:bg-gray-700/50 backdrop-blur-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400",placeholder:"Ex: 2º Pavimento, Sala 201"})]})]}),a.jsxs("div",{className:"flex gap-4 pt-6",children:[a.jsxs("button",{type:"button",onClick:k,className:"flex-1 flex items-center justify-center gap-2 py-3 px-6 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[a.jsx(T,{className:"w-5 h-5"}),"Cancelar"]}),a.jsxs("button",{type:"submit",disabled:g,className:"flex-1 flex items-center justify-center gap-2 py-3 px-6 bg-blue-600 text-white rounded-xl hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[a.jsx(S,{className:"w-5 h-5"}),g?"Salvando...":"Salvar Tarefa"]})]})]})})})]})}export{R as default}; diff --git a/dist/assets/js/Dashboard-BPPxBqO4.js b/dist/assets/js/Dashboard-BPPxBqO4.js deleted file mode 100644 index 8ef6def..0000000 --- a/dist/assets/js/Dashboard-BPPxBqO4.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./query-vendor-BLVqILA6.js";import{T as t}from"./ThemeToggle-Cryh6OOS.js";import{a as l,m as r,F as i,B as d,L as o,W as n,T as c,b as x,c as m}from"./ui-vendor-CyRvbSfR.js";import{L as a}from"./router-vendor-D4by-_6Z.js";import"./react-vendor-CqRd3GwO.js";const g=[{id:"1",nome:"Edifício Residencial Aurora",progresso:75,status:"ativa"},{id:"2",nome:"Shopping Center Plaza",progresso:45,status:"ativa"},{id:"3",nome:"Condomínio Jardim Verde",progresso:90,status:"pausada"}],b=[{id:"1",titulo:"Verificar torque dos parafusos - Setor A",obra:"Ed. Aurora",prazo:"Hoje"},{id:"2",titulo:"Aprovar RDO 15/01",obra:"Shopping Plaza",prazo:"Amanhã"}],h=s=>s>=80?"bg-green-500":s>=50?"bg-yellow-500":"bg-red-500";function N(){return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bg-white/80 dark:bg-gray-800/80 backdrop-blur-md sticky top-0 z-10",children:e.jsxs("div",{className:"px-4 sm:px-6 py-4 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-bold text-gray-900 dark:text-white",children:"Dashboard"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:"Bem-vindo, Engenheiro!"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(a,{to:"/manual",className:"flex items-center gap-2 px-3 py-2 bg-blue-100 dark:bg-blue-900/30 rounded-xl text-blue-700 dark:text-blue-300 hover:bg-blue-200 dark:hover:bg-blue-900/50 transition-colors",title:"Manual de Instruções",children:[e.jsx(l,{className:"w-4 h-4"}),e.jsx("span",{className:"hidden sm:inline text-sm font-medium",children:"Manual"})]}),e.jsx(t,{})]})]})}),e.jsxs("div",{className:"p-4 sm:p-6 space-y-6",children:[e.jsxs(r.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 dark:text-gray-200 mb-3",children:"Acesso Rápido"}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[e.jsxs(a,{to:"/rdo/novo",className:"flex flex-col items-center justify-center p-4 bg-blue-100 dark:bg-blue-900/30 rounded-2xl text-blue-700 dark:text-blue-300 hover:bg-blue-200 dark:hover:bg-blue-900/50 transition-colors",children:[e.jsx(i,{className:"w-8 h-8 mb-2"}),e.jsx("span",{className:"text-sm font-semibold text-center",children:"Novo RDO"})]}),e.jsxs(a,{to:"/cadastros/obras",className:"flex flex-col items-center justify-center p-4 bg-purple-100 dark:bg-purple-900/30 rounded-2xl text-purple-700 dark:text-purple-300 hover:bg-purple-200 dark:hover:bg-purple-900/50 transition-colors",children:[e.jsx(d,{className:"w-8 h-8 mb-2"}),e.jsx("span",{className:"text-sm font-semibold text-center",children:"Nova Obra"})]}),e.jsxs(a,{to:"/obra/1/tarefas",className:"flex flex-col items-center justify-center p-4 bg-green-100 dark:bg-green-900/30 rounded-2xl text-green-700 dark:text-green-300 hover:bg-green-200 dark:hover:bg-green-900/50 transition-colors",children:[e.jsx(o,{className:"w-8 h-8 mb-2"}),e.jsx("span",{className:"text-sm font-semibold text-center",children:"Apontar Tarefa"})]}),e.jsxs(a,{to:"/configuracoes",className:"flex flex-col items-center justify-center p-4 bg-gray-100 dark:bg-gray-700 rounded-2xl text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:[e.jsx(n,{className:"w-8 h-8 mb-2"}),e.jsx("span",{className:"text-sm font-semibold text-center",children:"Configurar"})]})]})]}),e.jsxs(r.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.1},children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 dark:text-gray-200 mb-3",children:"Avisos Importantes"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center p-4 bg-red-100 dark:bg-red-900/30 rounded-2xl text-red-800 dark:text-red-200",children:[e.jsx(c,{className:"w-6 h-6 mr-3"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-semibold",children:"Segurança"}),e.jsx("p",{className:"text-sm",children:"EPIs da equipe de montagem precisam de inspeção."})]})]}),e.jsxs("div",{className:"flex items-center p-4 bg-yellow-100 dark:bg-yellow-900/30 rounded-2xl text-yellow-800 dark:text-yellow-200",children:[e.jsx(x,{className:"w-6 h-6 mr-3"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-semibold",children:"Prazo Apertado"}),e.jsx("p",{className:"text-sm",children:"Entrega da estrutura do Setor B vence em 3 dias."})]})]})]})]}),e.jsxs(r.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.2},children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 dark:text-gray-200 mb-3",children:"Minhas Tarefas Pendentes"}),e.jsx("div",{className:"space-y-3",children:b.map(s=>e.jsxs("div",{className:"flex items-center p-4 bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl border border-gray-200/50 dark:border-gray-700/50",children:[e.jsx(m,{className:"w-6 h-6 mr-4 text-gray-400"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:s.titulo}),e.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:[s.obra," - ",e.jsx("span",{className:"font-semibold",children:s.prazo})]})]}),e.jsx(a,{to:"/obra/1/tarefas",className:"text-blue-600 dark:text-blue-400 font-semibold text-sm",children:"Ver"})]},s.id))})]}),e.jsxs(r.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.3},children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 dark:text-gray-200",children:"Obras em Andamento"}),e.jsx(a,{to:"/cadastros/obras",className:"text-blue-600 dark:text-blue-400 font-semibold text-sm",children:"Ver todas"})]}),e.jsx("div",{className:"space-y-3",children:g.filter(s=>s.status==="ativa").map(s=>e.jsxs(a,{to:`/obra/${s.id}`,className:"block p-4 bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"font-semibold text-gray-900 dark:text-white",children:s.nome}),e.jsxs("p",{className:"font-bold text-gray-800 dark:text-gray-200",children:[s.progresso,"%"]})]}),e.jsx("div",{className:"w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2 mt-2",children:e.jsx("div",{className:`h-2 rounded-full ${h(s.progresso)}`,style:{width:`${s.progresso}%`}})})]},s.id))})]})]})]})}export{N as default}; diff --git a/dist/assets/js/DatabaseTest-BA9LjsoE.js b/dist/assets/js/DatabaseTest-BA9LjsoE.js deleted file mode 100644 index 3328ace..0000000 --- a/dist/assets/js/DatabaseTest-BA9LjsoE.js +++ /dev/null @@ -1 +0,0 @@ -import{j as t}from"./query-vendor-BLVqILA6.js";import{r as i}from"./router-vendor-D4by-_6Z.js";import{s as a}from"./index-doec96Hx.js";import"./react-vendor-CqRd3GwO.js";import"./ui-vendor-CyRvbSfR.js";import"./supabase-vendor-CnnNSQLo.js";import"./state-vendor-DHadhBU5.js";const U=()=>{const[m,d]=i.useState([{name:"Conexão com Supabase",status:"pending"},{name:"Leitura da tabela usuarios",status:"pending"},{name:"Leitura da tabela obras",status:"pending"},{name:"Leitura da tabela rdos",status:"pending"},{name:"Inserção de dados de teste",status:"pending"},{name:"Teste de autenticação",status:"pending"},{name:"Teste de políticas RLS",status:"pending"}]),[r,u]=i.useState(!1),[g,n]=i.useState(-1),o=(e,s)=>{d(f=>f.map((l,y)=>y===e?{...l,...s}:l))},c=[{name:"Conexão com Supabase",icon:"🗄️",test:async()=>{try{const{data:e,error:s}=await a.from("usuarios").select("count",{count:"exact",head:!0});if(s)throw s;return{success:!0,message:"Conexão estabelecida com sucesso",data:"Tabela usuarios acessível"}}catch(e){return{success:!1,message:e.message}}}},{name:"Leitura da tabela usuarios",icon:"👥",test:async()=>{try{const{data:e,error:s}=await a.from("usuarios").select("*").limit(5);if(s)throw s;return{success:!0,message:`${e?.length||0} registros encontrados`,data:e}}catch(e){return{success:!1,message:e.message}}}},{name:"Leitura da tabela obras",icon:"🏗️",test:async()=>{try{const{data:e,error:s}=await a.from("obras").select("*").limit(5);if(s)throw s;return{success:!0,message:`${e?.length||0} registros encontrados`,data:e}}catch(e){return{success:!1,message:e.message}}}},{name:"Leitura da tabela rdos",icon:"📄",test:async()=>{try{const{data:e,error:s}=await a.from("rdos").select("*").limit(5);if(s)throw s;return{success:!0,message:`${e?.length||0} registros encontrados`,data:e}}catch(e){return{success:!1,message:e.message}}}},{name:"Inserção de dados de teste",icon:"➕",test:async()=>{try{const{data:e,error:s}=await a.from("usuarios").select("id").limit(1);if(s)throw s;return{success:!0,message:"Permissões de leitura funcionando",data:"Teste de inserção simulado"}}catch(e){return{success:!1,message:e.message}}}},{name:"Teste de autenticação",icon:"🔐",test:async()=>{try{const{data:{user:e}}=await a.auth.getUser();return{success:!0,message:e?`Usuário autenticado: ${e.email}`:"Usuário não autenticado (modo anônimo)",data:e?{id:e.id,email:e.email}:null}}catch(e){return{success:!1,message:e.message}}}},{name:"Teste de políticas RLS",icon:"🛡️",test:async()=>{try{const{data:e,error:s}=await a.from("usuarios").select("*").limit(1);if(s&&s.code==="PGRST116")return{success:!0,message:"RLS ativo - acesso negado conforme esperado",data:"Políticas funcionando"};if(s)throw s;return{success:!0,message:"RLS configurado - dados acessíveis",data:`${e?.length||0} registros`}}catch(e){return{success:!1,message:e.message}}}}],x=async()=>{u(!0);for(let e=0;esetTimeout(s,500))}n(-1),u(!1)},p=()=>{d(e=>e.map(s=>({...s,status:"pending",message:void 0,data:void 0}))),n(-1)},h=e=>{switch(e){case"running":return t.jsx("span",{className:"inline-block w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin"});case"success":return t.jsx("span",{className:"text-green-500 text-xl",children:"✓"});case"error":return t.jsx("span",{className:"text-red-500 text-xl",children:"✗"});default:return t.jsx("span",{className:"inline-block w-4 h-4 border-2 border-gray-300 rounded-full"})}},b=e=>{const s="px-2 py-1 rounded text-sm font-medium";switch(e){case"running":return t.jsx("span",{className:`${s} bg-blue-100 text-blue-800`,children:"Executando"});case"success":return t.jsx("span",{className:`${s} bg-green-100 text-green-800`,children:"Sucesso"});case"error":return t.jsx("span",{className:`${s} bg-red-100 text-red-800`,children:"Erro"});default:return t.jsx("span",{className:`${s} bg-gray-100 text-gray-800`,children:"Pendente"})}};return t.jsxs("div",{className:"container mx-auto p-6 space-y-6",children:[t.jsxs("div",{className:"text-center",children:[t.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Teste de Conexão do Banco de Dados"}),t.jsx("p",{className:"text-gray-600",children:"Verificação completa da integração com Supabase"})]}),t.jsxs("div",{className:"flex justify-center space-x-4",children:[t.jsxs("button",{onClick:x,disabled:r,className:"flex items-center space-x-2 px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",children:[r?t.jsx("span",{className:"inline-block w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}):t.jsx("span",{children:"🗄️"}),t.jsx("span",{children:r?"Executando Testes...":"Executar Todos os Testes"})]}),t.jsx("button",{onClick:p,disabled:r,className:"px-4 py-2 border border-gray-300 text-gray-700 rounded hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Resetar Testes"})]}),t.jsx("div",{className:"grid gap-4",children:m.map((e,s)=>t.jsxs("div",{className:`border border-gray-200 rounded-lg p-6 transition-all duration-200 hover:shadow-md bg-white ${g===s?"ring-2 ring-blue-500 shadow-lg":""}`,children:[t.jsx("div",{className:"pb-3",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[h(e.status),t.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:[t.jsx("span",{children:c[s]?.icon}),e.name]})]}),b(e.status)]})}),(e.message||e.data!==void 0)&&t.jsxs("div",{className:"pt-0",children:[e.message&&t.jsx("p",{className:`text-sm ${e.status==="error"?"text-red-600":"text-gray-600"}`,children:e.message}),e.data!==void 0&&t.jsx("div",{className:"mt-3 p-3 bg-gray-50 rounded-md",children:t.jsx("pre",{className:"text-xs text-gray-700 whitespace-pre-wrap",children:JSON.stringify(e.data,null,2)})})]})]},s))})]})};export{U as default}; diff --git a/dist/assets/js/ManualInstrucoes-G3xr1xLl.js b/dist/assets/js/ManualInstrucoes-G3xr1xLl.js deleted file mode 100644 index d62b14d..0000000 --- a/dist/assets/js/ManualInstrucoes-G3xr1xLl.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./query-vendor-BLVqILA6.js";import{r as h,L as E}from"./router-vendor-D4by-_6Z.js";import{T as M}from"./ThemeToggle-Cryh6OOS.js";import{X as L,ac as V,a as y,o as v,A as B,m as w,S as I,ad as O,c,b as C,C as x,P as d,F as l,f as s,H as j,U as N,J as D,T as A,ae as Q,af as U,x as q,ag as R,a3 as z,ah as G,ai as S,aj as H,R as k,ak as $,h as J,al as P,n as W,am as X,an as _}from"./ui-vendor-CyRvbSfR.js";import"./react-vendor-CqRd3GwO.js";const r=[{id:"introducao",titulo:"Bem-vindo ao App RDO da TrackSteel",icone:e.jsx(y,{className:"w-5 h-5"}),conteudo:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gradient-to-r from-blue-50 to-purple-50 dark:from-blue-900/20 dark:to-purple-900/20 rounded-2xl p-6 border border-blue-200/50 dark:border-blue-700/50",children:[e.jsx("h3",{className:"text-lg sm:text-xl font-semibold text-blue-900 dark:text-blue-100 mb-3",children:"🎉 Parabéns por escolher o App RDO!"}),e.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"Seu assistente completo para gerenciamento de obras e relatórios diários de obra (RDO). O App RDO é como ter um assistente pessoal que nunca esquece de nada e está sempre pronto para ajudar!"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-4 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-2 flex items-center gap-2",children:[e.jsx(c,{className:"w-4 h-4 text-green-500"}),"O que você vai aprender"]}),e.jsxs("ul",{className:"text-sm text-gray-600 dark:text-gray-400 space-y-1",children:[e.jsx("li",{children:"• Como navegar pelo aplicativo"}),e.jsx("li",{children:"• Criar e gerenciar suas obras"}),e.jsx("li",{children:"• Fazer RDOs completos e profissionais"}),e.jsx("li",{children:"• Acompanhar progresso e métricas"}),e.jsx("li",{children:"• Trabalhar offline e sincronizar"})]})]}),e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-4 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-2 flex items-center gap-2",children:[e.jsx(C,{className:"w-4 h-4 text-blue-500"}),"Tempo de leitura"]}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Este manual foi feito para ser lido como um livro. Reserve cerca de 15-20 minutos para uma leitura completa, ou navegue pelos capítulos conforme sua necessidade."})]})]})]})},{id:"primeiros-passos",titulo:"Primeiros Passos",icone:e.jsx(j,{className:"w-5 h-5"}),conteudo:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gradient-to-r from-green-50 to-blue-50 dark:from-green-900/20 dark:to-blue-900/20 rounded-2xl p-6 border border-green-200/50 dark:border-green-700/50",children:[e.jsx("h3",{className:"text-lg sm:text-xl font-semibold text-green-900 dark:text-green-100 mb-3",children:"🚀 Vamos começar sua jornada!"}),e.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"Pense no App RDO como sua nova casa digital para gerenciar obras. Assim como quando você chega em uma casa nova, vamos fazer um tour pelos cômodos principais para você se sentir em casa!"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-5 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx(x,{className:"w-5 h-5 text-blue-500"}),"1. O Dashboard - Sua Central de Comando"]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-3",children:"O Dashboard é como a sala de estar da sua casa - é onde você vê tudo que está acontecendo de uma só vez. Aqui você encontra:"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-4",children:[e.jsxs("div",{className:"bg-blue-50 dark:bg-blue-900/20 rounded-lg p-3",children:[e.jsx("p",{className:"text-sm font-medium text-blue-900 dark:text-blue-100",children:"📊 Resumo das Obras"}),e.jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:"Quantas obras ativas, pausadas e concluídas"})]}),e.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 rounded-lg p-3",children:[e.jsx("p",{className:"text-sm font-medium text-green-900 dark:text-green-100",children:"📋 RDOs do Dia"}),e.jsx("p",{className:"text-xs text-green-700 dark:text-green-300",children:"Quantos relatórios foram feitos hoje"})]})]}),e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700/30 rounded-lg p-3",children:[e.jsx("h5",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"🚀 Botões de Ação Rápida:"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1 text-blue-700 dark:text-blue-300",children:[e.jsx(d,{className:"w-3 h-3"}),e.jsx("span",{children:"Novo RDO"})]}),e.jsxs("div",{className:"flex items-center gap-1 text-purple-700 dark:text-purple-300",children:[e.jsx(d,{className:"w-3 h-3"}),e.jsx("span",{children:"Nova Obra"})]}),e.jsxs("div",{className:"flex items-center gap-1 text-green-700 dark:text-green-300",children:[e.jsx(l,{className:"w-3 h-3"}),e.jsx("span",{children:"Apontar Tarefa"})]}),e.jsxs("div",{className:"flex items-center gap-1 text-gray-700 dark:text-gray-300",children:[e.jsx(s,{className:"w-3 h-3"}),e.jsx("span",{children:"Configurações"})]})]})]})]}),e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-5 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx(s,{className:"w-5 h-5 text-purple-500"}),"2. Botões Importantes no Topo"]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-3",children:"No canto superior direito, você encontra três botões essenciais:"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3 p-2 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx(y,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Manual"}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:"- Este botão que você clicou para chegar aqui!"})]}),e.jsxs("div",{className:"flex items-center gap-3 p-2 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx(s,{className:"w-4 h-4 text-gray-500"}),e.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Configurações"}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:"- Para personalizar listas e opções"})]})]})]})]})]})},{id:"criando-obra",titulo:"Criando sua Primeira Obra",icone:e.jsx(d,{className:"w-5 h-5"}),conteudo:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gradient-to-r from-purple-50 to-pink-50 dark:from-purple-900/20 dark:to-pink-900/20 rounded-2xl p-6 border border-purple-200/50 dark:border-purple-700/50",children:[e.jsx("h3",{className:"text-lg sm:text-xl font-semibold text-purple-900 dark:text-purple-100 mb-3",children:"🏗️ Hora de criar sua primeira obra!"}),e.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"Criar uma obra no app é como plantar uma semente em um jardim. Você vai dar todas as informações necessárias para que ela cresça e seja bem cuidada durante todo o processo."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-5 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx("span",{className:"bg-blue-500 text-white rounded-full w-6 h-6 flex items-center justify-center text-sm",children:"1"}),'Encontre o Botão "Nova Obra"']}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-3",children:'No Dashboard, procure pelo botão azul "Nova Obra" no canto superior direito da seção "Suas Obras". É como um botão mágico que abre as portas para sua nova construção!'}),e.jsx("div",{className:"bg-blue-50 dark:bg-blue-900/20 rounded-lg p-3",children:e.jsxs("p",{className:"text-sm text-blue-800 dark:text-blue-200 flex items-center gap-2",children:[e.jsx(d,{className:"w-4 h-4"}),e.jsx("strong",{children:"Dica:"}),' O botão tem um ícone de "+" e é bem visível!']})})]}),e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-5 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx("span",{className:"bg-blue-500 text-white rounded-full w-6 h-6 flex items-center justify-center text-sm",children:"2"}),"Preencha as Informações"]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-3",children:"Quando clicar no botão, uma janela vai aparecer pedindo algumas informações básicas. É como preencher uma ficha de identificação da sua obra:"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700/50 rounded-lg p-3",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"📝 Nome da Obra"}),e.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:'Ex: "Edifício Residencial Aurora"'})]}),e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700/50 rounded-lg p-3",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"📍 Endereço"}),e.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Onde a obra está localizada"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700/50 rounded-lg p-3",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"👤 Cliente"}),e.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Quem contratou a obra"})]}),e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700/50 rounded-lg p-3",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"📅 Datas"}),e.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Início e fim previsto"})]})]})]})]})]})]})},{id:"fazendo-rdo",titulo:"Fazendo seu Primeiro RDO",icone:e.jsx(l,{className:"w-5 h-5"}),conteudo:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gradient-to-r from-orange-50 to-red-50 dark:from-orange-900/20 dark:to-red-900/20 rounded-2xl p-6 border border-orange-200/50 dark:border-orange-700/50",children:[e.jsx("h3",{className:"text-lg sm:text-xl font-semibold text-orange-900 dark:text-orange-100 mb-3",children:"📋 Seu primeiro Relatório Diário de Obra!"}),e.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"O RDO é como um diário da sua obra. Imagine que você está contando para um amigo tudo que aconteceu no canteiro hoje - quem trabalhou, que atividades foram feitas, se choveu, se houve algum problema..."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-5 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx("span",{className:"bg-orange-500 text-white rounded-full w-6 h-6 flex items-center justify-center text-sm",children:"1"}),"Acesse a Obra"]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-3",children:"No Dashboard, você verá todas as suas obras em cartões. Cada cartão tem dois botões importantes:"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"bg-blue-50 dark:bg-blue-900/20 rounded-lg p-3 flex items-center gap-3",children:[e.jsx(d,{className:"w-5 h-5 text-blue-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-blue-900 dark:text-blue-100",children:"Criar RDO"}),e.jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:"Para fazer um novo relatório"})]})]}),e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700/50 rounded-lg p-3 flex items-center gap-3",children:[e.jsx(l,{className:"w-5 h-5 text-gray-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Ver Detalhes"}),e.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Para ver todos os RDOs"})]})]})]})]}),e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-5 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx("span",{className:"bg-orange-500 text-white rounded-full w-6 h-6 flex items-center justify-center text-sm",children:"2"}),"Preencha o Relatório"]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-3",children:"O RDO é organizado em seções expansíveis para facilitar o preenchimento:"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 rounded-lg p-3",children:[e.jsxs("p",{className:"text-sm font-medium text-green-900 dark:text-green-100 mb-1 flex items-center gap-2",children:[e.jsx(l,{className:"w-4 h-4"}),"Informações Básicas"]}),e.jsx("p",{className:"text-xs text-green-700 dark:text-green-300",children:"Data, condições climáticas e observações gerais"})]}),e.jsxs("div",{className:"bg-blue-50 dark:bg-blue-900/20 rounded-lg p-3",children:[e.jsxs("p",{className:"text-sm font-medium text-blue-900 dark:text-blue-100 mb-1 flex items-center gap-2",children:[e.jsx(s,{className:"w-4 h-4"}),"Atividades Executadas"]}),e.jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:"Tipo, localização e descrição das atividades"})]}),e.jsxs("div",{className:"bg-purple-50 dark:bg-purple-900/20 rounded-lg p-3",children:[e.jsxs("p",{className:"text-sm font-medium text-purple-900 dark:text-purple-100 mb-1 flex items-center gap-2",children:[e.jsx(N,{className:"w-4 h-4"}),"Mão de Obra & Equipamentos"]}),e.jsx("p",{className:"text-xs text-purple-700 dark:text-purple-300",children:"Equipe, funções, horas e equipamentos utilizados"})]}),e.jsxs("div",{className:"bg-orange-50 dark:bg-orange-900/20 rounded-lg p-3",children:[e.jsxs("p",{className:"text-sm font-medium text-orange-900 dark:text-orange-100 mb-1 flex items-center gap-2",children:[e.jsx(D,{className:"w-4 h-4"}),"Inspeção de Qualidade"]}),e.jsx("p",{className:"text-xs text-orange-700 dark:text-orange-300",children:"Controle de soldas, torque e qualidade"})]}),e.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 rounded-lg p-3",children:[e.jsxs("p",{className:"text-sm font-medium text-red-900 dark:text-red-100 mb-1 flex items-center gap-2",children:[e.jsx(A,{className:"w-4 h-4"}),"Ocorrências & Anexos"]}),e.jsx("p",{className:"text-xs text-red-700 dark:text-red-300",children:"Incidentes, fotos e documentos"})]})]})]})]})]})},{id:"acompanhando-progresso",titulo:"Acompanhando o Progresso",icone:e.jsx(x,{className:"w-5 h-5"}),conteudo:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gradient-to-r from-teal-50 to-cyan-50 dark:from-teal-900/20 dark:to-cyan-900/20 rounded-2xl p-6 border border-teal-200/50 dark:border-teal-700/50",children:[e.jsx("h3",{className:"text-lg sm:text-xl font-semibold text-teal-900 dark:text-teal-100 mb-3",children:"📈 Vendo sua obra crescer!"}),e.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"Acompanhar o progresso da obra é como assistir uma planta crescer. A cada dia, você pode ver o quanto avançou e o que ainda falta para chegar ao final. O app te mostra isso de forma visual e fácil!"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-5 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx(x,{className:"w-5 h-5 text-teal-500"}),"Sistema de Relatórios Avançado"]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-3",children:"Acesse relatórios detalhados com filtros personalizáveis e exportação em múltiplos formatos:"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",children:[e.jsxs("h5",{className:"font-semibold text-blue-900 dark:text-blue-300 mb-2 flex items-center gap-2",children:[e.jsx(Q,{className:"w-4 h-4"}),"Relatório de Produtividade"]}),e.jsx("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Análise de rendimento por equipe, atividade e período com gráficos interativos."})]}),e.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-4 rounded-lg",children:[e.jsxs("h5",{className:"font-semibold text-green-900 dark:text-green-300 mb-2 flex items-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"Relatório Financeiro"]}),e.jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Controle de custos, orçamento vs realizado e projeções financeiras."})]}),e.jsxs("div",{className:"bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg",children:[e.jsxs("h5",{className:"font-semibold text-purple-900 dark:text-purple-300 mb-2 flex items-center gap-2",children:[e.jsx(q,{className:"w-4 h-4"}),"Relatório de Equipamentos"]}),e.jsx("p",{className:"text-sm text-purple-800 dark:text-purple-200",children:"Utilização, manutenção e custos operacionais dos equipamentos."})]}),e.jsxs("div",{className:"bg-orange-50 dark:bg-orange-900/20 p-4 rounded-lg",children:[e.jsxs("h5",{className:"font-semibold text-orange-900 dark:text-orange-300 mb-2 flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"Relatório de Obras"]}),e.jsx("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:"Progresso geral, marcos e cronograma de cada obra."})]})]}),e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-800/50 p-4 rounded-lg",children:[e.jsxs("h5",{className:"font-semibold text-gray-900 dark:text-gray-300 mb-2 flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"Exportação Flexível"]}),e.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-400 mb-2",children:"Exporte seus relatórios em diferentes formatos:"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("span",{className:"px-2 py-1 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-300 text-xs rounded",children:"PDF"}),e.jsx("span",{className:"px-2 py-1 bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300 text-xs rounded",children:"Excel"}),e.jsx("span",{className:"px-2 py-1 bg-purple-100 dark:bg-purple-900/30 text-purple-800 dark:text-purple-300 text-xs rounded",children:"CSV"}),e.jsx("span",{className:"px-2 py-1 bg-orange-100 dark:bg-orange-900/30 text-orange-800 dark:text-orange-300 text-xs rounded",children:"JSON"})]})]})]}),e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-5 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx(N,{className:"w-5 h-5 text-blue-500"}),"Status das Obras"]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-3",children:"Cada obra tem um status que te conta rapidamente como ela está:"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 rounded-lg p-3 text-center",children:[e.jsx("div",{className:"w-3 h-3 bg-green-500 rounded-full mx-auto mb-2"}),e.jsx("p",{className:"text-sm font-medium text-green-900 dark:text-green-100",children:"Ativa"}),e.jsx("p",{className:"text-xs text-green-700 dark:text-green-300",children:"Trabalhando normalmente"})]}),e.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 rounded-lg p-3 text-center",children:[e.jsx("div",{className:"w-3 h-3 bg-yellow-500 rounded-full mx-auto mb-2"}),e.jsx("p",{className:"text-sm font-medium text-yellow-900 dark:text-yellow-100",children:"Pausada"}),e.jsx("p",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:"Temporariamente parada"})]}),e.jsxs("div",{className:"bg-blue-50 dark:bg-blue-900/20 rounded-lg p-3 text-center",children:[e.jsx("div",{className:"w-3 h-3 bg-blue-500 rounded-full mx-auto mb-2"}),e.jsx("p",{className:"text-sm font-medium text-blue-900 dark:text-blue-100",children:"Concluída"}),e.jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:"Obra finalizada"})]})]})]})]})]})},{id:"configuracoes",titulo:"Personalizando o App",icone:e.jsx(s,{className:"w-5 h-5"}),conteudo:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gradient-to-r from-indigo-50 to-blue-50 dark:from-indigo-900/20 dark:to-blue-900/20 rounded-2xl p-6 border border-indigo-200/50 dark:border-indigo-700/50",children:[e.jsx("h3",{className:"text-lg sm:text-xl font-semibold text-indigo-900 dark:text-indigo-100 mb-3",children:"⚙️ Deixando o app com a sua cara!"}),e.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"As configurações são como o armário de ferramentas do app. Aqui você pode personalizar listas, adicionar novos tipos de atividades e deixar tudo do jeito que funciona melhor para você!"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-5 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx(s,{className:"w-5 h-5 text-indigo-500"}),"Acessando as Configurações"]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-3",children:'Clique no botão "Configurações" no canto superior direito do Dashboard. É como abrir a gaveta de ferramentas para ajustar o que precisar!'}),e.jsx("div",{className:"bg-indigo-50 dark:bg-indigo-900/20 rounded-lg p-3",children:e.jsxs("p",{className:"text-sm text-indigo-800 dark:text-indigo-200 flex items-center gap-2",children:[e.jsx(s,{className:"w-4 h-4"}),e.jsx("strong",{children:"Lembre-se:"})," Só administradores podem acessar as configurações!"]})})]}),e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-5 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx(s,{className:"w-5 h-5 text-purple-500"}),"Centro de Configurações"]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-3",children:"Personalize completamente o sistema com configurações organizadas por categoria:"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 mb-4",children:[e.jsxs("div",{className:"bg-purple-50 dark:bg-purple-900/20 rounded-lg p-3",children:[e.jsxs("p",{className:"text-sm font-medium text-purple-900 dark:text-purple-100 flex items-center gap-2",children:[e.jsx(l,{className:"w-4 h-4"}),"Tipos de Atividade"]}),e.jsx("p",{className:"text-xs text-purple-700 dark:text-purple-300",children:"Soldas, montagem, pintura, estruturas"})]}),e.jsxs("div",{className:"bg-blue-50 dark:bg-blue-900/20 rounded-lg p-3",children:[e.jsxs("p",{className:"text-sm font-medium text-blue-900 dark:text-blue-100 flex items-center gap-2",children:[e.jsx(G,{className:"w-4 h-4"}),"Condições Climáticas"]}),e.jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:"Sol, chuva, vento, nublado, garoa"})]}),e.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 rounded-lg p-3",children:[e.jsxs("p",{className:"text-sm font-medium text-green-900 dark:text-green-100 flex items-center gap-2",children:[e.jsx(N,{className:"w-4 h-4"}),"Funções da Equipe"]}),e.jsx("p",{className:"text-xs text-green-700 dark:text-green-300",children:"Soldador, montador, operador, técnico"})]}),e.jsxs("div",{className:"bg-orange-50 dark:bg-orange-900/20 rounded-lg p-3",children:[e.jsxs("p",{className:"text-sm font-medium text-orange-900 dark:text-orange-100 flex items-center gap-2",children:[e.jsx(q,{className:"w-4 h-4"}),"Equipamentos"]}),e.jsx("p",{className:"text-xs text-orange-700 dark:text-orange-300",children:"Guindastes, soldas, compressores"})]}),e.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 rounded-lg p-3",children:[e.jsxs("p",{className:"text-sm font-medium text-red-900 dark:text-red-100 flex items-center gap-2",children:[e.jsx(A,{className:"w-4 h-4"}),"Tipos de Ocorrência"]}),e.jsx("p",{className:"text-xs text-red-700 dark:text-red-300",children:"Incidentes, não conformidades, paradas"})]}),e.jsxs("div",{className:"bg-teal-50 dark:bg-teal-900/20 rounded-lg p-3",children:[e.jsxs("p",{className:"text-sm font-medium text-teal-900 dark:text-teal-100 flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"Localizações"]}),e.jsx("p",{className:"text-xs text-teal-700 dark:text-teal-300",children:"Eixos, pavimentos, setores da obra"})]})]}),e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-800/50 p-4 rounded-lg",children:[e.jsxs("h5",{className:"font-semibold text-gray-900 dark:text-gray-300 mb-2 flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"Backup e Restauração"]}),e.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-400 mb-2",children:"Gerencie suas configurações:"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("span",{className:"px-2 py-1 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-300 text-xs rounded",children:"Exportar Configurações"}),e.jsx("span",{className:"px-2 py-1 bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300 text-xs rounded",children:"Importar Configurações"}),e.jsx("span",{className:"px-2 py-1 bg-red-100 dark:bg-red-900/30 text-red-800 dark:text-red-300 text-xs rounded",children:"Restaurar Padrões"})]})]})]})]})]})},{id:"offline",titulo:"Modo Offline",icone:e.jsx(P,{className:"w-5 h-5"}),conteudo:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gradient-to-r from-orange-50 to-red-50 dark:from-orange-900/20 dark:to-red-900/20 rounded-2xl p-6 border border-orange-200/50 dark:border-orange-700/50",children:[e.jsx("h3",{className:"text-lg sm:text-xl font-semibold text-orange-900 dark:text-orange-100 mb-3",children:"📱 Trabalhe sem internet!"}),e.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"O App RDO funciona completamente offline. Crie RDOs, gerencie obras e configure o sistema mesmo sem conexão com a internet. Quando a conexão voltar, tudo será sincronizado automaticamente!"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md p-6 rounded-xl border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center gap-2",children:[e.jsx(S,{className:"w-5 h-5 text-blue-600 dark:text-blue-400"}),"Armazenamento Local"]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg border-l-4 border-blue-400",children:[e.jsxs("h5",{className:"font-semibold text-blue-900 dark:text-blue-300 mb-2 flex items-center gap-2",children:[e.jsx(H,{className:"w-4 h-4"}),"Dados Seguros"]}),e.jsx("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Todos os seus dados ficam salvos no dispositivo. RDOs, obras, configurações - tudo fica disponível offline."})]}),e.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-4 rounded-lg border-l-4 border-green-400",children:[e.jsxs("h5",{className:"font-semibold text-green-900 dark:text-green-300 mb-2 flex items-center gap-2",children:[e.jsx(D,{className:"w-4 h-4"}),"Sem Perda de Dados"]}),e.jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Mesmo que a internet caia no meio do trabalho, seus dados estão protegidos e salvos localmente."})]})]})]}),e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md p-6 rounded-xl border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center gap-2",children:[e.jsx(k,{className:"w-5 h-5 text-green-600 dark:text-green-400"}),"Sincronização Inteligente"]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-orange-50 dark:bg-orange-900/20 p-4 rounded-lg border-l-4 border-orange-400",children:[e.jsxs("h5",{className:"font-semibold text-orange-900 dark:text-orange-300 mb-2 flex items-center gap-2",children:[e.jsx($,{className:"w-4 h-4"}),"Status Visível"]}),e.jsx("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:"Veja o indicador de conexão no canto da tela. Ele mostra quantas operações estão aguardando sincronização."})]}),e.jsxs("div",{className:"bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg border-l-4 border-purple-400",children:[e.jsxs("h5",{className:"font-semibold text-purple-900 dark:text-purple-300 mb-2 flex items-center gap-2",children:[e.jsx(k,{className:"w-4 h-4"}),"Sync Automático"]}),e.jsx("p",{className:"text-sm text-purple-800 dark:text-purple-200",children:"Quando a internet voltar, o sistema sincroniza automaticamente todos os dados pendentes em segundo plano."})]})]})]})]}),e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md p-6 rounded-xl border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center gap-2",children:[e.jsx(s,{className:"w-5 h-5 text-purple-600 dark:text-purple-400"}),"Gerenciamento Offline"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg text-center",children:[e.jsx("div",{className:"w-12 h-12 bg-blue-100 dark:bg-blue-800/50 rounded-full flex items-center justify-center mx-auto mb-3",children:e.jsx(S,{className:"w-6 h-6 text-blue-600 dark:text-blue-400"})}),e.jsx("h5",{className:"font-semibold text-blue-900 dark:text-blue-300 mb-2",children:"Cache Local"}),e.jsx("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Visualize o tamanho do cache e dados armazenados localmente"})]}),e.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-4 rounded-lg text-center",children:[e.jsx("div",{className:"w-12 h-12 bg-green-100 dark:bg-green-800/50 rounded-full flex items-center justify-center mx-auto mb-3",children:e.jsx(k,{className:"w-6 h-6 text-green-600 dark:text-green-400"})}),e.jsx("h5",{className:"font-semibold text-green-900 dark:text-green-300 mb-2",children:"Sync Manual"}),e.jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Force a sincronização quando necessário através do painel de status"})]}),e.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-4 rounded-lg text-center",children:[e.jsx("div",{className:"w-12 h-12 bg-red-100 dark:bg-red-800/50 rounded-full flex items-center justify-center mx-auto mb-3",children:e.jsx(J,{className:"w-6 h-6 text-red-600 dark:text-red-400"})}),e.jsx("h5",{className:"font-semibold text-red-900 dark:text-red-300 mb-2",children:"Limpar Cache"}),e.jsx("p",{className:"text-sm text-red-800 dark:text-red-200",children:"Limpe o cache local quando necessário para liberar espaço"})]})]})]})]})},{id:"dicas",titulo:"Dicas e Truques",icone:e.jsx(_,{className:"w-5 h-5"}),conteudo:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gradient-to-r from-emerald-50 to-teal-50 dark:from-emerald-900/20 dark:to-teal-900/20 rounded-2xl p-6 border border-emerald-200/50 dark:border-emerald-700/50",children:[e.jsx("h3",{className:"text-lg sm:text-xl font-semibold text-emerald-900 dark:text-emerald-100 mb-3",children:"💡 Segredos para usar o app como um profissional!"}),e.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"Aqui estão algumas dicas especiais que vão fazer você usar o App RDO como um verdadeiro expert. São pequenos truques que fazem uma grande diferença no dia a dia!"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-5 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx(C,{className:"w-5 h-5 text-blue-500"}),"⏰ RDOs Diários"]}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-2",children:"Use as seções expansíveis para organizar melhor as informações. Preencha sempre no final do expediente!"}),e.jsx("div",{className:"bg-blue-50 dark:bg-blue-900/20 rounded-lg p-2",children:e.jsxs("p",{className:"text-xs text-blue-800 dark:text-blue-200",children:[e.jsx("strong",{children:"Dica:"})," Clique nas setas para expandir/recolher seções!"]})})]}),e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-5 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx(P,{className:"w-5 h-5 text-green-500"}),"📱 Modo Offline"]}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-2",children:"Trabalhe sem internet! O app sincroniza automaticamente quando a conexão voltar."}),e.jsx("div",{className:"bg-green-50 dark:bg-green-900/20 rounded-lg p-2",children:e.jsxs("p",{className:"text-xs text-green-800 dark:text-green-200",children:[e.jsx("strong",{children:"Status:"})," Monitore o indicador no canto da tela!"]})})]}),e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-5 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx(W,{className:"w-5 h-5 text-purple-500"}),"📸 Fotos & Anexos"]}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-2",children:"Anexe fotos aos RDOs para documentar o progresso. Especialmente útil para inspeções!"}),e.jsx("div",{className:"bg-purple-50 dark:bg-purple-900/20 rounded-lg p-2",children:e.jsxs("p",{className:"text-xs text-purple-800 dark:text-purple-200",children:[e.jsx("strong",{children:"Tip:"})," Fotos antes/depois são muito valiosas!"]})})]}),e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-5 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx(s,{className:"w-5 h-5 text-orange-500"}),"⚙️ Personalize Tudo"]}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-2",children:"Configure tipos de atividades, condições climáticas e outros parâmetros nas configurações."}),e.jsx("div",{className:"bg-orange-50 dark:bg-orange-900/20 rounded-lg p-2",children:e.jsxs("p",{className:"text-xs text-orange-800 dark:text-orange-200",children:[e.jsx("strong",{children:"Estratégia:"})," Adapte às necessidades da sua obra!"]})})]}),e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-5 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx(x,{className:"w-5 h-5 text-red-500"}),"📊 Relatórios Avançados"]}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-2",children:"Explore diferentes tipos de relatórios e formatos de exportação (PDF, Excel, CSV, JSON)."}),e.jsx("div",{className:"bg-red-50 dark:bg-red-900/20 rounded-lg p-2",children:e.jsxs("p",{className:"text-xs text-red-800 dark:text-red-200",children:[e.jsx("strong",{children:"Filtros:"})," Use filtros para relatórios específicos!"]})})]}),e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-5 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx(X,{className:"w-5 h-5 text-indigo-500"}),"🌙 Modo Escuro"]}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-2",children:"Alterne entre temas claro e escuro para trabalhar confortavelmente em qualquer ambiente."}),e.jsx("div",{className:"bg-indigo-50 dark:bg-indigo-900/20 rounded-lg p-2",children:e.jsxs("p",{className:"text-xs text-indigo-800 dark:text-indigo-200",children:[e.jsx("strong",{children:"Conforto:"})," Reduz cansaço visual durante uso prolongado!"]})})]})]}),e.jsxs("div",{className:"bg-gradient-to-r from-yellow-50 to-orange-50 dark:from-yellow-900/20 dark:to-orange-900/20 rounded-xl p-5 border border-yellow-200/50 dark:border-yellow-700/50",children:[e.jsxs("h4",{className:"font-semibold text-yellow-900 dark:text-yellow-100 mb-3 flex items-center gap-2",children:[e.jsx(c,{className:"w-5 h-5"}),"🎯 Dica de Ouro"]}),e.jsxs("p",{className:"text-yellow-800 dark:text-yellow-200 text-sm",children:[e.jsx("strong",{children:"O segredo do sucesso:"})," Use o app todos os dias, mesmo que seja só para dar uma olhada rápida. Assim você sempre sabe como suas obras estão andando e pode tomar decisões mais inteligentes!"]})]})]})},{id:"conclusao",titulo:"Parabéns! Você chegou ao fim",icone:e.jsx(c,{className:"w-5 h-5"}),conteudo:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gradient-to-r from-green-50 to-emerald-50 dark:from-green-900/20 dark:to-emerald-900/20 rounded-2xl p-6 border border-green-200/50 dark:border-green-700/50",children:[e.jsx("h3",{className:"text-lg sm:text-xl font-semibold text-green-900 dark:text-green-100 mb-3",children:"🎉 Parabéns, você é agora um usuário expert do App RDO!"}),e.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:"Você chegou ao final deste manual e agora tem todas as ferramentas necessárias para usar o App RDO como um verdadeiro profissional. É hora de colocar a mão na massa!"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-5 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx(c,{className:"w-5 h-5 text-green-500"}),"✅ O que você aprendeu"]}),e.jsxs("ul",{className:"text-sm text-gray-600 dark:text-gray-400 space-y-1",children:[e.jsx("li",{children:"• Como navegar pelo Dashboard"}),e.jsx("li",{children:"• Criar e gerenciar obras"}),e.jsx("li",{children:"• Fazer RDOs completos"}),e.jsx("li",{children:"• Acompanhar o progresso"}),e.jsx("li",{children:"• Personalizar configurações"}),e.jsx("li",{children:"• Dicas de uso profissional"})]})]}),e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl p-5 border border-gray-200/50 dark:border-gray-700/50",children:[e.jsxs("h4",{className:"font-semibold text-gray-900 dark:text-white mb-3 flex items-center gap-2",children:[e.jsx(j,{className:"w-5 h-5 text-blue-500"}),"🚀 Próximos passos"]}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:"Agora é hora de praticar! Comece criando sua primeira obra e fazendo seu primeiro RDO. Lembre-se: a prática leva à perfeição!"}),e.jsxs(E,{to:"/",className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors text-sm font-medium",children:[e.jsx(j,{className:"w-4 h-4"}),"Voltar ao Dashboard"]})]})]}),e.jsxs("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 rounded-xl p-5 border border-blue-200/50 dark:border-blue-700/50 text-center",children:[e.jsx("h4",{className:"font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"💙 Obrigado por usar o App RDO!"}),e.jsx("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:'Este manual sempre estará aqui quando você precisar. Clique no botão "Manual" no Dashboard sempre que quiser revisar algum conceito ou descobrir algo novo!'})]})]})}];function se(){const[t,m]=h.useState("introducao"),[o,g]=h.useState(!1),[f,T]=h.useState(""),F=r.filter(a=>a.titulo.toLowerCase().includes(f.toLowerCase())),b=r.find(a=>a.id===t)||r[0],i=r.findIndex(a=>a.id===t),p=r[i+1],u=r[i-1];return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900 w-full overflow-x-hidden",children:[e.jsx("div",{className:"bg-white/80 dark:bg-gray-800/80 backdrop-blur-md border-b border-gray-200/50 dark:border-gray-700/50 sticky top-0 z-40",children:e.jsxs("div",{className:"px-4 sm:px-6 py-3 sm:py-4 flex items-center justify-between min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-4 min-w-0",children:[e.jsx("button",{onClick:()=>g(!o),className:"lg:hidden p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-xl transition-colors",children:o?e.jsx(L,{className:"w-4 h-4 sm:w-5 sm:h-5"}):e.jsx(V,{className:"w-4 h-4 sm:w-5 sm:h-5"})}),e.jsxs("div",{children:[e.jsxs("h1",{className:"text-lg sm:text-xl lg:text-2xl font-bold text-gray-900 dark:text-white flex items-center gap-2 min-w-0",children:[e.jsx(y,{className:"w-5 h-5 sm:w-6 sm:h-6 text-blue-600"}),e.jsx("span",{className:"hidden xs:inline",children:"Manual do App RDO"}),e.jsx("span",{className:"xs:hidden",children:"Manual"})]}),e.jsx("p",{className:"text-xs sm:text-sm text-gray-600 dark:text-gray-300 hidden sm:block",children:"Guia completo para usar o aplicativo"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[e.jsxs(E,{to:"/",className:"flex items-center gap-1 sm:gap-2 px-2 sm:px-3 lg:px-4 py-2 bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl border border-gray-200/50 dark:border-gray-700/50 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors text-xs sm:text-sm font-medium text-gray-700 dark:text-gray-300",title:"Voltar ao Dashboard",children:[e.jsx(v,{className:"w-3 h-3 sm:w-4 sm:h-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Dashboard"})]}),e.jsx(M,{})]})]})}),e.jsxs("div",{className:"flex",children:[e.jsx(B,{children:(o||window.innerWidth>=1024)&&e.jsx(w.div,{initial:{x:-300,opacity:0},animate:{x:0,opacity:1},exit:{x:-300,opacity:0},transition:{type:"spring",damping:25,stiffness:200},className:"fixed lg:sticky top-[65px] sm:top-[73px] left-0 h-[calc(100vh-65px)] sm:h-[calc(100vh-73px)] w-full sm:w-80 lg:w-80 bg-white/80 dark:bg-gray-800/80 backdrop-blur-md border-r border-gray-200/50 dark:border-gray-700/50 z-30 lg:z-auto overflow-y-auto",children:e.jsxs("div",{className:"p-3 sm:p-4 space-y-3 sm:space-y-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(I,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-3 h-3 sm:w-4 sm:h-4 text-gray-400"}),e.jsx("input",{type:"text",placeholder:"Buscar no manual...",value:f,onChange:a=>T(a.target.value),className:"w-full pl-8 sm:pl-10 pr-3 sm:pr-4 py-2 bg-white/70 dark:bg-gray-700/70 backdrop-blur-md rounded-xl border border-gray-200/50 dark:border-gray-600/50 focus:outline-none focus:ring-2 focus:ring-blue-500/50 text-xs sm:text-sm"})]}),e.jsx("nav",{className:"space-y-1",children:F.map((a,n)=>e.jsxs("button",{onClick:()=>{m(a.id),g(!1)},className:`w-full flex items-center gap-2 sm:gap-3 px-2 sm:px-3 py-2 sm:py-3 rounded-xl text-left transition-all duration-200 ${t===a.id?"bg-blue-100 dark:bg-blue-900/30 text-blue-900 dark:text-blue-100 shadow-sm":"hover:bg-gray-100 dark:hover:bg-gray-700/50 text-gray-700 dark:text-gray-300"}`,children:[e.jsx("div",{className:`p-1.5 sm:p-2 rounded-lg ${t===a.id?"bg-blue-200 dark:bg-blue-800/50 text-blue-700 dark:text-blue-300":"bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400"}`,children:e.jsx("div",{className:"w-3 h-3 sm:w-4 sm:h-4",children:a.icone})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:`text-xs font-medium px-1.5 sm:px-2 py-0.5 sm:py-1 rounded-full ${t===a.id?"bg-blue-200 dark:bg-blue-800/50 text-blue-700 dark:text-blue-300":"bg-gray-200 dark:bg-gray-600 text-gray-600 dark:text-gray-400"}`,children:n+1})}),e.jsx("p",{className:"text-xs sm:text-sm font-medium truncate mt-1",children:a.titulo})]}),t===a.id&&e.jsx(O,{className:"w-3 h-3 sm:w-4 sm:h-4 text-blue-600 dark:text-blue-400"})]},a.id))})]})})}),o&&e.jsx("div",{className:"fixed inset-0 bg-black/20 backdrop-blur-sm z-20 lg:hidden",onClick:()=>g(!1)}),e.jsx("div",{className:"flex-1 lg:ml-0",children:e.jsx("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-4 sm:py-6 lg:py-8",children:e.jsxs(w.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"space-y-4 sm:space-y-6 lg:space-y-8",children:[e.jsxs("div",{className:"text-center space-y-3 sm:space-y-4",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 sm:gap-3 px-3 sm:px-4 py-2 bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl border border-gray-200/50 dark:border-gray-700/50",children:[e.jsx("div",{className:"p-1.5 sm:p-2 bg-blue-100 dark:bg-blue-900/30 rounded-xl text-blue-600 dark:text-blue-400",children:e.jsx("div",{className:"w-4 h-4 sm:w-5 sm:h-5",children:b.icone})}),e.jsxs("span",{className:"text-xs sm:text-sm font-medium text-gray-600 dark:text-gray-400",children:["Capítulo ",i+1," de ",r.length]})]}),e.jsx("h2",{className:"text-xl sm:text-2xl lg:text-3xl xl:text-4xl font-bold text-gray-900 dark:text-white px-4",children:b.titulo})]}),e.jsx("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-4 sm:p-6 lg:p-8 border border-gray-200/50 dark:border-gray-700/50 shadow-lg",children:b.conteudo}),e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-center gap-4 pt-4 sm:pt-6 lg:pt-8",children:[e.jsx("div",{className:"w-full sm:w-auto",children:u&&e.jsxs("button",{onClick:()=>m(u.id),className:"flex items-center gap-2 px-3 sm:px-4 py-2 sm:py-3 bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl border border-gray-200/50 dark:border-gray-700/50 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors text-xs sm:text-sm font-medium text-gray-700 dark:text-gray-300 w-full sm:w-auto",children:[e.jsx(v,{className:"w-3 h-3 sm:w-4 sm:h-4"}),e.jsxs("div",{className:"text-left",children:[e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Anterior"}),e.jsx("p",{className:"truncate max-w-24 sm:max-w-32",children:u.titulo})]})]})}),e.jsx("div",{className:"text-center order-first sm:order-none",children:e.jsx("div",{className:"flex gap-1",children:r.map((a,n)=>e.jsx("div",{className:`w-1.5 h-1.5 sm:w-2 sm:h-2 rounded-full transition-colors ${n===i?"bg-blue-500":"bg-gray-300 dark:bg-gray-600"}`},n))})}),e.jsx("div",{className:"w-full sm:w-auto",children:p&&e.jsxs("button",{onClick:()=>m(p.id),className:"flex items-center gap-2 px-3 sm:px-4 py-2 sm:py-3 bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-xl border border-gray-200/50 dark:border-gray-700/50 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors text-xs sm:text-sm font-medium text-gray-700 dark:text-gray-300 w-full sm:w-auto justify-end sm:justify-start",children:[e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Próximo"}),e.jsx("p",{className:"truncate max-w-24 sm:max-w-32",children:p.titulo})]}),e.jsx(O,{className:"w-3 h-3 sm:w-4 sm:h-4"})]})})]})]},t)})})]})]})}export{se as default}; diff --git a/dist/assets/js/NeuralNetworkBackground-CER-dIFD.js b/dist/assets/js/NeuralNetworkBackground-CER-dIFD.js deleted file mode 100644 index f40826b..0000000 --- a/dist/assets/js/NeuralNetworkBackground-CER-dIFD.js +++ /dev/null @@ -1 +0,0 @@ -import{j as M}from"./query-vendor-BLVqILA6.js";import{r as c}from"./router-vendor-D4by-_6Z.js";const E=()=>{const l=c.useRef(null),h=c.useRef(),n=c.useRef([]);return c.useEffect(()=>{const e=l.current;if(!e)return;const r=e.getContext("2d");if(!r)return;const f=()=>{e.width=window.innerWidth,e.height=window.innerHeight},u=()=>{const t=Math.floor(e.width*e.height/15e3);n.current=[];for(let a=0;a{r.beginPath(),r.arc(t.x,t.y,2,0,Math.PI*2),r.fillStyle="rgba(147, 197, 253, 0.8)",r.fill()},y=(t,a,i,o)=>{const s=1-i/o;r.beginPath(),r.moveTo(t.x,t.y),r.lineTo(a.x,a.y),r.strokeStyle=`rgba(147, 197, 253, ${s*.3})`,r.lineWidth=1,r.stroke()},v=()=>{n.current.forEach(t=>{t.x+=t.vx,t.y+=t.vy,(t.x<0||t.x>e.width)&&(t.vx*=-1),(t.y<0||t.y>e.height)&&(t.vy*=-1),t.x=Math.max(0,Math.min(e.width,t.x)),t.y=Math.max(0,Math.min(e.height,t.y))})},x=()=>{r.clearRect(0,0,e.width,e.height);const t=r.createLinearGradient(0,0,e.width,e.height);t.addColorStop(0,"#0f172a"),t.addColorStop(.5,"#1e1b4b"),t.addColorStop(1,"#581c87"),r.fillStyle=t,r.fillRect(0,0,e.width,e.height),v();const a=120;for(let i=0;i{f(),u()};return window.addEventListener("resize",m),()=>{window.removeEventListener("resize",m),h.current&&cancelAnimationFrame(h.current)}},[]),M.jsx("canvas",{ref:l,className:"fixed inset-0 w-full h-full -z-10",style:{background:"linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #581c87 100%)"}})};export{E as N}; diff --git a/dist/assets/js/ObraDetails-S1VcIvXW.js b/dist/assets/js/ObraDetails-S1VcIvXW.js deleted file mode 100644 index be88b3b..0000000 --- a/dist/assets/js/ObraDetails-S1VcIvXW.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./query-vendor-BLVqILA6.js";import{c as j,r as m,L as i}from"./router-vendor-D4by-_6Z.js";import{T as f}from"./ThemeToggle-Cryh6OOS.js";import{o as w,j as k,F as h,n as p,c as x,m as l,X as N,q as _,v as C,U as D,l as u,P as b,w as R,b as T}from"./ui-vendor-CyRvbSfR.js";import"./react-vendor-CqRd3GwO.js";const S=[{id:"1",data:"2024-01-15",status:"aprovado",responsavel:"João Silva",atividades:5,ocorrencias:0},{id:"2",data:"2024-01-14",status:"aprovado",responsavel:"Maria Santos",atividades:3,ocorrencias:1},{id:"3",data:"2024-01-13",status:"enviado",responsavel:"Pedro Costa",atividades:4,ocorrencias:0},{id:"4",data:"2024-01-12",status:"rascunho",responsavel:"Ana Costa",atividades:2,ocorrencias:0},{id:"5",data:"2024-01-11",status:"aprovado",responsavel:"Carlos Lima",atividades:6,ocorrencias:2}],F=[{id:"1",url:"https://trae-api-us.mchost.guru/api/ide/v1/text_to_image?prompt=construction%20site%20concrete%20foundation%20work%20modern%20building&image_size=landscape_4_3",data:"2024-01-15",descricao:"Fundação do edifício"},{id:"2",url:"https://trae-api-us.mchost.guru/api/ide/v1/text_to_image?prompt=construction%20workers%20steel%20structure%20building%20site&image_size=landscape_4_3",data:"2024-01-14",descricao:"Estrutura metálica"},{id:"3",url:"https://trae-api-us.mchost.guru/api/ide/v1/text_to_image?prompt=construction%20site%20concrete%20pouring%20workers%20safety%20equipment&image_size=landscape_4_3",data:"2024-01-13",descricao:"Concretagem da laje"},{id:"4",url:"https://trae-api-us.mchost.guru/api/ide/v1/text_to_image?prompt=construction%20site%20electrical%20installation%20modern%20building&image_size=landscape_4_3",data:"2024-01-12",descricao:"Instalações elétricas"},{id:"5",url:"https://trae-api-us.mchost.guru/api/ide/v1/text_to_image?prompt=construction%20site%20plumbing%20installation%20modern%20building&image_size=landscape_4_3",data:"2024-01-11",descricao:"Instalações hidráulicas"}],P=d=>{switch(d){case"aprovado":return e.jsx(x,{className:"w-4 h-4 text-green-500"});case"enviado":return e.jsx(T,{className:"w-4 h-4 text-yellow-500"});case"rascunho":return e.jsx(R,{className:"w-4 h-4 text-gray-500"});default:return null}},I=d=>{switch(d){case"aprovado":return"text-green-600 bg-green-100 dark:bg-green-900/30 dark:text-green-400";case"enviado":return"text-yellow-600 bg-yellow-100 dark:bg-yellow-900/30 dark:text-yellow-400";case"rascunho":return"text-gray-600 bg-gray-100 dark:bg-gray-700 dark:text-gray-400";default:return"text-gray-600 bg-gray-100"}};function z(){const{id:d}=j(),[o,y]=m.useState("info"),r={id:d||"1",nome:"Edifício Residencial Aurora",endereco:"Rua das Flores, 123 - Centro",descricao:"Edifício residencial de 15 andares com 120 apartamentos",dataInicio:"2023-06-01",dataPrevistaFim:"2024-12-31",progresso:75,status:"ativa",responsavel:"Eng. Carlos Mendes"},[c,g]=m.useState(!1),[t,n]=m.useState(r);return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900",children:[e.jsx("div",{className:"bg-white/80 dark:bg-gray-800/80 backdrop-blur-md border-b border-gray-200/50 dark:border-gray-700/50",children:e.jsxs("div",{className:"px-6 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(i,{to:"/",className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-xl transition-colors",children:e.jsx(w,{className:"w-5 h-5 text-gray-600 dark:text-gray-400"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:r.nome}),e.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-300 flex items-center gap-1",children:[e.jsx(k,{className:"w-4 h-4"}),r.endereco]})]})]}),e.jsx(f,{})]}),e.jsx("div",{className:"flex gap-1 bg-gray-100 dark:bg-gray-700 rounded-xl p-1 overflow-x-auto scrollbar-hide",children:[{key:"info",label:"Informações",icon:h},{key:"rdos",label:"RDOs",icon:h},{key:"fotos",label:"Fotos",icon:p},{key:"tarefas",label:"Tarefas",icon:x}].map(({key:a,label:s,icon:v})=>e.jsxs("button",{onClick:()=>y(a),className:`flex-1 min-w-fit flex items-center justify-center gap-2 py-2 px-4 rounded-lg text-sm font-medium transition-all whitespace-nowrap ${o===a?"bg-white dark:bg-gray-600 text-blue-600 dark:text-blue-400 shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200"}`,children:[e.jsx(v,{className:"w-4 h-4"}),s]},a))})]})}),e.jsxs("div",{className:"px-6 py-6",children:[o==="info"&&e.jsxs(l.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-6",children:[e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Detalhes da Obra"}),e.jsx("div",{className:"flex items-center gap-2",children:c?e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>{g(!1),n(r)},className:"flex items-center gap-2 px-3 py-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 transition-colors",children:[e.jsx(N,{className:"w-4 h-4"}),"Cancelar"]}),e.jsxs("button",{onClick:()=>{Object.assign(r,t),g(!1)},className:"flex items-center gap-2 px-3 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:[e.jsx(_,{className:"w-4 h-4"}),"Salvar"]})]}):e.jsxs("button",{onClick:()=>g(!0),className:"flex items-center gap-2 px-3 py-2 text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-colors",children:[e.jsx(C,{className:"w-4 h-4"}),"Editar"]})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Descrição"}),c?e.jsx("textarea",{value:t.descricao,onChange:a=>n({...t,descricao:a.target.value}),"aria-label":"Descrição da obra",className:"w-full mt-1 px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",rows:3}):e.jsx("p",{className:"text-gray-900 dark:text-white",children:r.descricao})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Responsável"}),c?e.jsx("input",{type:"text",value:t.responsavel,onChange:a=>n({...t,responsavel:a.target.value}),"aria-label":"Responsável pela obra",className:"w-full mt-1 px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-2 focus:ring-blue-500 focus:border-transparent"}):e.jsxs("p",{className:"text-gray-900 dark:text-white flex items-center gap-2",children:[e.jsx(D,{className:"w-4 h-4"}),r.responsavel]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Data de Início"}),c?e.jsx("input",{type:"text",value:t.dataInicio,onChange:a=>n({...t,dataInicio:a.target.value}),className:"w-full mt-1 px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"dd/mm/aa",maxLength:8,onInput:a=>{let s=a.currentTarget.value.replace(/\D/g,"");s.length>=2&&(s=s.slice(0,2)+"/"+s.slice(2)),s.length>=5&&(s=s.slice(0,5)+"/"+s.slice(5,7)),a.currentTarget.value=s}}):e.jsxs("p",{className:"text-gray-900 dark:text-white flex items-center gap-2",children:[e.jsx(u,{className:"w-4 h-4"}),new Date(r.dataInicio).toLocaleDateString("pt-BR")]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Previsão de Término"}),c?e.jsx("input",{type:"text",value:t.dataPrevistaFim,onChange:a=>n({...t,dataPrevistaFim:a.target.value}),className:"w-full mt-1 px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"dd/mm/aa",maxLength:8,onInput:a=>{let s=a.currentTarget.value.replace(/\D/g,"");s.length>=2&&(s=s.slice(0,2)+"/"+s.slice(2)),s.length>=5&&(s=s.slice(0,5)+"/"+s.slice(5,7)),a.currentTarget.value=s}}):e.jsxs("p",{className:"text-gray-900 dark:text-white flex items-center gap-2",children:[e.jsx(u,{className:"w-4 h-4"}),new Date(r.dataPrevistaFim).toLocaleDateString("pt-BR")]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Progresso"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex-1 h-3 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-blue-500 transition-all duration-500",style:{width:`${r.progresso}%`}})}),e.jsxs("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:[r.progresso,"%"]})]})]})]})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsxs(i,{to:`/obra/${r.id}/rdo/novo`,className:"flex-1 flex items-center justify-center gap-2 py-3 px-4 bg-blue-600 text-white rounded-xl hover:bg-blue-700 transition-colors",children:[e.jsx(b,{className:"w-5 h-5"}),"Criar RDO"]}),e.jsxs(i,{to:`/obra/${r.id}/tarefas`,className:"flex-1 flex items-center justify-center gap-2 py-3 px-4 bg-gray-600 text-white rounded-xl hover:bg-gray-700 transition-colors",children:[e.jsx(x,{className:"w-5 h-5"}),"Ver Tarefas"]})]})]}),o==="rdos"&&e.jsxs(l.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Histórico de RDOs"}),e.jsxs(i,{to:`/obra/${r.id}/rdo/novo`,className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-xl hover:bg-blue-700 transition-colors",children:[e.jsx(b,{className:"w-4 h-4"}),"Novo RDO"]})]}),S.map((a,s)=>e.jsx(l.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:s*.1},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-4 border border-gray-200/50 dark:border-gray-700/50 shadow-lg",children:e.jsxs(i,{to:`/obra/${r.id}/rdo/${a.id}`,className:"block",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-blue-100 dark:bg-blue-900/30 rounded-lg",children:e.jsx(h,{className:"w-5 h-5 text-blue-600 dark:text-blue-400"})}),e.jsxs("div",{children:[e.jsxs("h4",{className:"font-medium text-gray-900 dark:text-white",children:["RDO - ",new Date(a.data).toLocaleDateString("pt-BR")]}),e.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Por ",a.responsavel]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[P(a.status),e.jsx("span",{className:`px-2 py-1 rounded-lg text-xs font-medium ${I(a.status)}`,children:a.status.charAt(0).toUpperCase()+a.status.slice(1)})]})]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-gray-600 dark:text-gray-400",children:[e.jsxs("span",{children:[a.atividades," atividades"]}),e.jsxs("span",{children:[a.ocorrencias," ocorrências"]})]})]})},a.id))]}),o==="fotos"&&e.jsxs(l.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Galeria de Fotos"}),e.jsxs("button",{className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-xl hover:bg-blue-700 transition-colors",children:[e.jsx(p,{className:"w-4 h-4"}),"Adicionar Foto"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:F.map((a,s)=>e.jsxs(l.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:s*.1},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl overflow-hidden border border-gray-200/50 dark:border-gray-700/50 shadow-lg hover:shadow-xl transition-all duration-300",children:[e.jsx("div",{className:"aspect-square overflow-hidden",children:e.jsx("img",{src:a.url,alt:a.descricao,className:"w-full h-full object-cover hover:scale-110 transition-transform duration-300"})}),e.jsxs("div",{className:"p-3",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white mb-1",children:a.descricao}),e.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:new Date(a.data).toLocaleDateString("pt-BR")})]})]},a.id))})]}),o==="tarefas"&&e.jsxs(l.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Tarefas da Obra"}),e.jsx(i,{to:`/obra/${r.id}/tarefas`,className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-xl hover:bg-blue-700 transition-colors",children:"Ver Todas"})]}),e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg text-center",children:[e.jsx(x,{className:"w-12 h-12 text-gray-400 dark:text-gray-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Acesse a página de tarefas para ver o controle completo"})]})]})]})]})}export{z as default}; diff --git a/dist/assets/js/ObraTasks-Cy-rxhIo.js b/dist/assets/js/ObraTasks-Cy-rxhIo.js deleted file mode 100644 index 19c0d56..0000000 --- a/dist/assets/js/ObraTasks-Cy-rxhIo.js +++ /dev/null @@ -1 +0,0 @@ -var xe=Object.defineProperty;var ge=(n,t,s)=>t in n?xe(n,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[t]=s;var z=(n,t,s)=>ge(n,typeof t!="symbol"?t+"":t,s);import{j as e}from"./query-vendor-BLVqILA6.js";import{r as d,c as me,L as H}from"./router-vendor-D4by-_6Z.js";import{T as ue}from"./ThemeToggle-Cryh6OOS.js";import{A as w,m as h,X as he,b as Q,k as Z,l as ee,w as ae,a5 as be,g as R,a6 as P,a7 as V,a8 as L,o as pe,P as ye,S as G,d as fe,h as K,a9 as je,aa as ke,E as ve,F as Ne,j as we}from"./ui-vendor-CyRvbSfR.js";import"./react-vendor-CqRd3GwO.js";const Te={inicio:"Tarefa Iniciada",pausa:"Tarefa Pausada",retomada:"Tarefa Retomada",conclusao:"Tarefa Concluída",revisao:"Tarefa Revisada",edicao:"Tarefa Editada",cancelamento:"Tarefa Cancelada"},Ce={inicio:"text-blue-600 bg-blue-100 dark:bg-blue-900/30",pausa:"text-yellow-600 bg-yellow-100 dark:bg-yellow-900/30",retomada:"text-blue-600 bg-blue-100 dark:bg-blue-900/30",conclusao:"text-green-600 bg-green-100 dark:bg-green-900/30",revisao:"text-purple-600 bg-purple-100 dark:bg-purple-900/30",edicao:"text-orange-600 bg-orange-100 dark:bg-orange-900/30",cancelamento:"text-red-600 bg-red-100 dark:bg-red-900/30"},W="task_logs",k=class k{constructor(){z(this,"logs",{});this.loadFromStorage()}static getInstance(){return k.instance||(k.instance=new k),k.instance}loadFromStorage(){try{const t=localStorage.getItem(W);t&&(this.logs=JSON.parse(t))}catch{this.logs={}}}saveToStorage(){try{localStorage.setItem(W,JSON.stringify(this.logs))}catch{}}addEvent(t,s,o="Usuário Atual",l,i){const x=new Date().toISOString();this.logs[t]||(this.logs[t]={taskId:t,eventos:[],criadoEm:x,atualizadoEm:x});const p={id:`${t}_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,taskId:t,type:s,timestamp:x,usuario:o,...l!==void 0&&{descricao:l},...i!==void 0&&{detalhes:i}};this.logs[t].eventos.push(p),this.logs[t].atualizadoEm=x,this.saveToStorage()}getTaskLog(t){return this.logs[t]||null}getTaskEvents(t){const s=this.getTaskLog(t);return s?s.eventos.sort((o,l)=>new Date(l.timestamp).getTime()-new Date(o.timestamp).getTime()):[]}getAllLogs(){return{...this.logs}}clearTaskLog(t){delete this.logs[t],this.saveToStorage()}clearAllLogs(){this.logs={},this.saveToStorage()}logTaskStart(t,s){this.addEvent(t,"inicio",s,"Tarefa iniciada")}logTaskPause(t,s){this.addEvent(t,"pausa",s,"Tarefa pausada")}logTaskResume(t,s){this.addEvent(t,"retomada",s,"Tarefa retomada")}logTaskComplete(t,s){this.addEvent(t,"conclusao",s,"Tarefa concluída")}logTaskEdit(t,s,o,l){const i={camposAlterados:s,...l!==void 0&&{observacoes:l}};this.addEvent(t,"edicao",o,`Tarefa editada: ${s.join(", ")}`,i)}logTaskCancel(t,s,o){const l=o!==void 0?{observacoes:o}:void 0;this.addEvent(t,"cancelamento",s,"Tarefa cancelada",l)}logStatusChange(t,s,o,l){let i,x;switch(o){case"em_andamento":i=s==="pausada"?"retomada":"inicio",x=s==="pausada"?"Tarefa retomada":"Tarefa iniciada";break;case"pausada":i="pausa",x="Tarefa pausada";break;case"concluida":i="conclusao",x="Tarefa concluída";break;case"cancelada":i="cancelamento",x="Tarefa cancelada";break;default:i="edicao",x=`Status alterado de ${s} para ${o}`}this.addEvent(t,i,l,x,{statusAnterior:s,statusNovo:o})}};z(k,"instance");let I=k;const te=I.getInstance(),E=(n,t,s,o)=>{let l;switch(t){case"start":l="inicio";break;case"resume":l="retomada";break;case"pause":l="pausa";break;case"complete":l="conclusao";break;case"edit":l="edicao";break;case"cancel":l="cancelamento";break;default:l="edicao"}te.addEvent(n,l,o,s)},Ee={Play:L,Pause:V,CheckCircle2:P,Edit3:R,RotateCcw:be,X:ae},Se=({isOpen:n,onClose:t,taskId:s,taskTitle:o})=>{const[l,i]=d.useState([]),[x,p]=d.useState(!0);d.useEffect(()=>{n&&s&&D()},[n,s]);const D=()=>{p(!0);try{const r=te.getTaskEvents(s);i(r)}catch{i([])}finally{p(!1)}},v=r=>{const u=new Date(r);return{date:u.toLocaleDateString("pt-BR"),time:u.toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"})}},A=r=>Ee[r==="inicio"||r==="retomada"?"Play":r==="pausa"?"Pause":r==="conclusao"?"CheckCircle2":r==="edicao"?"Edit3":r==="revisao"?"RotateCcw":"X"],S=r=>{const u=new Date,N=new Date(r),y=Math.floor((u.getTime()-N.getTime())/(1e3*60));if(y<1)return"Agora mesmo";if(y<60)return`${y} min atrás`;const b=Math.floor(y/60);if(b<24)return`${b}h atrás`;const f=Math.floor(b/24);return f<7?`${f} dia${f>1?"s":""} atrás`:v(r).date};return n?e.jsx(w,{children:e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:e.jsxs(h.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white dark:bg-gray-800 rounded-2xl shadow-2xl w-full max-w-2xl max-h-[80vh] overflow-hidden",children:[e.jsx("div",{className:"bg-gradient-to-r from-blue-600 to-purple-600 px-6 py-4 text-white",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-bold mb-1",children:"Histórico da Tarefa"}),e.jsx("p",{className:"text-blue-100 text-sm truncate",children:o})]}),e.jsx("button",{onClick:t,className:"p-2 hover:bg-white/20 rounded-lg transition-colors",children:e.jsx(he,{className:"w-5 h-5"})})]})}),e.jsx("div",{className:"p-6 overflow-y-auto max-h-[calc(80vh-120px)]",children:x?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"}),e.jsx("span",{className:"ml-3 text-gray-600 dark:text-gray-300",children:"Carregando histórico..."})]}):l.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx("div",{className:"w-16 h-16 bg-gray-100 dark:bg-gray-700 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(Q,{className:"w-8 h-8 text-gray-400 dark:text-gray-500"})}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-2",children:"Nenhum evento registrado"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:"Esta tarefa ainda não possui histórico de atividades."})]}):e.jsx("div",{className:"space-y-4",children:l.map((r,u)=>{const N=A(r.type),{date:y,time:b}=v(r.timestamp),f=u===0,T=u===l.length-1;return e.jsxs(h.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:u*.05},className:"relative",children:[!T&&e.jsx("div",{className:"absolute left-6 top-12 w-0.5 h-full bg-gray-200 dark:bg-gray-700 -z-10"}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:`flex-shrink-0 w-12 h-12 rounded-full flex items-center justify-center ${Ce[r.type]} ${f?"ring-2 ring-blue-500 ring-offset-2 dark:ring-offset-gray-800":""}`,children:e.jsx(N,{className:"w-5 h-5"})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700/50 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsx("h4",{className:"font-semibold text-gray-900 dark:text-white",children:Te[r.type]}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 ml-2",children:S(r.timestamp)})]}),r.descricao&&e.jsx("p",{className:"text-gray-700 dark:text-gray-300 text-sm mb-3",children:r.descricao}),r.detalhes&&e.jsxs("div",{className:"space-y-2 text-sm",children:[r.detalhes.statusAnterior&&r.detalhes.statusNovo&&e.jsxs("div",{className:"flex items-center gap-2 text-gray-600 dark:text-gray-400",children:[e.jsx("span",{children:"Status:"}),e.jsx("span",{className:"font-medium",children:r.detalhes.statusAnterior}),e.jsx("span",{children:"→"}),e.jsx("span",{className:"font-medium",children:r.detalhes.statusNovo})]}),r.detalhes.camposAlterados&&r.detalhes.camposAlterados.length>0&&e.jsxs("div",{className:"text-gray-600 dark:text-gray-400",children:[e.jsx("span",{children:"Campos alterados: "}),e.jsx("span",{className:"font-medium",children:r.detalhes.camposAlterados.join(", ")})]}),r.detalhes.observacoes&&e.jsxs("div",{className:"text-gray-600 dark:text-gray-400",children:[e.jsx("span",{children:"Observações: "}),e.jsx("span",{className:"font-medium",children:r.detalhes.observacoes})]})]}),e.jsxs("div",{className:"flex items-center justify-between mt-3 pt-3 border-t border-gray-200 dark:border-gray-600",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400",children:[e.jsx(Z,{className:"w-3 h-3"}),e.jsx("span",{children:r.usuario})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400",children:[e.jsx(ee,{className:"w-3 h-3"}),e.jsxs("span",{children:[y," às ",b]})]})]})]})})]})]},r.id)})})})]})})}):null},_e=[{id:"1",titulo:"Concretagem da Laje do 2º Pavimento",descricao:"Executar a concretagem da laje do segundo pavimento conforme projeto estrutural",obra_id:"1",obra_nome:"Edifício Residencial Aurora",responsavel:"João Silva",prioridade:"alta",status:"em_andamento",data_inicio:"2024-01-15",data_prazo:"2024-01-18",progresso:65,tempo_estimado:16,tempo_trabalhado:10.5,categoria:"Estrutura",localizacao:"2º Pavimento",anexos:3,comentarios:2},{id:"2",titulo:"Instalação Elétrica - Sala 201",descricao:"Instalação completa do sistema elétrico da sala 201",obra_id:"1",obra_nome:"Edifício Residencial Aurora",responsavel:"Carlos Santos",prioridade:"media",status:"pendente",data_inicio:"2024-01-20",data_prazo:"2024-01-25",progresso:0,tempo_estimado:12,tempo_trabalhado:0,categoria:"Elétrica",localizacao:"2º Pavimento - Sala 201",anexos:1,comentarios:0},{id:"3",titulo:"Impermeabilização da Cobertura",descricao:"Aplicação de manta asfáltica na cobertura do edifício",obra_id:"1",obra_nome:"Edifício Residencial Aurora",responsavel:"Pedro Costa",prioridade:"critica",status:"pausada",data_inicio:"2024-01-12",data_prazo:"2024-01-16",progresso:30,tempo_estimado:24,tempo_trabalhado:7,categoria:"Impermeabilização",localizacao:"Cobertura",anexos:2,comentarios:4},{id:"4",titulo:"Pintura Externa - Fachada Norte",descricao:"Aplicação de tinta acrílica na fachada norte do edifício",obra_id:"1",obra_nome:"Edifício Residencial Aurora",responsavel:"Ana Costa",prioridade:"baixa",status:"pendente",data_inicio:"2024-01-25",data_prazo:"2024-02-05",progresso:0,tempo_estimado:32,tempo_trabalhado:0,categoria:"Acabamento",localizacao:"Fachada Norte",anexos:0,comentarios:1}],F={pendente:{label:"Pendente",color:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",icon:ke},em_andamento:{label:"Em Andamento",color:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300",icon:L},pausada:{label:"Pausada",color:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-300",icon:V},concluida:{label:"Concluída",color:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300",icon:P},cancelada:{label:"Cancelada",color:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-300",icon:je}},Y={baixa:{label:"Baixa",color:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300"},media:{label:"Média",color:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-300"},alta:{label:"Alta",color:"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-300"},critica:{label:"Crítica",color:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-300"}};function ze(){const{id:n}=me(),[t,s]=d.useState([]),[o,l]=d.useState(""),[i,x]=d.useState("todos"),[p,D]=d.useState("todas"),[v,A]=d.useState(!1),[S,r]=d.useState(null),[u,N]=d.useState(null),[y,b]=d.useState(!1),[f,T]=d.useState(null),[re,C]=d.useState(!1),[j,O]=d.useState(null),[B,U]=d.useState(!1),[$,q]=d.useState(null);d.useEffect(()=>{const a=_e.filter(c=>c.obra_id===n);s(a),a.length>0&&N({nome:a[0].obra_nome})},[n]);const J=t.filter(a=>{const c=a.titulo.toLowerCase().includes(o.toLowerCase())||a.descricao.toLowerCase().includes(o.toLowerCase())||a.responsavel.toLowerCase().includes(o.toLowerCase()),m=i==="todos"||a.status===i,g=p==="todas"||a.prioridade===p;return c&&m&&g}),_=(a,c)=>{const m=t.find(g=>g.id===a);m&&(c==="em_andamento"&&m.status==="pendente"?E(a,"start","Tarefa iniciada"):c==="em_andamento"&&m.status==="pausada"?E(a,"resume","Tarefa retomada"):c==="pausada"?E(a,"pause","Tarefa pausada"):c==="concluida"&&E(a,"complete","Tarefa concluída")),s(t.map(g=>g.id===a?{...g,status:c}:g))},se=a=>{q(a),U(!0),r(null)},le=a=>{E(a.id,"edit","Tarefa editada"),O(a),C(!0),r(null)},oe=a=>{T(a),b(!0),r(null)},ie=()=>{f&&(s(t.filter(a=>a.id!==f)),T(null),b(!1))},X=()=>{T(null),b(!1)},de=a=>{const c=new Date,g=new Date(a).getTime()-c.getTime();return Math.ceil(g/(1e3*60*60*24))},ne=(a,c)=>c==="concluida"?"bg-green-500":c==="cancelada"?"bg-red-500":a>=80?"bg-green-500":a>=50?"bg-yellow-500":"bg-blue-500",ce=({task:a})=>{const c=F[a.status].icon,m=de(a.data_prazo),g=m<0,M=m<=2&&m>=0;return e.jsxs(h.div,{layout:!0,initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg hover:shadow-xl transition-all duration-300",children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white text-lg",children:a.titulo}),(g||M)&&e.jsx(ae,{className:`w-5 h-5 ${g?"text-red-500":"text-yellow-500"}`})]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300 text-sm mb-3",children:a.descricao})]}),e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:()=>r(S===a.id?null:a.id),className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:e.jsx(ve,{className:"w-5 h-5 text-gray-400 dark:text-gray-500"})}),e.jsx(w,{children:S===a.id&&e.jsx(h.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"absolute right-0 top-full mt-2 w-48 bg-white dark:bg-gray-800 rounded-xl shadow-lg border border-gray-200 dark:border-gray-700 z-10",children:e.jsxs("div",{className:"p-2",children:[e.jsxs("button",{onClick:()=>se(a.id),className:"w-full flex items-center gap-2 px-3 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:[e.jsx(Ne,{className:"w-4 h-4"}),"Ver Log"]}),e.jsxs("button",{onClick:()=>le(a),className:"w-full flex items-center gap-2 px-3 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:[e.jsx(R,{className:"w-4 h-4"}),"Editar"]}),e.jsxs("button",{onClick:()=>oe(a.id),className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors",children:[e.jsx(K,{className:"w-4 h-4"}),"Excluir"]})]})})})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.jsxs("span",{className:`px-3 py-1 rounded-full text-xs font-medium ${F[a.status].color}`,children:[e.jsx(c,{className:"w-3 h-3 inline mr-1"}),F[a.status].label]}),e.jsx("span",{className:`px-3 py-1 rounded-full text-xs font-medium ${Y[a.prioridade].color}`,children:Y[a.prioridade].label}),e.jsx("span",{className:"px-3 py-1 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-full text-xs font-medium",children:a.categoria})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Progresso"}),e.jsxs("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:[a.progresso,"%"]})]}),e.jsx("div",{className:"w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2",children:e.jsx(h.div,{initial:{width:0},animate:{width:`${a.progresso}%`},transition:{duration:.5,ease:"easeOut"},className:`h-2 rounded-full ${ne(a.progresso,a.status)}`})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Z,{className:"w-4 h-4 text-gray-400 dark:text-gray-500"}),e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-300",children:a.responsavel})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(we,{className:"w-4 h-4 text-gray-400 dark:text-gray-500"}),e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-300",children:a.localizacao||"Não especificado"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ee,{className:"w-4 h-4 text-gray-400 dark:text-gray-500"}),e.jsx("span",{className:`text-sm ${g?"text-red-600 dark:text-red-400 font-medium":M?"text-yellow-600 dark:text-yellow-400 font-medium":"text-gray-600 dark:text-gray-300"}`,children:g?`${Math.abs(m)} dias atrasado`:m===0?"Vence hoje":`${m} dias restantes`})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Q,{className:"w-4 h-4 text-gray-400 dark:text-gray-500"}),e.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-300",children:[a.tempo_trabalhado,"h / ",a.tempo_estimado,"h"]})]})]}),e.jsxs("div",{className:"flex gap-2",children:[a.status==="pendente"&&e.jsxs("button",{onClick:()=>_(a.id,"em_andamento"),className:"flex-1 flex items-center justify-center gap-2 py-2 px-4 bg-blue-600 text-white rounded-xl hover:bg-blue-700 transition-colors",children:[e.jsx(L,{className:"w-4 h-4"}),"Iniciar"]}),a.status==="em_andamento"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>_(a.id,"pausada"),className:"flex-1 flex items-center justify-center gap-2 py-2 px-4 bg-yellow-600 text-white rounded-xl hover:bg-yellow-700 transition-colors",children:[e.jsx(V,{className:"w-4 h-4"}),"Pausar"]}),e.jsxs("button",{onClick:()=>_(a.id,"concluida"),className:"flex-1 flex items-center justify-center gap-2 py-2 px-4 bg-green-600 text-white rounded-xl hover:bg-green-700 transition-colors",children:[e.jsx(P,{className:"w-4 h-4"}),"Concluir"]})]}),a.status==="pausada"&&e.jsxs("button",{onClick:()=>_(a.id,"em_andamento"),className:"flex-1 flex items-center justify-center gap-2 py-2 px-4 bg-blue-600 text-white rounded-xl hover:bg-blue-700 transition-colors",children:[e.jsx(L,{className:"w-4 h-4"}),"Retomar"]}),a.status==="concluida"&&e.jsxs("div",{className:"flex-1 flex items-center justify-center gap-2 py-2 px-4 bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300 rounded-xl",children:[e.jsx(P,{className:"w-4 h-4"}),"Concluída"]})]})]})};return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900",children:[e.jsx("div",{className:"bg-white/80 dark:bg-gray-800/80 backdrop-blur-md border-b border-gray-200/50 dark:border-gray-700/50",children:e.jsxs("div",{className:"px-6 py-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(H,{to:`/obra/${n}`,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:e.jsx(pe,{className:"w-5 h-5 text-gray-600 dark:text-gray-300"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-2",children:"Tarefas da Obra"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:u?.nome||"Carregando..."})]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(ue,{}),e.jsxs(H,{to:`/obra/${n}/tarefa/nova`,className:"flex items-center gap-2 px-6 py-3 bg-blue-600 text-white rounded-xl hover:bg-blue-700 transition-colors shadow-lg",children:[e.jsx(ye,{className:"w-5 h-5"}),"Nova Tarefa"]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(G,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400 dark:text-gray-500"}),e.jsx("input",{type:"text",placeholder:"Buscar tarefas...",value:o,onChange:a=>l(a.target.value),className:"w-full pl-10 pr-4 py-3 bg-white/50 dark:bg-gray-700/50 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400"})]}),e.jsxs("button",{onClick:()=>A(!v),className:`flex items-center gap-2 px-4 py-3 rounded-xl border transition-colors ${v?"bg-blue-100 dark:bg-blue-900/30 border-blue-300 dark:border-blue-600 text-blue-700 dark:text-blue-300":"bg-white/50 dark:bg-gray-700/50 border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-600"}`,children:[e.jsx(fe,{className:"w-5 h-5"}),"Filtros"]})]}),e.jsx(w,{children:v&&e.jsxs(h.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"grid grid-cols-1 md:grid-cols-2 gap-4 p-4 bg-white/50 dark:bg-gray-700/50 rounded-xl border border-gray-200 dark:border-gray-600",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Status"}),e.jsxs("select",{value:i,onChange:a=>x(a.target.value),className:"w-full px-3 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-gray-900 dark:text-white",children:[e.jsx("option",{value:"todos",children:"Todos os Status"}),e.jsx("option",{value:"pendente",children:"Pendente"}),e.jsx("option",{value:"em_andamento",children:"Em Andamento"}),e.jsx("option",{value:"pausada",children:"Pausada"}),e.jsx("option",{value:"concluida",children:"Concluída"}),e.jsx("option",{value:"cancelada",children:"Cancelada"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Prioridade"}),e.jsxs("select",{value:p,onChange:a=>D(a.target.value),className:"w-full px-3 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-gray-900 dark:text-white",children:[e.jsx("option",{value:"todas",children:"Todas as Prioridades"}),e.jsx("option",{value:"baixa",children:"Baixa"}),e.jsx("option",{value:"media",children:"Média"}),e.jsx("option",{value:"alta",children:"Alta"}),e.jsx("option",{value:"critica",children:"Crítica"})]})]})]})})]})]})}),e.jsx("div",{className:"px-6 py-6",children:J.length===0?e.jsx(h.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center py-12",children:e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-8 border border-gray-200/50 dark:border-gray-700/50 shadow-lg max-w-md mx-auto",children:[e.jsx("div",{className:"w-16 h-16 bg-gray-100 dark:bg-gray-700 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(G,{className:"w-8 h-8 text-gray-400 dark:text-gray-500"})}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-2",children:"Nenhuma tarefa encontrada"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:t.length===0?"Esta obra ainda não possui tarefas cadastradas":"Tente ajustar os filtros ou criar uma nova tarefa"})]})}):e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6",children:e.jsx(w,{children:J.map(a=>e.jsx(ce,{task:a},a.id))})})}),e.jsx(w,{children:y&&e.jsx(h.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",onClick:X,children:e.jsxs(h.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white dark:bg-gray-800 rounded-2xl p-6 max-w-md w-full shadow-xl",onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-12 h-12 bg-red-100 dark:bg-red-900/30 rounded-full flex items-center justify-center",children:e.jsx(K,{className:"w-6 h-6 text-red-600 dark:text-red-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Excluir Tarefa"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:"Esta ação não pode ser desfeita"})]})]}),e.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-6",children:"Tem certeza que deseja excluir esta tarefa? Todos os dados relacionados serão perdidos permanentemente."}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:X,className:"flex-1 px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-xl hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"Cancelar"}),e.jsx("button",{onClick:ie,className:"flex-1 px-4 py-2 bg-red-600 text-white rounded-xl hover:bg-red-700 transition-colors",children:"Excluir"})]})]})})}),e.jsxs(w,{children:[re&&j&&e.jsx(h.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",onClick:()=>C(!1),children:e.jsxs(h.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white dark:bg-gray-800 rounded-2xl p-6 max-w-2xl w-full shadow-xl max-h-[90vh] overflow-y-auto",onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 bg-blue-100 dark:bg-blue-900/30 rounded-full flex items-center justify-center",children:e.jsx(R,{className:"w-6 h-6 text-blue-600 dark:text-blue-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Editar Tarefa"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:"Modifique os dados da tarefa"})]})]}),e.jsx("button",{onClick:()=>C(!1),className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Título"}),e.jsx("input",{type:"text",defaultValue:j.titulo,className:"w-full px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Descrição"}),e.jsx("textarea",{rows:3,defaultValue:j.descricao,className:"w-full px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Status"}),e.jsxs("select",{defaultValue:j.status,className:"w-full px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-gray-900 dark:text-white",children:[e.jsx("option",{value:"pendente",children:"Pendente"}),e.jsx("option",{value:"em_andamento",children:"Em Andamento"}),e.jsx("option",{value:"pausada",children:"Pausada"}),e.jsx("option",{value:"concluida",children:"Concluída"}),e.jsx("option",{value:"cancelada",children:"Cancelada"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Prioridade"}),e.jsxs("select",{defaultValue:j.prioridade,className:"w-full px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-gray-900 dark:text-white",children:[e.jsx("option",{value:"baixa",children:"Baixa"}),e.jsx("option",{value:"media",children:"Média"}),e.jsx("option",{value:"alta",children:"Alta"}),e.jsx("option",{value:"critica",children:"Crítica"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Responsável"}),e.jsx("input",{type:"text",defaultValue:j.responsavel,className:"w-full px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Progresso (%)"}),e.jsx("input",{type:"number",min:"0",max:"100",defaultValue:j.progresso,className:"w-full px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400"})]})]})]}),e.jsxs("div",{className:"flex gap-3 mt-6",children:[e.jsx("button",{onClick:()=>C(!1),className:"flex-1 px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-xl hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"Cancelar"}),e.jsx("button",{onClick:()=>{C(!1),O(null)},className:"flex-1 px-4 py-2 bg-blue-600 text-white rounded-xl hover:bg-blue-700 transition-colors",children:"Salvar Alterações"})]})]})})," "]}),B&&$&&e.jsx(Se,{taskId:$,taskTitle:t.find(a=>a.id===$)?.titulo||"Tarefa",isOpen:B,onClose:()=>{U(!1),q(null)}})]})}export{ze as default}; diff --git a/dist/assets/js/RDODetails-tkR9ftO-.js b/dist/assets/js/RDODetails-tkR9ftO-.js deleted file mode 100644 index a65cfae..0000000 --- a/dist/assets/js/RDODetails-tkR9ftO-.js +++ /dev/null @@ -1,5 +0,0 @@ -import{j as e}from"./query-vendor-BLVqILA6.js";import{r as n,c as R,d as O}from"./router-vendor-D4by-_6Z.js";import{T}from"./ThemeToggle-Cryh6OOS.js";import{s as l}from"./index-doec96Hx.js";import{T as y,R as S,o as E,F as k,W as p,U as j,n as u,m as i,l as L,k as $,j as A,x as P,c as v,b as U,v as z}from"./ui-vendor-CyRvbSfR.js";import"./react-vendor-CqRd3GwO.js";import"./supabase-vendor-CnnNSQLo.js";import"./state-vendor-DHadhBU5.js";const B=s=>{const[b,x]=n.useState(null),[d,g]=n.useState(!0),[r,m]=n.useState(null),o=n.useCallback(async()=>{if(s)try{g(!0),m(null);const{data:c,error:h}=await l.from("rdos").select(` - *, - obra:obras(*), - criador:usuarios!rdos_criado_por_fkey(*) - `).eq("id",s).single();if(h)throw h;if(!c)throw new Error("RDO não encontrado");const[{data:a},{data:t},{data:w},{data:f},{data:_},{data:C},{data:q}]=await Promise.all([l.from("rdo_atividades").select("*").eq("rdo_id",s).order("ordem"),l.from("rdo_mao_obra").select("*").eq("rdo_id",s),l.from("rdo_equipamentos").select("*").eq("rdo_id",s),l.from("rdo_ocorrencias").select("*").eq("rdo_id",s),l.from("rdo_anexos").select("*").eq("rdo_id",s),l.from("rdo_inspecoes_solda").select("*").eq("rdo_id",s),l.from("rdo_verificacoes_torque").select("*").eq("rdo_id",s)]),D={...c,atividades:a||[],mao_obra:t||[],equipamentos:w||[],ocorrencias:f||[],anexos:_||[],inspecoes_solda:C||[],verificacoes_torque:q||[]};x(D)}catch(c){m(c.message||"Erro ao carregar RDO")}finally{g(!1)}},[s]);return n.useEffect(()=>{o()},[o]),{rdo:b,loading:d,error:r,refetch:o}},F=s=>{switch(s){case"rascunho":return"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300";case"enviado":return"bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-300";case"aprovado":return"bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300";case"rejeitado":return"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300";default:return"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}},G=s=>{switch(s){case"rascunho":return e.jsx(z,{className:"w-4 h-4"});case"enviado":return e.jsx(U,{className:"w-4 h-4"});case"aprovado":return e.jsx(v,{className:"w-4 h-4"});default:return e.jsx(k,{className:"w-4 h-4"})}},N=s=>s.toLowerCase().includes("crítica")||s.toLowerCase().includes("grave")?"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300":s.toLowerCase().includes("atenção")||s.toLowerCase().includes("alerta")?"bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-300":"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300";function Y(){const{obraId:s,rdoId:b}=R(),x=O(),[d,g]=n.useState("geral"),{rdo:r,loading:m,error:o,refetch:c}=B(b),h=[{id:"geral",label:"Geral",icon:k},{id:"atividades",label:"Atividades",icon:p},{id:"recursos",label:"Recursos",icon:j},{id:"ocorrencias",label:"Ocorrências",icon:y},{id:"fotos",label:"Fotos",icon:u}];return m?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900",children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Carregando detalhes do RDO..."})]})}):o||!r?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 p-8 rounded-2xl shadow-lg border border-red-200 dark:border-red-900/30 max-w-md w-full text-center",children:[e.jsx(y,{className:"w-12 h-12 text-red-500 mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-2",children:"Erro ao carregar RDO"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:o||"RDO não encontrado."}),e.jsxs("div",{className:"flex gap-3 justify-center",children:[e.jsx("button",{onClick:()=>x(-1),className:"px-4 py-2 bg-gray-200 dark:bg-gray-700 rounded-lg text-gray-800 dark:text-white hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors",children:"Voltar"}),e.jsxs("button",{onClick:c,className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors flex items-center gap-2",children:[e.jsx(S,{className:"w-4 h-4"})," Tentar Novamente"]})]})]})}):e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900",children:[e.jsx("div",{className:"bg-white/80 dark:bg-gray-800/80 backdrop-blur-md border-b border-gray-200/50 dark:border-gray-700/50 sticky top-0 z-10 transition-all",children:e.jsx("div",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("button",{onClick:()=>x(`/obra/${s}`),className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-xl transition-colors",title:"Voltar para a obra",children:e.jsx(E,{className:"w-5 h-5 text-gray-600 dark:text-gray-400"})}),e.jsxs("div",{children:[e.jsxs("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:["RDO - ",new Date(r.data_relatorio).toLocaleDateString("pt-BR")]}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:r.obra?.nome||"Obra não identificada"})]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:`flex items-center gap-2 px-3 py-1 rounded-lg text-sm font-medium ${F(r.status)}`,children:[G(r.status),r.status.charAt(0).toUpperCase()+r.status.slice(1)]}),e.jsx(T,{})]})]})})}),e.jsx("div",{className:"px-6 py-4 overflow-x-auto",children:e.jsx("div",{className:"flex gap-2 min-w-max",children:h.map(a=>{const t=a.icon;return e.jsxs("button",{onClick:()=>g(a.id),className:`flex items-center gap-2 px-4 py-2 rounded-xl text-sm font-medium transition-colors whitespace-nowrap ${d===a.id?"bg-blue-600 text-white shadow-md":"bg-white/70 dark:bg-gray-800/70 text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:[e.jsx(t,{className:"w-4 h-4"}),a.label]},a.id)})})}),e.jsxs("div",{className:"px-6 pb-8 max-w-7xl mx-auto",children:[d==="geral"&&e.jsxs(i.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-6",children:[e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Informações Básicas"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Data"}),e.jsxs("p",{className:"text-gray-900 dark:text-white flex items-center gap-2",children:[e.jsx(L,{className:"w-4 h-4"}),new Date(r.data_relatorio).toLocaleDateString("pt-BR")]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Responsável"}),e.jsxs("p",{className:"text-gray-900 dark:text-white flex items-center gap-2",children:[e.jsx($,{className:"w-4 h-4"}),r.criador?.nome||"Carregando..."]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Clima"}),e.jsx("p",{className:"text-gray-900 dark:text-white",children:r.condicoes_climaticas})]})]})]}),r.observacoes_gerais&&e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Observações Gerais"}),e.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed whitespace-pre-wrap",children:r.observacoes_gerais})]})]}),d==="atividades"&&e.jsx(i.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-4",children:r.atividades&&r.atividades.length>0?r.atividades.map((a,t)=>e.jsx(i.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:t*.05},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg hover:border-blue-200/50 transition-colors",children:e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"flex items-center gap-2 mb-2",children:e.jsx("span",{className:"px-2 py-1 bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded-lg text-xs font-medium",children:a.tipo_atividade})}),e.jsx("h4",{className:"font-medium text-gray-900 dark:text-white mb-1",children:a.descricao}),a.localizacao&&e.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400 flex items-center gap-1",children:[e.jsx(A,{className:"w-3 h-3"}),a.localizacao]})]}),a.percentual_concluido!=null&&e.jsxs("div",{className:"text-right min-w-[80px]",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-1",children:[a.percentual_concluido,"%"]}),e.jsx("div",{className:"w-full h-2 bg-gray-200 dark:bg-gray-600 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-green-500 transition-all duration-500",style:{width:`${a.percentual_concluido}%`},role:"progressbar","aria-label":"Progresso da atividade"})})]})]})},a.id)):e.jsxs("div",{className:"text-center p-8 bg-white/50 dark:bg-gray-800/50 rounded-2xl",children:[e.jsx(p,{className:"w-12 h-12 text-gray-400 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500",children:"Nenhuma atividade registrada."})]})}),d==="recursos"&&e.jsxs(i.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-6",children:[e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg",children:[e.jsxs("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center gap-2",children:[e.jsx(j,{className:"w-5 h-5"}),"Mão de Obra"]}),e.jsx("div",{className:"space-y-3",children:r.mao_obra&&r.mao_obra.length>0?r.mao_obra.map(a=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 dark:bg-gray-700/50 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:a.funcao}),e.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Qtd: ",a.quantidade]})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("p",{className:"font-medium text-gray-900 dark:text-white",children:[a.horas_trabalhadas,"h"]}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"trabalhadas"})]})]},a.id)):e.jsx("p",{className:"text-gray-500 italic text-sm",children:"Nenhuma mão de obra registrada."})})]}),e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg",children:[e.jsxs("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center gap-2",children:[e.jsx(P,{className:"w-5 h-5"}),"Equipamentos"]}),e.jsx("div",{className:"space-y-3",children:r.equipamentos&&r.equipamentos.length>0?r.equipamentos.map(a=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 dark:bg-gray-700/50 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:a.nome_equipamento}),a.tipo&&e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:a.tipo})]}),e.jsx("div",{className:"text-right",children:e.jsxs("p",{className:"font-medium text-gray-900 dark:text-white",children:[a.horas_utilizadas,"h uso"]})})]},a.id)):e.jsx("p",{className:"text-gray-500 italic text-sm",children:"Nenhum equipamento registrado."})})]})]}),d==="ocorrencias"&&e.jsx(i.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-4",children:r.ocorrencias&&r.ocorrencias.length>0?r.ocorrencias.map((a,t)=>e.jsx(i.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:t*.05},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-4 border border-gray-200/50 dark:border-gray-700/50 shadow-lg",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`p-2 rounded-lg ${N(a.gravidade||"normal")}`,children:e.jsx(y,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:`px-2 py-1 rounded-lg text-xs font-medium ${N(a.gravidade||"normal")}`,children:(a.gravidade||"Geral").toUpperCase()}),e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400 bg-gray-100 dark:bg-gray-700 px-2 py-0.5 rounded",children:a.tipo_ocorrencia})]}),e.jsx("p",{className:"text-gray-900 dark:text-white mt-2",children:a.descricao}),a.acao_tomada&&e.jsxs("div",{className:"mt-2 text-sm text-gray-600 dark:text-gray-400 border-l-2 border-gray-300 pl-3",children:[e.jsx("span",{className:"font-semibold",children:"Ação tomada:"})," ",a.acao_tomada]})]})]})},a.id)):e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-8 border border-gray-200/50 dark:border-gray-700/50 shadow-lg text-center",children:[e.jsx(v,{className:"w-12 h-12 text-green-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Nenhuma ocorrência registrada neste dia"})]})}),d==="fotos"&&e.jsx(i.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-4",children:r.anexos&&r.anexos.filter(a=>a.tipo_arquivo?.startsWith("image/")||!0).length>0?e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:r.anexos.map((a,t)=>e.jsxs(i.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:t*.05},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl overflow-hidden border border-gray-200/50 dark:border-gray-700/50 shadow-lg hover:shadow-xl transition-all duration-300 group relative",children:[e.jsx("div",{className:"aspect-square overflow-hidden bg-gray-100 dark:bg-gray-700",children:a.url_storage?e.jsx("img",{src:a.url_storage,alt:a.descricao||`Foto ${t+1}`,className:"w-full h-full object-cover hover:scale-110 transition-transform duration-500"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center text-gray-400",children:e.jsx(u,{className:"w-8 h-8"})})}),a.descricao&&e.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-black/60 p-2 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx("p",{className:"text-white text-xs truncate",children:a.descricao})})]},t))}):e.jsxs("div",{className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-8 border border-gray-200/50 dark:border-gray-700/50 shadow-lg text-center",children:[e.jsx(u,{className:"w-12 h-12 text-gray-400 dark:text-gray-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Nenhuma foto encontrada neste RDO"})]})})]})]})}export{Y as default}; diff --git a/dist/assets/js/Reports-BmqmPZPj.js b/dist/assets/js/Reports-BmqmPZPj.js deleted file mode 100644 index 375f912..0000000 --- a/dist/assets/js/Reports-BmqmPZPj.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./query-vendor-BLVqILA6.js";import{r as d}from"./router-vendor-D4by-_6Z.js";import{T as S}from"./ThemeToggle-Cryh6OOS.js";import{S as G,d as p,A as x,m as l,l as j,B as D,F as g,W as E,ae as z,C as k,U,b as I,T as B,c as P,e as M,f as q,a3 as v,ao as L,M as O,ap as $}from"./ui-vendor-CyRvbSfR.js";import"./react-vendor-CqRd3GwO.js";const V=[{id:"1",title:"Relatório de Obras",description:"Status geral das obras em andamento",type:"obras",icon:D,data:{total:15,em_andamento:8,concluidas:5,pausadas:2,progresso_medio:67},lastGenerated:"2024-01-15T10:30:00",status:"updated"},{id:"2",title:"Relatório de RDOs",description:"Análise dos relatórios diários de obra",type:"rdos",icon:g,data:{total_mes:124,pendentes:8,aprovados:110,rejeitados:6,media_diaria:4.1},lastGenerated:"2024-01-15T09:15:00",status:"updated"},{id:"3",title:"Relatório de Equipamentos",description:"Status e utilização dos equipamentos",type:"equipamentos",icon:E,data:{total:45,em_uso:32,disponivel:8,manutencao:3,inativo:2,taxa_utilizacao:71},lastGenerated:"2024-01-15T08:45:00",status:"updated"},{id:"4",title:"Relatório de Produtividade",description:"Análise de produtividade por obra e equipe",type:"produtividade",icon:z,data:{eficiencia_media:85,horas_trabalhadas:1240,atividades_concluidas:89,atrasos:12,meta_mensal:95},lastGenerated:"2024-01-15T07:20:00",status:"outdated"},{id:"5",title:"Relatório Financeiro",description:"Custos e orçamentos das obras",type:"financeiro",icon:k,data:{orcamento_total:125e5,gasto_atual:875e4,economia:125e3,obras_no_orcamento:12,obras_acima_orcamento:3},lastGenerated:"2024-01-14T16:30:00",status:"outdated"},{id:"6",title:"Relatório de Usuários",description:"Atividade e engajamento dos usuários",type:"usuarios",icon:U,data:{total_usuarios:28,ativos_mes:24,novos_cadastros:3,ultimo_acesso_medio:2,rdos_por_usuario:4.4},lastGenerated:"2024-01-15T11:00:00",status:"updated"}],i={updated:{label:"Atualizado",color:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300",icon:P},outdated:{label:"Desatualizado",color:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-300",icon:B},generating:{label:"Gerando...",color:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300",icon:I}},W=[{id:"pdf",label:"PDF",icon:g},{id:"excel",label:"Excel",icon:k},{id:"csv",label:"CSV",icon:g}];function Y(){const[u,N]=d.useState(null),[n,f]=d.useState(!1),[m,w]=d.useState("pdf"),[b,y]=d.useState({dateRange:{start:"2024-01-01",end:"2024-01-31"},obras:[],status:[],usuarios:[]}),[_,h]=d.useState([]),o=a=>new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(a),R=a=>new Date(a).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}),T=async a=>{h(t=>[...t,a]),setTimeout(()=>{h(t=>t.filter(c=>c!==a))},3e3)},C=(a,t)=>{},F=({report:a})=>{const t=a.icon,c=i[a.status].icon,r=_.includes(a.id);return e.jsxs(l.div,{layout:!0,initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"bg-white/70 dark:bg-gray-800/70 backdrop-blur-md rounded-2xl p-6 border border-gray-200/50 dark:border-gray-700/50 shadow-lg hover:shadow-xl transition-all duration-300",children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-blue-500 to-purple-600 rounded-xl flex items-center justify-center",children:e.jsx(t,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white text-lg",children:a.title}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:a.description})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("span",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${r?i.generating.color:i[a.status].color}`,children:[e.jsx(c,{className:"w-3 h-3"}),r?"Gerando...":i[a.status].label]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[a.type==="obras"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx("div",{className:"text-2xl font-bold text-blue-600 dark:text-blue-400",children:a.data.total}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Total"})]}),e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx("div",{className:"text-2xl font-bold text-green-600 dark:text-green-400",children:a.data.em_andamento}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Em Andamento"})]}),e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsxs("div",{className:"text-2xl font-bold text-purple-600 dark:text-purple-400",children:[a.data.progresso_medio,"%"]}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Progresso Médio"})]}),e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx("div",{className:"text-2xl font-bold text-orange-600 dark:text-orange-400",children:a.data.concluidas}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Concluídas"})]})]}),a.type==="rdos"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx("div",{className:"text-2xl font-bold text-blue-600 dark:text-blue-400",children:a.data.total_mes}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Total do Mês"})]}),e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx("div",{className:"text-2xl font-bold text-green-600 dark:text-green-400",children:a.data.aprovados}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Aprovados"})]}),e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx("div",{className:"text-2xl font-bold text-yellow-600 dark:text-yellow-400",children:a.data.pendentes}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Pendentes"})]}),e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx("div",{className:"text-2xl font-bold text-purple-600 dark:text-purple-400",children:a.data.media_diaria}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Média Diária"})]})]}),a.type==="equipamentos"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx("div",{className:"text-2xl font-bold text-blue-600 dark:text-blue-400",children:a.data.total}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Total"})]}),e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx("div",{className:"text-2xl font-bold text-green-600 dark:text-green-400",children:a.data.em_uso}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Em Uso"})]}),e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsxs("div",{className:"text-2xl font-bold text-purple-600 dark:text-purple-400",children:[a.data.taxa_utilizacao,"%"]}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Taxa Utilização"})]}),e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx("div",{className:"text-2xl font-bold text-yellow-600 dark:text-yellow-400",children:a.data.manutencao}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Manutenção"})]})]}),a.type==="financeiro"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"col-span-2 text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx("div",{className:"text-2xl font-bold text-blue-600 dark:text-blue-400",children:o(a.data.orcamento_total)}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Orçamento Total"})]}),e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx("div",{className:"text-2xl font-bold text-green-600 dark:text-green-400",children:o(a.data.gasto_atual)}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Gasto Atual"})]}),e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx("div",{className:"text-2xl font-bold text-purple-600 dark:text-purple-400",children:o(a.data.economia)}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Economia"})]})]}),(a.type==="produtividade"||a.type==="usuarios")&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx("div",{className:"text-2xl font-bold text-blue-600 dark:text-blue-400",children:a.type==="produtividade"?`${a.data.eficiencia_media}%`:a.data.total_usuarios}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:a.type==="produtividade"?"Eficiência":"Total Usuários"})]}),e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx("div",{className:"text-2xl font-bold text-green-600 dark:text-green-400",children:a.type==="produtividade"?a.data.atividades_concluidas:a.data.ativos_mes}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:a.type==="produtividade"?"Atividades":"Ativos"})]}),e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx("div",{className:"text-2xl font-bold text-yellow-600 dark:text-yellow-400",children:a.type==="produtividade"?a.data.horas_trabalhadas:a.data.novos_cadastros}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:a.type==="produtividade"?"Horas":"Novos"})]}),e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx("div",{className:"text-2xl font-bold text-purple-600 dark:text-purple-400",children:a.type==="produtividade"?a.data.atrasos:a.data.rdos_por_usuario}),e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-300",children:a.type==="produtividade"?"Atrasos":"RDOs/Usuário"})]})]})]}),e.jsx("div",{className:"flex items-center justify-between mb-4",children:e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["Última atualização: ",R(a.lastGenerated)]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:()=>N(u===a.id?null:a.id),className:"flex-1 flex items-center justify-center gap-2 px-4 py-2 bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded-lg hover:bg-blue-200 dark:hover:bg-blue-900/50 transition-colors",children:[e.jsx(M,{className:"w-4 h-4"}),"Visualizar"]}),e.jsxs("button",{onClick:()=>T(a.id),disabled:r,className:"flex items-center justify-center gap-2 px-4 py-2 bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300 rounded-lg hover:bg-green-200 dark:hover:bg-green-900/50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[r?e.jsx(l.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:e.jsx(q,{className:"w-4 h-4"})}):e.jsx(v,{className:"w-4 h-4"}),r?"Gerando...":"Gerar"]})]}),e.jsx(x,{children:u===a.id&&e.jsxs(l.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"mt-4 pt-4 border-t border-gray-200 dark:border-gray-700",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-3",children:"Exportar Relatório"}),e.jsx("div",{className:"grid grid-cols-3 gap-2 mb-3",children:W.map(s=>{const A=s.icon;return e.jsxs("button",{onClick:()=>w(s.id),className:`flex items-center justify-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors ${m===s.id?"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 border border-blue-300 dark:border-blue-600":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"}`,children:[e.jsx(A,{className:"w-4 h-4"}),s.label]},s.id)})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:()=>C(a.id),className:"flex-1 flex items-center justify-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:[e.jsx(v,{className:"w-4 h-4"}),"Exportar ",m.toUpperCase()]}),e.jsx("button",{className:"flex items-center justify-center gap-2 px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:e.jsx(L,{className:"w-4 h-4"})}),e.jsx("button",{className:"flex items-center justify-center gap-2 px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:e.jsx(O,{className:"w-4 h-4"})}),e.jsx("button",{className:"flex items-center justify-center gap-2 px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:e.jsx($,{className:"w-4 h-4"})})]})]})})]})};return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900",children:[e.jsx("div",{className:"bg-white/80 dark:bg-gray-800/80 backdrop-blur-md border-b border-gray-200/50 dark:border-gray-700/50",children:e.jsxs("div",{className:"px-6 py-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-2",children:"Relatórios"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:"Análises e relatórios consolidados do sistema"})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(G,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 dark:text-gray-500 w-5 h-5"}),e.jsx("input",{type:"text",placeholder:"Buscar relatórios...",className:"pl-12 pr-4 py-3 bg-white/50 dark:bg-gray-700/50 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-transparent w-64"})]}),e.jsx(S,{}),e.jsxs("button",{onClick:()=>f(!n),className:`flex items-center gap-2 px-6 py-3 rounded-xl border transition-colors ${n?"bg-blue-100 dark:bg-blue-900/30 border-blue-300 dark:border-blue-600 text-blue-700 dark:text-blue-300":"bg-white/50 dark:bg-gray-700/50 border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-600"}`,children:[e.jsx(p,{className:"w-5 h-5"}),"Filtros Avançados"]})]})]}),e.jsx(x,{children:n&&e.jsxs(l.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"bg-white/50 dark:bg-gray-700/50 rounded-xl p-4 mb-6 border border-gray-200 dark:border-gray-600",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[e.jsx(j,{className:"w-4 h-4 text-gray-400 dark:text-gray-500 inline mr-2"}),"Data Início"]}),e.jsx("input",{type:"text",value:b.dateRange.start,onChange:a=>y(t=>({...t,dateRange:{...t.dateRange,start:a.target.value}})),className:"w-full px-3 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"dd/mm/aa",maxLength:8,onInput:a=>{let t=a.currentTarget.value.replace(/\D/g,"");t.length>=2&&(t=t.slice(0,2)+"/"+t.slice(2)),t.length>=5&&(t=t.slice(0,5)+"/"+t.slice(5,7)),a.currentTarget.value=t}})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[e.jsx(j,{className:"w-4 h-4 text-gray-400 dark:text-gray-500 inline mr-2"}),"Data Fim"]}),e.jsx("input",{type:"text",value:b.dateRange.end,onChange:a=>y(t=>({...t,dateRange:{...t.dateRange,end:a.target.value}})),className:"w-full px-3 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"dd/mm/aa",maxLength:8,onInput:a=>{let t=a.currentTarget.value.replace(/\D/g,"");t.length>=2&&(t=t.slice(0,2)+"/"+t.slice(2)),t.length>=5&&(t=t.slice(0,5)+"/"+t.slice(5,7)),a.currentTarget.value=t}})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Obras"}),e.jsxs("select",{className:"w-full px-3 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[e.jsx("option",{value:"",children:"Todas as obras"}),e.jsx("option",{value:"1",children:"Edifício Residencial Aurora"}),e.jsx("option",{value:"2",children:"Centro Comercial Plaza"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[e.jsx(p,{className:"w-4 h-4 text-gray-400 dark:text-gray-500 inline mr-2"}),"Status"]}),e.jsxs("select",{className:"w-full px-3 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[e.jsx("option",{value:"",children:"Todos os status"}),e.jsx("option",{value:"updated",children:"Atualizado"}),e.jsx("option",{value:"outdated",children:"Desatualizado"})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[e.jsx("button",{className:"px-4 py-2 text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white transition-colors",children:"Limpar Filtros"}),e.jsx("button",{className:"px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:"Aplicar Filtros"})]})]})})]})}),e.jsx("div",{className:"px-6 py-6",children:e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6",children:e.jsx(x,{children:V.map(a=>e.jsx(F,{report:a},a.id))})})})]})}export{Y as default}; diff --git a/dist/assets/js/SelectOrganization-Cb4zDKko.js b/dist/assets/js/SelectOrganization-Cb4zDKko.js deleted file mode 100644 index f89668c..0000000 --- a/dist/assets/js/SelectOrganization-Cb4zDKko.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./query-vendor-BLVqILA6.js";import{d as I,r as a}from"./router-vendor-D4by-_6Z.js";import{s as m}from"./index-doec96Hx.js";import{u as U}from"./useInviteCode-BxOSdQOT.js";import{N as B}from"./NeuralNetworkBackground-CER-dIFD.js";import{B as O,$ as D,a2 as f,a0 as b,aq as V,p as F,c as j,ar as L}from"./ui-vendor-CyRvbSfR.js";import"./react-vendor-CqRd3GwO.js";import"./supabase-vendor-CnnNSQLo.js";import"./state-vendor-DHadhBU5.js";const $=()=>{const i=I(),{loading:o,validarConvite:w,usarConvite:N}=U(),[r,v]=a.useState(""),[l,c]=a.useState("input"),[d,u]=a.useState(null),[x,n]=a.useState(""),[y,C]=a.useState(""),[k,z]=a.useState("");a.useEffect(()=>{(async()=>{const{data:{user:t}}=await m.auth.getUser();if(!t){i("/login");return}z(t.id),C(t.user_metadata?.full_name||t.user_metadata?.nome||t.email?.split("@")[0]||"Usuário");const{data:p}=await m.from("usuarios").select("organizacao_id").eq("id",t.id).single();p&&p.organizacao_id&&i("/dashboard")})()},[i]);const h=async()=>{if(!r.trim()){n("Digite o código de convite.");return}n("");const s=await w(r);s.success?(u({organizacao_nome:s.organizacao_nome||"Organização",organizacao_id:s.organizacao_id||"",role:s.role||"usuario"}),c("confirm")):n(s.error||"Código inválido.")},S=async()=>{const s=await N(r,k);s.success?(c("success"),setTimeout(()=>{i("/dashboard"),window.location.reload()},2e3)):(n(s.error||"Erro ao ingressar na organização."),c("error"))},_=async()=>{await m.auth.signOut(),i("/login")},g=()=>{c("input"),u(null),n("")},E=s=>({admin:"Administrador",engenheiro:"Engenheiro",mestre_obra:"Mestre de Obra",usuario:"Usuário"})[s]||s;return e.jsxs("div",{className:"min-h-screen relative flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8 overflow-hidden",children:[e.jsx(B,{}),e.jsxs("div",{className:"relative z-10 max-w-lg w-full space-y-6 animate-fade-in",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl shadow-lg border border-white/20 p-6 inline-block mb-4",children:e.jsx(O,{className:"w-16 h-16 text-blue-300 mx-auto"})}),e.jsxs("h1",{className:"text-3xl font-bold text-white mb-2",children:["Bem-vindo, ",y,"!"]}),e.jsx("p",{className:"text-blue-200 text-lg",children:"Para acessar o sistema, informe o código de convite da sua organização."})]}),e.jsxs("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl shadow-2xl border border-white/20 p-8 transition-all duration-300",children:[l==="input"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx(D,{className:"w-6 h-6 text-yellow-300"}),e.jsx("h2",{className:"text-xl font-semibold text-white",children:"Código de Convite"})]}),e.jsx("p",{className:"text-blue-200 text-sm",children:"Solicite o código de convite ao administrador da sua organização. O código é composto por 8 caracteres alfanuméricos."}),x&&e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-red-500/20 border border-red-400/30 rounded-xl",children:[e.jsx(f,{className:"w-5 h-5 text-red-300 flex-shrink-0"}),e.jsx("p",{className:"text-red-200 text-sm",children:x})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-white mb-2",children:"Digite o código"}),e.jsx("input",{type:"text",value:r,onChange:s=>v(s.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,8)),placeholder:"Ex: A1B2C3D4",maxLength:8,className:"w-full px-4 py-4 bg-white/10 border border-white/20 rounded-xl text-white text-center text-2xl font-mono tracking-[0.3em] placeholder-blue-200/50 focus:outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent backdrop-blur-sm transition-all duration-200 uppercase",onKeyDown:s=>s.key==="Enter"&&h(),autoFocus:!0})]}),e.jsx("button",{onClick:h,disabled:o||r.length<4,className:"w-full flex items-center justify-center gap-2 bg-gradient-to-r from-blue-500 to-purple-600 text-white py-3 px-6 rounded-xl hover:from-blue-600 hover:to-purple-700 focus:outline-none focus:ring-2 focus:ring-blue-400 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 shadow-lg hover:shadow-xl font-semibold",children:o?e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"w-5 h-5 animate-spin"}),"Verificando..."]}):e.jsxs(e.Fragment,{children:["Verificar Código",e.jsx(V,{className:"w-5 h-5"})]})})]}),l==="confirm"&&d&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx(F,{className:"w-6 h-6 text-green-300"}),e.jsx("h2",{className:"text-xl font-semibold text-white",children:"Confirmar Ingresso"})]}),e.jsxs("div",{className:"p-4 bg-green-500/10 border border-green-400/30 rounded-xl space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-green-200 text-sm",children:"Organização:"}),e.jsx("span",{className:"text-white font-semibold text-lg",children:d.organizacao_nome})]}),e.jsx("div",{className:"h-px bg-green-400/20"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-green-200 text-sm",children:"Seu cargo será:"}),e.jsx("span",{className:"text-white font-medium",children:E(d.role)})]}),e.jsx("div",{className:"h-px bg-green-400/20"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-green-200 text-sm",children:"Código:"}),e.jsx("span",{className:"text-white font-mono",children:r})]})]}),e.jsx("p",{className:"text-blue-200 text-sm text-center",children:"Deseja ingressar nesta organização?"}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:g,disabled:o,className:"flex-1 py-3 px-4 bg-white/10 border border-white/20 text-white rounded-xl hover:bg-white/20 transition-all duration-200 font-medium",children:"Voltar"}),e.jsx("button",{onClick:S,disabled:o,className:"flex-1 flex items-center justify-center gap-2 bg-gradient-to-r from-green-500 to-emerald-600 text-white py-3 px-4 rounded-xl hover:from-green-600 hover:to-emerald-700 transition-all duration-200 font-semibold shadow-lg",children:o?e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"w-5 h-5 animate-spin"}),"Ingressando..."]}):e.jsxs(e.Fragment,{children:[e.jsx(j,{className:"w-5 h-5"}),"Confirmar"]})})]})]}),l==="success"&&e.jsxs("div",{className:"text-center space-y-4 py-4",children:[e.jsx(j,{className:"w-20 h-20 text-green-400 mx-auto animate-bounce"}),e.jsx("h2",{className:"text-2xl font-bold text-white",children:"Bem-vindo à equipe!"}),e.jsxs("p",{className:"text-green-200",children:["Você ingressou na organização ",e.jsx("strong",{children:d?.organizacao_nome})," com sucesso!"]}),e.jsx("p",{className:"text-blue-200 text-sm",children:"Redirecionando para o painel..."}),e.jsx("div",{className:"w-full bg-white/10 rounded-full h-2 overflow-hidden",children:e.jsx("div",{className:"bg-green-400 h-2 rounded-full animate-pulse w-2/3"})})]}),l==="error"&&e.jsxs("div",{className:"text-center space-y-4 py-4",children:[e.jsx(f,{className:"w-20 h-20 text-red-400 mx-auto"}),e.jsx("h2",{className:"text-2xl font-bold text-white",children:"Erro ao Ingressar"}),e.jsx("p",{className:"text-red-200",children:x}),e.jsx("button",{onClick:g,className:"mt-4 py-3 px-6 bg-white/10 border border-white/20 text-white rounded-xl hover:bg-white/20 transition-all duration-200 font-medium",children:"Tentar Novamente"})]})]}),e.jsx("div",{className:"text-center",children:e.jsxs("button",{onClick:_,className:"inline-flex items-center gap-2 text-blue-200 hover:text-white transition-colors duration-200 text-sm",children:[e.jsx(L,{className:"w-4 h-4"}),"Sair e usar outra conta"]})}),e.jsx("div",{className:"text-center text-sm text-gray-300",children:e.jsx("p",{className:"italic",children:"Desenvolvido por TrackSteel"})})]})]})};export{$ as default}; diff --git a/dist/assets/js/ThemeToggle-Cryh6OOS.js b/dist/assets/js/ThemeToggle-Cryh6OOS.js deleted file mode 100644 index 788e427..0000000 --- a/dist/assets/js/ThemeToggle-Cryh6OOS.js +++ /dev/null @@ -1 +0,0 @@ -import{j as a}from"./query-vendor-BLVqILA6.js";import{r as o}from"./router-vendor-D4by-_6Z.js";import{m as s,I as l,am as i}from"./ui-vendor-CyRvbSfR.js";function n(){const[t,e]=o.useState(()=>{const r=localStorage.getItem("theme");return r||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")});return o.useEffect(()=>{document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(t),localStorage.setItem("theme",t)},[t]),{theme:t,toggleTheme:()=>{e(r=>r==="light"?"dark":"light")},isDark:t==="dark"}}function h(){const{toggleTheme:t,isDark:e}=n();return a.jsx(s.button,{onClick:t,className:"relative p-2 rounded-xl bg-white/70 dark:bg-gray-800/70 backdrop-blur-md border border-gray-200/50 dark:border-gray-700/50 shadow-lg hover:shadow-xl transition-all duration-300 group",whileHover:{scale:1.05},whileTap:{scale:.95},title:e?"Alternar para modo claro":"Alternar para modo escuro",children:a.jsxs("div",{className:"relative w-6 h-6",children:[a.jsx(s.div,{initial:!1,animate:{scale:e?0:1,rotate:e?180:0,opacity:e?0:1},transition:{duration:.3,ease:"easeInOut"},className:"absolute inset-0 flex items-center justify-center",children:a.jsx(l,{className:"w-5 h-5 text-yellow-500 group-hover:text-yellow-600"})}),a.jsx(s.div,{initial:!1,animate:{scale:e?1:0,rotate:e?0:-180,opacity:e?1:0},transition:{duration:.3,ease:"easeInOut"},className:"absolute inset-0 flex items-center justify-center",children:a.jsx(i,{className:"w-5 h-5 text-blue-400 group-hover:text-blue-300"})})]})})}export{h as T}; diff --git a/dist/assets/js/configStore-DS-p50om.js b/dist/assets/js/configStore-DS-p50om.js deleted file mode 100644 index 7dea429..0000000 --- a/dist/assets/js/configStore-DS-p50om.js +++ /dev/null @@ -1 +0,0 @@ -import{p as v}from"./index-doec96Hx.js";import{c as C}from"./state-vendor-DHadhBU5.js";const s=[{id:"1",nome:"Escavação",ativo:!0,ordem:1},{id:"2",nome:"Fundação",ativo:!0,ordem:2},{id:"3",nome:"Concretagem",ativo:!0,ordem:3},{id:"4",nome:"Alvenaria",ativo:!0,ordem:4},{id:"5",nome:"Instalação Elétrica",ativo:!0,ordem:5},{id:"6",nome:"Instalação Hidráulica",ativo:!0,ordem:6},{id:"7",nome:"Revestimento",ativo:!0,ordem:7},{id:"8",nome:"Pintura",ativo:!0,ordem:8}],c=[{id:"1",nome:"Ensolarado",valor:"ensolarado",ativo:!0,ordem:1,icone:"Sun"},{id:"2",nome:"Parcialmente Nublado",valor:"parcialmente_nublado",ativo:!0,ordem:2,icone:"Cloud"},{id:"3",nome:"Nublado",valor:"nublado",ativo:!0,ordem:3,icone:"Cloud"},{id:"4",nome:"Chuvisco",valor:"chuvisco",ativo:!0,ordem:4,icone:"CloudRain"},{id:"5",nome:"Chuva Leve",valor:"chuva_leve",ativo:!0,ordem:5,icone:"CloudRain"},{id:"6",nome:"Chuva Forte",valor:"chuva_forte",ativo:!0,ordem:6,icone:"CloudRain"}],m=[{id:"1",nome:"Acidente de Trabalho",ativo:!0,ordem:1,cor:"#ef4444"},{id:"2",nome:"Atraso na Entrega",ativo:!0,ordem:2,cor:"#f59e0b"},{id:"3",nome:"Problema de Qualidade",ativo:!0,ordem:3,cor:"#f59e0b"},{id:"4",nome:"Falta de Material",ativo:!0,ordem:4,cor:"#f59e0b"},{id:"5",nome:"Problema Climático",ativo:!0,ordem:5,cor:"#6b7280"},{id:"6",nome:"Equipamento Quebrado",ativo:!0,ordem:6,cor:"#ef4444"},{id:"7",nome:"Outros",ativo:!0,ordem:7,cor:"#6b7280"}],u=[{id:"1",nome:"Pedreiro",ativo:!0,ordem:1},{id:"2",nome:"Servente",ativo:!0,ordem:2},{id:"3",nome:"Armador",ativo:!0,ordem:3},{id:"4",nome:"Encarregado",ativo:!0,ordem:4},{id:"5",nome:"Mestre de Obras",ativo:!0,ordem:5},{id:"6",nome:"Engenheiro Civil",ativo:!0,ordem:6},{id:"7",nome:"Arquiteto",ativo:!0,ordem:7},{id:"8",nome:"Eletricista",ativo:!0,ordem:8},{id:"9",nome:"Encanador",ativo:!0,ordem:9},{id:"10",nome:"Pintor",ativo:!0,ordem:10}],p=[{id:"1",nome:"Betoneira",ativo:!0,ordem:1},{id:"2",nome:"Guindaste",ativo:!0,ordem:2},{id:"3",nome:"Escavadeira",ativo:!0,ordem:3},{id:"4",nome:"Guincho de Coluna",ativo:!0,ordem:4},{id:"5",nome:"Compactador",ativo:!0,ordem:5},{id:"6",nome:"Furadeira",ativo:!0,ordem:6},{id:"7",nome:"Serra Circular",ativo:!0,ordem:7},{id:"8",nome:"Andaime",ativo:!0,ordem:8}],l=[{id:"1",nome:"Cimento",ativo:!0,ordem:1},{id:"2",nome:"Areia",ativo:!0,ordem:2},{id:"3",nome:"Brita",ativo:!0,ordem:3},{id:"4",nome:"Ferro/Aço",ativo:!0,ordem:4},{id:"5",nome:"Tijolo",ativo:!0,ordem:5},{id:"6",nome:"Bloco de Concreto",ativo:!0,ordem:6},{id:"7",nome:"Madeira",ativo:!0,ordem:7},{id:"8",nome:"Tinta",ativo:!0,ordem:8},{id:"9",nome:"Argamassa",ativo:!0,ordem:9},{id:"10",nome:"Cerâmica",ativo:!0,ordem:10}],n=()=>Date.now().toString()+Math.random().toString(36).substr(2,9),d=C()(v((r,t)=>({tiposAtividade:s,condicoesClimaticas:c,tiposOcorrencia:m,funcoesCargos:u,tiposEquipamento:p,materiais:l,addTipoAtividade:o=>r(e=>({tiposAtividade:[...e.tiposAtividade,{...o,id:n()}].sort((i,a)=>i.ordem-a.ordem)})),updateTipoAtividade:(o,e)=>r(i=>({tiposAtividade:i.tiposAtividade.map(a=>a.id===o?{...a,...e}:a)})),deleteTipoAtividade:o=>r(e=>({tiposAtividade:e.tiposAtividade.filter(i=>i.id!==o)})),reorderTiposAtividade:o=>r(()=>({tiposAtividade:o})),addCondicaoClimatica:o=>r(e=>({condicoesClimaticas:[...e.condicoesClimaticas,{...o,id:n()}].sort((i,a)=>i.ordem-a.ordem)})),updateCondicaoClimatica:(o,e)=>r(i=>({condicoesClimaticas:i.condicoesClimaticas.map(a=>a.id===o?{...a,...e}:a)})),deleteCondicaoClimatica:o=>r(e=>({condicoesClimaticas:e.condicoesClimaticas.filter(i=>i.id!==o)})),reorderCondicoesClimaticas:o=>r(()=>({condicoesClimaticas:o})),addTipoOcorrencia:o=>r(e=>({tiposOcorrencia:[...e.tiposOcorrencia,{...o,id:n()}].sort((i,a)=>i.ordem-a.ordem)})),updateTipoOcorrencia:(o,e)=>r(i=>({tiposOcorrencia:i.tiposOcorrencia.map(a=>a.id===o?{...a,...e}:a)})),deleteTipoOcorrencia:o=>r(e=>({tiposOcorrencia:e.tiposOcorrencia.filter(i=>i.id!==o)})),reorderTiposOcorrencia:o=>r(()=>({tiposOcorrencia:o})),addFuncaoCargo:o=>r(e=>({funcoesCargos:[...e.funcoesCargos,{...o,id:n()}].sort((i,a)=>i.ordem-a.ordem)})),updateFuncaoCargo:(o,e)=>r(i=>({funcoesCargos:i.funcoesCargos.map(a=>a.id===o?{...a,...e}:a)})),deleteFuncaoCargo:o=>r(e=>({funcoesCargos:e.funcoesCargos.filter(i=>i.id!==o)})),reorderFuncoesCargos:o=>r(()=>({funcoesCargos:o})),addTipoEquipamento:o=>r(e=>({tiposEquipamento:[...e.tiposEquipamento,{...o,id:n()}].sort((i,a)=>i.ordem-a.ordem)})),updateTipoEquipamento:(o,e)=>r(i=>({tiposEquipamento:i.tiposEquipamento.map(a=>a.id===o?{...a,...e}:a)})),deleteTipoEquipamento:o=>r(e=>({tiposEquipamento:e.tiposEquipamento.filter(i=>i.id!==o)})),reorderTiposEquipamento:o=>r(()=>({tiposEquipamento:o})),addMaterial:o=>r(e=>({materiais:[...e.materiais,{...o,id:n()}].sort((i,a)=>i.ordem-a.ordem)})),updateMaterial:(o,e)=>r(i=>({materiais:i.materiais.map(a=>a.id===o?{...a,...e}:a)})),deleteMaterial:o=>r(e=>({materiais:e.materiais.filter(i=>i.id!==o)})),reorderMateriais:o=>r(()=>({materiais:o})),resetToDefaults:()=>r(()=>({tiposAtividade:s,condicoesClimaticas:c,tiposOcorrencia:m,funcoesCargos:u,tiposEquipamento:p,materiais:l})),exportConfig:()=>{const o=d.getState();return JSON.stringify({tiposAtividade:o.tiposAtividade,condicoesClimaticas:o.condicoesClimaticas,tiposOcorrencia:o.tiposOcorrencia,funcoesCargos:o.funcoesCargos,tiposEquipamento:o.tiposEquipamento,materiais:o.materiais},null,2)},importConfig:o=>{try{const e=JSON.parse(o);r(()=>({tiposAtividade:e.tiposAtividade||s,condicoesClimaticas:e.condicoesClimaticas||c,tiposOcorrencia:e.tiposOcorrencia||m,funcoesCargos:e.funcoesCargos||u,tiposEquipamento:e.tiposEquipamento||p,materiais:e.materiais||l}))}catch{}}}),{name:"rdo-config-storage",version:1})),E=()=>{const{tiposAtividade:r,addTipoAtividade:t,updateTipoAtividade:o,deleteTipoAtividade:e,reorderTiposAtividade:i}=d();return{items:r.filter(a=>a.ativo),allItems:r,add:t,update:o,delete:e,reorder:i}},T=()=>{const{condicoesClimaticas:r,addCondicaoClimatica:t,updateCondicaoClimatica:o,deleteCondicaoClimatica:e,reorderCondicoesClimaticas:i}=d();return{items:r.filter(a=>a.ativo),allItems:r,add:t,update:o,delete:e,reorder:i}},A=()=>{const{tiposOcorrencia:r,addTipoOcorrencia:t,updateTipoOcorrencia:o,deleteTipoOcorrencia:e,reorderTiposOcorrencia:i}=d();return{items:r.filter(a=>a.ativo),allItems:r,add:t,update:o,delete:e,reorder:i}},O=()=>{const{funcoesCargos:r,addFuncaoCargo:t,updateFuncaoCargo:o,deleteFuncaoCargo:e,reorderFuncoesCargos:i}=d();return{items:r.filter(a=>a.ativo),allItems:r,add:t,update:o,delete:e,reorder:i}},q=()=>{const{tiposEquipamento:r,addTipoEquipamento:t,updateTipoEquipamento:o,deleteTipoEquipamento:e,reorderTiposEquipamento:i}=d();return{items:r.filter(a=>a.ativo),allItems:r,add:t,update:o,delete:e,reorder:i}},b=()=>{const{materiais:r,addMaterial:t,updateMaterial:o,deleteMaterial:e,reorderMateriais:i}=d();return{items:r.filter(a=>a.ativo),allItems:r,add:t,update:o,delete:e,reorder:i}};export{T as a,O as b,A as c,q as d,b as e,d as f,E as u}; diff --git a/dist/assets/js/index-doec96Hx.js b/dist/assets/js/index-doec96Hx.js deleted file mode 100644 index 6251ac6..0000000 --- a/dist/assets/js/index-doec96Hx.js +++ /dev/null @@ -1,3 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/js/useUserStore-VOdYc7Zm.js","assets/js/state-vendor-DHadhBU5.js","assets/js/react-vendor-CqRd3GwO.js","assets/js/router-vendor-D4by-_6Z.js","assets/js/query-vendor-BLVqILA6.js","assets/js/ui-vendor-CyRvbSfR.js","assets/js/supabase-vendor-CnnNSQLo.js","assets/js/Dashboard-BPPxBqO4.js","assets/js/ThemeToggle-Cryh6OOS.js","assets/js/Cadastros-QZZ_REjv.js","assets/js/CreateRDO-Bhe5_7xI.js","assets/js/form-vendor-vQotxSmE.js","assets/js/zod-7IfHMaWP.js","assets/js/configStore-DS-p50om.js","assets/js/ObraDetails-S1VcIvXW.js","assets/js/RDODetails-tkR9ftO-.js","assets/js/Configuracoes-LYuviA0-.js","assets/js/useInviteCode-BxOSdQOT.js","assets/js/ObraTasks-Cy-rxhIo.js","assets/js/CreateTask-BlEDuvPM.js","assets/js/ManualInstrucoes-G3xr1xLl.js","assets/js/Reports-BmqmPZPj.js","assets/js/DatabaseTest-BA9LjsoE.js","assets/js/Auth-KZISTjMo.js","assets/js/NeuralNetworkBackground-CER-dIFD.js","assets/js/CreateObra-BwwQt_hK.js","assets/js/AuthCallback-DlZVcD4W.js","assets/js/SelectOrganization-Cb4zDKko.js"])))=>i.map(i=>d[i]); -var dt=Object.defineProperty;var ut=(e,r,t)=>r in e?dt(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var F=(e,r,t)=>ut(e,typeof r!="symbol"?r+"":r,t);import{j as i,_ as I,Q as mt,a as ft,u as pt}from"./query-vendor-BLVqILA6.js";import{u as We,L as De,r as k,N as Te,B as gt,a as ht,b as bt}from"./router-vendor-D4by-_6Z.js";import{a as yt}from"./react-vendor-CqRd3GwO.js";import{H as Ke,B as wt,P as vt,L as xt,C as kt,m as Me,T as St,R as _t}from"./ui-vendor-CyRvbSfR.js";import{c as Ct}from"./supabase-vendor-CnnNSQLo.js";import{D as Ot,c as At}from"./state-vendor-DHadhBU5.js";var le={},qe;function Et(){if(qe)return le;qe=1;var e=yt();return le.createRoot=e.createRoot,le.hydrateRoot=e.hydrateRoot,le}var It=Et();function Ze(e){var r,t,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(r=0;r{const r=Nt(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:u=>{const h=u.split(Ae);return h[0]===""&&h.length!==1&&h.shift(),$e(h,r)||Pt(u)},getConflictingClassGroupIds:(u,h)=>{const g=t[u]||[];return h&&o[u]?[...g,...o[u]]:g}}},$e=(e,r)=>{if(e.length===0)return r.classGroupId;const t=e[0],o=r.nextPart.get(t),s=o?$e(e.slice(1),o):void 0;if(s)return s;if(r.validators.length===0)return;const a=e.join(Ae);return r.validators.find(({validator:u})=>u(a))?.classGroupId},Ve=/^\[(.+)\]$/,Pt=e=>{if(Ve.test(e)){const r=Ve.exec(e)[1],t=r?.substring(0,r.indexOf(":"));if(t)return"arbitrary.."+t}},Nt=e=>{const{theme:r,classGroups:t}=e,o={nextPart:new Map,validators:[]};for(const s in t)ve(t[s],o,s,r);return o},ve=(e,r,t,o)=>{e.forEach(s=>{if(typeof s=="string"){const a=s===""?r:Ue(r,s);a.classGroupId=t;return}if(typeof s=="function"){if(zt(s)){ve(s(o),r,t,o);return}r.validators.push({validator:s,classGroupId:t});return}Object.entries(s).forEach(([a,u])=>{ve(u,Ue(r,a),t,o)})})},Ue=(e,r)=>{let t=e;return r.split(Ae).forEach(o=>{t.nextPart.has(o)||t.nextPart.set(o,{nextPart:new Map,validators:[]}),t=t.nextPart.get(o)}),t},zt=e=>e.isThemeGetter,Lt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,t=new Map,o=new Map;const s=(a,u)=>{t.set(a,u),r++,r>e&&(r=0,o=t,t=new Map)};return{get(a){let u=t.get(a);if(u!==void 0)return u;if((u=o.get(a))!==void 0)return s(a,u),u},set(a,u){t.has(a)?t.set(a,u):s(a,u)}}},xe="!",ke=":",Dt=ke.length,Tt=e=>{const{prefix:r,experimentalParseClassName:t}=e;let o=s=>{const a=[];let u=0,h=0,g=0,v;for(let y=0;yg?v-g:void 0;return{modifiers:a,hasImportantModifier:n,baseClassName:l,maybePostfixModifierPosition:c}};if(r){const s=r+ke,a=o;o=u=>u.startsWith(s)?a(u.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:u,maybePostfixModifierPosition:void 0}}if(t){const s=o;o=a=>t({className:a,parseClassName:s})}return o},Mt=e=>e.endsWith(xe)?e.substring(0,e.length-1):e.startsWith(xe)?e.substring(1):e,qt=e=>{const r=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const s=[];let a=[];return o.forEach(u=>{u[0]==="["||r[u]?(s.push(...a.sort(),u),a=[]):a.push(u)}),s.push(...a.sort()),s}},Vt=e=>({cache:Lt(e.cacheSize),parseClassName:Tt(e),sortModifiers:qt(e),...Rt(e)}),Ut=/\s+/,Ft=(e,r)=>{const{parseClassName:t,getClassGroupId:o,getConflictingClassGroupIds:s,sortModifiers:a}=r,u=[],h=e.trim().split(Ut);let g="";for(let v=h.length-1;v>=0;v-=1){const d=h[v],{isExternal:l,modifiers:n,hasImportantModifier:c,baseClassName:y,maybePostfixModifierPosition:p}=t(d);if(l){g=d+(g.length>0?" "+g:g);continue}let O=!!p,S=o(O?y.substring(0,p):y);if(!S){if(!O){g=d+(g.length>0?" "+g:g);continue}if(S=o(y),!S){g=d+(g.length>0?" "+g:g);continue}O=!1}const _=a(n).join(":"),j=c?_+xe:_,D=j+S;if(u.includes(D))continue;u.push(D);const U=s(S,O);for(let J=0;J0?" "+g:g)}return g};function Gt(){let e=0,r,t,o="";for(;e{if(typeof e=="string")return e;let r,t="";for(let o=0;ol(d),e());return t=Vt(v),o=t.cache.get,s=t.cache.set,a=h,h(g)}function h(g){const v=o(g);if(v)return v;const d=Ft(g,t);return s(g,d),d}return function(){return a(Gt.apply(null,arguments))}}const R=e=>{const r=t=>t[e]||[];return r.isThemeGetter=!0,r},Xe=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,et=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Jt=/^\d+\/\d+$/,Qt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ht=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Wt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Kt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,K=e=>Jt.test(e),x=e=>!!e&&!Number.isNaN(Number(e)),G=e=>!!e&&Number.isInteger(Number(e)),he=e=>e.endsWith("%")&&x(e.slice(0,-1)),q=e=>Qt.test(e),$t=()=>!0,Yt=e=>Ht.test(e)&&!Wt.test(e),tt=()=>!1,Xt=e=>Kt.test(e),er=e=>Zt.test(e),tr=e=>!m(e)&&!f(e),rr=e=>$(e,st,tt),m=e=>Xe.test(e),H=e=>$(e,at,Yt),be=e=>$(e,ir,x),Fe=e=>$(e,rt,tt),or=e=>$(e,ot,er),ce=e=>$(e,nt,Xt),f=e=>et.test(e),ee=e=>Y(e,at),sr=e=>Y(e,lr),Ge=e=>Y(e,rt),ar=e=>Y(e,st),nr=e=>Y(e,ot),de=e=>Y(e,nt,!0),$=(e,r,t)=>{const o=Xe.exec(e);return o?o[1]?r(o[1]):t(o[2]):!1},Y=(e,r,t=!1)=>{const o=et.exec(e);return o?o[1]?r(o[1]):t:!1},rt=e=>e==="position"||e==="percentage",ot=e=>e==="image"||e==="url",st=e=>e==="length"||e==="size"||e==="bg-size",at=e=>e==="length",ir=e=>e==="number",lr=e=>e==="family-name",nt=e=>e==="shadow",cr=()=>{const e=R("color"),r=R("font"),t=R("text"),o=R("font-weight"),s=R("tracking"),a=R("leading"),u=R("breakpoint"),h=R("container"),g=R("spacing"),v=R("radius"),d=R("shadow"),l=R("inset-shadow"),n=R("text-shadow"),c=R("drop-shadow"),y=R("blur"),p=R("perspective"),O=R("aspect"),S=R("ease"),_=R("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],U=()=>[...D(),f,m],J=()=>["auto","hidden","clip","visible","scroll"],X=()=>["auto","contain","none"],w=()=>[f,m,g],T=()=>[K,"full","auto",...w()],Ee=()=>[G,"none","subgrid",f,m],Ie=()=>["auto",{span:["full",G,f,m]},G,f,m],oe=()=>[G,"auto",f,m],je=()=>["auto","min","max","fr",f,m],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...w()],Q=()=>[K,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],b=()=>[e,f,m],Re=()=>[...D(),Ge,Fe,{position:[f,m]}],Pe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Ne=()=>["auto","cover","contain",ar,rr,{size:[f,m]}],pe=()=>[he,ee,H],N=()=>["","none","full",v,f,m],z=()=>["",x,ee,H],se=()=>["solid","dashed","dotted","double"],ze=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>[x,he,Ge,Fe],Le=()=>["","none",y,f,m],ae=()=>["none",x,f,m],ne=()=>["none",x,f,m],ge=()=>[x,f,m],ie=()=>[K,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[q],breakpoint:[q],color:[$t],container:[q],"drop-shadow":[q],ease:["in","out","in-out"],font:[tr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[q],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[q],shadow:[q],spacing:["px",x],text:[q],"text-shadow":[q],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",K,m,f,O]}],container:["container"],columns:[{columns:[x,m,f,h]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:U()}],overflow:[{overflow:J()}],"overflow-x":[{"overflow-x":J()}],"overflow-y":[{"overflow-y":J()}],overscroll:[{overscroll:X()}],"overscroll-x":[{"overscroll-x":X()}],"overscroll-y":[{"overscroll-y":X()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{start:T()}],end:[{end:T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[G,"auto",f,m]}],basis:[{basis:[K,"full","auto",h,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[x,K,"auto","initial","none",m]}],grow:[{grow:["",x,f,m]}],shrink:[{shrink:["",x,f,m]}],order:[{order:[G,"first","last","none",f,m]}],"grid-cols":[{"grid-cols":Ee()}],"col-start-end":[{col:Ie()}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":Ee()}],"row-start-end":[{row:Ie()}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":je()}],"auto-rows":[{"auto-rows":je()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],w:[{w:[h,"screen",...Q()]}],"min-w":[{"min-w":[h,"screen","none",...Q()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[u]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",t,ee,H]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,f,be]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",he,m]}],"font-family":[{font:[sr,m,r]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,f,m]}],"line-clamp":[{"line-clamp":[x,"none",f,be]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":["none",f,m]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",f,m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:b()}],"text-color":[{text:b()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[x,"from-font","auto",f,H]}],"text-decoration-color":[{decoration:b()}],"underline-offset":[{"underline-offset":[x,"auto",f,m]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",f,m]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",f,m]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Re()}],"bg-repeat":[{bg:Pe()}],"bg-size":[{bg:Ne()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},G,f,m],radial:["",f,m],conic:[G,f,m]},nr,or]}],"bg-color":[{bg:b()}],"gradient-from-pos":[{from:pe()}],"gradient-via-pos":[{via:pe()}],"gradient-to-pos":[{to:pe()}],"gradient-from":[{from:b()}],"gradient-via":[{via:b()}],"gradient-to":[{to:b()}],rounded:[{rounded:N()}],"rounded-s":[{"rounded-s":N()}],"rounded-e":[{"rounded-e":N()}],"rounded-t":[{"rounded-t":N()}],"rounded-r":[{"rounded-r":N()}],"rounded-b":[{"rounded-b":N()}],"rounded-l":[{"rounded-l":N()}],"rounded-ss":[{"rounded-ss":N()}],"rounded-se":[{"rounded-se":N()}],"rounded-ee":[{"rounded-ee":N()}],"rounded-es":[{"rounded-es":N()}],"rounded-tl":[{"rounded-tl":N()}],"rounded-tr":[{"rounded-tr":N()}],"rounded-br":[{"rounded-br":N()}],"rounded-bl":[{"rounded-bl":N()}],"border-w":[{border:z()}],"border-w-x":[{"border-x":z()}],"border-w-y":[{"border-y":z()}],"border-w-s":[{"border-s":z()}],"border-w-e":[{"border-e":z()}],"border-w-t":[{"border-t":z()}],"border-w-r":[{"border-r":z()}],"border-w-b":[{"border-b":z()}],"border-w-l":[{"border-l":z()}],"divide-x":[{"divide-x":z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:b()}],"border-color-x":[{"border-x":b()}],"border-color-y":[{"border-y":b()}],"border-color-s":[{"border-s":b()}],"border-color-e":[{"border-e":b()}],"border-color-t":[{"border-t":b()}],"border-color-r":[{"border-r":b()}],"border-color-b":[{"border-b":b()}],"border-color-l":[{"border-l":b()}],"divide-color":[{divide:b()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[x,f,m]}],"outline-w":[{outline:["",x,ee,H]}],"outline-color":[{outline:b()}],shadow:[{shadow:["","none",d,de,ce]}],"shadow-color":[{shadow:b()}],"inset-shadow":[{"inset-shadow":["none",l,de,ce]}],"inset-shadow-color":[{"inset-shadow":b()}],"ring-w":[{ring:z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:b()}],"ring-offset-w":[{"ring-offset":[x,H]}],"ring-offset-color":[{"ring-offset":b()}],"inset-ring-w":[{"inset-ring":z()}],"inset-ring-color":[{"inset-ring":b()}],"text-shadow":[{"text-shadow":["none",n,de,ce]}],"text-shadow-color":[{"text-shadow":b()}],opacity:[{opacity:[x,f,m]}],"mix-blend":[{"mix-blend":[...ze(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ze()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[x]}],"mask-image-linear-from-pos":[{"mask-linear-from":P()}],"mask-image-linear-to-pos":[{"mask-linear-to":P()}],"mask-image-linear-from-color":[{"mask-linear-from":b()}],"mask-image-linear-to-color":[{"mask-linear-to":b()}],"mask-image-t-from-pos":[{"mask-t-from":P()}],"mask-image-t-to-pos":[{"mask-t-to":P()}],"mask-image-t-from-color":[{"mask-t-from":b()}],"mask-image-t-to-color":[{"mask-t-to":b()}],"mask-image-r-from-pos":[{"mask-r-from":P()}],"mask-image-r-to-pos":[{"mask-r-to":P()}],"mask-image-r-from-color":[{"mask-r-from":b()}],"mask-image-r-to-color":[{"mask-r-to":b()}],"mask-image-b-from-pos":[{"mask-b-from":P()}],"mask-image-b-to-pos":[{"mask-b-to":P()}],"mask-image-b-from-color":[{"mask-b-from":b()}],"mask-image-b-to-color":[{"mask-b-to":b()}],"mask-image-l-from-pos":[{"mask-l-from":P()}],"mask-image-l-to-pos":[{"mask-l-to":P()}],"mask-image-l-from-color":[{"mask-l-from":b()}],"mask-image-l-to-color":[{"mask-l-to":b()}],"mask-image-x-from-pos":[{"mask-x-from":P()}],"mask-image-x-to-pos":[{"mask-x-to":P()}],"mask-image-x-from-color":[{"mask-x-from":b()}],"mask-image-x-to-color":[{"mask-x-to":b()}],"mask-image-y-from-pos":[{"mask-y-from":P()}],"mask-image-y-to-pos":[{"mask-y-to":P()}],"mask-image-y-from-color":[{"mask-y-from":b()}],"mask-image-y-to-color":[{"mask-y-to":b()}],"mask-image-radial":[{"mask-radial":[f,m]}],"mask-image-radial-from-pos":[{"mask-radial-from":P()}],"mask-image-radial-to-pos":[{"mask-radial-to":P()}],"mask-image-radial-from-color":[{"mask-radial-from":b()}],"mask-image-radial-to-color":[{"mask-radial-to":b()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":D()}],"mask-image-conic-pos":[{"mask-conic":[x]}],"mask-image-conic-from-pos":[{"mask-conic-from":P()}],"mask-image-conic-to-pos":[{"mask-conic-to":P()}],"mask-image-conic-from-color":[{"mask-conic-from":b()}],"mask-image-conic-to-color":[{"mask-conic-to":b()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Re()}],"mask-repeat":[{mask:Pe()}],"mask-size":[{mask:Ne()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",f,m]}],filter:[{filter:["","none",f,m]}],blur:[{blur:Le()}],brightness:[{brightness:[x,f,m]}],contrast:[{contrast:[x,f,m]}],"drop-shadow":[{"drop-shadow":["","none",c,de,ce]}],"drop-shadow-color":[{"drop-shadow":b()}],grayscale:[{grayscale:["",x,f,m]}],"hue-rotate":[{"hue-rotate":[x,f,m]}],invert:[{invert:["",x,f,m]}],saturate:[{saturate:[x,f,m]}],sepia:[{sepia:["",x,f,m]}],"backdrop-filter":[{"backdrop-filter":["","none",f,m]}],"backdrop-blur":[{"backdrop-blur":Le()}],"backdrop-brightness":[{"backdrop-brightness":[x,f,m]}],"backdrop-contrast":[{"backdrop-contrast":[x,f,m]}],"backdrop-grayscale":[{"backdrop-grayscale":["",x,f,m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[x,f,m]}],"backdrop-invert":[{"backdrop-invert":["",x,f,m]}],"backdrop-opacity":[{"backdrop-opacity":[x,f,m]}],"backdrop-saturate":[{"backdrop-saturate":[x,f,m]}],"backdrop-sepia":[{"backdrop-sepia":["",x,f,m]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",f,m]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[x,"initial",f,m]}],ease:[{ease:["linear","initial",S,f,m]}],delay:[{delay:[x,f,m]}],animate:[{animate:["none",_,f,m]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,f,m]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:ne()}],"scale-x":[{"scale-x":ne()}],"scale-y":[{"scale-y":ne()}],"scale-z":[{"scale-z":ne()}],"scale-3d":["scale-3d"],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[f,m,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ie()}],"translate-x":[{"translate-x":ie()}],"translate-y":[{"translate-y":ie()}],"translate-z":[{"translate-z":ie()}],"translate-none":["translate-none"],accent:[{accent:b()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:b()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",f,m]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",f,m]}],fill:[{fill:["none",...b()]}],"stroke-w":[{stroke:[x,ee,H,be]}],stroke:[{stroke:["none",...b()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},dr=Bt(cr);function Be(...e){return dr(jt(e))}const ur=[{path:"/",label:"Início",icon:Ke},{path:"/cadastros/obras",label:"Obras",icon:wt},{path:"/rdo/novo",label:"Adicionar",icon:vt,isCentral:!0},{path:"/obra/1/tarefas",label:"Tarefas",icon:xt},{path:"/reports",label:"Relatórios",icon:kt}];function mr(){const e=We();return i.jsx("div",{className:"fixed bottom-0 left-0 right-0 h-20 bg-white/80 dark:bg-gray-900/80 backdrop-blur-lg border-t border-gray-200/80 dark:border-gray-700/80 z-50",children:i.jsx("div",{className:"flex justify-around items-center h-full max-w-lg mx-auto",children:ur.map(r=>{const t=e.pathname===r.path,o=r.icon;return r.isCentral?i.jsx(De,{to:r.path,className:"-mt-8",children:i.jsx(Me.div,{whileHover:{scale:1.1},whileTap:{scale:.9},className:"w-16 h-16 bg-blue-600 rounded-full flex items-center justify-center text-white shadow-lg shadow-blue-500/50",children:i.jsx(o,{className:"w-8 h-8"})})},r.path):i.jsxs(De,{to:r.path,className:"flex flex-col items-center justify-center w-16 h-16",children:[i.jsxs("div",{className:"relative",children:[i.jsx(o,{className:Be("w-6 h-6 transition-colors",t?"text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400")}),t&&i.jsx(Me.div,{layoutId:"active-indicator",className:"absolute -bottom-2 left-1/2 -translate-x-1/2 w-1 h-1 bg-blue-600 rounded-full"})]}),i.jsx("span",{className:Be("text-xs mt-1 transition-colors",t?"text-blue-600 dark:text-blue-400":"text-gray-600 dark:text-gray-400"),children:r.label})]},r.path)})})})}function fr({children:e}){return i.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900 w-full overflow-x-hidden",children:[i.jsx("main",{className:"pb-24",children:e}),i.jsx(mr,{})]})}const pr="https://ympbgdymeesivfajmgat.supabase.co",gr="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InltcGJnZHltZWVzaXZmYWptZ2F0Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjUwNjA3MDYsImV4cCI6MjA4MDYzNjcwNn0.TOU2ol_Y2wtipSflHTwHU5QmKriDRF3JeqAzA5gqc9c",E=Ct(pr,gr,{auth:{autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"pkce"},realtime:{params:{eventsPerSecond:10}},global:{headers:{"X-Client-Info":"rdo-mobile-app"}}}),hr=()=>{const[e,r]=k.useState({user:null,session:null,loading:!0,error:null});k.useEffect(()=>{(async()=>{try{const{data:{session:c},error:y}=await E.auth.getSession();if(y)throw y;r({user:c?.user??null,session:c,loading:!1,error:null})}catch(c){r({user:null,session:null,loading:!1,error:c.message})}})();const{data:{subscription:n}}=E.auth.onAuthStateChange(async(c,y)=>{r({user:y?.user??null,session:y,loading:!1,error:null}),c==="SIGNED_IN"&&y?.user&&await t(y.user)});return()=>n.unsubscribe()},[]);const t=async l=>{try{const{data:n,error:c}=await E.from("usuarios").select("*").eq("email",l.email).single();if(c&&c.code!=="PGRST116")return;if(!n){const{error:y}=await E.from("usuarios").insert({id:l.id,email:l.email,nome:l.user_metadata?.full_name||l.user_metadata?.nome||l.email?.split("@")[0]||"Usuário",ativo:!0})}}catch{}},o=async l=>{try{r(y=>({...y,loading:!0,error:null}));const{data:n,error:c}=await E.auth.signInWithPassword({email:l.email,password:l.password});if(c)throw c;if(n.user){const{useUserStore:y}=await I(async()=>{const{useUserStore:p}=await import("./useUserStore-VOdYc7Zm.js");return{useUserStore:p}},__vite__mapDeps([0,1,2,3,4,5,6]));await y.getState().fetchCurrentUser(n.user.id)}return{success:!0,data:n}}catch(n){const c=Z(n);return r(y=>({...y,loading:!1,error:c})),{success:!1,error:c}}},s=async l=>{try{r(y=>({...y,loading:!0,error:null}));const{data:n,error:c}=await E.auth.signUp({email:l.email,password:l.password,options:{data:{nome:l.nome,cpf:l.cpf,telefone:l.telefone}}});if(c)throw c;return{success:!0,data:n}}catch(n){const c=Z(n);return r(y=>({...y,loading:!1,error:c})),{success:!1,error:c}}},a=async()=>{try{r(n=>({...n,loading:!0,error:null}));const{error:l}=await E.auth.signOut();if(l)throw l;return{success:!0}}catch(l){const n=Z(l);return r(c=>({...c,loading:!1,error:n})),{success:!1,error:n}}},u=async l=>{try{const{error:n}=await E.auth.resetPasswordForEmail(l,{redirectTo:`${window.location.origin}/reset-password`});if(n)throw n;return{success:!0}}catch(n){return{success:!1,error:Z(n)}}},h=async l=>{try{const{error:n}=await E.auth.updateUser({password:l});if(n)throw n;return{success:!0}}catch(n){return{success:!1,error:Z(n)}}},g=async l=>{try{if(!e.user)throw new Error("Usuário não autenticado");const{error:n}=await E.auth.updateUser({data:l});if(n)throw n;const{error:c}=await E.from("usuarios").update(l).eq("id",e.user.id);if(c)throw c;return{success:!0}}catch(n){return{success:!1,error:Z(n)}}},v=()=>{r(l=>({...l,error:null}))},d=async()=>{try{r(c=>({...c,loading:!0,error:null}));const l={id:"bypass-user-"+Date.now(),email:"bypass@desenvolvimento.com",user_metadata:{nome:"Usuário Bypass"},aud:"authenticated",role:"authenticated"},n={access_token:"mock-token",refresh_token:"mock-refresh",expires_in:3600,token_type:"bearer",user:l};return r({user:l,session:n,loading:!1,error:null}),{success:!0,data:{user:l,session:n}}}catch{return r(n=>({...n,loading:!1,error:"Erro no bypass"})),{success:!1,error:"Erro no bypass"}}};return{user:e.user,session:e.session,loading:e.loading,error:e.error,isAuthenticated:!!e.user,login:o,register:s,logout:a,resetPassword:u,updatePassword:h,updateProfile:g,clearError:v,bypassLogin:d}},Z=e=>{if("message"in e)switch(e.message){case"Invalid login credentials":return"Credenciais de login inválidas";case"Email not confirmed":return"Email não confirmado. Verifique sua caixa de entrada";case"User already registered":return"Usuário já cadastrado com este email";case"Password should be at least 6 characters":return"A senha deve ter pelo menos 6 caracteres";case"Unable to validate email address: invalid format":return"Formato de email inválido";case"Email rate limit exceeded":return"Limite de emails excedido. Tente novamente mais tarde";default:return e.message}return"Erro desconhecido"},it=k.createContext(void 0),br=({children:e})=>{const r=hr();return i.jsx(it.Provider,{value:r,children:e})},yr=()=>{const e=k.useContext(it);if(e===void 0)throw new Error("useAuthContext deve ser usado dentro de um AuthProvider");return e},wr=({children:e,requireAuth:r=!0,redirectTo:t="/login"})=>{const{isAuthenticated:o,loading:s}=yr(),a=We();if(s)return i.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"}),i.jsx("p",{className:"text-gray-600",children:"Verificando autenticação..."})]})});if(r&&!o)return i.jsx(Te,{to:t,state:{from:a},replace:!0});const h=["/auth/callback","/selecionar-organizacao"].includes(a.pathname);if(!r&&o&&!h){const g=a.state?.from?.pathname||"/dashboard";return i.jsx(Te,{to:g,replace:!0})}return i.jsx(i.Fragment,{children:e})},vr={queries:{staleTime:600*1e3,gcTime:900*1e3,retry:(e,r)=>r?.status===401||r?.status===403?!1:e<3,retryDelay:e=>Math.min(1e3*2**e,3e4),refetchOnWindowFocus:!0,refetchOnReconnect:!0,refetchOnMount:!1,networkMode:"offlineFirst"},mutations:{retry:1,retryDelay:1e3,networkMode:"online"}},xr=()=>new mt({defaultOptions:vr}),L=xr(),A={users:{all:["users"],lists:()=>[...A.users.all,"list"],list:e=>[...A.users.lists(),{filters:e}],details:()=>[...A.users.all,"detail"],detail:e=>[...A.users.details(),e],profile:()=>[...A.users.all,"profile"]},obras:{all:["obras"],lists:()=>[...A.obras.all,"list"],list:e=>[...A.obras.lists(),{filters:e}],details:()=>[...A.obras.all,"detail"],detail:e=>[...A.obras.details(),e],byUser:e=>[...A.obras.all,"byUser",e]},rdos:{all:["rdos"],lists:()=>[...A.rdos.all,"list"],list:e=>[...A.rdos.lists(),{filters:e}],details:()=>[...A.rdos.all,"detail"],detail:e=>[...A.rdos.details(),e],byObra:e=>[...A.rdos.all,"byObra",e],byUser:e=>[...A.rdos.all,"byUser",e]},reports:{all:["reports"]}},kr={users:()=>L.invalidateQueries({queryKey:A.users.all}),user:e=>L.invalidateQueries({queryKey:A.users.detail(e)}),obras:()=>L.invalidateQueries({queryKey:A.obras.all}),obra:e=>L.invalidateQueries({queryKey:A.obras.detail(e)}),rdos:()=>L.invalidateQueries({queryKey:A.rdos.all}),rdo:e=>L.invalidateQueries({queryKey:A.rdos.detail(e)}),rdosByObra:e=>L.invalidateQueries({queryKey:A.rdos.byObra(e)}),reports:()=>L.invalidateQueries({queryKey:A.reports.all}),all:()=>L.invalidateQueries()};function Sr(){return k.useEffect(()=>{const e=L.getQueryCache().subscribe(t=>{}),r=L.getMutationCache().subscribe(t=>{});return()=>{e(),r()}},[]),null}const _r=({children:e})=>i.jsxs(ft,{client:L,children:[i.jsx(Sr,{}),e]});class Cr extends Ot{constructor(){super("RDOOfflineDB");F(this,"usuarios");F(this,"obras");F(this,"rdos");F(this,"pendingOperations");F(this,"offlineConfig");this.version(1).stores({usuarios:"++id, email, nome, tipo, ativo, created_at, updated_at, _lastSync, _pendingSync, _deleted",obras:"++id, nome, descricao, endereco, status, usuario_responsavel_id, created_at, updated_at, _lastSync, _pendingSync, _deleted",rdos:"++id, obra_id, usuario_id, data, turno, atividades, observacoes, status, created_at, updated_at, _lastSync, _pendingSync, _deleted",pendingOperations:"++id, table, operation, timestamp, retryCount",offlineConfig:"++id, key, updatedAt"})}}const C=new Cr;class V{static isOffline(){return!navigator.onLine}static async cacheData(r,t){try{const o=Date.now(),s=t.map(a=>({...a,_lastSync:o,_pendingSync:!1,_deleted:!1}));await C[r].clear(),await C[r].clear(),await C[r].bulkAdd(s)}catch{}}static async getCachedData(r,t){try{const s=await C[r].where("_deleted").notEqual(1).toArray();return t?s.filter(t):s}catch{return[]}}static async addPendingOperation(r,t,o){try{await C.pendingOperations.add({table:r,operation:t,data:o,timestamp:Date.now(),retryCount:0})}catch{}}static async getPendingOperations(){try{return await C.pendingOperations.orderBy("timestamp").toArray()}catch{return[]}}static async removePendingOperation(r){try{await C.pendingOperations.delete(r)}catch{}}static async markOperationError(r,t){try{await C.pendingOperations.update(r,{error:t,retryCount:await C.pendingOperations.get(r).then(o=>(o?.retryCount||0)+1)})}catch{}}static async setConfig(r,t){try{const o=await C.offlineConfig.where("key").equals(r).first();o?await C.offlineConfig.update(o.id,{value:t,updatedAt:Date.now()}):await C.offlineConfig.add({key:r,value:t,updatedAt:Date.now()})}catch(o){throw o}}static async getConfig(r){try{return(await C.offlineConfig.where("key").equals(r).first())?.value}catch{return null}}static async cleanOldData(){try{const r=Date.now()-2592e6;await C.pendingOperations.where("retryCount").above(5).delete(),await C.offlineConfig.where("updatedAt").below(r).delete()}catch{}}static async getCacheStats(){try{const[r,t,o,s,a]=await Promise.all([C.usuarios.count(),C.obras.count(),C.rdos.count(),C.pendingOperations.count(),this.getConfig("lastFullSync")]);return{usuarios:r,obras:t,rdos:o,pendingOperations:s,lastSync:a}}catch{return{usuarios:0,obras:0,rdos:0,pendingOperations:0}}}static async clearCache(){try{await Promise.all([C.usuarios.clear(),C.obras.clear(),C.rdos.clear(),C.pendingOperations.clear(),C.offlineConfig.clear()])}catch{}}}C.open().catch(e=>{});const Or=()=>{const[e,r]=k.useState(navigator.onLine),[t,o]=k.useState(!1),[s,a]=k.useState([]);pt(),k.useEffect(()=>{const d=()=>{r(!0),h()},l=()=>{r(!1)};return window.addEventListener("online",d),window.addEventListener("offline",l),()=>{window.removeEventListener("online",d),window.removeEventListener("offline",l)}},[]);const u=k.useCallback(async()=>{const d=await V.getPendingOperations();a(d)},[]),h=k.useCallback(async()=>{if(!(!e||t)){o(!0);try{const d=await V.getPendingOperations();for(const l of d)try{await g(l),await V.removePendingOperation(l.id)}catch(n){await V.markOperationError(l.id,n instanceof Error?n.message:"Unknown error")}await u(),kr.all()}catch{}finally{o(!1)}}},[e,t]),g=async d=>{const{table:l,operation:n,data:c}=d;switch(l){case"usuarios":if(n==="create")await E.from("usuarios").insert(c);else if(n==="update"){const{id:y,...p}=c;await E.from("usuarios").update(p).eq("id",y)}else n==="delete"&&await E.from("usuarios").delete().eq("id",c.id);break;case"obras":if(n==="create")await E.from("obras").insert(c);else if(n==="update"){const{id:y,...p}=c;await E.from("obras").update(p).eq("id",y)}else n==="delete"&&await E.from("obras").delete().eq("id",c.id);break;case"rdos":if(n==="create")await E.from("rdos").insert(c);else if(n==="update"){const{id:y,...p}=c;await E.from("rdos").update(p).eq("id",y)}else n==="delete"&&await E.from("rdos").delete().eq("id",c.id);break}},v=k.useCallback(async()=>{if(e)try{const{data:d}=await E.from("usuarios").select("*").eq("ativo",!0);d&&await V.cacheData("usuarios",d);const{data:l}=await E.from("obras").select("*");l&&await V.cacheData("obras",l);const n=new Date;n.setDate(n.getDate()-30);const{data:c}=await E.from("rdos").select("*").gte("created_at",n.toISOString());c&&await V.cacheData("rdos",c),await V.setConfig("lastFullSync",Date.now())}catch{}},[e]);return k.useEffect(()=>{u(),e&&v()},[u,v,e]),{isOnline:e,isSyncing:t,pendingOperations:s,syncPendingOperations:h,cacheDataForOffline:v,loadPendingOperations:u}},Ar=k.createContext(void 0),Er=({children:e,showNotifications:r=!0})=>{const{isOnline:t,isSyncing:o,pendingOperations:s,syncPendingOperations:a,cacheDataForOffline:u}=Or(),[h,g]=k.useState(!1),[v,d]=k.useState(!1);k.useEffect(()=>{!t&&!v?(d(!0),g(!0)):t&&v&&s.length>0&&g(!0)},[t,v,s.length]),k.useEffect(()=>{const c=setInterval(async()=>{await V.cleanOldData()},864e5);return()=>clearInterval(c)},[]),k.useEffect(()=>{if(t&&s.length>0&&!o){const c=setTimeout(()=>{a()},2e3);return()=>clearTimeout(c)}},[t,s.length,o,a]);const l=()=>{g(!1)},n={isOnline:t,isSyncing:o,pendingOperationsCount:s.length,syncPendingOperations:a,cacheDataForOffline:u,showOfflineNotification:h,dismissOfflineNotification:l};return i.jsxs(Ar.Provider,{value:n,children:[e,r&&i.jsxs(i.Fragment,{children:[h&&i.jsx("div",{className:"fixed top-4 right-4 z-50 max-w-sm",children:i.jsx("div",{className:"bg-white rounded-lg shadow-lg border border-gray-200 p-4",children:i.jsx("div",{className:"flex items-start justify-between",children:i.jsx("div",{className:"flex-1",children:t?s.length>0?i.jsx(ye,{type:"sync",pendingCount:s.length,isSyncing:o,onSync:a,onDismiss:l}):i.jsx(ye,{type:"synced",onDismiss:l}):i.jsx(ye,{type:"offline",onDismiss:l})})})})}),!t&&i.jsx("div",{className:"fixed top-0 left-0 right-0 z-40 bg-orange-500 text-white px-4 py-2",children:i.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm",children:[i.jsx("div",{className:"w-2 h-2 bg-white rounded-full animate-pulse"}),i.jsx("span",{children:"Modo offline ativo - Suas alterações serão sincronizadas quando a conexão for restaurada"})]})})]})]})},ye=({type:e,pendingCount:r=0,isSyncing:t=!1,onSync:o,onDismiss:s})=>{k.useEffect(()=>{if(e==="synced"){const n=setTimeout(s,3e3);return()=>clearTimeout(n)}},[e,s]);const a=()=>{switch(e){case"offline":return{title:"Modo Offline",message:"Você está trabalhando offline. Suas alterações serão salvas localmente.",color:"orange",showDismiss:!0};case"sync":return{title:"Sincronização Pendente",message:`${r} operação(ões) aguardando sincronização.`,color:"blue",showDismiss:!0,showSyncButton:!0};case"synced":return{title:"Sincronizado",message:"Todas as alterações foram sincronizadas com sucesso.",color:"green",showDismiss:!1};default:return{title:"",message:"",color:"gray",showDismiss:!0}}},{title:u,message:h,color:g,showDismiss:v,showSyncButton:d}=a(),l={orange:"text-orange-800 bg-orange-50 border-orange-200",blue:"text-blue-800 bg-blue-50 border-blue-200",green:"text-green-800 bg-green-50 border-green-200",gray:"text-gray-800 bg-gray-50 border-gray-200"};return i.jsx("div",{className:`p-3 rounded-lg border ${l[g]}`,children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("h4",{className:"font-medium text-sm",children:u}),i.jsx("p",{className:"text-xs mt-1 opacity-90",children:h}),d&&i.jsx("div",{className:"mt-2 flex gap-2",children:i.jsx("button",{onClick:o,disabled:t,className:"px-3 py-1 text-xs bg-blue-600 text-white rounded hover:bg-blue-700 disabled:bg-blue-400 disabled:cursor-not-allowed",children:t?"Sincronizando...":"Sincronizar Agora"})})]}),v&&i.jsx("button",{onClick:s,className:"ml-2 text-gray-400 hover:text-gray-600",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})},Se=k.lazy(()=>I(()=>import("./Dashboard-BPPxBqO4.js"),__vite__mapDeps([7,4,3,2,8,5]))),Je=k.lazy(()=>I(()=>import("./Cadastros-QZZ_REjv.js"),__vite__mapDeps([9,4,3,2,8,5]))),_e=k.lazy(()=>I(()=>import("./CreateRDO-Bhe5_7xI.js"),__vite__mapDeps([10,4,3,2,11,12,5,8,13,1,6]))),lt=k.lazy(()=>I(()=>import("./ObraDetails-S1VcIvXW.js"),__vite__mapDeps([14,4,3,2,8,5]))),Ir=k.lazy(()=>I(()=>import("./RDODetails-tkR9ftO-.js"),__vite__mapDeps([15,4,3,2,8,5,6,1]))),jr=k.lazy(()=>I(()=>import("./Configuracoes-LYuviA0-.js"),__vite__mapDeps([16,4,3,2,8,5,13,1,17,0,6]))),Rr=k.lazy(()=>I(()=>import("./ObraTasks-Cy-rxhIo.js"),__vite__mapDeps([18,4,3,2,8,5]))),Pr=k.lazy(()=>I(()=>import("./CreateTask-BlEDuvPM.js"),__vite__mapDeps([19,4,3,2,8,5]))),Nr=k.lazy(()=>I(()=>import("./ManualInstrucoes-G3xr1xLl.js"),__vite__mapDeps([20,4,3,2,8,5]))),zr=k.lazy(()=>I(()=>import("./Reports-BmqmPZPj.js"),__vite__mapDeps([21,4,3,2,8,5]))),Lr=k.lazy(()=>I(()=>import("./DatabaseTest-BA9LjsoE.js"),__vite__mapDeps([22,4,3,2,5,6,1]))),me=k.lazy(()=>I(()=>import("./Auth-KZISTjMo.js"),__vite__mapDeps([23,4,3,2,24,5,6,1]))),Dr=k.lazy(()=>I(()=>import("./CreateObra-BwwQt_hK.js"),__vite__mapDeps([25,4,3,2,11,12,5,8,0,1,6]))),Tr=k.lazy(()=>I(()=>import("./AuthCallback-DlZVcD4W.js"),__vite__mapDeps([26,4,3,2,5,6,1])).then(e=>({default:e.AuthCallback}))),Mr=k.lazy(()=>I(()=>import("./SelectOrganization-Cb4zDKko.js"),__vite__mapDeps([27,4,3,2,17,24,5,6,1]))),B=[{path:"/login",component:me,requireAuth:!1,useLayout:!1,title:"Login",description:"Página de login do sistema RDO",preload:!0,category:"auth"},{path:"/register",component:me,requireAuth:!1,useLayout:!1,title:"Cadastro",description:"Página de cadastro de usuário",preload:!1,category:"auth"},{path:"/cadastro",component:me,requireAuth:!1,useLayout:!1,title:"Cadastro",description:"Página de cadastro de usuário",preload:!1,category:"auth"},{path:"/auth/callback",component:Tr,requireAuth:!1,useLayout:!1,title:"Callback OAuth",description:"Processamento de retorno OAuth",preload:!1,category:"auth"},{path:"/selecionar-organizacao",component:Mr,requireAuth:!1,useLayout:!1,title:"Selecionar Organização",description:"Seleção de organização via código de convite",preload:!1,category:"auth"},{path:"/",component:Se,requireAuth:!0,useLayout:!0,title:"Dashboard",description:"Painel principal do sistema RDO",preload:!0,category:"main"},{path:"/dashboard",component:Se,requireAuth:!0,useLayout:!0,title:"Dashboard",description:"Painel principal do sistema RDO",preload:!0,category:"main"},{path:"/cadastros",component:Je,requireAuth:!0,useLayout:!0,title:"Cadastros",description:"Gerenciamento de cadastros",preload:!1,category:"admin"},{path:"/cadastros/obras",component:Je,requireAuth:!0,useLayout:!0,title:"Cadastro de Obras",description:"Gerenciamento de obras",preload:!1,category:"admin"},{path:"/cadastros/obras/new",component:Dr,requireAuth:!0,useLayout:!1,title:"Nova Obra",description:"Cadastro de nova obra",preload:!1,category:"admin"},{path:"/reports",component:zr,requireAuth:!0,useLayout:!0,title:"Relatórios",description:"Relatórios e análises do sistema",preload:!1,category:"admin"},{path:"/database-test",component:Lr,requireAuth:!0,useLayout:!0,title:"Teste de Banco",description:"Página de teste do banco de dados",preload:!1,category:"admin"},{path:"/obra/:id",component:lt,requireAuth:!0,useLayout:!1,title:"Detalhes da Obra",description:"Visualização detalhada da obra",preload:!0,category:"obra"},{path:"/obra/:id/tarefas",component:Rr,requireAuth:!0,useLayout:!1,title:"Tarefas da Obra",description:"Gerenciamento de tarefas da obra",preload:!1,category:"obra"},{path:"/obra/:id/tarefa/nova",component:Pr,requireAuth:!0,useLayout:!1,title:"Nova Tarefa",description:"Criação de nova tarefa",preload:!1,category:"obra"},{path:"/obra/:id/rdo/novo",component:_e,requireAuth:!0,useLayout:!1,title:"Novo RDO",description:"Criação de novo RDO",preload:!0,category:"obra"},{path:"/obra/:obraId/rdo/:rdoId",component:Ir,requireAuth:!0,useLayout:!1,title:"Detalhes do RDO",description:"Visualização detalhada do RDO",preload:!1,category:"obra"},{path:"/rdo/novo",component:_e,requireAuth:!0,useLayout:!1,title:"Novo RDO",description:"Criação de novo RDO",preload:!0,category:"obra"},{path:"/configuracoes",component:jr,requireAuth:!0,useLayout:!1,title:"Configurações",description:"Configurações do sistema",preload:!1,category:"admin"},{path:"/manual",component:Nr,requireAuth:!0,useLayout:!1,title:"Manual de Instruções",description:"Manual de uso do sistema",preload:!1,category:"admin"}],Ce={findRoute:e=>B.find(r=>r.path===e),getPublicRoutes:()=>B.filter(e=>!e.requireAuth),getProtectedRoutes:()=>B.filter(e=>e.requireAuth),getLayoutRoutes:()=>B.filter(e=>e.useLayout),getFullScreenRoutes:()=>B.filter(e=>e.requireAuth&&!e.useLayout),getPreloadRoutes:()=>B.filter(e=>e.preload),getRoutesByCategory:e=>B.filter(r=>r.category===e),preloadRoutes:async()=>{const r=Ce.getPreloadRoutes().map(t=>t.component===Se?I(()=>import("./Dashboard-BPPxBqO4.js"),__vite__mapDeps([7,4,3,2,8,5])):t.component===_e?I(()=>import("./CreateRDO-Bhe5_7xI.js"),__vite__mapDeps([10,4,3,2,11,12,5,8,13,1,6])):t.component===lt?I(()=>import("./ObraDetails-S1VcIvXW.js"),__vite__mapDeps([14,4,3,2,8,5])):t.component===me?I(()=>import("./Auth-KZISTjMo.js"),__vite__mapDeps([23,4,3,2,24,5,6,1])):Promise.resolve());await Promise.allSettled(r)},generateBreadcrumbs:e=>{const r=Ce.findRoute(e);if(!r)return[];const t=[{label:"Home",path:"/"}];return r.category==="obra"?t.push({label:"Obras",path:"/obras"}):r.category==="admin"&&t.push({label:"Administração",path:"/cadastros"}),t.push({label:r.title||"Página",path:e}),t}},Qe={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_SUPABASE_ANON_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InltcGJnZHltZWVzaXZmYWptZ2F0Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjUwNjA3MDYsImV4cCI6MjA4MDYzNjcwNn0.TOU2ol_Y2wtipSflHTwHU5QmKriDRF3JeqAzA5gqc9c",VITE_SUPABASE_URL:"https://ympbgdymeesivfajmgat.supabase.co"},re=new Map,ue=e=>{const r=re.get(e);return r?Object.fromEntries(Object.entries(r.stores).map(([t,o])=>[t,o.getState()])):{}},qr=(e,r,t)=>{if(e===void 0)return{type:"untracked",connection:r.connect(t)};const o=re.get(t.name);if(o)return{type:"tracked",store:e,...o};const s={connection:r.connect(t),stores:{}};return re.set(t.name,s),{type:"tracked",store:e,...s}},Vr=(e,r)=>{if(r===void 0)return;const t=re.get(e);t&&(delete t.stores[r],Object.keys(t.stores).length===0&&re.delete(e))},Ur=e=>{var r,t;if(!e)return;const o=e.split(` -`),s=o.findIndex(u=>u.includes("api.setState"));if(s<0)return;const a=((r=o[s+1])==null?void 0:r.trim())||"";return(t=/.+ (.+) .+/.exec(a))==null?void 0:t[1]},Fr=(e,r={})=>(t,o,s)=>{const{enabled:a,anonymousActionType:u,store:h,...g}=r;let v;try{v=(a??(Qe?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!v)return e(t,o,s);const{connection:d,...l}=qr(h,v,g);let n=!0;s.setState=((p,O,S)=>{const _=t(p,O);if(!n)return _;const j=S===void 0?{type:u||Ur(new Error().stack)||"anonymous"}:typeof S=="string"?{type:S}:S;return h===void 0?(d?.send(j,o()),_):(d?.send({...j,type:`${h}/${j.type}`},{...ue(g.name),[h]:s.getState()}),_)}),s.devtools={cleanup:()=>{d&&typeof d.unsubscribe=="function"&&d.unsubscribe(),Vr(g.name,h)}};const c=(...p)=>{const O=n;n=!1,t(...p),n=O},y=e(s.setState,o,s);if(l.type==="untracked"?d?.init(y):(l.stores[l.store]=s,d?.init(Object.fromEntries(Object.entries(l.stores).map(([p,O])=>[p,p===l.store?y:O.getState()])))),s.dispatchFromDevtools&&typeof s.dispatch=="function"){let p=!1;const O=s.dispatch;s.dispatch=(...S)=>{(Qe?"production":void 0)!=="production"&&S[0].type==="__setState"&&!p&&(p=!0),O(...S)}}return d.subscribe(p=>{var O;switch(p.type){case"ACTION":return typeof p.payload!="string"?void 0:we(p.payload,S=>{if(S.type==="__setState"){if(h===void 0){c(S.state);return}Object.keys(S.state).length;const _=S.state[h];if(_==null)return;JSON.stringify(s.getState())!==JSON.stringify(_)&&c(_);return}s.dispatchFromDevtools&&typeof s.dispatch=="function"&&s.dispatch(S)});case"DISPATCH":switch(p.payload.type){case"RESET":return c(y),h===void 0?d?.init(s.getState()):d?.init(ue(g.name));case"COMMIT":if(h===void 0){d?.init(s.getState());return}return d?.init(ue(g.name));case"ROLLBACK":return we(p.state,S=>{if(h===void 0){c(S),d?.init(s.getState());return}c(S[h]),d?.init(ue(g.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return we(p.state,S=>{if(h===void 0){c(S);return}JSON.stringify(s.getState())!==JSON.stringify(S[h])&&c(S[h])});case"IMPORT_STATE":{const{nextLiftedState:S}=p.payload,_=(O=S.computedStates.slice(-1)[0])==null?void 0:O.state;if(!_)return;c(h===void 0?_:_[h]),d?.send(null,S);return}case"PAUSE_RECORDING":return n=!n}return}}),y},Gr=Fr,we=(e,r)=>{let t;try{t=JSON.parse(e)}catch{}t!==void 0&&r(t)};function Br(e,r){let t;try{t=e()}catch{return}return{getItem:s=>{var a;const u=g=>g===null?null:JSON.parse(g,void 0),h=(a=t.getItem(s))!=null?a:null;return h instanceof Promise?h.then(u):u(h)},setItem:(s,a)=>t.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>t.removeItem(s)}}const Oe=e=>r=>{try{const t=e(r);return t instanceof Promise?t:{then(o){return Oe(o)(t)},catch(o){return this}}}catch(t){return{then(o){return this},catch(o){return Oe(o)(t)}}}},Jr=(e,r)=>(t,o,s)=>{let a={storage:Br(()=>localStorage),partialize:p=>p,version:0,merge:(p,O)=>({...O,...p}),...r},u=!1;const h=new Set,g=new Set;let v=a.storage;if(!v)return e((...p)=>{t(...p)},o,s);const d=()=>{const p=a.partialize({...o()});return v.setItem(a.name,{state:p,version:a.version})},l=s.setState;s.setState=(p,O)=>(l(p,O),d());const n=e((...p)=>(t(...p),d()),o,s);s.getInitialState=()=>n;let c;const y=()=>{var p,O;if(!v)return;u=!1,h.forEach(_=>{var j;return _((j=o())!=null?j:n)});const S=((O=a.onRehydrateStorage)==null?void 0:O.call(a,(p=o())!=null?p:n))||void 0;return Oe(v.getItem.bind(v))(a.name).then(_=>{if(_)if(typeof _.version=="number"&&_.version!==a.version){if(a.migrate){const j=a.migrate(_.state,_.version);return j instanceof Promise?j.then(D=>[!0,D]):[!0,j]}}else return[!1,_.state];return[!1,void 0]}).then(_=>{var j;const[D,U]=_;if(c=a.merge(U,(j=o())!=null?j:n),t(c,!0),D)return d()}).then(()=>{S?.(c,void 0),c=o(),u=!0,g.forEach(_=>_(c))}).catch(_=>{S?.(void 0,_)})};return s.persist={setOptions:p=>{a={...a,...p},p.storage&&(v=p.storage)},clearStorage:()=>{v?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>y(),hasHydrated:()=>u,onHydrate:p=>(h.add(p),()=>{h.delete(p)}),onFinishHydration:p=>(g.add(p),()=>{g.delete(p)})},a.skipHydration||y(),c||n},Qr=Jr,ct={theme:"system",language:"pt-BR",autoSync:!0,syncInterval:5,offlineMode:!1,notifications:{push:!0,email:!1,sound:!0},display:{density:"comfortable",animations:!0,reducedMotion:!1}},He={isOnline:navigator.onLine,isSyncing:!1,lastSync:null,syncError:null,isLoading:!1,sidebarCollapsed:!1,currentView:"dashboard",notifications:[],settings:ct,filters:{users:{},obras:{},tasks:{},rdos:{}}},te=At()(Gr(Qr((e,r)=>({...He,setOnline:t=>e({isOnline:t},!1,"setOnline"),setConnectivity:t=>e({isOnline:t},!1,"setConnectivity"),setSyncing:t=>e({isSyncing:t},!1,"setSyncing"),setLastSync:t=>e({lastSync:t},!1,"setLastSync"),setSyncError:t=>e({syncError:t},!1,"setSyncError"),setLoading:t=>e({isLoading:t},!1,"setLoading"),setSidebarCollapsed:t=>e({sidebarCollapsed:t},!1,"setSidebarCollapsed"),setCurrentView:t=>e({currentView:t},!1,"setCurrentView"),addNotification:t=>{const o={...t,id:crypto.randomUUID(),timestamp:new Date().toISOString(),read:!1};e(s=>({notifications:[o,...s.notifications].slice(0,50)}),!1,"addNotification")},removeNotification:t=>{e(o=>({notifications:o.notifications.filter(s=>s.id!==t)}),!1,"removeNotification")},markNotificationAsRead:t=>{e(o=>({notifications:o.notifications.map(s=>s.id===t?{...s,read:!0}:s)}),!1,"markNotificationAsRead")},clearNotifications:()=>e({notifications:[]},!1,"clearNotifications"),updateSettings:t=>{e(o=>({settings:{...o.settings,...t}}),!1,"updateSettings")},resetSettings:()=>e({settings:ct},!1,"resetSettings"),setFilter:(t,o)=>{e(s=>({filters:{...s.filters,[t]:o}}),!1,"setFilter")},clearFilters:t=>{t?e(o=>({filters:{...o.filters,[t]:{}}}),!1,"clearFilter"):e({filters:{users:{},obras:{},tasks:{},rdos:{}}},!1,"clearAllFilters")},initializeApp:()=>{e({isOnline:navigator.onLine,isLoading:!1,lastSync:null,syncError:null},!1,"initializeApp")},reset:()=>e(He,!1,"reset")}),{name:"app-state-store",partialize:e=>({settings:e.settings,sidebarCollapsed:e.sidebarCollapsed,filters:e.filters})}),{name:"app-state-store"}));typeof window<"u"&&(window.addEventListener("online",()=>{te.getState().setOnline(!0)}),window.addEventListener("offline",()=>{te.getState().setOnline(!1)}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{const{settings:r}=te.getState();r.theme==="system"&&te.getState().updateSettings({theme:"system"})}));class Hr extends k.Component{constructor(t){super(t);F(this,"handleRetry",()=>{this.setState({hasError:!1,error:null,errorInfo:null})});F(this,"handleGoHome",()=>{window.location.href="/"});this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t,errorInfo:null}}componentDidCatch(t,o){this.setState({error:t,errorInfo:o}),this.props.onError&&this.props.onError(t,o)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:i.jsx("div",{className:"min-h-screen bg-gray-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:i.jsx("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:i.jsx("div",{className:"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10",children:i.jsxs("div",{className:"text-center",children:[i.jsx(St,{className:"mx-auto h-12 w-12 text-red-500 mb-4"}),i.jsx("h2",{className:"text-lg font-medium text-gray-900 mb-2",children:"Ops! Algo deu errado"}),i.jsx("p",{className:"text-sm text-gray-600 mb-6",children:"Ocorreu um erro inesperado. Você pode tentar recarregar a página ou voltar ao início."}),!1,i.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[i.jsxs("button",{onClick:this.handleRetry,className:"flex-1 flex justify-center items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[i.jsx(_t,{className:"w-4 h-4 mr-2"}),"Tentar novamente"]}),i.jsxs("button",{onClick:this.handleGoHome,className:"flex-1 flex justify-center items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[i.jsx(Ke,{className:"w-4 h-4 mr-2"}),"Ir para início"]})]})]})})})}):this.props.children}}const Wr=({children:e,fallback:r,onError:t})=>i.jsx(Hr,{fallback:r,onError:t,children:e}),Kr=()=>i.jsx("div",{className:"flex items-center justify-center min-h-screen",children:i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})}),Zr=e=>{const r=e.component,t=i.jsx(k.Suspense,{fallback:i.jsx(Kr,{}),children:i.jsx(wr,{requireAuth:e.requireAuth,children:e.useLayout?i.jsx(fr,{children:i.jsx(r,{})}):i.jsx(r,{})})});return i.jsx(bt,{path:e.path,element:t},e.path)};function $r(){const{initializeApp:e,setConnectivity:r}=te();return k.useEffect(()=>{e();const t=setTimeout(()=>{Ce.preloadRoutes().catch(console.warn)},1e3),o=()=>r(!0),s=()=>r(!1);return window.addEventListener("online",o),window.addEventListener("offline",s),()=>{clearTimeout(t),window.removeEventListener("online",o),window.removeEventListener("offline",s)}},[e,r]),i.jsx(ht,{children:B.map(Zr)})}function Yr(){return i.jsx(Wr,{children:i.jsx(gt,{children:i.jsx(_r,{children:i.jsx(Er,{children:i.jsx(br,{children:i.jsx($r,{})})})})})})}It.createRoot(document.getElementById("root")).render(i.jsx(k.StrictMode,{children:i.jsx(Yr,{})}));export{Gr as d,Qr as p,E as s,yr as u}; diff --git a/dist/assets/js/query-vendor-BLVqILA6.js b/dist/assets/js/query-vendor-BLVqILA6.js deleted file mode 100644 index c94a190..0000000 --- a/dist/assets/js/query-vendor-BLVqILA6.js +++ /dev/null @@ -1,9 +0,0 @@ -var qt=e=>{throw TypeError(e)};var vt=(e,t,s)=>t.has(e)||qt("Cannot "+s);var i=(e,t,s)=>(vt(e,t,"read from private field"),s?s.call(e):t.get(e)),l=(e,t,s)=>t.has(e)?qt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),h=(e,t,s,r)=>(vt(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),w=(e,t,s)=>(vt(e,t,"access private method"),s);var ft=(e,t,s,r)=>({set _(n){h(e,t,n,s)},get _(){return i(e,t,r)}});import{r as Ct}from"./router-vendor-D4by-_6Z.js";import{r as ee}from"./react-vendor-CqRd3GwO.js";var gt={exports:{}},it={};/** - * @license React - * react-jsx-runtime.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Mt;function se(){if(Mt)return it;Mt=1;var e=ee(),t=Symbol.for("react.element"),s=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function c(o,a,d){var f,p={},y=null,S=null;d!==void 0&&(y=""+d),a.key!==void 0&&(y=""+a.key),a.ref!==void 0&&(S=a.ref);for(f in a)r.call(a,f)&&!u.hasOwnProperty(f)&&(p[f]=a[f]);if(o&&o.defaultProps)for(f in a=o.defaultProps,a)p[f]===void 0&&(p[f]=a[f]);return{$$typeof:t,type:o,key:y,ref:S,props:p,_owner:n.current}}return it.Fragment=s,it.jsx=c,it.jsxs=c,it}var Qt;function re(){return Qt||(Qt=1,gt.exports=se()),gt.exports}var ie=re();const ne=(function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"})(),ae=function(e){return"/"+e},At={},je=function(t,s,r){let n=Promise.resolve();if(s&&s.length>0){let c=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=o?.nonce||o?.getAttribute("nonce");n=c(s.map(d=>{if(d=ae(d),d in At)return;At[d]=!0;const f=d.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const y=document.createElement("link");if(y.rel=f?"stylesheet":ne,f||(y.as="script"),y.crossOrigin="",y.href=d,a&&y.setAttribute("nonce",a),document.head.appendChild(y),f)return new Promise((S,b)=>{y.addEventListener("load",S),y.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${d}`)))})}))}function u(c){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=c,window.dispatchEvent(o),!o.defaultPrevented)throw c}return n.then(c=>{for(const o of c||[])o.status==="rejected"&&u(o.reason);return t().catch(u)})};var yt=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},oe={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},I,St,kt,ue=(kt=class{constructor(){l(this,I,oe);l(this,St,!1)}setTimeoutProvider(e){h(this,I,e)}setTimeout(e,t){return i(this,I).setTimeout(e,t)}clearTimeout(e){i(this,I).clearTimeout(e)}setInterval(e,t){return i(this,I).setInterval(e,t)}clearInterval(e){i(this,I).clearInterval(e)}},I=new WeakMap,St=new WeakMap,kt),bt=new ue;function ce(e){setTimeout(e,0)}var mt=typeof window>"u"||"Deno"in globalThis;function E(){}function he(e,t){return typeof e=="function"?e(t):e}function le(e){return typeof e=="number"&&e>=0&&e!==1/0}function fe(e,t){return Math.max(e+(t||0)-Date.now(),0)}function wt(e,t){return typeof e=="function"?e(t):e}function de(e,t){return typeof e=="function"?e(t):e}function Dt(e,t){const{type:s="all",exact:r,fetchStatus:n,predicate:u,queryKey:c,stale:o}=e;if(c){if(r){if(t.queryHash!==Ft(c,t.options))return!1}else if(!at(t.queryKey,c))return!1}if(s!=="all"){const a=t.isActive();if(s==="active"&&!a||s==="inactive"&&a)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||n&&n!==t.state.fetchStatus||u&&!u(t))}function Tt(e,t){const{exact:s,status:r,predicate:n,mutationKey:u}=e;if(u){if(!t.options.mutationKey)return!1;if(s){if(nt(t.options.mutationKey)!==nt(u))return!1}else if(!at(t.options.mutationKey,u))return!1}return!(r&&t.state.status!==r||n&&!n(t))}function Ft(e,t){return(t?.queryKeyHashFn||nt)(e)}function nt(e){return JSON.stringify(e,(t,s)=>Pt(s)?Object.keys(s).sort().reduce((r,n)=>(r[n]=s[n],r),{}):s)}function at(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>at(e[s],t[s])):!1}var pe=Object.prototype.hasOwnProperty;function Wt(e,t){if(e===t)return e;const s=xt(e)&&xt(t);if(!s&&!(Pt(e)&&Pt(t)))return t;const n=(s?e:Object.keys(e)).length,u=s?t:Object.keys(t),c=u.length,o=s?new Array(c):{};let a=0;for(let d=0;d{bt.setTimeout(t,e)})}function me(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?Wt(e,t):t}function ve(e,t,s=0){const r=[...e,t];return s&&r.length>s?r.slice(1):r}function ge(e,t,s=0){const r=[t,...e];return s&&r.length>s?r.slice(0,-1):r}var Et=Symbol();function zt(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Et?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var N,U,z,Kt,be=(Kt=class extends yt{constructor(){super();l(this,N);l(this,U);l(this,z);h(this,z,t=>{if(!mt&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){i(this,U)||this.setEventListener(i(this,z))}onUnsubscribe(){var t;this.hasListeners()||((t=i(this,U))==null||t.call(this),h(this,U,void 0))}setEventListener(t){var s;h(this,z,t),(s=i(this,U))==null||s.call(this),h(this,U,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){i(this,N)!==t&&(h(this,N,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(s=>{s(t)})}isFocused(){return typeof i(this,N)=="boolean"?i(this,N):globalThis.document?.visibilityState!=="hidden"}},N=new WeakMap,U=new WeakMap,z=new WeakMap,Kt),Vt=new be;function we(){let e,t;const s=new Promise((n,u)=>{e=n,t=u});s.status="pending",s.catch(()=>{});function r(n){Object.assign(s,n),delete s.resolve,delete s.reject}return s.resolve=n=>{r({status:"fulfilled",value:n}),e(n)},s.reject=n=>{r({status:"rejected",reason:n}),t(n)},s}var Pe=ce;function Oe(){let e=[],t=0,s=o=>{o()},r=o=>{o()},n=Pe;const u=o=>{t?e.push(o):n(()=>{s(o)})},c=()=>{const o=e;e=[],o.length&&n(()=>{r(()=>{o.forEach(a=>{s(a)})})})};return{batch:o=>{let a;t++;try{a=o()}finally{t--,t||c()}return a},batchCalls:o=>(...a)=>{u(()=>{o(...a)})},schedule:u,setNotifyFunction:o=>{s=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{n=o}}}var O=Oe(),V,_,Y,Lt,Se=(Lt=class extends yt{constructor(){super();l(this,V,!0);l(this,_);l(this,Y);h(this,Y,t=>{if(!mt&&window.addEventListener){const s=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",r)}}})}onSubscribe(){i(this,_)||this.setEventListener(i(this,Y))}onUnsubscribe(){var t;this.hasListeners()||((t=i(this,_))==null||t.call(this),h(this,_,void 0))}setEventListener(t){var s;h(this,Y,t),(s=i(this,_))==null||s.call(this),h(this,_,t(this.setOnline.bind(this)))}setOnline(t){i(this,V)!==t&&(h(this,V,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return i(this,V)}},V=new WeakMap,_=new WeakMap,Y=new WeakMap,Lt),pt=new Se;function Ce(e){return Math.min(1e3*2**e,3e4)}function Yt(e){return(e??"online")==="online"?pt.isOnline():!0}var Ot=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Zt(e){let t=!1,s=0,r;const n=we(),u=()=>n.status!=="pending",c=v=>{if(!u()){const C=new Ot(v);y(C),e.onCancel?.(C)}},o=()=>{t=!0},a=()=>{t=!1},d=()=>Vt.isFocused()&&(e.networkMode==="always"||pt.isOnline())&&e.canRun(),f=()=>Yt(e.networkMode)&&e.canRun(),p=v=>{u()||(r?.(),n.resolve(v))},y=v=>{u()||(r?.(),n.reject(v))},S=()=>new Promise(v=>{r=C=>{(u()||d())&&v(C)},e.onPause?.()}).then(()=>{r=void 0,u()||e.onContinue?.()}),b=()=>{if(u())return;let v;const C=s===0?e.initialPromise:void 0;try{v=C??e.fn()}catch(M){v=Promise.reject(M)}Promise.resolve(v).then(p).catch(M=>{if(u())return;const H=e.retry??(mt?0:3),rt=e.retryDelay??Ce,ht=typeof rt=="function"?rt(s,M):rt,lt=H===!0||typeof H=="number"&&sd()?void 0:S()).then(()=>{t?y(M):b()})})};return{promise:n,status:()=>n.status,cancel:c,continue:()=>(r?.(),n),cancelRetry:o,continueRetry:a,canStart:f,start:()=>(f()?b():S().then(b),n)}}var G,Ht,Xt=(Ht=class{constructor(){l(this,G)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),le(this.gcTime)&&h(this,G,bt.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(mt?1/0:300*1e3))}clearGcTimeout(){i(this,G)&&(bt.clearTimeout(i(this,G)),h(this,G,void 0))}},G=new WeakMap,Ht),B,Z,F,$,g,ot,J,R,T,Nt,Fe=(Nt=class extends Xt{constructor(t){super();l(this,R);l(this,B);l(this,Z);l(this,F);l(this,$);l(this,g);l(this,ot);l(this,J);h(this,J,!1),h(this,ot,t.defaultOptions),this.setOptions(t.options),this.observers=[],h(this,$,t.client),h(this,F,i(this,$).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,h(this,B,It(this.options)),this.state=t.state??i(this,B),this.scheduleGc()}get meta(){return this.options.meta}get promise(){return i(this,g)?.promise}setOptions(t){if(this.options={...i(this,ot),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=It(this.options);s.data!==void 0&&(this.setData(s.data,{updatedAt:s.dataUpdatedAt,manual:!0}),h(this,B,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&i(this,F).remove(this)}setData(t,s){const r=me(this.state.data,t,this.options);return w(this,R,T).call(this,{data:r,type:"success",dataUpdatedAt:s?.updatedAt,manual:s?.manual}),r}setState(t,s){w(this,R,T).call(this,{type:"setState",state:t,setStateOptions:s})}cancel(t){const s=i(this,g)?.promise;return i(this,g)?.cancel(t),s?s.then(E).catch(E):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(i(this,B))}isActive(){return this.observers.some(t=>de(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Et||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>wt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!fe(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(s=>s.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),i(this,g)?.continue()}onOnline(){this.observers.find(s=>s.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),i(this,g)?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),i(this,F).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(s=>s!==t),this.observers.length||(i(this,g)&&(i(this,J)?i(this,g).cancel({revert:!0}):i(this,g).cancelRetry()),this.scheduleGc()),i(this,F).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||w(this,R,T).call(this,{type:"invalidate"})}async fetch(t,s){if(this.state.fetchStatus!=="idle"&&i(this,g)?.status()!=="rejected"){if(this.state.data!==void 0&&s?.cancelRefetch)this.cancel({silent:!0});else if(i(this,g))return i(this,g).continueRetry(),i(this,g).promise}if(t&&this.setOptions(t),!this.options.queryFn){const a=this.observers.find(d=>d.options.queryFn);a&&this.setOptions(a.options)}const r=new AbortController,n=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(h(this,J,!0),r.signal)})},u=()=>{const a=zt(this.options,s),f=(()=>{const p={client:i(this,$),queryKey:this.queryKey,meta:this.meta};return n(p),p})();return h(this,J,!1),this.options.persister?this.options.persister(a,f,this):a(f)},o=(()=>{const a={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:i(this,$),state:this.state,fetchFn:u};return n(a),a})();this.options.behavior?.onFetch(o,this),h(this,Z,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&w(this,R,T).call(this,{type:"fetch",meta:o.fetchOptions?.meta}),h(this,g,Zt({initialPromise:s?.initialPromise,fn:o.fetchFn,onCancel:a=>{a instanceof Ot&&a.revert&&this.setState({...i(this,Z),fetchStatus:"idle"}),r.abort()},onFail:(a,d)=>{w(this,R,T).call(this,{type:"failed",failureCount:a,error:d})},onPause:()=>{w(this,R,T).call(this,{type:"pause"})},onContinue:()=>{w(this,R,T).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const a=await i(this,g).start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),i(this,F).config.onSuccess?.(a,this),i(this,F).config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof Ot){if(a.silent)return i(this,g).promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw w(this,R,T).call(this,{type:"error",error:a}),i(this,F).config.onError?.(a,this),i(this,F).config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}},B=new WeakMap,Z=new WeakMap,F=new WeakMap,$=new WeakMap,g=new WeakMap,ot=new WeakMap,J=new WeakMap,R=new WeakSet,T=function(t){const s=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Ee(r.data,this.options),fetchMeta:t.meta??null};case"success":const n={...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return h(this,Z,t.manual?n:void 0),n;case"error":const u=t.error;return{...r,error:u,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:u,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=s(this.state),O.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),i(this,F).notify({query:this,type:"updated",action:t})})},Nt);function Ee(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Yt(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function It(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,r=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}function Ut(e){return{onFetch:(t,s)=>{const r=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,u=t.state.data?.pages||[],c=t.state.data?.pageParams||[];let o={pages:[],pageParams:[]},a=0;const d=async()=>{let f=!1;const p=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?f=!0:t.signal.addEventListener("abort",()=>{f=!0}),t.signal)})},y=zt(t.options,t.fetchOptions),S=async(b,v,C)=>{if(f)return Promise.reject();if(v==null&&b.pages.length)return Promise.resolve(b);const H=(()=>{const Rt={client:t.client,queryKey:t.queryKey,pageParam:v,direction:C?"backward":"forward",meta:t.options.meta};return p(Rt),Rt})(),rt=await y(H),{maxPages:ht}=t.options,lt=C?ge:ve;return{pages:lt(b.pages,rt,ht),pageParams:lt(b.pageParams,v,ht)}};if(n&&u.length){const b=n==="backward",v=b?Re:_t,C={pages:u,pageParams:c},M=v(r,C);o=await S(C,M,b)}else{const b=e??u.length;do{const v=a===0?c[0]??r.initialPageParam:_t(r,o);if(a>0&&v==null)break;o=await S(o,v),a++}while(at.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=d}}}function _t(e,{pages:t,pageParams:s}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,s[r],s):void 0}function Re(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var ut,Q,P,W,A,j,Gt,qe=(Gt=class extends Xt{constructor(t){super();l(this,A);l(this,ut);l(this,Q);l(this,P);l(this,W);h(this,ut,t.client),this.mutationId=t.mutationId,h(this,P,t.mutationCache),h(this,Q,[]),this.state=t.state||Me(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){i(this,Q).includes(t)||(i(this,Q).push(t),this.clearGcTimeout(),i(this,P).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){h(this,Q,i(this,Q).filter(s=>s!==t)),this.scheduleGc(),i(this,P).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){i(this,Q).length||(this.state.status==="pending"?this.scheduleGc():i(this,P).remove(this))}continue(){return i(this,W)?.continue()??this.execute(this.state.variables)}async execute(t){const s=()=>{w(this,A,j).call(this,{type:"continue"})},r={client:i(this,ut),meta:this.options.meta,mutationKey:this.options.mutationKey};h(this,W,Zt({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(c,o)=>{w(this,A,j).call(this,{type:"failed",failureCount:c,error:o})},onPause:()=>{w(this,A,j).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>i(this,P).canRun(this)}));const n=this.state.status==="pending",u=!i(this,W).canStart();try{if(n)s();else{w(this,A,j).call(this,{type:"pending",variables:t,isPaused:u}),await i(this,P).config.onMutate?.(t,this,r);const o=await this.options.onMutate?.(t,r);o!==this.state.context&&w(this,A,j).call(this,{type:"pending",context:o,variables:t,isPaused:u})}const c=await i(this,W).start();return await i(this,P).config.onSuccess?.(c,t,this.state.context,this,r),await this.options.onSuccess?.(c,t,this.state.context,r),await i(this,P).config.onSettled?.(c,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(c,null,t,this.state.context,r),w(this,A,j).call(this,{type:"success",data:c}),c}catch(c){try{throw await i(this,P).config.onError?.(c,t,this.state.context,this,r),await this.options.onError?.(c,t,this.state.context,r),await i(this,P).config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,c,t,this.state.context,r),c}finally{w(this,A,j).call(this,{type:"error",error:c})}}finally{i(this,P).runNext(this)}}},ut=new WeakMap,Q=new WeakMap,P=new WeakMap,W=new WeakMap,A=new WeakSet,j=function(t){const s=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=s(this.state),O.batch(()=>{i(this,Q).forEach(r=>{r.onMutationUpdate(t)}),i(this,P).notify({mutation:this,type:"updated",action:t})})},Gt);function Me(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var x,q,ct,Bt,Qe=(Bt=class extends yt{constructor(t={}){super();l(this,x);l(this,q);l(this,ct);this.config=t,h(this,x,new Set),h(this,q,new Map),h(this,ct,0)}build(t,s,r){const n=new qe({client:t,mutationCache:this,mutationId:++ft(this,ct)._,options:t.defaultMutationOptions(s),state:r});return this.add(n),n}add(t){i(this,x).add(t);const s=dt(t);if(typeof s=="string"){const r=i(this,q).get(s);r?r.push(t):i(this,q).set(s,[t])}this.notify({type:"added",mutation:t})}remove(t){if(i(this,x).delete(t)){const s=dt(t);if(typeof s=="string"){const r=i(this,q).get(s);if(r)if(r.length>1){const n=r.indexOf(t);n!==-1&&r.splice(n,1)}else r[0]===t&&i(this,q).delete(s)}}this.notify({type:"removed",mutation:t})}canRun(t){const s=dt(t);if(typeof s=="string"){const n=i(this,q).get(s)?.find(u=>u.state.status==="pending");return!n||n===t}else return!0}runNext(t){const s=dt(t);return typeof s=="string"?i(this,q).get(s)?.find(n=>n!==t&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){O.batch(()=>{i(this,x).forEach(t=>{this.notify({type:"removed",mutation:t})}),i(this,x).clear(),i(this,q).clear()})}getAll(){return Array.from(i(this,x))}find(t){const s={exact:!0,...t};return this.getAll().find(r=>Tt(s,r))}findAll(t={}){return this.getAll().filter(s=>Tt(t,s))}notify(t){O.batch(()=>{this.listeners.forEach(s=>{s(t)})})}resumePausedMutations(){const t=this.getAll().filter(s=>s.state.isPaused);return O.batch(()=>Promise.all(t.map(s=>s.continue().catch(E))))}},x=new WeakMap,q=new WeakMap,ct=new WeakMap,Bt);function dt(e){return e.options.scope?.id}var D,$t,Ae=($t=class extends yt{constructor(t={}){super();l(this,D);this.config=t,h(this,D,new Map)}build(t,s,r){const n=s.queryKey,u=s.queryHash??Ft(n,s);let c=this.get(u);return c||(c=new Fe({client:t,queryKey:n,queryHash:u,options:t.defaultQueryOptions(s),state:r,defaultOptions:t.getQueryDefaults(n)}),this.add(c)),c}add(t){i(this,D).has(t.queryHash)||(i(this,D).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const s=i(this,D).get(t.queryHash);s&&(t.destroy(),s===t&&i(this,D).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){O.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return i(this,D).get(t)}getAll(){return[...i(this,D).values()]}find(t){const s={exact:!0,...t};return this.getAll().find(r=>Dt(s,r))}findAll(t={}){const s=this.getAll();return Object.keys(t).length>0?s.filter(r=>Dt(t,r)):s}notify(t){O.batch(()=>{this.listeners.forEach(s=>{s(t)})})}onFocus(){O.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){O.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},D=new WeakMap,$t),m,k,K,X,tt,L,et,st,Jt,Ie=(Jt=class{constructor(e={}){l(this,m);l(this,k);l(this,K);l(this,X);l(this,tt);l(this,L);l(this,et);l(this,st);h(this,m,e.queryCache||new Ae),h(this,k,e.mutationCache||new Qe),h(this,K,e.defaultOptions||{}),h(this,X,new Map),h(this,tt,new Map),h(this,L,0)}mount(){ft(this,L)._++,i(this,L)===1&&(h(this,et,Vt.subscribe(async e=>{e&&(await this.resumePausedMutations(),i(this,m).onFocus())})),h(this,st,pt.subscribe(async e=>{e&&(await this.resumePausedMutations(),i(this,m).onOnline())})))}unmount(){var e,t;ft(this,L)._--,i(this,L)===0&&((e=i(this,et))==null||e.call(this),h(this,et,void 0),(t=i(this,st))==null||t.call(this),h(this,st,void 0))}isFetching(e){return i(this,m).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return i(this,k).findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return i(this,m).get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=i(this,m).build(this,t),r=s.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(wt(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return i(this,m).findAll(e).map(({queryKey:t,state:s})=>{const r=s.data;return[t,r]})}setQueryData(e,t,s){const r=this.defaultQueryOptions({queryKey:e}),u=i(this,m).get(r.queryHash)?.state.data,c=he(t,u);if(c!==void 0)return i(this,m).build(this,r).setData(c,{...s,manual:!0})}setQueriesData(e,t,s){return O.batch(()=>i(this,m).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,s)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return i(this,m).get(t.queryHash)?.state}removeQueries(e){const t=i(this,m);O.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=i(this,m);return O.batch(()=>(s.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},r=O.batch(()=>i(this,m).findAll(e).map(n=>n.cancel(s)));return Promise.all(r).then(E).catch(E)}invalidateQueries(e,t={}){return O.batch(()=>(i(this,m).findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},r=O.batch(()=>i(this,m).findAll(e).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let u=n.fetch(void 0,s);return s.throwOnError||(u=u.catch(E)),n.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(r).then(E)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=i(this,m).build(this,t);return s.isStaleByTime(wt(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(E).catch(E)}fetchInfiniteQuery(e){return e.behavior=Ut(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(E).catch(E)}ensureInfiniteQueryData(e){return e.behavior=Ut(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return pt.isOnline()?i(this,k).resumePausedMutations():Promise.resolve()}getQueryCache(){return i(this,m)}getMutationCache(){return i(this,k)}getDefaultOptions(){return i(this,K)}setDefaultOptions(e){h(this,K,e)}setQueryDefaults(e,t){i(this,X).set(nt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...i(this,X).values()],s={};return t.forEach(r=>{at(e,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(e,t){i(this,tt).set(nt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...i(this,tt).values()],s={};return t.forEach(r=>{at(e,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...i(this,K).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ft(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Et&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...i(this,K).mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){i(this,m).clear(),i(this,k).clear()}},m=new WeakMap,k=new WeakMap,K=new WeakMap,X=new WeakMap,tt=new WeakMap,L=new WeakMap,et=new WeakMap,st=new WeakMap,Jt),te=Ct.createContext(void 0),Ue=e=>{const t=Ct.useContext(te);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},_e=({client:e,children:t})=>(Ct.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),ie.jsx(te.Provider,{value:e,children:t}));export{Ie as Q,je as _,_e as a,ie as j,Ue as u}; diff --git a/dist/assets/js/state-vendor-DHadhBU5.js b/dist/assets/js/state-vendor-DHadhBU5.js deleted file mode 100644 index 3c43db7..0000000 --- a/dist/assets/js/state-vendor-DHadhBU5.js +++ /dev/null @@ -1,3 +0,0 @@ -import{c as si,g as ci}from"./react-vendor-CqRd3GwO.js";import{R as zn}from"./router-vendor-D4by-_6Z.js";var Yn={exports:{}},li=Yn.exports,_r;function fi(){return _r||(_r=1,(function(Y,X){(function(re,A){Y.exports=A()})(li,function(){var re=function(e,n){return(re=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])})(e,n)},A=function(){return(A=Object.assign||function(e){for(var n,t=1,r=arguments.length;t"u"||$.Promise||($.Promise=Promise);var ie=Object.getPrototypeOf,dn={}.hasOwnProperty;function z(e,n){return dn.call(e,n)}function ye(e,n){typeof n=="function"&&(n=n(ie(e))),(typeof Reflect>"u"?W:Reflect.ownKeys)(n).forEach(function(t){ve(e,t,n[t])})}var pn=Object.defineProperty;function ve(e,n,t,r){pn(e,n,ee(t&&z(t,"get")&&typeof t.get=="function"?{get:t.get,set:t.set,configurable:!0}:{value:t,configurable:!0,writable:!0},r))}function Fe(e){return{from:function(n){return e.prototype=Object.create(n.prototype),ve(e.prototype,"constructor",e),{extend:ye.bind(null,e.prototype)}}}}var Pr=Object.getOwnPropertyDescriptor,Er=[].slice;function yn(e,n,t){return Er.call(e,n,t)}function It(e,n){return n(e)}function Xe(e){if(!e)throw new Error("Assertion Failed")}function Tt(e){$.setImmediate?setImmediate(e):setTimeout(e,0)}function fe(e,n){if(typeof n=="string"&&z(e,n))return e[n];if(!n)return e;if(typeof n!="string"){for(var t=[],r=0,i=n.length;r"u"?[]:(function(){var e=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[e,ie(e),e];var n=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[n,ie(n),e]})(),en=Ke[0],ue=Ke[1],Ke=Ke[2],ue=ue&&ue.then,je=en&&en.constructor,Hn=!!Ke,nn=function(e,n){tn.push([e,n]),gn&&(queueMicrotask(Fr),gn=!1)},Jn=!0,gn=!0,Ce=[],bn=[],Zn=Je,me={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:F,pgp:!1,env:{},finalize:F},j=me,tn=[],Ae=0,wn=[];function S(e){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var n=this._PSD=j;if(typeof e!="function"){if(e!==Ze)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&nt(this,this._value))}this._state=null,this._value=null,++n.ref,(function t(r,i){try{i(function(o){if(r._state===null){if(o===r)throw new TypeError("A promise cannot be resolved with itself.");var a=r._lib&&Ue();o&&typeof o.then=="function"?t(r,function(u,c){o instanceof S?o._then(u,c):o.then(u,c)}):(r._state=!0,r._value=o,Vt(r)),a&&Ve()}},nt.bind(null,r))}catch(o){nt(r,o)}})(this,e)}var et={get:function(){var e=j,n=On;function t(r,i){var o=this,a=!e.global&&(e!==j||n!==On),u=a&&!be(),c=new S(function(l,p){tt(o,new Ut(Yt(r,e,a,u),Yt(i,e,a,u),l,p,e))});return this._consoleTask&&(c._consoleTask=this._consoleTask),c}return t.prototype=Ze,t},set:function(e){ve(this,"then",e&&e.prototype===Ze?et:{get:function(){return e},set:et.set})}};function Ut(e,n,t,r,i){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof n=="function"?n:null,this.resolve=t,this.reject=r,this.psd=i}function nt(e,n){var t,r;bn.push(n),e._state===null&&(t=e._lib&&Ue(),n=Zn(n),e._state=!1,e._value=n,r=e,Ce.some(function(i){return i._value===r._value})||Ce.push(r),Vt(e),t&&Ve())}function Vt(e){var n=e._listeners;e._listeners=[];for(var t=0,r=n.length;t.",Wt="String expected.",Ye=[],En="__dbnames",ot="readonly",at="readwrite";function Te(e,n){return e?n?function(){return e.apply(this,arguments)&&n.apply(this,arguments)}:e:n}var $t={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Sn(e){return typeof e!="string"||/\./.test(e)?function(n){return n}:function(n){return n[e]===void 0&&e in n&&delete(n=Pe(n))[e],n}}function Qt(){throw C.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function B(e,n){try{var t=Gt(e),r=Gt(n);if(t!==r)return t==="Array"?1:r==="Array"?-1:t==="binary"?1:r==="binary"?-1:t==="string"?1:r==="string"?-1:t==="Date"?1:r!=="Date"?NaN:-1;switch(t){case"number":case"Date":case"string":return ng+b&&y(g+c)})})}var m=We(t)&&t.limit===1/0&&(typeof e!="function"||h)&&{index:t.index,range:t.range};return y(0).then(function(){if(0=v})).length!==0?(p.forEach(function(m){d.push(function(){var g=y,b=m._cfg.dbschema;Bn(s,g,h),Bn(s,b,h),y=s._dbSchema=b;var w=pt(g,b);w.add.forEach(function(E){yt(h,E[0],E[1].primKey,E[1].indexes)}),w.change.forEach(function(E){if(E.recreate)throw new C.Upgrade("Not yet support for changing primary key");var O=h.objectStore(E.name);E.add.forEach(function(K){return Tn(O,K)}),E.change.forEach(function(K){O.deleteIndex(K.name),Tn(O,K)}),E.del.forEach(function(K){return O.deleteIndex(K)})});var x=m._cfg.contentUpgrade;if(x&&m._cfg.version>v){Dn(s,h),f._memoizedTables={};var P=qt(b);w.del.forEach(function(E){P[E]=g[E]}),dt(s,[s.Transaction.prototype]),In(s,[s.Transaction.prototype],W(P),P),f.schema=P;var _,k=Qn(x);return k&&ze(),w=S.follow(function(){var E;(_=x(f))&&k&&(E=be.bind(null,null),_.then(E,E))}),_&&typeof _.then=="function"?S.resolve(_):w.then(function(){return _})}}),d.push(function(g){var b,w,x=m._cfg.dbschema;b=x,w=g,[].slice.call(w.db.objectStoreNames).forEach(function(P){return b[P]==null&&w.db.deleteObjectStore(P)}),dt(s,[s.Transaction.prototype]),In(s,[s.Transaction.prototype],s._storeNames,s._dbSchema),f.schema=s._dbSchema}),d.push(function(g){s.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(s.idbdb.version/10)===m._cfg.version?(s.idbdb.deleteObjectStore("$meta"),delete s._dbSchema.$meta,s._storeNames=s._storeNames.filter(function(b){return b!=="$meta"})):g.objectStore("$meta").put(m._cfg.version,"version"))})}),(function m(){return d.length?S.resolve(d.shift()(f.idbtrans)).then(m):S.resolve()})().then(function(){ur(y,h)})):S.resolve();var s,v,f,h,d,y}).catch(a)):(W(i).forEach(function(p){yt(t,p,i[p].primKey,i[p].indexes)}),Dn(e,t),void S.follow(function(){return e.on.populate.fire(o)}).catch(a));var c,l})}function Hr(e,n){ur(e._dbSchema,n),n.db.version%10!=0||n.objectStoreNames.contains("$meta")||n.db.createObjectStore("$meta").add(Math.ceil(n.db.version/10-1),"version");var t=qn(0,e.idbdb,n);Bn(e,e._dbSchema,n);for(var r=0,i=pt(t,e._dbSchema).change;rMath.pow(2,62)?0:y.oldVersion,s=y<1,e.idbdb=d.result,o&&Hr(e,p),Xr(e,y/10,p,f))},f),d.onsuccess=L(function(){p=null;var y,m,g,b,w,x=e.idbdb=d.result,P=yn(x.objectStoreNames);if(0"u"?S.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(v){function f(){return indexedDB.databases().finally(v)}c=setInterval(f,100),f()}).finally(function(){return clearInterval(c)}):Promise.resolve()).then(u)]).then(function(){return a(),n.onReadyBeingFired=[],S.resolve(gt(function(){return e.on.ready.fire(e.vip)})).then(function v(){if(0n.limit?v.length=n.limit:e.length===n.limit&&v.length=m.limit&&(!m.values||x.req.values)&&ii(x.req.query.range,m.query.range)}),!1,g,b];case"count":return w=b.find(function(x){return gr(x.req.query.range,m.query.range)}),[w,!!w,g,b]}})(n,t,"query",o),p=l[0],s=l[1],v=l[2],f=l[3];return p&&s?p.obsSet=o.obsSet:(s=r.query(o).then(function(h){var d=h.result;if(p&&(p.res=d),a){for(var y=0,m=d.length;y{let X;const re=new Set,A=(ie,dn)=>{const z=typeof ie=="function"?ie(X):ie;if(!Object.is(z,X)){const ye=X;X=dn??(typeof z!="object"||z===null)?z:Object.assign({},X,z),re.forEach(pn=>pn(X,ye))}},Oe=()=>X,M={setState:A,getState:Oe,getInitialState:()=>ee,subscribe:ie=>(re.add(ie),()=>re.delete(ie))},ee=X=Y(A,Oe,M);return M},di=(Y=>Y?kr(Y):kr),pi=Y=>Y;function yi(Y,X=pi){const re=zn.useSyncExternalStore(Y.subscribe,zn.useCallback(()=>X(Y.getState()),[Y,X]),zn.useCallback(()=>X(Y.getInitialState()),[Y,X]));return zn.useDebugValue(re),re}const Or=Y=>{const X=di(Y),re=A=>yi(X,A);return Object.assign(re,X),re},ji=(Y=>Y?Or(Y):Or);export{Dt as D,ji as c}; diff --git a/dist/assets/js/supabase-vendor-CnnNSQLo.js b/dist/assets/js/supabase-vendor-CnnNSQLo.js deleted file mode 100644 index 1987d8f..0000000 --- a/dist/assets/js/supabase-vendor-CnnNSQLo.js +++ /dev/null @@ -1,25 +0,0 @@ -import{b as Rt,g as xt}from"./react-vendor-CqRd3GwO.js";import{_ as ue}from"./query-vendor-BLVqILA6.js";const It=n=>{let e;return n?e=n:typeof fetch>"u"?e=(...t)=>ue(async()=>{const{default:s}=await Promise.resolve().then(()=>ne);return{default:s}},void 0).then(({default:s})=>s(...t)):e=fetch,(...t)=>e(...t)};class qe extends Error{constructor(e,t="FunctionsError",s){super(e),this.name=t,this.context=s}}class Ut extends qe{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class He extends qe{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class ze extends qe{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Pe;(function(n){n.Any="any",n.ApNortheast1="ap-northeast-1",n.ApNortheast2="ap-northeast-2",n.ApSouth1="ap-south-1",n.ApSoutheast1="ap-southeast-1",n.ApSoutheast2="ap-southeast-2",n.CaCentral1="ca-central-1",n.EuCentral1="eu-central-1",n.EuWest1="eu-west-1",n.EuWest2="eu-west-2",n.EuWest3="eu-west-3",n.SaEast1="sa-east-1",n.UsEast1="us-east-1",n.UsWest1="us-west-1",n.UsWest2="us-west-2"})(Pe||(Pe={}));var Lt=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(h){try{c(s.next(h))}catch(u){o(u)}}function l(h){try{c(s.throw(h))}catch(u){o(u)}}function c(h){h.done?i(h.value):r(h.value).then(a,l)}c((s=s.apply(n,e||[])).next())})};class Dt{constructor(e,{headers:t={},customFetch:s,region:r=Pe.Any}={}){this.url=e,this.headers=t,this.region=r,this.fetch=It(s)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t={}){var s;return Lt(this,void 0,void 0,function*(){try{const{headers:r,method:i,body:o}=t;let a={},{region:l}=t;l||(l=this.region);const c=new URL(`${this.url}/${e}`);l&&l!=="any"&&(a["x-region"]=l,c.searchParams.set("forceFunctionRegion",l));let h;o&&(r&&!Object.prototype.hasOwnProperty.call(r,"Content-Type")||!r)&&(typeof Blob<"u"&&o instanceof Blob||o instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",h=o):typeof o=="string"?(a["Content-Type"]="text/plain",h=o):typeof FormData<"u"&&o instanceof FormData?h=o:(a["Content-Type"]="application/json",h=JSON.stringify(o)));const u=yield this.fetch(c.toString(),{method:i||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),r),body:h}).catch(v=>{throw new Ut(v)}),d=u.headers.get("x-relay-error");if(d&&d==="true")throw new He(u);if(!u.ok)throw new ze(u);let f=((s=u.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),g;return f==="application/json"?g=yield u.json():f==="application/octet-stream"?g=yield u.blob():f==="text/event-stream"?g=u:f==="multipart/form-data"?g=yield u.formData():g=yield u.text(),{data:g,error:null,response:u}}catch(r){return{data:null,error:r,response:r instanceof ze||r instanceof He?r.context:void 0}}})}}var O={},z={},J={},G={},V={},Q={},Nt=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},ie=Nt();const Bt=ie.fetch,gt=ie.fetch.bind(ie),pt=ie.Headers,qt=ie.Request,Mt=ie.Response,ne=Object.freeze(Object.defineProperty({__proto__:null,Headers:pt,Request:qt,Response:Mt,default:gt,fetch:Bt},Symbol.toStringTag,{value:"Module"})),Ft=Rt(ne);var fe={},Je;function _t(){if(Je)return fe;Je=1,Object.defineProperty(fe,"__esModule",{value:!0});class n extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}}return fe.default=n,fe}var Ge;function vt(){if(Ge)return Q;Ge=1;var n=Q&&Q.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Q,"__esModule",{value:!0});const e=n(Ft),t=n(_t());class s{constructor(i){var o,a;this.shouldThrowOnError=!1,this.method=i.method,this.url=i.url,this.headers=new Headers(i.headers),this.schema=i.schema,this.body=i.body,this.shouldThrowOnError=(o=i.shouldThrowOnError)!==null&&o!==void 0?o:!1,this.signal=i.signal,this.isMaybeSingle=(a=i.isMaybeSingle)!==null&&a!==void 0?a:!1,i.fetch?this.fetch=i.fetch:typeof fetch>"u"?this.fetch=e.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(i,o){return this.headers=new Headers(this.headers),this.headers.set(i,o),this}then(i,o){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const a=this.fetch;let l=a(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async c=>{var h,u,d,f;let g=null,v=null,p=null,S=c.status,T=c.statusText;if(c.ok){if(this.method!=="HEAD"){const m=await c.text();m===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((h=this.headers.get("Accept"))===null||h===void 0)&&h.includes("application/vnd.pgrst.plan+text"))?v=m:v=JSON.parse(m))}const b=(u=this.headers.get("Prefer"))===null||u===void 0?void 0:u.match(/count=(exact|planned|estimated)/),A=(d=c.headers.get("content-range"))===null||d===void 0?void 0:d.split("/");b&&A&&A.length>1&&(p=parseInt(A[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(v)&&(v.length>1?(g={code:"PGRST116",details:`Results contain ${v.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},v=null,p=null,S=406,T="Not Acceptable"):v.length===1?v=v[0]:v=null)}else{const b=await c.text();try{g=JSON.parse(b),Array.isArray(g)&&c.status===404&&(v=[],g=null,S=200,T="OK")}catch{c.status===404&&b===""?(S=204,T="No Content"):g={message:b}}if(g&&this.isMaybeSingle&&(!((f=g?.details)===null||f===void 0)&&f.includes("0 rows"))&&(g=null,S=200,T="OK"),g&&this.shouldThrowOnError)throw new t.default(g)}return{error:g,data:v,count:p,status:S,statusText:T}});return this.shouldThrowOnError||(l=l.catch(c=>{var h,u,d;return{error:{message:`${(h=c?.name)!==null&&h!==void 0?h:"FetchError"}: ${c?.message}`,details:`${(u=c?.stack)!==null&&u!==void 0?u:""}`,hint:"",code:`${(d=c?.code)!==null&&d!==void 0?d:""}`},data:null,count:null,status:0,statusText:""}})),l.then(i,o)}returns(){return this}overrideTypes(){return this}}return Q.default=s,Q}var Ve;function wt(){if(Ve)return V;Ve=1;var n=V&&V.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(V,"__esModule",{value:!0});const e=n(vt());class t extends e.default{select(r){let i=!1;const o=(r??"*").split("").map(a=>/\s/.test(a)&&!i?"":(a==='"'&&(i=!i),a)).join("");return this.url.searchParams.set("select",o),this.headers.append("Prefer","return=representation"),this}order(r,{ascending:i=!0,nullsFirst:o,foreignTable:a,referencedTable:l=a}={}){const c=l?`${l}.order`:"order",h=this.url.searchParams.get(c);return this.url.searchParams.set(c,`${h?`${h},`:""}${r}.${i?"asc":"desc"}${o===void 0?"":o?".nullsfirst":".nullslast"}`),this}limit(r,{foreignTable:i,referencedTable:o=i}={}){const a=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(a,`${r}`),this}range(r,i,{foreignTable:o,referencedTable:a=o}={}){const l=typeof a>"u"?"offset":`${a}.offset`,c=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(l,`${r}`),this.url.searchParams.set(c,`${i-r+1}`),this}abortSignal(r){return this.signal=r,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:r=!1,verbose:i=!1,settings:o=!1,buffers:a=!1,wal:l=!1,format:c="text"}={}){var h;const u=[r?"analyze":null,i?"verbose":null,o?"settings":null,a?"buffers":null,l?"wal":null].filter(Boolean).join("|"),d=(h=this.headers.get("Accept"))!==null&&h!==void 0?h:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${c}; for="${d}"; options=${u};`),c==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(r){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${r}`),this}}return V.default=t,V}var Qe;function Me(){if(Qe)return G;Qe=1;var n=G&&G.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(G,"__esModule",{value:!0});const e=n(wt());class t extends e.default{eq(r,i){return this.url.searchParams.append(r,`eq.${i}`),this}neq(r,i){return this.url.searchParams.append(r,`neq.${i}`),this}gt(r,i){return this.url.searchParams.append(r,`gt.${i}`),this}gte(r,i){return this.url.searchParams.append(r,`gte.${i}`),this}lt(r,i){return this.url.searchParams.append(r,`lt.${i}`),this}lte(r,i){return this.url.searchParams.append(r,`lte.${i}`),this}like(r,i){return this.url.searchParams.append(r,`like.${i}`),this}likeAllOf(r,i){return this.url.searchParams.append(r,`like(all).{${i.join(",")}}`),this}likeAnyOf(r,i){return this.url.searchParams.append(r,`like(any).{${i.join(",")}}`),this}ilike(r,i){return this.url.searchParams.append(r,`ilike.${i}`),this}ilikeAllOf(r,i){return this.url.searchParams.append(r,`ilike(all).{${i.join(",")}}`),this}ilikeAnyOf(r,i){return this.url.searchParams.append(r,`ilike(any).{${i.join(",")}}`),this}is(r,i){return this.url.searchParams.append(r,`is.${i}`),this}in(r,i){const o=Array.from(new Set(i)).map(a=>typeof a=="string"&&new RegExp("[,()]").test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(r,`in.(${o})`),this}contains(r,i){return typeof i=="string"?this.url.searchParams.append(r,`cs.${i}`):Array.isArray(i)?this.url.searchParams.append(r,`cs.{${i.join(",")}}`):this.url.searchParams.append(r,`cs.${JSON.stringify(i)}`),this}containedBy(r,i){return typeof i=="string"?this.url.searchParams.append(r,`cd.${i}`):Array.isArray(i)?this.url.searchParams.append(r,`cd.{${i.join(",")}}`):this.url.searchParams.append(r,`cd.${JSON.stringify(i)}`),this}rangeGt(r,i){return this.url.searchParams.append(r,`sr.${i}`),this}rangeGte(r,i){return this.url.searchParams.append(r,`nxl.${i}`),this}rangeLt(r,i){return this.url.searchParams.append(r,`sl.${i}`),this}rangeLte(r,i){return this.url.searchParams.append(r,`nxr.${i}`),this}rangeAdjacent(r,i){return this.url.searchParams.append(r,`adj.${i}`),this}overlaps(r,i){return typeof i=="string"?this.url.searchParams.append(r,`ov.${i}`):this.url.searchParams.append(r,`ov.{${i.join(",")}}`),this}textSearch(r,i,{config:o,type:a}={}){let l="";a==="plain"?l="pl":a==="phrase"?l="ph":a==="websearch"&&(l="w");const c=o===void 0?"":`(${o})`;return this.url.searchParams.append(r,`${l}fts${c}.${i}`),this}match(r){return Object.entries(r).forEach(([i,o])=>{this.url.searchParams.append(i,`eq.${o}`)}),this}not(r,i,o){return this.url.searchParams.append(r,`not.${i}.${o}`),this}or(r,{foreignTable:i,referencedTable:o=i}={}){const a=o?`${o}.or`:"or";return this.url.searchParams.append(a,`(${r})`),this}filter(r,i,o){return this.url.searchParams.append(r,`${i}.${o}`),this}}return G.default=t,G}var Ye;function yt(){if(Ye)return J;Ye=1;var n=J&&J.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(J,"__esModule",{value:!0});const e=n(Me());class t{constructor(r,{headers:i={},schema:o,fetch:a}){this.url=r,this.headers=new Headers(i),this.schema=o,this.fetch=a}select(r,{head:i=!1,count:o}={}){const a=i?"HEAD":"GET";let l=!1;const c=(r??"*").split("").map(h=>/\s/.test(h)&&!l?"":(h==='"'&&(l=!l),h)).join("");return this.url.searchParams.set("select",c),o&&this.headers.append("Prefer",`count=${o}`),new e.default({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(r,{count:i,defaultToNull:o=!0}={}){var a;const l="POST";if(i&&this.headers.append("Prefer",`count=${i}`),o||this.headers.append("Prefer","missing=default"),Array.isArray(r)){const c=r.reduce((h,u)=>h.concat(Object.keys(u)),[]);if(c.length>0){const h=[...new Set(c)].map(u=>`"${u}"`);this.url.searchParams.set("columns",h.join(","))}}return new e.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:r,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}upsert(r,{onConflict:i,ignoreDuplicates:o=!1,count:a,defaultToNull:l=!0}={}){var c;const h="POST";if(this.headers.append("Prefer",`resolution=${o?"ignore":"merge"}-duplicates`),i!==void 0&&this.url.searchParams.set("on_conflict",i),a&&this.headers.append("Prefer",`count=${a}`),l||this.headers.append("Prefer","missing=default"),Array.isArray(r)){const u=r.reduce((d,f)=>d.concat(Object.keys(f)),[]);if(u.length>0){const d=[...new Set(u)].map(f=>`"${f}"`);this.url.searchParams.set("columns",d.join(","))}}return new e.default({method:h,url:this.url,headers:this.headers,schema:this.schema,body:r,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch})}update(r,{count:i}={}){var o;const a="PATCH";return i&&this.headers.append("Prefer",`count=${i}`),new e.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:r,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}delete({count:r}={}){var i;const o="DELETE";return r&&this.headers.append("Prefer",`count=${r}`),new e.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}}return J.default=t,J}var Xe;function Wt(){if(Xe)return z;Xe=1;var n=z&&z.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(z,"__esModule",{value:!0});const e=n(yt()),t=n(Me());class s{constructor(i,{headers:o={},schema:a,fetch:l}={}){this.url=i,this.headers=new Headers(o),this.schemaName=a,this.fetch=l}from(i){const o=new URL(`${this.url}/${i}`);return new e.default(o,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(i){return new s(this.url,{headers:this.headers,schema:i,fetch:this.fetch})}rpc(i,o={},{head:a=!1,get:l=!1,count:c}={}){var h;let u;const d=new URL(`${this.url}/rpc/${i}`);let f;a||l?(u=a?"HEAD":"GET",Object.entries(o).filter(([v,p])=>p!==void 0).map(([v,p])=>[v,Array.isArray(p)?`{${p.join(",")}}`:`${p}`]).forEach(([v,p])=>{d.searchParams.append(v,p)})):(u="POST",f=o);const g=new Headers(this.headers);return c&&g.set("Prefer",`count=${c}`),new t.default({method:u,url:d,headers:g,schema:this.schemaName,body:f,fetch:(h=this.fetch)!==null&&h!==void 0?h:fetch})}}return z.default=s,z}var Ze;function Kt(){if(Ze)return O;Ze=1;var n=O&&O.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(O,"__esModule",{value:!0}),O.PostgrestError=O.PostgrestBuilder=O.PostgrestTransformBuilder=O.PostgrestFilterBuilder=O.PostgrestQueryBuilder=O.PostgrestClient=void 0;const e=n(Wt());O.PostgrestClient=e.default;const t=n(yt());O.PostgrestQueryBuilder=t.default;const s=n(Me());O.PostgrestFilterBuilder=s.default;const r=n(wt());O.PostgrestTransformBuilder=r.default;const i=n(vt());O.PostgrestBuilder=i.default;const o=n(_t());return O.PostgrestError=o.default,O.default={PostgrestClient:e.default,PostgrestQueryBuilder:t.default,PostgrestFilterBuilder:s.default,PostgrestTransformBuilder:r.default,PostgrestBuilder:i.default,PostgrestError:o.default},O}var Ht=Kt();const zt=xt(Ht),{PostgrestClient:Jt,PostgrestQueryBuilder:Lr,PostgrestFilterBuilder:Dr,PostgrestTransformBuilder:Nr,PostgrestBuilder:Br,PostgrestError:qr}=zt;class Gt{static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"){const t=process.versions;if(t&&t.node){const s=t.node,r=parseInt(s.replace(/^v/,"").split(".")[0]);return r>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${r} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${r} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: -import ws from "ws" -new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let t=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(t+=` - -Suggested solution: ${e.workaround}`),new Error(t)}static createWebSocket(e,t){const s=this.getWebSocketConstructor();return new s(e,t)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const Vt="2.15.5",Qt=`realtime-js/${Vt}`,Yt="1.0.0",$e=1e4,Xt=1e3,Zt=100;var ae;(function(n){n[n.connecting=0]="connecting",n[n.open=1]="open",n[n.closing=2]="closing",n[n.closed=3]="closed"})(ae||(ae={}));var E;(function(n){n.closed="closed",n.errored="errored",n.joined="joined",n.joining="joining",n.leaving="leaving"})(E||(E={}));var R;(function(n){n.close="phx_close",n.error="phx_error",n.join="phx_join",n.reply="phx_reply",n.leave="phx_leave",n.access_token="access_token"})(R||(R={}));var Ce;(function(n){n.websocket="websocket"})(Ce||(Ce={}));var W;(function(n){n.Connecting="connecting",n.Open="open",n.Closing="closing",n.Closed="closed"})(W||(W={}));class es{constructor(){this.HEADER_LENGTH=1}decode(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):t(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){const t=new DataView(e),s=new TextDecoder;return this._decodeBroadcast(e,t,s)}_decodeBroadcast(e,t,s){const r=t.getUint8(1),i=t.getUint8(2);let o=this.HEADER_LENGTH+2;const a=s.decode(e.slice(o,o+r));o=o+r;const l=s.decode(e.slice(o,o+i));o=o+i;const c=JSON.parse(s.decode(e.slice(o,e.byteLength)));return{ref:null,topic:a,event:l,payload:c}}}class bt{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var k;(function(n){n.abstime="abstime",n.bool="bool",n.date="date",n.daterange="daterange",n.float4="float4",n.float8="float8",n.int2="int2",n.int4="int4",n.int4range="int4range",n.int8="int8",n.int8range="int8range",n.json="json",n.jsonb="jsonb",n.money="money",n.numeric="numeric",n.oid="oid",n.reltime="reltime",n.text="text",n.time="time",n.timestamp="timestamp",n.timestamptz="timestamptz",n.timetz="timetz",n.tsrange="tsrange",n.tstzrange="tstzrange"})(k||(k={}));const et=(n,e,t={})=>{var s;const r=(s=t.skipTypes)!==null&&s!==void 0?s:[];return Object.keys(e).reduce((i,o)=>(i[o]=ts(o,n,e,r),i),{})},ts=(n,e,t,s)=>{const r=e.find(a=>a.name===n),i=r?.type,o=t[n];return i&&!s.includes(i)?mt(i,o):Re(o)},mt=(n,e)=>{if(n.charAt(0)==="_"){const t=n.slice(1,n.length);return ns(e,t)}switch(n){case k.bool:return ss(e);case k.float4:case k.float8:case k.int2:case k.int4:case k.int8:case k.numeric:case k.oid:return rs(e);case k.json:case k.jsonb:return is(e);case k.timestamp:return os(e);case k.abstime:case k.date:case k.daterange:case k.int4range:case k.int8range:case k.money:case k.reltime:case k.text:case k.time:case k.timestamptz:case k.timetz:case k.tsrange:case k.tstzrange:return Re(e);default:return Re(e)}},Re=n=>n,ss=n=>{switch(n){case"t":return!0;case"f":return!1;default:return n}},rs=n=>{if(typeof n=="string"){const e=parseFloat(n);if(!Number.isNaN(e))return e}return n},is=n=>{if(typeof n=="string")try{return JSON.parse(n)}catch{return n}return n},ns=(n,e)=>{if(typeof n!="string")return n;const t=n.length-1,s=n[t];if(n[0]==="{"&&s==="}"){let i;const o=n.slice(1,t);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(a=>mt(e,a))}return n},os=n=>typeof n=="string"?n.replace(" ","T"):n,kt=n=>{let e=n;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")+"/api/broadcast"};class me{constructor(e,t,s={},r=$e){this.channel=e,this.event=t,this.payload=s,this.timeout=r,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var s;return this._hasReceived(e)&&t((s=this.receivedResp)===null||s===void 0?void 0:s.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=t=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=t,this._matchReceive(t)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,t){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter(s=>s.status===e).forEach(s=>s.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var tt;(function(n){n.SYNC="sync",n.JOIN="join",n.LEAVE="leave"})(tt||(tt={}));class le{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const s=t?.events||{state:"presence_state",diff:"presence_diff"};this.channel._on(s.state,{},r=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel._joinRef(),this.state=le.syncState(this.state,r,i,o),this.pendingDiffs.forEach(l=>{this.state=le.syncDiff(this.state,l,i,o)}),this.pendingDiffs=[],a()}),this.channel._on(s.diff,{},r=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(r):(this.state=le.syncDiff(this.state,r,i,o),a())}),this.onJoin((r,i,o)=>{this.channel._trigger("presence",{event:"join",key:r,currentPresences:i,newPresences:o})}),this.onLeave((r,i,o)=>{this.channel._trigger("presence",{event:"leave",key:r,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,s,r){const i=this.cloneDeep(e),o=this.transformState(t),a={},l={};return this.map(i,(c,h)=>{o[c]||(l[c]=h)}),this.map(o,(c,h)=>{const u=i[c];if(u){const d=h.map(p=>p.presence_ref),f=u.map(p=>p.presence_ref),g=h.filter(p=>f.indexOf(p.presence_ref)<0),v=u.filter(p=>d.indexOf(p.presence_ref)<0);g.length>0&&(a[c]=g),v.length>0&&(l[c]=v)}else a[c]=h}),this.syncDiff(i,{joins:a,leaves:l},s,r)}static syncDiff(e,t,s,r){const{joins:i,leaves:o}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return s||(s=()=>{}),r||(r=()=>{}),this.map(i,(a,l)=>{var c;const h=(c=e[a])!==null&&c!==void 0?c:[];if(e[a]=this.cloneDeep(l),h.length>0){const u=e[a].map(f=>f.presence_ref),d=h.filter(f=>u.indexOf(f.presence_ref)<0);e[a].unshift(...d)}s(a,h,l)}),this.map(o,(a,l)=>{let c=e[a];if(!c)return;const h=l.map(u=>u.presence_ref);c=c.filter(u=>h.indexOf(u.presence_ref)<0),e[a]=c,r(a,c,l),c.length===0&&delete e[a]}),e}static map(e,t){return Object.getOwnPropertyNames(e).map(s=>t(s,e[s]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((t,s)=>{const r=e[s];return"metas"in r?t[s]=r.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):t[s]=r,t},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var st;(function(n){n.ALL="*",n.INSERT="INSERT",n.UPDATE="UPDATE",n.DELETE="DELETE"})(st||(st={}));var ce;(function(n){n.BROADCAST="broadcast",n.PRESENCE="presence",n.POSTGRES_CHANGES="postgres_changes",n.SYSTEM="system"})(ce||(ce={}));var U;(function(n){n.SUBSCRIBED="SUBSCRIBED",n.TIMED_OUT="TIMED_OUT",n.CLOSED="CLOSED",n.CHANNEL_ERROR="CHANNEL_ERROR"})(U||(U={}));class Fe{constructor(e,t={config:{}},s){this.topic=e,this.params=t,this.socket=s,this.bindings={},this.state=E.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config),this.timeout=this.socket.timeout,this.joinPush=new me(this,R.join,this.params,this.timeout),this.rejoinTimer=new bt(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=E.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=E.closed,this.socket._remove(this)}),this._onError(r=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,r),this.state=E.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=E.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",r=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,r),this.state=E.errored,this.rejoinTimer.scheduleTimeout())}),this._on(R.reply,{},(r,i)=>{this._trigger(this._replyEventName(i),r)}),this.presence=new le(this),this.broadcastEndpointURL=kt(this.socket.endPoint),this.private=this.params.config.private||!1}subscribe(e,t=this.timeout){var s,r,i;if(this.socket.isConnected()||this.socket.connect(),this.state==E.closed){const{config:{broadcast:o,presence:a,private:l}}=this.params,c=(r=(s=this.bindings.postgres_changes)===null||s===void 0?void 0:s.map(f=>f.filter))!==null&&r!==void 0?r:[],h=!!this.bindings[ce.PRESENCE]&&this.bindings[ce.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,u={},d={broadcast:o,presence:Object.assign(Object.assign({},a),{enabled:h}),postgres_changes:c,private:l};this.socket.accessTokenValue&&(u.access_token=this.socket.accessTokenValue),this._onError(f=>e?.(U.CHANNEL_ERROR,f)),this._onClose(()=>e?.(U.CLOSED)),this.updateJoinPayload(Object.assign({config:d},u)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",async({postgres_changes:f})=>{var g;if(this.socket.setAuth(),f===void 0){e?.(U.SUBSCRIBED);return}else{const v=this.bindings.postgres_changes,p=(g=v?.length)!==null&&g!==void 0?g:0,S=[];for(let T=0;T{this.state=E.errored,e?.(U.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(f).join(", ")||"error")))}).receive("timeout",()=>{e?.(U.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,s){return this.state===E.joined&&e===ce.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(e,t,s)}async send(e,t={}){var s,r;if(!this._canPush()&&e.type==="broadcast"){const{event:i,payload:o}=e,l={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const c=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(s=t.timeout)!==null&&s!==void 0?s:this.timeout);return await((r=c.body)===null||r===void 0?void 0:r.cancel()),c.ok?"ok":"error"}catch(c){return c.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,a,l;const c=this._push(e.type,e,t.timeout||this.timeout);e.type==="broadcast"&&!(!((l=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||l===void 0)&&l.ack)&&i("ok"),c.receive("ok",()=>i("ok")),c.receive("error",()=>i("error")),c.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=E.leaving;const t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(R.close,"leave",this._joinRef())};this.joinPush.destroy();let s=null;return new Promise(r=>{s=new me(this,R.leave,{},e),s.receive("ok",()=>{t(),r("ok")}).receive("timeout",()=>{t(),r("timed out")}).receive("error",()=>{r("error")}),s.send(),this._canPush()||s.trigger("ok",{})}).finally(()=>{s?.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=E.closed,this.bindings={}}async _fetchWithTimeout(e,t,s){const r=new AbortController,i=setTimeout(()=>r.abort(),s),o=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(i),o}_push(e,t,s=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let r=new me(this,e,t,s);return this._canPush()?r.send():this._addToPushBuffer(r),r}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>Zt){const t=this.pushBuffer.shift();t&&(t.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${t.event}`,t.payload))}}_onMessage(e,t,s){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,s){var r,i;const o=e.toLocaleLowerCase(),{close:a,error:l,leave:c,join:h}=R;if(s&&[a,l,c,h].indexOf(o)>=0&&s!==this._joinRef())return;let d=this._onMessage(o,t,s);if(t&&!d)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(r=this.bindings.postgres_changes)===null||r===void 0||r.filter(f=>{var g,v,p;return((g=f.filter)===null||g===void 0?void 0:g.event)==="*"||((p=(v=f.filter)===null||v===void 0?void 0:v.event)===null||p===void 0?void 0:p.toLocaleLowerCase())===o}).map(f=>f.callback(d,s)):(i=this.bindings[o])===null||i===void 0||i.filter(f=>{var g,v,p,S,T,_;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in f){const b=f.id,A=(g=f.filter)===null||g===void 0?void 0:g.event;return b&&((v=t.ids)===null||v===void 0?void 0:v.includes(b))&&(A==="*"||A?.toLocaleLowerCase()===((p=t.data)===null||p===void 0?void 0:p.type.toLocaleLowerCase()))}else{const b=(T=(S=f?.filter)===null||S===void 0?void 0:S.event)===null||T===void 0?void 0:T.toLocaleLowerCase();return b==="*"||b===((_=t?.event)===null||_===void 0?void 0:_.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===o}).map(f=>{if(typeof d=="object"&&"ids"in d){const g=d.data,{schema:v,table:p,commit_timestamp:S,type:T,errors:_}=g;d=Object.assign(Object.assign({},{schema:v,table:p,commit_timestamp:S,eventType:T,new:{},old:{},errors:_}),this._getPayloadRecords(g))}f.callback(d,s)})}_isClosed(){return this.state===E.closed}_isJoined(){return this.state===E.joined}_isJoining(){return this.state===E.joining}_isLeaving(){return this.state===E.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,s){const r=e.toLocaleLowerCase(),i={type:r,filter:t,callback:s};return this.bindings[r]?this.bindings[r].push(i):this.bindings[r]=[i],this}_off(e,t){const s=e.toLocaleLowerCase();return this.bindings[s]&&(this.bindings[s]=this.bindings[s].filter(r=>{var i;return!(((i=r.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===s&&Fe.isEqual(r.filter,t))})),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(R.close,{},e)}_onError(e){this._on(R.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=E.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const t={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(t.new=et(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(t.old=et(e.columns,e.old_record)),t}}const ke=()=>{},ge={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},as=[1e3,2e3,5e3,1e4],ls=1e4,cs=` - addEventListener("message", (e) => { - if (e.data.event === "start") { - setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); - } - });`;class hs{constructor(e,t){var s;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=$e,this.transport=null,this.heartbeatIntervalMs=ge.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=ke,this.ref=0,this.reconnectTimer=null,this.logger=ke,this.conn=null,this.sendBuffer=[],this.serializer=new es,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=r=>{let i;return r?i=r:typeof fetch>"u"?i=(...o)=>ue(async()=>{const{default:a}=await Promise.resolve().then(()=>ne);return{default:a}},void 0).then(({default:a})=>a(...o)).catch(a=>{throw new Error(`Failed to load @supabase/node-fetch: ${a.message}. This is required for HTTP requests in Node.js environments without native fetch.`)}):i=fetch,(...o)=>i(...o)},!(!((s=t?.params)===null||s===void 0)&&s.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=t.params.apikey,this.endPoint=`${e}/${Ce.websocket}`,this.httpEndpoint=kt(e),this._initializeOptions(t),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(t?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=Gt.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const t=e.message;throw t.includes("Node.js")?new Error(`${t} - -To use Realtime in Node.js, you need to provide a WebSocket implementation: - -Option 1: Use Node.js 22+ which has native WebSocket support -Option 2: Install and provide the "ws" package: - - npm install ws - - import ws from "ws" - const client = new RealtimeClient(url, { - ...options, - transport: ws - })`):new Error(`WebSocket not available: ${t}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:Yt}))}disconnect(e,t){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const s=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(s),this._setConnectionState("disconnected")},e?this.conn.close(e,t??""):this.conn.close(),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const t=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),t}async removeAllChannels(){const e=await Promise.all(this.channels.map(t=>t.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,t,s){this.logger(e,t,s)}connectionState(){switch(this.conn&&this.conn.readyState){case ae.connecting:return W.Connecting;case ae.open:return W.Open;case ae.closing:return W.Closing;default:return W.Closed}}isConnected(){return this.connectionState()===W.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(e,t={config:{}}){const s=`realtime:${e}`,r=this.getChannels().find(i=>i.topic===s);if(r)return r;{const i=new Fe(`realtime:${e}`,t,this);return this.channels.push(i),i}}push(e){const{topic:t,event:s,payload:r,ref:i}=e,o=()=>{this.encode(e,a=>{var l;(l=this.conn)===null||l===void 0||l.send(a)})};this.log("push",`${t} ${s} (${i})`,r),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var e;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(t){this.log("error","error in heartbeat callback",t)}this._wasManualDisconnect=!1,(e=this.conn)===null||e===void 0||e.close(Xt,"heartbeat timeout"),setTimeout(()=>{var t;this.isConnected()||(t=this.reconnectTimer)===null||t===void 0||t.scheduleTimeout()},ge.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(t){this.log("error","error in heartbeat callback",t)}this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let t=this.channels.find(s=>s.topic===e&&(s._isJoined()||s._isJoining()));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,t=>{if(t.topic==="phoenix"&&t.event==="phx_reply")try{this.heartbeatCallback(t.payload.status==="ok"?"ok":"error")}catch(c){this.log("error","error in heartbeat callback",c)}t.ref&&t.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:s,event:r,payload:i,ref:o}=t,a=o?`(${o})`:"",l=i.status||"";this.log("receive",`${l} ${s} ${r} ${a}`.trim(),i),this.channels.filter(c=>c._isMember(s)).forEach(c=>c._trigger(r,i,o)),this._triggerStateCallbacks("message",t)})}_clearTimer(e){var t;e==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):e==="reconnect"&&((t=this.reconnectTimer)===null||t===void 0||t.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_teardownConnection(){this.conn&&(this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null),this._clearAllTimers(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=t=>{this.log("worker","worker error",t.message),this.workerRef.terminate()},this.workerRef.onmessage=t=>{t.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(e){var t;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(t=this.reconnectTimer)===null||t===void 0||t.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e)}_triggerChanError(){this.channels.forEach(e=>e._trigger(R.error))}_appendParams(e,t){if(Object.keys(t).length===0)return e;const s=e.match(/\?/)?"&":"?",r=new URLSearchParams(t);return`${e}${s}${r}`}_workerObjectUrl(e){let t;if(e)t=e;else{const s=new Blob([cs],{type:"application/javascript"});t=URL.createObjectURL(s)}return t}_setConnectionState(e,t=!1){this._connectionState=e,e==="connecting"?this._wasManualDisconnect=!1:e==="disconnecting"&&(this._wasManualDisconnect=t)}async _performAuth(e=null){let t;e?t=e:this.accessToken?t=await this.accessToken():t=this.accessTokenValue,this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(s=>{const r={access_token:t,version:Qt};t&&s.updateJoinPayload(r),s.joinedOnce&&s._isJoined()&&s._push(R.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this.setAuth().catch(t=>{this.log("error",`error setting auth in ${e}`,t)})}_triggerStateCallbacks(e,t){try{this.stateChangeCallbacks[e].forEach(s=>{try{s(t)}catch(r){this.log("error",`error in ${e} callback`,r)}})}catch(s){this.log("error",`error triggering ${e} callbacks`,s)}}_setupReconnectionTimer(){this.reconnectTimer=new bt(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},ge.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var t,s,r,i,o,a,l,c,h;if(this.transport=(t=e?.transport)!==null&&t!==void 0?t:null,this.timeout=(s=e?.timeout)!==null&&s!==void 0?s:$e,this.heartbeatIntervalMs=(r=e?.heartbeatIntervalMs)!==null&&r!==void 0?r:ge.HEARTBEAT_INTERVAL,this.worker=(i=e?.worker)!==null&&i!==void 0?i:!1,this.accessToken=(o=e?.accessToken)!==null&&o!==void 0?o:null,this.heartbeatCallback=(a=e?.heartbeatCallback)!==null&&a!==void 0?a:ke,e?.params&&(this.params=e.params),e?.logger&&(this.logger=e.logger),(e?.logLevel||e?.log_level)&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(l=e?.reconnectAfterMs)!==null&&l!==void 0?l:(u=>as[u-1]||ls),this.encode=(c=e?.encode)!==null&&c!==void 0?c:((u,d)=>d(JSON.stringify(u))),this.decode=(h=e?.decode)!==null&&h!==void 0?h:this.serializer.decode.bind(this.serializer),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e?.workerUrl}}}class We extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function j(n){return typeof n=="object"&&n!==null&&"__isStorageError"in n}class us extends We{constructor(e,t,s){super(e),this.name="StorageApiError",this.status=t,this.statusCode=s}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class xe extends We{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}var ds=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(h){try{c(s.next(h))}catch(u){o(u)}}function l(h){try{c(s.throw(h))}catch(u){o(u)}}function c(h){h.done?i(h.value):r(h.value).then(a,l)}c((s=s.apply(n,e||[])).next())})};const St=n=>{let e;return n?e=n:typeof fetch>"u"?e=(...t)=>ue(async()=>{const{default:s}=await Promise.resolve().then(()=>ne);return{default:s}},void 0).then(({default:s})=>s(...t)):e=fetch,(...t)=>e(...t)},fs=()=>ds(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield ue(()=>Promise.resolve().then(()=>ne),void 0)).Response:Response}),Ie=n=>{if(Array.isArray(n))return n.map(t=>Ie(t));if(typeof n=="function"||n!==Object(n))return n;const e={};return Object.entries(n).forEach(([t,s])=>{const r=t.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[r]=Ie(s)}),e},gs=n=>{if(typeof n!="object"||n===null)return!1;const e=Object.getPrototypeOf(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)};var K=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(h){try{c(s.next(h))}catch(u){o(u)}}function l(h){try{c(s.throw(h))}catch(u){o(u)}}function c(h){h.done?i(h.value):r(h.value).then(a,l)}c((s=s.apply(n,e||[])).next())})};const Se=n=>n.msg||n.message||n.error_description||n.error||JSON.stringify(n),ps=(n,e,t)=>K(void 0,void 0,void 0,function*(){const s=yield fs();n instanceof s&&!t?.noResolveJson?n.json().then(r=>{const i=n.status||500,o=r?.statusCode||i+"";e(new us(Se(r),i,o))}).catch(r=>{e(new xe(Se(r),r))}):e(new xe(Se(n),n))}),_s=(n,e,t,s)=>{const r={method:n,headers:e?.headers||{}};return n==="GET"||!s?r:(gs(s)?(r.headers=Object.assign({"Content-Type":"application/json"},e?.headers),r.body=JSON.stringify(s)):r.body=s,e?.duplex&&(r.duplex=e.duplex),Object.assign(Object.assign({},r),t))};function de(n,e,t,s,r,i){return K(this,void 0,void 0,function*(){return new Promise((o,a)=>{n(t,_s(e,s,r,i)).then(l=>{if(!l.ok)throw l;return s?.noResolveJson?l:l.json()}).then(l=>o(l)).catch(l=>ps(l,a,s))})})}function we(n,e,t,s){return K(this,void 0,void 0,function*(){return de(n,"GET",e,t,s)})}function x(n,e,t,s,r){return K(this,void 0,void 0,function*(){return de(n,"POST",e,s,r,t)})}function Ue(n,e,t,s,r){return K(this,void 0,void 0,function*(){return de(n,"PUT",e,s,r,t)})}function vs(n,e,t,s){return K(this,void 0,void 0,function*(){return de(n,"HEAD",e,Object.assign(Object.assign({},t),{noResolveJson:!0}),s)})}function Tt(n,e,t,s,r){return K(this,void 0,void 0,function*(){return de(n,"DELETE",e,s,r,t)})}var $=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(h){try{c(s.next(h))}catch(u){o(u)}}function l(h){try{c(s.throw(h))}catch(u){o(u)}}function c(h){h.done?i(h.value):r(h.value).then(a,l)}c((s=s.apply(n,e||[])).next())})};const ws={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},rt={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class ys{constructor(e,t={},s,r){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.bucketId=s,this.fetch=St(r)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(e,t,s,r){return $(this,void 0,void 0,function*(){try{let i;const o=Object.assign(Object.assign({},rt),r);let a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const l=o.metadata;typeof Blob<"u"&&s instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),l&&i.append("metadata",this.encodeMetadata(l)),i.append("",s)):typeof FormData<"u"&&s instanceof FormData?(i=s,i.append("cacheControl",o.cacheControl),l&&i.append("metadata",this.encodeMetadata(l))):(i=s,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,l&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(l)))),r?.headers&&(a=Object.assign(Object.assign({},a),r.headers));const c=this._removeEmptyFolders(t),h=this._getFinalPath(c),u=yield(e=="PUT"?Ue:x)(this.fetch,`${this.url}/object/${h}`,i,Object.assign({headers:a},o?.duplex?{duplex:o.duplex}:{}));return{data:{path:c,id:u.Id,fullPath:u.Key},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(j(i))return{data:null,error:i};throw i}})}upload(e,t,s){return $(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,s)})}uploadToSignedUrl(e,t,s,r){return $(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(e),o=this._getFinalPath(i),a=new URL(this.url+`/object/upload/sign/${o}`);a.searchParams.set("token",t);try{let l;const c=Object.assign({upsert:rt.upsert},r),h=Object.assign(Object.assign({},this.headers),{"x-upsert":String(c.upsert)});typeof Blob<"u"&&s instanceof Blob?(l=new FormData,l.append("cacheControl",c.cacheControl),l.append("",s)):typeof FormData<"u"&&s instanceof FormData?(l=s,l.append("cacheControl",c.cacheControl)):(l=s,h["cache-control"]=`max-age=${c.cacheControl}`,h["content-type"]=c.contentType);const u=yield Ue(this.fetch,a.toString(),l,{headers:h});return{data:{path:i,fullPath:u.Key},error:null}}catch(l){if(this.shouldThrowOnError)throw l;if(j(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(e,t){return $(this,void 0,void 0,function*(){try{let s=this._getFinalPath(e);const r=Object.assign({},this.headers);t?.upsert&&(r["x-upsert"]="true");const i=yield x(this.fetch,`${this.url}/object/upload/sign/${s}`,{},{headers:r}),o=new URL(this.url+i.url),a=o.searchParams.get("token");if(!a)throw new We("No token returned by API");return{data:{signedUrl:o.toString(),path:e,token:a},error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(j(s))return{data:null,error:s};throw s}})}update(e,t,s){return $(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,s)})}move(e,t,s){return $(this,void 0,void 0,function*(){try{return{data:yield x(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:s?.destinationBucket},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(j(r))return{data:null,error:r};throw r}})}copy(e,t,s){return $(this,void 0,void 0,function*(){try{return{data:{path:(yield x(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:s?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(j(r))return{data:null,error:r};throw r}})}createSignedUrl(e,t,s){return $(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e),i=yield x(this.fetch,`${this.url}/object/sign/${r}`,Object.assign({expiresIn:t},s?.transform?{transform:s.transform}:{}),{headers:this.headers});const o=s?.download?`&download=${s.download===!0?"":s.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(j(r))return{data:null,error:r};throw r}})}createSignedUrls(e,t,s){return $(this,void 0,void 0,function*(){try{const r=yield x(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),i=s?.download?`&download=${s.download===!0?"":s.download}`:"";return{data:r.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${i}`):null})),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(j(r))return{data:null,error:r};throw r}})}download(e,t){return $(this,void 0,void 0,function*(){const r=typeof t?.transform<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString(t?.transform||{}),o=i?`?${i}`:"";try{const a=this._getFinalPath(e);return{data:yield(yield we(this.fetch,`${this.url}/${r}/${a}${o}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(j(a))return{data:null,error:a};throw a}})}info(e){return $(this,void 0,void 0,function*(){const t=this._getFinalPath(e);try{const s=yield we(this.fetch,`${this.url}/object/info/${t}`,{headers:this.headers});return{data:Ie(s),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(j(s))return{data:null,error:s};throw s}})}exists(e){return $(this,void 0,void 0,function*(){const t=this._getFinalPath(e);try{return yield vs(this.fetch,`${this.url}/object/${t}`,{headers:this.headers}),{data:!0,error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(j(s)&&s instanceof xe){const r=s.originalError;if([400,404].includes(r?.status))return{data:!1,error:s}}throw s}})}getPublicUrl(e,t){const s=this._getFinalPath(e),r=[],i=t?.download?`download=${t.download===!0?"":t.download}`:"";i!==""&&r.push(i);const a=typeof t?.transform<"u"?"render/image":"object",l=this.transformOptsToQueryString(t?.transform||{});l!==""&&r.push(l);let c=r.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${s}${c}`)}}}remove(e){return $(this,void 0,void 0,function*(){try{return{data:yield Tt(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(j(t))return{data:null,error:t};throw t}})}list(e,t,s){return $(this,void 0,void 0,function*(){try{const r=Object.assign(Object.assign(Object.assign({},ws),t),{prefix:e||""});return{data:yield x(this.fetch,`${this.url}/object/list/${this.bucketId}`,r,{headers:this.headers},s),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(j(r))return{data:null,error:r};throw r}})}listV2(e,t){return $(this,void 0,void 0,function*(){try{const s=Object.assign({},e);return{data:yield x(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,s,{headers:this.headers},t),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(j(s))return{data:null,error:s};throw s}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}}const bs="2.12.1",ms={"X-Client-Info":`storage-js/${bs}`};var Y=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(h){try{c(s.next(h))}catch(u){o(u)}}function l(h){try{c(s.throw(h))}catch(u){o(u)}}function c(h){h.done?i(h.value):r(h.value).then(a,l)}c((s=s.apply(n,e||[])).next())})};class ks{constructor(e,t={},s,r){this.shouldThrowOnError=!1;const i=new URL(e);r?.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase.")),this.url=i.href,this.headers=Object.assign(Object.assign({},ms),t),this.fetch=St(s)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(){return Y(this,void 0,void 0,function*(){try{return{data:yield we(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(j(e))return{data:null,error:e};throw e}})}getBucket(e){return Y(this,void 0,void 0,function*(){try{return{data:yield we(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(j(t))return{data:null,error:t};throw t}})}createBucket(e,t={public:!1}){return Y(this,void 0,void 0,function*(){try{return{data:yield x(this.fetch,`${this.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(j(s))return{data:null,error:s};throw s}})}updateBucket(e,t){return Y(this,void 0,void 0,function*(){try{return{data:yield Ue(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(j(s))return{data:null,error:s};throw s}})}emptyBucket(e){return Y(this,void 0,void 0,function*(){try{return{data:yield x(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(j(t))return{data:null,error:t};throw t}})}deleteBucket(e){return Y(this,void 0,void 0,function*(){try{return{data:yield Tt(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(j(t))return{data:null,error:t};throw t}})}}class Ss extends ks{constructor(e,t={},s,r){super(e,t,s,r)}from(e){return new ys(this.url,this.headers,e,this.fetch)}}const Ts="2.57.4";let oe="";typeof Deno<"u"?oe="deno":typeof document<"u"?oe="web":typeof navigator<"u"&&navigator.product==="ReactNative"?oe="react-native":oe="node";const Es={"X-Client-Info":`supabase-js-${oe}/${Ts}`},js={headers:Es},Os={schema:"public"},As={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Ps={};var $s=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(h){try{c(s.next(h))}catch(u){o(u)}}function l(h){try{c(s.throw(h))}catch(u){o(u)}}function c(h){h.done?i(h.value):r(h.value).then(a,l)}c((s=s.apply(n,e||[])).next())})};const Cs=n=>{let e;return n?e=n:typeof fetch>"u"?e=gt:e=fetch,(...t)=>e(...t)},Rs=()=>typeof Headers>"u"?pt:Headers,xs=(n,e,t)=>{const s=Cs(t),r=Rs();return(i,o)=>$s(void 0,void 0,void 0,function*(){var a;const l=(a=yield e())!==null&&a!==void 0?a:n;let c=new r(o?.headers);return c.has("apikey")||c.set("apikey",n),c.has("Authorization")||c.set("Authorization",`Bearer ${l}`),s(i,Object.assign(Object.assign({},o),{headers:c}))})};var Is=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(h){try{c(s.next(h))}catch(u){o(u)}}function l(h){try{c(s.throw(h))}catch(u){o(u)}}function c(h){h.done?i(h.value):r(h.value).then(a,l)}c((s=s.apply(n,e||[])).next())})};function Us(n){return n.endsWith("/")?n:n+"/"}function Ls(n,e){var t,s;const{db:r,auth:i,realtime:o,global:a}=n,{db:l,auth:c,realtime:h,global:u}=e,d={db:Object.assign(Object.assign({},l),r),auth:Object.assign(Object.assign({},c),i),realtime:Object.assign(Object.assign({},h),o),storage:{},global:Object.assign(Object.assign(Object.assign({},u),a),{headers:Object.assign(Object.assign({},(t=u?.headers)!==null&&t!==void 0?t:{}),(s=a?.headers)!==null&&s!==void 0?s:{})}),accessToken:()=>Is(this,void 0,void 0,function*(){return""})};return n.accessToken?d.accessToken=n.accessToken:delete d.accessToken,d}function Ds(n){const e=n?.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(Us(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}const Et="2.71.1",se=30*1e3,Le=3,Te=Le*se,Ns="http://localhost:9999",Bs="supabase.auth.token",qs={"X-Client-Info":`gotrue-js/${Et}`},De="X-Supabase-Api-Version",jt={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},Ms=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Fs=600*1e3;class Ke extends Error{constructor(e,t,s){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=s}}function w(n){return typeof n=="object"&&n!==null&&"__isAuthError"in n}class Ws extends Ke{constructor(e,t,s){super(e,t,s),this.name="AuthApiError",this.status=t,this.code=s}}function Ks(n){return w(n)&&n.name==="AuthApiError"}class Ot extends Ke{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class B extends Ke{constructor(e,t,s,r){super(e,s,r),this.name=t,this.status=s}}class D extends B{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Hs(n){return w(n)&&n.name==="AuthSessionMissingError"}class pe extends B{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class _e extends B{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class ve extends B{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function zs(n){return w(n)&&n.name==="AuthImplicitGrantRedirectError"}class it extends B{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Ne extends B{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function Ee(n){return w(n)&&n.name==="AuthRetryableFetchError"}class nt extends B{constructor(e,t,s){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=s}}class Be extends B{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const ye="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),ot=` -\r=`.split(""),Js=(()=>{const n=new Array(128);for(let e=0;e=6;){const s=e.queue>>e.queuedBits-6&63;t(ye[s]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const s=e.queue>>e.queuedBits-6&63;t(ye[s]),e.queuedBits-=6}}function At(n,e,t){const s=Js[n];if(s>-1)for(e.queue=e.queue<<6|s,e.queuedBits+=6;e.queuedBits>=8;)t(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(s===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(n)}"`)}}function lt(n){const e=[],t=o=>{e.push(String.fromCodePoint(o))},s={utf8seq:0,codepoint:0},r={queue:0,queuedBits:0},i=o=>{Qs(o,s,t)};for(let o=0;o>6),e(128|n&63);return}else if(n<=65535){e(224|n>>12),e(128|n>>6&63),e(128|n&63);return}else if(n<=1114111){e(240|n>>18),e(128|n>>12&63),e(128|n>>6&63),e(128|n&63);return}throw new Error(`Unrecognized Unicode codepoint: ${n.toString(16)}`)}function Vs(n,e){for(let t=0;t55295&&s<=56319){const r=(s-55296)*1024&65535;s=(n.charCodeAt(t+1)-56320&65535|r)+65536,t+=1}Gs(s,e)}}function Qs(n,e,t){if(e.utf8seq===0){if(n<=127){t(n);return}for(let s=1;s<6;s+=1)if((n>>7-s&1)===0){e.utf8seq=s;break}if(e.utf8seq===2)e.codepoint=n&31;else if(e.utf8seq===3)e.codepoint=n&15;else if(e.utf8seq===4)e.codepoint=n&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(n<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|n&63,e.utf8seq-=1,e.utf8seq===0&&t(e.codepoint)}}function Ys(n){const e=[],t={queue:0,queuedBits:0},s=r=>{e.push(r)};for(let r=0;re.push(t)),new Uint8Array(e)}function Zs(n){const e=[],t={queue:0,queuedBits:0},s=r=>{e.push(r)};return n.forEach(r=>at(r,t,s)),at(null,t,s),e.join("")}function er(n){return Math.round(Date.now()/1e3)+n}function tr(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const e=Math.random()*16|0;return(n=="x"?e:e&3|8).toString(16)})}const C=()=>typeof window<"u"&&typeof document<"u",q={tested:!1,writable:!1},Pt=()=>{if(!C())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(q.tested)return q.writable;const n=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(n,n),globalThis.localStorage.removeItem(n),q.tested=!0,q.writable=!0}catch{q.tested=!0,q.writable=!1}return q.writable};function sr(n){const e={},t=new URL(n);if(t.hash&&t.hash[0]==="#")try{new URLSearchParams(t.hash.substring(1)).forEach((r,i)=>{e[i]=r})}catch{}return t.searchParams.forEach((s,r)=>{e[r]=s}),e}const $t=n=>{let e;return n?e=n:typeof fetch>"u"?e=(...t)=>ue(async()=>{const{default:s}=await Promise.resolve().then(()=>ne);return{default:s}},void 0).then(({default:s})=>s(...t)):e=fetch,(...t)=>e(...t)},rr=n=>typeof n=="object"&&n!==null&&"status"in n&&"ok"in n&&"json"in n&&typeof n.json=="function",re=async(n,e,t)=>{await n.setItem(e,JSON.stringify(t))},M=async(n,e)=>{const t=await n.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch{return t}},L=async(n,e)=>{await n.removeItem(e)};class be{constructor(){this.promise=new be.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}be.promiseConstructor=Promise;function je(n){const e=n.split(".");if(e.length!==3)throw new Be("Invalid JWT structure");for(let s=0;s{setTimeout(()=>e(null),n)})}function nr(n,e){return new Promise((s,r)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await n(i);if(!e(i,null,o)){s(o);return}}catch(o){if(!e(i,o)){r(o);return}}})()})}function or(n){return("0"+n.toString(16)).substr(-2)}function ar(){const e=new Uint32Array(56);if(typeof crypto>"u"){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",s=t.length;let r="";for(let i=0;i<56;i++)r+=t.charAt(Math.floor(Math.random()*s));return r}return crypto.getRandomValues(e),Array.from(e,or).join("")}async function lr(n){const t=new TextEncoder().encode(n),s=await crypto.subtle.digest("SHA-256",t),r=new Uint8Array(s);return Array.from(r).map(i=>String.fromCharCode(i)).join("")}async function cr(n){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return n;const t=await lr(n);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function X(n,e,t=!1){const s=ar();let r=s;t&&(r+="/PASSWORD_RECOVERY"),await re(n,`${e}-code-verifier`,r);const i=await cr(s);return[i,s===i?"plain":"s256"]}const hr=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function ur(n){const e=n.headers.get(De);if(!e||!e.match(hr))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function dr(n){if(!n)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(n<=e)throw new Error("JWT has expired")}function fr(n){switch(n){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const gr=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Z(n){if(!gr.test(n))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Oe(){const n={};return new Proxy(n,{get:(e,t)=>{if(t==="__isUserNotAvailableProxy")return!0;if(typeof t=="symbol"){const s=t.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function ct(n){return JSON.parse(JSON.stringify(n))}var pr=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);rn.msg||n.message||n.error_description||n.error||JSON.stringify(n),_r=[502,503,504];async function ht(n){var e;if(!rr(n))throw new Ne(F(n),0);if(_r.includes(n.status))throw new Ne(F(n),n.status);let t;try{t=await n.json()}catch(i){throw new Ot(F(i),i)}let s;const r=ur(n);if(r&&r.getTime()>=jt["2024-01-01"].timestamp&&typeof t=="object"&&t&&typeof t.code=="string"?s=t.code:typeof t=="object"&&t&&typeof t.error_code=="string"&&(s=t.error_code),s){if(s==="weak_password")throw new nt(F(t),n.status,((e=t.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(s==="session_not_found")throw new D}else if(typeof t=="object"&&t&&typeof t.weak_password=="object"&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((i,o)=>i&&typeof o=="string",!0))throw new nt(F(t),n.status,t.weak_password.reasons);throw new Ws(F(t),n.status||500,s)}const vr=(n,e,t,s)=>{const r={method:n,headers:e?.headers||{}};return n==="GET"?r:(r.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e?.headers),r.body=JSON.stringify(s),Object.assign(Object.assign({},r),t))};async function y(n,e,t,s){var r;const i=Object.assign({},s?.headers);i[De]||(i[De]=jt["2024-01-01"].name),s?.jwt&&(i.Authorization=`Bearer ${s.jwt}`);const o=(r=s?.query)!==null&&r!==void 0?r:{};s?.redirectTo&&(o.redirect_to=s.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await wr(n,e,t+a,{headers:i,noResolveJson:s?.noResolveJson},{},s?.body);return s?.xform?s?.xform(l):{data:Object.assign({},l),error:null}}async function wr(n,e,t,s,r,i){const o=vr(e,s,r,i);let a;try{a=await n(t,Object.assign({},o))}catch(l){throw new Ne(F(l),0)}if(a.ok||await ht(a),s?.noResolveJson)return a;try{return await a.json()}catch(l){await ht(l)}}function I(n){var e;let t=null;kr(n)&&(t=Object.assign({},n),n.expires_at||(t.expires_at=er(n.expires_in)));const s=(e=n.user)!==null&&e!==void 0?e:n;return{data:{session:t,user:s},error:null}}function ut(n){const e=I(n);return!e.error&&n.weak_password&&typeof n.weak_password=="object"&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.message&&typeof n.weak_password.message=="string"&&n.weak_password.reasons.reduce((t,s)=>t&&typeof s=="string",!0)&&(e.data.weak_password=n.weak_password),e}function N(n){var e;return{data:{user:(e=n.user)!==null&&e!==void 0?e:n},error:null}}function yr(n){return{data:n,error:null}}function br(n){const{action_link:e,email_otp:t,hashed_token:s,redirect_to:r,verification_type:i}=n,o=pr(n,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:t,hashed_token:s,redirect_to:r,verification_type:i},l=Object.assign({},o);return{data:{properties:a,user:l},error:null}}function mr(n){return n}function kr(n){return n.access_token&&n.refresh_token&&n.expires_in}const Ae=["global","local","others"];var Sr=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r0&&(f.forEach(g=>{const v=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),p=JSON.parse(g.split(";")[1].split("=")[1]);c[`${p}Page`]=v}),c.total=parseInt(d)),{data:Object.assign(Object.assign({},u),c),error:null}}catch(c){if(w(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){Z(e);try{return await y(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:N})}catch(t){if(w(t))return{data:{user:null},error:t};throw t}}async updateUserById(e,t){Z(e);try{return await y(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:N})}catch(s){if(w(s))return{data:{user:null},error:s};throw s}}async deleteUser(e,t=!1){Z(e);try{return await y(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:N})}catch(s){if(w(s))return{data:{user:null},error:s};throw s}}async _listFactors(e){Z(e.userId);try{const{data:t,error:s}=await y(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:r=>({data:{factors:r},error:null})});return{data:t,error:s}}catch(t){if(w(t))return{data:null,error:t};throw t}}async _deleteFactor(e){Z(e.userId),Z(e.id);try{return{data:await y(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(t){if(w(t))return{data:null,error:t};throw t}}}function dt(n={}){return{getItem:e=>n[e]||null,setItem:(e,t)=>{n[e]=t},removeItem:e=>{delete n[e]}}}function Er(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}const ee={debug:!!(globalThis&&Pt()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Ct extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class jr extends Ct{}async function Or(n,e,t){ee.debug;const s=new globalThis.AbortController;return e>0&&setTimeout(()=>{s.abort(),ee.debug},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(n,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:s.signal},async r=>{if(r){ee.debug;try{return await t()}finally{ee.debug}}else{if(e===0)throw ee.debug,new jr(`Acquiring an exclusive Navigator LockManager lock "${n}" immediately failed`);if(ee.debug)try{const i=await globalThis.navigator.locks.query()}catch{}return await t()}}))}Er();const Ar={url:Ns,storageKey:Bs,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:qs,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function ft(n,e,t){return await t()}const te={};class he{constructor(e){var t,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=he.nextInstanceID,he.nextInstanceID+=1,this.instanceID>0&&C();const r=Object.assign(Object.assign({},Ar),e);if(this.logDebugMessages=!!r.debug,typeof r.debug=="function"&&(this.logger=r.debug),this.persistSession=r.persistSession,this.storageKey=r.storageKey,this.autoRefreshToken=r.autoRefreshToken,this.admin=new Tr({url:r.url,headers:r.headers,fetch:r.fetch}),this.url=r.url,this.headers=r.headers,this.fetch=$t(r.fetch),this.lock=r.lock||ft,this.detectSessionInUrl=r.detectSessionInUrl,this.flowType=r.flowType,this.hasCustomAuthorizationHeader=r.hasCustomAuthorizationHeader,r.lock?this.lock=r.lock:C()&&(!((t=globalThis?.navigator)===null||t===void 0)&&t.locks)?this.lock=Or:this.lock=ft,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?(r.storage?this.storage=r.storage:Pt()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=dt(this.memoryStorage)),r.userStorage&&(this.userStorage=r.userStorage)):(this.memoryStorage={},this.storage=dt(this.memoryStorage)),C()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch{}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}get jwks(){var e,t;return(t=(e=te[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&t!==void 0?t:{keys:[]}}set jwks(e){te[this.storageKey]=Object.assign(Object.assign({},te[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,t;return(t=(e=te[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&t!==void 0?t:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){te[this.storageKey]=Object.assign(Object.assign({},te[this.storageKey]),{cachedAt:e})}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${Et}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{const t=sr(window.location.href);let s="none";if(this._isImplicitGrantCallback(t)?s="implicit":await this._isPKCECallback(t)&&(s="pkce"),C()&&this.detectSessionInUrl&&s!=="none"){const{data:r,error:i}=await this._getSessionFromURL(t,s);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),zs(i)){const l=(e=i.details)===null||e===void 0?void 0:e.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:i}}return await this._removeSession(),{error:i}}const{session:o,redirectType:a}=r;return this._debug("#_initialize()","detected session in URL",o,"redirect type",a),await this._saveSession(o),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(t){return w(t)?{error:t}:{error:new Ot("Unexpected error during initialization",t)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,s,r;try{const i=await y(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(s=(t=e?.options)===null||t===void 0?void 0:t.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:(r=e?.options)===null||r===void 0?void 0:r.captchaToken}},xform:I}),{data:o,error:a}=i;if(a||!o)return{data:{user:null,session:null},error:a};const l=o.session,c=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:c,session:l},error:null}}catch(i){if(w(i))return{data:{user:null,session:null},error:i};throw i}}async signUp(e){var t,s,r;try{let i;if("email"in e){const{email:h,password:u,options:d}=e;let f=null,g=null;this.flowType==="pkce"&&([f,g]=await X(this.storage,this.storageKey)),i=await y(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:d?.emailRedirectTo,body:{email:h,password:u,data:(t=d?.data)!==null&&t!==void 0?t:{},gotrue_meta_security:{captcha_token:d?.captchaToken},code_challenge:f,code_challenge_method:g},xform:I})}else if("phone"in e){const{phone:h,password:u,options:d}=e;i=await y(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:h,password:u,data:(s=d?.data)!==null&&s!==void 0?s:{},channel:(r=d?.channel)!==null&&r!==void 0?r:"sms",gotrue_meta_security:{captcha_token:d?.captchaToken}},xform:I})}else throw new _e("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return{data:{user:null,session:null},error:a};const l=o.session,c=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:c,session:l},error:null}}catch(i){if(w(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithPassword(e){try{let t;if("email"in e){const{email:i,password:o,options:a}=e;t=await y(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ut})}else if("phone"in e){const{phone:i,password:o,options:a}=e;t=await y(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ut})}else throw new _e("You must provide either an email or phone number and a password");const{data:s,error:r}=t;return r?{data:{user:null,session:null},error:r}:!s||!s.session||!s.user?{data:{user:null,session:null},error:new pe}:(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),{data:Object.assign({user:s.user,session:s.session},s.weak_password?{weakPassword:s.weak_password}:null),error:r})}catch(t){if(w(t))return{data:{user:null,session:null},error:t};throw t}}async signInWithOAuth(e){var t,s,r,i;return await this._handleProviderSignIn(e.provider,{redirectTo:(t=e.options)===null||t===void 0?void 0:t.redirectTo,scopes:(s=e.options)===null||s===void 0?void 0:s.scopes,queryParams:(r=e.options)===null||r===void 0?void 0:r.queryParams,skipBrowserRedirect:(i=e.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:t}=e;if(t==="solana")return await this.signInWithSolana(e);throw new Error(`@supabase/auth-js: Unsupported chain "${t}"`)}async signInWithSolana(e){var t,s,r,i,o,a,l,c,h,u,d,f;let g,v;if("message"in e)g=e.message,v=e.signature;else{const{chain:p,wallet:S,statement:T,options:_}=e;let b;if(C())if(typeof S=="object")b=S;else{const m=window;if("solana"in m&&typeof m.solana=="object"&&("signIn"in m.solana&&typeof m.solana.signIn=="function"||"signMessage"in m.solana&&typeof m.solana.signMessage=="function"))b=m.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof S!="object"||!_?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=S}const A=new URL((t=_?.url)!==null&&t!==void 0?t:window.location.href);if("signIn"in b&&b.signIn){const m=await b.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},_?.signInWithSolana),{version:"1",domain:A.host,uri:A.href}),T?{statement:T}:null));let P;if(Array.isArray(m)&&m[0]&&typeof m[0]=="object")P=m[0];else if(m&&typeof m=="object"&&"signedMessage"in m&&"signature"in m)P=m;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in P&&"signature"in P&&(typeof P.signedMessage=="string"||P.signedMessage instanceof Uint8Array)&&P.signature instanceof Uint8Array)g=typeof P.signedMessage=="string"?P.signedMessage:new TextDecoder().decode(P.signedMessage),v=P.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in b)||typeof b.signMessage!="function"||!("publicKey"in b)||typeof b!="object"||!b.publicKey||!("toBase58"in b.publicKey)||typeof b.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");g=[`${A.host} wants you to sign in with your Solana account:`,b.publicKey.toBase58(),...T?["",T,""]:[""],"Version: 1",`URI: ${A.href}`,`Issued At: ${(r=(s=_?.signInWithSolana)===null||s===void 0?void 0:s.issuedAt)!==null&&r!==void 0?r:new Date().toISOString()}`,...!((i=_?.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${_.signInWithSolana.notBefore}`]:[],...!((o=_?.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${_.signInWithSolana.expirationTime}`]:[],...!((a=_?.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${_.signInWithSolana.chainId}`]:[],...!((l=_?.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${_.signInWithSolana.nonce}`]:[],...!((c=_?.signInWithSolana)===null||c===void 0)&&c.requestId?[`Request ID: ${_.signInWithSolana.requestId}`]:[],...!((u=(h=_?.signInWithSolana)===null||h===void 0?void 0:h.resources)===null||u===void 0)&&u.length?["Resources",..._.signInWithSolana.resources.map(P=>`- ${P}`)]:[]].join(` -`);const m=await b.signMessage(new TextEncoder().encode(g),"utf8");if(!m||!(m instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");v=m}}try{const{data:p,error:S}=await y(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:g,signature:Zs(v)},!((d=e.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(f=e.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:I});if(S)throw S;return!p||!p.session||!p.user?{data:{user:null,session:null},error:new pe}:(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("SIGNED_IN",p.session)),{data:Object.assign({},p),error:S})}catch(p){if(w(p))return{data:{user:null,session:null},error:p};throw p}}async _exchangeCodeForSession(e){const t=await M(this.storage,`${this.storageKey}-code-verifier`),[s,r]=(t??"").split("/");try{const{data:i,error:o}=await y(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:s},xform:I});if(await L(this.storage,`${this.storageKey}-code-verifier`),o)throw o;return!i||!i.session||!i.user?{data:{user:null,session:null,redirectType:null},error:new pe}:(i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign(Object.assign({},i),{redirectType:r??null}),error:o})}catch(i){if(w(i))return{data:{user:null,session:null,redirectType:null},error:i};throw i}}async signInWithIdToken(e){try{const{options:t,provider:s,token:r,access_token:i,nonce:o}=e,a=await y(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:s,id_token:r,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:t?.captchaToken}},xform:I}),{data:l,error:c}=a;return c?{data:{user:null,session:null},error:c}:!l||!l.session||!l.user?{data:{user:null,session:null},error:new pe}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:c})}catch(t){if(w(t))return{data:{user:null,session:null},error:t};throw t}}async signInWithOtp(e){var t,s,r,i,o;try{if("email"in e){const{email:a,options:l}=e;let c=null,h=null;this.flowType==="pkce"&&([c,h]=await X(this.storage,this.storageKey));const{error:u}=await y(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(t=l?.data)!==null&&t!==void 0?t:{},create_user:(s=l?.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},code_challenge:c,code_challenge_method:h},redirectTo:l?.emailRedirectTo});return{data:{user:null,session:null},error:u}}if("phone"in e){const{phone:a,options:l}=e,{data:c,error:h}=await y(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(r=l?.data)!==null&&r!==void 0?r:{},create_user:(i=l?.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},channel:(o=l?.channel)!==null&&o!==void 0?o:"sms"}});return{data:{user:null,session:null,messageId:c?.message_id},error:h}}throw new _e("You must provide either an email or phone number.")}catch(a){if(w(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var t,s;try{let r,i;"options"in e&&(r=(t=e.options)===null||t===void 0?void 0:t.redirectTo,i=(s=e.options)===null||s===void 0?void 0:s.captchaToken);const{data:o,error:a}=await y(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:r,xform:I});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const l=o.session,c=o.user;return l?.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),{data:{user:c,session:l},error:null}}catch(r){if(w(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithSSO(e){var t,s,r;try{let i=null,o=null;return this.flowType==="pkce"&&([i,o]=await X(this.storage,this.storageKey)),await y(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(s=(t=e.options)===null||t===void 0?void 0:t.redirectTo)!==null&&s!==void 0?s:void 0}),!((r=e?.options)===null||r===void 0)&&r.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:o}),headers:this.headers,xform:yr})}catch(i){if(w(i))return{data:null,error:i};throw i}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:t},error:s}=e;if(s)throw s;if(!t)throw new D;const{error:r}=await y(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return{data:{user:null,session:null},error:r}})}catch(e){if(w(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{const t=`${this.url}/resend`;if("email"in e){const{email:s,type:r,options:i}=e,{error:o}=await y(this.fetch,"POST",t,{headers:this.headers,body:{email:s,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},redirectTo:i?.emailRedirectTo});return{data:{user:null,session:null},error:o}}else if("phone"in e){const{phone:s,type:r,options:i}=e,{data:o,error:a}=await y(this.fetch,"POST",t,{headers:this.headers,body:{phone:s,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}}});return{data:{user:null,session:null,messageId:o?.message_id},error:a}}throw new _e("You must provide either an email or phone number and a type")}catch(t){if(w(t))return{data:{user:null,session:null},error:t};throw t}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async t=>t))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const s=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),r=(async()=>(await s,await t()))();return this.pendingInLock.push((async()=>{try{await r}catch{}})()),r}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const s=t();for(this.pendingInLock.push((async()=>{try{await s}catch{}})()),await s;this.pendingInLock.length;){const r=[...this.pendingInLock];await Promise.all(r),this.pendingInLock.splice(0,r.length)}return await s}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const t=await M(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),t!==null&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const s=e.expires_at?e.expires_at*1e3-Date.now()(!o&&c==="user"&&(o=!0,this.suppressGetSessionWarning=!0),Reflect.get(l,c,h))})}return{data:{session:e},error:null}}const{session:r,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{session:null},error:i}:{data:{session:r},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await y(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:N}):await this._useSession(async t=>{var s,r,i;const{data:o,error:a}=t;if(a)throw a;return!(!((s=o.session)===null||s===void 0)&&s.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new D}:await y(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(r=o.session)===null||r===void 0?void 0:r.access_token)!==null&&i!==void 0?i:void 0,xform:N})})}catch(t){if(w(t))return Hs(t)&&(await this._removeSession(),await L(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:t};throw t}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async s=>{const{data:r,error:i}=s;if(i)throw i;if(!r.session)throw new D;const o=r.session;let a=null,l=null;this.flowType==="pkce"&&e.email!=null&&([a,l]=await X(this.storage,this.storageKey));const{data:c,error:h}=await y(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:t?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:l}),jwt:o.access_token,xform:N});if(h)throw h;return o.user=c.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(s){if(w(s))return{data:{user:null},error:s};throw s}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new D;const t=Date.now()/1e3;let s=t,r=!0,i=null;const{payload:o}=je(e.access_token);if(o.exp&&(s=o.exp,r=s<=t),r){const{session:a,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return{data:{user:null,session:null},error:l};if(!a)return{data:{user:null,session:null},error:null};i=a}else{const{data:a,error:l}=await this._getUser(e.access_token);if(l)throw l;i={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:s-t,expires_at:s},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(t){if(w(t))return{data:{session:null,user:null},error:t};throw t}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var s;if(!e){const{data:o,error:a}=t;if(a)throw a;e=(s=o.session)!==null&&s!==void 0?s:void 0}if(!e?.refresh_token)throw new D;const{session:r,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{user:null,session:null},error:i}:r?{data:{user:r.user,session:r},error:null}:{data:{user:null,session:null},error:null}})}catch(t){if(w(t))return{data:{user:null,session:null},error:t};throw t}}async _getSessionFromURL(e,t){try{if(!C())throw new ve("No browser detected.");if(e.error||e.error_description||e.error_code)throw new ve(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if(this.flowType==="pkce")throw new it("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new ve("Not a valid implicit grant flow url.");break;default:}if(t==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new it("No code detected.");const{data:T,error:_}=await this._exchangeCodeForSession(e.code);if(_)throw _;const b=new URL(window.location.href);return b.searchParams.delete("code"),window.history.replaceState(window.history.state,"",b.toString()),{data:{session:T.session,redirectType:null},error:null}}const{provider_token:s,provider_refresh_token:r,access_token:i,refresh_token:o,expires_in:a,expires_at:l,token_type:c}=e;if(!i||!a||!o||!c)throw new ve("No session defined in URL");const h=Math.round(Date.now()/1e3),u=parseInt(a);let d=h+u;l&&(d=parseInt(l)),(d-h)*1e3<=se;const g=d-u;h-g>=120||h-g<0;const{data:v,error:p}=await this._getUser(i);if(p)throw p;const S={provider_token:s,provider_refresh_token:r,access_token:i,expires_in:u,expires_at:d,refresh_token:o,token_type:c,user:v.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:S,redirectType:e.type},error:null}}catch(s){if(w(s))return{data:{session:null,redirectType:null},error:s};throw s}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){const t=await M(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var s;const{data:r,error:i}=t;if(i)return{error:i};const o=(s=r.session)===null||s===void 0?void 0:s.access_token;if(o){const{error:a}=await this.admin.signOut(o,e);if(a&&!(Ks(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await L(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){const t=tr(),s={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,s),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(t)})))(),{data:{subscription:s}}}async _emitInitialSession(e){return await this._useSession(async t=>{var s,r;try{const{data:{session:i},error:o}=t;if(o)throw o;await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",e,"session",i)}catch(i){await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",i)}})}async resetPasswordForEmail(e,t={}){let s=null,r=null;this.flowType==="pkce"&&([s,r]=await X(this.storage,this.storageKey,!0));try{return await y(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:s,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(i){if(w(i))return{data:null,error:i};throw i}}async getUserIdentities(){var e;try{const{data:t,error:s}=await this.getUser();if(s)throw s;return{data:{identities:(e=t.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(t){if(w(t))return{data:null,error:t};throw t}}async linkIdentity(e){var t;try{const{data:s,error:r}=await this._useSession(async i=>{var o,a,l,c,h;const{data:u,error:d}=i;if(d)throw d;const f=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(l=e.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await y(this.fetch,"GET",f,{headers:this.headers,jwt:(h=(c=u.session)===null||c===void 0?void 0:c.access_token)!==null&&h!==void 0?h:void 0})});if(r)throw r;return C()&&!(!((t=e.options)===null||t===void 0)&&t.skipBrowserRedirect)&&window.location.assign(s?.url),{data:{provider:e.provider,url:s?.url},error:null}}catch(s){if(w(s))return{data:{provider:e.provider,url:null},error:s};throw s}}async unlinkIdentity(e){try{return await this._useSession(async t=>{var s,r;const{data:i,error:o}=t;if(o)throw o;return await y(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(r=(s=i.session)===null||s===void 0?void 0:s.access_token)!==null&&r!==void 0?r:void 0})})}catch(t){if(w(t))return{data:null,error:t};throw t}}async _refreshAccessToken(e){const t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{const s=Date.now();return await nr(async r=>(r>0&&await ir(200*Math.pow(2,r-1)),this._debug(t,"refreshing attempt",r),await y(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:I})),(r,i)=>{const o=200*Math.pow(2,r);return i&&Ee(i)&&Date.now()+o-s{try{await a.callback(e,t)}catch(l){i.push(l)}});if(await Promise.all(o),i.length>0){for(let a=0;athis._autoRefreshTokenTick(),se);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async t=>{const{data:{session:s}}=t;if(!s||!s.refresh_token||!s.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const r=Math.floor((s.expires_at*1e3-e)/se);this._debug("#_autoRefreshTokenTick()",`access token expires in ${r} ticks, a tick lasts ${se}ms, refresh threshold is ${Le} ticks`),r<=Le&&await this._callRefreshToken(s.refresh_token)})}catch{}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof Ct)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!C()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch{}}async _onVisibilityChanged(e){const t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,s){const r=[`provider=${encodeURIComponent(t)}`];if(s?.redirectTo&&r.push(`redirect_to=${encodeURIComponent(s.redirectTo)}`),s?.scopes&&r.push(`scopes=${encodeURIComponent(s.scopes)}`),this.flowType==="pkce"){const[i,o]=await X(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});r.push(a.toString())}if(s?.queryParams){const i=new URLSearchParams(s.queryParams);r.push(i.toString())}return s?.skipBrowserRedirect&&r.push(`skip_http_redirect=${s.skipBrowserRedirect}`),`${e}?${r.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var s;const{data:r,error:i}=t;return i?{data:null,error:i}:await y(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(s=r?.session)===null||s===void 0?void 0:s.access_token})})}catch(t){if(w(t))return{data:null,error:t};throw t}}async _enroll(e){try{return await this._useSession(async t=>{var s,r;const{data:i,error:o}=t;if(o)return{data:null,error:o};const a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:l,error:c}=await y(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(s=i?.session)===null||s===void 0?void 0:s.access_token});return c?{data:null,error:c}:(e.factorType==="totp"&&(!((r=l?.totp)===null||r===void 0)&&r.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),{data:l,error:null})})}catch(t){if(w(t))return{data:null,error:t};throw t}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var s;const{data:r,error:i}=t;if(i)return{data:null,error:i};const{data:o,error:a}=await y(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(s=r?.session)===null||s===void 0?void 0:s.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),{data:o,error:a})})}catch(t){if(w(t))return{data:null,error:t};throw t}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var s;const{data:r,error:i}=t;return i?{data:null,error:i}:await y(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(s=r?.session)===null||s===void 0?void 0:s.access_token})})}catch(t){if(w(t))return{data:null,error:t};throw t}})}async _challengeAndVerify(e){const{data:t,error:s}=await this._challenge({factorId:e.factorId});return s?{data:null,error:s}:await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){const{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};const s=e?.factors||[],r=s.filter(o=>o.factor_type==="totp"&&o.status==="verified"),i=s.filter(o=>o.factor_type==="phone"&&o.status==="verified");return{data:{all:s,totp:r,phone:i},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var t,s;const{data:{session:r},error:i}=e;if(i)return{data:null,error:i};if(!r)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:o}=je(r.access_token);let a=null;o.aal&&(a=o.aal);let l=a;((s=(t=r.user.factors)===null||t===void 0?void 0:t.filter(u=>u.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(l="aal2");const h=o.amr||[];return{data:{currentLevel:a,nextLevel:l,currentAuthenticationMethods:h},error:null}}))}async fetchJwk(e,t={keys:[]}){let s=t.keys.find(a=>a.kid===e);if(s)return s;const r=Date.now();if(s=this.jwks.keys.find(a=>a.kid===e),s&&this.jwks_cached_at+Fs>r)return s;const{data:i,error:o}=await y(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=r,s=i.keys.find(a=>a.kid===e),!s)?null:s}async getClaims(e,t={}){try{let s=e;if(!s){const{data:f,error:g}=await this.getSession();if(g||!f.session)return{data:null,error:g};s=f.session.access_token}const{header:r,payload:i,signature:o,raw:{header:a,payload:l}}=je(s);t?.allowExpired||dr(i.exp);const c=!r.alg||r.alg.startsWith("HS")||!r.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(r.kid,t?.keys?{keys:t.keys}:t?.jwks);if(!c){const{error:f}=await this.getUser(s);if(f)throw f;return{data:{claims:i,header:r,signature:o},error:null}}const h=fr(r.alg),u=await crypto.subtle.importKey("jwk",c,h,!0,["verify"]);if(!await crypto.subtle.verify(h,u,o,Xs(`${a}.${l}`)))throw new Be("Invalid JWT signature");return{data:{claims:i,header:r,signature:o},error:null}}catch(s){if(w(s))return{data:null,error:s};throw s}}}he.nextInstanceID=0;const Pr=he;class $r extends Pr{constructor(e){super(e)}}var Cr=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(h){try{c(s.next(h))}catch(u){o(u)}}function l(h){try{c(s.throw(h))}catch(u){o(u)}}function c(h){h.done?i(h.value):r(h.value).then(a,l)}c((s=s.apply(n,e||[])).next())})};class Rr{constructor(e,t,s){var r,i,o;this.supabaseUrl=e,this.supabaseKey=t;const a=Ds(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const l=`sb-${a.hostname.split(".")[0]}-auth-token`,c={db:Os,realtime:Ps,auth:Object.assign(Object.assign({},As),{storageKey:l}),global:js},h=Ls(s??{},c);this.storageKey=(r=h.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(i=h.global.headers)!==null&&i!==void 0?i:{},h.accessToken?(this.accessToken=h.accessToken,this.auth=new Proxy({},{get:(u,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=h.auth)!==null&&o!==void 0?o:{},this.headers,h.global.fetch),this.fetch=xs(t,this._getAccessToken.bind(this),h.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},h.realtime)),this.rest=new Jt(new URL("rest/v1",a).href,{headers:this.headers,schema:h.db.schema,fetch:this.fetch}),this.storage=new Ss(this.storageUrl.href,this.headers,this.fetch,s?.storage),h.accessToken||this._listenForAuthEvents()}get functions(){return new Dt(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},s={}){return this.rest.rpc(e,t,s)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,t;return Cr(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:s}=yield this.auth.getSession();return(t=(e=s.session)===null||e===void 0?void 0:e.access_token)!==null&&t!==void 0?t:this.supabaseKey})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:s,storage:r,userStorage:i,storageKey:o,flowType:a,lock:l,debug:c},h,u){const d={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new $r({url:this.authUrl.href,headers:Object.assign(Object.assign({},d),h),storageKey:o,autoRefreshToken:e,persistSession:t,detectSessionInUrl:s,storage:r,userStorage:i,flowType:a,lock:l,debug:c,fetch:u,hasCustomAuthorizationHeader:Object.keys(this.headers).some(f=>f.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new hs(this.realtimeUrl.href,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,s)=>{this._handleTokenChanged(t,"CLIENT",s?.access_token)})}_handleTokenChanged(e,t,s){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==s?this.changedAccessToken=s:e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const Mr=(n,e,t)=>new Rr(n,e,t);function xr(){if(typeof window<"u"||typeof process>"u")return!1;const n=process.version;if(n==null)return!1;const e=n.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}xr();export{Mr as c}; diff --git a/dist/assets/js/ui-vendor-CyRvbSfR.js b/dist/assets/js/ui-vendor-CyRvbSfR.js deleted file mode 100644 index adda054..0000000 --- a/dist/assets/js/ui-vendor-CyRvbSfR.js +++ /dev/null @@ -1,424 +0,0 @@ -import{r as v,R as lt}from"./router-vendor-D4by-_6Z.js";/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Io=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$o=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,s)=>s?s.toUpperCase():n.toLowerCase()),dn=t=>{const e=$o(t);return e.charAt(0).toUpperCase()+e.slice(1)},ms=(...t)=>t.filter((e,n,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===n).join(" ").trim(),zo=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var Uo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ho=v.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:o="",children:r,iconNode:i,...a},c)=>v.createElement("svg",{ref:c,...Uo,width:e,height:e,stroke:t,strokeWidth:s?Number(n)*24/Number(e):n,className:ms("lucide",o),...!r&&!zo(a)&&{"aria-hidden":"true"},...a},[...i.map(([l,u])=>v.createElement(l,u)),...Array.isArray(r)?r:[r]]));/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const g=(t,e)=>{const n=v.forwardRef(({className:s,...o},r)=>v.createElement(Ho,{ref:r,iconNode:e,className:ms(`lucide-${Io(dn(t))}`,`lucide-${t}`,s),...o}));return n.displayName=dn(t),n};/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wo=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],$u=g("arrow-left",Wo);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qo=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],zu=g("arrow-right",qo);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Go=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Uu=g("book-open",Go);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ko=[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]],Hu=g("building-2",Ko);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Yo=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]],Wu=g("building",Yo);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xo=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],qu=g("calendar",Xo);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Zo=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],Gu=g("camera",Zo);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Qo=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Ku=g("chart-column",Qo);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Jo=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Yu=g("chevron-down",Jo);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ti=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Xu=g("chevron-right",ti);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ei=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Zu=g("chevron-up",ei);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ni=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Qu=g("circle-alert",ni);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const si=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Ju=g("circle-check-big",si);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const oi=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],td=g("circle-check",oi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ii=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ed=g("circle-x",ii);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ri=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],nd=g("circle",ri);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ai=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],sd=g("clipboard",ai);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ci=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],od=g("clock",ci);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const li=[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M16 14v6",key:"1j4efv"}],["path",{d:"M8 14v6",key:"17c4r9"}],["path",{d:"M12 16v6",key:"c8a4gj"}]],id=g("cloud-rain",li);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ui=[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M8 15h.01",key:"a7atzg"}],["path",{d:"M8 19h.01",key:"puxtts"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M12 21h.01",key:"h35vbk"}],["path",{d:"M16 15h.01",key:"rnfrdf"}],["path",{d:"M16 19h.01",key:"1vcnzz"}]],rd=g("cloud-snow",ui);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const di=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],ad=g("cloud",di);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hi=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],cd=g("copy",hi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fi=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],ld=g("crown",fi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pi=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],ud=g("database",pi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mi=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],dd=g("dollar-sign",mi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yi=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],hd=g("download",yi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gi=[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]],fd=g("droplets",gi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vi=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],pd=g("ellipsis-vertical",vi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xi=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],md=g("eye",xi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bi=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],yd=g("file-text",bi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ki=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],gd=g("funnel",ki);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wi=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],vd=g("globe",wi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Pi=[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]],xd=g("hammer",Pi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ti=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],bd=g("hard-drive",Ti);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Mi=[["path",{d:"M10 10V5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v5",key:"1p9q5i"}],["path",{d:"M14 6a6 6 0 0 1 6 6v3",key:"1hnv84"}],["path",{d:"M4 15v-3a6 6 0 0 1 6-6",key:"9ciidu"}],["rect",{x:"2",y:"15",width:"20",height:"4",rx:"1",key:"g3x8cw"}]],kd=g("hard-hat",Mi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Vi=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],wd=g("house",Vi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ci=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Pd=g("key-round",Ci);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Si=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Td=g("layers",Si);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ai=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],Md=g("lightbulb",Ai);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Di=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],Vd=g("list-checks",Di);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ri=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Cd=g("loader-circle",Ri);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Li=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Sd=g("log-out",Li);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ei=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Ad=g("mail",Ei);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const _i=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Dd=g("map-pin",_i);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ji=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],Rd=g("menu",ji);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Fi=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Ld=g("moon",Fi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bi=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Ed=g("package",Bi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ni=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],_d=g("pause",Ni);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Oi=[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]],jd=g("pen-line",Oi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ii=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Fd=g("pen",Ii);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $i=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],Bd=g("phone",$i);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zi=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Nd=g("play",zi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ui=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Od=g("plus",Ui);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Hi=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],Id=g("printer",Hi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wi=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],$d=g("refresh-cw",Wi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qi=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],zd=g("rotate-ccw",qi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Gi=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Ud=g("save",Gi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ki=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Hd=g("search",Ki);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Yi=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Wd=g("send",Yi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xi=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],qd=g("settings",Xi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Zi=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],Gd=g("share-2",Zi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Qi=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Kd=g("shield-check",Qi);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ji=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Yd=g("shield",Ji);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tr=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Xd=g("smartphone",tr);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const er=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Zd=g("square-pen",er);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nr=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Qd=g("square",nr);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sr=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Jd=g("sun",sr);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const or=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],th=g("tag",or);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ir=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],eh=g("trash-2",ir);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rr=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],nh=g("trending-up",rr);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ar=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],sh=g("triangle-alert",ar);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const cr=[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]],oh=g("truck",cr);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lr=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],ih=g("upload",lr);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ur=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],rh=g("user",ur);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dr=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],ah=g("users",dr);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hr=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],ch=g("wifi-off",hr);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fr=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lh=g("x",fr);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pr=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],uh=g("wrench",pr);/** - * @license lucide-react v0.511.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mr=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],dh=g("zap",mr),ys=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),ee=v.createContext({}),ne=v.createContext(null),se=typeof document<"u",Be=se?v.useLayoutEffect:v.useEffect,gs=v.createContext({strict:!1}),Ne=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),yr="framerAppearId",vs="data-"+Ne(yr);function gr(t,e,n,s){const{visualElement:o}=v.useContext(ee),r=v.useContext(gs),i=v.useContext(ne),a=v.useContext(ys).reducedMotion,c=v.useRef();s=s||r.renderer,!c.current&&s&&(c.current=s(t,{visualState:e,parent:o,props:n,presenceContext:i,blockInitialAnimation:i?i.initial===!1:!1,reducedMotionConfig:a}));const l=c.current;v.useInsertionEffect(()=>{l&&l.update(n,i)});const u=v.useRef(!!(n[vs]&&!window.HandoffComplete));return Be(()=>{l&&(l.render(),u.current&&l.animationState&&l.animationState.animateChanges())}),v.useEffect(()=>{l&&(l.updateFeatures(),!u.current&&l.animationState&&l.animationState.animateChanges(),u.current&&(u.current=!1,window.HandoffComplete=!0))}),l}function gt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function vr(t,e,n){return v.useCallback(s=>{s&&t.mount&&t.mount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):gt(n)&&(n.current=s))},[e])}function Et(t){return typeof t=="string"||Array.isArray(t)}function oe(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const Oe=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ie=["initial",...Oe];function ie(t){return oe(t.animate)||Ie.some(e=>Et(t[e]))}function xs(t){return!!(ie(t)||t.variants)}function xr(t,e){if(ie(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Et(n)?n:void 0,animate:Et(s)?s:void 0}}return t.inherit!==!1?e:{}}function br(t){const{initial:e,animate:n}=xr(t,v.useContext(ee));return v.useMemo(()=>({initial:e,animate:n}),[hn(e),hn(n)])}function hn(t){return Array.isArray(t)?t.join(" "):t}const fn={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},_t={};for(const t in fn)_t[t]={isEnabled:e=>fn[t].some(n=>!!e[n])};function kr(t){for(const e in t)_t[e]={..._t[e],...t[e]}}const $e=v.createContext({}),bs=v.createContext({}),wr=Symbol.for("motionComponentSymbol");function Pr({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:o}){t&&kr(t);function r(a,c){let l;const u={...v.useContext(ys),...a,layoutId:Tr(a)},{isStatic:d}=u,h=br(a),f=s(a,d);if(!d&&se){h.visualElement=gr(o,f,u,e);const p=v.useContext(bs),m=v.useContext(gs).strict;h.visualElement&&(l=h.visualElement.loadFeatures(u,m,t,p))}return v.createElement(ee.Provider,{value:h},l&&h.visualElement?v.createElement(l,{visualElement:h.visualElement,...u}):null,n(o,a,vr(f,h.visualElement,c),f,d,h.visualElement))}const i=v.forwardRef(r);return i[wr]=o,i}function Tr({layoutId:t}){const e=v.useContext($e).id;return e&&t!==void 0?e+"-"+t:t}function Mr(t){function e(s,o={}){return Pr(t(s,o))}if(typeof Proxy>"u")return e;const n=new Map;return new Proxy(e,{get:(s,o)=>(n.has(o)||n.set(o,e(o)),n.get(o))})}const Vr=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ze(t){return typeof t!="string"||t.includes("-")?!1:!!(Vr.indexOf(t)>-1||/[A-Z]/.test(t))}const Gt={};function Cr(t){Object.assign(Gt,t)}const Ft=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ht=new Set(Ft);function ks(t,{layout:e,layoutId:n}){return ht.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Gt[t]||t==="opacity")}const N=t=>!!(t&&t.getVelocity),Sr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ar=Ft.length;function Dr(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},s,o){let r="";for(let i=0;ie=>typeof e=="string"&&e.startsWith(t),Ps=ws("--"),Pe=ws("var(--"),Rr=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,Lr=(t,e)=>e&&typeof t=="number"?e.transform(t):t,et=(t,e,n)=>Math.min(Math.max(n,t),e),ft={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},At={...ft,transform:t=>et(0,1,t)},$t={...ft,default:1},Dt=t=>Math.round(t*1e5)/1e5,re=/(-)?([\d]*\.?[\d])+/g,Ts=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Er=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Bt(t){return typeof t=="string"}const Nt=t=>({test:e=>Bt(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Q=Nt("deg"),W=Nt("%"),P=Nt("px"),_r=Nt("vh"),jr=Nt("vw"),pn={...W,parse:t=>W.parse(t)/100,transform:t=>W.transform(t*100)},mn={...ft,transform:Math.round},Ms={borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,radius:P,borderTopLeftRadius:P,borderTopRightRadius:P,borderBottomRightRadius:P,borderBottomLeftRadius:P,width:P,maxWidth:P,height:P,maxHeight:P,size:P,top:P,right:P,bottom:P,left:P,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,rotate:Q,rotateX:Q,rotateY:Q,rotateZ:Q,scale:$t,scaleX:$t,scaleY:$t,scaleZ:$t,skew:Q,skewX:Q,skewY:Q,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:At,originX:pn,originY:pn,originZ:P,zIndex:mn,fillOpacity:At,strokeOpacity:At,numOctaves:mn};function Ue(t,e,n,s){const{style:o,vars:r,transform:i,transformOrigin:a}=t;let c=!1,l=!1,u=!0;for(const d in e){const h=e[d];if(Ps(d)){r[d]=h;continue}const f=Ms[d],p=Lr(h,f);if(ht.has(d)){if(c=!0,i[d]=p,!u)continue;h!==(f.default||0)&&(u=!1)}else d.startsWith("origin")?(l=!0,a[d]=p):o[d]=p}if(e.transform||(c||s?o.transform=Dr(t.transform,n,u,s):o.transform&&(o.transform="none")),l){const{originX:d="50%",originY:h="50%",originZ:f=0}=a;o.transformOrigin=`${d} ${h} ${f}`}}const He=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Vs(t,e,n){for(const s in e)!N(e[s])&&!ks(s,n)&&(t[s]=e[s])}function Fr({transformTemplate:t},e,n){return v.useMemo(()=>{const s=He();return Ue(s,e,{enableHardwareAcceleration:!n},t),Object.assign({},s.vars,s.style)},[e])}function Br(t,e,n){const s=t.style||{},o={};return Vs(o,s,t),Object.assign(o,Fr(t,e,n)),t.transformValues?t.transformValues(o):o}function Nr(t,e,n){const s={},o=Br(t,e,n);return t.drag&&t.dragListener!==!1&&(s.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(s.tabIndex=0),s.style=o,s}const Or=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Kt(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Or.has(t)}let Cs=t=>!Kt(t);function Ir(t){t&&(Cs=e=>e.startsWith("on")?!Kt(e):t(e))}try{Ir(require("@emotion/is-prop-valid").default)}catch{}function $r(t,e,n){const s={};for(const o in t)o==="values"&&typeof t.values=="object"||(Cs(o)||n===!0&&Kt(o)||!e&&!Kt(o)||t.draggable&&o.startsWith("onDrag"))&&(s[o]=t[o]);return s}function yn(t,e,n){return typeof t=="string"?t:P.transform(e+n*t)}function zr(t,e,n){const s=yn(e,t.x,t.width),o=yn(n,t.y,t.height);return`${s} ${o}`}const Ur={offset:"stroke-dashoffset",array:"stroke-dasharray"},Hr={offset:"strokeDashoffset",array:"strokeDasharray"};function Wr(t,e,n=1,s=0,o=!0){t.pathLength=1;const r=o?Ur:Hr;t[r.offset]=P.transform(-s);const i=P.transform(e),a=P.transform(n);t[r.array]=`${i} ${a}`}function We(t,{attrX:e,attrY:n,attrScale:s,originX:o,originY:r,pathLength:i,pathSpacing:a=1,pathOffset:c=0,...l},u,d,h){if(Ue(t,l,u,h),d){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:p,dimensions:m}=t;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(o!==void 0||r!==void 0||p.transform)&&(p.transformOrigin=zr(m,o!==void 0?o:.5,r!==void 0?r:.5)),e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),s!==void 0&&(f.scale=s),i!==void 0&&Wr(f,i,a,c,!1)}const Ss=()=>({...He(),attrs:{}}),qe=t=>typeof t=="string"&&t.toLowerCase()==="svg";function qr(t,e,n,s){const o=v.useMemo(()=>{const r=Ss();return We(r,e,{enableHardwareAcceleration:!1},qe(s),t.transformTemplate),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};Vs(r,t.style,t),o.style={...r,...o.style}}return o}function Gr(t=!1){return(n,s,o,{latestValues:r},i)=>{const c=(ze(n)?qr:Nr)(s,r,i,n),u={...$r(s,typeof n=="string",t),...c,ref:o},{children:d}=s,h=v.useMemo(()=>N(d)?d.get():d,[d]);return v.createElement(n,{...u,children:h})}}function As(t,{style:e,vars:n},s,o){Object.assign(t.style,e,o&&o.getProjectionStyles(s));for(const r in n)t.style.setProperty(r,n[r])}const Ds=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Rs(t,e,n,s){As(t,e,void 0,s);for(const o in e.attrs)t.setAttribute(Ds.has(o)?o:Ne(o),e.attrs[o])}function Ge(t,e){const{style:n}=t,s={};for(const o in n)(N(n[o])||e.style&&N(e.style[o])||ks(o,t))&&(s[o]=n[o]);return s}function Ls(t,e){const n=Ge(t,e);for(const s in t)if(N(t[s])||N(e[s])){const o=Ft.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;n[o]=t[s]}return n}function Ke(t,e,n,s={},o={}){return typeof e=="function"&&(e=e(n!==void 0?n:t.custom,s,o)),typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"&&(e=e(n!==void 0?n:t.custom,s,o)),e}function Es(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const Yt=t=>Array.isArray(t),Kr=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Yr=t=>Yt(t)?t[t.length-1]||0:t;function Wt(t){const e=N(t)?t.get():t;return Kr(e)?e.toValue():e}function Xr({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},s,o,r){const i={latestValues:Zr(s,o,r,t),renderState:e()};return n&&(i.mount=a=>n(s,a,i)),i}const _s=t=>(e,n)=>{const s=v.useContext(ee),o=v.useContext(ne),r=()=>Xr(t,e,s,o);return n?r():Es(r)};function Zr(t,e,n,s){const o={},r=s(t,{});for(const h in r)o[h]=Wt(r[h]);let{initial:i,animate:a}=t;const c=ie(t),l=xs(t);e&&l&&!c&&t.inherit!==!1&&(i===void 0&&(i=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||i===!1;const d=u?a:i;return d&&typeof d!="boolean"&&!oe(d)&&(Array.isArray(d)?d:[d]).forEach(f=>{const p=Ke(t,f);if(!p)return;const{transitionEnd:m,transition:b,...w}=p;for(const x in w){let y=w[x];if(Array.isArray(y)){const k=u?y.length-1:0;y=y[k]}y!==null&&(o[x]=y)}for(const x in m)o[x]=m[x]}),o}const L=t=>t;class gn{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const n=this.order.indexOf(e);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}function Qr(t){let e=new gn,n=new gn,s=0,o=!1,r=!1;const i=new WeakSet,a={schedule:(c,l=!1,u=!1)=>{const d=u&&o,h=d?e:n;return l&&i.add(c),h.add(c)&&d&&o&&(s=e.order.length),c},cancel:c=>{n.remove(c),i.delete(c)},process:c=>{if(o){r=!0;return}if(o=!0,[e,n]=[n,e],n.clear(),s=e.order.length,s)for(let l=0;l(d[h]=Qr(()=>n=!0),d),{}),i=d=>r[d].process(o),a=()=>{const d=performance.now();n=!1,o.delta=s?1e3/60:Math.max(Math.min(d-o.timestamp,Jr),1),o.timestamp=d,o.isProcessing=!0,zt.forEach(i),o.isProcessing=!1,n&&e&&(s=!1,t(a))},c=()=>{n=!0,s=!0,o.isProcessing||t(a)};return{schedule:zt.reduce((d,h)=>{const f=r[h];return d[h]=(p,m=!1,b=!1)=>(n||c(),f.schedule(p,m,b)),d},{}),cancel:d=>zt.forEach(h=>r[h].cancel(d)),state:o,steps:r}}const{schedule:C,cancel:X,state:j,steps:ue}=ta(typeof requestAnimationFrame<"u"?requestAnimationFrame:L,!0),ea={useVisualState:_s({scrapeMotionValuesFromProps:Ls,createRenderState:Ss,onMount:(t,e,{renderState:n,latestValues:s})=>{C.read(()=>{try{n.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),C.render(()=>{We(n,s,{enableHardwareAcceleration:!1},qe(e.tagName),t.transformTemplate),Rs(e,n)})}})},na={useVisualState:_s({scrapeMotionValuesFromProps:Ge,createRenderState:He})};function sa(t,{forwardMotionProps:e=!1},n,s){return{...ze(t)?ea:na,preloadedFeatures:n,useRender:Gr(e),createVisualElement:s,Component:t}}function G(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const js=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function ae(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const oa=t=>e=>js(e)&&t(e,ae(e));function K(t,e,n,s){return G(t,e,oa(n),s)}const ia=(t,e)=>n=>e(t(n)),tt=(...t)=>t.reduce(ia);function Fs(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const vn=Fs("dragHorizontal"),xn=Fs("dragVertical");function Bs(t){let e=!1;if(t==="y")e=xn();else if(t==="x")e=vn();else{const n=vn(),s=xn();n&&s?e=()=>{n(),s()}:(n&&n(),s&&s())}return e}function Ns(){const t=Bs(!0);return t?(t(),!1):!0}class st{constructor(e){this.isMounted=!1,this.node=e}update(){}}function bn(t,e){const n="pointer"+(e?"enter":"leave"),s="onHover"+(e?"Start":"End"),o=(r,i)=>{if(r.pointerType==="touch"||Ns())return;const a=t.getProps();t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",e),a[s]&&C.update(()=>a[s](r,i))};return K(t.current,n,o,{passive:!t.getProps()[s]})}class ra extends st{mount(){this.unmount=tt(bn(this.node,!0),bn(this.node,!1))}unmount(){}}class aa extends st{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=tt(G(this.node.current,"focus",()=>this.onFocus()),G(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Os=(t,e)=>e?t===e?!0:Os(t,e.parentElement):!1;function de(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,ae(n))}class ca extends st{constructor(){super(...arguments),this.removeStartListeners=L,this.removeEndListeners=L,this.removeAccessibleListeners=L,this.startPointerPress=(e,n)=>{if(this.isPressing)return;this.removeEndListeners();const s=this.node.getProps(),r=K(window,"pointerup",(a,c)=>{if(!this.checkPressEnd())return;const{onTap:l,onTapCancel:u,globalTapTarget:d}=this.node.getProps();C.update(()=>{!d&&!Os(this.node.current,a.target)?u&&u(a,c):l&&l(a,c)})},{passive:!(s.onTap||s.onPointerUp)}),i=K(window,"pointercancel",(a,c)=>this.cancelPress(a,c),{passive:!(s.onTapCancel||s.onPointerCancel)});this.removeEndListeners=tt(r,i),this.startPress(e,n)},this.startAccessiblePress=()=>{const e=r=>{if(r.key!=="Enter"||this.isPressing)return;const i=a=>{a.key!=="Enter"||!this.checkPressEnd()||de("up",(c,l)=>{const{onTap:u}=this.node.getProps();u&&C.update(()=>u(c,l))})};this.removeEndListeners(),this.removeEndListeners=G(this.node.current,"keyup",i),de("down",(a,c)=>{this.startPress(a,c)})},n=G(this.node.current,"keydown",e),s=()=>{this.isPressing&&de("cancel",(r,i)=>this.cancelPress(r,i))},o=G(this.node.current,"blur",s);this.removeAccessibleListeners=tt(n,o)}}startPress(e,n){this.isPressing=!0;const{onTapStart:s,whileTap:o}=this.node.getProps();o&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),s&&C.update(()=>s(e,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Ns()}cancelPress(e,n){if(!this.checkPressEnd())return;const{onTapCancel:s}=this.node.getProps();s&&C.update(()=>s(e,n))}mount(){const e=this.node.getProps(),n=K(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),s=G(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=tt(n,s)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const Te=new WeakMap,he=new WeakMap,la=t=>{const e=Te.get(t.target);e&&e(t)},ua=t=>{t.forEach(la)};function da({root:t,...e}){const n=t||document;he.has(n)||he.set(n,{});const s=he.get(n),o=JSON.stringify(e);return s[o]||(s[o]=new IntersectionObserver(ua,{root:t,...e})),s[o]}function ha(t,e,n){const s=da(e);return Te.set(t,n),s.observe(t),()=>{Te.delete(t),s.unobserve(t)}}const fa={some:0,all:1};class pa extends st{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:o="some",once:r}=e,i={root:n?n.current:void 0,rootMargin:s,threshold:typeof o=="number"?o:fa[o]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,r&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),h=l?u:d;h&&h(c)};return ha(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(ma(e,n))&&this.startObserver()}unmount(){}}function ma({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const ya={inView:{Feature:pa},tap:{Feature:ca},focus:{Feature:aa},hover:{Feature:ra}};function Is(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;se[s]=n.get()),e}function va(t){const e={};return t.values.forEach((n,s)=>e[s]=n.getVelocity()),e}function ce(t,e,n){const s=t.getProps();return Ke(s,e,n!==void 0?n:s.custom,ga(t),va(t))}let Ye=L;const dt=t=>t*1e3,Y=t=>t/1e3,xa={current:!1},$s=t=>Array.isArray(t)&&typeof t[0]=="number";function zs(t){return!!(!t||typeof t=="string"&&Us[t]||$s(t)||Array.isArray(t)&&t.every(zs))}const St=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Us={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:St([0,.65,.55,1]),circOut:St([.55,0,1,.45]),backIn:St([.31,.01,.66,-.59]),backOut:St([.33,1.53,.69,.99])};function Hs(t){if(t)return $s(t)?St(t):Array.isArray(t)?t.map(Hs):Us[t]}function ba(t,e,n,{delay:s=0,duration:o,repeat:r=0,repeatType:i="loop",ease:a,times:c}={}){const l={[e]:n};c&&(l.offset=c);const u=Hs(a);return Array.isArray(u)&&(l.easing=u),t.animate(l,{delay:s,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:i==="reverse"?"alternate":"normal"})}function ka(t,{repeat:e,repeatType:n="loop"}){const s=e&&n!=="loop"&&e%2===1?0:t.length-1;return t[s]}const Ws=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,wa=1e-7,Pa=12;function Ta(t,e,n,s,o){let r,i,a=0;do i=e+(n-e)/2,r=Ws(i,s,o)-t,r>0?n=i:e=i;while(Math.abs(r)>wa&&++aTa(r,0,1,t,n);return r=>r===0||r===1?r:Ws(o(r),e,s)}const Ma=Ot(.42,0,1,1),Va=Ot(0,0,.58,1),qs=Ot(.42,0,.58,1),Ca=t=>Array.isArray(t)&&typeof t[0]!="number",Gs=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ks=t=>e=>1-t(1-e),Xe=t=>1-Math.sin(Math.acos(t)),Ys=Ks(Xe),Sa=Gs(Xe),Xs=Ot(.33,1.53,.69,.99),Ze=Ks(Xs),Aa=Gs(Ze),Da=t=>(t*=2)<1?.5*Ze(t):.5*(2-Math.pow(2,-10*(t-1))),Ra={linear:L,easeIn:Ma,easeInOut:qs,easeOut:Va,circIn:Xe,circInOut:Sa,circOut:Ys,backIn:Ze,backInOut:Aa,backOut:Xs,anticipate:Da},kn=t=>{if(Array.isArray(t)){Ye(t.length===4);const[e,n,s,o]=t;return Ot(e,n,s,o)}else if(typeof t=="string")return Ra[t];return t},Qe=(t,e)=>n=>!!(Bt(n)&&Er.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Zs=(t,e,n)=>s=>{if(!Bt(s))return s;const[o,r,i,a]=s.match(re);return{[t]:parseFloat(o),[e]:parseFloat(r),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},La=t=>et(0,255,t),fe={...ft,transform:t=>Math.round(La(t))},ut={test:Qe("rgb","red"),parse:Zs("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+fe.transform(t)+", "+fe.transform(e)+", "+fe.transform(n)+", "+Dt(At.transform(s))+")"};function Ea(t){let e="",n="",s="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,s+=s,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:o?parseInt(o,16)/255:1}}const Me={test:Qe("#"),parse:Ea,transform:ut.transform},vt={test:Qe("hsl","hue"),parse:Zs("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+W.transform(Dt(e))+", "+W.transform(Dt(n))+", "+Dt(At.transform(s))+")"},B={test:t=>ut.test(t)||Me.test(t)||vt.test(t),parse:t=>ut.test(t)?ut.parse(t):vt.test(t)?vt.parse(t):Me.parse(t),transform:t=>Bt(t)?t:t.hasOwnProperty("red")?ut.transform(t):vt.transform(t)},R=(t,e,n)=>-n*t+n*e+t;function pe(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function _a({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let o=0,r=0,i=0;if(!e)o=r=i=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;o=pe(c,a,t+1/3),r=pe(c,a,t),i=pe(c,a,t-1/3)}return{red:Math.round(o*255),green:Math.round(r*255),blue:Math.round(i*255),alpha:s}}const me=(t,e,n)=>{const s=t*t;return Math.sqrt(Math.max(0,n*(e*e-s)+s))},ja=[Me,ut,vt],Fa=t=>ja.find(e=>e.test(t));function wn(t){const e=Fa(t);let n=e.parse(t);return e===vt&&(n=_a(n)),n}const Qs=(t,e)=>{const n=wn(t),s=wn(e),o={...n};return r=>(o.red=me(n.red,s.red,r),o.green=me(n.green,s.green,r),o.blue=me(n.blue,s.blue,r),o.alpha=R(n.alpha,s.alpha,r),ut.transform(o))};function Ba(t){var e,n;return isNaN(t)&&Bt(t)&&(((e=t.match(re))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(Ts))===null||n===void 0?void 0:n.length)||0)>0}const Js={regex:Rr,countKey:"Vars",token:"${v}",parse:L},to={regex:Ts,countKey:"Colors",token:"${c}",parse:B.parse},eo={regex:re,countKey:"Numbers",token:"${n}",parse:ft.parse};function ye(t,{regex:e,countKey:n,token:s,parse:o}){const r=t.tokenised.match(e);r&&(t["num"+n]=r.length,t.tokenised=t.tokenised.replace(e,s),t.values.push(...r.map(o)))}function Xt(t){const e=t.toString(),n={value:e,tokenised:e,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&ye(n,Js),ye(n,to),ye(n,eo),n}function no(t){return Xt(t).values}function so(t){const{values:e,numColors:n,numVars:s,tokenised:o}=Xt(t),r=e.length;return i=>{let a=o;for(let c=0;ctypeof t=="number"?0:t;function Oa(t){const e=no(t);return so(t)(e.map(Na))}const nt={test:Ba,parse:no,createTransformer:so,getAnimatableNone:Oa},oo=(t,e)=>n=>`${n>0?e:t}`;function io(t,e){return typeof t=="number"?n=>R(t,e,n):B.test(t)?Qs(t,e):t.startsWith("var(")?oo(t,e):ao(t,e)}const ro=(t,e)=>{const n=[...t],s=n.length,o=t.map((r,i)=>io(r,e[i]));return r=>{for(let i=0;i{const n={...t,...e},s={};for(const o in n)t[o]!==void 0&&e[o]!==void 0&&(s[o]=io(t[o],e[o]));return o=>{for(const r in s)n[r]=s[r](o);return n}},ao=(t,e)=>{const n=nt.createTransformer(e),s=Xt(t),o=Xt(e);return s.numVars===o.numVars&&s.numColors===o.numColors&&s.numNumbers>=o.numNumbers?tt(ro(s.values,o.values),n):oo(t,e)},jt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s},Pn=(t,e)=>n=>R(t,e,n);function $a(t){return typeof t=="number"?Pn:typeof t=="string"?B.test(t)?Qs:ao:Array.isArray(t)?ro:typeof t=="object"?Ia:Pn}function za(t,e,n){const s=[],o=n||$a(t[0]),r=t.length-1;for(let i=0;ie[0];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const i=za(e,s,o),a=i.length,c=l=>{let u=0;if(a>1)for(;uc(et(t[0],t[r-1],l)):c}function Ua(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const o=jt(0,e,s);t.push(R(n,1,o))}}function Ha(t){const e=[0];return Ua(e,t.length-1),e}function Wa(t,e){return t.map(n=>n*e)}function qa(t,e){return t.map(()=>e||qs).splice(0,t.length-1)}function Zt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const o=Ca(s)?s.map(kn):kn(s),r={done:!1,value:e[0]},i=Wa(n&&n.length===e.length?n:Ha(e),t),a=co(i,e,{ease:Array.isArray(o)?o:qa(e,o)});return{calculatedDuration:t,next:c=>(r.value=a(c),r.done=c>=t,r)}}function lo(t,e){return e?t*(1e3/e):0}const Ga=5;function uo(t,e,n){const s=Math.max(e-Ga,0);return lo(n-t(s),e-s)}const ge=.001,Ka=.01,Ya=10,Xa=.05,Za=1;function Qa({duration:t=800,bounce:e=.25,velocity:n=0,mass:s=1}){let o,r,i=1-e;i=et(Xa,Za,i),t=et(Ka,Ya,Y(t)),i<1?(o=l=>{const u=l*i,d=u*t,h=u-n,f=Ve(l,i),p=Math.exp(-d);return ge-h/f*p},r=l=>{const d=l*i*t,h=d*n+n,f=Math.pow(i,2)*Math.pow(l,2)*t,p=Math.exp(-d),m=Ve(Math.pow(l,2),i);return(-o(l)+ge>0?-1:1)*((h-f)*p)/m}):(o=l=>{const u=Math.exp(-l*t),d=(l-n)*t+1;return-ge+u*d},r=l=>{const u=Math.exp(-l*t),d=(n-l)*(t*t);return u*d});const a=5/t,c=tc(o,r,a);if(t=dt(t),isNaN(c))return{stiffness:100,damping:10,duration:t};{const l=Math.pow(c,2)*s;return{stiffness:l,damping:i*2*Math.sqrt(s*l),duration:t}}}const Ja=12;function tc(t,e,n){let s=n;for(let o=1;ot[n]!==void 0)}function sc(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Tn(t,nc)&&Tn(t,ec)){const n=Qa(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}function ho({keyframes:t,restDelta:e,restSpeed:n,...s}){const o=t[0],r=t[t.length-1],i={done:!1,value:o},{stiffness:a,damping:c,mass:l,duration:u,velocity:d,isResolvedFromDuration:h}=sc({...s,velocity:-Y(s.velocity||0)}),f=d||0,p=c/(2*Math.sqrt(a*l)),m=r-o,b=Y(Math.sqrt(a/l)),w=Math.abs(m)<5;n||(n=w?.01:2),e||(e=w?.005:.5);let x;if(p<1){const y=Ve(b,p);x=k=>{const T=Math.exp(-p*b*k);return r-T*((f+p*b*m)/y*Math.sin(y*k)+m*Math.cos(y*k))}}else if(p===1)x=y=>r-Math.exp(-b*y)*(m+(f+b*m)*y);else{const y=b*Math.sqrt(p*p-1);x=k=>{const T=Math.exp(-p*b*k),S=Math.min(y*k,300);return r-T*((f+p*b*m)*Math.sinh(S)+y*m*Math.cosh(S))/y}}return{calculatedDuration:h&&u||null,next:y=>{const k=x(y);if(h)i.done=y>=u;else{let T=f;y!==0&&(p<1?T=uo(x,y,k):T=0);const S=Math.abs(T)<=n,A=Math.abs(r-k)<=e;i.done=S&&A}return i.value=i.done?r:k,i}}}function Mn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:o=10,bounceStiffness:r=500,modifyTarget:i,min:a,max:c,restDelta:l=.5,restSpeed:u}){const d=t[0],h={done:!1,value:d},f=M=>a!==void 0&&Mc,p=M=>a===void 0?c:c===void 0||Math.abs(a-M)-m*Math.exp(-M/s),y=M=>w+x(M),k=M=>{const V=x(M),I=y(M);h.done=Math.abs(V)<=l,h.value=h.done?w:I};let T,S;const A=M=>{f(h.value)&&(T=M,S=ho({keyframes:[h.value,p(h.value)],velocity:uo(y,M,h.value),damping:o,stiffness:r,restDelta:l,restSpeed:u}))};return A(0),{calculatedDuration:null,next:M=>{let V=!1;return!S&&T===void 0&&(V=!0,k(M),A(M)),T!==void 0&&M>T?S.next(M-T):(!V&&k(M),h)}}}const oc=t=>{const e=({timestamp:n})=>t(n);return{start:()=>C.update(e,!0),stop:()=>X(e),now:()=>j.isProcessing?j.timestamp:performance.now()}},Vn=2e4;function Cn(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e=Vn?1/0:e}const ic={decay:Mn,inertia:Mn,tween:Zt,keyframes:Zt,spring:ho};function Qt({autoplay:t=!0,delay:e=0,driver:n=oc,keyframes:s,type:o="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:a="loop",onPlay:c,onStop:l,onComplete:u,onUpdate:d,...h}){let f=1,p=!1,m,b;const w=()=>{b=new Promise(D=>{m=D})};w();let x;const y=ic[o]||Zt;let k;y!==Zt&&typeof s[0]!="number"&&(k=co([0,100],s,{clamp:!1}),s=[0,100]);const T=y({...h,keyframes:s});let S;a==="mirror"&&(S=y({...h,keyframes:[...s].reverse(),velocity:-(h.velocity||0)}));let A="idle",M=null,V=null,I=null;T.calculatedDuration===null&&r&&(T.calculatedDuration=Cn(T));const{calculatedDuration:pt}=T;let H=1/0,q=1/0;pt!==null&&(H=pt+i,q=H*(r+1)-i);let F=0;const mt=D=>{if(V===null)return;f>0&&(V=Math.min(V,D)),f<0&&(V=Math.min(D-q/f,V)),M!==null?F=M:F=Math.round(D-V)*f;const Tt=F-e*(f>=0?1:-1),an=f>=0?Tt<0:Tt>q;F=Math.max(Tt,0),A==="finished"&&M===null&&(F=q);let cn=F,ln=T;if(r){const le=Math.min(F,q)/H;let It=Math.floor(le),ot=le%1;!ot&&le>=1&&(ot=1),ot===1&&It--,It=Math.min(It,r+1),!!(It%2)&&(a==="reverse"?(ot=1-ot,i&&(ot-=i/H)):a==="mirror"&&(ln=S)),cn=et(0,1,ot)*H}const Mt=an?{done:!1,value:s[0]}:ln.next(cn);k&&(Mt.value=k(Mt.value));let{done:un}=Mt;!an&&pt!==null&&(un=f>=0?F>=q:F<=0);const Oo=M===null&&(A==="finished"||A==="running"&&un);return d&&d(Mt.value),Oo&&Pt(),Mt},_=()=>{x&&x.stop(),x=void 0},Z=()=>{A="idle",_(),m(),w(),V=I=null},Pt=()=>{A="finished",u&&u(),_(),m()},yt=()=>{if(p)return;x||(x=n(mt));const D=x.now();c&&c(),M!==null?V=D-M:(!V||A==="finished")&&(V=D),A==="finished"&&w(),I=V,M=null,A="running",x.start()};t&&yt();const rn={then(D,Tt){return b.then(D,Tt)},get time(){return Y(F)},set time(D){D=dt(D),F=D,M!==null||!x||f===0?M=D:V=x.now()-D/f},get duration(){const D=T.calculatedDuration===null?Cn(T):T.calculatedDuration;return Y(D)},get speed(){return f},set speed(D){D===f||!x||(f=D,rn.time=Y(F))},get state(){return A},play:yt,pause:()=>{A="paused",M=F},stop:()=>{p=!0,A!=="idle"&&(A="idle",l&&l(),Z())},cancel:()=>{I!==null&&mt(I),Z()},complete:()=>{A="finished"},sample:D=>(V=0,mt(D))};return rn}function rc(t){let e;return()=>(e===void 0&&(e=t()),e)}const ac=rc(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),cc=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Ut=10,lc=2e4,uc=(t,e)=>e.type==="spring"||t==="backgroundColor"||!zs(e.ease);function dc(t,e,{onUpdate:n,onComplete:s,...o}){if(!(ac()&&cc.has(e)&&!o.repeatDelay&&o.repeatType!=="mirror"&&o.damping!==0&&o.type!=="inertia"))return!1;let i=!1,a,c,l=!1;const u=()=>{c=new Promise(y=>{a=y})};u();let{keyframes:d,duration:h=300,ease:f,times:p}=o;if(uc(e,o)){const y=Qt({...o,repeat:0,delay:0});let k={done:!1,value:d[0]};const T=[];let S=0;for(;!k.done&&S{l=!1,m.cancel()},w=()=>{l=!0,C.update(b),a(),u()};return m.onfinish=()=>{l||(t.set(ka(d,o)),s&&s(),w())},{then(y,k){return c.then(y,k)},attachTimeline(y){return m.timeline=y,m.onfinish=null,L},get time(){return Y(m.currentTime||0)},set time(y){m.currentTime=dt(y)},get speed(){return m.playbackRate},set speed(y){m.playbackRate=y},get duration(){return Y(h)},play:()=>{i||(m.play(),X(b))},pause:()=>m.pause(),stop:()=>{if(i=!0,m.playState==="idle")return;const{currentTime:y}=m;if(y){const k=Qt({...o,autoplay:!1});t.setWithVelocity(k.sample(y-Ut).value,k.sample(y).value,Ut)}w()},complete:()=>{l||m.finish()},cancel:w}}function hc({keyframes:t,delay:e,onUpdate:n,onComplete:s}){const o=()=>(n&&n(t[t.length-1]),s&&s(),{time:0,speed:1,duration:0,play:L,pause:L,stop:L,then:r=>(r(),Promise.resolve()),cancel:L,complete:L});return e?Qt({keyframes:[0,1],duration:0,delay:e,onComplete:o}):o()}const fc={type:"spring",stiffness:500,damping:25,restSpeed:10},pc=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),mc={type:"keyframes",duration:.8},yc={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},gc=(t,{keyframes:e})=>e.length>2?mc:ht.has(t)?t.startsWith("scale")?pc(e[1]):fc:yc,Ce=(t,e)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(nt.test(e)||e==="0")&&!e.startsWith("url(")),vc=new Set(["brightness","contrast","saturate","opacity"]);function xc(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(re)||[];if(!s)return t;const o=n.replace(s,"");let r=vc.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+o+")"}const bc=/([a-z-]*)\(.*?\)/g,Se={...nt,getAnimatableNone:t=>{const e=t.match(bc);return e?e.map(xc).join(" "):t}},kc={...Ms,color:B,backgroundColor:B,outlineColor:B,fill:B,stroke:B,borderColor:B,borderTopColor:B,borderRightColor:B,borderBottomColor:B,borderLeftColor:B,filter:Se,WebkitFilter:Se},Je=t=>kc[t];function fo(t,e){let n=Je(t);return n!==Se&&(n=nt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const po=t=>/^0[^.\s]+$/.test(t);function wc(t){if(typeof t=="number")return t===0;if(t!==null)return t==="none"||t==="0"||po(t)}function Pc(t,e,n,s){const o=Ce(e,n);let r;Array.isArray(n)?r=[...n]:r=[null,n];const i=s.from!==void 0?s.from:t.get();let a;const c=[];for(let l=0;lo=>{const r=tn(s,t)||{},i=r.delay||s.delay||0;let{elapsed:a=0}=s;a=a-dt(i);const c=Pc(e,t,n,r),l=c[0],u=c[c.length-1],d=Ce(t,l),h=Ce(t,u);let f={keyframes:c,velocity:e.getVelocity(),ease:"easeOut",...r,delay:-a,onUpdate:p=>{e.set(p),r.onUpdate&&r.onUpdate(p)},onComplete:()=>{o(),r.onComplete&&r.onComplete()}};if(Tc(r)||(f={...f,...gc(t,f)}),f.duration&&(f.duration=dt(f.duration)),f.repeatDelay&&(f.repeatDelay=dt(f.repeatDelay)),!d||!h||xa.current||r.type===!1||Mc.skipAnimations)return hc(f);if(!s.isHandoff&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const p=dc(e,t,f);if(p)return p}return Qt(f)};function Jt(t){return!!(N(t)&&t.add)}const mo=t=>/^\-?\d*\.?\d+$/.test(t);function nn(t,e){t.indexOf(e)===-1&&t.push(e)}function sn(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class on{constructor(){this.subscriptions=[]}add(e){return nn(this.subscriptions,e),()=>sn(this.subscriptions,e)}notify(e,n,s){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](e,n,s);else for(let r=0;r!isNaN(parseFloat(t));class Cc{constructor(e,n={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(s,o=!0)=>{this.prev=this.current,this.current=s;const{delta:r,timestamp:i}=j;this.lastUpdated!==i&&(this.timeDelta=r,this.lastUpdated=i,C.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>C.postRender(this.velocityCheck),this.velocityCheck=({timestamp:s})=>{s!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=Vc(this.current),this.owner=n.owner}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new on);const s=this.events[e].add(n);return e==="change"?()=>{s(),C.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,s){this.set(n),this.prev=e,this.timeDelta=s}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?lo(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function kt(t,e){return new Cc(t,e)}const yo=t=>e=>e.test(t),Sc={test:t=>t==="auto",parse:t=>t},go=[ft,P,W,Q,jr,_r,Sc],Vt=t=>go.find(yo(t)),Ac=[...go,B,nt],Dc=t=>Ac.find(yo(t));function Rc(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,kt(n))}function Lc(t,e){const n=ce(t,e);let{transitionEnd:s={},transition:o={},...r}=n?t.makeTargetAnimatable(n,!1):{};r={...r,...s};for(const i in r){const a=Yr(r[i]);Rc(t,i,a)}}function Ec(t,e,n){var s,o;const r=Object.keys(e).filter(a=>!t.hasValue(a)),i=r.length;if(i)for(let a=0;ac.remove(d))),l.push(b)}return i&&Promise.all(l).then(()=>{i&&Lc(t,i)}),l}function Ae(t,e,n={}){const s=ce(t,e,n.custom);let{transition:o=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(o=n.transitionOverride);const r=s?()=>Promise.all(vo(t,s,n)):()=>Promise.resolve(),i=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:d}=o;return Nc(t,e,l+c,u,d,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[c,l]=a==="beforeChildren"?[r,i]:[i,r];return c().then(()=>l())}else return Promise.all([r(),i(n.delay)])}function Nc(t,e,n=0,s=0,o=1,r){const i=[],a=(t.variantChildren.size-1)*s,c=o===1?(l=0)=>l*s:(l=0)=>a-l*s;return Array.from(t.variantChildren).sort(Oc).forEach((l,u)=>{l.notify("AnimationStart",e),i.push(Ae(l,e,{...r,delay:n+c(u)}).then(()=>l.notify("AnimationComplete",e)))}),Promise.all(i)}function Oc(t,e){return t.sortNodePosition(e)}function Ic(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const o=e.map(r=>Ae(t,r,n));s=Promise.all(o)}else if(typeof e=="string")s=Ae(t,e,n);else{const o=typeof e=="function"?ce(t,e,n.custom):e;s=Promise.all(vo(t,o,n))}return s.then(()=>t.notify("AnimationComplete",e))}const $c=[...Oe].reverse(),zc=Oe.length;function Uc(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Ic(t,n,s)))}function Hc(t){let e=Uc(t);const n=qc();let s=!0;const o=(c,l)=>{const u=ce(t,l);if(u){const{transition:d,transitionEnd:h,...f}=u;c={...c,...f,...h}}return c};function r(c){e=c(t)}function i(c,l){const u=t.getProps(),d=t.getVariantContext(!0)||{},h=[],f=new Set;let p={},m=1/0;for(let w=0;wm&&T,I=!1;const pt=Array.isArray(k)?k:[k];let H=pt.reduce(o,{});S===!1&&(H={});const{prevResolvedValues:q={}}=y,F={...q,...H},mt=_=>{V=!0,f.has(_)&&(I=!0,f.delete(_)),y.needsAnimating[_]=!0};for(const _ in F){const Z=H[_],Pt=q[_];if(p.hasOwnProperty(_))continue;let yt=!1;Yt(Z)&&Yt(Pt)?yt=!Is(Z,Pt):yt=Z!==Pt,yt?Z!==void 0?mt(_):f.add(_):Z!==void 0&&f.has(_)?mt(_):y.protectedKeys[_]=!0}y.prevProp=k,y.prevResolvedValues=H,y.isActive&&(p={...p,...H}),s&&t.blockInitialAnimation&&(V=!1),V&&(!A||I)&&h.push(...pt.map(_=>({animation:_,options:{type:x,...c}})))}if(f.size){const w={};f.forEach(x=>{const y=t.getBaseTarget(x);y!==void 0&&(w[x]=y)}),h.push({animation:w})}let b=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(b=!1),s=!1,b?e(h):Promise.resolve()}function a(c,l,u){var d;if(n[c].isActive===l)return Promise.resolve();(d=t.variantChildren)===null||d===void 0||d.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(c,l)}),n[c].isActive=l;const h=i(u,c);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:i,setActive:a,setAnimateFunction:r,getState:()=>n}}function Wc(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Is(e,t):!1}function it(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qc(){return{animate:it(!0),whileInView:it(),whileHover:it(),whileTap:it(),whileDrag:it(),whileFocus:it(),exit:it()}}class Gc extends st{constructor(e){super(e),e.animationState||(e.animationState=Hc(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),oe(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let Kc=0;class Yc extends st{constructor(){super(...arguments),this.id=Kc++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n,custom:s}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===o)return;const r=this.node.animationState.setActive("exit",!e,{custom:s??this.node.getProps().custom});n&&!e&&r.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const Xc={animation:{Feature:Gc},exit:{Feature:Yc}},Sn=(t,e)=>Math.abs(t-e);function Zc(t,e){const n=Sn(t.x,e.x),s=Sn(t.y,e.y);return Math.sqrt(n**2+s**2)}class xo{constructor(e,n,{transformPagePoint:s,contextWindow:o,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=xe(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,f=Zc(d.offset,{x:0,y:0})>=3;if(!h&&!f)return;const{point:p}=d,{timestamp:m}=j;this.history.push({...p,timestamp:m});const{onStart:b,onMove:w}=this.handlers;h||(b&&b(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=ve(h,this.transformPagePoint),C.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:f,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=xe(d.type==="pointercancel"?this.lastMoveEventInfo:ve(h,this.transformPagePoint),this.history);this.startEvent&&f&&f(d,b),p&&p(d,b)},!js(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.contextWindow=o||window;const i=ae(e),a=ve(i,this.transformPagePoint),{point:c}=a,{timestamp:l}=j;this.history=[{...c,timestamp:l}];const{onSessionStart:u}=n;u&&u(e,xe(a,this.history)),this.removeListeners=tt(K(this.contextWindow,"pointermove",this.handlePointerMove),K(this.contextWindow,"pointerup",this.handlePointerUp),K(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),X(this.updatePoint)}}function ve(t,e){return e?{point:e(t.point)}:t}function An(t,e){return{x:t.x-e.x,y:t.y-e.y}}function xe({point:t},e){return{point:t,delta:An(t,bo(e)),offset:An(t,Qc(e)),velocity:Jc(e,.1)}}function Qc(t){return t[0]}function bo(t){return t[t.length-1]}function Jc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const o=bo(t);for(;n>=0&&(s=t[n],!(o.timestamp-s.timestamp>dt(e)));)n--;if(!s)return{x:0,y:0};const r=Y(o.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const i={x:(o.x-s.x)/r,y:(o.y-s.y)/r};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function O(t){return t.max-t.min}function De(t,e=0,n=.01){return Math.abs(t-e)<=n}function Dn(t,e,n,s=.5){t.origin=s,t.originPoint=R(e.min,e.max,t.origin),t.scale=O(n)/O(e),(De(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=R(n.min,n.max,t.origin)-t.originPoint,(De(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Rt(t,e,n,s){Dn(t.x,e.x,n.x,s?s.originX:void 0),Dn(t.y,e.y,n.y,s?s.originY:void 0)}function Rn(t,e,n){t.min=n.min+e.min,t.max=t.min+O(e)}function tl(t,e,n){Rn(t.x,e.x,n.x),Rn(t.y,e.y,n.y)}function Ln(t,e,n){t.min=e.min-n.min,t.max=t.min+O(e)}function Lt(t,e,n){Ln(t.x,e.x,n.x),Ln(t.y,e.y,n.y)}function el(t,{min:e,max:n},s){return e!==void 0&&tn&&(t=s?R(n,t,s.max):Math.min(t,n)),t}function En(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function nl(t,{top:e,left:n,bottom:s,right:o}){return{x:En(t.x,n,o),y:En(t.y,e,s)}}function _n(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.mins?n=jt(e.min,e.max-s,t.min):s>o&&(n=jt(t.min,t.max-o,e.min)),et(0,1,n)}function il(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Re=.35;function rl(t=Re){return t===!1?t=0:t===!0&&(t=Re),{x:jn(t,"left","right"),y:jn(t,"top","bottom")}}function jn(t,e,n){return{min:Fn(t,e),max:Fn(t,n)}}function Fn(t,e){return typeof t=="number"?t:t[e]||0}const Bn=()=>({translate:0,scale:1,origin:0,originPoint:0}),xt=()=>({x:Bn(),y:Bn()}),Nn=()=>({min:0,max:0}),E=()=>({x:Nn(),y:Nn()});function z(t){return[t("x"),t("y")]}function ko({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function al({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function cl(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function be(t){return t===void 0||t===1}function Le({scale:t,scaleX:e,scaleY:n}){return!be(t)||!be(e)||!be(n)}function rt(t){return Le(t)||wo(t)||t.z||t.rotate||t.rotateX||t.rotateY}function wo(t){return On(t.x)||On(t.y)}function On(t){return t&&t!=="0%"}function te(t,e,n){const s=t-n,o=e*s;return n+o}function In(t,e,n,s,o){return o!==void 0&&(t=te(t,o,s)),te(t,n,s)+e}function Ee(t,e=0,n=1,s,o){t.min=In(t.min,e,n,s,o),t.max=In(t.max,e,n,s,o)}function Po(t,{x:e,y:n}){Ee(t.x,e.translate,e.scale,e.originPoint),Ee(t.y,n.translate,n.scale,n.originPoint)}function ll(t,e,n,s=!1){const o=n.length;if(!o)return;e.x=e.y=1;let r,i;for(let a=0;a1.0000000000001||t<.999999999999?t:1}function J(t,e){t.min=t.min+e,t.max=t.max+e}function zn(t,e,[n,s,o]){const r=e[o]!==void 0?e[o]:.5,i=R(t.min,t.max,r);Ee(t,e[n],e[s],i,e.scale)}const ul=["x","scaleX","originX"],dl=["y","scaleY","originY"];function bt(t,e){zn(t.x,e,ul),zn(t.y,e,dl)}function To(t,e){return ko(cl(t.getBoundingClientRect(),e))}function hl(t,e,n){const s=To(t,n),{scroll:o}=e;return o&&(J(s.x,o.offset.x),J(s.y,o.offset.y)),s}const Mo=({current:t})=>t?t.ownerDocument.defaultView:null,fl=new WeakMap;class pl{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=E(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ae(u,"page").point)},r=(u,d)=>{const{drag:h,dragPropagation:f,onDragStart:p}=this.getProps();if(h&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Bs(h),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),z(b=>{let w=this.getAxisMotionValue(b).get()||0;if(W.test(w)){const{projection:x}=this.visualElement;if(x&&x.layout){const y=x.layout.layoutBox[b];y&&(w=O(y)*(parseFloat(w)/100))}}this.originPoint[b]=w}),p&&C.update(()=>p(u,d),!1,!0);const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},i=(u,d)=>{const{dragPropagation:h,dragDirectionLock:f,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openGlobalLock)return;const{offset:b}=d;if(f&&this.currentDirection===null){this.currentDirection=ml(b),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,b),this.updateAxis("y",d.point,b),this.visualElement.render(),m&&m(u,d)},a=(u,d)=>this.stop(u,d),c=()=>z(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:l}=this.getProps();this.panSession=new xo(e,{onSessionStart:o,onStart:r,onMove:i,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:Mo(this.visualElement)})}stop(e,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&C.update(()=>r(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:o}=this.getProps();if(!s||!Ht(e,o,this.currentDirection))return;const r=this.getAxisMotionValue(e);let i=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(i=el(i,this.constraints[e],this.elastic[e])),r.set(i)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:s}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,r=this.constraints;n&>(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&o?this.constraints=nl(o.layoutBox,n):this.constraints=!1,this.elastic=rl(s),r!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&z(i=>{this.getAxisMotionValue(i)&&(this.constraints[i]=il(o.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!gt(e))return!1;const s=e.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const r=hl(s,o.root,this.visualElement.getTransformPagePoint());let i=sl(o.layout.layoutBox,r);if(n){const a=n(al(i));this.hasMutatedConstraints=!!a,a&&(i=ko(a))}return i}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:o,dragTransition:r,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=z(u=>{if(!Ht(u,n,this.currentDirection))return;let d=c&&c[u]||{};i&&(d={min:0,max:0});const h=o?200:1e6,f=o?40:1e7,p={type:"inertia",velocity:s?e[u]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...r,...d};return this.startAxisValueAnimation(u,p)});return Promise.all(l).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return s.start(en(e,s,0,n))}stopAnimation(){z(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){z(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n="_drag"+e.toUpperCase(),s=this.visualElement.getProps(),o=s[n];return o||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){z(n=>{const{drag:s}=this.getProps();if(!Ht(n,s,this.currentDirection))return;const{projection:o}=this.visualElement,r=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:a}=o.layout.layoutBox[n];r.set(e[n]-R(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!gt(n)||!s||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};z(i=>{const a=this.getAxisMotionValue(i);if(a){const c=a.get();o[i]=ol({min:c,max:c},this.constraints[i])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),z(i=>{if(!Ht(i,e,null))return;const a=this.getAxisMotionValue(i),{min:c,max:l}=this.constraints[i];a.set(R(c,l,o[i]))})}addListeners(){if(!this.visualElement.current)return;fl.set(this.visualElement,this);const e=this.visualElement.current,n=K(e,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(c)}),s=()=>{const{dragConstraints:c}=this.getProps();gt(c)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,r=o.addEventListener("measure",s);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),s();const i=G(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(z(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=c[u].translate,d.set(d.get()+c[u].translate))}),this.visualElement.render())}));return()=>{i(),n(),r(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:o=!1,dragConstraints:r=!1,dragElastic:i=Re,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:o,dragConstraints:r,dragElastic:i,dragMomentum:a}}}function Ht(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function ml(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class yl extends st{constructor(e){super(e),this.removeGroupControls=L,this.removeListeners=L,this.controls=new pl(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||L}unmount(){this.removeGroupControls(),this.removeListeners()}}const Un=t=>(e,n)=>{t&&C.update(()=>t(e,n))};class gl extends st{constructor(){super(...arguments),this.removePointerDownListener=L}onPointerDown(e){this.session=new xo(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Mo(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:o}=this.node.getProps();return{onSessionStart:Un(e),onStart:Un(n),onMove:s,onEnd:(r,i)=>{delete this.session,o&&C.update(()=>o(r,i))}}}mount(){this.removePointerDownListener=K(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function vl(){const t=v.useContext(ne);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:s}=t,o=v.useId();return v.useEffect(()=>s(o),[]),!e&&n?[!1,()=>n&&n(o)]:[!0]}const qt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Hn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ct={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(P.test(t))t=parseFloat(t);else return t;const n=Hn(t,e.target.x),s=Hn(t,e.target.y);return`${n}% ${s}%`}},xl={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,o=nt.parse(t);if(o.length>5)return s;const r=nt.createTransformer(t),i=typeof o[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;o[0+i]/=a,o[1+i]/=c;const l=R(a,c,.5);return typeof o[2+i]=="number"&&(o[2+i]/=l),typeof o[3+i]=="number"&&(o[3+i]/=l),r(o)}};class bl extends lt.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:o}=this.props,{projection:r}=e;Cr(kl),r&&(n.group&&n.group.add(r),s&&s.register&&o&&s.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),qt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:o,isPresent:r}=this.props,i=s.projection;return i&&(i.isPresent=r,o||e.layoutDependency!==n||n===void 0?i.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?i.promote():i.relegate()||C.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),queueMicrotask(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:o}=e;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),s&&s.deregister&&s.deregister(o))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Vo(t){const[e,n]=vl(),s=v.useContext($e);return lt.createElement(bl,{...t,layoutGroup:s,switchLayoutGroup:v.useContext(bs),isPresent:e,safeToRemove:n})}const kl={borderRadius:{...Ct,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ct,borderTopRightRadius:Ct,borderBottomLeftRadius:Ct,borderBottomRightRadius:Ct,boxShadow:xl},Co=["TopLeft","TopRight","BottomLeft","BottomRight"],wl=Co.length,Wn=t=>typeof t=="string"?parseFloat(t):t,qn=t=>typeof t=="number"||P.test(t);function Pl(t,e,n,s,o,r){o?(t.opacity=R(0,n.opacity!==void 0?n.opacity:1,Tl(s)),t.opacityExit=R(e.opacity!==void 0?e.opacity:1,0,Ml(s))):r&&(t.opacity=R(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let i=0;ise?1:n(jt(t,e,s))}function Kn(t,e){t.min=e.min,t.max=e.max}function $(t,e){Kn(t.x,e.x),Kn(t.y,e.y)}function Yn(t,e,n,s,o){return t-=e,t=te(t,1/n,s),o!==void 0&&(t=te(t,1/o,s)),t}function Vl(t,e=0,n=1,s=.5,o,r=t,i=t){if(W.test(e)&&(e=parseFloat(e),e=R(i.min,i.max,e/100)-i.min),typeof e!="number")return;let a=R(r.min,r.max,s);t===r&&(a-=e),t.min=Yn(t.min,e,n,a,o),t.max=Yn(t.max,e,n,a,o)}function Xn(t,e,[n,s,o],r,i){Vl(t,e[n],e[s],e[o],e.scale,r,i)}const Cl=["x","scaleX","originX"],Sl=["y","scaleY","originY"];function Zn(t,e,n,s){Xn(t.x,e,Cl,n?n.x:void 0,s?s.x:void 0),Xn(t.y,e,Sl,n?n.y:void 0,s?s.y:void 0)}function Qn(t){return t.translate===0&&t.scale===1}function Ao(t){return Qn(t.x)&&Qn(t.y)}function Al(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function Do(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function Jn(t){return O(t.x)/O(t.y)}class Dl{constructor(){this.members=[]}add(e){nn(this.members,e),e.scheduleRender()}remove(e){if(sn(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(o=>e===o);if(n===0)return!1;let s;for(let o=n;o>=0;o--){const r=this.members[o];if(r.isPresent!==!1){s=r;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:o}=e.options;o===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ts(t,e,n){let s="";const o=t.x.translate/e.x,r=t.y.translate/e.y;if((o||r)&&(s=`translate3d(${o}px, ${r}px, 0) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:c,rotateX:l,rotateY:u}=n;c&&(s+=`rotate(${c}deg) `),l&&(s+=`rotateX(${l}deg) `),u&&(s+=`rotateY(${u}deg) `)}const i=t.x.scale*e.x,a=t.y.scale*e.y;return(i!==1||a!==1)&&(s+=`scale(${i}, ${a})`),s||"none"}const Rl=(t,e)=>t.depth-e.depth;class Ll{constructor(){this.children=[],this.isDirty=!1}add(e){nn(this.children,e),this.isDirty=!0}remove(e){sn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Rl),this.isDirty=!1,this.children.forEach(e)}}function El(t,e){const n=performance.now(),s=({timestamp:o})=>{const r=o-n;r>=e&&(X(s),t(r-e))};return C.read(s,!0),()=>X(s)}function _l(t){window.MotionDebug&&window.MotionDebug.record(t)}function jl(t){return t instanceof SVGElement&&t.tagName!=="svg"}function Fl(t,e,n){const s=N(t)?t:kt(t);return s.start(en("",s,e,n)),s.animation}const es=["","X","Y","Z"],Bl={visibility:"hidden"},ns=1e3;let Nl=0;const at={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function Ro({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(i={},a=e?.()){this.id=Nl++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,at.totalNodes=at.resolvedTargetDeltas=at.recalculatedProjection=0,this.nodes.forEach($l),this.nodes.forEach(ql),this.nodes.forEach(Gl),this.nodes.forEach(zl),_l(at)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;t(i,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=El(h,250),qt.hasAnimatedSinceResize&&(qt.hasAnimatedSinceResize=!1,this.nodes.forEach(os))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&u&&(c||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||Ql,{onLayoutAnimationStart:b,onLayoutAnimationComplete:w}=u.getProps(),x=!this.targetLayout||!Do(this.targetLayout,p)||f,y=!h&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||y||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,y);const k={...tn(m,"layout"),onPlay:b,onComplete:w};(u.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k)}else h||os(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,X(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Kl),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;uthis.update()))}clearAllSnapshots(){this.nodes.forEach(Ul),this.sharedNodes.forEach(Yl)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,C.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){C.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const T=k/1e3;is(d.x,i.x,T),is(d.y,i.y,T),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Lt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Xl(this.relativeTarget,this.relativeTargetOrigin,h,T),y&&Al(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=E()),$(y,this.relativeTarget)),m&&(this.animationValues=u,Pl(u,l,this.latestValues,T,x,w)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(X(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=C.update(()=>{qt.hasAnimatedSinceResize=!0,this.currentAnimation=Fl(0,ns,{...i,onUpdate:a=>{this.mixTargetDelta(a),i.onUpdate&&i.onUpdate(a)},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ns),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=i;if(!(!a||!c||!l)){if(this!==i&&this.layout&&l&&Lo(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||E();const d=O(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+d;const h=O(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+h}$(a,c),bt(a,u),Rt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new Dl),this.sharedNodes.get(i).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var i;const{layoutId:a}=this.options;return a?((i=this.getStack())===null||i===void 0?void 0:i.lead)||this:this}getPrevLead(){var i;const{layoutId:a}=this.options;return a?(i=this.getStack())===null||i===void 0?void 0:i.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:c}=i;if((c.rotate||c.rotateX||c.rotateY||c.rotateZ)&&(a=!0),!a)return;const l={};for(let u=0;u{var a;return(a=i.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(ss),this.root.sharedNodes.clear()}}}function Ol(t){t.updateLayout()}function Il(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:o}=t.layout,{animationType:r}=t.options,i=n.source!==t.layout.source;r==="size"?z(d=>{const h=i?n.measuredBox[d]:n.layoutBox[d],f=O(h);h.min=s[d].min,h.max=h.min+f}):Lo(r,n.layoutBox,s)&&z(d=>{const h=i?n.measuredBox[d]:n.layoutBox[d],f=O(s[d]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+f)});const a=xt();Rt(a,s,n.layoutBox);const c=xt();i?Rt(c,t.applyTransform(o,!0),n.measuredBox):Rt(c,s,n.layoutBox);const l=!Ao(a);let u=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:f}=d;if(h&&f){const p=E();Lt(p,n.layoutBox,h.layoutBox);const m=E();Lt(m,s,f.layoutBox),Do(p,m)||(u=!0),d.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=p,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:c,layoutDelta:a,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function $l(t){at.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function zl(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Ul(t){t.clearSnapshot()}function ss(t){t.clearMeasurements()}function Hl(t){t.isLayoutDirty=!1}function Wl(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function os(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ql(t){t.resolveTargetDelta()}function Gl(t){t.calcProjection()}function Kl(t){t.resetRotation()}function Yl(t){t.removeLeadSnapshot()}function is(t,e,n){t.translate=R(e.translate,0,n),t.scale=R(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function rs(t,e,n,s){t.min=R(e.min,n.min,s),t.max=R(e.max,n.max,s)}function Xl(t,e,n,s){rs(t.x,e.x,n.x,s),rs(t.y,e.y,n.y,s)}function Zl(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Ql={duration:.45,ease:[.4,0,.1,1]},as=t=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(t),cs=as("applewebkit/")&&!as("chrome/")?Math.round:L;function ls(t){t.min=cs(t.min),t.max=cs(t.max)}function Jl(t){ls(t.x),ls(t.y)}function Lo(t,e,n){return t==="position"||t==="preserve-aspect"&&!De(Jn(e),Jn(n),.2)}const tu=Ro({attachResizeListener:(t,e)=>G(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ke={current:void 0},Eo=Ro({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ke.current){const t=new tu({});t.mount(window),t.setOptions({layoutScroll:!0}),ke.current=t}return ke.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),eu={pan:{Feature:gl},drag:{Feature:yl,ProjectionNode:Eo,MeasureLayout:Vo}},nu=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function su(t){const e=nu.exec(t);if(!e)return[,];const[,n,s]=e;return[n,s]}function _e(t,e,n=1){const[s,o]=su(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const i=r.trim();return mo(i)?parseFloat(i):i}else return Pe(o)?_e(o,e,n+1):o}function ou(t,{...e},n){const s=t.current;if(!(s instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(o=>{const r=o.get();if(!Pe(r))return;const i=_e(r,s);i&&o.set(i)});for(const o in e){const r=e[o];if(!Pe(r))continue;const i=_e(r,s);i&&(e[o]=i,n||(n={}),n[o]===void 0&&(n[o]=r))}return{target:e,transitionEnd:n}}const iu=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),_o=t=>iu.has(t),ru=t=>Object.keys(t).some(_o),us=t=>t===ft||t===P,ds=(t,e)=>parseFloat(t.split(", ")[e]),hs=(t,e)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const o=s.match(/^matrix3d\((.+)\)$/);if(o)return ds(o[1],e);{const r=s.match(/^matrix\((.+)\)$/);return r?ds(r[1],t):0}},au=new Set(["x","y","z"]),cu=Ft.filter(t=>!au.has(t));function lu(t){const e=[];return cu.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}const wt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:hs(4,13),y:hs(5,14)};wt.translateX=wt.x;wt.translateY=wt.y;const uu=(t,e,n)=>{const s=e.measureViewportBox(),o=e.current,r=getComputedStyle(o),{display:i}=r,a={};i==="none"&&e.setStaticValue("display",t.display||"block"),n.forEach(l=>{a[l]=wt[l](s,r)}),e.render();const c=e.measureViewportBox();return n.forEach(l=>{const u=e.getValue(l);u&&u.jump(a[l]),t[l]=wt[l](c,r)}),t},du=(t,e,n={},s={})=>{e={...e},s={...s};const o=Object.keys(e).filter(_o);let r=[],i=!1;const a=[];if(o.forEach(c=>{const l=t.getValue(c);if(!t.hasValue(c))return;let u=n[c],d=Vt(u);const h=e[c];let f;if(Yt(h)){const p=h.length,m=h[0]===null?1:0;u=h[m],d=Vt(u);for(let b=m;b=0?window.pageYOffset:null,l=uu(e,t,a);return r.length&&r.forEach(([u,d])=>{t.getValue(u).set(d)}),t.render(),se&&c!==null&&window.scrollTo({top:c}),{target:l,transitionEnd:s}}else return{target:e,transitionEnd:s}};function hu(t,e,n,s){return ru(e)?du(t,e,n,s):{target:e,transitionEnd:s}}const fu=(t,e,n,s)=>{const o=ou(t,e,s);return e=o.target,s=o.transitionEnd,hu(t,e,n,s)},je={current:null},jo={current:!1};function pu(){if(jo.current=!0,!!se)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>je.current=t.matches;t.addListener(e),e()}else je.current=!1}function mu(t,e,n){const{willChange:s}=e;for(const o in e){const r=e[o],i=n[o];if(N(r))t.addValue(o,r),Jt(s)&&s.add(o);else if(N(i))t.addValue(o,kt(r,{owner:t})),Jt(s)&&s.remove(o);else if(i!==r)if(t.hasValue(o)){const a=t.getValue(o);!a.hasAnimated&&a.set(r)}else{const a=t.getStaticValue(o);t.addValue(o,kt(a!==void 0?a:r,{owner:t}))}}for(const o in n)e[o]===void 0&&t.removeValue(o);return e}const fs=new WeakMap,Fo=Object.keys(_t),yu=Fo.length,ps=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],gu=Ie.length;class vu{constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:o,visualState:r},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>C.render(this.render,!1,!0);const{latestValues:a,renderState:c}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=o,this.options=i,this.isControllingVariants=ie(n),this.isVariantNode=xs(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(n,{});for(const d in u){const h=u[d];a[d]!==void 0&&N(h)&&(h.set(a[d],!1),Jt(l)&&l.add(d))}}scrapeMotionValuesFromProps(e,n){return{}}mount(e){this.current=e,fs.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),jo.current||pu(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:je.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){fs.delete(this.current),this.projection&&this.projection.unmount(),X(this.notifyUpdate),X(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,n){const s=ht.has(e),o=n.on("change",i=>{this.latestValues[e]=i,this.props.onUpdate&&C.update(this.notifyUpdate,!1,!0),s&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{o(),r()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...n},s,o,r){let i,a;for(let c=0;cthis.scheduleRender(),animationType:typeof l=="string"?l:"both",initialPromotionConfig:r,layoutScroll:h,layoutRoot:f})}return a}updateFeatures(){for(const e in this.features){const n=this.features[e];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):E()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}makeTargetAnimatable(e,n=!0){return this.makeTargetAnimatableFromInstance(e,this.props,n)}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;sn.variantChildren.delete(e)}addValue(e,n){n!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,n)),this.values.set(e,n),this.latestValues[e]=n.get()}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=kt(n,{owner:this}),this.addValue(e,s)),s}readValue(e){var n;return this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(n=this.getBaseTargetFromProps(this.props,e))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,e,this.options)}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:s}=this.props,o=typeof s=="string"||typeof s=="object"?(n=Ke(this.props,s))===null||n===void 0?void 0:n[e]:void 0;if(s&&o!==void 0)return o;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!N(r)?r:this.initialValues[e]!==void 0&&o===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new on),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class Bo extends vu{sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:n,...s},{transformValues:o},r){let i=jc(s,e||{},this);if(o&&(n&&(n=o(n)),s&&(s=o(s)),i&&(i=o(i))),r){Ec(this,s,i);const a=fu(this,s,i,n);n=a.transitionEnd,s=a.target}return{transition:e,transitionEnd:n,...s}}}function xu(t){return window.getComputedStyle(t)}class bu extends Bo{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,n){if(ht.has(n)){const s=Je(n);return s&&s.default||0}else{const s=xu(e),o=(Ps(n)?s.getPropertyValue(n):s[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(e,{transformPagePoint:n}){return To(e,n)}build(e,n,s,o){Ue(e,n,s,o.transformTemplate)}scrapeMotionValuesFromProps(e,n){return Ge(e,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;N(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(e,n,s,o){As(e,n,s,o)}}class ku extends Bo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(ht.has(n)){const s=Je(n);return s&&s.default||0}return n=Ds.has(n)?n:Ne(n),e.getAttribute(n)}measureInstanceViewportBox(){return E()}scrapeMotionValuesFromProps(e,n){return Ls(e,n)}build(e,n,s,o){We(e,n,s,this.isSVGTag,o.transformTemplate)}renderInstance(e,n,s,o){Rs(e,n,s,o)}mount(e){this.isSVGTag=qe(e.tagName),super.mount(e)}}const wu=(t,e)=>ze(t)?new ku(e,{enableHardwareAcceleration:!1}):new bu(e,{enableHardwareAcceleration:!0}),Pu={layout:{ProjectionNode:Eo,MeasureLayout:Vo}},Tu={...Xc,...ya,...eu,...Pu},fh=Mr((t,e)=>sa(t,e,Tu,wu));function No(){const t=v.useRef(!1);return Be(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Mu(){const t=No(),[e,n]=v.useState(0),s=v.useCallback(()=>{t.current&&n(e+1)},[e]);return[v.useCallback(()=>C.postRender(s),[s]),e]}class Vu extends v.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Cu({children:t,isPresent:e}){const n=v.useId(),s=v.useRef(null),o=v.useRef({width:0,height:0,top:0,left:0});return v.useInsertionEffect(()=>{const{width:r,height:i,top:a,left:c}=o.current;if(e||!s.current||!r||!i)return;s.current.dataset.motionPopId=n;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(` - [data-motion-pop-id="${n}"] { - position: absolute !important; - width: ${r}px !important; - height: ${i}px !important; - top: ${a}px !important; - left: ${c}px !important; - } - `),()=>{document.head.removeChild(l)}},[e]),v.createElement(Vu,{isPresent:e,childRef:s,sizeRef:o},v.cloneElement(t,{ref:s}))}const we=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:o,presenceAffectsLayout:r,mode:i})=>{const a=Es(Su),c=v.useId(),l=v.useMemo(()=>({id:c,initial:e,isPresent:n,custom:o,onExitComplete:u=>{a.set(u,!0);for(const d of a.values())if(!d)return;s&&s()},register:u=>(a.set(u,!1),()=>a.delete(u))}),r?void 0:[n]);return v.useMemo(()=>{a.forEach((u,d)=>a.set(d,!1))},[n]),v.useEffect(()=>{!n&&!a.size&&s&&s()},[n]),i==="popLayout"&&(t=v.createElement(Cu,{isPresent:n},t)),v.createElement(ne.Provider,{value:l},t)};function Su(){return new Map}function Au(t){return v.useEffect(()=>()=>t(),[])}const ct=t=>t.key||"";function Du(t,e){t.forEach(n=>{const s=ct(n);e.set(s,n)})}function Ru(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const ph=({children:t,custom:e,initial:n=!0,onExitComplete:s,exitBeforeEnter:o,presenceAffectsLayout:r=!0,mode:i="sync"})=>{const a=v.useContext($e).forceRender||Mu()[0],c=No(),l=Ru(t);let u=l;const d=v.useRef(new Map).current,h=v.useRef(u),f=v.useRef(new Map).current,p=v.useRef(!0);if(Be(()=>{p.current=!1,Du(l,f),h.current=u}),Au(()=>{p.current=!0,f.clear(),d.clear()}),p.current)return v.createElement(v.Fragment,null,u.map(x=>v.createElement(we,{key:ct(x),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:r,mode:i},x)));u=[...u];const m=h.current.map(ct),b=l.map(ct),w=m.length;for(let x=0;x{if(b.indexOf(y)!==-1)return;const k=f.get(y);if(!k)return;const T=m.indexOf(y);let S=x;if(!S){const A=()=>{d.delete(y);const M=Array.from(f.keys()).filter(V=>!b.includes(V));if(M.forEach(V=>f.delete(V)),h.current=l.filter(V=>{const I=ct(V);return I===y||M.includes(I)}),!d.size){if(c.current===!1)return;a(),s&&s()}};S=v.createElement(we,{key:ct(k),isPresent:!1,onExitComplete:A,custom:e,presenceAffectsLayout:r,mode:i},k),d.set(y,S)}u.splice(T,0,S)}),u=u.map(x=>{const y=x.key;return d.has(y)?x:v.createElement(we,{key:ct(x),isPresent:!0,presenceAffectsLayout:r,mode:i},x)}),v.createElement(v.Fragment,null,d.size?u:u.map(x=>v.cloneElement(x)))};function Lu(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}Array(12).fill(0);let Fe=1;class Eu{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:s,...o}=e,r=typeof e?.id=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:Fe++,i=this.toasts.find(c=>c.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(c=>c.id===r?(this.publish({...c,...e,id:r,title:s}),{...c,...e,id:r,dismissible:a,title:s}):c):this.addToast({title:s,...o,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(s=>s({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let s;n.loading!==void 0&&(s=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(e instanceof Function?e():e);let r=s!==void 0,i;const a=o.then(async l=>{if(i=["resolve",l],lt.isValidElement(l))r=!1,this.create({id:s,type:"default",message:l});else if(ju(l)&&!l.ok){r=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${l.status}`):n.error,h=typeof n.description=="function"?await n.description(`HTTP error! status: ${l.status}`):n.description,p=typeof d=="object"&&!lt.isValidElement(d)?d:{message:d};this.create({id:s,type:"error",description:h,...p})}else if(l instanceof Error){r=!1;const d=typeof n.error=="function"?await n.error(l):n.error,h=typeof n.description=="function"?await n.description(l):n.description,p=typeof d=="object"&&!lt.isValidElement(d)?d:{message:d};this.create({id:s,type:"error",description:h,...p})}else if(n.success!==void 0){r=!1;const d=typeof n.success=="function"?await n.success(l):n.success,h=typeof n.description=="function"?await n.description(l):n.description,p=typeof d=="object"&&!lt.isValidElement(d)?d:{message:d};this.create({id:s,type:"success",description:h,...p})}}).catch(async l=>{if(i=["reject",l],n.error!==void 0){r=!1;const u=typeof n.error=="function"?await n.error(l):n.error,d=typeof n.description=="function"?await n.description(l):n.description,f=typeof u=="object"&&!lt.isValidElement(u)?u:{message:u};this.create({id:s,type:"error",description:d,...f})}}).finally(()=>{r&&(this.dismiss(s),s=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((l,u)=>a.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof s!="string"&&typeof s!="number"?{unwrap:c}:Object.assign(s,{unwrap:c})},this.custom=(e,n)=>{const s=n?.id||Fe++;return this.create({jsx:e(s),id:s,...n}),s},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const U=new Eu,_u=(t,e)=>{const n=e?.id||Fe++;return U.addToast({title:t,...e,id:n}),n},ju=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Fu=_u,Bu=()=>U.toasts,Nu=()=>U.getActiveToasts(),mh=Object.assign(Fu,{success:U.success,info:U.info,warning:U.warning,error:U.error,custom:U.custom,message:U.message,promise:U.promise,dismiss:U.dismiss,loading:U.loading},{getHistory:Bu,getToasts:Nu});Lu("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");export{Pd as $,ph as A,Hu as B,Ku as C,rd as D,pd as E,yd as F,id as G,wd as H,Jd as I,Yd as J,ld as K,Vd as L,Ad as M,sd as N,kd as O,Od as P,xd as Q,$d as R,Hd as S,sh as T,ah as U,Ed as V,uh as W,lh as X,fd as Y,dh as Z,Td as _,Uu as a,Cd as a0,cd as a1,ed as a2,hd as a3,ih as a4,zd as a5,td as a6,_d as a7,Nd as a8,Qd as a9,nd as aa,th as ab,Rd as ac,Xu as ad,nh as ae,dd as af,Wu as ag,vd as ah,ud as ai,bd as aj,Xd as ak,ch as al,Ld as am,Md as an,Id as ao,Gd as ap,zu as aq,Sd as ar,od as b,Ju as c,gd as d,md as e,qd as f,jd as g,eh as h,Bd as i,Dd as j,rh as k,qu as l,fh as m,Gu as n,$u as o,Kd as p,Ud as q,Wd as r,Zu as s,mh as t,Yu as u,Zd as v,Qu as w,oh as x,Fd as y,ad as z}; diff --git a/dist/assets/js/useInviteCode-BxOSdQOT.js b/dist/assets/js/useInviteCode-BxOSdQOT.js deleted file mode 100644 index 2c401b6..0000000 --- a/dist/assets/js/useInviteCode-BxOSdQOT.js +++ /dev/null @@ -1,12 +0,0 @@ -import{r as d}from"./router-vendor-D4by-_6Z.js";import{s as n}from"./index-doec96Hx.js";const w=()=>{const[g,s]=d.useState(!1),[m,t]=d.useState(null);return{loading:g,error:m,validarConvite:async i=>{try{s(!0),t(null);const e=i.toUpperCase().trim(),{data:r,error:a}=await n.from("convites").select(` - id, - codigo, - organizacao_id, - role, - max_usos, - usos_atuais, - ativo, - expira_em, - email_convidado, - organizacoes:organizacao_id (nome) - `).eq("codigo",e).eq("ativo",!0).single();if(a||!r)return{success:!1,error:"Código de convite inválido ou expirado."};const o=r;return o.expira_em&&new Date(o.expira_em)0&&o.usos_atuais>=o.max_usos?{success:!1,error:"Este código de convite já atingiu o limite de usos."}:{success:!0,organizacao_id:o.organizacao_id,organizacao_nome:o.organizacoes?.nome||"Organização",role:o.role}}catch(e){const r=e instanceof Error?e.message:"Erro ao validar convite";return t(r),{success:!1,error:r}}finally{s(!1)}},usarConvite:async(i,e)=>{try{s(!0),t(null);const{data:r,error:a}=await n.rpc("usar_convite",{p_codigo:i,p_usuario_id:e});if(a)throw a;const o=r;return o.success||t(o.error||"Erro ao usar convite"),o}catch(r){const a=r instanceof Error?r.message:"Erro ao usar convite";return t(a),{success:!1,error:a}}finally{s(!1)}},gerarConvite:async(i,e={})=>{try{s(!0),t(null);const{data:r,error:a}=await n.rpc("gerar_codigo_convite");if(a)throw a;const o=r;let u=null;if(e.expiraEmDias){const c=new Date;c.setDate(c.getDate()+e.expiraEmDias),u=c.toISOString()}const{data:{user:f}}=await n.auth.getUser(),{error:l}=await n.from("convites").insert({organizacao_id:i,codigo:o,criado_por:f?.id,email_convidado:e.emailConvidado||null,role:e.role||"usuario",max_usos:e.maxUsos??1,expira_em:u});if(l)throw l;return{success:!0,codigo:o}}catch(r){const a=r instanceof Error?r.message:"Erro ao gerar convite";return t(a),{success:!1,error:a}}finally{s(!1)}},listarConvites:async i=>{try{s(!0);const{data:e,error:r}=await n.from("convites").select("*").eq("organizacao_id",i).order("created_at",{ascending:!1});if(r)throw r;return e||[]}catch{return[]}finally{s(!1)}}}};export{w as u}; diff --git a/dist/assets/js/useUserStore-VOdYc7Zm.js b/dist/assets/js/useUserStore-VOdYc7Zm.js deleted file mode 100644 index b10b3f4..0000000 --- a/dist/assets/js/useUserStore-VOdYc7Zm.js +++ /dev/null @@ -1 +0,0 @@ -import{d,p as U,s as o}from"./index-doec96Hx.js";import{c as g}from"./state-vendor-DHadhBU5.js";import"./query-vendor-BLVqILA6.js";import"./router-vendor-D4by-_6Z.js";import"./react-vendor-CqRd3GwO.js";import"./ui-vendor-CyRvbSfR.js";import"./supabase-vendor-CnnNSQLo.js";const i={currentUser:null,users:[],loading:!1,error:null},m=g()(d(U((r,u)=>({...i,setCurrentUser:e=>r({currentUser:e},!1,"setCurrentUser"),setUsers:e=>r({users:e},!1,"setUsers"),setLoading:e=>r({loading:e},!1,"setLoading"),setError:e=>r({error:e},!1,"setError"),clearError:()=>r({error:null},!1,"clearError"),reset:()=>r(i,!1,"reset"),fetchCurrentUser:async e=>{try{r({loading:!0,error:null},!1,"fetchCurrentUser:start");const{data:s,error:a}=await o.from("usuarios").select("*").eq("id",e).single();if(a)throw a;r({currentUser:s,loading:!1},!1,"fetchCurrentUser:success")}catch(s){r({error:s.message||"Erro ao buscar usuário",loading:!1},!1,"fetchCurrentUser:error")}},fetchUsers:async()=>{try{r({loading:!0,error:null},!1,"fetchUsers:start");const{data:e,error:s}=await o.from("usuarios").select("*").order("nome");if(s)throw s;r({users:e||[],loading:!1},!1,"fetchUsers:success")}catch(e){r({error:e.message||"Erro ao buscar usuários",loading:!1},!1,"fetchUsers:error")}},updateUser:async(e,s)=>{try{r({loading:!0,error:null},!1,"updateUser:start");const{data:a,error:t}=await o.from("usuarios").update({...s,updated_at:new Date().toISOString()}).eq("id",e).select().single();if(t)throw t;const{users:n,currentUser:l}=u(),f=n.map(c=>c.id===e?a:c);return r({users:f,currentUser:l?.id===e?a:l,loading:!1},!1,"updateUser:success"),!0}catch(a){return r({error:a.message||"Erro ao atualizar usuário",loading:!1},!1,"updateUser:error"),!1}},createUser:async e=>{try{r({loading:!0,error:null},!1,"createUser:start");const{data:s,error:a}=await o.from("usuarios").insert(e).select().single();if(a)throw a;const{users:t}=u();return r({users:[...t,s],loading:!1},!1,"createUser:success"),!0}catch(s){return r({error:s.message||"Erro ao criar usuário",loading:!1},!1,"createUser:error"),!1}},deleteUser:async e=>{try{r({loading:!0,error:null},!1,"deleteUser:start");const{error:s}=await o.from("usuarios").delete().eq("id",e);if(s)throw s;const{users:a,currentUser:t}=u(),n=a.filter(l=>l.id!==e);return r({users:n,currentUser:t?.id===e?null:t,loading:!1},!1,"deleteUser:success"),!0}catch(s){return r({error:s.message||"Erro ao deletar usuário",loading:!1},!1,"deleteUser:error"),!1}}}),{name:"user-store",partialize:r=>({currentUser:r.currentUser,users:r.users})}))),b=()=>m(r=>r.currentUser);export{b as useCurrentUser,m as useUserStore}; diff --git a/dist/index.html b/dist/index.html index 7e1ba0c..79db7e1 100644 --- a/dist/index.html +++ b/dist/index.html @@ -8,14 +8,14 @@ RDO Mobile - Relatório Diário de Obra - + - - - - - + + + + +