diff --git a/app/Http/Controllers/ShiftController.php b/app/Http/Controllers/ShiftController.php index 6d2aea159..3acad2ea0 100644 --- a/app/Http/Controllers/ShiftController.php +++ b/app/Http/Controllers/ShiftController.php @@ -298,11 +298,13 @@ class ShiftController extends Controller }); $departments = \App\Models\Department::select('id', 'name')->get(); + $allShifts = \App\Models\Shift::whereIn('created_by', getCompanyAndUsersId())->where('status', 'active')->get(); return Inertia::render('hr/shifts/calendar', [ 'users' => $users, 'dates' => $dates, 'departments' => $departments, + 'shifts' => $allShifts, 'filters' => [ 'month' => $month, 'year' => $year, @@ -313,4 +315,41 @@ class ShiftController extends Controller } return redirect()->back()->with('error', __('Permission Denied.')); } + + public function assignShift(Request $request) + { + if (Auth::user()->can('manage-shifts')) { + $validated = $request->validate([ + 'employee_id' => 'required|exists:users,id', + 'start_date' => 'required|date', + 'end_date' => 'required|date|after_or_equal:start_date', + 'shift_id' => 'required_without:is_rest_day|nullable|exists:shifts,id', + 'is_rest_day' => 'boolean', + ]); + + $startDate = \Carbon\Carbon::parse($validated['start_date']); + $endDate = \Carbon\Carbon::parse($validated['end_date']); + + $period = \Carbon\CarbonPeriod::create($startDate, $endDate); + + foreach ($period as $date) { + \App\Models\AttendanceRecord::updateOrCreate( + [ + 'employee_id' => $validated['employee_id'], + 'date' => $date->format('Y-m-d'), + 'created_by' => creatorId(), + ], + [ + 'shift_id' => $validated['is_rest_day'] ? null : $validated['shift_id'], + 'is_rest_day' => $validated['is_rest_day'] ?? false, + 'status' => $validated['is_rest_day'] ? 'absent' : 'present', // Default status for scheduled shift + ] + ); + } + + return redirect()->back()->with('success', __('Shifts assigned successfully.')); + } + + return redirect()->back()->with('error', __('Permission Denied.')); + } } diff --git a/public/build/assets/AboutUs-CfDijVZg.js b/public/build/assets/AboutUs-DAnCcO_u.js similarity index 94% rename from public/build/assets/AboutUs-CfDijVZg.js rename to public/build/assets/AboutUs-DAnCcO_u.js index 671bd03e3..9c5acbd1f 100644 --- a/public/build/assets/AboutUs-CfDijVZg.js +++ b/public/build/assets/AboutUs-DAnCcO_u.js @@ -1 +1 @@ -import{r as g,j as e}from"./ui-Z445SNHD.js";import{u as R}from"./useScrollAnimation-B_bDsIuD.js";import{u as S,g as _}from"./app-WRyxGXuF.js";import{Z as A}from"./zap-DvesHlOn.js";import{U as z}from"./users-BhT6-B6i.js";import{S as M}from"./shield-CsW-x7Up.js";import{S as $}from"./star-BvPMDrlk.js";import{L as E}from"./lightbulb-BhJNx4Pg.js";import{A as I}from"./award-lmrljHg1.js";import{H as T}from"./heart-f5hklX-a.js";import{T as b}from"./target-ClTOdyc0.js";/* empty css *//* empty css */import"./utils-BWxnHGCV.js";const U={target:b,heart:T,award:I,lightbulb:E,star:$,shield:M,users:z,zap:A};function X({settings:L,sectionData:t,brandColor:p="#3b82f6"}){const{t:s}=S(),{ref:j,isVisible:h}=R(),r=_(t.image),v=t.background_color||"#f9fafb",f=t.layout||"image-right",n=t.image_position||"right",i=t.parallax===!0,o=g.useRef(null),[m,y]=g.useState(0);g.useEffect(()=>{if(!i||!r)return;const a=()=>{if(!o.current)return;const l=o.current.getBoundingClientRect(),c=l.top+l.height/2-window.innerHeight/2;y(c*.2)};return window.addEventListener("scroll",a,{passive:!0}),a(),()=>window.removeEventListener("scroll",a)},[i,r]);const N=[{icon:"target",title:s("Our Mission"),description:s("To empower businesses with smart HR solutions that simplify employee management, payroll, attendance, and performance tracking.")},{icon:"heart",title:s("Our Values"),description:s("We prioritize innovation, efficiency, and creating a workplace ecosystem that nurtures growth and collaboration.")},{icon:"award",title:s("Our Commitment"),description:s("Providing reliable, intuitive HR tools backed by exceptional support to help organizations optimize their workforce.")},{icon:"lightbulb",title:s("Our Vision"),description:s("A future where HR management is fully automated, transparent, and enables organizations to focus on people, not paperwork.")}],w=[{value:s("3+ Years"),label:s("Experience"),color:"blue"},{value:"500+",label:s("Companies Served"),color:"green"},{value:"20K+",label:s("Employees Managed"),color:"purple"}],H=t.values&&t.values.length>0?t.values:N,d=t.stats&&t.stats.length>0?t.stats:w,x=()=>e.jsx("div",{className:"bg-white rounded-xl p-8 border border-gray-200 h-96 flex items-center justify-center overflow-hidden",children:r?e.jsx("img",{src:r,alt:"About Us",className:"max-w-full max-h-full object-contain rounded-lg",style:i?{transform:`translateY(${m}px)`,transition:"transform 0.1s linear"}:void 0}):e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-24 h-24 bg-gray-100 rounded-full mx-auto mb-6 flex items-center justify-center",children:e.jsx("span",{className:"text-3xl",children:t.image_icon||"🚀"})}),e.jsx("h4",{className:"text-xl font-semibold text-gray-900 mb-2",children:t.image_title||s("Innovation Driven")}),e.jsx("p",{className:"text-gray-600",children:t.image_subtitle||s("Building the future of networking")})]})}),u=({centered:a=!1})=>e.jsxs("div",{className:a?"text-center":"",children:[e.jsx("h3",{className:"text-2xl font-bold text-gray-900 mb-6",children:t.story_title||s("We are passionate about simplifying HR management for businesses of all sizes.")}),e.jsx("div",{className:"text-gray-600 mb-8 leading-relaxed",dangerouslySetInnerHTML:{__html:(t.story_content||s("Founded by HR and tech enthusiasts, HRMGo was created to replace cumbersome spreadsheets and manual processes with a modern, all-in-one HR platform.")).replace(/\n/g,'
')}}),d.length>0&&e.jsx("div",{className:`flex items-center gap-8 ${a?"justify-center":""}`,children:d.map((l,c)=>e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-gray-900",children:l.value}),e.jsx("div",{className:"text-sm text-gray-600",children:l.label})]},c))})]}),k=()=>f==="centered"?n==="background"&&r?e.jsxs("div",{ref:o,className:"relative rounded-xl overflow-hidden mb-8 sm:mb-12 lg:mb-16",children:[e.jsx("img",{src:r,alt:"About Us",className:"w-full h-96 object-cover",style:i?{transform:`translateY(${m}px)`,transition:"transform 0.1s linear",height:"110%",top:"-5%",position:"relative"}:void 0}),e.jsx("div",{className:"absolute inset-0 bg-black/50 flex items-center justify-center p-8",children:e.jsxs("div",{className:"text-center text-white max-w-2xl",children:[e.jsx("h3",{className:"text-2xl font-bold mb-4",children:t.story_title||s("We are passionate about simplifying HR management for businesses of all sizes.")}),e.jsx("div",{className:"mb-6 leading-relaxed opacity-90",dangerouslySetInnerHTML:{__html:(t.story_content||s("Founded by HR and tech enthusiasts, HRMGo was created to replace cumbersome spreadsheets and manual processes with a modern, all-in-one HR platform.")).replace(/\n/g,'
')}}),d.length>0&&e.jsx("div",{className:"flex items-center justify-center gap-8",children:d.map((a,l)=>e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold",children:a.value}),e.jsx("div",{className:"text-sm opacity-80",children:a.label})]},l))})]})})]}):e.jsxs("div",{className:"max-w-3xl mx-auto text-center mb-8 sm:mb-12 lg:mb-16",children:[e.jsx(u,{centered:!0}),(n==="left"||n==="right")&&e.jsx("div",{className:"mt-8",children:e.jsx(x,{})})]}):f==="image-left"?e.jsxs("div",{className:"grid lg:grid-cols-2 gap-8 sm:gap-12 lg:gap-16 items-center mb-8 sm:mb-12 lg:mb-16",children:[n==="background"&&r?e.jsxs("div",{ref:o,className:"relative rounded-xl overflow-hidden h-96",children:[e.jsx("img",{src:r,alt:"About Us",className:"w-full object-cover",style:i?{transform:`translateY(${m}px)`,transition:"transform 0.1s linear",height:"120%",top:"-10%",position:"relative"}:{height:"100%"}}),e.jsx("div",{className:"absolute inset-0 bg-black/30 rounded-xl"})]}):e.jsx(x,{}),e.jsx(u,{})]}):e.jsxs("div",{className:"grid lg:grid-cols-2 gap-8 sm:gap-12 lg:gap-16 items-center mb-8 sm:mb-12 lg:mb-16",children:[e.jsx(u,{}),n==="background"&&r?e.jsxs("div",{ref:o,className:"relative rounded-xl overflow-hidden h-96",children:[e.jsx("img",{src:r,alt:"About Us",className:"w-full object-cover",style:i?{transform:`translateY(${m}px)`,transition:"transform 0.1s linear",height:"120%",top:"-10%",position:"relative"}:{height:"100%"}}),e.jsx("div",{className:"absolute inset-0 bg-black/30 rounded-xl"})]}):e.jsx(x,{})]});return e.jsx("section",{id:"about",className:"py-12 sm:py-16 lg:py-20",style:{backgroundColor:v},ref:j,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:`text-center mb-8 sm:mb-12 lg:mb-16 transition-all duration-700 ${h?"opacity-100 translate-y-0":"opacity-0 translate-y-8"}`,children:[e.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-gray-900 mb-4",children:t.title||s("About HRM SaaS")}),e.jsx("p",{className:"text-lg text-gray-600 max-w-3xl mx-auto leading-relaxed font-medium",children:t.description||s("We are passionate about simplifying HR management for businesses of all sizes.")})]}),k(),e.jsx("div",{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 sm:gap-8 transition-all duration-700 delay-500 ${h?"opacity-100 translate-y-0":"opacity-0 translate-y-8"}`,children:H.map((a,l)=>{const c=U[a.icon]||b;return e.jsxs("div",{className:"text-center bg-white p-6 rounded-xl border border-gray-200",children:[e.jsx("div",{className:"w-12 h-12 rounded-lg flex items-center justify-center mx-auto mb-4",style:{backgroundColor:`${p}15`},children:e.jsx(c,{className:"w-6 h-6",style:{color:p}})}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-3",children:a.title}),e.jsx("p",{className:"text-gray-600 text-sm leading-relaxed",children:a.description})]},l)})})]})})}export{X as default}; +import{r as g,j as e}from"./ui-Z445SNHD.js";import{u as R}from"./useScrollAnimation-B_bDsIuD.js";import{u as S,g as _}from"./app-C3JPEKON.js";import{Z as A}from"./zap-uleUjTNN.js";import{U as z}from"./users-4jwuwqJ2.js";import{S as M}from"./shield-B3TLJuIh.js";import{S as $}from"./star-r-VK-vSq.js";import{L as E}from"./lightbulb-aqpD38w4.js";import{A as I}from"./award-jFtx9KYQ.js";import{H as T}from"./heart-DC9zwrJY.js";import{T as b}from"./target-VPspX0te.js";/* empty css *//* empty css */import"./utils-BWxnHGCV.js";const U={target:b,heart:T,award:I,lightbulb:E,star:$,shield:M,users:z,zap:A};function X({settings:L,sectionData:t,brandColor:p="#3b82f6"}){const{t:s}=S(),{ref:j,isVisible:h}=R(),r=_(t.image),v=t.background_color||"#f9fafb",f=t.layout||"image-right",n=t.image_position||"right",i=t.parallax===!0,o=g.useRef(null),[m,y]=g.useState(0);g.useEffect(()=>{if(!i||!r)return;const a=()=>{if(!o.current)return;const l=o.current.getBoundingClientRect(),c=l.top+l.height/2-window.innerHeight/2;y(c*.2)};return window.addEventListener("scroll",a,{passive:!0}),a(),()=>window.removeEventListener("scroll",a)},[i,r]);const N=[{icon:"target",title:s("Our Mission"),description:s("To empower businesses with smart HR solutions that simplify employee management, payroll, attendance, and performance tracking.")},{icon:"heart",title:s("Our Values"),description:s("We prioritize innovation, efficiency, and creating a workplace ecosystem that nurtures growth and collaboration.")},{icon:"award",title:s("Our Commitment"),description:s("Providing reliable, intuitive HR tools backed by exceptional support to help organizations optimize their workforce.")},{icon:"lightbulb",title:s("Our Vision"),description:s("A future where HR management is fully automated, transparent, and enables organizations to focus on people, not paperwork.")}],w=[{value:s("3+ Years"),label:s("Experience"),color:"blue"},{value:"500+",label:s("Companies Served"),color:"green"},{value:"20K+",label:s("Employees Managed"),color:"purple"}],H=t.values&&t.values.length>0?t.values:N,d=t.stats&&t.stats.length>0?t.stats:w,x=()=>e.jsx("div",{className:"bg-white rounded-xl p-8 border border-gray-200 h-96 flex items-center justify-center overflow-hidden",children:r?e.jsx("img",{src:r,alt:"About Us",className:"max-w-full max-h-full object-contain rounded-lg",style:i?{transform:`translateY(${m}px)`,transition:"transform 0.1s linear"}:void 0}):e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-24 h-24 bg-gray-100 rounded-full mx-auto mb-6 flex items-center justify-center",children:e.jsx("span",{className:"text-3xl",children:t.image_icon||"🚀"})}),e.jsx("h4",{className:"text-xl font-semibold text-gray-900 mb-2",children:t.image_title||s("Innovation Driven")}),e.jsx("p",{className:"text-gray-600",children:t.image_subtitle||s("Building the future of networking")})]})}),u=({centered:a=!1})=>e.jsxs("div",{className:a?"text-center":"",children:[e.jsx("h3",{className:"text-2xl font-bold text-gray-900 mb-6",children:t.story_title||s("We are passionate about simplifying HR management for businesses of all sizes.")}),e.jsx("div",{className:"text-gray-600 mb-8 leading-relaxed",dangerouslySetInnerHTML:{__html:(t.story_content||s("Founded by HR and tech enthusiasts, HRMGo was created to replace cumbersome spreadsheets and manual processes with a modern, all-in-one HR platform.")).replace(/\n/g,'
')}}),d.length>0&&e.jsx("div",{className:`flex items-center gap-8 ${a?"justify-center":""}`,children:d.map((l,c)=>e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-gray-900",children:l.value}),e.jsx("div",{className:"text-sm text-gray-600",children:l.label})]},c))})]}),k=()=>f==="centered"?n==="background"&&r?e.jsxs("div",{ref:o,className:"relative rounded-xl overflow-hidden mb-8 sm:mb-12 lg:mb-16",children:[e.jsx("img",{src:r,alt:"About Us",className:"w-full h-96 object-cover",style:i?{transform:`translateY(${m}px)`,transition:"transform 0.1s linear",height:"110%",top:"-5%",position:"relative"}:void 0}),e.jsx("div",{className:"absolute inset-0 bg-black/50 flex items-center justify-center p-8",children:e.jsxs("div",{className:"text-center text-white max-w-2xl",children:[e.jsx("h3",{className:"text-2xl font-bold mb-4",children:t.story_title||s("We are passionate about simplifying HR management for businesses of all sizes.")}),e.jsx("div",{className:"mb-6 leading-relaxed opacity-90",dangerouslySetInnerHTML:{__html:(t.story_content||s("Founded by HR and tech enthusiasts, HRMGo was created to replace cumbersome spreadsheets and manual processes with a modern, all-in-one HR platform.")).replace(/\n/g,'
')}}),d.length>0&&e.jsx("div",{className:"flex items-center justify-center gap-8",children:d.map((a,l)=>e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold",children:a.value}),e.jsx("div",{className:"text-sm opacity-80",children:a.label})]},l))})]})})]}):e.jsxs("div",{className:"max-w-3xl mx-auto text-center mb-8 sm:mb-12 lg:mb-16",children:[e.jsx(u,{centered:!0}),(n==="left"||n==="right")&&e.jsx("div",{className:"mt-8",children:e.jsx(x,{})})]}):f==="image-left"?e.jsxs("div",{className:"grid lg:grid-cols-2 gap-8 sm:gap-12 lg:gap-16 items-center mb-8 sm:mb-12 lg:mb-16",children:[n==="background"&&r?e.jsxs("div",{ref:o,className:"relative rounded-xl overflow-hidden h-96",children:[e.jsx("img",{src:r,alt:"About Us",className:"w-full object-cover",style:i?{transform:`translateY(${m}px)`,transition:"transform 0.1s linear",height:"120%",top:"-10%",position:"relative"}:{height:"100%"}}),e.jsx("div",{className:"absolute inset-0 bg-black/30 rounded-xl"})]}):e.jsx(x,{}),e.jsx(u,{})]}):e.jsxs("div",{className:"grid lg:grid-cols-2 gap-8 sm:gap-12 lg:gap-16 items-center mb-8 sm:mb-12 lg:mb-16",children:[e.jsx(u,{}),n==="background"&&r?e.jsxs("div",{ref:o,className:"relative rounded-xl overflow-hidden h-96",children:[e.jsx("img",{src:r,alt:"About Us",className:"w-full object-cover",style:i?{transform:`translateY(${m}px)`,transition:"transform 0.1s linear",height:"120%",top:"-10%",position:"relative"}:{height:"100%"}}),e.jsx("div",{className:"absolute inset-0 bg-black/30 rounded-xl"})]}):e.jsx(x,{})]});return e.jsx("section",{id:"about",className:"py-12 sm:py-16 lg:py-20",style:{backgroundColor:v},ref:j,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:`text-center mb-8 sm:mb-12 lg:mb-16 transition-all duration-700 ${h?"opacity-100 translate-y-0":"opacity-0 translate-y-8"}`,children:[e.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-gray-900 mb-4",children:t.title||s("About HRM SaaS")}),e.jsx("p",{className:"text-lg text-gray-600 max-w-3xl mx-auto leading-relaxed font-medium",children:t.description||s("We are passionate about simplifying HR management for businesses of all sizes.")})]}),k(),e.jsx("div",{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 sm:gap-8 transition-all duration-700 delay-500 ${h?"opacity-100 translate-y-0":"opacity-0 translate-y-8"}`,children:H.map((a,l)=>{const c=U[a.icon]||b;return e.jsxs("div",{className:"text-center bg-white p-6 rounded-xl border border-gray-200",children:[e.jsx("div",{className:"w-12 h-12 rounded-lg flex items-center justify-center mx-auto mb-4",style:{backgroundColor:`${p}15`},children:e.jsx(c,{className:"w-6 h-6",style:{color:p}})}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-3",children:a.title}),e.jsx("p",{className:"text-gray-600 text-sm leading-relaxed",children:a.description})]},l)})})]})})}export{X as default};
diff --git a/public/build/assets/ContactSection-BC7tU8QG.js b/public/build/assets/ContactSection-BdO67KJP.js
similarity index 97%
rename from public/build/assets/ContactSection-BC7tU8QG.js
rename to public/build/assets/ContactSection-BdO67KJP.js
index 03d11b54e..94898f9ad 100644
--- a/public/build/assets/ContactSection-BC7tU8QG.js
+++ b/public/build/assets/ContactSection-BdO67KJP.js
@@ -1 +1 @@
-import{j as e}from"./ui-Z445SNHD.js";import{u as j,b as y,t as u}from"./app-WRyxGXuF.js";import{M as f}from"./mail-CleclCbg.js";import{P as N}from"./phone-CBt3sSgr.js";import{M as v}from"./map-pin-BL4iaHnf.js";import{S as w}from"./send-C3nGHmgC.js";/* empty css *//* empty css */import"./utils-BWxnHGCV.js";function T({flash:S,settings:a,sectionData:s,brandColor:d="#3b82f6"}){const{t:r}=j(),{data:n,setData:c,post:g,processing:o,errors:t,reset:h}=y({name:"",email:"",subject:"",message:""}),b=l=>{l.preventDefault(),g(route("landing-page.contact"),{onSuccess:m=>{var x;h();const i=((x=m.props.flash)==null?void 0:x.success)||"Thank you for your message. We will get back to you soon!";u.success(i)},onError:m=>{const i=Object.values(m).join(", ");u.error(i||"Failed to send message. Please try again.")}})},p=[{icon:f,title:r("Email Us"),content:(a==null?void 0:a.contact_email)||"support@hrm.com"},{icon:N,title:r("Call Us"),content:(a==null?void 0:a.contact_phone)||"+1 (555) 123-4567"},{icon:v,title:r("Visit Us"),content:(a==null?void 0:a.contact_address)||"123 Business Ave, Suite 100"}].filter(l=>l.content);return e.jsx("section",{id:"contact",className:"py-12 sm:py-16 lg:py-20 bg-gray-50",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:"text-center mb-8 sm:mb-12 lg:mb-16",children:[e.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-gray-900 mb-4",children:(s==null?void 0:s.title)||r("Get in Touch")}),e.jsx("p",{className:"text-lg text-gray-600 max-w-3xl mx-auto leading-relaxed font-medium",children:(s==null?void 0:s.subtitle)||r("Have questions about HRM SaaS? We'd love to hear from you.. Send us a message and we'll respond as soon as possible.")})]}),e.jsxs("div",{className:"grid lg:grid-cols-2 gap-8 sm:gap-12 lg:gap-16",children:[e.jsx("div",{children:e.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-8",children:[e.jsx("h3",{className:"text-2xl font-bold text-gray-900 mb-6",children:(s==null?void 0:s.form_title)||r("Send us a Message")}),e.jsxs("form",{onSubmit:b,className:"space-y-6",role:"form","aria-label":"Contact form",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 sm:gap-6",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-2",children:[r("Full Name")," ",e.jsx("span",{className:"text-red-500","aria-label":"required",children:"*"})]}),e.jsx("input",{type:"text",id:"name",value:n.name,onChange:l=>c("name",l.target.value),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 disabled:bg-gray-100 disabled:cursor-not-allowed",style:{"--tw-ring-color":d},placeholder:r("Your full name"),required:!0,disabled:o}),t.name&&e.jsx("p",{className:"text-red-600 text-sm mt-1",children:t.name})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-2",children:[r("Email Address")," ",e.jsx("span",{className:"text-red-500","aria-label":"required",children:"*"})]}),e.jsx("input",{type:"email",id:"email",value:n.email,onChange:l=>c("email",l.target.value),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 disabled:bg-gray-100 disabled:cursor-not-allowed",style:{"--tw-ring-color":d},placeholder:r("your@email.com"),required:!0,disabled:o}),t.email&&e.jsx("p",{className:"text-red-600 text-sm mt-1",children:t.email})]})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"subject",className:"block text-sm font-medium text-gray-700 mb-2",children:[r("Subject")," ",e.jsx("span",{className:"text-red-500","aria-label":"required",children:"*"})]}),e.jsx("input",{type:"text",id:"subject",value:n.subject,onChange:l=>c("subject",l.target.value),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 disabled:bg-gray-100 disabled:cursor-not-allowed",style:{"--tw-ring-color":d},placeholder:r("What's this about?"),required:!0,disabled:o}),t.subject&&e.jsx("p",{className:"text-red-600 text-sm mt-1",children:t.subject})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"message",className:"block text-sm font-medium text-gray-700 mb-2",children:[r("Message")," ",e.jsx("span",{className:"text-red-500","aria-label":"required",children:"*"})]}),e.jsx("textarea",{id:"message",rows:6,value:n.message,onChange:l=>c("message",l.target.value),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 resize-none disabled:bg-gray-100 disabled:cursor-not-allowed",style:{"--tw-ring-color":d},placeholder:r("Tell us more about your inquiry..."),required:!0,disabled:o}),t.message&&e.jsx("p",{className:"text-red-600 text-sm mt-1",children:t.message})]}),e.jsx("button",{type:"submit",disabled:o,className:"cursor-pointer w-full text-white px-8 py-4 rounded-lg transition-colors font-semibold disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",style:{backgroundColor:d},"aria-label":o?"Sending message":"Send contact message",children:o?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}),r("Sending...")]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"w-5 h-5"}),r("Send Message")]})})]})]})}),e.jsx("div",{children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-2xl font-bold text-gray-900 mb-6",children:(s==null?void 0:s.info_title)||r("Contact Information")}),e.jsx("p",{className:"text-gray-600 mb-8",children:(s==null?void 0:s.info_description)||r("We're here to help and answer any questions you might have about managing your HR processes efficiently. We look forward to hearing from you.")})]}),e.jsx("div",{className:"space-y-6",children:p.map((l,m)=>{const i=l.icon;return e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-lg flex items-center justify-center flex-shrink-0",style:{backgroundColor:`${d}15`},children:e.jsx(i,{className:"w-6 h-6",style:{color:d}})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-lg font-semibold text-gray-900 mb-1",children:l.title}),e.jsx("p",{className:"text-gray-900 font-medium mb-1",children:l.content}),e.jsx("p",{className:"text-gray-600 text-sm",children:l.description})]})]},m)})}),(s==null?void 0:s.faqs)&&s.faqs.length>0&&e.jsxs("div",{className:"bg-white rounded-xl p-6 border border-gray-200",children:[e.jsx("h4",{className:"text-lg font-semibold text-gray-900 mb-4",children:r("Frequently Asked Questions")}),e.jsx("div",{className:"space-y-4",children:s.faqs.map((l,m)=>e.jsxs("div",{children:[e.jsx("h5",{className:"font-medium text-gray-900 mb-1",children:l.question}),e.jsx("p",{className:"text-gray-600 text-sm",children:l.answer})]},m))})]})]})})]})]})})}export{T as default};
+import{j as e}from"./ui-Z445SNHD.js";import{u as j,b as y,t as u}from"./app-C3JPEKON.js";import{M as f}from"./mail-Ckh-gp_I.js";import{P as N}from"./phone-DiksxXoj.js";import{M as v}from"./map-pin-BSwaD91p.js";import{S as w}from"./send-BgGltC09.js";/* empty css *//* empty css */import"./utils-BWxnHGCV.js";function T({flash:S,settings:a,sectionData:s,brandColor:d="#3b82f6"}){const{t:r}=j(),{data:n,setData:c,post:g,processing:o,errors:t,reset:h}=y({name:"",email:"",subject:"",message:""}),b=l=>{l.preventDefault(),g(route("landing-page.contact"),{onSuccess:m=>{var x;h();const i=((x=m.props.flash)==null?void 0:x.success)||"Thank you for your message. We will get back to you soon!";u.success(i)},onError:m=>{const i=Object.values(m).join(", ");u.error(i||"Failed to send message. Please try again.")}})},p=[{icon:f,title:r("Email Us"),content:(a==null?void 0:a.contact_email)||"support@hrm.com"},{icon:N,title:r("Call Us"),content:(a==null?void 0:a.contact_phone)||"+1 (555) 123-4567"},{icon:v,title:r("Visit Us"),content:(a==null?void 0:a.contact_address)||"123 Business Ave, Suite 100"}].filter(l=>l.content);return e.jsx("section",{id:"contact",className:"py-12 sm:py-16 lg:py-20 bg-gray-50",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:"text-center mb-8 sm:mb-12 lg:mb-16",children:[e.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-gray-900 mb-4",children:(s==null?void 0:s.title)||r("Get in Touch")}),e.jsx("p",{className:"text-lg text-gray-600 max-w-3xl mx-auto leading-relaxed font-medium",children:(s==null?void 0:s.subtitle)||r("Have questions about HRM SaaS? We'd love to hear from you.. Send us a message and we'll respond as soon as possible.")})]}),e.jsxs("div",{className:"grid lg:grid-cols-2 gap-8 sm:gap-12 lg:gap-16",children:[e.jsx("div",{children:e.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-8",children:[e.jsx("h3",{className:"text-2xl font-bold text-gray-900 mb-6",children:(s==null?void 0:s.form_title)||r("Send us a Message")}),e.jsxs("form",{onSubmit:b,className:"space-y-6",role:"form","aria-label":"Contact form",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 sm:gap-6",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-2",children:[r("Full Name")," ",e.jsx("span",{className:"text-red-500","aria-label":"required",children:"*"})]}),e.jsx("input",{type:"text",id:"name",value:n.name,onChange:l=>c("name",l.target.value),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 disabled:bg-gray-100 disabled:cursor-not-allowed",style:{"--tw-ring-color":d},placeholder:r("Your full name"),required:!0,disabled:o}),t.name&&e.jsx("p",{className:"text-red-600 text-sm mt-1",children:t.name})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-2",children:[r("Email Address")," ",e.jsx("span",{className:"text-red-500","aria-label":"required",children:"*"})]}),e.jsx("input",{type:"email",id:"email",value:n.email,onChange:l=>c("email",l.target.value),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 disabled:bg-gray-100 disabled:cursor-not-allowed",style:{"--tw-ring-color":d},placeholder:r("your@email.com"),required:!0,disabled:o}),t.email&&e.jsx("p",{className:"text-red-600 text-sm mt-1",children:t.email})]})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"subject",className:"block text-sm font-medium text-gray-700 mb-2",children:[r("Subject")," ",e.jsx("span",{className:"text-red-500","aria-label":"required",children:"*"})]}),e.jsx("input",{type:"text",id:"subject",value:n.subject,onChange:l=>c("subject",l.target.value),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 disabled:bg-gray-100 disabled:cursor-not-allowed",style:{"--tw-ring-color":d},placeholder:r("What's this about?"),required:!0,disabled:o}),t.subject&&e.jsx("p",{className:"text-red-600 text-sm mt-1",children:t.subject})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"message",className:"block text-sm font-medium text-gray-700 mb-2",children:[r("Message")," ",e.jsx("span",{className:"text-red-500","aria-label":"required",children:"*"})]}),e.jsx("textarea",{id:"message",rows:6,value:n.message,onChange:l=>c("message",l.target.value),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 resize-none disabled:bg-gray-100 disabled:cursor-not-allowed",style:{"--tw-ring-color":d},placeholder:r("Tell us more about your inquiry..."),required:!0,disabled:o}),t.message&&e.jsx("p",{className:"text-red-600 text-sm mt-1",children:t.message})]}),e.jsx("button",{type:"submit",disabled:o,className:"cursor-pointer w-full text-white px-8 py-4 rounded-lg transition-colors font-semibold disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",style:{backgroundColor:d},"aria-label":o?"Sending message":"Send contact message",children:o?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}),r("Sending...")]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"w-5 h-5"}),r("Send Message")]})})]})]})}),e.jsx("div",{children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-2xl font-bold text-gray-900 mb-6",children:(s==null?void 0:s.info_title)||r("Contact Information")}),e.jsx("p",{className:"text-gray-600 mb-8",children:(s==null?void 0:s.info_description)||r("We're here to help and answer any questions you might have about managing your HR processes efficiently. We look forward to hearing from you.")})]}),e.jsx("div",{className:"space-y-6",children:p.map((l,m)=>{const i=l.icon;return e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-lg flex items-center justify-center flex-shrink-0",style:{backgroundColor:`${d}15`},children:e.jsx(i,{className:"w-6 h-6",style:{color:d}})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-lg font-semibold text-gray-900 mb-1",children:l.title}),e.jsx("p",{className:"text-gray-900 font-medium mb-1",children:l.content}),e.jsx("p",{className:"text-gray-600 text-sm",children:l.description})]})]},m)})}),(s==null?void 0:s.faqs)&&s.faqs.length>0&&e.jsxs("div",{className:"bg-white rounded-xl p-6 border border-gray-200",children:[e.jsx("h4",{className:"text-lg font-semibold text-gray-900 mb-4",children:r("Frequently Asked Questions")}),e.jsx("div",{className:"space-y-4",children:s.faqs.map((l,m)=>e.jsxs("div",{children:[e.jsx("h5",{className:"font-medium text-gray-900 mb-1",children:l.question}),e.jsx("p",{className:"text-gray-600 text-sm",children:l.answer})]},m))})]})]})})]})]})})}export{T as default};
diff --git a/public/build/assets/CookieConsentBanner-C4hOCxro.js b/public/build/assets/CookieConsentBanner-Cd_456i9.js
similarity index 98%
rename from public/build/assets/CookieConsentBanner-C4hOCxro.js
rename to public/build/assets/CookieConsentBanner-Cd_456i9.js
index c364e6c77..e34177e46 100644
--- a/public/build/assets/CookieConsentBanner-C4hOCxro.js
+++ b/public/build/assets/CookieConsentBanner-Cd_456i9.js
@@ -1 +1 @@
-import{r as v,j as e,z as B,B as $,E as K,F as V,I as W,S as Q,G as Y,L as Z}from"./ui-Z445SNHD.js";import{R as P}from"./react-country-flag.esm-Bs2jngHP.js";import{u as A,c as I,D as ee,h as te,j as se,k as ae,L as M,I as z,o as j,J as T,e as F,K as _,N as O,P as oe,O as U,Q as ne,r as q,R as J,a as re,C as G,X as H,T as ie,t as X}from"./app-WRyxGXuF.js";import{R as ce}from"./refresh-cw-CL79jlh1.js";import{G as le}from"./globe-D1qAJHoC.js";import{S as de}from"./settings-BtOPBhq3.js";import{S as ue}from"./switch-CI-Khxz1.js";function me({open:s,onOpenChange:l,onSuccess:c}){var o;const{t}=A(),{props:p}=I(),b=((o=p.globalSettings)==null?void 0:o.is_demo)||!1,[n,u]=v.useState({code:"",name:"",countryCode:""}),[x,D]=v.useState(!1),f=async d=>{var C;d.preventDefault(),D(!0);try{const y=await fetch(route("languages.create"),{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":((C=document.querySelector('meta[name="csrf-token"]'))==null?void 0:C.getAttribute("content"))||"",Accept:"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify(n)}),h=await y.json();y.ok&&h.success?(T.success(h.message||t("Language created successfully")),u({code:"",name:"",countryCode:""}),l(!1),c==null||c(),window.location.reload()):(console.error("Create language error:",h),b&&h.message?T.error(h.message):T.error(h.error||t("Failed to create language")))}catch(y){console.error("Network error:",y),T.error(t("Failed to create language"))}finally{D(!1)}};return e.jsx(ee,{open:s,onOpenChange:l,children:e.jsxs(te,{className:"sm:max-w-md",children:[e.jsx(se,{children:e.jsx(ae,{children:t("Create Language")})}),e.jsxs("form",{onSubmit:f,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(M,{htmlFor:"code",children:t("Language Code")}),e.jsx(z,{id:"code",placeholder:t("e.g., fr, de, ja"),value:n.code,onChange:d=>u({...n,code:d.target.value}),required:!0})]}),e.jsxs("div",{children:[e.jsx(M,{htmlFor:"name",children:t("Language Name")}),e.jsx(z,{id:"name",placeholder:t("e.g., Français, Deutsch, 日本語"),value:n.name,onChange:d=>u({...n,name:d.target.value}),required:!0})]}),e.jsxs("div",{children:[e.jsx(M,{htmlFor:"countryCode",children:t("Country Code")}),e.jsx(z,{id:"countryCode",placeholder:t("e.g., FR, DE, JP"),maxLength:2,value:n.countryCode,onChange:d=>u({...n,countryCode:d.target.value.toUpperCase()}),required:!0})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(j,{type:"button",variant:"outline",onClick:()=>l(!1),children:t("Cancel")}),e.jsx(j,{type:"submit",disabled:x,children:x?e.jsxs(e.Fragment,{children:[e.jsx(ce,{className:"h-4 w-4 animate-spin mr-2"}),t("Creating...")]}):t("Create Language")})]})]})]})})}function ge({...s}){return e.jsx(B,{"data-slot":"dropdown-menu",...s})}function fe({...s}){return e.jsx($,{"data-slot":"dropdown-menu-trigger",...s})}function pe({className:s,sideOffset:l=4,...c}){return e.jsx(K,{children:e.jsx(V,{"data-slot":"dropdown-menu-content",sideOffset:l,className:F("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",s),...c})})}function he({...s}){return e.jsx(Y,{"data-slot":"dropdown-menu-group",...s})}function R({className:s,inset:l,variant:c="default",...t}){return e.jsx(W,{"data-slot":"dropdown-menu-item","data-inset":l,"data-variant":c,className:F("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive-foreground data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/40 data-[variant=destructive]:focus:text-destructive-foreground data-[variant=destructive]:*:[svg]:!text-destructive-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),...t})}function Ne({className:s,inset:l,...c}){return e.jsx(Z,{"data-slot":"dropdown-menu-label","data-inset":l,className:F("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",s),...c})}function xe({className:s,...l}){return e.jsx(Q,{"data-slot":"dropdown-menu-separator",className:F("bg-border -mx-1 my-1 h-px",s),...l})}function De(){var g,N;const{i18n:s,t:l}=A(),{auth:c,globalSettings:t,userLanguage:p}=I().props,{setPosition:b}=_(),{updatePosition:n}=_(),[u,x]=v.useState(()=>{const a=((t==null?void 0:t.availableLanguages)||[]).filter(r=>r.enabled!==!1);if(p){const r=a.find(i=>i.code===p);if(r)return r}return a[0]||null}),[D,f]=v.useState(!1),o=(t==null?void 0:t.availableLanguages)||[],d=(t==null?void 0:t.is_saas)||!1,C=!!(c!=null&&c.user),y=((N=(g=c==null?void 0:c.user)==null?void 0:g.roles)==null?void 0:N.map(a=>a.name))||[],h=C&&O("superadmin",y),S=C&&O("company",y),m=d?h:S;v.useEffect(()=>{const a=(o||[]).filter(r=>r.enabled!==!1);if(p&&s.language!==p)s.changeLanguage(p,()=>{const r=a.find(i=>i.code===p)||a[0];x(r)});else{const r=a.find(i=>i.code===s.language)||a[0];x(r)}},[o,p]),v.useEffect(()=>{const a=(o||[]).filter(i=>i.enabled!==!1),r=a.find(i=>i.code===s.language)||a[0];x(r)},[s.language,o]);const k=["ar","he"],w=async a=>{const r=o.find(i=>i.code===a);if(r){x(r);try{await s.changeLanguage(a);const i=k.includes(a);let L;U()?L=i?"right":ne("layoutPosition")||"left":L=i?"right":(t==null?void 0:t.layoutDirection)||"left",document.documentElement.dir="ltr",document.documentElement.setAttribute("dir","ltr"),n(L),C&&!U()?q.post(route("languages.change"),{language:a},{preserveScroll:!0,onSuccess:()=>{(i||!i&&(t==null?void 0:t.layoutDirection)==="right")&&q.post(route("settings.brand.update"),{settings:{layoutDirection:L}},{preserveScroll:!0,onError:E=>{console.error("Failed to update layout direction:",E)}})},onError:E=>{console.error("Failed to change language:",E)}}):(J("app_language",a),J("layoutPosition",L)),window.dispatchEvent(new CustomEvent("languageChanged",{detail:{language:a,direction:L}})),window.dispatchEvent(new Event("resize"))}catch(i){console.error("Error changing language:",i)}}};return e.jsxs(e.Fragment,{children:[e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsxs(j,{variant:"ghost",className:"flex items-center gap-2 rounded-md border shadow-sm bg-white",children:[e.jsx(le,{className:"h-4 w-4"}),u&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-sm font-medium hidden md:inline-block",children:u.name}),e.jsx(P,{countryCode:u.countryCode,svg:!0,style:{width:"1.2em",height:"1.2em"}})]})]})}),e.jsxs(pe,{className:"w-56",align:"end",forceMount:!0,children:[e.jsx(he,{children:e.jsx("div",{className:"max-h-48 overflow-y-auto",children:(o||[]).filter(a=>a.enabled!==!1).map(a=>e.jsxs(R,{onClick:()=>w(a.code),className:`flex items-center gap-2 ${(u==null?void 0:u.code)===a.code?"bg-accent":""}`,children:[e.jsx(P,{countryCode:a.countryCode,svg:!0,style:{width:"1.2em",height:"1.2em"}}),e.jsx("span",{children:a.name})]},a.code))})}),m&&e.jsxs(e.Fragment,{children:[e.jsx(xe,{}),e.jsxs(R,{onClick:()=>f(!0),className:"justify-center text-primary font-semibold cursor-pointer",children:[e.jsx(oe,{className:"h-4 w-4 mr-2"}),l("Create Language")]}),e.jsx(R,{asChild:!0,className:"justify-center text-primary font-semibold cursor-pointer",children:e.jsxs("a",{href:route("manage-language"),rel:"noopener noreferrer",children:[e.jsx(de,{className:"h-4 w-4 mr-2"}),l("Manage Language")]})})]})]})]}),e.jsx(me,{open:D,onOpenChange:f,onSuccess:()=>f(!1)})]})}function Le(){const{t:s}=A(),{props:l}=I(),[c,t]=v.useState(!1),[p,b]=v.useState(!1),[n,u]=v.useState(!1),{themeColor:x,customColor:D}=re(),f=x==="custom"?D:ie[x],o=l.globalSettings||{},d={cookieTitle:o.cookieTitle||"Cookie Consent",cookieDescription:o.cookieDescription||"We use cookies to enhance your browsing experience and provide personalized content.",strictlyCookieTitle:o.strictlyCookieTitle||"Strictly Necessary Cookies",strictlyCookieDescription:o.strictlyCookieDescription||"These cookies are essential for the website to function properly.",contactUsDescription:o.contactUsDescription||"If you have any questions about our cookie policy, please contact us.",contactUsUrl:o.contactUsUrl||"#"};v.useEffect(()=>{var N,a;const m=o.enableLogging==="1"||o.enableLogging===1||o.enableLogging===!0,k=o.is_demo==="1"||o.is_demo===1||o.is_demo===!0,w=window.location.pathname==="/dashboard"||window.location.pathname.includes("/dashboard"),g=(a=(N=l.auth)==null?void 0:N.user)==null?void 0:a.type;if(m){if(k&&(!w||g!=="company"))return;localStorage.getItem("cookie-consent")||t(!0)}},[]);const C=async()=>{try{const m=new AbortController,k=setTimeout(()=>m.abort(),5e3),w=await fetch("https://ipapi.co/json/",{signal:m.signal,headers:{Accept:"application/json"}});if(clearTimeout(k),!w.ok)throw new Error(`HTTP error! status: ${w.status}`);const g=await w.json();return{ip:g.ip||"unknown",country:g.country_name||"unknown",city:g.city||"unknown",region:g.region||"unknown",...g}}catch(m){return console.warn("Failed to get location data:",m.message),{ip:"unknown",country:"unknown",city:"unknown",region:"unknown",error:m.message||"Location fetch failed"}}},y=async(m,k)=>{var w;try{const g=await C(),N={...k,timestamp:new Date().toISOString(),consentType:m,userAgent:navigator.userAgent||"unknown",language:navigator.language||"unknown",url:window.location.href,...g};localStorage.setItem("cookie-consent",JSON.stringify({accepted:!0,timestamp:Date.now()}));const a=(w=document.querySelector('meta[name="csrf-token"]'))==null?void 0:w.getAttribute("content");if(!a){console.warn("CSRF token not found");return}const r=await fetch(route("cookie.consent.store"),{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":a,Accept:"application/json"},body:JSON.stringify(N)});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);if(!(await r.json()).success)throw new Error("Server returned error")}catch(g){throw console.error("Failed to save cookie consent:",g),localStorage.setItem("cookie-consent",JSON.stringify({accepted:!0,timestamp:Date.now()})),g}},h=async()=>{if(!n){u(!0);try{await y("accept_all",{necessary:!0,analytics:!0,marketing:!0}),t(!1)}catch{X.error(s("Failed to save cookie preferences"))}finally{u(!1)}}},S=async()=>{if(!n){u(!0);try{await y("necessary_only",{necessary:!0,analytics:!1,marketing:!1}),t(!1)}catch{X.error(s("Failed to save cookie preferences"))}finally{u(!1)}}};return c?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed bottom-4 left-1/2 transform -translate-x-1/2 z-50 max-w-md w-full mx-4",children:e.jsxs(G,{className:"p-4 shadow-lg border",children:[e.jsxs("div",{className:"flex justify-between items-start mb-3",children:[e.jsx("h3",{className:"font-semibold text-sm",children:d.cookieTitle}),e.jsx(j,{variant:"ghost",size:"sm",onClick:()=>t(!1),className:"h-6 w-6 p-0",children:e.jsx(H,{className:"h-4 w-4"})})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:d.cookieDescription}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{onClick:h,size:"sm",className:"flex-1 text-white hover:opacity-90",style:{backgroundColor:f},disabled:n,children:s(n?"Saving...":"Accept All")}),e.jsx(j,{onClick:S,variant:"outline",size:"sm",className:"flex-1",style:{borderColor:f,color:f},disabled:n,children:s(n?"Saving...":"Necessary Only")})]}),e.jsx(j,{onClick:()=>b(!0),variant:"ghost",size:"sm",className:"text-sm underline",children:s("Let me choose")})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:[d.contactUsDescription," ",e.jsx("a",{href:d.contactUsUrl,className:"underline",children:s("Contact us")})]})]})}),p&&e.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4",children:e.jsx(G,{className:"w-full max-w-md max-h-[80vh] overflow-y-auto",children:e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:d.cookieTitle}),e.jsx(j,{variant:"ghost",size:"sm",onClick:()=>b(!1),className:"h-6 w-6 p-0",children:e.jsx(H,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-medium text-sm",children:d.strictlyCookieTitle}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:d.strictlyCookieDescription})]}),e.jsx(ue,{checked:!0,disabled:!0})]})}),e.jsxs("div",{className:"flex gap-2 mt-6",children:[e.jsx(j,{onClick:async()=>{await S(),b(!1)},variant:"outline",size:"sm",className:"flex-1",style:{borderColor:f,color:f},disabled:n,children:s(n?"Saving...":"Save Preferences")}),e.jsx(j,{onClick:async()=>{await h(),b(!1)},size:"sm",className:"flex-1 text-white hover:opacity-90",style:{backgroundColor:f},disabled:n,children:s(n?"Saving...":"Accept All")})]})]})})})]}):null}export{Le as C,ge as D,De as L,fe as a,pe as b,R as c,xe as d,Ne as e,he as f};
+import{r as v,j as e,z as B,B as $,E as K,F as V,I as W,S as Q,G as Y,L as Z}from"./ui-Z445SNHD.js";import{R as P}from"./react-country-flag.esm-Bs2jngHP.js";import{u as A,c as I,D as ee,h as te,j as se,k as ae,L as M,I as z,o as j,J as T,e as F,K as _,N as O,P as oe,O as U,Q as ne,r as q,R as J,a as re,C as G,X as H,T as ie,t as X}from"./app-C3JPEKON.js";import{R as ce}from"./refresh-cw-OGlw7wjK.js";import{G as le}from"./globe-DRqr45i3.js";import{S as de}from"./settings-BePP_uz5.js";import{S as ue}from"./switch-B_3YHJr3.js";function me({open:s,onOpenChange:l,onSuccess:c}){var o;const{t}=A(),{props:p}=I(),b=((o=p.globalSettings)==null?void 0:o.is_demo)||!1,[n,u]=v.useState({code:"",name:"",countryCode:""}),[x,D]=v.useState(!1),f=async d=>{var C;d.preventDefault(),D(!0);try{const y=await fetch(route("languages.create"),{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":((C=document.querySelector('meta[name="csrf-token"]'))==null?void 0:C.getAttribute("content"))||"",Accept:"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify(n)}),h=await y.json();y.ok&&h.success?(T.success(h.message||t("Language created successfully")),u({code:"",name:"",countryCode:""}),l(!1),c==null||c(),window.location.reload()):(console.error("Create language error:",h),b&&h.message?T.error(h.message):T.error(h.error||t("Failed to create language")))}catch(y){console.error("Network error:",y),T.error(t("Failed to create language"))}finally{D(!1)}};return e.jsx(ee,{open:s,onOpenChange:l,children:e.jsxs(te,{className:"sm:max-w-md",children:[e.jsx(se,{children:e.jsx(ae,{children:t("Create Language")})}),e.jsxs("form",{onSubmit:f,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(M,{htmlFor:"code",children:t("Language Code")}),e.jsx(z,{id:"code",placeholder:t("e.g., fr, de, ja"),value:n.code,onChange:d=>u({...n,code:d.target.value}),required:!0})]}),e.jsxs("div",{children:[e.jsx(M,{htmlFor:"name",children:t("Language Name")}),e.jsx(z,{id:"name",placeholder:t("e.g., Français, Deutsch, 日本語"),value:n.name,onChange:d=>u({...n,name:d.target.value}),required:!0})]}),e.jsxs("div",{children:[e.jsx(M,{htmlFor:"countryCode",children:t("Country Code")}),e.jsx(z,{id:"countryCode",placeholder:t("e.g., FR, DE, JP"),maxLength:2,value:n.countryCode,onChange:d=>u({...n,countryCode:d.target.value.toUpperCase()}),required:!0})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(j,{type:"button",variant:"outline",onClick:()=>l(!1),children:t("Cancel")}),e.jsx(j,{type:"submit",disabled:x,children:x?e.jsxs(e.Fragment,{children:[e.jsx(ce,{className:"h-4 w-4 animate-spin mr-2"}),t("Creating...")]}):t("Create Language")})]})]})]})})}function ge({...s}){return e.jsx(B,{"data-slot":"dropdown-menu",...s})}function fe({...s}){return e.jsx($,{"data-slot":"dropdown-menu-trigger",...s})}function pe({className:s,sideOffset:l=4,...c}){return e.jsx(K,{children:e.jsx(V,{"data-slot":"dropdown-menu-content",sideOffset:l,className:F("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",s),...c})})}function he({...s}){return e.jsx(Y,{"data-slot":"dropdown-menu-group",...s})}function R({className:s,inset:l,variant:c="default",...t}){return e.jsx(W,{"data-slot":"dropdown-menu-item","data-inset":l,"data-variant":c,className:F("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive-foreground data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/40 data-[variant=destructive]:focus:text-destructive-foreground data-[variant=destructive]:*:[svg]:!text-destructive-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),...t})}function Ne({className:s,inset:l,...c}){return e.jsx(Z,{"data-slot":"dropdown-menu-label","data-inset":l,className:F("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",s),...c})}function xe({className:s,...l}){return e.jsx(Q,{"data-slot":"dropdown-menu-separator",className:F("bg-border -mx-1 my-1 h-px",s),...l})}function De(){var g,N;const{i18n:s,t:l}=A(),{auth:c,globalSettings:t,userLanguage:p}=I().props,{setPosition:b}=_(),{updatePosition:n}=_(),[u,x]=v.useState(()=>{const a=((t==null?void 0:t.availableLanguages)||[]).filter(r=>r.enabled!==!1);if(p){const r=a.find(i=>i.code===p);if(r)return r}return a[0]||null}),[D,f]=v.useState(!1),o=(t==null?void 0:t.availableLanguages)||[],d=(t==null?void 0:t.is_saas)||!1,C=!!(c!=null&&c.user),y=((N=(g=c==null?void 0:c.user)==null?void 0:g.roles)==null?void 0:N.map(a=>a.name))||[],h=C&&O("superadmin",y),S=C&&O("company",y),m=d?h:S;v.useEffect(()=>{const a=(o||[]).filter(r=>r.enabled!==!1);if(p&&s.language!==p)s.changeLanguage(p,()=>{const r=a.find(i=>i.code===p)||a[0];x(r)});else{const r=a.find(i=>i.code===s.language)||a[0];x(r)}},[o,p]),v.useEffect(()=>{const a=(o||[]).filter(i=>i.enabled!==!1),r=a.find(i=>i.code===s.language)||a[0];x(r)},[s.language,o]);const k=["ar","he"],w=async a=>{const r=o.find(i=>i.code===a);if(r){x(r);try{await s.changeLanguage(a);const i=k.includes(a);let L;U()?L=i?"right":ne("layoutPosition")||"left":L=i?"right":(t==null?void 0:t.layoutDirection)||"left",document.documentElement.dir="ltr",document.documentElement.setAttribute("dir","ltr"),n(L),C&&!U()?q.post(route("languages.change"),{language:a},{preserveScroll:!0,onSuccess:()=>{(i||!i&&(t==null?void 0:t.layoutDirection)==="right")&&q.post(route("settings.brand.update"),{settings:{layoutDirection:L}},{preserveScroll:!0,onError:E=>{console.error("Failed to update layout direction:",E)}})},onError:E=>{console.error("Failed to change language:",E)}}):(J("app_language",a),J("layoutPosition",L)),window.dispatchEvent(new CustomEvent("languageChanged",{detail:{language:a,direction:L}})),window.dispatchEvent(new Event("resize"))}catch(i){console.error("Error changing language:",i)}}};return e.jsxs(e.Fragment,{children:[e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsxs(j,{variant:"ghost",className:"flex items-center gap-2 rounded-md border shadow-sm bg-white",children:[e.jsx(le,{className:"h-4 w-4"}),u&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-sm font-medium hidden md:inline-block",children:u.name}),e.jsx(P,{countryCode:u.countryCode,svg:!0,style:{width:"1.2em",height:"1.2em"}})]})]})}),e.jsxs(pe,{className:"w-56",align:"end",forceMount:!0,children:[e.jsx(he,{children:e.jsx("div",{className:"max-h-48 overflow-y-auto",children:(o||[]).filter(a=>a.enabled!==!1).map(a=>e.jsxs(R,{onClick:()=>w(a.code),className:`flex items-center gap-2 ${(u==null?void 0:u.code)===a.code?"bg-accent":""}`,children:[e.jsx(P,{countryCode:a.countryCode,svg:!0,style:{width:"1.2em",height:"1.2em"}}),e.jsx("span",{children:a.name})]},a.code))})}),m&&e.jsxs(e.Fragment,{children:[e.jsx(xe,{}),e.jsxs(R,{onClick:()=>f(!0),className:"justify-center text-primary font-semibold cursor-pointer",children:[e.jsx(oe,{className:"h-4 w-4 mr-2"}),l("Create Language")]}),e.jsx(R,{asChild:!0,className:"justify-center text-primary font-semibold cursor-pointer",children:e.jsxs("a",{href:route("manage-language"),rel:"noopener noreferrer",children:[e.jsx(de,{className:"h-4 w-4 mr-2"}),l("Manage Language")]})})]})]})]}),e.jsx(me,{open:D,onOpenChange:f,onSuccess:()=>f(!1)})]})}function Le(){const{t:s}=A(),{props:l}=I(),[c,t]=v.useState(!1),[p,b]=v.useState(!1),[n,u]=v.useState(!1),{themeColor:x,customColor:D}=re(),f=x==="custom"?D:ie[x],o=l.globalSettings||{},d={cookieTitle:o.cookieTitle||"Cookie Consent",cookieDescription:o.cookieDescription||"We use cookies to enhance your browsing experience and provide personalized content.",strictlyCookieTitle:o.strictlyCookieTitle||"Strictly Necessary Cookies",strictlyCookieDescription:o.strictlyCookieDescription||"These cookies are essential for the website to function properly.",contactUsDescription:o.contactUsDescription||"If you have any questions about our cookie policy, please contact us.",contactUsUrl:o.contactUsUrl||"#"};v.useEffect(()=>{var N,a;const m=o.enableLogging==="1"||o.enableLogging===1||o.enableLogging===!0,k=o.is_demo==="1"||o.is_demo===1||o.is_demo===!0,w=window.location.pathname==="/dashboard"||window.location.pathname.includes("/dashboard"),g=(a=(N=l.auth)==null?void 0:N.user)==null?void 0:a.type;if(m){if(k&&(!w||g!=="company"))return;localStorage.getItem("cookie-consent")||t(!0)}},[]);const C=async()=>{try{const m=new AbortController,k=setTimeout(()=>m.abort(),5e3),w=await fetch("https://ipapi.co/json/",{signal:m.signal,headers:{Accept:"application/json"}});if(clearTimeout(k),!w.ok)throw new Error(`HTTP error! status: ${w.status}`);const g=await w.json();return{ip:g.ip||"unknown",country:g.country_name||"unknown",city:g.city||"unknown",region:g.region||"unknown",...g}}catch(m){return console.warn("Failed to get location data:",m.message),{ip:"unknown",country:"unknown",city:"unknown",region:"unknown",error:m.message||"Location fetch failed"}}},y=async(m,k)=>{var w;try{const g=await C(),N={...k,timestamp:new Date().toISOString(),consentType:m,userAgent:navigator.userAgent||"unknown",language:navigator.language||"unknown",url:window.location.href,...g};localStorage.setItem("cookie-consent",JSON.stringify({accepted:!0,timestamp:Date.now()}));const a=(w=document.querySelector('meta[name="csrf-token"]'))==null?void 0:w.getAttribute("content");if(!a){console.warn("CSRF token not found");return}const r=await fetch(route("cookie.consent.store"),{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":a,Accept:"application/json"},body:JSON.stringify(N)});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);if(!(await r.json()).success)throw new Error("Server returned error")}catch(g){throw console.error("Failed to save cookie consent:",g),localStorage.setItem("cookie-consent",JSON.stringify({accepted:!0,timestamp:Date.now()})),g}},h=async()=>{if(!n){u(!0);try{await y("accept_all",{necessary:!0,analytics:!0,marketing:!0}),t(!1)}catch{X.error(s("Failed to save cookie preferences"))}finally{u(!1)}}},S=async()=>{if(!n){u(!0);try{await y("necessary_only",{necessary:!0,analytics:!1,marketing:!1}),t(!1)}catch{X.error(s("Failed to save cookie preferences"))}finally{u(!1)}}};return c?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed bottom-4 left-1/2 transform -translate-x-1/2 z-50 max-w-md w-full mx-4",children:e.jsxs(G,{className:"p-4 shadow-lg border",children:[e.jsxs("div",{className:"flex justify-between items-start mb-3",children:[e.jsx("h3",{className:"font-semibold text-sm",children:d.cookieTitle}),e.jsx(j,{variant:"ghost",size:"sm",onClick:()=>t(!1),className:"h-6 w-6 p-0",children:e.jsx(H,{className:"h-4 w-4"})})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:d.cookieDescription}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{onClick:h,size:"sm",className:"flex-1 text-white hover:opacity-90",style:{backgroundColor:f},disabled:n,children:s(n?"Saving...":"Accept All")}),e.jsx(j,{onClick:S,variant:"outline",size:"sm",className:"flex-1",style:{borderColor:f,color:f},disabled:n,children:s(n?"Saving...":"Necessary Only")})]}),e.jsx(j,{onClick:()=>b(!0),variant:"ghost",size:"sm",className:"text-sm underline",children:s("Let me choose")})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:[d.contactUsDescription," ",e.jsx("a",{href:d.contactUsUrl,className:"underline",children:s("Contact us")})]})]})}),p&&e.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4",children:e.jsx(G,{className:"w-full max-w-md max-h-[80vh] overflow-y-auto",children:e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:d.cookieTitle}),e.jsx(j,{variant:"ghost",size:"sm",onClick:()=>b(!1),className:"h-6 w-6 p-0",children:e.jsx(H,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-medium text-sm",children:d.strictlyCookieTitle}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:d.strictlyCookieDescription})]}),e.jsx(ue,{checked:!0,disabled:!0})]})}),e.jsxs("div",{className:"flex gap-2 mt-6",children:[e.jsx(j,{onClick:async()=>{await S(),b(!1)},variant:"outline",size:"sm",className:"flex-1",style:{borderColor:f,color:f},disabled:n,children:s(n?"Saving...":"Save Preferences")}),e.jsx(j,{onClick:async()=>{await h(),b(!1)},size:"sm",className:"flex-1 text-white hover:opacity-90",style:{backgroundColor:f},disabled:n,children:s(n?"Saving...":"Accept All")})]})]})})})]}):null}export{Le as C,ge as D,De as L,fe as a,pe as b,R as c,xe as d,Ne as e,he as f};
diff --git a/public/build/assets/CrudDeleteModal-ChHWdR5b.js b/public/build/assets/CrudDeleteModal-Bvf2ztId.js
similarity index 90%
rename from public/build/assets/CrudDeleteModal-ChHWdR5b.js
rename to public/build/assets/CrudDeleteModal-Bvf2ztId.js
index 809992c7c..e6d22f274 100644
--- a/public/build/assets/CrudDeleteModal-ChHWdR5b.js
+++ b/public/build/assets/CrudDeleteModal-Bvf2ztId.js
@@ -1 +1 @@
-import{j as e}from"./ui-Z445SNHD.js";import{u as r,D as c,h as d,j as u,k as h,p as j,q as x,o as a}from"./app-WRyxGXuF.js";function p({isOpen:o,onClose:n,onConfirm:i,itemName:l,entityName:t}){const{t:s}=r();return e.jsx(c,{open:o,onOpenChange:n,children:e.jsxs(d,{className:"sm:max-w-md",children:[e.jsxs(u,{children:[e.jsxs(h,{children:[s("Delete")," ",t]}),e.jsxs(j,{children:[s("Are you sure you want to delete")," ",l||`this ${t}`,"? ",s("This action cannot be undone.")]})]}),e.jsxs(x,{className:"sm:justify-end",children:[e.jsx(a,{type:"button",variant:"outline",onClick:n,children:s("Cancel")}),e.jsx(a,{type:"button",variant:"destructive",onClick:i,children:s("Delete")})]})]})})}export{p as C};
+import{j as e}from"./ui-Z445SNHD.js";import{u as r,D as c,h as d,j as u,k as h,p as j,q as x,o as a}from"./app-C3JPEKON.js";function p({isOpen:o,onClose:n,onConfirm:i,itemName:l,entityName:t}){const{t:s}=r();return e.jsx(c,{open:o,onOpenChange:n,children:e.jsxs(d,{className:"sm:max-w-md",children:[e.jsxs(u,{children:[e.jsxs(h,{children:[s("Delete")," ",t]}),e.jsxs(j,{children:[s("Are you sure you want to delete")," ",l||`this ${t}`,"? ",s("This action cannot be undone.")]})]}),e.jsxs(x,{className:"sm:justify-end",children:[e.jsx(a,{type:"button",variant:"outline",onClick:n,children:s("Cancel")}),e.jsx(a,{type:"button",variant:"destructive",onClick:i,children:s("Delete")})]})]})})}export{p as C};
diff --git a/public/build/assets/CrudFormModal-CFImxokG.js b/public/build/assets/CrudFormModal-CeNgl9Zq.js
similarity index 97%
rename from public/build/assets/CrudFormModal-CFImxokG.js
rename to public/build/assets/CrudFormModal-CeNgl9Zq.js
index 75752bb5f..1fc170dc0 100644
--- a/public/build/assets/CrudFormModal-CFImxokG.js
+++ b/public/build/assets/CrudFormModal-CeNgl9Zq.js
@@ -1 +1 @@
-import{r as w,j as a,R as se}from"./ui-Z445SNHD.js";import{B as re,X as ce,c as oe,u as le,D as me,h as ie,j as ue,k as pe,p as de,L as R,q as xe,o as X,I as M,M as he}from"./app-WRyxGXuF.js";import{T as ye}from"./textarea-NhQ1oYyi.js";import{S as be,a as ge,b as je,c as ve,d as Y}from"./select-CIzzFfV-.js";import{R as we,a as Se}from"./radio-group-BWmzpJem.js";import{C as Ne}from"./checkbox-B-JFpLIv.js";import{S as Oe}from"./switch-CI-Khxz1.js";import{S as Fe}from"./scroll-area-BlUJfocG.js";function ke({options:i,selected:h,onChange:g,placeholder:d="Select options",className:x}){const[O,l]=w.useState(!1),[F,j]=w.useState(""),C=w.useRef(null);w.useEffect(()=>{function t(c){C.current&&!C.current.contains(c.target)&&(l(!1),j(""))}return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[]);const b=t=>{h.includes(t)||g([...h,t]),j("")},n=t=>{g(h.filter(c=>c!==t))},p=i.filter(t=>!h.includes(t.value)&&t.label.toLowerCase().includes(F.toLowerCase()));return a.jsxs("div",{ref:C,className:`${x??""}`,children:[a.jsxs("div",{className:"flex flex-wrap gap-1 p-2 border rounded-md min-h-[38px] cursor-text",onClick:()=>l(!0),children:[h.map(t=>{const c=i.find(v=>v.value===t);return a.jsxs(re,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[(c==null?void 0:c.label)||t,a.jsx("button",{type:"button",className:"ml-1 rounded-sm",onClick:v=>{v.stopPropagation(),n(t)},children:a.jsx(ce,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},t)}),a.jsx("input",{type:"text",value:F,onChange:t=>j(t.target.value),onFocus:()=>l(!0),placeholder:h.length===0?d:"",className:"flex-1 outline-none bg-transparent min-w-[50px] text-sm"})]}),O&&p.length>0&&a.jsx("div",{className:"mt-1 w-full border border-gray-200 dark:border-gray-700 rounded-md bg-white dark:bg-gray-800 shadow-sm",children:p.map(t=>a.jsx("div",{className:"px-3 py-2 cursor-pointer text-sm text-gray-900 dark:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-700",onMouseDown:c=>{c.preventDefault(),b(t.value)},children:t.label},t.value))})]})}function Ce({field:i,formData:h,handleChange:g}){const d=Array.isArray(h[i.name])?h[i.name]:h[i.name]?[h[i.name].toString()]:[];return a.jsx(ke,{options:i.options||[],selected:d,onChange:x=>g(i.name,x),placeholder:i.placeholder||`Select ${i.label}`})}function Ve({fields:i,values:h,onChange:g,disabled:d=!1}){const{base_url:x}=oe().props,[O,l]=w.useState(()=>{const n={};return i.forEach((p,t)=>{t===0?n[p.name]=p.options||[]:n[p.name]=[]}),n}),[F,j]=w.useState({}),C=async(n,p)=>{var t;if(!n.apiEndpoint)return[];j(c=>({...c,[n.name]:!0}));try{let c=n.apiEndpoint;if(p){const u=encodeURIComponent(String(p)),y=(t=i[i.indexOf(n)-1])==null?void 0:t.name;y&&(c=c.replace(`{${y}}`,u))}const v=await fetch(`${x}${c}`);if(!v.ok)throw new Error(`HTTP error! status: ${v.status}`);const S=await v.json();return Array.isArray(S)?S.map(u=>({value:String(u.id||u.value||""),label:String(u.name||u.label||"Unknown")})):[]}catch{return[]}finally{j(c=>({...c,[n.name]:!1}))}};w.useEffect(()=>{(async()=>{const p={};for(let t=0;t =r||D<0||g&&P>=u}function C(){var U=Wf();if(E(U))return L(U);p=setTimeout(C,_(U))}function L(U){return p=void 0,S&&o?T(U):(o=l=void 0,f)}function z(){p!==void 0&&clearTimeout(p),h=0,o=m=l=p=void 0}function F(){return p===void 0?f:L(Wf())}function ee(){var U=Wf(),D=E(U);if(o=arguments,l=this,m=U,D){if(p===void 0)return b(m);if(g)return clearTimeout(p),p=setTimeout(C,r),T(m)}return p===void 0&&(p=setTimeout(C,r)),f}return ee.cancel=z,ee.flush=F,ee}function yp(t,r,a){(a!==void 0&&!_s(t[r],a)||a===void 0&&!(r in t))&&Qp(t,r,a)}function lC(t){return Er(t)&&Tu(t)}function vp(t,r){if(!(r==="constructor"&&typeof t[r]=="function")&&r!="__proto__")return t[r]}function uC(t){return gT(t,gx(t))}function cC(t,r,a,o,l,u,f){var p=vp(t,a),m=vp(r,a),h=f.get(m);if(h){yp(t,a,h);return}var y=u?u(p,m,a+"",t,r,f):void 0,g=y===void 0;if(g){var S=ir(m),T=!S&&ds(m),b=!S&&!T&&tm(m);y=m,S||T||b?ir(p)?y=p:lC(p)?y=rT(p):T?(g=!1,y=Sx(m,!0)):b?(g=!1,y=_x(m,!0)):y=[]:WA(m)||lu(m)?(y=p,lu(p)?y=uC(p):(!Ln(p)||Kp(p))&&(y=Ex(m))):g=!1}g&&(f.set(m,y),l(y,m,o,u,f),f.delete(m)),yp(t,a,y)}function Cx(t,r,a,o,l){t!==r&&rC(r,function(u,f){if(l||(l=new Sr),Ln(u))cC(t,r,f,a,Cx,o,l);else{var p=o?o(vp(t,f),u,f+"",t,r,l):void 0;p===void 0&&(p=u),yp(t,f,p)}},gx)}var fC={"&":"&","<":"<",">":">",'"':""","'":"'"},dC=eO(fC),Dx=/[&<>"']/g,pC=RegExp(Dx.source);function mC(t){return t=yx(t),t&&pC.test(t)?t.replace(Dx,dC):t}var hC=Object.prototype,gC=hC.hasOwnProperty;function yC(t,r){return t!=null&&gC.call(t,r)}function Nx(t,r){return t!=null&&tC(t,r,yC)}function Ea(t,r){return Rx(t,r)}var bp=ST(function(t,r,a){Cx(t,r,a)});function vC(t,r,a,o){if(!Ln(t))return t;r=rm(r,t);for(var l=-1,u=r.length,f=u-1,p=t;p!=null&&++l-1e3&&H<1e3||U.call(/e/,Z))return Z;var Be=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof H=="number"){var ke=H<0?-ne(-H):ne(H);if(ke!==H){var We=String(ke),Le=L.call(Z,We.length+1);return z.call(We,Be,"$&_")+"."+z.call(z.call(Le,/([0-9]{3})/g,"$&_"),/_$/,"")}}return z.call(Z,Be,"$&_")}var Y=SC,le=Y.custom,de=Qe(le)?le:null,Q={__proto__:null,double:'"',single:"'"},J={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};td=function H(Z,Be,ke,We){var Le=Be||{};if(dt(Le,"quoteStyle")&&!dt(Q,Le.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(dt(Le,"maxStringLength")&&(typeof Le.maxStringLength=="number"?Le.maxStringLength<0&&Le.maxStringLength!==1/0:Le.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var sn=dt(Le,"customInspect")?Le.customInspect:!0;if(typeof sn!="boolean"&&sn!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(dt(Le,"indent")&&Le.indent!==null&&Le.indent!==" "&&!(parseInt(Le.indent,10)===Le.indent&&Le.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(dt(Le,"numericSeparator")&&typeof Le.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Yt=Le.numericSeparator;if(typeof Z>"u")return"undefined";if(Z===null)return"null";if(typeof Z=="boolean")return Z?"true":"false";if(typeof Z=="string")return _e(Z,Le);if(typeof Z=="number"){if(Z===0)return 1/0/Z>0?"0":"-0";var we=String(Z);return Yt?j(Z,we):we}if(typeof Z=="bigint"){var Ze=String(Z)+"n";return Yt?j(Z,Ze):Ze}var Rt=typeof Le.depth>"u"?5:Le.depth;if(typeof ke>"u"&&(ke=0),ke>=Rt&&Rt>0&&typeof Z=="object")return Oe(Z)?"[Array]":"[Object]";var At=Pn(Le,ke);if(typeof We>"u")We=[];else if(kt(We,Z)>=0)return"[Circular]";function Mt(wr,fr,io){if(fr&&(We=k.call(We),We.push(fr)),io){var Tr={depth:Le.depth};return dt(Le,"quoteStyle")&&(Tr.quoteStyle=Le.quoteStyle),H(wr,Tr,ke+1,We)}return H(wr,Le,ke+1,We)}if(typeof Z=="function"&&!Ae(Z)){var gt=it(Z),Wt=on(Z,Mt);return"[Function"+(gt?": "+gt:" (anonymous)")+"]"+(Wt.length>0?" { "+P.call(Wt,", ")+" }":"")}if(Qe(Z)){var ur=ae?z.call(String(Z),/^(Symbol\(.*\))_[^)]*$/,"$1"):I.call(Z);return typeof Z=="object"&&!ae?Ke(ur):ur}if(Pe(Z)){for(var zt="<"+ee.call(String(Z.nodeName)),Xt=Z.attributes||[],Kn=0;Kn Date: {date} Date: {date} Date: {date}=h;--m)l.point(O[m],x[m]);l.lineEnd(),l.areaEnd()}g&&(O[d]=+e(y,d,f),x[d]=+t(y,d,f),l.point(n?+n(y,d,f):O[d],r?+r(y,d,f):x[d]))}if(b)return l=null,b+""||null}function s(){return Nm().defined(i).curve(o).context(a)}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:re(+f),n=null,c):e},c.x0=function(f){return arguments.length?(e=typeof f=="function"?f:re(+f),c):e},c.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:re(+f),c):n},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:re(+f),r=null,c):t},c.y0=function(f){return arguments.length?(t=typeof f=="function"?f:re(+f),c):t},c.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:re(+f),c):r},c.lineX0=c.lineY0=function(){return s().x(e).y(t)},c.lineY1=function(){return s().x(e).y(r)},c.lineX1=function(){return s().x(n).y(t)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:re(!!f),c):i},c.curve=function(f){return arguments.length?(o=f,a!=null&&(l=o(a)),c):o},c.context=function(f){return arguments.length?(f==null?a=l=null:l=o(a=f),c):a},c}class Dm{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function uw(e){return new Dm(e,!0)}function sw(e){return new Dm(e,!1)}const As={draw(e,t){const r=gt(t/Fi);e.moveTo(r,0),e.arc(0,0,r,0,Ra)}},cw={draw(e,t){const r=gt(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},$m=gt(1/3),fw=$m*2,dw={draw(e,t){const r=gt(t/fw),n=r*$m;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},vw={draw(e,t){const r=gt(t),n=-r/2;e.rect(n,n,r,r)}},hw=.8908130915292852,Rm=Bi(Fi/10)/Bi(7*Fi/10),pw=Bi(Ra/10)*Rm,mw=-Cm(Ra/10)*Rm,yw={draw(e,t){const r=gt(t*hw),n=pw*r,i=mw*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=Ra*a/5,l=Cm(o),u=Bi(o);e.lineTo(u*r,-l*r),e.lineTo(l*n-u*i,u*n+l*i)}e.closePath()}},No=gt(3),gw={draw(e,t){const r=-gt(t/(No*3));e.moveTo(0,r*2),e.lineTo(-No*r,-r),e.lineTo(No*r,-r),e.closePath()}},nt=-.5,it=gt(3)/2,bu=1/gt(12),bw=(bu/2+1)*3,xw={draw(e,t){const r=gt(t/bw),n=r/2,i=r*bu,a=n,o=r*bu+r,l=-a,u=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(l,u),e.lineTo(nt*n-it*i,it*n+nt*i),e.lineTo(nt*a-it*o,it*a+nt*o),e.lineTo(nt*l-it*u,it*l+nt*u),e.lineTo(nt*n+it*i,nt*i-it*n),e.lineTo(nt*a+it*o,nt*o-it*a),e.lineTo(nt*l+it*u,nt*u-it*l),e.closePath()}};function ww(e,t){let r=null,n=Ps(i);e=typeof e=="function"?e:re(e||As),t=typeof t=="function"?t:re(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:re(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:re(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function Wi(){}function Ki(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Lm(e){this._context=e}Lm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ki(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ki(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Pw(e){return new Lm(e)}function zm(e){this._context=e}zm.prototype={areaStart:Wi,areaEnd:Wi,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ki(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ow(e){return new zm(e)}function Bm(e){this._context=e}Bm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Ki(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Aw(e){return new Bm(e)}function Fm(e){this._context=e}Fm.prototype={areaStart:Wi,areaEnd:Wi,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Sw(e){return new Fm(e)}function Sf(e){return e<0?-1:1}function jf(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),l=(a*i+o*n)/(n+i);return(Sf(a)+Sf(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function Ef(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Do(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,l=(a-n)/3;e._context.bezierCurveTo(n+l,i+l*t,a-l,o-l*r,a,o)}function qi(e){this._context=e}qi.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Do(this,this._t0,Ef(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Do(this,Ef(this,r=jf(this,e,t)),r);break;default:Do(this,this._t0,r=jf(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Wm(e){this._context=new Km(e)}(Wm.prototype=Object.create(qi.prototype)).point=function(e,t){qi.prototype.point.call(this,t,e)};function Km(e){this._context=e}Km.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function jw(e){return new qi(e)}function Ew(e){return new Wm(e)}function qm(e){this._context=e}qm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=_f(e),i=_f(t),a=0,o=1;o=h;--m)l.point(O[m],x[m]);l.lineEnd(),l.areaEnd()}g&&(O[d]=+e(y,d,f),x[d]=+t(y,d,f),l.point(n?+n(y,d,f):O[d],r?+r(y,d,f):x[d]))}if(b)return l=null,b+""||null}function s(){return Nm().defined(i).curve(o).context(a)}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:re(+f),n=null,c):e},c.x0=function(f){return arguments.length?(e=typeof f=="function"?f:re(+f),c):e},c.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:re(+f),c):n},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:re(+f),r=null,c):t},c.y0=function(f){return arguments.length?(t=typeof f=="function"?f:re(+f),c):t},c.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:re(+f),c):r},c.lineX0=c.lineY0=function(){return s().x(e).y(t)},c.lineY1=function(){return s().x(e).y(r)},c.lineX1=function(){return s().x(n).y(t)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:re(!!f),c):i},c.curve=function(f){return arguments.length?(o=f,a!=null&&(l=o(a)),c):o},c.context=function(f){return arguments.length?(f==null?a=l=null:l=o(a=f),c):a},c}class Dm{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function uw(e){return new Dm(e,!0)}function sw(e){return new Dm(e,!1)}const As={draw(e,t){const r=gt(t/Fi);e.moveTo(r,0),e.arc(0,0,r,0,Ra)}},cw={draw(e,t){const r=gt(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},$m=gt(1/3),fw=$m*2,dw={draw(e,t){const r=gt(t/fw),n=r*$m;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},vw={draw(e,t){const r=gt(t),n=-r/2;e.rect(n,n,r,r)}},hw=.8908130915292852,Rm=Bi(Fi/10)/Bi(7*Fi/10),pw=Bi(Ra/10)*Rm,mw=-Cm(Ra/10)*Rm,yw={draw(e,t){const r=gt(t*hw),n=pw*r,i=mw*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=Ra*a/5,l=Cm(o),u=Bi(o);e.lineTo(u*r,-l*r),e.lineTo(l*n-u*i,u*n+l*i)}e.closePath()}},No=gt(3),gw={draw(e,t){const r=-gt(t/(No*3));e.moveTo(0,r*2),e.lineTo(-No*r,-r),e.lineTo(No*r,-r),e.closePath()}},nt=-.5,it=gt(3)/2,bu=1/gt(12),bw=(bu/2+1)*3,xw={draw(e,t){const r=gt(t/bw),n=r/2,i=r*bu,a=n,o=r*bu+r,l=-a,u=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(l,u),e.lineTo(nt*n-it*i,it*n+nt*i),e.lineTo(nt*a-it*o,it*a+nt*o),e.lineTo(nt*l-it*u,it*l+nt*u),e.lineTo(nt*n+it*i,nt*i-it*n),e.lineTo(nt*a+it*o,nt*o-it*a),e.lineTo(nt*l+it*u,nt*u-it*l),e.closePath()}};function ww(e,t){let r=null,n=Ps(i);e=typeof e=="function"?e:re(e||As),t=typeof t=="function"?t:re(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:re(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:re(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function Wi(){}function Ki(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Lm(e){this._context=e}Lm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ki(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ki(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Pw(e){return new Lm(e)}function zm(e){this._context=e}zm.prototype={areaStart:Wi,areaEnd:Wi,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ki(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ow(e){return new zm(e)}function Bm(e){this._context=e}Bm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Ki(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Aw(e){return new Bm(e)}function Fm(e){this._context=e}Fm.prototype={areaStart:Wi,areaEnd:Wi,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Sw(e){return new Fm(e)}function Sf(e){return e<0?-1:1}function jf(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),l=(a*i+o*n)/(n+i);return(Sf(a)+Sf(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function Ef(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Do(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,l=(a-n)/3;e._context.bezierCurveTo(n+l,i+l*t,a-l,o-l*r,a,o)}function qi(e){this._context=e}qi.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Do(this,this._t0,Ef(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Do(this,Ef(this,r=jf(this,e,t)),r);break;default:Do(this,this._t0,r=jf(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Wm(e){this._context=new Km(e)}(Wm.prototype=Object.create(qi.prototype)).point=function(e,t){qi.prototype.point.call(this,t,e)};function Km(e){this._context=e}Km.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function jw(e){return new qi(e)}function Ew(e){return new Wm(e)}function qm(e){this._context=e}qm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=_f(e),i=_f(t),a=0,o=1;oExperience Certificate
Joining Letter
No Objection Certificate
t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=b.fromJSON(e,t.content),s=e.nodeType(t.type).create(t.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};_e.prototype.text=void 0;class zn extends _e{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):el(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new zn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new zn(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function el(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class ht{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new mc(e,t);if(r.next==null)return ht.empty;let i=tl(r);r.next&&r.err("Unexpected trailing text");let s=Cc(xc(i));return Mc(s,r),s}matchType(e){for(let t=0;tt.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=b.fromJSON(e,t.content),s=e.nodeType(t.type).create(t.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};_e.prototype.text=void 0;class zn extends _e{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):el(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new zn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new zn(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function el(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class ht{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new mc(e,t);if(r.next==null)return ht.empty;let i=tl(r);r.next&&r.err("Unexpected trailing text");let s=Cc(xc(i));return Mc(s,r),s}matchType(e){for(let t=0;t