@bailierich/booking-components 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +319 -0
  2. package/TENANT_DATA_INTEGRATION.md +402 -0
  3. package/TENANT_SETUP.md +316 -0
  4. package/components/BookingFlow/BookingFlow.tsx +790 -0
  5. package/components/BookingFlow/index.ts +5 -0
  6. package/components/BookingFlow/steps/AddonsSelection.tsx +118 -0
  7. package/components/BookingFlow/steps/Confirmation.tsx +185 -0
  8. package/components/BookingFlow/steps/ContactForm.tsx +292 -0
  9. package/components/BookingFlow/steps/CycleAwareDateSelection.tsx +277 -0
  10. package/components/BookingFlow/steps/DateSelection.tsx +473 -0
  11. package/components/BookingFlow/steps/ServiceSelection.tsx +315 -0
  12. package/components/BookingFlow/steps/TimeSelection.tsx +230 -0
  13. package/components/BookingFlow/steps/index.ts +10 -0
  14. package/components/BottomSheet/index.tsx +120 -0
  15. package/components/Forms/FormBlock.tsx +283 -0
  16. package/components/Forms/FormField.tsx +385 -0
  17. package/components/Forms/FormRenderer.tsx +216 -0
  18. package/components/Forms/FormValidation.ts +122 -0
  19. package/components/Forms/index.ts +4 -0
  20. package/components/HoldTimer/HoldTimer.tsx +266 -0
  21. package/components/HoldTimer/index.ts +2 -0
  22. package/components/SectionRenderer.tsx +558 -0
  23. package/components/Sections/About.tsx +145 -0
  24. package/components/Sections/BeforeAfter.tsx +81 -0
  25. package/components/Sections/BookingSection.tsx +76 -0
  26. package/components/Sections/Contact.tsx +103 -0
  27. package/components/Sections/FAQSection.tsx +239 -0
  28. package/components/Sections/FeatureContent.tsx +113 -0
  29. package/components/Sections/FeaturedLink.tsx +103 -0
  30. package/components/Sections/FixedInfoCard.tsx +189 -0
  31. package/components/Sections/Gallery.tsx +83 -0
  32. package/components/Sections/Header.tsx +78 -0
  33. package/components/Sections/Hero.tsx +178 -0
  34. package/components/Sections/ImageSection.tsx +147 -0
  35. package/components/Sections/InstagramFeed.tsx +38 -0
  36. package/components/Sections/LinkList.tsx +76 -0
  37. package/components/Sections/LocationMap.tsx +202 -0
  38. package/components/Sections/Logo.tsx +61 -0
  39. package/components/Sections/MinimalFooter.tsx +78 -0
  40. package/components/Sections/MinimalHeader.tsx +81 -0
  41. package/components/Sections/MinimalNavigation.tsx +63 -0
  42. package/components/Sections/Navbar.tsx +258 -0
  43. package/components/Sections/PricingTable.tsx +106 -0
  44. package/components/Sections/ScrollingTextDivider.tsx +138 -0
  45. package/components/Sections/ScrollingTextDivider.tsx.bak +138 -0
  46. package/components/Sections/ServicesPreview.tsx +129 -0
  47. package/components/Sections/SocialBar.tsx +177 -0
  48. package/components/Sections/Team.tsx +80 -0
  49. package/components/Sections/Testimonials.tsx +92 -0
  50. package/components/Sections/TextSection.tsx +116 -0
  51. package/components/Sections/VideoSection.tsx +178 -0
  52. package/components/Sections/index.ts +57 -0
  53. package/components/index.ts +21 -0
  54. package/dist/index-DAai7Glf.d.mts +474 -0
  55. package/dist/index-DAai7Glf.d.ts +474 -0
  56. package/dist/index.d.mts +1075 -0
  57. package/dist/index.d.ts +1075 -0
  58. package/dist/index.js +22 -0
  59. package/dist/index.js.map +1 -0
  60. package/dist/index.mjs +22 -0
  61. package/dist/index.mjs.map +1 -0
  62. package/dist/styles/index.d.mts +1 -0
  63. package/dist/styles/index.d.ts +1 -0
  64. package/dist/styles/index.js +2 -0
  65. package/dist/styles/index.js.map +1 -0
  66. package/dist/styles/index.mjs +2 -0
  67. package/dist/styles/index.mjs.map +1 -0
  68. package/docs/API.md +849 -0
  69. package/docs/CALLBACKS.md +760 -0
  70. package/docs/COMPLETE_SESSION_SUMMARY.md +404 -0
  71. package/docs/DATA_SHAPES.md +684 -0
  72. package/docs/MIGRATION.md +662 -0
  73. package/docs/PAYMENT_INTEGRATION.md +766 -0
  74. package/docs/SESSION_SUMMARY.md +185 -0
  75. package/docs/STYLING.md +735 -0
  76. package/index.ts +4 -0
  77. package/lib/storage.ts +239 -0
  78. package/package.json +59 -0
  79. package/styles/animations.ts +210 -0
  80. package/styles/index.ts +1 -0
  81. package/tsconfig.json +32 -0
  82. package/tsup.config.ts +13 -0
  83. package/types/index.ts +369 -0
package/dist/index.mjs ADDED
@@ -0,0 +1,22 @@
1
+ import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {ChevronDown,ChevronLeft,ChevronRight,X,Instagram,PinIcon,Youtube,Twitter,Music,Facebook,GripVertical}from'lucide-react';import Ge,{createContext,memo,useReducer,useState,useRef,useMemo,useCallback,useLayoutEffect,useEffect,useContext}from'react';import {motion,AnimatePresence}from'framer-motion';import {createClient}from'@supabase/supabase-js';import {unstable_batchedUpdates,createPortal}from'react-dom';function tn({logoUrl:e,fallbackText:t,size:r="medium",alignment:a="center",colors:o,enableInlineEditing:i=false,sectionId:n=""}){let l={small:80,medium:120,large:160}[r];return jsx("div",{className:`container mx-auto px-4 flex ${a==="center"?"justify-center":a==="right"?"justify-end":"justify-start"}`,children:e?jsx("img",{src:e,alt:t||"Logo",className:"object-contain",style:{height:`${l}px`,width:"auto"}}):t?jsx("div",{className:"flex items-center justify-center rounded-full font-bold",style:{width:`${l}px`,height:`${l}px`,backgroundColor:o.primary,color:"#FFFFFF",fontSize:`${l*.4}px`},children:t.slice(0,2).toUpperCase()}):jsx("div",{className:"rounded-full",style:{width:`${l}px`,height:`${l}px`,backgroundColor:o.primary,opacity:.2}})})}function nn({name:e,title:t,bio:r,showName:a=true,showTitle:o=true,showBio:i=true,colors:n,typography:s,enableInlineEditing:l=false,sectionId:c=""}){return jsxs("div",{className:"container mx-auto px-4 text-center",children:[a&&jsx("h1",{className:"text-4xl font-bold mb-3",style:{fontFamily:s.headingFont,color:n.text},...l&&{"data-editable":true,"data-section-id":c,"data-field-path":"settings.name"},children:e||"Your Name"}),o&&jsx("p",{className:"text-lg opacity-80 mb-2",...l&&{"data-editable":true,"data-section-id":c,"data-field-path":"settings.title"},children:t||"Beauty Professional"}),i&&jsx("p",{className:"text-base opacity-70 max-w-md mx-auto",...l&&{"data-editable":true,"data-section-id":c,"data-field-path":"settings.bio"},children:r||"Transform your look \u2728"})]})}function on({text:e,url:t,style:r="gradient",size:a="large",colors:o,enableInlineEditing:i=false,sectionId:n=""}){let s=()=>{let c="";switch(a){case "small":c="p-3 text-base";break;case "medium":c="p-4 text-lg";break;case "large":c="p-5 text-xl";break;default:c="p-5 text-xl";}let d="";switch(r){case "gradient":d="rounded-full";break;case "solid":d="rounded-lg";break;case "outline":d="rounded-full border-2";break;default:d="rounded-full";}return `block max-w-2xl mx-auto ${c} ${d} text-center font-semibold transition-all hover:scale-105 hover:shadow-xl`},l=()=>{switch(r){case "gradient":return {background:`linear-gradient(135deg, ${o.primary} 0%, ${o.secondary} 100%)`,color:"#FFFFFF"};case "solid":return {backgroundColor:o.primary,color:"#FFFFFF"};case "outline":return {backgroundColor:"transparent",borderColor:o.primary,color:o.primary};default:return {backgroundColor:o.primary,color:"#FFFFFF"}}};return jsx("div",{className:"container mx-auto px-4",children:jsx("a",{href:t||"/book",className:s(),style:l(),...i&&{"data-editable":true,"data-section-id":n,"data-field-path":"settings.text"},children:e||"\u{1F485} Book Now"})})}function sn({links:e,style:t="pill",colors:r,enableInlineEditing:a=false,sectionId:o=""}){let i=()=>{let s="block w-full p-4 text-center font-medium transition-all hover:scale-105";switch(t){case "pill":return `${s} rounded-full`;case "square":return `${s} rounded-md`;case "outline":return `${s} rounded-full border-2`;default:return `${s} rounded-lg`}},n=s=>s?{backgroundColor:"transparent",borderColor:r.primary,color:r.primary}:{backgroundColor:r.linkBackground||r.primary,color:r.linkText||"#FFFFFF"};return jsx("div",{className:"container mx-auto px-4",children:jsx("div",{className:"max-w-2xl mx-auto space-y-3",children:e.map((s,l)=>jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:i(),style:n(t==="outline"),...a&&{"data-editable":true,"data-section-id":o,"data-field-path":`settings.links.${l}.label`},children:s.label},s.id))})})}function ln({platforms:e,socialLinks:t={},style:r="filled",size:a="large",position:o="center",invertIcons:i=false,colors:n,enableInlineEditing:s=false,sectionId:l=""}){let c=p=>{let b=p.replace("#",""),w=parseInt(b.substr(0,2),16),N=parseInt(b.substr(2,2),16),g=parseInt(b.substr(4,2),16);return (.299*w+.587*N+.114*g)/255>.5?"#000000":"#FFFFFF"},d=p=>{let b=a==="small"?20:a==="medium"?24:28;switch(p){case "instagram":return jsx(Instagram,{size:b});case "facebook":return jsx(Facebook,{size:b});case "tiktok":return jsx(Music,{size:b});case "twitter":return jsx(Twitter,{size:b});case "youtube":return jsx(Youtube,{size:b});case "pinterest":return jsx(PinIcon,{size:b});default:return jsx(Instagram,{size:b})}},u=()=>{let p="";switch(a){case "small":p="w-10 h-10 text-lg";break;case "medium":p="w-12 h-12 text-xl";break;case "large":p="w-14 h-14 text-2xl";break;default:p="w-14 h-14 text-2xl";}let b="";switch(r){case "filled":b="rounded-full";break;case "outline":b="rounded-full border-2";break;case "ghost":b="rounded-full";break;default:b="rounded-full";}return `${p} ${b} flex items-center justify-center hover:scale-110 transition-transform`},m=()=>{switch(r){case "filled":return {backgroundColor:n.primary,color:c(n.primary||"#BCB4FF")};case "outline":return {backgroundColor:"transparent",borderColor:n.primary,color:n.primary};case "ghost":return {backgroundColor:"rgba(0,0,0,0.05)",color:n.primary};default:return {backgroundColor:n.primary,color:c(n.primary||"#BCB4FF")}}};return o==="left-vertical"||o==="right-vertical"?jsx("div",{className:`fixed top-6 z-40 flex flex-col gap-3 ${o==="left-vertical"?"left-4":"right-4"}`,children:e.map(p=>{let b=t[p]||`https://${p}.com/`;return jsx("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:u(),style:{...m(),filter:i?"invert(1)":"none"},title:p.charAt(0).toUpperCase()+p.slice(1),children:d(p)},p)})}):jsx("div",{className:"container mx-auto px-4 py-8 text-center",children:jsx("div",{className:"flex items-center justify-center gap-4",children:e.map(p=>{let b=t[p]||`https://${p}.com/`;return jsx("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:u(),style:{...m(),filter:i?"invert(1)":"none"},title:p.charAt(0).toUpperCase()+p.slice(1),children:d(p)},p)})})})}function cn({headline:e,subheadline:t,heroImage:r,ctaButton:a,layout:o="split",imagePosition:i="right",contentDisplay:n="side",colors:s,typography:l,enableInlineEditing:c=false,sectionId:d=""}){let u=jsxs("div",{className:o==="full"?"text-center max-w-4xl z-10":"text-left",children:[jsx("h1",{className:o==="full"?"text-5xl md:text-6xl font-bold mb-6":"text-5xl font-bold mb-4",style:{fontFamily:l.headingFont,color:o==="full"&&r?"#FFFFFF":s.text,textShadow:o==="full"&&r?"0 2px 10px rgba(0,0,0,0.3)":"none"},...c&&{"data-editable":true,"data-section-id":d,"data-field-path":"settings.headline"},children:e||"Welcome"}),t&&jsx("p",{className:o==="full"?"text-xl md:text-2xl opacity-90 mb-12":"text-xl opacity-80 mb-8",style:{color:o==="full"&&r?"#FFFFFF":s.text,textShadow:o==="full"&&r?"0 2px 10px rgba(0,0,0,0.3)":"none"},...c&&{"data-editable":true,"data-section-id":d,"data-field-path":"settings.subheadline"},children:t}),a&&jsx("a",{href:a.url||"#",className:"inline-block px-8 py-4 rounded-lg font-semibold text-lg transition-all hover:scale-105 shadow-lg",style:{backgroundColor:s.primary,color:"#FFFFFF"},...c&&{"data-editable":true,"data-section-id":d,"data-field-path":"settings.ctaButton.text"},children:a.text||"Get Started"})]}),m=r?jsx("div",{className:"w-full h-full rounded-2xl overflow-hidden",children:jsx("img",{src:r,alt:e||"Hero",className:"w-full h-full object-cover"})}):jsx("div",{className:"w-full h-full rounded-2xl flex items-center justify-center",style:{backgroundColor:s.primary,opacity:.1},children:jsx("span",{className:"text-sm opacity-50",children:"Add hero image"})});return o==="full"?jsxs("div",{className:"relative py-20 md:py-24 px-4 flex items-center justify-center",style:{backgroundImage:r?`url(${r})`:"none",backgroundSize:"cover",backgroundPosition:"center",backgroundColor:r?"transparent":s.primary,opacity:r?1:.1},children:[r&&jsx("div",{className:"absolute inset-0 bg-black/40"}),u]}):n==="overlay"?jsx("div",{className:"container mx-auto px-4 py-16",children:jsxs("div",{className:"relative max-w-6xl mx-auto rounded-2xl overflow-hidden",style:{height:"500px"},children:[r?jsx("img",{src:r,alt:e||"Hero",className:"absolute inset-0 w-full h-full object-cover"}):jsx("div",{className:"absolute inset-0",style:{backgroundColor:s.primary,opacity:.1}}),jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-black/60 to-black/20"}),jsx("div",{className:`relative h-full flex items-center ${i==="left"?"justify-end":"justify-start"} px-12`,children:jsx("div",{className:"max-w-lg",style:{color:"#FFFFFF",textShadow:"0 2px 10px rgba(0,0,0,0.3)"},children:u})})]})}):jsx("div",{className:"container mx-auto px-4 py-16",children:jsxs("div",{className:"grid md:grid-cols-2 gap-12 items-center max-w-6xl mx-auto",children:[i==="left"&&jsx("div",{className:"aspect-[4/3]",children:m}),jsx("div",{children:u}),i==="right"&&jsx("div",{className:"aspect-[4/3]",children:m})]})})}function dn({title:e,content:t,image:r,layout:a="centered",colors:o,typography:i,enableInlineEditing:n=false,sectionId:s=""}){return a==="centered"?jsx("div",{className:"container mx-auto px-4 py-16",children:jsxs("div",{className:"max-w-3xl mx-auto text-center",children:[jsx("h2",{className:"text-3xl font-bold mb-6",style:{fontFamily:i.headingFont,color:o.text},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.title"},children:e||"About Us"}),jsx("p",{className:"text-lg opacity-80",...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.content"},children:t||"Tell your story here..."})]})}):a==="split"?jsx("div",{className:"container mx-auto px-4 py-16",children:jsxs("div",{className:"max-w-6xl mx-auto grid md:grid-cols-2 gap-12 items-center",children:[jsx("div",{className:"aspect-square rounded-2xl overflow-hidden",children:r?jsx("img",{src:r,alt:e||"About",className:"w-full h-full object-cover"}):jsx("div",{className:"w-full h-full flex items-center justify-center",style:{backgroundColor:o.primary,opacity:.2},children:jsx("span",{className:"text-sm opacity-50",children:"Add image"})})}),jsxs("div",{children:[jsx("h2",{className:"text-3xl font-bold mb-6",style:{fontFamily:i.headingFont,color:o.text},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.title"},children:e||"About Us"}),jsx("p",{className:"text-lg opacity-80 leading-relaxed",...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.content"},children:t||"Tell your story here..."})]})]})}):jsx("div",{className:"container mx-auto px-4 py-16",children:jsxs("div",{className:"max-w-7xl mx-auto",children:[jsx("h2",{className:"text-4xl font-bold mb-8 text-left",style:{fontFamily:i.headingFont,color:o.text},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.title"},children:e||"About Us"}),jsx("p",{className:"text-xl opacity-80 leading-relaxed columns-2 gap-12",...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.content"},children:t||"Tell your story here..."})]})})}function un({title:e,services:t=[],layout:r="grid",columns:a=3,showPrices:o=true,showDuration:i=true,colors:n,typography:s,enableInlineEditing:l=false,sectionId:c=""}){let d={2:"grid-cols-1 md:grid-cols-2",3:"grid-cols-1 md:grid-cols-3",4:"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"},u=t.length>0?t:[{id:1,name:"Haircut & Style",description:"Professional cut and styling",price:75,duration:60},{id:2,name:"Color Treatment",description:"Full color or highlights",price:150,duration:120},{id:3,name:"Deep Conditioning",description:"Restorative treatment",price:50,duration:45}],m=()=>{switch(r){case "grid":return `grid ${d[a]} gap-8`;case "list":return "flex flex-col gap-4 max-w-3xl mx-auto";case "carousel":return "flex overflow-x-auto snap-x gap-6 pb-4";default:return `grid ${d[a]} gap-8`}};return jsx("section",{className:"py-16 px-6",children:jsxs("div",{className:"max-w-7xl mx-auto",children:[jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:s.headingFont,color:n.text},...l&&{"data-editable":true,"data-section-id":c,"data-field-path":"settings.title"},children:e||"Our Services"}),jsx("div",{className:m(),children:u.map(p=>jsxs("div",{className:`p-6 rounded-lg border hover:scale-105 transition-transform shadow-lg ${r==="carousel"?"snap-center flex-shrink-0 w-80":""} ${r==="list"?"flex items-center gap-6":""}`,style:{backgroundColor:"rgba(255, 255, 255, 0.95)",borderColor:`${n.primary}20`},children:[r==="list"&&jsx("div",{className:"flex-shrink-0 w-24 h-24 rounded-lg",style:{backgroundColor:n.primary,opacity:.2}}),jsxs("div",{className:"flex-1",children:[jsx("h3",{className:"text-xl font-semibold mb-3",style:{color:"#1a1a1a"},children:p.name}),jsx("p",{className:"text-sm opacity-80 mb-4",style:{color:"#333333"},children:p.description}),jsxs("div",{className:`flex ${r==="list"?"gap-4":"justify-between"} items-center`,children:[o&&jsxs("p",{className:"font-bold text-lg",style:{color:n.primary},children:["$",p.price]}),i&&jsxs("p",{className:"text-sm opacity-70",style:{color:"#666666"},children:[p.duration," min"]})]})]})]},p.id))})]})})}function mn({title:e,images:t=[],columns:r=3,colors:a,typography:o,enableInlineEditing:i=false,sectionId:n=""}){let s={2:"grid-cols-2",3:"grid-cols-2 md:grid-cols-3",4:"grid-cols-2 md:grid-cols-4"},l=t.length>0?t:[1,2,3,4,5,6].map(c=>({id:c,url:void 0}));return jsx("section",{className:"py-16 px-6",children:jsxs("div",{className:"max-w-7xl mx-auto",children:[jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:o.headingFont,color:a.text},...i&&{"data-editable":true,"data-section-id":n,"data-field-path":"settings.title"},children:e||"Gallery"}),jsx("div",{className:`grid ${s[r]} gap-4`,children:l.map((c,d)=>jsx("div",{className:"relative aspect-square overflow-hidden rounded-lg group",children:c.url?jsx("img",{src:c.url,alt:c.alt||"",className:"w-full h-full object-cover transition-transform group-hover:scale-110"}):jsx("div",{className:"w-full h-full flex items-center justify-center transition-transform group-hover:scale-110",style:{backgroundColor:a.primary,opacity:.2},children:jsx("span",{className:"text-sm opacity-50",children:"Add image"})})},c.id||d))})]})})}function gn({title:e,testimonials:t=[],layout:r="grid",colors:a,typography:o,enableInlineEditing:i=false,sectionId:n=""}){let s=r==="carousel"?"flex overflow-x-auto snap-x gap-6 pb-4":"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",l=t.length>0?t:[{id:1,text:"Amazing service! I love my new look.",author:"Sarah M.",rating:5},{id:2,text:"Professional and friendly staff.",author:"Jessica L.",rating:5},{id:3,text:"Best salon in town!",author:"Emily R.",rating:5}];return jsx("section",{className:"py-16 px-6",children:jsxs("div",{className:"max-w-7xl mx-auto",children:[jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:o.headingFont,color:a.text},...i&&{"data-editable":true,"data-section-id":n,"data-field-path":"settings.title"},children:e||"What Our Clients Say"}),jsx("div",{className:s,children:l.map(c=>jsxs("div",{className:`p-6 rounded-lg bg-white/10 backdrop-blur-sm ${r==="carousel"?"snap-center flex-shrink-0 w-80":""}`,children:[jsx("div",{className:"flex gap-1 mb-4",children:[...Array(5)].map((d,u)=>jsx("svg",{className:"w-5 h-5",fill:u<c.rating?a.primary||"#8B5CF6":"#E5E7EB",viewBox:"0 0 20 20",children:jsx("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"})},u))}),jsxs("p",{className:"mb-4 italic",style:{color:a.text},children:['"',c.text,'"']}),jsx("p",{className:"font-semibold",style:{color:a.text},children:c.author})]},c.id))})]})})}function fn({title:e,members:t=[],colors:r,typography:a,enableInlineEditing:o=false,sectionId:i=""}){let n=t.length>0?t:[{id:1,name:"Sarah Johnson",role:"Master Stylist",bio:"Expert in color and styling with 10+ years experience"},{id:2,name:"Michael Chen",role:"Senior Stylist",bio:"Specializing in precision cuts and modern styles"},{id:3,name:"Emma Davis",role:"Stylist",bio:"Passionate about creating beautiful transformations"}];return jsx("section",{className:"py-16 px-6",children:jsxs("div",{className:"max-w-7xl mx-auto",children:[jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:a.headingFont,color:r.text},...o&&{"data-editable":true,"data-section-id":i,"data-field-path":"settings.title"},children:e||"Meet Our Team"}),jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:n.map(s=>jsxs("div",{className:"text-center",children:[jsx("div",{className:"w-32 h-32 rounded-full mx-auto mb-4",style:{backgroundColor:r.primary,opacity:.2}}),jsx("h3",{className:"text-xl font-semibold mb-2",style:{color:r.text},children:s.name}),jsx("p",{className:"text-sm mb-3",style:{color:r.primary},children:s.role}),jsx("p",{className:"text-sm opacity-80",style:{color:r.text},children:s.bio})]},s.id))})]})})}function yn({title:e,email:t="contact@example.com",phone:r="(555) 123-4567",address:a="123 Main Street, City, State 12345",showForm:o=true,colors:i,typography:n,enableInlineEditing:s=false,sectionId:l=""}){return jsx("section",{className:"py-16 px-6",children:jsxs("div",{className:"max-w-7xl mx-auto",children:[jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:n.headingFont,color:i.text},...s&&{"data-editable":true,"data-section-id":l,"data-field-path":"settings.title"},children:e||"Get In Touch"}),jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12",children:[jsxs("div",{className:"space-y-6",children:[jsxs("div",{className:"flex items-center gap-4",children:[jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:i.primary},children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),jsx("span",{style:{color:i.text},children:t})]}),jsxs("div",{className:"flex items-center gap-4",children:[jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:i.primary},children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"})}),jsx("span",{style:{color:i.text},children:r})]}),jsxs("div",{className:"flex items-start gap-4",children:[jsxs("svg",{className:"w-6 h-6 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:i.primary},children:[jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),jsx("span",{style:{color:i.text},children:a})]})]}),o&&jsxs("form",{className:"space-y-4",children:[jsx("input",{type:"text",placeholder:"Name",className:"w-full px-4 py-3 rounded-lg bg-white/10 backdrop-blur-sm border border-white/20",style:{color:i.text}}),jsx("input",{type:"email",placeholder:"Email",className:"w-full px-4 py-3 rounded-lg bg-white/10 backdrop-blur-sm border border-white/20",style:{color:i.text}}),jsx("textarea",{placeholder:"Message",rows:4,className:"w-full px-4 py-3 rounded-lg bg-white/10 backdrop-blur-sm border border-white/20",style:{color:i.text}}),jsx("button",{type:"submit",className:"w-full px-6 py-3 rounded-lg font-semibold transition-all hover:scale-105",style:{backgroundColor:i.primary,color:"#FFFFFF"},children:"Send Message"})]})]})]})})}function bn({brandName:e,logoUrl:t,style:r="both",alignment:a="left",sticky:o=true,colors:i,typography:n,enableInlineEditing:s=false,sectionId:l=""}){let c=a==="center"?"justify-center":a==="right"?"justify-end":"justify-start";return jsx("header",{className:`${o?"sticky top-0 z-50 backdrop-blur-sm":""} border-b`,style:{backgroundColor:o?"rgba(255, 255, 255, 0.8)":"transparent",borderColor:i.primary},children:jsx("div",{className:`container mx-auto px-4 py-4 flex items-center ${c}`,children:jsxs("div",{className:"flex items-center gap-3",children:[(r==="logo"||r==="both")&&jsx(Fragment,{children:t?jsx("img",{src:t,alt:e||"Logo",className:"h-10 w-auto object-contain"}):jsx("div",{className:"w-10 h-10 rounded-full",style:{backgroundColor:i.primary,opacity:.2}})}),(r==="text"||r==="both"||!r)&&jsx("h1",{className:"text-2xl font-bold",style:{fontFamily:n.headingFont,color:i.text},...s&&{"data-editable":true,"data-section-id":l,"data-field-path":"settings.brandName"},children:e||"Your Brand"})]})})})}function xn({links:e,style:t="horizontal",colors:r,enableInlineEditing:a=false,sectionId:o=""}){let i=(n,s)=>{if(s.startsWith("#")){n.preventDefault();let l=s.substring(1),c=document.querySelector(`[data-section-id="${l}"]`);c&&c.scrollIntoView({behavior:"smooth",block:"start"});}};return jsx("nav",{className:"container mx-auto px-4 py-4",children:jsx("div",{className:`flex ${t==="vertical"?"flex-col space-y-2":"flex-row space-x-6 justify-center"}`,children:e.map((n,s)=>jsx("a",{href:n.url,onClick:l=>i(l,n.url),className:"text-base font-medium transition-colors hover:opacity-70",style:{color:r.text},...n.linkType==="external"&&!n.url.startsWith("#")?{target:"_blank",rel:"noopener noreferrer"}:{},...a&&{"data-editable":true,"data-section-id":o,"data-field-path":`settings.links.${s}.label`},children:n.label},n.id))})})}function vn({footerText:e,alignment:t="center",showSocial:r=true,showContact:a=true,showLinks:o=true,colors:i,enableInlineEditing:n=false,sectionId:s=""}){let l=t==="center"?"text-center":t==="right"?"text-right":"text-left";return jsx("footer",{className:"border-t py-8",style:{borderColor:i.primary},children:jsx("div",{className:`container mx-auto px-4 ${l}`,children:jsxs("div",{className:"space-y-4",children:[r&&jsx("div",{className:`flex gap-4 ${t==="center"?"justify-center":t==="right"?"justify-end":"justify-start"}`,children:["instagram","facebook","twitter"].map(c=>jsx("a",{href:`https://${c}.com/`,className:"w-8 h-8 rounded-full flex items-center justify-center transition-transform hover:scale-110",style:{backgroundColor:i.primary,color:"#FFFFFF"},children:c[0].toUpperCase()},c))}),a&&jsx("div",{className:"text-sm opacity-70",style:{color:i.text},children:jsx("p",{children:"contact@example.com | (555) 123-4567"})}),o&&jsxs("div",{className:`flex gap-4 text-sm ${t==="center"?"justify-center":t==="right"?"justify-end":"justify-start"}`,children:[jsx("a",{href:"/privacy",className:"hover:opacity-70",style:{color:i.text},children:"Privacy"}),jsx("a",{href:"/terms",className:"hover:opacity-70",style:{color:i.text},children:"Terms"})]}),jsx("p",{className:"text-sm opacity-60",style:{color:i.text},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.footerText"},children:e||"\xA9 2025 Your Business"})]})})})}function wn({headline:e,description:t,image:r,buttonText:a,buttonUrl:o,layout:i="image-right",showButton:n=true,colors:s,typography:l,enableInlineEditing:c=false,sectionId:d=""}){let u=jsx("div",{className:"w-full h-full aspect-video rounded-lg overflow-hidden bg-gray-100",children:r?jsx("img",{src:r,alt:e||"Feature image",className:"w-full h-full object-cover"}):jsx("div",{className:"w-full h-full flex items-center justify-center",style:{backgroundColor:s.primary,opacity:.2},children:jsx("span",{className:"text-sm opacity-50",children:"Add image"})})}),m=jsxs("div",{className:"space-y-4",children:[jsx("h2",{className:"text-3xl font-bold",style:{fontFamily:l.headingFont,color:s.text},...c&&{"data-editable":true,"data-section-id":d,"data-field-path":"settings.headline"},children:e||"Feature Headline"}),jsx("p",{className:"text-lg opacity-80",style:{color:s.text},...c&&{"data-editable":true,"data-section-id":d,"data-field-path":"settings.description"},children:t||"Feature description goes here..."}),n&&jsx("a",{href:o||"#",className:"inline-block px-6 py-3 rounded-lg font-semibold transition-all hover:scale-105",style:{backgroundColor:s.primary,color:"#FFFFFF"},...c&&{"data-editable":true,"data-section-id":d,"data-field-path":"settings.buttonText"},children:a||"Learn More"})]});return jsx("div",{className:"container mx-auto px-4 py-16",children:jsxs("div",{className:`grid md:grid-cols-2 gap-12 items-center ${i==="image-top"?"grid-cols-1":""}`,children:[i==="image-left"&&u,m,i==="image-right"&&u,i==="image-top"&&u]})})}function Cn({title:e,comparisons:t=[],colors:r,typography:a,enableInlineEditing:o=false,sectionId:i=""}){let n=t.length>0?t:[{id:1,title:"Hair Transformation",beforeImage:"",afterImage:""}];return jsx("section",{className:"py-16 px-6",children:jsxs("div",{className:"max-w-7xl mx-auto",children:[jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:a.headingFont,color:r.text},...o&&{"data-editable":true,"data-section-id":i,"data-field-path":"settings.title"},children:e||"Results"}),jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:n.map((s,l)=>jsxs("div",{className:"space-y-4",children:[s.title&&jsx("h3",{className:"text-xl font-semibold text-center",style:{color:r.text},children:s.title}),jsxs("div",{className:"relative aspect-[4/3] rounded-lg overflow-hidden",children:[jsx("div",{className:"absolute inset-0",style:{backgroundColor:r.primary,opacity:.1}}),jsx("div",{className:"absolute top-4 left-4 bg-black/50 text-white px-3 py-1 rounded text-sm",children:"Before"}),jsx("div",{className:"absolute top-4 right-4 bg-black/50 text-white px-3 py-1 rounded text-sm",children:"After"})]})]},s.id||l))})]})})}function Sn({title:e,plans:t=[],colors:r,typography:a,enableInlineEditing:o=false,sectionId:i=""}){let n=t.length>0?t:[{id:1,name:"Basic",price:50,features:["Service 1","Service 2"]},{id:2,name:"Premium",price:100,features:["Service 1","Service 2","Service 3"],featured:true},{id:3,name:"Deluxe",price:150,features:["All Services","Priority Booking"]}];return jsx("section",{className:"py-16 px-6",children:jsxs("div",{className:"max-w-7xl mx-auto",children:[jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:a.headingFont,color:r.text},...o&&{"data-editable":true,"data-section-id":i,"data-field-path":"settings.title"},children:e||"Pricing"}),jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:n.map(s=>jsxs("div",{className:`p-8 rounded-lg border-2 ${s.featured?"scale-105 shadow-xl":""}`,style:{borderColor:s.featured?r.primary:"rgba(255,255,255,0.1)",backgroundColor:s.featured?`${r.primary}15`:"rgba(255,255,255,0.05)"},children:[jsx("h3",{className:"text-2xl font-bold mb-2 text-center",style:{color:r.text},children:s.name}),jsx("div",{className:"text-center mb-6",children:jsxs("span",{className:"text-4xl font-bold",style:{color:r.primary},children:["$",s.price]})}),jsx("ul",{className:"space-y-3 mb-6",children:s.features.map((l,c)=>jsxs("li",{className:"flex items-center gap-2",children:[jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:r.primary},children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),jsx("span",{style:{color:r.text},children:l})]},c))}),jsx("button",{className:"w-full px-6 py-3 rounded-lg font-semibold transition-all hover:scale-105",style:{backgroundColor:s.featured?r.primary:"rgba(255,255,255,0.1)",color:s.featured?"#FFFFFF":r.text},children:"Choose Plan"})]},s.id))})]})})}function Fn({username:e,colors:t,enableInlineEditing:r=false,sectionId:a=""}){return jsx("div",{className:"container mx-auto px-4 py-8",children:jsxs("div",{className:"max-w-4xl mx-auto",children:[jsxs("p",{className:"text-center text-sm opacity-60 mb-4",children:["Instagram Feed: ",e||"@handle"]}),jsx("div",{className:"grid grid-cols-3 gap-1",children:[1,2,3,4,5,6].map(o=>jsx("div",{className:"aspect-square rounded",style:{backgroundColor:t.primary,opacity:.2}},o))})]})})}function In({name:e,subheading:t,bio:r,links:a=[],bookingButtonText:o,bookingButtonUrl:i,showBookingButton:n=true,position:s="bottom-left",cardWidth:l="medium",cardColor:c="#FFFFFF",colors:d,typography:u,enableInlineEditing:m=false,sectionId:p=""}){let b=(C,S)=>{let x=parseInt(C.slice(1,3),16),F=parseInt(C.slice(3,5),16),k=parseInt(C.slice(5,7),16);return `rgba(${x}, ${F}, ${k}, ${S})`},w={small:"280px",medium:"320px",large:"400px"},N={"bottom-left":"bottom-0 left-0","bottom-right":"bottom-0 right-0","bottom-center":"bottom-0 left-1/2 -translate-x-1/2"},g=s==="bottom-left"?"text-left":s==="bottom-right"?"text-right":"text-center",v=s==="bottom-left"?"justify-start":s==="bottom-right"?"justify-end":"justify-center",f=()=>s==="bottom-left"?"rounded-tr-3xl rounded-tl-none":s==="bottom-right"?"rounded-tl-3xl rounded-tr-none":"rounded-t-3xl";return jsx("div",{className:`fixed z-50 ${N[s]}`,style:{width:w[l]},children:jsxs("div",{className:`${f()} shadow-2xl border-t border-x`,style:{backgroundColor:b(c,.9),borderColor:b(c,.3),boxShadow:"0 -10px 40px rgba(0, 0, 0, 0.1)"},children:[jsx("div",{className:`px-8 pt-8 pb-3 ${g}`,children:jsx("h3",{className:"text-2xl font-bold",style:{fontFamily:u.headingFont,color:d.text},...m&&{"data-editable":true,"data-section-id":p,"data-field-path":"settings.name"},children:e||"Your Name"})}),jsx("div",{className:"mb-6",children:t?jsxs("div",{className:`flex items-center gap-3 px-8 ${v}`,children:[jsx("span",{className:"text-xs font-medium whitespace-nowrap",style:{color:d.primary},...m&&{"data-editable":true,"data-section-id":p,"data-field-path":"settings.subheading"},children:t}),jsx("div",{className:"flex-1 h-px",style:{backgroundColor:d.primary,opacity:.3}})]}):jsx("div",{className:"w-full h-px",style:{backgroundColor:d.primary,opacity:.3}})}),jsxs("div",{className:`px-8 pb-8 ${g}`,children:[jsx("p",{className:"text-sm opacity-80 mb-4",style:{color:d.text},...m&&{"data-editable":true,"data-section-id":p,"data-field-path":"settings.bio"},children:r||"Transforming beauty, one client at a time \u2728"}),a.length>0&&jsx("div",{className:"space-y-2 mb-4",children:a.map((C,S)=>jsx("a",{href:C.url,target:"_blank",rel:"noopener noreferrer",className:"block text-sm font-medium hover:opacity-70 transition-opacity",style:{color:d.primary},...m&&{"data-editable":true,"data-section-id":p,"data-field-path":`settings.links.${S}.label`},children:C.label},C.id))}),n&&jsx("a",{href:i||"/book",className:"block w-full py-3 px-4 rounded-xl text-center font-semibold transition-all hover:scale-105 hover:shadow-lg",style:{backgroundColor:d.primary,color:d.buttonText||"#FFFFFF"},...m&&{"data-editable":true,"data-section-id":p,"data-field-path":"settings.bookingButtonText"},children:o||"Book Appointment"})]})]})})}function En({config:e,colors:t,BookingFlowComponent:r,enableInlineEditing:a=false,sectionId:o=""}){return r?jsx("div",{className:"container mx-auto px-4 py-16",children:jsx(r,{config:e,colors:t})}):jsx("div",{className:"container mx-auto px-4 py-16",children:jsx("div",{className:"max-w-4xl mx-auto text-center",children:jsxs("div",{className:"p-12 rounded-2xl border-2 border-dashed",style:{borderColor:t.primary,opacity:.5},children:[jsx("div",{className:"text-6xl mb-4",children:"\u{1F4C5}"}),jsx("h3",{className:"text-2xl font-bold mb-3",style:{color:t.text},children:"Booking Flow"}),jsx("p",{className:"text-base opacity-70",style:{color:t.text},children:"Pass a BookingFlowComponent prop to render your custom booking flow here."})]})})})}function Rn({videoUrl:e,aspectRatio:t="16:9",autoplay:r=false,loop:a=false,muted:o=true,controls:i=true,allowFullScreen:n=true,coverImage:s,maxWidth:l="large",alignment:c="center",borderRadius:d=12,colors:u,enableInlineEditing:m=false,sectionId:p=""}){let w=(f=>{let C=f.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]+)/);if(C){let x=C[1],F=new URLSearchParams({...r?{autoplay:"1"}:{},...a?{loop:"1",playlist:x}:{},...o?{mute:"1"}:{},...i?{}:{controls:"0"}});return {type:"youtube",embedUrl:`https://www.youtube.com/embed/${x}?${F.toString()}`}}let S=f.match(/(?:vimeo\.com\/)(\d+)/);if(S){let x=S[1],F=new URLSearchParams({...r?{autoplay:"1"}:{},...a?{loop:"1"}:{},...o?{muted:"1"}:{},...i?{}:{controls:"0"}});return {type:"vimeo",embedUrl:`https://player.vimeo.com/video/${x}?${F.toString()}`}}return f.match(/\.(mp4|webm|ogg)$/i)?{type:"direct",embedUrl:f}:null})(e),N={"16:9":"56.25%","4:3":"75%","1:1":"100%","9:16":"177.78%"},g={full:"max-w-full",large:"max-w-6xl",medium:"max-w-4xl",small:"max-w-2xl"},v=c==="center"?"mx-auto":c==="right"?"ml-auto":"mr-auto";return jsx("div",{className:"container mx-auto px-4",children:jsx("div",{className:`${g[l]} ${v}`,children:jsx("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:N[t],borderRadius:`${d}px`},children:w?w.type==="direct"?jsx("video",{src:w.embedUrl,autoPlay:r,loop:a,muted:o,controls:i,poster:s,className:"absolute top-0 left-0 w-full h-full object-cover"}):jsx("iframe",{src:w.embedUrl,className:"absolute top-0 left-0 w-full h-full",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:n,title:"Video"}):jsx("div",{className:"absolute top-0 left-0 w-full h-full flex items-center justify-center",style:{backgroundColor:`${u.primary}20`},children:jsxs("div",{className:"text-center px-4",children:[jsxs("svg",{className:"w-16 h-16 mx-auto mb-4",fill:"none",stroke:u.primary,viewBox:"0 0 24 24",children:[jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]}),jsx("p",{style:{color:u.text,opacity:.6},children:e?"Invalid video URL":"Add a video URL to display"})]})})})})})}function Pn({text:e="SCROLL TEXT",scrollDirection:t="left",scrollSpeed:r="medium",orientation:a="horizontal",dividerIcon:o="bullet",customIcon:i,textSize:n="medium",textColor:s,fontWeight:l="bold",backgroundColor:c,backgroundGradient:d,pauseOnHover:u=true,colors:m,typography:p,enableInlineEditing:b=false,sectionId:w=""}){let[N,g]=useState(false),f={bullet:"\u2022",star:"\u2605",diamond:"\u25C6",custom:i||"\u2022",none:""}[o],S=typeof r=="number"?r:{slow:60,medium:30,fast:15}[r],x={small:"text-xl md:text-2xl",medium:"text-2xl md:text-4xl",large:"text-3xl md:text-5xl",xl:"text-4xl md:text-6xl"},F={light:"font-light",normal:"font-normal",bold:"font-bold"},k={horizontal:"0deg","diagonal-left":"-5deg","diagonal-right":"5deg"},I=f?`${e} ${f} `.repeat(20):`${e} `.repeat(20);return jsxs("div",{className:"relative overflow-hidden py-3",style:{...d?{background:d}:{backgroundColor:c||"transparent"},transform:`rotate(${k[a]})`},onMouseEnter:()=>u&&g(true),onMouseLeave:()=>u&&g(false),children:[jsx("style",{children:`
2
+ @keyframes scroll-${t} {
3
+ 0% {
4
+ transform: translateX(${t==="left"?"0%":"-50%"});
5
+ }
6
+ 100% {
7
+ transform: translateX(${t==="left"?"-50%":"0%"});
8
+ }
9
+ }
10
+ `}),jsxs("div",{className:`flex items-center whitespace-nowrap ${x[n]} ${F[l]} uppercase tracking-wider`,style:{fontFamily:p?.headingFont||"inherit",color:s||m.text,animation:`scroll-${t} ${S}s linear infinite`,animationPlayState:N?"paused":"running"},children:[jsx("span",{className:"inline-block",children:I}),jsx("span",{className:"inline-block","aria-hidden":"true",children:I})]})]})}function An({address:e,displayType:t="both",mapHeight:r="medium",mapStyle:a="roadmap",zoom:o=15,showMarker:i=true,borderRadius:n=12,directionsButtonText:s="Get Directions",colors:l,typography:c,enableInlineEditing:d=false,sectionId:u=""}){let p={small:300,medium:400,large:500}[r],b=encodeURIComponent(e),w=`https://www.google.com/maps/dir/?api=1&destination=${b}`,g=`https://www.google.com/maps/embed/v1/place?key=${import.meta.env?.VITE_GOOGLE_MAPS_API_KEY||typeof globalThis<"u"&&globalThis.process?.env?.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY||""}&q=${b}&zoom=${o}&maptype=${a}`;return jsx("div",{className:"container mx-auto px-4",children:jsxs("div",{className:"max-w-4xl mx-auto",children:[(t==="map-only"||t==="both")&&e&&jsx("div",{className:"w-full overflow-hidden mb-6",style:{height:`${p}px`,borderRadius:`${n}px`},children:jsx("iframe",{src:g,className:"w-full h-full",style:{border:0},allowFullScreen:true,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",title:"Location Map"})}),(t==="address-only"||t==="both")&&jsx("div",{className:"p-6 rounded-lg border",style:{backgroundColor:`${l.primary}10`,borderColor:`${l.primary}30`,borderRadius:`${n}px`},children:jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[jsx("div",{className:"flex-1",children:jsxs("div",{className:"flex items-start gap-3",children:[jsxs("svg",{className:"w-5 h-5 mt-0.5 flex-shrink-0",fill:"none",stroke:l.primary,viewBox:"0 0 24 24",children:[jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),jsxs("div",{children:[jsx("p",{className:"font-medium mb-1",style:{color:l.text,fontFamily:c?.bodyFont||"inherit"},...d&&{"data-editable":true,"data-section-id":u,"data-field-path":"settings.address"},children:e||"Add your address"}),e&&jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"text-sm underline hover:no-underline",style:{color:l.primary},children:"View in Google Maps \uFFFD"})]})]})}),e&&jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"px-6 py-3 rounded-lg font-semibold transition-all hover:opacity-90 text-center",style:{backgroundColor:l.primary,color:"#FFFFFF"},children:s})]})}),!e&&jsxs("div",{className:"p-12 rounded-lg border-2 border-dashed text-center",style:{borderColor:`${l.primary}30`,borderRadius:`${n}px`},children:[jsxs("svg",{className:"w-12 h-12 mx-auto mb-4",fill:"none",stroke:l.primary,viewBox:"0 0 24 24",children:[jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),jsx("p",{style:{color:l.text,opacity:.6},children:"Add your business address to display a map"})]})]})})}function Mn({imageUrl:e,altText:t="",caption:r,maxWidth:a="large",alignment:o="center",aspectRatio:i="auto",borderRadius:n=12,linkUrl:s,openInNewTab:l=true,colors:c,typography:d,enableInlineEditing:u=false,sectionId:m=""}){let p={full:"max-w-full",large:"max-w-6xl",medium:"max-w-4xl",small:"max-w-2xl"},b={auto:null,"16:9":"56.25%","4:3":"75%","1:1":"100%","3:2":"66.67%"},w=o==="center"?"mx-auto":o==="right"?"ml-auto":"mr-auto",N=jsxs("div",{className:`${p[a]} ${w}`,children:[jsx("div",{className:"relative w-full overflow-hidden",style:{borderRadius:`${n}px`,...b[i]&&{paddingBottom:b[i]}},children:e?jsx("img",{src:e,alt:t||"Image",className:i==="auto"?"w-full h-auto":"absolute top-0 left-0 w-full h-full object-cover",style:{borderRadius:`${n}px`}}):jsx("div",{className:"flex items-center justify-center bg-gray-100",style:{backgroundColor:`${c.primary}10`,borderRadius:`${n}px`,minHeight:i==="auto"?"300px":void 0},children:jsxs("div",{className:"text-center px-4",children:[jsx("svg",{className:"w-16 h-16 mx-auto mb-4",fill:"none",stroke:c.primary,viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),jsx("p",{style:{color:c.text,opacity:.6},children:"Add an image URL to display"})]})})}),r&&e&&jsx("p",{className:"mt-3 text-sm text-center",style:{color:c.text,opacity:.7,fontFamily:d?.bodyFont||"inherit"},...u&&{"data-editable":true,"data-section-id":m,"data-field-path":"settings.caption"},children:r})]});return jsx("div",{className:a==="full"?"w-full":"container mx-auto px-4",children:s&&e?jsx("a",{href:s,target:l?"_blank":"_self",rel:l?"noopener noreferrer":void 0,className:"block",children:N}):N})}function Xa({faq:e,index:t,colors:r,typography:a,enableInlineEditing:o,sectionId:i}){let[n,s]=useState(false);return jsxs("div",{className:"border-b border-opacity-10",style:{borderColor:r.text},children:[jsxs("button",{onClick:()=>s(!n),className:"w-full py-4 px-6 flex items-center justify-between text-left hover:bg-opacity-5 transition-colors",style:{backgroundColor:n?`${r.primary}10`:"transparent"},children:[jsx("span",{className:"font-semibold text-lg pr-4",style:{color:r.text,fontFamily:a?.headingFont||"inherit"},...o&&{"data-editable":true,"data-section-id":i,"data-field-path":`settings.faqs.${t}.question`},children:e.question||"Add question..."}),jsx("svg",{className:"w-5 h-5 flex-shrink-0 transition-transform",style:{color:r.primary,transform:n?"rotate(180deg)":"rotate(0deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),n&&jsx("div",{className:"px-6 pb-4 pt-2",style:{color:r.text,opacity:.8,fontFamily:a?.bodyFont||"inherit"},...o&&{"data-editable":true,"data-section-id":i,"data-field-path":`settings.faqs.${t}.answer`},children:e.answer||"Add answer..."})]})}function $n({title:e="Frequently Asked Questions",faqs:t=[],layout:r="accordion",maxWidth:a="large",colors:o,typography:i,enableInlineEditing:n=false,sectionId:s=""}){return jsx("div",{className:"container mx-auto px-4",children:jsxs("div",{className:`${{full:"max-w-full",large:"max-w-4xl",medium:"max-w-3xl",small:"max-w-2xl"}[a]} mx-auto`,children:[e&&jsx("h2",{className:"text-3xl font-bold text-center mb-8",style:{color:o.text,fontFamily:i?.headingFont||"inherit"},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.title"},children:e}),t.length>0?jsx("div",{className:"rounded-lg overflow-hidden",style:{border:`1px solid ${o.text}20`,backgroundColor:`${o.primary}05`},children:t.map((c,d)=>r==="accordion"?jsx(Xa,{faq:c,index:d,colors:o,typography:i,enableInlineEditing:n,sectionId:s},d):jsxs("div",{className:"border-b border-opacity-10 last:border-b-0 p-6",style:{borderColor:o.text},children:[jsx("h3",{className:"font-semibold text-lg mb-2",style:{color:o.text,fontFamily:i?.headingFont||"inherit"},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":`settings.faqs.${d}.question`},children:c.question||"Add question..."}),jsx("p",{style:{color:o.text,opacity:.8,fontFamily:i?.bodyFont||"inherit"},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":`settings.faqs.${d}.answer`},children:c.answer||"Add answer..."})]},d))}):jsxs("div",{className:"p-12 rounded-lg border-2 border-dashed text-center",style:{borderColor:`${o.primary}30`,backgroundColor:`${o.primary}05`},children:[jsx("svg",{className:"w-12 h-12 mx-auto mb-4",fill:"none",stroke:o.primary,viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),jsx("p",{style:{color:o.text,opacity:.6},children:"Add FAQ items to get started"})]})]})})}function Bn({brandName:e="Your Brand",logoUrl:t,showLogo:r=true,showBrandName:a=true,links:o=[],ctaText:i,ctaUrl:n,sticky:s=true,transparentOnTop:l=false,colors:c,typography:d,enableInlineEditing:u=false,sectionId:m=""}){let[p,b]=useState(false),[w,N]=useState(false),[g,v]=useState("");useEffect(()=>{let x=()=>{N(window.scrollY>20);};return window.addEventListener("scroll",x),()=>window.removeEventListener("scroll",x)},[]),useEffect(()=>{let x=()=>{let F=o.filter(I=>I.url.startsWith("#")).map(I=>document.querySelector(`[data-section-id="${I.url.substring(1)}"]`)).filter(Boolean),k="";F.forEach(I=>{if(I){let y=I.getBoundingClientRect();y.top<=100&&y.bottom>=100&&(k=I.getAttribute("data-section-id")||"");}}),v(k);};return window.addEventListener("scroll",x),()=>window.removeEventListener("scroll",x)},[o]);let f=(x,F)=>{if(F.startsWith("#")){x.preventDefault();let k=F.substring(1),I=document.querySelector(`[data-section-id="${k}"]`);I&&I.scrollIntoView({behavior:"smooth",block:"start"}),b(false);}},C=l&&!w;return jsx("nav",{className:`${s?"sticky top-0 z-50":""} ${C?"bg-transparent":s?"bg-white/80 backdrop-blur-md border-b":"bg-white border-b"} transition-all duration-300`,style:{borderColor:C?"transparent":`${c.primary}20`},children:jsxs("div",{className:"container mx-auto px-4",children:[jsxs("div",{className:"flex items-center justify-between h-16 md:h-20",children:[jsxs("div",{className:"flex items-center gap-3",children:[r&&t&&jsx("img",{src:t,alt:e,className:"h-8 md:h-10 w-auto object-contain"}),a&&jsx("h1",{className:"text-xl md:text-2xl font-bold",style:{fontFamily:d?.headingFont||"inherit",color:c.text},...u&&{"data-editable":true,"data-section-id":m,"data-field-path":"settings.brandName"},children:e})]}),jsxs("div",{className:"hidden md:flex items-center gap-8",children:[o.map((x,F)=>{let k=x.url.startsWith("#")&&x.url.substring(1)===g;return jsxs("a",{href:x.url,onClick:I=>f(I,x.url),className:"relative text-base font-medium transition-colors group",style:{color:k?c.primary:c.text,fontFamily:d?.bodyFont||"inherit"},...x.linkType==="external"&&!x.url.startsWith("#")?{target:"_blank",rel:"noopener noreferrer"}:{},...u&&{"data-editable":true,"data-section-id":m,"data-field-path":`settings.links.${F}.label`},children:[x.label,jsx("span",{className:`absolute -bottom-1 left-0 h-0.5 transition-all ${k?"w-full":"w-0 group-hover:w-full"}`,style:{backgroundColor:c.primary}})]},x.id)}),i&&n&&jsx("a",{href:n,className:"px-6 py-2.5 rounded-full font-semibold transition-all hover:opacity-90 hover:scale-105",style:{backgroundColor:c.primary,color:c.buttonText||"#FFFFFF",fontFamily:d?.bodyFont||"inherit"},children:i})]}),jsx("button",{onClick:()=>b(!p),className:"md:hidden p-2 rounded-lg transition-colors hover:bg-black/5","aria-label":"Toggle menu",children:jsx("svg",{className:"w-6 h-6",fill:"none",stroke:c.text,viewBox:"0 0 24 24",children:p?jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]}),jsx("div",{className:`md:hidden overflow-hidden transition-all duration-300 ${p?"max-h-96 pb-4":"max-h-0"}`,children:jsxs("div",{className:"flex flex-col space-y-3 pt-4 border-t",style:{borderColor:`${c.primary}20`},children:[o.map((x,F)=>{let k=x.url.startsWith("#")&&x.url.substring(1)===g;return jsx("a",{href:x.url,onClick:I=>f(I,x.url),className:"text-base font-medium py-2 px-4 rounded-lg transition-colors",style:{color:k?c.primary:c.text,backgroundColor:k?`${c.primary}10`:"transparent",fontFamily:d?.bodyFont||"inherit"},...x.linkType==="external"&&!x.url.startsWith("#")?{target:"_blank",rel:"noopener noreferrer"}:{},children:x.label},x.id)}),i&&n&&jsx("a",{href:n,className:"px-6 py-3 rounded-full font-semibold text-center transition-all hover:opacity-90",style:{backgroundColor:c.primary,color:c.buttonText||"#FFFFFF",fontFamily:d?.bodyFont||"inherit"},children:i})]})})]})})}function zn({title:e,content:t,alignment:r="left",maxWidth:a="medium",textSize:o="medium",backgroundColor:i,textColor:n,paddingY:s="medium",colors:l,typography:c,enableInlineEditing:d=false,sectionId:u=""}){let m={full:"max-w-full",large:"max-w-6xl",medium:"max-w-4xl",small:"max-w-2xl"},p={left:"text-left",center:"text-center",right:"text-right"},b={small:"text-sm",medium:"text-base",large:"text-lg"};return jsx("div",{className:{none:"py-0",small:"py-8",medium:"py-16",large:"py-24"}[s],style:{backgroundColor:i||"transparent"},children:jsx("div",{className:"container mx-auto px-4",children:jsxs("div",{className:`${m[a]} mx-auto ${p[r]}`,children:[e&&jsx("h2",{className:"text-3xl md:text-4xl font-bold mb-6",style:{color:n||l.text,fontFamily:c?.headingFont||"inherit"},...d&&{"data-editable":true,"data-section-id":u,"data-field-path":"settings.title"},children:e}),jsx("div",{className:`${b[o]} leading-relaxed whitespace-pre-wrap`,style:{color:n||l.text,fontFamily:c?.bodyFont||"inherit"},...d&&{"data-editable":true,"data-section-id":u,"data-field-path":"settings.content"},children:t||"Add your text content here..."})]})})})}function Ac(e,t=false){if(t)return .15;switch(e){case "fast":return .2;case "slow":return .5;default:return .3}}function Ja(e=50){return {enter:t=>({x:t==="forward"?e:-e,opacity:0}),center:{x:0,opacity:1},exit:t=>({x:t==="forward"?-e:e,opacity:0})}}function Qa(){return {enter:()=>({opacity:0,scale:.95}),center:{opacity:1,scale:1},exit:()=>({opacity:0,scale:.95})}}function Mc(e,t){return e==="fade"?Qa():Ja(t)}var rr={easing:[.4,0,.2,1],spring:{type:"spring",damping:30,stiffness:300},staggerChildren:{staggerChildren:.05,delayChildren:.1},cardHover:{scale:1.02,transition:{duration:.2}},buttonHover:{scale:1.05,transition:{duration:.2}},fadeIn:{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},slideUp:{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"}},scaleIn:{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9}},slideInLeft:{initial:{opacity:0,x:-10},animate:{opacity:1,x:0}},slideInRight:{initial:{opacity:0,x:10},animate:{opacity:1,x:0}},backdrop:{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}};function $c(){return typeof window>"u"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Lc(e,t=.1,r=.05){return Array.from({length:e},(a,o)=>({initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:t+o*r,ease:rr.easing}}))}function ge(e=0,t=.3){return {initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:t,delay:e,ease:rr.easing}}}function On({services:e,categories:t=[],selectedService:r,onServiceSelect:a,settings:o,colors:i}){let[n,s]=useState(null),[l,c]=useState(new Set(t.length>0?[t[0].id]:[])),d=o.serviceLayout||"grid",u=o.columns||2,m=o.headerContent?.value||"Choose Your Service",p=o.subheaderContent?.value||"Select the service you'd like to book",b=o.showPricing!==false,w=o.showDuration!==false,N=o.showDescription!==false,g=o.enableCategories===true,v=o.categoryStyle||"dropdown",f=o.policyImages||[],C=o.policyText||null,S=o.imageSpacing||"small",x={none:"0px",small:"8px",medium:"16px",large:"24px"},F=o.imageBorderRadius||"0px",k={1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"}[u]||"grid-cols-2",I=g&&n?e.filter(h=>h.category===n):e,y=(h,E)=>{let W=r===h.id;return jsx("button",{onClick:()=>a(h.id),className:`w-full ${E==="grid"?"h-full":""} p-4 rounded-lg border-2 transition-all text-left ${E==="grid"?"flex flex-col":""} ${W?"border-current shadow-lg":"border-gray-200 hover:border-gray-300"}`,style:{borderColor:W?i.primary:void 0,backgroundColor:W?`${i.primary}10`:void 0},children:E==="grid"?jsxs(Fragment,{children:[jsx("p",{className:"font-semibold mb-1",children:h.name}),N&&jsx("p",{className:"text-xs opacity-70 mb-2 flex-1",children:h.description}),jsxs("div",{className:"flex justify-between items-center text-sm mt-auto",children:[b&&jsxs("span",{className:"font-bold",style:{color:i.primary},children:["$",h.price]}),w&&jsxs("span",{className:"opacity-60",children:[h.duration," min"]})]})]}):jsxs("div",{className:"flex justify-between items-start",children:[jsxs("div",{className:"flex-1",children:[jsx("p",{className:"font-semibold mb-1",children:h.name}),N&&jsx("p",{className:"text-sm opacity-70",children:h.description})]}),jsxs("div",{className:"text-right ml-4",children:[b&&jsxs("p",{className:"font-bold",style:{color:i.primary},children:["$",h.price]}),w&&jsxs("p",{className:"text-sm opacity-60",children:[h.duration," min"]})]})]})},h.id)};return jsxs("div",{className:"space-y-4",children:[jsxs(motion.div,{...ge(.05),className:"text-center sm:text-left",children:[jsx("h2",{className:"text-xl sm:text-2xl font-bold mb-2",style:{color:i.primary},children:m}),jsx("p",{className:"text-sm opacity-70",children:p})]}),f&&f.length>0&&jsx("div",{className:"w-full flex flex-col",style:{gap:x[S]},children:f.slice(0,3).map((h,E)=>jsx("div",{className:"w-full overflow-hidden",style:{aspectRatio:"720 / 300",borderRadius:F},children:jsx("img",{src:h.url,alt:h.alt||`Policy image ${E+1}`,className:"w-full h-full object-cover"})},E))}),(!f||f.length===0)&&C&&jsx("div",{className:"w-full p-4 rounded-lg border",style:{backgroundColor:`${i.primary}10`,borderColor:`${i.primary}30`},dangerouslySetInnerHTML:{__html:C}}),g&&t.length>0&&jsxs(Fragment,{children:[v==="dropdown"&&jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-2",children:"Service Category"}),jsxs("select",{value:n||"all",onChange:h=>s(h.target.value==="all"?null:h.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:border-transparent transition-all",style:{"--tw-ring-color":i.primary},children:[jsx("option",{value:"all",children:"All Services"}),t.map(h=>jsx("option",{value:h.id,children:h.name},h.id))]})]}),v==="tabs"&&jsxs("div",{className:"flex gap-2 flex-wrap",children:[jsx("button",{onClick:()=>s(null),className:`px-4 py-2 rounded-lg transition-all text-sm font-medium ${n===null?"text-white shadow-lg":"border border-gray-300 hover:border-gray-400"}`,style:{backgroundColor:n===null?i.primary:void 0},children:"All Services"}),t.map(h=>jsx("button",{onClick:()=>s(h.id),className:`px-4 py-2 rounded-lg transition-all text-sm font-medium ${n===h.id?"text-white shadow-lg":"border border-gray-300 hover:border-gray-400"}`,style:{backgroundColor:n===h.id?i.primary:void 0},children:h.name},h.id))]}),v==="pills"&&jsxs("div",{className:"flex gap-2 overflow-x-auto pb-2 scrollbar-hide",children:[jsx("button",{onClick:()=>s(null),className:`px-5 py-2 rounded-full transition-all text-sm font-medium whitespace-nowrap ${n===null?"text-white shadow-md":"bg-gray-100 hover:bg-gray-200"}`,style:{backgroundColor:n===null?i.primary:void 0},children:"All"}),t.map(h=>jsx("button",{onClick:()=>s(h.id),className:`px-5 py-2 rounded-full transition-all text-sm font-medium whitespace-nowrap ${n===h.id?"text-white shadow-md":"bg-gray-100 hover:bg-gray-200"}`,style:{backgroundColor:n===h.id?i.primary:void 0},children:h.name},h.id))]}),v==="chips"&&jsxs("div",{className:"flex gap-2 flex-wrap",children:[jsxs("button",{onClick:()=>s(null),className:`px-3 py-1.5 rounded-lg transition-all text-xs font-medium flex items-center gap-1.5 ${n===null?"text-white":"border border-gray-300 bg-white hover:border-gray-400"}`,style:{backgroundColor:n===null?i.primary:void 0,borderColor:n===null?i.primary:void 0},children:[n===null&&jsx("span",{className:"text-[10px]",children:"\u2713"}),"All"]}),t.map(h=>jsxs("button",{onClick:()=>s(h.id),className:`px-3 py-1.5 rounded-lg transition-all text-xs font-medium flex items-center gap-1.5 ${n===h.id?"text-white":"border border-gray-300 bg-white hover:border-gray-400"}`,style:{backgroundColor:n===h.id?i.primary:void 0,borderColor:n===h.id?i.primary:void 0},children:[n===h.id&&jsx("span",{className:"text-[10px]",children:"\u2713"}),h.name]},h.id))]})]}),g&&v==="accordion"?jsx("div",{className:"space-y-4",children:t.map(h=>{let E=l.has(h.id),W=e.filter(O=>O.category===h.id);return jsxs("div",{children:[jsxs("button",{onClick:()=>{let O=new Set(l);E?O.delete(h.id):O.add(h.id),c(O);},className:"w-full flex items-center justify-between py-2 border-b-2 transition-all group",style:{borderColor:E?i.primary:"#e5e7eb"},children:[jsx("span",{className:"font-semibold text-left transition-colors",style:{color:E?i.primary:void 0},children:h.name}),jsx(ChevronDown,{className:`w-4 h-4 transition-all ${E?"rotate-180":""}`,style:{color:E?i.primary:"#9ca3af"}})]}),E&&jsx("div",{className:`mt-4 ${d==="grid"?`grid ${k} gap-3`:"space-y-3"}`,children:W.map(O=>y(O,d))})]},h.id)})}):d==="grid"?jsx("div",{className:`grid ${k} gap-3`,children:I.map(h=>y(h,"grid"))}):jsx("div",{className:"space-y-3",children:I.map(h=>y(h,"list"))})]})}function oi(){let e=[],t=new Date;t.setHours(0,0,0,0);for(let r=0;r<3;r++){let a=new Date(t.getFullYear(),t.getMonth()+r,1),o=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();for(let i=1;i<=o;i++){if(new Date(a.getFullYear(),a.getMonth(),i)<t||Math.random()>.6)continue;let s=`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(i).padStart(2,"0")}`;e.push(s);}}return e}var ko={avoid:{bg:"#FEE2E2",text:"#991B1B",label:"Avoid"},caution:{bg:"#FEF3C7",text:"#92400E",label:"Caution"},optimal:{bg:"#D1FAE5",text:"#065F46",label:"Optimal"},neutral:{bg:"#F3F4F6",text:"#4B5563",label:"Neutral"}};function nr({availableDates:e,selectedDate:t,onDateSelect:r,settings:a,colors:o,cyclePhases:i,selectedService:n,addons:s=[],selectedAddons:l=[],onAddonsChange:c,addonPlacement:d="date_selection"}){console.log("[DateSelection] Addon Debug:",{addonsLength:s.length,hasOnAddonsChange:!!c,addonPlacement:d,showAddons:d!=="separate_step"&&s.length>0&&!!c,addons:s,selectedService:n});let u=a.calendarView||"month",m=a.headerContent?.value||"Select a Date",p=!e||e.length===0,b=useMemo(()=>p?oi():e,[p,e]),w=useMemo(()=>{let D=new Date;if(D.setHours(0,0,0,0),b.length>0){let T=b.find(P=>new Date(P)>=D);if(T){let P=new Date(T);return `${P.getFullYear()}-${String(P.getMonth()+1).padStart(2,"0")}`}}return `${D.getFullYear()}-${String(D.getMonth()+1).padStart(2,"0")}`},[b]),[N,g]=useState(w),v=useMemo(()=>new Set(b),[b]),[f,C]=N.split("-").map(Number),x=["January","February","March","April","May","June","July","August","September","October","November","December"][C-1],F=useMemo(()=>{let D=new Date(f,C-1,1),T=new Date(f,C,0),P=D.getDay(),L=T.getDate(),K=[];for(let Y=0;Y<P;Y++)K.push(null);for(let Y=1;Y<=L;Y++){let Te=`${f}-${String(C).padStart(2,"0")}-${String(Y).padStart(2,"0")}`,H=new Date(Te),ie=new Date;ie.setHours(0,0,0,0),K.push({day:Y,dateStr:Te,isAvailable:v.has(Te)&&H>=ie});}return K},[f,C,v]),k=useMemo(()=>{let D=new Date(f,C-2,1),T=`${D.getFullYear()}-${String(D.getMonth()+1).padStart(2,"0")}`;return b.some(P=>P.startsWith(T))},[b,f,C]),I=useMemo(()=>{let D=new Date(f,C,1),T=`${D.getFullYear()}-${String(D.getMonth()+1).padStart(2,"0")}`;return b.some(P=>P.startsWith(T))},[b,f,C]),y=()=>{if(!k)return;let D=new Date(f,C-2,1);g(`${D.getFullYear()}-${String(D.getMonth()+1).padStart(2,"0")}`);},h=()=>{if(!I)return;let D=new Date(f,C,1);g(`${D.getFullYear()}-${String(D.getMonth()+1).padStart(2,"0")}`);},E=i&&Object.keys(i).length>0,W=()=>{let D=n?.price||0;return l.length>0&&s.length>0&&l.forEach(T=>{let P=s.find(L=>L.id===T);P&&(D+=P.addonPrice||P.price||0);}),D},O=D=>{if(!c)return;let T=l.includes(D);c(T?l.filter(P=>P!==D):[...l,D]);};return jsxs("div",{className:"space-y-6",children:[n&&jsx(motion.div,{...ge(.05),className:"bg-gradient-to-br from-white to-gray-50/30 rounded-xl border border-gray-200/80 p-6 shadow-sm hover:shadow-md transition-shadow",children:jsxs("div",{className:"flex items-start justify-between gap-4",children:[jsxs("div",{className:"flex-1",children:[jsx("div",{className:"flex items-center gap-2 mb-3",children:jsx("h3",{className:"text-sm font-semibold tracking-wide uppercase",style:{color:o.primary},children:"Your Selection"})}),jsxs("div",{className:"space-y-2",children:[jsx("p",{className:"font-bold text-lg text-gray-900",children:n.name}),n.description&&jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:n.description}),n.duration&&jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),jsxs("span",{children:[n.duration," minutes"]})]})]})]}),jsxs("div",{className:"text-right",children:[jsx("div",{className:"text-xs text-gray-500 mb-1 font-medium",children:"Price"}),jsxs("div",{className:"text-2xl font-bold",style:{color:o.primary},children:["$",n.price]})]})]})}),d!=="separate_step"&&s.length>0&&c&&jsxs(motion.div,{...ge(.1),className:"bg-white rounded-xl border border-gray-200/80 p-6 shadow-sm hover:shadow-md transition-shadow",children:[jsx("div",{className:"flex items-center gap-2 mb-4",children:jsx("h3",{className:"text-sm font-semibold tracking-wide uppercase",style:{color:o.primary},children:"Enhance Your Experience"})}),jsx("div",{className:"space-y-3",children:s.map(D=>{let T=l.includes(D.id),P=D.addonPrice||D.price||0;return jsxs("label",{className:"flex items-start gap-4 p-4 rounded-xl border-2 cursor-pointer transition-all group",style:{borderColor:T?o.primary:"#E5E7EB",backgroundColor:T?`${o.primary}08`:"transparent",boxShadow:T?`0 0 0 3px ${o.primary}15`:"none"},children:[jsx("div",{className:"flex items-center pt-0.5",children:jsx("input",{type:"checkbox",checked:T,onChange:()=>O(D.id),className:"w-5 h-5 rounded border-2 border-gray-300 cursor-pointer",style:{accentColor:o.primary}})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-start justify-between gap-3 mb-1",children:[jsx("span",{className:"font-semibold text-base text-gray-900 group-hover:text-gray-700 transition-colors",children:D.name}),jsxs("span",{className:"text-base font-bold whitespace-nowrap flex-shrink-0",style:{color:o.primary},children:["+$",P]})]}),D.description&&jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:D.description})]})]},D.id)})}),l.length>0&&jsx("div",{className:"mt-6 pt-5 border-t-2 border-gray-100",children:jsxs("div",{className:"flex items-center justify-between px-2",children:[jsxs("div",{children:[jsx("div",{className:"text-xs text-gray-500 mb-1 font-medium uppercase tracking-wide",children:"New Total"}),jsxs("div",{className:"text-sm text-gray-600",children:["Service + ",l.length," add-on",l.length>1?"s":""]})]}),jsxs("div",{className:"text-3xl font-bold",style:{color:o.primary},children:["$",W()]})]})})]}),jsx(motion.h2,{...ge(.15),className:"text-xl sm:text-2xl font-bold text-center sm:text-left",style:{color:o.primary},children:m}),E&&jsx(motion.div,{...ge(.1),className:"bg-white rounded-lg border border-gray-200 px-4 py-3",children:jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2 text-xs",children:[jsx("span",{className:"font-medium flex items-center",style:{color:o.primary},children:"Cycle Calendar:"}),jsx("div",{className:"flex items-center gap-3",children:Object.entries(ko).map(([D,T])=>jsxs("div",{className:"flex items-center space-x-1.5",children:[jsx("div",{className:"w-3 h-3 rounded border border-gray-300",style:{backgroundColor:T.bg}}),jsx("span",{children:T.label})]},D))})]})}),u==="month"?jsxs("div",{className:"border border-gray-200 rounded-lg p-4",children:[jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsx("button",{className:`p-2 rounded transition-colors ${k?"hover:bg-gray-100":"opacity-30 cursor-not-allowed"}`,onClick:y,disabled:!k,children:jsx(ChevronLeft,{className:"w-4 h-4"})}),jsxs("p",{className:"font-semibold",children:[x," ",f]}),jsx("button",{className:`p-2 rounded transition-colors ${I?"hover:bg-gray-100":"opacity-30 cursor-not-allowed"}`,onClick:h,disabled:!I,children:jsx(ChevronRight,{className:"w-4 h-4"})})]}),jsxs("div",{className:"grid grid-cols-7 gap-2",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(D=>jsx("div",{className:"text-center text-xs font-medium py-2 opacity-60",children:D},D)),F.map((D,T)=>{if(!D)return jsx("div",{},`empty-${T}`);let{day:P,dateStr:L,isAvailable:K}=D,Y=t===L,Te=i?.[L],H=Te?ko[Te]:null;return jsx("button",{onClick:()=>K&&r(L),disabled:!K,className:`aspect-square rounded-lg text-sm transition-all ${Y?"text-white shadow-lg font-semibold":K?"hover:scale-105 cursor-pointer":"bg-gray-50 text-gray-300 cursor-not-allowed opacity-40"}`,style:{backgroundColor:Y?o.primary:H?.bg||void 0,color:Y?"white":H?.text||void 0},children:P},L)})]})]}):jsx("div",{className:"grid grid-cols-5 gap-3",children:b.slice(0,5).map(D=>{let T=new Date(D),P=T.getDate(),K=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][T.getDay()],Y=t===D;return jsxs("button",{onClick:()=>r(D),className:`p-4 rounded-lg border-2 transition-all text-center ${Y?"border-current text-white":"border-gray-200 hover:border-gray-300"}`,style:{borderColor:Y?o.primary:void 0,backgroundColor:Y?o.primary:void 0},children:[jsx("p",{className:"text-xs mb-1 opacity-75",children:K}),jsx("p",{className:"text-2xl font-semibold",children:P})]},D)})})]})}function Hn({availableTimes:e,selectedTime:t,onTimeSelect:r,settings:a,serviceDuration:o,colors:i,selectedService:n,selectedDate:s,selectedAddons:l=[],addons:c=[]}){let d=a.timeFormat||"12h",u=a.showDuration!==false,m=a.headerContent?.value||"Pick a Time",p=a.columns||3,b=()=>{let v=n?.price||0;return l.length>0&&c.length>0&&l.forEach(f=>{let C=c.find(S=>S.id===f);C&&(v+=C.addonPrice||C.price||0);}),v},w=v=>new Date(v+"T00:00:00").toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"}),N=v=>{let f=v.trim().split(" "),[C,S]=f[0].split(":"),x=parseInt(C),F=S||"00";if(f.length>1){let k=f[1];return d==="24h"?(k==="PM"&&x!==12?x+=12:k==="AM"&&x===12&&(x=0),`${String(x).padStart(2,"0")}:${F}`):v}if(d==="12h"){let k=x>=12?"PM":"AM";return `${x===0?12:x>12?x-12:x}:${F} ${k}`}return `${String(x).padStart(2,"0")}:${F}`},g={2:"grid-cols-2",3:"grid-cols-2 sm:grid-cols-3",4:"grid-cols-2 sm:grid-cols-3 lg:grid-cols-4"}[p]||"grid-cols-3";return jsxs("div",{className:"space-y-6",children:[n&&s&&jsxs(motion.div,{...ge(.05),className:"bg-gradient-to-br from-white to-gray-50/30 rounded-xl border border-gray-200/80 p-6 shadow-sm hover:shadow-md transition-shadow",children:[jsx("div",{className:"flex items-center gap-2 mb-4",children:jsx("h3",{className:"text-sm font-semibold tracking-wide uppercase",style:{color:i.primary},children:"Your Booking"})}),jsxs("div",{className:"mb-3",children:[jsx("p",{className:"font-bold text-lg text-gray-900",children:n.name}),n.duration&&jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500 mt-1",children:[jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),jsxs("span",{children:[n.duration," minutes"]})]})]}),l.length>0&&c.length>0&&jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-bold text-gray-900 mb-2",children:"Add-ons"}),jsx("div",{className:"space-y-2",children:l.map(v=>{let f=c.find(C=>C.id===v);return f?jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:"text-sm text-gray-700 font-medium",children:f.name}),jsxs("span",{className:"text-sm font-semibold text-gray-900",children:["$",f.addonPrice||f.price||0]})]},v):null})})]}),jsx("div",{className:"border-t border-gray-200 -mx-6 mb-4"}),jsx("div",{className:"bg-gray-50/50 -mx-6 px-6 py-4 mb-4",children:jsx("div",{className:"flex items-center justify-between",children:jsxs("div",{className:"flex items-center gap-2",children:[jsx("svg",{className:"w-5 h-5",style:{color:i.primary},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),jsx("span",{className:"font-bold text-base text-gray-900",children:w(s)})]})})}),jsx("div",{className:"border-t border-gray-200 -mx-6 mb-4"}),jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:"text-base font-bold text-gray-900",children:"Total"}),jsxs("span",{className:"text-2xl font-bold",style:{color:i.primary},children:["$",b()]})]})]}),jsx(motion.h2,{...ge(n&&s?.15:.05),className:"text-xl sm:text-2xl font-bold text-center sm:text-left",style:{color:i.primary},children:m}),jsx(motion.div,{className:`grid ${g} gap-3`,initial:{opacity:0},animate:{opacity:1},transition:{duration:.3,delay:n&&s?.2:.1},children:e.map((v,f)=>{let C=t===v;return jsxs(motion.button,{onClick:()=>r(v),className:`p-3 rounded-lg border-2 transition-all text-center hover:scale-105 ${C?"border-current text-white shadow-lg":"border-gray-200 hover:border-gray-300"}`,style:{borderColor:C?i.primary:void 0,backgroundColor:C?i.primary:void 0},initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2,delay:.15+f*.03,ease:"easeOut"},children:[jsx("p",{className:"font-medium",children:N(v)}),u&&o&&jsxs("p",{className:"text-xs mt-1 opacity-75",children:[o," min"]})]},v)})})]})}function Wn({addons:e,selectedAddons:t,onAddonsChange:r,settings:a,colors:o}){let i=a.headerContent?.value||"Add Extras",n=a.subheaderContent?.value||"Enhance your experience with these optional add-ons",s=a.showPricing!==false,l=a.showDuration!==false,c=d=>{let u=t.includes(d)?t.filter(m=>m!==d):[...t,d];r(u);};return jsxs("div",{className:"space-y-4",children:[jsxs(motion.div,{...ge(.05),className:"text-center sm:text-left",children:[jsx("h2",{className:"text-xl sm:text-2xl font-bold mb-2",style:{color:o.primary},children:i}),jsx("p",{className:"text-sm opacity-70",children:n})]}),jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:e.map((d,u)=>{let m=t.includes(d.id);return jsxs(motion.button,{onClick:()=>c(d.id),className:`p-4 rounded-lg border-2 transition-all text-left relative ${m?"border-current shadow-lg":"border-gray-200 hover:border-gray-300"}`,style:{borderColor:m?o.primary:void 0,backgroundColor:m?`${o.primary}10`:void 0},initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:.1+u*.05},children:[m&&jsx("div",{className:"absolute top-3 right-3 w-6 h-6 rounded-full flex items-center justify-center text-white text-sm",style:{backgroundColor:o.primary},children:"\u2713"}),jsx("p",{className:"font-semibold mb-1 pr-8",children:d.name}),jsx("p",{className:"text-xs opacity-70 mb-3",children:d.description}),jsxs("div",{className:"flex justify-between items-center text-sm",children:[s&&jsxs("span",{className:"font-bold",style:{color:o.primary},children:["+$",d.price]}),l&&jsxs("span",{className:"opacity-60",children:["+",d.duration," min"]})]})]},d.id)})}),t.length>0&&jsxs(motion.div,{className:"bg-gray-50 rounded-lg p-4 mt-4",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},children:[jsx("p",{className:"text-sm font-medium mb-2",children:"Selected Add-ons:"}),jsx("div",{className:"space-y-1",children:t.map(d=>{let u=e.find(m=>m.id===d);return u?jsxs("div",{className:"flex justify-between text-sm",children:[jsx("span",{children:u.name}),jsxs("span",{className:"font-medium",style:{color:o.primary},children:["+$",u.price]})]},d):null})})]})]})}function jn({isOpen:e,onClose:t,title:r,children:a,isRequired:o=false,maxHeight:i="80vh"}){return useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset";}),[e]),useEffect(()=>{if(!o&&e){let n=s=>{s.key==="Escape"&&t();};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)}},[e,o,t]),jsx(AnimatePresence,{children:e&&jsxs(Fragment,{children:[jsx(motion.div,{...rr.backdrop,onClick:o?void 0:t,className:"fixed inset-0 bg-black/50 z-50",style:{backdropFilter:"blur(4px)"}}),jsxs(motion.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:rr.spring,className:"fixed bottom-0 left-0 right-0 bg-white rounded-t-2xl shadow-2xl z-50",style:{maxHeight:i},children:[jsx("div",{className:"flex justify-center pt-3 pb-2",children:jsx("div",{className:"w-12 h-1 bg-gray-300 rounded-full"})}),jsxs("div",{className:"flex items-center justify-between px-6 pb-4 border-b border-gray-200",children:[jsxs("div",{className:"flex items-center gap-2",children:[r&&jsx("h3",{className:"text-lg font-semibold",children:r}),o&&jsx("span",{className:"text-xs font-medium px-2 py-0.5 bg-amber-100 text-amber-800 rounded",children:"Required"})]}),!o&&jsx("button",{onClick:t,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors","aria-label":"Close",children:jsx(X,{className:"w-5 h-5"})})]}),jsx("div",{className:"overflow-y-auto",style:{maxHeight:`calc(${i} - 120px)`},children:jsx("div",{className:"px-6 py-6",children:a})})]})]})})}function Vn({contactInfo:e,onContactInfoChange:t,settings:r,optInModules:a=[],onOptInData:o,colors:i,isPreview:n=false}){let[s,l]=useState(false),[c,d]=useState(null),[u,m]=useState({}),[p,b]=useState({}),[w,N]=useState({}),g=r.headerContent?.value||"Your Information",v=y=>y?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(y)?null:"Please enter a valid email address":"Email is required",f=y=>y?y.replace(/\D/g,"").length<10?"Please enter a valid phone number":null:"Phone number is required",C=y=>!y||y.trim().length===0?"Name is required":y.trim().length<2?"Name must be at least 2 characters":null,S=(y,h)=>{switch(y){case "email":return v(h);case "phone":return f(h);case "name":return C(h);default:return null}},x=[{label:"Name *",type:"text",placeholder:"Your full name",field:"name"},{label:"Email *",type:"email",placeholder:"your@email.com",field:"email"},{label:"Phone *",type:"tel",placeholder:"(555) 123-4567",field:"phone"},{label:"Notes (optional)",type:"textarea",placeholder:"Any special requests or notes...",field:"notes"}],F=(y,h)=>{if(t({...e,[y]:h}),!n&&w[y]){let E=S(y,h);b(W=>({...W,[y]:E||""}));}},k=y=>{if(n)return;N(W=>({...W,[y]:true}));let h=e[y]||"",E=S(y,h);b(W=>({...W,[y]:E||""}));},I=(y,h)=>{m(E=>({...E,[y.id]:h})),h&&(d(y),l(true));};return jsxs(Fragment,{children:[jsxs("div",{className:"space-y-4",children:[jsx(motion.h2,{...ge(.05),className:"text-xl sm:text-2xl font-bold text-center sm:text-left",style:{color:i.primary},children:g}),jsxs("div",{className:"space-y-3",children:[x.map((y,h)=>jsxs(motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{duration:.3,delay:.1+h*.05,ease:"easeOut"},children:[jsx("label",{className:"block text-sm font-medium mb-1",children:y.label}),y.type==="textarea"?jsxs(Fragment,{children:[jsx("textarea",{className:`w-full px-3 py-2 border rounded-lg focus:ring-2 focus:border-transparent resize-none transition-all ${!n&&p[y.field]&&w[y.field]?"border-red-500":"border-gray-300"}`,style:{"--tw-ring-color":i.primary},rows:3,placeholder:y.placeholder,value:e[y.field]||"",onChange:E=>F(y.field,E.target.value),onBlur:()=>k(y.field)}),!n&&p[y.field]&&w[y.field]&&jsx("p",{className:"text-red-500 text-xs mt-1",children:p[y.field]})]}):jsxs(Fragment,{children:[jsx("input",{type:y.type,className:`w-full px-3 py-2 border rounded-lg focus:ring-2 focus:border-transparent transition-all ${!n&&p[y.field]&&w[y.field]?"border-red-500":"border-gray-300"}`,style:{"--tw-ring-color":i.primary},placeholder:y.placeholder,value:e[y.field]||"",onChange:E=>F(y.field,E.target.value),onBlur:()=>k(y.field)}),!n&&p[y.field]&&w[y.field]&&jsx("p",{className:"text-red-500 text-xs mt-1",children:p[y.field]})]})]},y.label)),a.length>0&&jsx(motion.div,{className:"pt-3 border-t border-gray-200 space-y-3",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:.3},children:a.map(y=>jsxs("label",{className:"flex items-start gap-3 cursor-pointer group",children:[jsx("input",{type:"checkbox",checked:u[y.id]||false,onChange:h=>I(y,h.target.checked),className:"mt-1 w-4 h-4 rounded border-gray-300",style:{accentColor:i.primary}}),jsxs("div",{children:[jsxs("span",{className:"text-sm font-medium",children:[y.label,y.required&&jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"Check this to provide additional information"})]})]},y.id))})]})]}),c&&jsx(jn,{isOpen:s,onClose:()=>l(false),title:c.formTitle||"Additional Information",isRequired:c.required,children:c.renderCustomForm?c.renderCustomForm(()=>l(false),y=>{o&&o(c.id,y);},i):jsxs("div",{className:"space-y-4",children:[c.formFields?.map(y=>jsxs("div",{children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:[y.label,y.required&&jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),y.type==="textarea"?jsx("textarea",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:border-transparent resize-none",style:{"--tw-ring-color":i.primary},rows:3,placeholder:y.placeholder}):y.type==="select"&&y.options?jsx("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:border-transparent",style:{"--tw-ring-color":i.primary},children:y.options.map(h=>jsx("option",{value:h.value,children:h.label},h.value))}):jsx("input",{type:y.type,className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:border-transparent",style:{"--tw-ring-color":i.primary},placeholder:y.placeholder})]},y.id)),jsx("button",{onClick:()=>{o&&c&&o(c.id,{}),l(false);},className:"w-full py-3 rounded-lg text-white font-medium transition-all hover:opacity-90",style:{backgroundColor:i.primary},children:"Save & Continue"})]})})]})}function Yn({service:e,addons:t=[],selectedDate:r,selectedTime:a,paymentProvider:o,paymentConfig:i,onConfirm:n,colors:s,isPreview:l=false}){let c=e?.price||0,d=t.reduce((f,C)=>f+(C.addonPrice||C.price||0),0),u=c+d,m=e?.duration||0,p=t.reduce((f,C)=>f+(C.duration||0),0),b=m+p,w=i.depositPercentage||20,N=(u*(w/100)).toFixed(2),g=u.toFixed(2),v=(parseFloat(g)-parseFloat(N)).toFixed(2);return jsxs("div",{className:"space-y-4",children:[jsx(motion.h2,{...ge(.05),className:"text-xl font-bold text-center",style:{color:s.primary},children:"Confirm & Pay"}),jsx(motion.div,{className:"bg-gray-50 rounded-lg p-4",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:.1},children:jsxs("div",{className:"space-y-2",children:[e&&jsxs("div",{className:"flex justify-between items-center text-sm",children:[jsxs("div",{children:[jsx("p",{className:"font-medium",children:e.name}),jsxs("p",{className:"text-xs opacity-70",children:[b," min total"]})]}),jsxs("span",{className:"font-bold",style:{color:s.primary},children:["$",c]})]}),t.length>0&&jsx("div",{className:"space-y-1 text-xs",children:t.map(f=>jsxs("div",{className:"flex justify-between opacity-70",children:[jsxs("span",{children:["+ ",f.name]}),jsxs("span",{children:["+$",f.addonPrice||f.price||0]})]},f.id))}),r&&jsxs("div",{className:"flex justify-between items-center text-sm pt-2 border-t border-gray-200",children:[jsx("span",{className:"opacity-70",children:new Date(r+"T00:00:00").toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}),jsx("span",{children:a})]}),jsxs("div",{className:"pt-2 mt-2 border-t border-gray-200 flex justify-between items-center",children:[jsx("span",{className:"text-sm font-medium",children:"Due Today"}),jsxs("span",{className:"text-lg font-bold",style:{color:s.primary},children:["$",N]})]})]})}),jsx(motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:.2},children:l?jsxs("div",{className:"border border-gray-200 rounded-lg p-4 bg-white",children:[jsxs("div",{className:"space-y-2",children:[jsx("div",{className:"h-10 bg-gray-50 border border-gray-200 rounded flex items-center px-3",children:jsx("span",{className:"text-xs text-gray-400",children:"Card Number"})}),jsxs("div",{className:"grid grid-cols-2 gap-2",children:[jsx("div",{className:"h-10 bg-gray-50 border border-gray-200 rounded flex items-center px-3",children:jsx("span",{className:"text-xs text-gray-400",children:"MM/YY"})}),jsx("div",{className:"h-10 bg-gray-50 border border-gray-200 rounded flex items-center px-3",children:jsx("span",{className:"text-xs text-gray-400",children:"CVV"})})]})]}),jsxs("div",{className:"mt-3 flex items-center justify-center gap-1",children:[jsx("svg",{className:"w-3 h-3 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),jsxs("span",{className:"text-xs text-gray-400",children:["Powered by ",o==="square"?"Square":"Stripe"]})]})]}):jsx("div",{className:"border border-gray-200 rounded-lg p-4 bg-white",children:jsxs("div",{className:"text-center py-8 text-sm text-gray-500",children:[jsxs("div",{className:"animate-pulse",children:["Initializing ",o==="square"?"Square":"Stripe"," payment..."]}),jsx("div",{className:"mt-4 text-xs text-gray-400",children:"Please wait while we securely load the payment form"})]})})}),jsx(motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:.3},children:jsxs("div",{className:"space-y-2",children:[jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[jsx("input",{type:"checkbox",className:"mt-0.5 w-4 h-4 rounded border-gray-300",style:{accentColor:s.primary}}),jsxs("span",{className:"text-xs",children:["I agree to the ",jsx("a",{href:"#",className:"underline",style:{color:s.primary},children:"cancellation policy"})," and understand the $",v," balance is due at appointment."]})]}),jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[jsx("input",{type:"checkbox",className:"mt-0.5 w-4 h-4 rounded border-gray-300",style:{accentColor:s.primary}}),jsxs("span",{className:"text-xs",children:["I agree to the ",jsx("a",{href:"#",className:"underline",style:{color:s.primary},children:"terms of service"}),"."]})]})]})})]})}var Io={avoid:{phase:"avoid",color:"#EF4444",bgColor:"#FEF2F2",label:"Avoid",icon:"\u{1F534}",description:"Period - avoid waxing"},caution:{phase:"caution",color:"#F59E0B",bgColor:"#FFFBEB",label:"Caution",icon:"\u{1F7E1}",description:"End of period - proceed with caution"},optimal:{phase:"optimal",color:"#10B981",bgColor:"#F0FDF4",label:"Optimal",icon:"\u{1F7E2}",description:"Best time for waxing"},neutral:{phase:"neutral",color:"#6B7280",bgColor:"#F9FAFB",label:"Neutral",icon:"\u26AA",description:"Okay but not optimal"},unknown:{phase:"unknown",color:"#9CA3AF",bgColor:"#F3F4F6",label:"Unknown",icon:"\u2753",description:"No cycle data available"}};function ui({availableDates:e,selectedDate:t,onDateSelect:r,settings:a,colors:o,fetchCycleData:i,selectedClient:n,onCycleWarning:s,cycleAwareEnabled:l}){let[c,d]=useState({}),[u,m]=useState(false),[p,b]=useState(null),w=useMemo(()=>l!==void 0?l:!!(n?.cycle_opt_in&&i),[l,n?.cycle_opt_in,i]);useEffect(()=>{if(!w||!i||!n){d({});return}e.length!==0&&(m(true),b(null),i(n,e).then(g=>{d(g);}).catch(g=>{console.error("[CycleAwareDateSelection] Error fetching cycle data:",g),b(g.message||"Failed to load cycle data"),d({});}).finally(()=>{m(false);}));},[w,i,n,e]);let N=useCallback(g=>{let v=c[g];v?.phase==="avoid"&&s&&s(v,g),r(g,v);},[c,r,s]);return jsxs("div",{className:"cycle-aware-date-selection space-y-4",children:[w&&Object.keys(c).length>0&&jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[jsxs("h4",{className:"font-medium mb-3 flex items-center",style:{color:o.primary},children:[jsx("span",{className:"mr-2",children:"\u{1F4C5}"}),"Your Cycle Calendar"]}),jsx("div",{className:"grid grid-cols-2 gap-3 text-sm",children:Object.entries(Io).map(([g,v])=>g!=="unknown"&&jsxs("div",{className:"flex items-center space-x-2",children:[jsx("div",{className:"w-3 h-3 rounded-full border border-gray-300",style:{backgroundColor:v.color}}),jsx("span",{children:v.label})]},g))}),jsx("p",{className:"text-xs opacity-70 mt-2",children:"Green dates are optimal for comfortable waxing appointments"})]}),w&&u&&jsx("div",{className:"text-center py-2 text-sm opacity-70",children:"Loading cycle predictions..."}),w&&p&&jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-3",children:jsxs("p",{className:"text-yellow-800 text-sm",children:["Unable to load cycle predictions: ",p]})}),jsx(nr,{availableDates:e,selectedDate:t,onDateSelect:N,settings:a,colors:o}),w&&t&&c[t]?.phase==="avoid"&&jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:jsxs("div",{className:"flex items-start space-x-3",children:[jsx("span",{className:"text-red-500 text-xl",children:"\u26A0\uFE0F"}),jsxs("div",{children:[jsx("h4",{className:"font-medium text-red-800 mb-1",children:"This date falls during your predicted period"}),jsx("p",{className:"text-red-700 text-sm mb-3",children:"Waxing during this time may be more uncomfortable than usual. Would you like to see better alternatives?"}),jsxs("div",{className:"flex space-x-2",children:[jsx("button",{className:"px-3 py-1 bg-red-100 text-red-700 rounded text-sm hover:bg-red-200 transition-colors",onClick:()=>{let g=e.filter(v=>c[v]?.phase==="optimal");g.length>0&&N(g[0]);},children:"Show optimal dates"}),jsx("button",{className:"px-3 py-1 text-red-600 text-sm hover:underline",children:"Continue anyway"})]})]})]})})]})}var mi={enabled:true,duration:6e5,warningThreshold:12e4,maxExtensions:2,extensionDuration:3e5,showActions:true,showWarning:true};function Rr({holdStatus:e,config:t,colors:r,onExtend:a,onRelease:o,onWarning:i,onExpired:n,className:s=""}){let[l,c]=useState(Date.now()),[d,u]=useState(false),[m,p]=useState(false),[b,w]=useState(false),N={...mi,...t};useEffect(()=>{if(!e)return;let E=setInterval(()=>{c(Date.now());},1e3);return ()=>clearInterval(E)},[e]);let g=e?Math.max(0,e.expiresAt-l):0,v=g===0&&e!==null,f=g<=N.warningThreshold&&g>0;useEffect(()=>{f&&!d&&i&&e&&(u(true),i(g));},[f,d,i,e,g]),useEffect(()=>{v&&e&&n&&n();},[v,e,n]),useEffect(()=>{u(false);},[e?.holdKey]);let C=useCallback(async()=>{if(!(!a||!e||m))try{p(!0),await a(),u(!1);}catch(E){console.error("[HoldTimer] Failed to extend hold:",E);}finally{p(false);}},[a,e,m]),S=useCallback(async()=>{if(!(!o||!e||b))try{w(!0),await o();}catch(E){console.error("[HoldTimer] Failed to release hold:",E);}finally{w(false);}},[o,e,b]);if(!e||!N.enabled)return null;let x=Math.floor(g/6e4),F=Math.floor(g%6e4/1e3),k=`${x}:${F.toString().padStart(2,"0")}`,I="rgba(139, 92, 246, 0.1)",y="rgba(139, 92, 246, 0.3)",h=r.primary;return v?(I="rgba(239, 68, 68, 0.1)",y="rgba(239, 68, 68, 0.3)",h="#EF4444"):f&&N.showWarning&&(I=`${r.secondary}1A`,y=`${r.secondary}4D`,h=r.secondary),jsx("div",{className:`rounded-lg p-4 text-center ${s}`,style:{backgroundColor:I,borderWidth:"1px",borderStyle:"solid",borderColor:y},children:jsxs("div",{className:"flex flex-col items-center justify-center",children:[jsx("div",{className:"flex flex-col items-center gap-2 mb-4",children:v?jsxs("div",{style:{color:h},className:"font-medium text-base",children:[jsx("span",{children:"Time expired - "}),jsx("button",{onClick:S,disabled:b,className:"underline hover:no-underline focus:outline-none focus:ring-2 focus:ring-offset-2 inline disabled:opacity-50",style:{color:h},children:b?"Releasing...":"select a new time"})]}):jsxs("div",{style:{color:h},className:"font-medium text-base",children:["Your time slot is reserved for ",k]})}),N.showActions&&!v&&jsxs("div",{className:"flex justify-center gap-2",children:[a&&e.canExtend&&jsxs("button",{onClick:C,disabled:!e.canExtend||m,className:"px-4 py-2 text-sm font-medium rounded transition-all active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed text-white",style:{backgroundColor:r.primary},"aria-label":`Extend hold (${e.maxExtensions-e.extensions} extensions remaining)`,children:[m?"Extending...":"Extend",!m&&e.maxExtensions-e.extensions>0&&jsxs("span",{className:"ml-1",children:["(",e.maxExtensions-e.extensions,")"]})]}),o&&jsx("button",{onClick:S,disabled:b,className:"px-4 py-2 text-sm font-medium rounded border transition-all active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed",style:{borderColor:"rgba(255, 255, 255, 0.2)",color:r.text||"#000000"},"aria-label":"Release hold and return to time selection",children:b?"Releasing...":"Release"})]}),!v&&!e.canExtend&&e.extensions>=e.maxExtensions&&jsx("div",{className:"mt-3 pt-3 border-t border-white/10 text-center",children:jsxs("div",{className:"text-sm",style:{color:r.secondary},children:["Maximum extensions reached - complete booking now or"," ",jsx("button",{onClick:S,disabled:b,className:"hover:underline focus:outline-none focus:underline disabled:opacity-50",style:{color:r.primary},children:b?"releasing...":"select a different time"})]})})]})})}function Ro({config:e,colors:t,services:r=[],categories:a=[],dates:o=[],times:i=[],addons:n=[],paymentProvider:s,paymentConfig:l,isPreview:c=false,onComplete:d,onStepChange:u,onServiceSelect:m,onDateSelect:p,onContactInfoChange:b,validateStep:w,holdTimer:N,stepOrder:g,optInModules:v=[],onOptInData:f,customPaymentForm:C,cyclePhases:S}){let[x,F]=useState(0),[k,I]=useState("forward"),[y,h]=useState(null),[E,W]=useState(null),[O,D]=useState(null),[T,P]=useState([]),[L,K]=useState({}),[Y,Te]=useState({}),[H,ie]=useState(null),Xe=t.bookingText||t.text||"#000000",ot=e.transitions||{},xe=ot.style||"slide",At=ot.speed||"normal",je=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,fe=e.background||{type:"color",value:"#FFFFFF"},B={service:{id:"service",name:"Service",enabled:e.steps?.service_selection?.enabled!==false,settings:e.steps?.service_selection?.settings||{}},date:{id:"date",name:"Date",enabled:e.steps?.date_selection?.enabled!==false,settings:e.steps?.date_selection?.settings||{}},time:{id:"time",name:"Time",enabled:e.steps?.time_selection?.enabled!==false,settings:e.steps?.time_selection?.settings||{}},addons:{id:"addons",name:"Add-ons",enabled:e.steps?.addon_selection?.enabled===true,settings:e.steps?.addon_selection?.settings||{}},details:{id:"details",name:"Details",enabled:e.steps?.contact_form?.enabled!==false,settings:e.steps?.contact_form?.settings||{}},confirm:{id:"confirm",name:"Confirm",enabled:e.steps?.confirmation?.enabled===true,settings:e.steps?.confirmation?.settings||{}}},Ne=g||["service","date","time","addons","details","confirm"],J=Ne.map(R=>B[R]).filter(R=>R&&R.enabled);console.log("[BookingFlow] Step configuration:",{customStepOrder:g,orderedStepIds:Ne,allSteps:J.map(R=>R.id),currentStepIndex:x,currentStepId:J[x]?.id});let re=J[x],at=()=>fe.type==="gradient"?{background:fe.value}:fe.type==="image"?{backgroundImage:`url(${fe.value})`,backgroundSize:"cover",backgroundPosition:"center"}:{backgroundColor:fe.value},it=()=>{if(je)return .15;switch(At){case "fast":return .2;case "slow":return .5;default:return .3}},gr=()=>xe==="fade"?{enter:()=>({opacity:0,scale:.95}),center:{opacity:1,scale:1},exit:()=>({opacity:0,scale:.95})}:{enter:()=>({x:k==="forward"?50:-50,opacity:0}),center:{x:0,opacity:1},exit:()=>({x:k==="forward"?-50:50,opacity:0})},Kt=()=>{let R=re?.id;if(w)return w(R,{service:y,date:E,time:O,addons:T,contact:L});switch(R){case "service":return y!==null;case "date":return E!==null;case "time":return O!==null;case "details":if(c)return true;let U=L?.name&&L.name.trim().length>=2,_=L?.email&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(L.email),ye=L?.phone&&L.phone.replace(/\D/g,"").length>=10;return U&&_&&ye;default:return true}},$t=R=>R<x,Ce=R=>{I(R>x?"forward":"backward"),F(R),u&&u(R,J[R]?.id);},bt=()=>{x<J.length-1&&Ce(x+1);},Lt=async()=>{if(x===0)return;let R=x-1;if(J[R]?.id==="time"&&H&&N?.releaseHold)try{await N.releaseHold(H.holdId),ie(null),D(null);}catch(_){console.error("[BookingFlow] Failed to release hold:",_);}Ce(R);},fr=async R=>{if(D(R),N?.enabled&&N.createHold&&E&&y)try{let U=r.find(ye=>ye.id===y),_=await N.createHold({date:E,time:R,serviceId:y,serviceDuration:U?.duration||60});ie(_);}catch(U){console.error("[BookingFlow] Failed to create hold:",U);return}bt();},yr=()=>{ie(null),D(null);let R=J.findIndex(U=>U.id==="time");R>=0&&Ce(R);},Jt=async()=>{d&&d({service:y,date:E,time:O,addons:T,contact:L,optIn:Y});},Zr=()=>{if(!re)return null;let R={settings:re.settings,colors:t},U=r.find(_=>_.id===y);switch(re.id){case "service":return jsx(On,{...R,services:r,categories:a,selectedService:y,onServiceSelect:se=>{h(se),m&&m(se);}});case "date":return jsx(nr,{...R,availableDates:o,selectedDate:E,onDateSelect:se=>{W(se),p&&p(se);},cyclePhases:S,selectedService:U,addons:n,selectedAddons:T,onAddonsChange:P,addonPlacement:e.steps?.addon_selection?.settings?.placement||"date_selection"});case "time":return jsx(Hn,{...R,availableTimes:i,selectedTime:O,onTimeSelect:fr,serviceDuration:U?.duration||60,selectedService:U,selectedDate:E,selectedAddons:T,addons:n});case "addons":return jsx(Wn,{...R,addons:n,selectedAddons:T,onAddonsChange:P});case "details":return jsx(Vn,{...R,contactInfo:L,onContactInfoChange:se=>{K(se),b&&b(se);},optInModules:v,onOptInData:f});case "confirm":let _=n.filter(se=>T.includes(se.id)),ye=_.reduce((se,Pe)=>se+(Pe.addonPrice||Pe.price||0),0),br=(U?.price||0)+ye,hr=_.reduce((se,Pe)=>Pe.affectsDuration&&Pe.additionalDuration?se+Pe.additionalDuration:se,U?.duration||60);return C?jsx(C,{bookingData:{service:y,serviceName:U?.name,date:E,time:O,addons:T,contact:L,amount:U?.price||0,duration:hr,clientName:L?.name,clientEmail:L?.email,clientPhone:L?.phone,pendingBooking:{customerClientId:null,serviceId:y,date:E,time:O,notes:L?.notes||"",selectedAddons:_,addonServices:T,addonTotalCost:ye,totalAmount:br,duration:hr}},onPaymentSuccess:Jt,onPaymentError:Pe=>{console.error("[BookingFlow] Payment error:",Pe);}}):jsx(Yn,{...R,service:U,addons:_,selectedDate:E||"",selectedTime:O||"",paymentProvider:s||"square",paymentConfig:l||{depositPercentage:20},isPreview:c,onConfirm:Jt});default:return null}},st=()=>{let R=e.progressBar?.style||"dots";return R==="bar"?jsxs("div",{className:"mb-6",children:[jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsxs("span",{className:"text-sm font-medium",children:["Step ",x+1," of ",J.length]}),jsx("span",{className:"text-xs opacity-60",children:re?.name})]}),jsx("div",{className:"w-full h-2 bg-gray-200 rounded-full overflow-hidden",children:jsx(motion.div,{className:"h-full rounded-full",style:{backgroundColor:t.primary},initial:{width:0},animate:{width:`${(x+1)/J.length*100}%`},transition:{duration:.3,ease:"easeOut"}})})]}):R==="minimal"?jsxs("div",{className:"mb-6 text-center",children:[jsx("p",{className:"text-sm font-medium",style:{color:t.primary},children:re?.name}),jsxs("p",{className:"text-xs opacity-60 mt-1",children:["Step ",x+1," of ",J.length]})]}):jsx("div",{className:"flex justify-center mb-4 overflow-x-auto py-2",children:jsx("div",{className:"flex items-center space-x-1.5 px-4 min-w-max",children:J.map((U,_)=>jsxs("div",{className:"flex items-center",children:[jsx(motion.div,{className:`w-6 h-6 rounded-full flex items-center justify-center font-medium text-xs transition-all flex-shrink-0 ${_===x?"text-white shadow-md":$t(_)?"text-white":"bg-gray-200 text-gray-500"}`,style:{backgroundColor:_<=x?t.primary:void 0},animate:{scale:_===x?1.05:1},transition:{duration:.2},children:$t(_)?"\u2713":_+1}),_<J.length-1&&jsx(motion.div,{className:`w-4 h-0.5 mx-1 transition-all flex-shrink-0 ${_<x?"":"bg-gray-200"}`,style:{backgroundColor:_<x?t.primary:void 0},initial:{scaleX:0},animate:{scaleX:1},transition:{duration:.3,delay:.1}})]},U.id))})})};return jsxs("div",{className:"w-full max-w-4xl mx-auto p-6 rounded-2xl shadow-xl",style:{...at(),color:Xe},children:[st(),N?.enabled&&H&&re?.id!=="time"&&jsx(Rr,{holdStatus:H,config:N.config,colors:t,onExtend:async()=>{if(N.extendHold&&H)try{let R=await N.extendHold(H.holdId);ie(R);}catch(R){console.error("[BookingFlow] Failed to extend hold:",R);}},onRelease:async()=>{if(N.releaseHold&&H)try{await N.releaseHold(H.holdId),ie(null),D(null);let R=J.findIndex(U=>U.id==="time");R>=0&&Ce(R);}catch(R){console.error("[BookingFlow] Failed to release hold:",R);}},onExpired:yr,className:"mb-6"}),jsx("div",{className:"mb-6 min-h-[300px] relative overflow-hidden",children:jsx(AnimatePresence,{mode:"wait",custom:k,children:jsx(motion.div,{custom:k,variants:gr(),initial:"enter",animate:"center",exit:"exit",transition:{duration:it(),ease:[.4,0,.2,1]},children:Zr()},x)})}),!(re?.id==="confirm"&&C)&&jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-gray-200",children:[jsx("button",{onClick:Lt,disabled:x===0,className:"px-4 py-2 rounded-lg border border-gray-300 disabled:opacity-30 disabled:cursor-not-allowed hover:bg-gray-50 transition-all text-sm font-medium",children:"Back"}),x<J.length-1?jsx("button",{onClick:bt,disabled:!Kt(),className:"px-6 py-2 rounded-lg text-white disabled:opacity-50 disabled:cursor-not-allowed hover:opacity-90 transition-all text-sm font-medium shadow-md",style:{backgroundColor:t.primary},children:"Next"}):jsx("button",{onClick:Jt,disabled:!Kt(),className:"px-6 py-2 rounded-lg text-white disabled:opacity-50 disabled:cursor-not-allowed hover:opacity-90 transition-all text-sm font-medium shadow-md",style:{backgroundColor:t.primary},children:re?.id==="confirm"?"Pay & Confirm":"Complete"})]})]})}function gi({section:e,theme:t,BookingFlowComponent:r,config:a,enableInlineEditing:o=false}){let{type:i,settings:n}=e,s=e.id;i==="video_section"&&console.log("\u{1F3AC} Rendering video_section:",{type:i,settings:n,sectionId:s});let l=t?.colors||{primary:"#BCB4FF",secondary:"#CAC426",text:"#000000"},c=t?.typography||{headingFont:"Geist Sans",bodyFont:"Inter",bodySize:"16px"};switch(i){case "logo":return jsx(tn,{logoUrl:n.logoUrl,fallbackText:n.fallbackText,size:n.size,alignment:n.alignment,colors:l,enableInlineEditing:o,sectionId:s});case "header":return jsx(nn,{name:n.name,title:n.title,bio:n.bio,showName:n.showName,showTitle:n.showTitle,showBio:n.showBio,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "featured_link":return jsx(on,{text:n.text,url:n.url,style:n.style,size:n.size,colors:l,enableInlineEditing:o,sectionId:s});case "link_list":return jsx(sn,{links:n.links||[],style:n.style,colors:l,enableInlineEditing:o,sectionId:s});case "social_bar":return jsx(ln,{platforms:n.platforms||[],socialLinks:n.socialLinks,style:n.style,size:n.size,position:n.position,invertIcons:n.invertIcons,colors:l,enableInlineEditing:o,sectionId:s});case "instagram_feed":return jsx(Fn,{username:n.username,colors:l,enableInlineEditing:o,sectionId:s});case "minimal_header":return jsx(bn,{brandName:n.brandName,logoUrl:n.logoUrl,style:n.style,alignment:n.alignment,sticky:n.sticky,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "minimal_navigation":return jsx(xn,{links:n.links||[],style:n.style,colors:l,enableInlineEditing:o,sectionId:s});case "feature_content":return jsx(wn,{headline:n.headline,description:n.description,image:n.image,buttonText:n.buttonText,buttonUrl:n.buttonUrl,showButton:n.showButton,layout:n.layout,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "minimal_footer":return jsx(vn,{alignment:n.alignment,showSocial:n.showSocial,showContact:n.showContact,showLinks:n.showLinks,footerText:n.footerText,colors:l,enableInlineEditing:o,sectionId:s});case "hero":return jsx(cn,{headline:n.headline,subheadline:n.subheadline,heroImage:n.heroImage,ctaButton:n.ctaButton,layout:n.layout,imagePosition:n.imagePosition,contentDisplay:n.contentDisplay,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "about":return jsx(dn,{title:n.title,content:n.content,image:n.image,layout:n.layout,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "services_preview":return jsx(un,{title:n.title,services:n.services,layout:n.layout,columns:n.columns,showPrices:n.showPrices,showDuration:n.showDuration,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "gallery":return jsx(mn,{title:n.title,images:n.images||[],columns:n.columns,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "testimonials":return jsx(gn,{title:n.title,testimonials:n.testimonials,layout:n.layout,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "team":return jsx(fn,{title:n.title,members:n.members,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "contact":return jsx(yn,{title:n.title,showForm:n.showForm,email:n.email,phone:n.phone,address:n.address,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "before_after":return jsx(Cn,{title:n.title,comparisons:n.comparisons,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "pricing_table":return jsx(Sn,{title:n.title,plans:n.plans,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "booking":return jsx(En,{config:a||{},colors:l,BookingFlowComponent:r,enableInlineEditing:o,sectionId:s});case "fixed_info_card":return jsx(In,{name:n.name,subheading:n.subheading,bio:n.bio,links:n.links||[],bookingButtonText:n.bookingButtonText,bookingButtonUrl:n.bookingButtonUrl,showBookingButton:n.showBookingButton,position:n.position,cardWidth:n.cardWidth,cardColor:n.cardColor,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "video_section":return jsx(Rn,{videoUrl:n.videoUrl,aspectRatio:n.aspectRatio,autoplay:n.autoplay,loop:n.loop,muted:n.muted,controls:n.controls,allowFullScreen:n.allowFullScreen,coverImage:n.coverImage,maxWidth:n.maxWidth,alignment:n.alignment,borderRadius:n.borderRadius,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "scrolling_text_divider":return jsx(Pn,{text:n.text,scrollDirection:n.scrollDirection,scrollSpeed:n.scrollSpeed,orientation:n.orientation,dividerIcon:n.dividerIcon,customIcon:n.customIcon,textSize:n.textSize,textColor:n.textColor,fontWeight:n.fontWeight,backgroundColor:n.backgroundColor,backgroundGradient:n.backgroundGradient,pauseOnHover:n.pauseOnHover,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "location_map":return jsx(An,{address:n.address,displayType:n.displayType,mapHeight:n.mapHeight,mapStyle:n.mapStyle,zoom:n.zoom,showMarker:n.showMarker,borderRadius:n.borderRadius,directionsButtonText:n.directionsButtonText,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "image_section":return jsx(Mn,{imageUrl:n.imageUrl,altText:n.altText,caption:n.caption,maxWidth:n.maxWidth,alignment:n.alignment,aspectRatio:n.aspectRatio,borderRadius:n.borderRadius,linkUrl:n.linkUrl,openInNewTab:n.openInNewTab,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "faq_section":return jsx($n,{title:n.title,faqs:n.faqs,layout:n.layout,maxWidth:n.maxWidth,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "navbar":return jsx(Bn,{brandName:n.brandName,logoUrl:n.logoUrl,showLogo:n.showLogo,showBrandName:n.showBrandName,links:n.links,ctaText:n.ctaText,ctaUrl:n.ctaUrl,sticky:n.sticky,transparentOnTop:n.transparentOnTop,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "text_section":return jsx(zn,{title:n.title,content:n.content,alignment:n.alignment,maxWidth:n.maxWidth,textSize:n.textSize,backgroundColor:n.backgroundColor,textColor:n.textColor,paddingY:n.paddingY,colors:l,typography:c,enableInlineEditing:o,sectionId:s});default:return jsx("div",{className:"container mx-auto px-4 py-16",children:jsx("div",{className:"max-w-4xl mx-auto p-8 rounded-lg border-2 border-dashed text-center",style:{borderColor:l.primary,opacity:.5},children:jsxs("p",{className:"text-lg",style:{color:l.text},children:["Unknown section type: ",i]})})})}}var Xn=null;function bi(){if(!Xn){let e=import.meta.env.VITE_SUPABASE_URL||process.env.NEXT_PUBLIC_SUPABASE_URL,t=import.meta.env.VITE_SUPABASE_ANON_KEY||process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;if(!e||!t)throw new Error("Supabase URL and Anon Key must be provided");Xn=createClient(e,t);}return Xn}var nt={bucket:"form-uploads",limits:{maxSize:5*1024*1024,allowedTypes:["image/jpeg","image/png","image/webp","image/jpg"]}};async function To(e,t,r){if(console.log("\u{1F4E6} uploadFormImage called:",{fileName:e.name,clientId:t,formId:r}),e.size>nt.limits.maxSize)throw new Error(`File size exceeds maximum of ${nt.limits.maxSize/1024/1024}MB`);if(!nt.limits.allowedTypes.includes(e.type))throw new Error(`File type ${e.type} not allowed. Accepted types: JPG, PNG, WebP`);console.log("\u{1F3A8} Starting image optimization...");let a=await hi(e);console.log("\u2705 Image optimized:",{originalSize:e.size,optimizedSize:a.size});let o=Date.now();e.name.split(".").pop()?.toLowerCase()||"jpg";let n=e.name.replace(/[^a-zA-Z0-9.-]/g,"_").substring(0,50),s=`${o}_${n}`,l=`${t}/${r}/${s}`;console.log("\u2601\uFE0F Uploading to Supabase:",{filePath:l,bucket:nt.bucket});let c=bi(),{data:d,error:u}=await c.storage.from(nt.bucket).upload(l,a,{cacheControl:"3600",upsert:false,contentType:a.type});if(console.log("\u{1F4E4} Upload result:",{data:d,error:u}),u)throw console.error("\u274C Supabase upload error:",u),new Error(`Upload failed: ${u.message}`);console.log("\u2705 Upload successful, getting public URL...");let{data:{publicUrl:m}}=c.storage.from(nt.bucket).getPublicUrl(l);return console.log("\u2705 Public URL obtained:",m),{url:m,path:l,filename:e.name,size:a.size,type:a.type}}async function hi(e,t=1920,r=.85){console.log("\u{1F5BC}\uFE0F optimizeImage: Starting optimization");let a=e.type==="image/png"||e.type==="image/webp",o=a?e.type:"image/jpeg";return console.log("\u{1F5BC}\uFE0F optimizeImage: Output type:",o,"Transparency:",a),new Promise((i,n)=>{let s=setTimeout(()=>{console.error("\u23F1\uFE0F optimizeImage: Timeout after 30 seconds"),n(new Error("Image optimization timed out"));},3e4),l=new Image,c=document.createElement("canvas"),d=c.getContext("2d",{alpha:a});if(!d){clearTimeout(s),console.error("\u274C optimizeImage: Canvas context not available"),n(new Error("Canvas context not available"));return}console.log("\u{1F5BC}\uFE0F optimizeImage: Created canvas and context"),l.onload=()=>{console.log("\u{1F5BC}\uFE0F optimizeImage: Image loaded",{width:l.width,height:l.height});try{let u=Math.min(t/l.width,1);c.width=l.width*u,c.height=l.height*u,console.log("\u{1F5BC}\uFE0F optimizeImage: Resizing to",{width:c.width,height:c.height}),a&&d.clearRect(0,0,c.width,c.height),d.drawImage(l,0,0,c.width,c.height),console.log("\u{1F5BC}\uFE0F optimizeImage: Image drawn, converting to blob..."),c.toBlob(m=>{if(clearTimeout(s),!m){console.error("\u274C optimizeImage: Blob conversion failed"),n(new Error("Image optimization failed"));return}console.log("\u2705 optimizeImage: Blob created",{size:m.size,type:o});let p=new File([m],e.name,{type:o,lastModified:Date.now()});console.log("\u2705 optimizeImage: Optimization complete"),i(p);},o,r);}catch(u){clearTimeout(s),console.error("\u274C optimizeImage: Error during processing",u),n(u);}},l.onerror=u=>{clearTimeout(s),console.error("\u274C optimizeImage: Failed to load image",u),n(new Error("Failed to load image"));},console.log("\u{1F5BC}\uFE0F optimizeImage: Creating object URL and loading image..."),l.src=URL.createObjectURL(e);})}function Po(e){return e.size>nt.limits.maxSize?{valid:false,error:`File size exceeds maximum of ${nt.limits.maxSize/1024/1024}MB`}:nt.limits.allowedTypes.includes(e.type)?{valid:true}:{valid:false,error:"File type not allowed. Accepted: JPG, PNG, WebP"}}function Pr({field:e,value:t,error:r,onChange:a,businessId:o,formId:i,styling:n}){let s=useRef(null),[l,c]=useState(false),[d,u]=useState(null),m=n?.labelColor||"#374151",p=n?.fieldStyle||"outlined",w=(()=>{let g="w-full px-4 py-2 transition-all focus:outline-none";if(r)return `${g} bg-red-50 border border-red-300 rounded-lg focus:ring-2 focus:ring-red-500`;switch(p){case "filled":return `${g} bg-gray-100 border border-transparent rounded-lg focus:bg-white focus:ring-2 focus:ring-gray-900 focus:border-transparent`;case "underlined":return `${g} bg-transparent border-0 border-b-2 border-gray-300 rounded-none focus:border-gray-900 focus:ring-0 px-0`;case "minimal":return `${g} bg-transparent border border-gray-200 rounded-lg focus:border-gray-400 focus:ring-1 focus:ring-gray-300`;case "outlined":default:return `${g} bg-white border-2 border-gray-300 rounded-lg focus:border-gray-900 focus:ring-2 focus:ring-gray-900`}})(),N="block text-sm font-medium mb-1";if(e.type==="text"||e.type==="email"||e.type==="tel")return jsxs("div",{children:[jsxs("label",{htmlFor:e.id,className:N,style:{color:m},children:[e.label,e.required&&jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsx("input",{type:e.type,id:e.id,name:e.id,value:t||"",onChange:g=>a(g.target.value),placeholder:e.placeholder,required:e.required,className:w,style:{color:m}}),r&&jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]});if(e.type==="textarea")return jsxs("div",{children:[jsxs("label",{htmlFor:e.id,className:N,style:{color:m},children:[e.label,e.required&&jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsx("textarea",{id:e.id,name:e.id,value:t||"",onChange:g=>a(g.target.value),placeholder:e.placeholder,required:e.required,rows:4,className:w,style:{color:m}}),r&&jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]});if(e.type==="date")return jsxs("div",{children:[jsxs("label",{htmlFor:e.id,className:N,style:{color:m},children:[e.label,e.required&&jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsx("input",{type:"date",id:e.id,name:e.id,value:t||"",onChange:g=>a(g.target.value),required:e.required,className:w,style:{color:m}}),r&&jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]});if(e.type==="select"&&e.options)return jsxs("div",{children:[jsxs("label",{htmlFor:e.id,className:N,style:{color:m},children:[e.label,e.required&&jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsxs("select",{id:e.id,name:e.id,value:t||"",onChange:g=>a(g.target.value),required:e.required,className:w,style:{color:m},children:[jsx("option",{value:"",children:"Select an option..."}),e.options.map(g=>jsx("option",{value:g.value,children:g.label},g.value))]}),r&&jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]});if(e.type==="radio"&&e.options)return jsxs("div",{children:[jsxs("label",{className:N,style:{color:m},children:[e.label,e.required&&jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsx("div",{className:"space-y-2 mt-2",children:e.options.map(g=>jsxs("label",{className:"flex items-center space-x-2 cursor-pointer",children:[jsx("input",{type:"radio",name:e.id,value:g.value,checked:t===g.value,onChange:v=>a(v.target.value),required:e.required,className:"w-4 h-4 text-gray-900 focus:ring-gray-900 focus:ring-2"}),jsx("span",{className:"text-sm",style:{color:n?.labelColor||"#000000"},children:g.label})]},g.value))}),r&&jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]});if(e.type==="checkbox"&&e.options){let g=Array.isArray(t)?t:[],v=f=>{let C=g.includes(f)?g.filter(S=>S!==f):[...g,f];a(C);};return jsxs("div",{children:[jsxs("label",{className:N,style:{color:m},children:[e.label,e.required&&jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsx("div",{className:"space-y-2 mt-2",children:e.options.map(f=>jsxs("label",{className:"flex items-center space-x-2 cursor-pointer",children:[jsx("input",{type:"checkbox",name:`${e.id}[]`,value:f.value,checked:g.includes(f.value),onChange:()=>v(f.value),className:"w-4 h-4 text-gray-900 focus:ring-gray-900 focus:ring-2 rounded"}),jsx("span",{className:"text-sm",style:{color:n?.labelColor||"#000000"},children:f.label})]},f.value))}),r&&jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]})}if(e.type==="photo"){let g=async v=>{let f=v.target.files?.[0];if(!f)return;u(null);let C=Po(f);if(!C.valid){u(C.error||"Invalid file"),s.current&&(s.current.value="");return}if(!o||!i){u("Missing required configuration for file upload"),s.current&&(s.current.value="");return}c(true);try{let S=await To(f,o,i);a({url:S.url,filename:S.filename,size:S.size,type:S.type,uploadedAt:new Date().toISOString()}),u(null);}catch(S){console.error("Photo upload error:",S),u(S instanceof Error?S.message:"Upload failed"),s.current&&(s.current.value="");}finally{c(false);}};return jsxs("div",{children:[jsxs("label",{htmlFor:e.id,className:N,style:{color:m},children:[e.label,e.required&&jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsxs("div",{className:"mt-1",children:[jsx("input",{ref:s,type:"file",id:e.id,name:e.id,accept:"image/*",onChange:g,required:e.required,disabled:l,className:`block w-full text-sm text-gray-500
11
+ file:mr-4 file:py-2 file:px-4
12
+ file:rounded-lg file:border-0
13
+ file:text-sm file:font-medium
14
+ file:bg-gray-900 file:text-white
15
+ hover:file:bg-gray-800
16
+ file:cursor-pointer cursor-pointer
17
+ disabled:opacity-50 disabled:cursor-not-allowed`}),l&&jsxs("div",{className:"mt-2 flex items-center gap-2 text-xs text-blue-600",children:[jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-blue-600 border-t-transparent"}),jsx("span",{children:"Uploading..."})]}),t&&!l&&jsxs("div",{className:"mt-2 flex items-center gap-2",children:[jsx("svg",{className:"w-4 h-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),jsxs("span",{className:"text-xs text-gray-600",children:[t.filename," (",Math.round(t.size/1024),"KB)"]})]})]}),jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Max file size: 5MB \u2022 JPG, PNG, WebP"}),d&&jsx("p",{className:"mt-1 text-xs text-red-600",children:d}),r&&jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]})}if(e.type==="image"){let g=e,v=g.imageUrl;if(!v)return null;let f=g.imageSize||"medium",C=f==="full",S={small:"200px",medium:"400px",large:"600px"},x=C?"none":S[f]||S.medium,F={none:"0",sm:"0.25rem",md:"0.375rem",lg:"0.5rem",full:"9999px"},k=F[g.borderRadius]||F.md,I=C?"":{left:"mr-auto",center:"mx-auto",right:"ml-auto"}[g.imageAlignment||"center"],y={maxWidth:x,...C&&{width:"100%"}};return jsx("div",{className:I,style:y,children:jsx("img",{src:v,alt:e.label||"",className:"w-full h-auto",style:{borderRadius:k}})})}return null}function Lo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return useMemo(()=>a=>{t.forEach(o=>o(a));},t)}var ar=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ft(e){let t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Mr(e){return "nodeType"in e}function he(e){var t,r;return e?Ft(e)?e:Mr(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function $r(e){let{Document:t}=he(e);return e instanceof t}function _t(e){return Ft(e)?false:e instanceof he(e).HTMLElement}function Qn(e){return e instanceof he(e).SVGElement}function Dt(e){return e?Ft(e)?e.document:Mr(e)?$r(e)?e:_t(e)||Qn(e)?e.ownerDocument:document:document:document}var Be=ar?useLayoutEffect:useEffect;function Lr(e){let t=useRef(e);return Be(()=>{t.current=e;}),useCallback(function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return t.current==null?void 0:t.current(...a)},[])}function Bo(){let e=useRef(null),t=useCallback((a,o)=>{e.current=setInterval(a,o);},[]),r=useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null);},[]);return [t,r]}function qt(e,t){t===void 0&&(t=[e]);let r=useRef(e);return Be(()=>{r.current!==e&&(r.current=e);},t),r}function Vt(e,t){let r=useRef();return useMemo(()=>{let a=e(r.current);return r.current=a,a},[...t])}function ir(e){let t=Lr(e),r=useRef(null),a=useCallback(o=>{o!==r.current&&t?.(o,r.current),r.current=o;},[]);return [r,a]}function Br(e){let t=useRef();return useEffect(()=>{t.current=e;},[e]),t.current}var Kn={};function It(e,t){return useMemo(()=>{if(t)return t;let r=Kn[e]==null?0:Kn[e]+1;return Kn[e]=r,e+"-"+r},[e,t])}function zo(e){return function(t){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return a.reduce((i,n)=>{let s=Object.entries(n);for(let[l,c]of s){let d=i[l];d!=null&&(i[l]=d+e*c);}return i},{...t})}}var Et=zo(1),Yt=zo(-1);function wi(e){return "clientX"in e&&"clientY"in e}function sr(e){if(!e)return false;let{KeyboardEvent:t}=he(e.target);return t&&e instanceof t}function Ni(e){if(!e)return false;let{TouchEvent:t}=he(e.target);return t&&e instanceof t}function zr(e){if(Ni(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:r}=e.touches[0];return {x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:r}=e.changedTouches[0];return {x:t,y:r}}}return wi(e)?{x:e.clientX,y:e.clientY}:null}var ft=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:r}=e;return "translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:r}=e;return "scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return [ft.Translate.toString(e),ft.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:a}=e;return t+" "+r+"ms "+a}}}),Mo="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Oo(e){return e.matches(Mo)?e:e.querySelector(Mo)}var ki={display:"none"};function Uo(e){let{id:t,value:r}=e;return Ge.createElement("div",{id:t,style:ki},r)}function Wo(e){let{id:t,announcement:r,ariaLiveType:a="assertive"}=e,o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Ge.createElement("div",{id:t,style:o,role:"status","aria-live":a,"aria-atomic":true},r)}function jo(){let[e,t]=useState("");return {announce:useCallback(a=>{a!=null&&t(a);},[]),announcement:e}}var ta=createContext(null);function Ei(e){let t=useContext(ta);useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t]);}function Ri(){let[e]=useState(()=>new Set),t=useCallback(a=>(e.add(a),()=>e.delete(a)),[e]);return [useCallback(a=>{let{type:o,event:i}=a;e.forEach(n=>{var s;return (s=n[o])==null?void 0:s.call(n,i)});},[e]),t]}var Ti={draggable:`
18
+ To pick up a draggable item, press the space bar.
19
+ While dragging, use the arrow keys to move the item.
20
+ Press space again to drop the item in its new position, or press escape to cancel.
21
+ `},Pi={onDragStart(e){let{active:t}=e;return "Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return "Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Ai(e){let{announcements:t=Pi,container:r,hiddenTextDescribedById:a,screenReaderInstructions:o=Ti}=e,{announce:i,announcement:n}=jo(),s=It("DndLiveRegion"),[l,c]=useState(false);if(useEffect(()=>{c(true);},[]),Ei(useMemo(()=>({onDragStart(u){let{active:m}=u;i(t.onDragStart({active:m}));},onDragMove(u){let{active:m,over:p}=u;t.onDragMove&&i(t.onDragMove({active:m,over:p}));},onDragOver(u){let{active:m,over:p}=u;i(t.onDragOver({active:m,over:p}));},onDragEnd(u){let{active:m,over:p}=u;i(t.onDragEnd({active:m,over:p}));},onDragCancel(u){let{active:m,over:p}=u;i(t.onDragCancel({active:m,over:p}));}}),[i,t])),!l)return null;let d=Ge.createElement(Ge.Fragment,null,Ge.createElement(Uo,{id:a,value:o.draggable}),Ge.createElement(Wo,{id:s,announcement:n}));return r?createPortal(d,r):d}var oe;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable";})(oe||(oe={}));function Ur(){}function ra(e,t){return useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function na(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return useMemo(()=>[...t].filter(a=>a!=null),[...t])}var We=Object.freeze({x:0,y:0});function Mi(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function $i(e,t){let{data:{value:r}}=e,{data:{value:a}}=t;return r-a}function Li(e,t){let{data:{value:r}}=e,{data:{value:a}}=t;return a-r}function oa(e,t){if(!e||e.length===0)return null;let[r]=e;return r[t]}function _o(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}var aa=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:a}=e,o=_o(t,t.left,t.top),i=[];for(let n of a){let{id:s}=n,l=r.get(s);if(l){let c=Mi(_o(l),o);i.push({id:s,data:{droppableContainer:n,value:c}});}}return i.sort($i)};function Bi(e,t){let r=Math.max(t.top,e.top),a=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),n=o-a,s=i-r;if(a<o&&r<i){let l=t.width*t.height,c=e.width*e.height,d=n*s,u=d/(l+c-d);return Number(u.toFixed(4))}return 0}var zi=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:a}=e,o=[];for(let i of a){let{id:n}=i,s=r.get(n);if(s){let l=Bi(s,t);l>0&&o.push({id:n,data:{droppableContainer:i,value:l}});}}return o.sort(Li)};function Oi(e,t,r){return {...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function ia(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:We}function Hi(e){return function(r){for(var a=arguments.length,o=new Array(a>1?a-1:0),i=1;i<a;i++)o[i-1]=arguments[i];return o.reduce((n,s)=>({...n,top:n.top+e*s.y,bottom:n.bottom+e*s.y,left:n.left+e*s.x,right:n.right+e*s.x}),{...r})}}var Ui=Hi(1);function Wi(e){if(e.startsWith("matrix3d(")){let t=e.slice(9,-1).split(/, /);return {x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){let t=e.slice(7,-1).split(/, /);return {x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function ji(e,t,r){let a=Wi(t);if(!a)return e;let{scaleX:o,scaleY:i,x:n,y:s}=a,l=e.left-n-(1-o)*parseFloat(r),c=e.top-s-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return {width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}var _i={ignoreTransform:false};function Pt(e,t){t===void 0&&(t=_i);let r=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:c,transformOrigin:d}=he(e).getComputedStyle(e);c&&(r=ji(r,c,d));}let{top:a,left:o,width:i,height:n,bottom:s,right:l}=r;return {top:a,left:o,width:i,height:n,bottom:s,right:l}}function qo(e){return Pt(e,{ignoreTransform:true})}function qi(e){let t=e.innerWidth,r=e.innerHeight;return {top:0,left:0,right:t,bottom:r,width:t,height:r}}function Vi(e,t){return t===void 0&&(t=he(e).getComputedStyle(e)),t.position==="fixed"}function Yi(e,t){t===void 0&&(t=he(e).getComputedStyle(e));let r=/(auto|scroll|overlay)/;return ["overflow","overflowX","overflowY"].some(o=>{let i=t[o];return typeof i=="string"?r.test(i):false})}function _r(e,t){let r=[];function a(o){if(t!=null&&r.length>=t||!o)return r;if($r(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!_t(o)||Qn(o)||r.includes(o))return r;let i=he(e).getComputedStyle(o);return o!==e&&Yi(o,i)&&r.push(o),Vi(o,i)?r:a(o.parentNode)}return e?a(e):r}function sa(e){let[t]=_r(e,1);return t??null}function Zn(e){return !ar||!e?null:Ft(e)?e:Mr(e)?$r(e)||e===Dt(e).scrollingElement?window:_t(e)?e:null:null}function la(e){return Ft(e)?e.scrollX:e.scrollLeft}function ca(e){return Ft(e)?e.scrollY:e.scrollTop}function ro(e){return {x:la(e),y:ca(e)}}var ce;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward";})(ce||(ce={}));function da(e){return !ar||!e?false:e===document.scrollingElement}function ua(e){let t={x:0,y:0},r=da(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},a={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,n=e.scrollTop>=a.y,s=e.scrollLeft>=a.x;return {isTop:o,isLeft:i,isBottom:n,isRight:s,maxScroll:a,minScroll:t}}var Gi={x:.2,y:.2};function Xi(e,t,r,a,o){let{top:i,left:n,right:s,bottom:l}=r;a===void 0&&(a=10),o===void 0&&(o=Gi);let{isTop:c,isBottom:d,isLeft:u,isRight:m}=ua(e),p={x:0,y:0},b={x:0,y:0},w={height:t.height*o.y,width:t.width*o.x};return !c&&i<=t.top+w.height?(p.y=ce.Backward,b.y=a*Math.abs((t.top+w.height-i)/w.height)):!d&&l>=t.bottom-w.height&&(p.y=ce.Forward,b.y=a*Math.abs((t.bottom-w.height-l)/w.height)),!m&&s>=t.right-w.width?(p.x=ce.Forward,b.x=a*Math.abs((t.right-w.width-s)/w.width)):!u&&n<=t.left+w.width&&(p.x=ce.Backward,b.x=a*Math.abs((t.left+w.width-n)/w.width)),{direction:p,speed:b}}function Ki(e){if(e===document.scrollingElement){let{innerWidth:i,innerHeight:n}=window;return {top:0,left:0,right:i,bottom:n,width:i,height:n}}let{top:t,left:r,right:a,bottom:o}=e.getBoundingClientRect();return {top:t,left:r,right:a,bottom:o,width:e.clientWidth,height:e.clientHeight}}function ma(e){return e.reduce((t,r)=>Et(t,ro(r)),We)}function Ji(e){return e.reduce((t,r)=>t+la(r),0)}function Qi(e){return e.reduce((t,r)=>t+ca(r),0)}function Zi(e,t){if(t===void 0&&(t=Pt),!e)return;let{top:r,left:a,bottom:o,right:i}=t(e);sa(e)&&(o<=0||i<=0||r>=window.innerHeight||a>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"});}var es=[["x",["left","right"],Ji],["y",["top","bottom"],Qi]],cr=class{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let a=_r(r),o=ma(a);this.rect={...t},this.width=t.width,this.height=t.height;for(let[i,n,s]of es)for(let l of n)Object.defineProperty(this,l,{get:()=>{let c=s(a),d=o[i]-c;return this.rect[l]+d},enumerable:true});Object.defineProperty(this,"rect",{enumerable:false});}},Rt=class{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var a;return (a=this.target)==null?void 0:a.removeEventListener(...r)});},this.target=t;}add(t,r,a){var o;(o=this.target)==null||o.addEventListener(t,r,a),this.listeners.push([t,r,a]);}};function ts(e){let{EventTarget:t}=he(e);return e instanceof t?e:Dt(e)}function eo(e,t){let r=Math.abs(e.x),a=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+a**2)>t:"x"in t&&"y"in t?r>t.x&&a>t.y:"x"in t?r>t.x:"y"in t?a>t.y:false}var ze;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange";})(ze||(ze={}));function Vo(e){e.preventDefault();}function rs(e){e.stopPropagation();}var $;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab";})($||($={}));var pa={start:[$.Space,$.Enter],cancel:[$.Esc],end:[$.Space,$.Enter,$.Tab]},ns=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case $.Right:return {...r,x:r.x+25};case $.Left:return {...r,x:r.x-25};case $.Down:return {...r,y:r.y+25};case $.Up:return {...r,y:r.y-25}}},Wr=class{constructor(t){this.props=void 0,this.autoScrollEnabled=false,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;let{event:{target:r}}=t;this.props=t,this.listeners=new Rt(Dt(r)),this.windowListeners=new Rt(he(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach();}attach(){this.handleStart(),this.windowListeners.add(ze.Resize,this.handleCancel),this.windowListeners.add(ze.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ze.Keydown,this.handleKeyDown));}handleStart(){let{activeNode:t,onStart:r}=this.props,a=t.node.current;a&&Zi(a),r(We);}handleKeyDown(t){if(sr(t)){let{active:r,context:a,options:o}=this.props,{keyboardCodes:i=pa,coordinateGetter:n=ns,scrollBehavior:s="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}let{collisionRect:c}=a.current,d=c?{x:c.left,y:c.top}:We;this.referenceCoordinates||(this.referenceCoordinates=d);let u=n(t,{active:r,context:a.current,currentCoordinates:d});if(u){let m=Yt(u,d),p={x:0,y:0},{scrollableAncestors:b}=a.current;for(let w of b){let N=t.code,{isTop:g,isRight:v,isLeft:f,isBottom:C,maxScroll:S,minScroll:x}=ua(w),F=Ki(w),k={x:Math.min(N===$.Right?F.right-F.width/2:F.right,Math.max(N===$.Right?F.left:F.left+F.width/2,u.x)),y:Math.min(N===$.Down?F.bottom-F.height/2:F.bottom,Math.max(N===$.Down?F.top:F.top+F.height/2,u.y))},I=N===$.Right&&!v||N===$.Left&&!f,y=N===$.Down&&!C||N===$.Up&&!g;if(I&&k.x!==u.x){let h=w.scrollLeft+m.x,E=N===$.Right&&h<=S.x||N===$.Left&&h>=x.x;if(E&&!m.y){w.scrollTo({left:h,behavior:s});return}E?p.x=w.scrollLeft-h:p.x=N===$.Right?w.scrollLeft-S.x:w.scrollLeft-x.x,p.x&&w.scrollBy({left:-p.x,behavior:s});break}else if(y&&k.y!==u.y){let h=w.scrollTop+m.y,E=N===$.Down&&h<=S.y||N===$.Up&&h>=x.y;if(E&&!m.x){w.scrollTo({top:h,behavior:s});return}E?p.y=w.scrollTop-h:p.y=N===$.Down?w.scrollTop-S.y:w.scrollTop-x.y,p.y&&w.scrollBy({top:-p.y,behavior:s});break}}this.handleMove(t,Et(Yt(u,this.referenceCoordinates),p));}}}handleMove(t,r){let{onMove:a}=this.props;t.preventDefault(),a(r);}handleEnd(t){let{onEnd:r}=this.props;t.preventDefault(),this.detach(),r();}handleCancel(t){let{onCancel:r}=this.props;t.preventDefault(),this.detach(),r();}detach(){this.listeners.removeAll(),this.windowListeners.removeAll();}};Wr.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:a=pa,onActivation:o}=t,{active:i}=r,{code:n}=e.nativeEvent;if(a.start.includes(n)){let s=i.activatorNode.current;return s&&e.target!==s?false:(e.preventDefault(),o?.({event:e.nativeEvent}),true)}return false}}];function Yo(e){return !!(e&&"distance"in e)}function Go(e){return !!(e&&"delay"in e)}var dr=class{constructor(t,r,a){var o;a===void 0&&(a=ts(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=true,this.document=void 0,this.activated=false,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;let{event:i}=t,{target:n}=i;this.props=t,this.events=r,this.document=Dt(n),this.documentListeners=new Rt(this.document),this.listeners=new Rt(a),this.windowListeners=new Rt(he(n)),this.initialCoordinates=(o=zr(i))!=null?o:We,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach();}attach(){let{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:a}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:false}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(ze.Resize,this.handleCancel),this.windowListeners.add(ze.DragStart,Vo),this.windowListeners.add(ze.VisibilityChange,this.handleCancel),this.windowListeners.add(ze.ContextMenu,Vo),this.documentListeners.add(ze.Keydown,this.handleKeydown),r){if(a!=null&&a({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Go(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Yo(r)){this.handlePending(r);return}}this.handleStart();}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null);}handlePending(t,r){let{active:a,onPending:o}=this.props;o(a,t,this.initialCoordinates,r);}handleStart(){let{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=true,this.documentListeners.add(ze.Click,rs,{capture:true}),this.removeTextSelection(),this.documentListeners.add(ze.SelectionChange,this.removeTextSelection),r(t));}handleMove(t){var r;let{activated:a,initialCoordinates:o,props:i}=this,{onMove:n,options:{activationConstraint:s}}=i;if(!o)return;let l=(r=zr(t))!=null?r:We,c=Yt(o,l);if(!a&&s){if(Yo(s)){if(s.tolerance!=null&&eo(c,s.tolerance))return this.handleCancel();if(eo(c,s.distance))return this.handleStart()}if(Go(s)&&eo(c,s.tolerance))return this.handleCancel();this.handlePending(s,c);return}t.cancelable&&t.preventDefault(),n(l);}handleEnd(){let{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r();}handleCancel(){let{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r();}handleKeydown(t){t.code===$.Esc&&this.handleCancel();}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges();}},os={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}},Xt=class extends dr{constructor(t){let{event:r}=t,a=Dt(r.target);super(t,os,a);}};Xt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:a}=t;return !r.isPrimary||r.button!==0?false:(a?.({event:r}),true)}}];var as={move:{name:"mousemove"},end:{name:"mouseup"}},no;(function(e){e[e.RightClick=2]="RightClick";})(no||(no={}));var oo=class extends dr{constructor(t){super(t,as,Dt(t.event.target));}};oo.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:a}=t;return r.button===no.RightClick?false:(a?.({event:r}),true)}}];var to={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}},ao=class extends dr{constructor(t){super(t,to);}static setup(){return window.addEventListener(to.move.name,t,{capture:false,passive:false}),function(){window.removeEventListener(to.move.name,t);};function t(){}}};ao.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:a}=t,{touches:o}=r;return o.length>1?false:(a?.({event:r}),true)}}];var lr;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect";})(lr||(lr={}));var jr;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder";})(jr||(jr={}));function is(e){let{acceleration:t,activator:r=lr.Pointer,canScroll:a,draggingRect:o,enabled:i,interval:n=5,order:s=jr.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:m}=e,p=ls({delta:u,disabled:!i}),[b,w]=Bo(),N=useRef({x:0,y:0}),g=useRef({x:0,y:0}),v=useMemo(()=>{switch(r){case lr.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case lr.DraggableRect:return o}},[r,o,l]),f=useRef(null),C=useCallback(()=>{let x=f.current;if(!x)return;let F=N.current.x*g.current.x,k=N.current.y*g.current.y;x.scrollBy(F,k);},[]),S=useMemo(()=>s===jr.TreeOrder?[...c].reverse():c,[s,c]);useEffect(()=>{if(!i||!c.length||!v){w();return}for(let x of S){if(a?.(x)===false)continue;let F=c.indexOf(x),k=d[F];if(!k)continue;let{direction:I,speed:y}=Xi(x,k,v,t,m);for(let h of ["x","y"])p[h][I[h]]||(y[h]=0,I[h]=0);if(y.x>0||y.y>0){w(),f.current=x,b(C,n),N.current=y,g.current=I;return}}N.current={x:0,y:0},g.current={x:0,y:0},w();},[t,C,a,w,i,n,JSON.stringify(v),JSON.stringify(p),b,c,S,d,JSON.stringify(m)]);}var ss={x:{[ce.Backward]:false,[ce.Forward]:false},y:{[ce.Backward]:false,[ce.Forward]:false}};function ls(e){let{delta:t,disabled:r}=e,a=Br(t);return Vt(o=>{if(r||!a||!o)return ss;let i={x:Math.sign(t.x-a.x),y:Math.sign(t.y-a.y)};return {x:{[ce.Backward]:o.x[ce.Backward]||i.x===-1,[ce.Forward]:o.x[ce.Forward]||i.x===1},y:{[ce.Backward]:o.y[ce.Backward]||i.y===-1,[ce.Forward]:o.y[ce.Forward]||i.y===1}}},[r,t,a])}function cs(e,t){let r=t!=null?e.get(t):void 0,a=r?r.node.current:null;return Vt(o=>{var i;return t==null?null:(i=a??o)!=null?i:null},[a,t])}function ds(e,t){return useMemo(()=>e.reduce((r,a)=>{let{sensor:o}=a,i=o.activators.map(n=>({eventName:n.eventName,handler:t(n.handler,a)}));return [...r,...i]},[]),[e,t])}var ur;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging";})(ur||(ur={}));var io;(function(e){e.Optimized="optimized";})(io||(io={}));var Xo=new Map;function us(e,t){let{dragging:r,dependencies:a,config:o}=t,[i,n]=useState(null),{frequency:s,measure:l,strategy:c}=o,d=useRef(e),u=N(),m=qt(u),p=useCallback(function(g){g===void 0&&(g=[]),!m.current&&n(v=>v===null?g:v.concat(g.filter(f=>!v.includes(f))));},[m]),b=useRef(null),w=Vt(g=>{if(u&&!r)return Xo;if(!g||g===Xo||d.current!==e||i!=null){let v=new Map;for(let f of e){if(!f)continue;if(i&&i.length>0&&!i.includes(f.id)&&f.rect.current){v.set(f.id,f.rect.current);continue}let C=f.node.current,S=C?new cr(l(C),C):null;f.rect.current=S,S&&v.set(f.id,S);}return v}return g},[e,i,r,u,l]);return useEffect(()=>{d.current=e;},[e]),useEffect(()=>{u||p();},[r,u]),useEffect(()=>{i&&i.length>0&&n(null);},[JSON.stringify(i)]),useEffect(()=>{u||typeof s!="number"||b.current!==null||(b.current=setTimeout(()=>{p(),b.current=null;},s));},[s,u,p,...a]),{droppableRects:w,measureDroppableContainers:p,measuringScheduled:i!=null};function N(){switch(c){case ur.Always:return false;case ur.BeforeDragging:return r;default:return !r}}}function ga(e,t){return Vt(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function ms(e,t){return ga(e,t)}function ps(e){let{callback:t,disabled:r}=e,a=Lr(t),o=useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:i}=window;return new i(a)},[a,r]);return useEffect(()=>()=>o?.disconnect(),[o]),o}function qr(e){let{callback:t,disabled:r}=e,a=Lr(t),o=useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:i}=window;return new i(a)},[r]);return useEffect(()=>()=>o?.disconnect(),[o]),o}function gs(e){return new cr(Pt(e),e)}function Ko(e,t,r){t===void 0&&(t=gs);let[a,o]=useState(null);function i(){o(l=>{if(!e)return null;if(e.isConnected===false){var c;return (c=l??r)!=null?c:null}let d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d});}let n=ps({callback(l){if(e)for(let c of l){let{type:d,target:u}=c;if(d==="childList"&&u instanceof HTMLElement&&u.contains(e)){i();break}}}}),s=qr({callback:i});return Be(()=>{i(),e?(s?.observe(e),n?.observe(document.body,{childList:true,subtree:true})):(s?.disconnect(),n?.disconnect());},[e]),a}function fs(e){let t=ga(e);return ia(e,t)}var Jo=[];function ys(e){let t=useRef(e),r=Vt(a=>e?a&&a!==Jo&&e&&t.current&&e.parentNode===t.current.parentNode?a:_r(e):Jo,[e]);return useEffect(()=>{t.current=e;},[e]),r}function bs(e){let[t,r]=useState(null),a=useRef(e),o=useCallback(i=>{let n=Zn(i.target);n&&r(s=>s?(s.set(n,ro(n)),new Map(s)):null);},[]);return useEffect(()=>{let i=a.current;if(e!==i){n(i);let s=e.map(l=>{let c=Zn(l);return c?(c.addEventListener("scroll",o,{passive:true}),[c,ro(c)]):null}).filter(l=>l!=null);r(s.length?new Map(s):null),a.current=e;}return ()=>{n(e),n(i);};function n(s){s.forEach(l=>{let c=Zn(l);c?.removeEventListener("scroll",o);});}},[o,e]),useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,n)=>Et(i,n),We):ma(e):We,[e,t])}function Qo(e,t){t===void 0&&(t=[]);let r=useRef(null);return useEffect(()=>{r.current=null;},t),useEffect(()=>{let a=e!==We;a&&!r.current&&(r.current=e),!a&&r.current&&(r.current=null);},[e]),r.current?Yt(e,r.current):We}function hs(e){useEffect(()=>{if(!ar)return;let t=e.map(r=>{let{sensor:a}=r;return a.setup==null?void 0:a.setup()});return ()=>{for(let r of t)r?.();}},e.map(t=>{let{sensor:r}=t;return r}));}function xs(e,t){return useMemo(()=>e.reduce((r,a)=>{let{eventName:o,handler:i}=a;return r[o]=n=>{i(n,t);},r},{}),[e,t])}function fa(e){return useMemo(()=>e?qi(e):null,[e])}var Zo=[];function vs(e,t){t===void 0&&(t=Pt);let[r]=e,a=fa(r?he(r):null),[o,i]=useState(Zo);function n(){i(()=>e.length?e.map(l=>da(l)?a:new cr(t(l),l)):Zo);}let s=qr({callback:n});return Be(()=>{s?.disconnect(),n(),e.forEach(l=>s?.observe(l));},[e]),o}function ws(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return _t(t)?t:e}function Ns(e){let{measure:t}=e,[r,a]=useState(null),o=useCallback(c=>{for(let{target:d}of c)if(_t(d)){a(u=>{let m=t(d);return u?{...u,width:m.width,height:m.height}:m});break}},[t]),i=qr({callback:o}),n=useCallback(c=>{let d=ws(c);i?.disconnect(),d&&i?.observe(d),a(d?t(d):null);},[t,i]),[s,l]=ir(n);return useMemo(()=>({nodeRef:s,rect:r,setRef:l}),[r,s,l])}var Cs=[{sensor:Xt,options:{}},{sensor:Wr,options:{}}],Ss={current:{}},Hr={draggable:{measure:qo},droppable:{measure:qo,strategy:ur.WhileDragging,frequency:io.Optimized},dragOverlay:{measure:Pt}},Tt=class extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return !r})}getNodeFor(t){var r,a;return (r=(a=this.get(t))==null?void 0:a.node.current)!=null?r:void 0}},ks={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Tt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ur},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Hr,measureDroppableContainers:Ur,windowRect:null,measuringScheduled:false},Fs={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ur,draggableNodes:new Map,over:null,measureDroppableContainers:Ur},Vr=createContext(Fs),ya=createContext(ks);function Ds(){return {draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Tt}}}function Is(e,t){switch(t.type){case oe.DragStart:return {...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case oe.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case oe.DragEnd:case oe.DragCancel:return {...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case oe.RegisterDroppable:{let{element:r}=t,{id:a}=r,o=new Tt(e.droppable.containers);return o.set(a,r),{...e,droppable:{...e.droppable,containers:o}}}case oe.SetDroppableDisabled:{let{id:r,key:a,disabled:o}=t,i=e.droppable.containers.get(r);if(!i||a!==i.key)return e;let n=new Tt(e.droppable.containers);return n.set(r,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:n}}}case oe.UnregisterDroppable:{let{id:r,key:a}=t,o=e.droppable.containers.get(r);if(!o||a!==o.key)return e;let i=new Tt(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Es(e){let{disabled:t}=e,{active:r,activatorEvent:a,draggableNodes:o}=useContext(Vr),i=Br(a),n=Br(r?.id);return useEffect(()=>{if(!t&&!a&&i&&n!=null){if(!sr(i)||document.activeElement===i.target)return;let s=o.get(n);if(!s)return;let{activatorNode:l,node:c}=s;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(let d of [l.current,c.current]){if(!d)continue;let u=Oo(d);if(u){u.focus();break}}});}},[a,t,o,n,i]),null}function Rs(e,t){let{transform:r,...a}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...a}),r):r}function Ts(e){return useMemo(()=>({draggable:{...Hr.draggable,...e?.draggable},droppable:{...Hr.droppable,...e?.droppable},dragOverlay:{...Hr.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Ps(e){let{activeNode:t,measure:r,initialRect:a,config:o=true}=e,i=useRef(false),{x:n,y:s}=typeof o=="boolean"?{x:o,y:o}:o;Be(()=>{if(!n&&!s||!t){i.current=false;return}if(i.current||!a)return;let c=t?.node.current;if(!c||c.isConnected===false)return;let d=r(c),u=ia(d,a);if(n||(u.x=0),s||(u.y=0),i.current=true,Math.abs(u.x)>0||Math.abs(u.y)>0){let m=sa(c);m&&m.scrollBy({top:u.y,left:u.x});}},[t,n,s,a,r]);}var ba=createContext({...We,scaleX:1,scaleY:1}),yt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized";})(yt||(yt={}));var ha=memo(function(t){var r,a,o,i;let{id:n,accessibility:s,autoScroll:l=true,children:c,sensors:d=Cs,collisionDetection:u=zi,measuring:m,modifiers:p,...b}=t,w=useReducer(Is,void 0,Ds),[N,g]=w,[v,f]=Ri(),[C,S]=useState(yt.Uninitialized),x=C===yt.Initialized,{draggable:{active:F,nodes:k,translate:I},droppable:{containers:y}}=N,h=F!=null?k.get(F):null,E=useRef({initial:null,translated:null}),W=useMemo(()=>{var pe;return F!=null?{id:F,data:(pe=h?.data)!=null?pe:Ss,rect:E}:null},[F,h]),O=useRef(null),[D,T]=useState(null),[P,L]=useState(null),K=qt(b,Object.values(b)),Y=It("DndDescribedBy",n),Te=useMemo(()=>y.getEnabled(),[y]),H=Ts(m),{droppableRects:ie,measureDroppableContainers:Xe,measuringScheduled:ot}=us(Te,{dragging:x,dependencies:[I.x,I.y],config:H.droppable}),xe=cs(k,F),At=useMemo(()=>P?zr(P):null,[P]),je=La(),fe=ms(xe,H.draggable.measure);Ps({activeNode:F!=null?k.get(F):null,config:je.layoutShiftCompensation,initialRect:fe,measure:H.draggable.measure});let B=Ko(xe,H.draggable.measure,fe),Mt=Ko(xe?xe.parentElement:null),Ne=useRef({activatorEvent:null,active:null,activeNode:xe,collisionRect:null,collisions:null,droppableRects:ie,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:y,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),J=y.getNodeFor((r=Ne.current.over)==null?void 0:r.id),re=Ns({measure:H.dragOverlay.measure}),at=(a=re.nodeRef.current)!=null?a:xe,it=x?(o=re.rect)!=null?o:B:null,gr=!!(re.nodeRef.current&&re.rect),Kt=fs(gr?null:B),$t=fa(at?he(at):null),Ce=ys(x?J??xe:null),bt=vs(Ce),Lt=Rs(p,{transform:{x:I.x-Kt.x,y:I.y-Kt.y,scaleX:1,scaleY:1},activatorEvent:P,active:W,activeNodeRect:B,containerNodeRect:Mt,draggingNodeRect:it,over:Ne.current.over,overlayNodeRect:re.rect,scrollableAncestors:Ce,scrollableAncestorRects:bt,windowRect:$t}),fr=At?Et(At,I):null,yr=bs(Ce),Jt=Qo(yr),Zr=Qo(yr,[B]),st=Et(Lt,Jt),R=it?Ui(it,Lt):null,U=W&&R?u({active:W,collisionRect:R,droppableRects:ie,droppableContainers:Te,pointerCoordinates:fr}):null,_=oa(U,"id"),[ye,br]=useState(null),hr=gr?Lt:Et(Lt,Zr),se=Oi(hr,(i=ye?.rect)!=null?i:null,B),Pe=useRef(null),uo=useCallback((pe,Se)=>{let{sensor:ke,options:lt}=Se;if(O.current==null)return;let Ae=k.get(O.current);if(!Ae)return;let Fe=pe.nativeEvent,_e=new ke({active:O.current,activeNode:Ae,event:Fe,options:lt,context:Ne,onAbort(de){if(!k.get(de))return;let{onDragAbort:qe}=K.current,Ke={id:de};qe?.(Ke),v({type:"onDragAbort",event:Ke});},onPending(de,ct,qe,Ke){if(!k.get(de))return;let{onDragPending:Zt}=K.current,dt={id:de,constraint:ct,initialCoordinates:qe,offset:Ke};Zt?.(dt),v({type:"onDragPending",event:dt});},onStart(de){let ct=O.current;if(ct==null)return;let qe=k.get(ct);if(!qe)return;let{onDragStart:Ke}=K.current,Qt={activatorEvent:Fe,active:{id:ct,data:qe.data,rect:E}};unstable_batchedUpdates(()=>{Ke?.(Qt),S(yt.Initializing),g({type:oe.DragStart,initialCoordinates:de,active:ct}),v({type:"onDragStart",event:Qt}),T(Pe.current),L(Fe);});},onMove(de){g({type:oe.DragMove,coordinates:de});},onEnd:Bt(oe.DragEnd),onCancel:Bt(oe.DragCancel)});Pe.current=_e;function Bt(de){return async function(){let{active:qe,collisions:Ke,over:Qt,scrollAdjustedTranslate:Zt}=Ne.current,dt=null;if(qe&&Zt){let{cancelDrop:er}=K.current;dt={activatorEvent:Fe,active:qe,collisions:Ke,delta:Zt,over:Qt},de===oe.DragEnd&&typeof er=="function"&&await Promise.resolve(er(dt))&&(de=oe.DragCancel);}O.current=null,unstable_batchedUpdates(()=>{g({type:de}),S(yt.Uninitialized),br(null),T(null),L(null),Pe.current=null;let er=de===oe.DragEnd?"onDragEnd":"onDragCancel";if(dt){let en=K.current[er];en?.(dt),v({type:er,event:dt});}});}}},[k]),Aa=useCallback((pe,Se)=>(ke,lt)=>{let Ae=ke.nativeEvent,Fe=k.get(lt);if(O.current!==null||!Fe||Ae.dndKit||Ae.defaultPrevented)return;let _e={active:Fe};pe(ke,Se.options,_e)===true&&(Ae.dndKit={capturedBy:Se.sensor},O.current=lt,uo(ke,Se));},[k,uo]),mo=ds(d,Aa);hs(d),Be(()=>{B&&C===yt.Initializing&&S(yt.Initialized);},[B,C]),useEffect(()=>{let{onDragMove:pe}=K.current,{active:Se,activatorEvent:ke,collisions:lt,over:Ae}=Ne.current;if(!Se||!ke)return;let Fe={active:Se,activatorEvent:ke,collisions:lt,delta:{x:st.x,y:st.y},over:Ae};unstable_batchedUpdates(()=>{pe?.(Fe),v({type:"onDragMove",event:Fe});});},[st.x,st.y]),useEffect(()=>{let{active:pe,activatorEvent:Se,collisions:ke,droppableContainers:lt,scrollAdjustedTranslate:Ae}=Ne.current;if(!pe||O.current==null||!Se||!Ae)return;let{onDragOver:Fe}=K.current,_e=lt.get(_),Bt=_e&&_e.rect.current?{id:_e.id,rect:_e.rect.current,data:_e.data,disabled:_e.disabled}:null,de={active:pe,activatorEvent:Se,collisions:ke,delta:{x:Ae.x,y:Ae.y},over:Bt};unstable_batchedUpdates(()=>{br(Bt),Fe?.(de),v({type:"onDragOver",event:de});});},[_]),Be(()=>{Ne.current={activatorEvent:P,active:W,activeNode:xe,collisionRect:R,collisions:U,droppableRects:ie,draggableNodes:k,draggingNode:at,draggingNodeRect:it,droppableContainers:y,over:ye,scrollableAncestors:Ce,scrollAdjustedTranslate:st},E.current={initial:it,translated:R};},[W,xe,U,R,k,at,it,ie,y,ye,Ce,st]),is({...je,delta:I,draggingRect:R,pointerCoordinates:fr,scrollableAncestors:Ce,scrollableAncestorRects:bt});let Ma=useMemo(()=>({active:W,activeNode:xe,activeNodeRect:B,activatorEvent:P,collisions:U,containerNodeRect:Mt,dragOverlay:re,draggableNodes:k,droppableContainers:y,droppableRects:ie,over:ye,measureDroppableContainers:Xe,scrollableAncestors:Ce,scrollableAncestorRects:bt,measuringConfiguration:H,measuringScheduled:ot,windowRect:$t}),[W,xe,B,P,U,Mt,re,k,y,ie,ye,Xe,Ce,bt,H,ot,$t]),$a=useMemo(()=>({activatorEvent:P,activators:mo,active:W,activeNodeRect:B,ariaDescribedById:{draggable:Y},dispatch:g,draggableNodes:k,over:ye,measureDroppableContainers:Xe}),[P,mo,W,B,g,Y,k,ye,Xe]);return Ge.createElement(ta.Provider,{value:f},Ge.createElement(Vr.Provider,{value:$a},Ge.createElement(ya.Provider,{value:Ma},Ge.createElement(ba.Provider,{value:se},c)),Ge.createElement(Es,{disabled:s?.restoreFocus===false})),Ge.createElement(Ai,{...s,hiddenTextDescribedById:Y}));function La(){let pe=D?.autoScrollEnabled===false,Se=typeof l=="object"?l.enabled===false:l===false,ke=x&&!pe&&!Se;return typeof l=="object"?{...l,enabled:ke}:{enabled:ke}}}),As=createContext(null),ea="button",Ms="Draggable";function xa(e){let{id:t,data:r,disabled:a=false,attributes:o}=e,i=It(Ms),{activators:n,activatorEvent:s,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:m}=useContext(Vr),{role:p=ea,roleDescription:b="draggable",tabIndex:w=0}=o??{},N=l?.id===t,g=useContext(N?ba:As),[v,f]=ir(),[C,S]=ir(),x=xs(n,t),F=qt(r);Be(()=>(u.set(t,{id:t,key:i,node:v,activatorNode:C,data:F}),()=>{let I=u.get(t);I&&I.key===i&&u.delete(t);}),[u,t]);let k=useMemo(()=>({role:p,tabIndex:w,"aria-disabled":a,"aria-pressed":N&&p===ea?true:void 0,"aria-roledescription":b,"aria-describedby":d.draggable}),[a,p,w,N,b,d.draggable]);return {active:l,activatorEvent:s,activeNodeRect:c,attributes:k,isDragging:N,listeners:a?void 0:x,node:v,over:m,setNodeRef:f,setActivatorNodeRef:S,transform:g}}function va(){return useContext(ya)}var $s="Droppable",Ls={timeout:25};function wa(e){let{data:t,disabled:r=false,id:a,resizeObserverConfig:o}=e,i=It($s),{active:n,dispatch:s,over:l,measureDroppableContainers:c}=useContext(Vr),d=useRef({disabled:r}),u=useRef(false),m=useRef(null),p=useRef(null),{disabled:b,updateMeasurementsFor:w,timeout:N}={...Ls,...o},g=qt(w??a),v=useCallback(()=>{if(!u.current){u.current=true;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{c(Array.isArray(g.current)?g.current:[g.current]),p.current=null;},N);},[N]),f=qr({callback:v,disabled:b||!n}),C=useCallback((k,I)=>{f&&(I&&(f.unobserve(I),u.current=false),k&&f.observe(k));},[f]),[S,x]=ir(C),F=qt(t);return useEffect(()=>{!f||!S.current||(f.disconnect(),u.current=false,f.observe(S.current));},[S,f]),useEffect(()=>(s({type:oe.RegisterDroppable,element:{id:a,key:i,disabled:r,node:S,rect:m,data:F}}),()=>s({type:oe.UnregisterDroppable,key:i,id:a})),[a]),useEffect(()=>{r!==d.current.disabled&&(s({type:oe.SetDroppableDisabled,id:a,key:i,disabled:r}),d.current.disabled=r);},[a,i,r,s]),{active:n,rect:m,isOver:l?.id===a,node:S,over:l,setNodeRef:x}}function Ca(e,t,r){let a=e.slice();return a.splice(r<0?a.length+r:r,0,a.splice(t,1)[0]),a}function Os(e,t){return e.reduce((r,a,o)=>{let i=t.get(a);return i&&(r[o]=i),r},Array(e.length))}function Yr(e){return e!==null&&e>=0}function Hs(e,t){if(e===t)return true;if(e.length!==t.length)return false;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return false;return true}function Us(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}var Sa=e=>{let{rects:t,activeIndex:r,overIndex:a,index:o}=e,i=Ca(t,a,r),n=t[o],s=i[o];return !s||!n?null:{x:s.left-n.left,y:s.top-n.top,scaleX:s.width/n.width,scaleY:s.height/n.height}};var Gr={scaleX:1,scaleY:1},ka=e=>{var t;let{activeIndex:r,activeNodeRect:a,index:o,rects:i,overIndex:n}=e,s=(t=i[r])!=null?t:a;if(!s)return null;if(o===r){let c=i[n];return c?{x:0,y:r<n?c.top+c.height-(s.top+s.height):c.top-s.top,...Gr}:null}let l=Ws(i,o,r);return o>r&&o<=n?{x:0,y:-s.height-l,...Gr}:o<r&&o>=n?{x:0,y:s.height+l,...Gr}:{x:0,y:0,...Gr}};function Ws(e,t,r){let a=e[t],o=e[t-1],i=e[t+1];return a?r<t?o?a.top-(o.top+o.height):i?i.top-(a.top+a.height):0:i?i.top-(a.top+a.height):o?a.top-(o.top+o.height):0:0}var Fa="Sortable",Da=Ge.createContext({activeIndex:-1,containerId:Fa,disableTransforms:false,items:[],overIndex:-1,useDragOverlay:false,sortedRects:[],strategy:Sa,disabled:{draggable:false,droppable:false}});function Ia(e){let{children:t,id:r,items:a,strategy:o=Sa,disabled:i=false}=e,{active:n,dragOverlay:s,droppableRects:l,over:c,measureDroppableContainers:d}=va(),u=It(Fa,r),m=s.rect!==null,p=useMemo(()=>a.map(x=>typeof x=="object"&&"id"in x?x.id:x),[a]),b=n!=null,w=n?p.indexOf(n.id):-1,N=c?p.indexOf(c.id):-1,g=useRef(p),v=!Hs(p,g.current),f=N!==-1&&w===-1||v,C=Us(i);Be(()=>{v&&b&&d(p);},[v,p,b,d]),useEffect(()=>{g.current=p;},[p]);let S=useMemo(()=>({activeIndex:w,containerId:u,disabled:C,disableTransforms:f,items:p,overIndex:N,useDragOverlay:m,sortedRects:Os(p,l),strategy:o}),[w,u,C.draggable,C.droppable,f,p,N,l,m,o]);return Ge.createElement(Da.Provider,{value:S},t)}var js=e=>{let{id:t,items:r,activeIndex:a,overIndex:o}=e;return Ca(r,a,o).indexOf(t)},_s=e=>{let{containerId:t,isSorting:r,wasDragging:a,index:o,items:i,newIndex:n,previousItems:s,previousContainerId:l,transition:c}=e;return !c||!a||s!==i&&o===n?false:r?true:n!==o&&t===l},qs={duration:200,easing:"ease"},Ea="transform",Vs=ft.Transition.toString({property:Ea,duration:0,easing:"linear"}),Ys={roleDescription:"sortable"};function Gs(e){let{disabled:t,index:r,node:a,rect:o}=e,[i,n]=useState(null),s=useRef(r);return Be(()=>{if(!t&&r!==s.current&&a.current){let l=o.current;if(l){let c=Pt(a.current,{ignoreTransform:true}),d={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(d.x||d.y)&&n(d);}}r!==s.current&&(s.current=r);},[t,r,a,o]),useEffect(()=>{i&&n(null);},[i]),i}function Ra(e){let{animateLayoutChanges:t=_s,attributes:r,disabled:a,data:o,getNewIndex:i=js,id:n,strategy:s,resizeObserverConfig:l,transition:c=qs}=e,{items:d,containerId:u,activeIndex:m,disabled:p,disableTransforms:b,sortedRects:w,overIndex:N,useDragOverlay:g,strategy:v}=useContext(Da),f=Xs(a,p),C=d.indexOf(n),S=useMemo(()=>({sortable:{containerId:u,index:C,items:d},...o}),[u,o,C,d]),x=useMemo(()=>d.slice(d.indexOf(n)),[d,n]),{rect:F,node:k,isOver:I,setNodeRef:y}=wa({id:n,data:S,disabled:f.droppable,resizeObserverConfig:{updateMeasurementsFor:x,...l}}),{active:h,activatorEvent:E,activeNodeRect:W,attributes:O,setNodeRef:D,listeners:T,isDragging:P,over:L,setActivatorNodeRef:K,transform:Y}=xa({id:n,data:S,attributes:{...Ys,...r},disabled:f.draggable}),Te=Lo(y,D),H=!!h,ie=H&&!b&&Yr(m)&&Yr(N),Xe=!g&&P,ot=Xe&&ie?Y:null,At=ie?ot??(s??v)({rects:w,activeNodeRect:W,activeIndex:m,overIndex:N,index:C}):null,je=Yr(m)&&Yr(N)?i({id:n,items:d,activeIndex:m,overIndex:N}):C,fe=h?.id,B=useRef({activeId:fe,items:d,newIndex:je,containerId:u}),Mt=d!==B.current.items,Ne=t({active:h,containerId:u,isDragging:P,isSorting:H,id:n,index:C,items:d,newIndex:B.current.newIndex,previousItems:B.current.items,previousContainerId:B.current.containerId,transition:c,wasDragging:B.current.activeId!=null}),J=Gs({disabled:!Ne,index:C,node:k,rect:F});return useEffect(()=>{H&&B.current.newIndex!==je&&(B.current.newIndex=je),u!==B.current.containerId&&(B.current.containerId=u),d!==B.current.items&&(B.current.items=d);},[H,je,u,d]),useEffect(()=>{if(fe===B.current.activeId)return;if(fe!=null&&B.current.activeId==null){B.current.activeId=fe;return}let at=setTimeout(()=>{B.current.activeId=fe;},50);return ()=>clearTimeout(at)},[fe]),{active:h,activeIndex:m,attributes:O,data:S,rect:F,index:C,newIndex:je,items:d,isOver:I,isSorting:H,isDragging:P,listeners:T,node:k,overIndex:N,over:L,setNodeRef:Te,setActivatorNodeRef:K,setDroppableNodeRef:y,setDraggableNodeRef:D,transform:J??At,transition:re()};function re(){if(J||Mt&&B.current.newIndex===C)return Vs;if(!(Xe&&!sr(E)||!c)&&(H||Ne))return ft.Transition.toString({...c,property:Ea})}}function Xs(e,t){var r,a;return typeof e=="boolean"?{draggable:e,droppable:false}:{draggable:(r=e?.draggable)!=null?r:t.draggable,droppable:(a=e?.droppable)!=null?a:t.droppable}}[$.Down,$.Right,$.Up,$.Left];function Js({field:e,value:t,error:r,onChange:a,businessId:o,formId:i,styling:n}){let{attributes:s,listeners:l,setNodeRef:c,transform:d,transition:u,isDragging:m}=Ra({id:e.id}),p={transform:ft.Transform.toString(d),transition:u,opacity:m?.5:1};return jsxs("div",{ref:c,style:p,className:`relative group ${m?"z-50":""}`,children:[jsx("div",{...s,...l,className:"absolute -left-8 top-1/2 -translate-y-1/2 z-50 opacity-0 group-hover:opacity-100 transition-opacity cursor-grab active:cursor-grabbing",onClick:b=>b.stopPropagation(),children:jsx("div",{className:"flex items-center gap-1 bg-[#BCB4FF] text-black px-1.5 py-1 rounded-md shadow-lg border border-black/10",children:jsx(GripVertical,{className:"w-3 h-3"})})}),jsx("div",{className:"absolute inset-0 pointer-events-none transition-all rounded-lg group-hover:border border-[#BCB4FF]/30"}),jsx("div",{style:{pointerEvents:"auto"},children:jsx(Pr,{field:e,value:t,error:r,onChange:a,businessId:o,formId:i,styling:n})})]})}function Jr({block:e,formData:t,errors:r,onChange:a,businessId:o,formId:i,styling:n,previewMode:s,onFieldReorder:l}){let c=na(ra(Xt,{activationConstraint:{distance:8}})),d=u=>{let{active:m,over:p}=u;if(p&&m.id!==p.id&&l&&e.fields){let b=e.fields.findIndex(N=>N.id===m.id),w=e.fields.findIndex(N=>N.id===p.id);l(e.id,b,w);}};if(e.type==="section"){let u=e.fields||[];return s&&l?jsxs("div",{className:"border rounded-lg p-6",style:{backgroundColor:n?.sectionBackground||"#FFFFFF",borderColor:n?.fieldBorder?`${n.fieldBorder}30`:"#E5E7EB"},children:[e.title&&jsx("h2",{className:"text-xl font-semibold mb-2",style:{color:n?.labelColor||"#000000"},children:e.title}),e.description&&jsx("p",{className:"text-sm mb-6",style:{color:n?.textColor||"#000000"},children:e.description}),jsx(ha,{sensors:c,collisionDetection:aa,onDragEnd:d,children:jsx(Ia,{items:u.map(m=>m.id),strategy:ka,children:jsx("div",{className:"space-y-4",children:u.map(m=>jsx(Js,{field:m,value:t[m.id],error:r[m.id],onChange:p=>a(m.id,p,m),businessId:o,formId:i,styling:n},m.id))})})})]}):jsxs("div",{className:"border rounded-lg p-6",style:{backgroundColor:n?.sectionBackground||"#FFFFFF",borderColor:n?.fieldBorder?`${n.fieldBorder}30`:"#E5E7EB"},children:[e.title&&jsx("h2",{className:"text-xl font-semibold mb-2",style:{color:n?.labelColor||"#000000"},children:e.title}),e.description&&jsx("p",{className:"text-sm mb-6",style:{color:n?.textColor||"#000000"},children:e.description}),jsx("div",{className:"space-y-4",children:u.map(m=>jsx(Pr,{field:m,value:t[m.id],error:r[m.id],onChange:p=>a(m.id,p,m),businessId:o,formId:i,styling:n},m.id))})]})}if(e.type==="text"){let u={left:"text-left",center:"text-center",right:"text-right"}[e.alignment||"left"];return jsx("div",{className:`prose prose-gray max-w-none ${u}`,children:jsx("p",{className:"whitespace-pre-wrap",style:{color:n?.textColor||"#000000"},children:e.content})})}if(e.type==="image"&&e.imageUrl){let u=e.imageSize||"medium",m=u==="full",p=m?"":{left:"mr-auto",center:"mx-auto",right:"ml-auto"}[e.alignment||"center"],b={small:"300px",medium:"500px",large:"700px"},w=m?"none":b[u]||b.medium,N={none:"0",sm:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem",full:"9999px"},g=N[e.borderRadius]||N.lg,v={maxWidth:w,...m&&{width:"100vw",marginLeft:"50%",transform:"translateX(-50%)"}};return jsx("div",{className:p,style:v,children:jsx("img",{src:e.imageUrl,alt:"",className:"w-full h-auto",style:{borderRadius:g,objectFit:"cover"}})})}return null}function co(e,t){if(t.required){if(e==null||e==="")return {isValid:false,error:`${t.label} is required`};if(Array.isArray(e)&&e.length===0)return {isValid:false,error:`Please select at least one ${t.label.toLowerCase()}`};if(t.type==="photo"&&!e.data)return {isValid:false,error:`${t.label} is required`}}if(t.type==="email"&&e&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))return {isValid:false,error:"Please enter a valid email address"};if(t.type==="tel"&&e&&(!/^[\d\s\-\+\(\)]+$/.test(e)||e.replace(/\D/g,"").length<10))return {isValid:false,error:"Please enter a valid phone number"};if(t.type==="date"&&e){let r=new Date(e);if(isNaN(r.getTime()))return {isValid:false,error:"Please enter a valid date"}}return {isValid:true}}function Ta(e,t){let r={},a=true;return t.forEach(o=>{let i=co(e[o.id],o);!i.isValid&&i.error&&(r[o.id]=i.error,a=false);}),{isValid:a,errors:r}}function Au(e){let t={};return Object.keys(e).forEach(r=>{let a=e[r];typeof a=="string"?t[r]=a.trim():(Array.isArray(a)||a&&typeof a=="object"&&a.data,t[r]=a);}),t}function Pa({form:e,businessId:t,onSuccess:r}){let[a,o]=useState({}),[i,n]=useState({}),[s,l]=useState(false),[c,d]=useState(false),[u,m]=useState(null),p=(v,f,C)=>{if(o(S=>({...S,[v]:f})),i[v]){let S=co(f,C);n(x=>{let F={...x};return S.isValid?delete F[v]:F[v]=S.error||"",F});}},b=async v=>{v.preventDefault(),m(null);let f=[];e.settings.blocks.forEach(S=>{S.type==="section"&&S.fields&&f.push(...S.fields);});let C=Ta(a,f);if(!C.isValid){n(C.errors);return}l(true);try{let x=typeof window<"u"&&import.meta.env?"/api/forms/submit":`/api/studio/forms/${t}/${e.slug}/submit`,F=await fetch(x,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({formId:e.id,slug:e.slug,data:a})});if(!F.ok){let k=await F.json();throw new Error(k.message||"Failed to submit form")}d(!0),o({}),n({}),r&&r();}catch(S){console.error("Form submission error:",S),m(S.message||"Failed to submit form. Please try again.");}finally{l(false);}};if(c)return jsx("div",{className:"max-w-2xl mx-auto px-4 py-12",children:jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-8 text-center",children:[jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:jsx("svg",{className:"w-8 h-8 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),jsx("h3",{className:"text-xl font-semibold mb-2",style:{color:e.settings.styling?.labelColor||"#000000"},children:"Success!"}),jsx("p",{style:{color:e.settings.styling?.textColor||"#000000"},children:e.settings.successMessage}),jsx("button",{onClick:()=>d(false),className:"mt-6 px-4 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 transition-colors",children:"Submit Another Response"})]})});let w=e.settings.styling?.alignment||"left",N=w==="center"?"text-center":w==="right"?"text-right":"text-left",g=e.settings.styling?.buttonColor||"#CAC426";return jsxs("div",{className:"max-w-2xl mx-auto px-4 py-12",children:[jsxs("div",{className:`mb-8 ${N}`,children:[jsx("h1",{className:"text-3xl font-bold mb-2",style:{color:e.settings.styling?.textColor||"#000000"},children:e.settings.title}),e.settings.description&&jsx("p",{style:{color:e.settings.styling?.textColor||"#000000"},children:e.settings.description})]}),jsxs("form",{onSubmit:b,className:"space-y-8",children:[e.settings.blocks.map(v=>jsx(Jr,{block:v,formData:a,errors:i,onChange:p,businessId:t,formId:e.id,styling:e.settings.styling},v.id)),u&&jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:jsx("p",{className:"text-sm text-red-600",children:u})}),jsx("div",{className:"pt-6",children:jsx("button",{type:"submit",disabled:s,className:"w-full px-6 py-3 text-white rounded-lg disabled:opacity-50 disabled:cursor-not-allowed transition-all font-medium hover:opacity-90",style:{backgroundColor:g},children:s?"Submitting...":e.settings.submitButtonText})})]})]})}export{dn as About,Wn as AddonsSelection,Cn as BeforeAfter,Ro as BookingFlow,En as BookingSection,jn as BottomSheet,Io as CYCLE_PHASES,Yn as Confirmation,yn as Contact,Vn as ContactForm,ui as CycleAwareDateSelection,nr as DateSelection,$n as FAQSection,wn as FeatureContent,on as FeaturedLink,In as FixedInfoCard,Jr as FormBlock,Pa as FormRenderer,mn as Gallery,nn as Header,cn as Hero,Rr as HoldTimer,Mn as ImageSection,Fn as InstagramFeed,sn as LinkList,An as LocationMap,tn as Logo,vn as MinimalFooter,bn as MinimalHeader,xn as MinimalNavigation,Bn as Navbar,Sn as PricingTable,Pn as ScrollingTextDivider,gi as SectionRenderer,On as ServiceSelection,un as ServicesPreview,ln as SocialBar,fn as Team,gn as Testimonials,zn as TextSection,Hn as TimeSelection,Rn as VideoSection,rr as animations,ge as createEntranceAnimation,Lc as createStaggerAnimation,Ac as getAnimationDuration,Qa as getFadeVariants,Ja as getSlideVariants,Mc as getTransitionVariants,Au as sanitizeFormData,$c as shouldReduceMotion,co as validateField,Ta as validateForm};//# sourceMappingURL=index.mjs.map
22
+ //# sourceMappingURL=index.mjs.map