Files
alrahma_sunday_school_api/apps/dashboard/.next/static/chunks/2yx4p5x7p8m4o.js
T
2026-06-11 03:22:12 -04:00

1 line
44 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,78740,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.SEVERITY_COLORS=a.DAMAGE_ZONE_COORDS=void 0,a.DAMAGE_ZONE_COORDS={hood:{x:48,y:8,w:64,h:28},roof:{x:48,y:52,w:64,h:56},trunk:{x:48,y:124,w:64,h:28},"front-bumper":{x:48,y:0,w:64,h:10},"rear-bumper":{x:48,y:150,w:64,h:10},"front-left-fender":{x:20,y:10,w:30,h:35},"front-right-fender":{x:110,y:10,w:30,h:35},"front-left-door":{x:20,y:52,w:30,h:30},"front-right-door":{x:110,y:52,w:30,h:30},"rear-left-door":{x:20,y:82,w:30,h:30},"rear-right-door":{x:110,y:82,w:30,h:30},"rear-left-fender":{x:20,y:112,w:30,h:35},"rear-right-fender":{x:110,y:112,w:30,h:35},windshield:{x:52,y:38,w:56,h:18},"rear-window":{x:52,y:104,w:56,h:18},"left-mirror":{x:8,y:50,w:14,h:10},"right-mirror":{x:138,y:50,w:14,h:10},"front-left-wheel":{x:10,y:24,w:22,h:26},"front-right-wheel":{x:128,y:24,w:22,h:26},"rear-left-wheel":{x:10,y:110,w:22,h:26},"rear-right-wheel":{x:128,y:110,w:22,h:26},interior:{x:55,y:58,w:50,h:44},"under-hood":{x:52,y:10,w:56,h:20},undercarriage:{x:52,y:130,w:56,h:20}},a.SEVERITY_COLORS={SCRATCH:"#F59E0B",DENT:"#EF4444",CRACK:"#8B5CF6",MISSING:"#374151",OTHER:"#6B7280"}},33556,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.FUEL_POLICY_LABELS=void 0,a.FUEL_POLICY_LABELS={FULL_TO_FULL:{en:"Full-to-Full: Return vehicle with a full tank. A refueling fee applies if returned with less fuel.",fr:"Plein à plein : retournez le véhicule avec le plein. Des frais de ravitaillement s'appliquent sinon.",ar:"ممتلئ إلى ممتلئ: يجب إعادة السيارة بخزان ممتلئ. رسوم إضافية في حال الإعادة بمستوى أقل."},FULL_TO_EMPTY:{en:"Full-to-Empty: Vehicle is provided with a full tank. No refund for unused fuel upon return.",fr:"Plein à vide : le véhicule est livré avec le plein. Aucun remboursement n'est accordé pour le carburant non utilisé.",ar:"ممتلئ إلى فارغ: تُسلَّم السيارة بخزان ممتلئ. لا استرداد للوقود غير المستخدم."},SAME_TO_SAME:{en:"Same-to-Same: Return vehicle with the same fuel level as at pickup.",fr:"Même niveau : retournez le véhicule avec le même niveau de carburant qu'au départ.",ar:"نفس المستوى: أعد السيارة بنفس مستوى الوقود عند الاستلام."},PREPAID:{en:"Prepaid Fuel: You pre-purchase a full tank at a fixed rate. Return at any fuel level.",fr:"Carburant prépayé : vous achetez un plein à tarif fixe à l'avance. Retour possible avec n'importe quel niveau.",ar:"الوقود المدفوع مسبقاً: تدفع مقدماً ثمن خزان كامل بسعر ثابت. يمكن إعادة السيارة بأي مستوى."},FREE:{en:"Fuel Included: Fuel cost is included in the rental price.",fr:"Carburant inclus : le coût du carburant est inclus dans le tarif de location.",ar:"الوقود مشمول: تكلفة الوقود مشمولة في سعر الإيجار."}}},89456,(e,t,a)=>{"use strict";function r(e){if(e)return e;let t="object"==typeof globalThis&&"document"in globalThis?globalThis.document?.documentElement?.lang:void 0;return"en"===t||"fr"===t||"ar"===t?t:"en"}function i(e,t="MAD"){return"ar"===r(e)?"درهم":"MAD"}Object.defineProperty(a,"__esModule",{value:!0}),a.PLAN_FEATURES=a.PLAN_PRICES=void 0,a.getCurrencyLabel=i,a.formatCurrency=function(e,t="MAD",a){let l=r(a),s=new Intl.NumberFormat({en:"en-US",fr:"fr-FR",ar:"ar-MA"}[l],{minimumFractionDigits:2,maximumFractionDigits:2}).format(e/100),n=i(l,t);return"en"===l?`${n} ${s}`:`${s} ${n}`},a.PLAN_PRICES={STARTER:{MONTHLY:{MAD:2990},ANNUAL:{MAD:29900}},GROWTH:{MONTHLY:{MAD:3990},ANNUAL:{MAD:39900}},PRO:{MONTHLY:{MAD:99900},ANNUAL:{MAD:999e3}}},a.PLAN_FEATURES={STARTER:["Up to 10 vehicles","1 user account","Basic analytics","Marketplace listing"],GROWTH:["Up to 50 vehicles","5 user accounts","Full analytics","Priority marketplace placement","Custom branding"],PRO:["Unlimited vehicles","Unlimited user accounts","Advanced reports","API access","Dedicated support"]}},82110,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.defaultMarketplaceHomepageContent=a.defaultMarketplaceHomepageSections=void 0,a.cloneMarketplaceHomepageContent=function(){return JSON.parse(JSON.stringify(a.defaultMarketplaceHomepageContent))},a.resolveMarketplaceHomepageSections=function(e){let t=e?.length?e:a.defaultMarketplaceHomepageSections;return t.filter((e,a)=>t.indexOf(e)===a)},a.defaultMarketplaceHomepageSections=["hero","surface","pillars","audiences","features","steps","closing"],a.defaultMarketplaceHomepageContent={en:{sections:a.defaultMarketplaceHomepageSections,heroKicker:"RentalDriveGo",heroTitle:"Marketplace discovery with a sharper front door.",heroBody:"Rental companies run private operations, renters browse a shared marketplace, and every booking ends on the companys own branded checkout.",startTrial:"Start free trial",exploreVehicles:"Explore vehicles",surfaceLabel:"Marketplace surface",surfaceTitle:"Designed for two audiences at once.",surfaceBody:"Operators need control, renters need confidence. The marketplace should show both without feeling like a template.",liveLabel:"Live network",trustedFleets:"Trusted fleets",brandedFlows:"Branded booking flows",multiTenant:"Multi-tenant operations",companyKicker:"Operator workflow",companyTitle:"Manage inventory, offers, billing, and staff from one control layer.",companyBody:"Publish inventory once, decide what appears publicly, and keep contracts, payments, and reporting isolated per company.",renterKicker:"Renter experience",renterTitle:"Let renters compare quickly, then hand them off to the right company site.",renterBody:"The marketplace works as a discovery engine, not a dead-end aggregator. Search here, reserve there, and pay direct.",pillars:[["Unified publishing","Vehicle photos, pricing, and offers flow from one admin workflow into marketplace discovery and branded booking pages."],["Qualified discovery","Featured offers, location-aware browsing, and company reputation signals help renters narrow options fast."],["Direct revenue path","Bookings move into the companys own payment flow, so customer ownership and cash collection stay with the business."]].map(([e,t])=>({title:e,body:t})),metrics:[["01","Shared marketplace visibility"],["02","Direct company checkout"],["03","Company-owned payments"]].map(([e,t])=>({value:e,label:t})),featureLabel:"What the product covers",features:["Fleet management with multi-photo uploads","Marketplace offers and redirect booking flow","Branded public booking site per company","Customer CRM, analytics, and billing controls"],stepsTitle:"How companies launch",steps:[["1","Create your company workspace","Pick a plan, launch your 90-day trial, and verify the owner account."],["2","Publish vehicles and offers","Upload photos once and control what appears on the marketplace and branded site."],["3","Accept bookings on your own site","Renters discover your fleet on RentalDriveGo, then pay you directly on your branded booking flow."]].map(([e,t,a])=>({step:e,title:t,body:a})),stepLabel:"Step",readyKicker:"Ready to launch",readyTitle:"The marketplace homepage should explain the product in seconds.",readyBody:"Use the marketplace to attract demand, then move renters into a branded experience that keeps pricing, payments, and trust tied to your company.",viewPricing:"View pricing",createWorkspace:"Create workspace"},fr:{sections:a.defaultMarketplaceHomepageSections,heroKicker:"RentalDriveGo",heroTitle:"Une vitrine marketplace plus claire et plus percutante.",heroBody:"Les entreprises de location gèrent leurs opérations en privé, les clients parcourent une marketplace commune et chaque réservation se finalise sur le parcours de paiement aux couleurs de l'entreprise.",startTrial:"Commencer lessai gratuit",exploreVehicles:"Explorer les véhicules",surfaceLabel:"Vitrine marketplace",surfaceTitle:"Pensée pour deux audiences à la fois.",surfaceBody:"Les opérateurs veulent du contrôle, les clients veulent de la confiance. La marketplace doit montrer les deux sans ressembler à un modèle générique.",liveLabel:"Réseau actif",trustedFleets:"Flottes fiables",brandedFlows:"Parcours de marque",multiTenant:"Opérations multi-tenant",companyKicker:"Flux opérateur",companyTitle:"Pilotez linventaire, les offres, la facturation et l’équipe depuis un seul centre de contrôle.",companyBody:"Publiez une seule fois, choisissez ce qui apparaît publiquement, et gardez contrats, paiements et rapports isolés par entreprise.",renterKicker:"Expérience client",renterTitle:"Laissez les clients comparer rapidement, puis redirigez-les vers le bon site dentreprise.",renterBody:"La marketplace sert de moteur de découverte, pas dagrégateur sans suite. Recherche ici, réservation là-bas, paiement direct.",pillars:[["Publication unifiée","Les photos, tarifs et offres circulent depuis un seul flux dadministration vers la découverte marketplace et les pages de réservation de marque."],["Découverte qualifiée","Offres mises en avant, navigation par localisation et signaux de réputation aident les clients à filtrer rapidement."],["Revenus en direct","Les réservations basculent vers le paiement propre à lentreprise afin de préserver la relation client et lencaissement."]].map(([e,t])=>({title:e,body:t})),metrics:[["01","Visibilité marketplace partagée"],["02","Paiement direct entreprise"],["03","Paiements gérés par lentreprise"]].map(([e,t])=>({value:e,label:t})),featureLabel:"Ce que couvre le produit",features:["Gestion de flotte avec téléversement de plusieurs photos","Offres marketplace et redirection vers la réservation","Site public de réservation par entreprise","CRM client, analytics et contrôle de facturation"],stepsTitle:"Comment les entreprises démarrent",steps:[["1","Créez votre espace entreprise","Choisissez un plan, lancez votre essai de 90 jours et vérifiez le compte propriétaire."],["2","Publiez véhicules et offres","Téléversez une seule fois et contrôlez ce qui apparaît sur la marketplace et le site de marque."],["3","Acceptez les réservations sur votre site","Les clients découvrent votre flotte sur RentalDriveGo puis paient directement via votre parcours de réservation."]].map(([e,t,a])=>({step:e,title:t,body:a})),stepLabel:"Étape",readyKicker:"Prêt à démarrer",readyTitle:"La page daccueil marketplace doit présenter le produit en quelques secondes.",readyBody:"Utilisez la marketplace pour capter la demande, puis orientez les clients vers une expérience de marque où les prix, les paiements et la confiance restent attachés à votre entreprise.",viewPricing:"Voir les tarifs",createWorkspace:"Créer lespace"},ar:{sections:a.defaultMarketplaceHomepageSections,heroKicker:"RentalDriveGo",heroTitle:"واجهة سوق أكثر وضوحاً وتأثيراً.",heroBody:"شركات التأجير تدير عملياتها بشكل خاص، والمستأجرون يتصفحون سوقاً مشتركاً، وكل حجز ينتهي في صفحة دفع تحمل هوية الشركة ذاتها.",startTrial:"ابدأ التجربة المجانية",exploreVehicles:"استكشف السيارات",surfaceLabel:"واجهة السوق",surfaceTitle:"مصممة لجمهورين في الوقت نفسه.",surfaceBody:"المشغلون يريدون التحكم، والمستأجرون يريدون الثقة. يجب أن تُظهر المنصة الأمرين معاً من دون أن تبدو كقالب عادي.",liveLabel:"شبكة نشطة",trustedFleets:"أساطيل موثوقة",brandedFlows:"مسارات حجز مخصصة",multiTenant:"عمليات متعددة الشركات",companyKicker:"سير عمل المشغل",companyTitle:"تحكم في المخزون والعروض والفوترة والفريق من طبقة تشغيل واحدة.",companyBody:"انشر المخزون مرة واحدة، وحدد ما يظهر للعامة، واحتفظ بالعقود والمدفوعات والتقارير معزولة لكل شركة.",renterKicker:"تجربة المستأجر",renterTitle:"دع المستأجرين يقارنون بسرعة ثم وجّههم إلى موقع الشركة المناسب.",renterBody:"هذه المنصة محرك لاكتشاف الخيارات، وليست مُجمِّعاً بلا مسار واضح. ابحث هنا، احجز هناك، وادفع مباشرة للشركة.",pillars:[["نشر موحد","صور السيارات والأسعار والعروض تنتقل من سير إدارة واحد إلى السوق وصفحات الحجز ذات الهوية الخاصة."],["اكتشاف مؤهل","تساعد العروض المميزة، والتصفح حسب الموقع، وإشارات السمعة المستأجرين على تحديد خياراتهم بسرعة."],["مسار إيراد مباشر","تنتقل الحجوزات إلى صفحة الدفع الخاصة بالشركة حتى تبقى علاقة العميل والتحصيل المالي بيد الشركة نفسها."]].map(([e,t])=>({title:e,body:t})),metrics:[["01","ظهور مشترك في السوق"],["02","دفع مباشر للشركة"],["03","مدفوعات مملوكة للشركة"]].map(([e,t])=>({value:e,label:t})),featureLabel:"ما الذي يقدمه المنتج",features:["إدارة الأسطول مع رفع عدة صور","عروض السوق والتحويل إلى مسار الحجز","موقع حجز عام مخصص لكل شركة","إدارة العملاء والتحليلات والفوترة"],stepsTitle:"كيف تبدأ الشركات",steps:[["1","أنشئ مساحة عمل شركتك","اختر الخطة وابدأ تجربتك لمدة 14 يوماً ثم فعّل حساب المالك."],["2","انشر السيارات والعروض","ارفع الصور مرة واحدة وتحكم فيما يظهر في السوق وفي الموقع المخصص."],["3","استقبل الحجوزات على موقعك","يكتشف المستأجرون أسطولك على RentalDriveGo ثم يدفعون مباشرة عبر مسار الحجز الخاص بك."]].map(([e,t,a])=>({step:e,title:t,body:a})),stepLabel:"الخطوة",readyKicker:"جاهز للانطلاق",readyTitle:"يجب أن تشرح الصفحة الرئيسية قيمة المنصة خلال ثوانٍ.",readyBody:"استخدم السوق لجذب الطلب، ثم انقل المستأجرين إلى تجربة تحمل هوية شركتك، بحيث تبقى الأسعار والمدفوعات والثقة مرتبطة بنشاطك.",viewPricing:"عرض الأسعار",createWorkspace:"إنشاء المساحة"}}},64712,(e,t,a)=>{"use strict";var r=e.e&&e.e.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var i=Object.getOwnPropertyDescriptor(t,a);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,i)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),i=e.e&&e.e.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||r(t,e,a)};Object.defineProperty(a,"__esModule",{value:!0}),i(e.r(78740),a),i(e.r(33556),a),i(e.r(89456),a),i(e.r(82110),a)},22315,(e,t,a)=>{e.e,t.exports=function(){"use strict";var e="millisecond",t="second",a="minute",r="hour",i="week",l="month",s="quarter",n="year",o="date",c="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,u=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p=function(e,t,a){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(a)+e},m="en",f={};f[m]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],a=e%100;return"["+e+(t[(a-20)%10]||t[a]||t[0])+"]"}};var h="$isDayjsObject",b=function(e){return e instanceof g||!(!e||!e[h])},x=function e(t,a,r){var i;if(!t)return m;if("string"==typeof t){var l=t.toLowerCase();f[l]&&(i=l),a&&(f[l]=a,i=l);var s=t.split("-");if(!i&&s.length>1)return e(s[0])}else{var n=t.name;f[n]=t,i=n}return!r&&i&&(m=i),i||!r&&m},v=function(e,t){if(b(e))return e.clone();var a="object"==typeof t?t:{};return a.date=e,a.args=arguments,new g(a)},y={s:p,z:function(e){var t=-e.utcOffset(),a=Math.abs(t);return(t<=0?"+":"-")+p(Math.floor(a/60),2,"0")+":"+p(a%60,2,"0")},m:function e(t,a){if(t.date()<a.date())return-e(a,t);var r=12*(a.year()-t.year())+(a.month()-t.month()),i=t.clone().add(r,l),s=a-i<0,n=t.clone().add(r+(s?-1:1),l);return+(-(r+(a-i)/(s?i-n:n-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(c){return({M:l,y:n,w:i,d:"day",D:o,h:r,m:a,s:t,ms:e,Q:s})[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}};y.l=x,y.i=b,y.w=function(e,t){return v(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var g=function(){function p(e){this.$L=x(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[h]=!0}var m=p.prototype;return m.parse=function(e){this.$d=function(e){var t=e.date,a=e.utc;if(null===t)return new Date(NaN);if(y.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(d);if(r){var i=r[2]-1||0,l=(r[7]||"0").substring(0,3);return a?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,l)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,l)}}return new Date(t)}(e),this.init()},m.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},m.$utils=function(){return y},m.isValid=function(){return this.$d.toString()!==c},m.isSame=function(e,t){var a=v(e);return this.startOf(t)<=a&&a<=this.endOf(t)},m.isAfter=function(e,t){return v(e)<this.startOf(t)},m.isBefore=function(e,t){return this.endOf(t)<v(e)},m.$g=function(e,t,a){return y.u(e)?this[t]:this.set(a,e)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(e,s){var c=this,d=!!y.u(s)||s,u=y.p(e),p=function(e,t){var a=y.w(c.$u?Date.UTC(c.$y,t,e):new Date(c.$y,t,e),c);return d?a:a.endOf("day")},m=function(e,t){return y.w(c.toDate()[e].apply(c.toDate("s"),(d?[0,0,0,0]:[23,59,59,999]).slice(t)),c)},f=this.$W,h=this.$M,b=this.$D,x="set"+(this.$u?"UTC":"");switch(u){case n:return d?p(1,0):p(31,11);case l:return d?p(1,h):p(0,h+1);case i:var v=this.$locale().weekStart||0,g=(f<v?f+7:f)-v;return p(d?b-g:b+(6-g),h);case"day":case o:return m(x+"Hours",0);case r:return m(x+"Minutes",1);case a:return m(x+"Seconds",2);case t:return m(x+"Milliseconds",3);default:return this.clone()}},m.endOf=function(e){return this.startOf(e,!1)},m.$set=function(i,s){var c,d=y.p(i),u="set"+(this.$u?"UTC":""),p=((c={}).day=u+"Date",c[o]=u+"Date",c[l]=u+"Month",c[n]=u+"FullYear",c[r]=u+"Hours",c[a]=u+"Minutes",c[t]=u+"Seconds",c[e]=u+"Milliseconds",c)[d],m="day"===d?this.$D+(s-this.$W):s;if(d===l||d===n){var f=this.clone().set(o,1);f.$d[p](m),f.init(),this.$d=f.set(o,Math.min(this.$D,f.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},m.set=function(e,t){return this.clone().$set(e,t)},m.get=function(e){return this[y.p(e)]()},m.add=function(e,s){var o,c=this;e=Number(e);var d=y.p(s),u=function(t){var a=v(c);return y.w(a.date(a.date()+Math.round(t*e)),c)};if(d===l)return this.set(l,this.$M+e);if(d===n)return this.set(n,this.$y+e);if("day"===d)return u(1);if(d===i)return u(7);var p=((o={})[a]=6e4,o[r]=36e5,o[t]=1e3,o)[d]||1,m=this.$d.getTime()+e*p;return y.w(m,this)},m.subtract=function(e,t){return this.add(-1*e,t)},m.format=function(e){var t=this,a=this.$locale();if(!this.isValid())return a.invalidDate||c;var r=e||"YYYY-MM-DDTHH:mm:ssZ",i=y.z(this),l=this.$H,s=this.$m,n=this.$M,o=a.weekdays,d=a.months,p=a.meridiem,m=function(e,a,i,l){return e&&(e[a]||e(t,r))||i[a].slice(0,l)},f=function(e){return y.s(l%12||12,e,"0")},h=p||function(e,t,a){var r=e<12?"AM":"PM";return a?r.toLowerCase():r};return r.replace(u,function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return y.s(t.$y,4,"0");case"M":return n+1;case"MM":return y.s(n+1,2,"0");case"MMM":return m(a.monthsShort,n,d,3);case"MMMM":return m(d,n);case"D":return t.$D;case"DD":return y.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return m(a.weekdaysMin,t.$W,o,2);case"ddd":return m(a.weekdaysShort,t.$W,o,3);case"dddd":return o[t.$W];case"H":return String(l);case"HH":return y.s(l,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return h(l,s,!0);case"A":return h(l,s,!1);case"m":return String(s);case"mm":return y.s(s,2,"0");case"s":return String(t.$s);case"ss":return y.s(t.$s,2,"0");case"SSS":return y.s(t.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")})},m.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},m.diff=function(e,o,c){var d,u=this,p=y.p(o),m=v(e),f=(m.utcOffset()-this.utcOffset())*6e4,h=this-m,b=function(){return y.m(u,m)};switch(p){case n:d=b()/12;break;case l:d=b();break;case s:d=b()/3;break;case i:d=(h-f)/6048e5;break;case"day":d=(h-f)/864e5;break;case r:d=h/36e5;break;case a:d=h/6e4;break;case t:d=h/1e3;break;default:d=h}return c?d:y.a(d)},m.daysInMonth=function(){return this.endOf(l).$D},m.$locale=function(){return f[this.$L]},m.locale=function(e,t){if(!e)return this.$L;var a=this.clone(),r=x(e,t,!0);return r&&(a.$L=r),a},m.clone=function(){return y.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},p}(),D=g.prototype;return v.prototype=D,[["$ms",e],["$s",t],["$m",a],["$H",r],["$W","day"],["$M",l],["$y",n],["$D",o]].forEach(function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),v.extend=function(e,t){return e.$i||(e(t,g,v),e.$i=!0),v},v.locale=x,v.isDayjs=b,v.unix=function(e){return v(1e3*e)},v.en=f[m],v.Ls=f,v.p={},v}()},1982,e=>{"use strict";var t=e.i(43476),a=e.i(71645),r=e.i(22315),i=e.i(64712),l=e.i(94327),s=e.i(56322);let n=["ECONOMY","COMPACT","MIDSIZE","FULLSIZE","SUV","LUXURY","VAN","TRUCK"];function o(){return{title:"",description:"",termsAndConds:"",type:"PERCENTAGE",discountValue:"",specialRate:"",appliesToAll:!0,categories:[],vehicleIds:[],minRentalDays:"",maxRentalDays:"",promoCode:"",maxRedemptions:"",validFrom:(0,r.default)().format("YYYY-MM-DD"),validUntil:(0,r.default)().add(30,"day").format("YYYY-MM-DD"),isActive:!0,isPublic:!0,isFeatured:!1}}let c={en:{title:"Offers",subtitle:"Promotions shown on your site and optionally on the marketplace.",createOffer:"Create Offer",editOffer:"Edit Offer",deleteOffer:"Delete Offer",confirmDelete:"Are you sure you want to delete this offer? This action cannot be undone.",cancel:"Cancel",save:"Save",saving:"Saving…",delete:"Delete",deleting:"Deleting…",ends:"ends",active:"Active",inactive:"Inactive",marketplace:"Marketplace",featured:"Featured",empty:"No offers yet. Create your first offer to attract customers.",labelTitle:"Title *",labelDescription:"Description",labelTerms:"Terms & Conditions",labelType:"Discount Type *",labelDiscount:"Discount Value *",labelSpecialRate:"Special Rate (MAD/day) *",labelAppliesToAll:"Applies to all vehicles",labelCategories:"Vehicle Categories",labelVehicles:"Specific Vehicles",labelVehicleSearch:"Search vehicles…",labelMinDays:"Min Rental Days",labelMaxDays:"Max Rental Days",labelPromoCode:"Promo Code",labelMaxRedemptions:"Max Redemptions",labelValidFrom:"Valid From *",labelValidUntil:"Valid Until *",labelIsActive:"Active",labelIsPublic:"Show on marketplace",labelIsFeatured:"Featured",typePERCENTAGE:"Percentage (%)",typeFIXED_AMOUNT:"Fixed Amount (MAD)",typeFREE_DAY:"Free Day",typeSPECIAL_RATE:"Special Daily Rate",placeholderTitle:"e.g. Summer Promotion",placeholderDescription:"Optional description…",placeholderTerms:"Terms and conditions…",placeholderPromoCode:"e.g. SUMMER20",errorTitle:"Title is required.",errorDiscount:"Please enter a valid discount value.",errorDates:"Valid From and Valid Until are required.",errorDateOrder:"Valid Until must be after Valid From.",failedSave:"Failed to save offer.",failedDelete:"Failed to delete offer.",redemptions:"redemptions",freeDay:"Free day",loadingVehicles:"Loading fleet…",noVehiclesFound:"No vehicles found.",selected:e=>`${e} selected`,categoryLabels:{ECONOMY:"Economy",COMPACT:"Compact",MIDSIZE:"Midsize",FULLSIZE:"Full-size",SUV:"SUV",LUXURY:"Luxury",VAN:"Van",TRUCK:"Truck"}},fr:{title:"Offres",subtitle:"Promotions affichées sur votre site et éventuellement sur la marketplace.",createOffer:"Créer une offre",editOffer:"Modifier l'offre",deleteOffer:"Supprimer l'offre",confirmDelete:"Êtes-vous sûr de vouloir supprimer cette offre ? Cette action est irréversible.",cancel:"Annuler",save:"Enregistrer",saving:"Enregistrement…",delete:"Supprimer",deleting:"Suppression…",ends:"expire le",active:"Actif",inactive:"Inactif",marketplace:"Marketplace",featured:"Mise en avant",empty:"Aucune offre. Créez votre première offre pour attirer des clients.",labelTitle:"Titre *",labelDescription:"Description",labelTerms:"Conditions générales",labelType:"Type de remise *",labelDiscount:"Valeur de la remise *",labelSpecialRate:"Tarif spécial (MAD/jour) *",labelAppliesToAll:"Applicable à tous les véhicules",labelCategories:"Catégories de véhicules",labelVehicles:"Véhicules spécifiques",labelVehicleSearch:"Rechercher des véhicules…",labelMinDays:"Jours de location minimum",labelMaxDays:"Jours de location maximum",labelPromoCode:"Code promo",labelMaxRedemptions:"Nombre max de rédemptions",labelValidFrom:"Valable du *",labelValidUntil:"Valable jusqu'au *",labelIsActive:"Actif",labelIsPublic:"Afficher sur la marketplace",labelIsFeatured:"Mise en avant",typePERCENTAGE:"Pourcentage (%)",typeFIXED_AMOUNT:"Montant fixe (MAD)",typeFREE_DAY:"Jour gratuit",typeSPECIAL_RATE:"Tarif journalier spécial",placeholderTitle:"ex. Promotion estivale",placeholderDescription:"Description optionnelle…",placeholderTerms:"Conditions générales…",placeholderPromoCode:"ex. ETE20",errorTitle:"Le titre est requis.",errorDiscount:"Veuillez saisir une valeur de remise valide.",errorDates:"Les dates de début et de fin sont requises.",errorDateOrder:"La date de fin doit être après la date de début.",failedSave:"Échec de l'enregistrement de l'offre.",failedDelete:"Échec de la suppression de l'offre.",redemptions:"rédemptions",freeDay:"Jour gratuit",loadingVehicles:"Chargement de la flotte…",noVehiclesFound:"Aucun véhicule trouvé.",selected:e=>`${e} s\xe9lectionn\xe9${e>1?"s":""}`,categoryLabels:{ECONOMY:"Économique",COMPACT:"Compacte",MIDSIZE:"Intermédiaire",FULLSIZE:"Grande berline",SUV:"SUV",LUXURY:"Luxe",VAN:"Van",TRUCK:"Camionnette"}},ar:{title:"العروض",subtitle:"عروض ترويجية تظهر في موقعك ويمكن عرضها أيضاً في السوق.",createOffer:"إنشاء عرض",editOffer:"تعديل العرض",deleteOffer:"حذف العرض",confirmDelete:"هل أنت متأكد من حذف هذا العرض؟ لا يمكن التراجع عن هذا الإجراء.",cancel:"إلغاء",save:"حفظ",saving:"جارٍ الحفظ…",delete:"حذف",deleting:"جارٍ الحذف…",ends:"تنتهي في",active:"نشط",inactive:"غير نشط",marketplace:"السوق",featured:"مميز",empty:"لا توجد عروض بعد. أنشئ أول عرض لجذب العملاء.",labelTitle:"العنوان *",labelDescription:"الوصف",labelTerms:"الشروط والأحكام",labelType:"نوع الخصم *",labelDiscount:"قيمة الخصم *",labelSpecialRate:"السعر الخاص (درهم/يوم) *",labelAppliesToAll:"ينطبق على جميع المركبات",labelCategories:"فئات المركبات",labelVehicles:"مركبات محددة",labelVehicleSearch:"ابحث عن مركبة…",labelMinDays:"الحد الأدنى لأيام الإيجار",labelMaxDays:"الحد الأقصى لأيام الإيجار",labelPromoCode:"رمز الترويج",labelMaxRedemptions:"الحد الأقصى للاسترداد",labelValidFrom:"صالح من *",labelValidUntil:"صالح حتى *",labelIsActive:"نشط",labelIsPublic:"عرض في السوق",labelIsFeatured:"مميز",typePERCENTAGE:"نسبة مئوية (%)",typeFIXED_AMOUNT:"مبلغ ثابت (درهم)",typeFREE_DAY:"يوم مجاني",typeSPECIAL_RATE:"سعر يومي خاص",placeholderTitle:"مثال: عرض الصيف",placeholderDescription:"وصف اختياري…",placeholderTerms:"الشروط والأحكام…",placeholderPromoCode:"مثال: SUMMER20",errorTitle:"العنوان مطلوب.",errorDiscount:"يرجى إدخال قيمة خصم صحيحة.",errorDates:"تاريخ البداية والنهاية مطلوبان.",errorDateOrder:"يجب أن يكون تاريخ الانتهاء بعد تاريخ البداية.",failedSave:"فشل حفظ العرض.",failedDelete:"فشل حذف العرض.",redemptions:"استرداد",freeDay:"يوم مجاني",loadingVehicles:"جارٍ تحميل الأسطول…",noVehiclesFound:"لم يتم العثور على مركبات.",selected:e=>`${e} محدد`,categoryLabels:{ECONOMY:"اقتصادية",COMPACT:"مدمجة",MIDSIZE:"متوسطة",FULLSIZE:"كبيرة",SUV:"دفع رباعي",LUXURY:"فاخرة",VAN:"فان",TRUCK:"شاحنة"}}};e.s(["default",0,function(){let{language:e}=(0,s.useDashboardI18n)(),d=c[e],[u,p]=(0,a.useState)([]),[m,f]=(0,a.useState)(null),[h,b]=(0,a.useState)(!1),[x,v]=(0,a.useState)(null),[y,g]=(0,a.useState)(o),[D,A]=(0,a.useState)(null),[w,C]=(0,a.useState)(!1),[N,M]=(0,a.useState)(null),[T,j]=(0,a.useState)(!1),[k,S]=(0,a.useState)([]),[R,E]=(0,a.useState)(!1),[O,$]=(0,a.useState)("");function F(){(0,l.apiFetch)("/offers").then(e=>{p(Array.isArray(e)?e:[]),f(null)}).catch(e=>f(e.message))}async function L(){E(!0);try{let e=await (0,l.apiFetch)("/vehicles?pageSize=200");S(Array.isArray(e)?e:[])}catch{}finally{E(!1)}}async function P(e){v(e),g({title:e.title,description:e.description??"",termsAndConds:e.termsAndConds??"",type:e.type,discountValue:String(e.discountValue),specialRate:null!=e.specialRate?String(e.specialRate):"",appliesToAll:e.appliesToAll,categories:e.categories??[],vehicleIds:e.vehicles?.map(e=>e.vehicleId)??[],minRentalDays:null!=e.minRentalDays?String(e.minRentalDays):"",maxRentalDays:null!=e.maxRentalDays?String(e.maxRentalDays):"",promoCode:e.promoCode??"",maxRedemptions:null!=e.maxRedemptions?String(e.maxRedemptions):"",validFrom:(0,r.default)(e.validFrom).format("YYYY-MM-DD"),validUntil:(0,r.default)(e.validUntil).format("YYYY-MM-DD"),isActive:e.isActive,isPublic:e.isPublic,isFeatured:e.isFeatured}),A(null),$(""),b(!0),L();try{let t=await (0,l.apiFetch)(`/offers/${e.id}`);g(e=>({...e,vehicleIds:Array.isArray(t?.vehicles)?t.vehicles.map(e=>e.vehicleId):[]}))}catch{}}function _(){b(!1),v(null),A(null)}async function V(e){if(e.preventDefault(),A(null),!y.title.trim())return A(d.errorTitle);if(!y.validFrom||!y.validUntil)return A(d.errorDates);if(y.validUntil<=y.validFrom)return A(d.errorDateOrder);if("FREE_DAY"!==y.type){let e=Number(y.discountValue);if(isNaN(e)||e<0)return A(d.errorDiscount)}C(!0);try{let e={title:y.title.trim(),description:y.description.trim()||void 0,termsAndConds:y.termsAndConds.trim()||void 0,type:y.type,discountValue:"FREE_DAY"===y.type?0:Number(y.discountValue),specialRate:y.specialRate?Number(y.specialRate):void 0,appliesToAll:y.appliesToAll,categories:y.appliesToAll?[]:y.categories,minRentalDays:y.minRentalDays?Number(y.minRentalDays):void 0,maxRentalDays:y.maxRentalDays?Number(y.maxRentalDays):void 0,promoCode:y.promoCode.trim()||void 0,maxRedemptions:y.maxRedemptions?Number(y.maxRedemptions):void 0,validFrom:new Date(y.validFrom).toISOString(),validUntil:new Date(y.validUntil).toISOString(),isActive:y.isActive,isPublic:y.isPublic,isFeatured:y.isFeatured,vehicleIds:y.appliesToAll?[]:y.vehicleIds};x?await (0,l.apiFetch)(`/offers/${x.id}`,{method:"PATCH",body:JSON.stringify(e)}):await (0,l.apiFetch)("/offers",{method:"POST",body:JSON.stringify(e)}),_(),F()}catch(e){A(e.message??d.failedSave)}finally{C(!1)}}async function I(){if(N){j(!0);try{await (0,l.apiFetch)(`/offers/${N.id}`,{method:"DELETE"}),M(null),F()}catch(e){A(e.message??d.failedDelete),M(null)}finally{j(!1)}}}(0,a.useEffect)(()=>{F()},[]);let U="ar"===e,Y=k.filter(e=>{let t=O.toLowerCase();return!t||e.make.toLowerCase().includes(t)||e.model.toLowerCase().includes(t)||e.licensePlate.toLowerCase().includes(t)});return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-xl font-semibold text-slate-900",children:d.title}),(0,t.jsx)("p",{className:"text-sm text-slate-500 mt-1",children:d.subtitle})]}),(0,t.jsxs)("button",{type:"button",onClick:function(){v(null),g(o()),A(null),$(""),b(!0),L()},className:"btn-primary shrink-0",children:[(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),d.createOffer]})]}),m&&(0,t.jsx)("div",{className:"card p-4 text-sm text-red-600",children:m}),(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:[u.map(a=>(0,t.jsxs)("div",{className:"card p-5 flex flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-slate-900 truncate",children:a.title}),(0,t.jsxs)("p",{className:"text-sm text-slate-500 mt-0.5",children:[d[`type${a.type}`]," · ",d.ends," ",(0,r.default)(a.validUntil).format("MMM D, YYYY")]})]}),(0,t.jsx)("span",{className:`shrink-0 ${a.isActive?"badge-green":"badge-gray"}`,children:a.isActive?d.active:d.inactive})]}),(0,t.jsx)("p",{className:"text-2xl font-bold text-slate-900",children:"PERCENTAGE"===a.type?`${a.discountValue}%`:"FIXED_AMOUNT"===a.type?(0,i.formatCurrency)(a.discountValue,"MAD",e):"FREE_DAY"===a.type?d.freeDay:"SPECIAL_RATE"===a.type?`${a.specialRate??a.discountValue} ${(0,i.getCurrencyLabel)(e)}${"fr"===e?"/jour":"ar"===e?"/يوم":"/day"}`:String(a.discountValue)}),a.description&&(0,t.jsx)("p",{className:"text-sm text-slate-500 line-clamp-2",children:a.description}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[a.isPublic&&(0,t.jsx)("span",{className:"badge-blue",children:d.marketplace}),a.isFeatured&&(0,t.jsx)("span",{className:"badge-purple",children:d.featured}),a.promoCode&&(0,t.jsx)("span",{className:"badge-amber",children:a.promoCode}),"number"==typeof a.redemptionCount&&(0,t.jsxs)("span",{className:"badge-gray",children:[a.redemptionCount," ",d.redemptions]})]}),(0,t.jsxs)("div",{className:`flex gap-2 mt-auto pt-2 border-t border-slate-100 ${U?"flex-row-reverse":""}`,children:[(0,t.jsx)("button",{type:"button",onClick:()=>P(a),className:"btn-secondary text-xs px-3 py-1.5",children:d.editOffer}),(0,t.jsx)("button",{type:"button",onClick:()=>M(a),className:"btn-danger text-xs px-3 py-1.5",children:d.deleteOffer})]})]},a.id)),0===u.length&&!m&&(0,t.jsx)("div",{className:"col-span-full card p-10 text-center text-sm text-slate-400",children:d.empty})]}),h&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto bg-blue-950/50 p-4",children:(0,t.jsxs)("div",{className:"relative w-full max-w-2xl my-8 card p-6",dir:U?"rtl":"ltr",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold text-slate-900 mb-5",children:x?d.editOffer:d.createOffer}),(0,t.jsxs)("form",{onSubmit:V,className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:d.labelTitle}),(0,t.jsx)("input",{className:"input-field",value:y.title,onChange:e=>g(t=>({...t,title:e.target.value})),placeholder:d.placeholderTitle})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:d.labelDescription}),(0,t.jsx)("textarea",{className:"input-field resize-none",rows:2,value:y.description,onChange:e=>g(t=>({...t,description:e.target.value})),placeholder:d.placeholderDescription})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:d.labelType}),(0,t.jsxs)("select",{className:"input-field",value:y.type,onChange:e=>g(t=>({...t,type:e.target.value})),children:[(0,t.jsx)("option",{value:"PERCENTAGE",children:d.typePERCENTAGE}),(0,t.jsx)("option",{value:"FIXED_AMOUNT",children:d.typeFIXED_AMOUNT}),(0,t.jsx)("option",{value:"FREE_DAY",children:d.typeFREE_DAY}),(0,t.jsx)("option",{value:"SPECIAL_RATE",children:d.typeSPECIAL_RATE})]})]}),(0,t.jsx)("div",{children:"SPECIAL_RATE"===y.type?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:d.labelSpecialRate}),(0,t.jsx)("input",{type:"number",min:0,className:"input-field",value:y.specialRate,onChange:e=>g(t=>({...t,specialRate:e.target.value}))})]}):"FREE_DAY"!==y.type?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:d.labelDiscount}),(0,t.jsx)("input",{type:"number",min:0,className:"input-field",value:y.discountValue,onChange:e=>g(t=>({...t,discountValue:e.target.value}))})]}):null})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:d.labelValidFrom}),(0,t.jsx)("input",{type:"date",className:"input-field",value:y.validFrom,onChange:e=>g(t=>({...t,validFrom:e.target.value}))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:d.labelValidUntil}),(0,t.jsx)("input",{type:"date",className:"input-field",value:y.validUntil,onChange:e=>g(t=>({...t,validUntil:e.target.value}))})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:d.labelPromoCode}),(0,t.jsx)("input",{className:"input-field",value:y.promoCode,onChange:e=>g(t=>({...t,promoCode:e.target.value})),placeholder:d.placeholderPromoCode})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:d.labelMaxRedemptions}),(0,t.jsx)("input",{type:"number",min:1,className:"input-field",value:y.maxRedemptions,onChange:e=>g(t=>({...t,maxRedemptions:e.target.value}))})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:d.labelMinDays}),(0,t.jsx)("input",{type:"number",min:1,className:"input-field",value:y.minRentalDays,onChange:e=>g(t=>({...t,minRentalDays:e.target.value}))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:d.labelMaxDays}),(0,t.jsx)("input",{type:"number",min:1,className:"input-field",value:y.maxRentalDays,onChange:e=>g(t=>({...t,maxRentalDays:e.target.value}))})]})]}),(0,t.jsx)("div",{children:(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm text-slate-700 cursor-pointer select-none",children:[(0,t.jsx)("input",{type:"checkbox",className:"h-4 w-4 rounded border-slate-300 accent-blue-600",checked:y.appliesToAll,onChange:e=>g(t=>({...t,appliesToAll:e.target.checked}))}),d.labelAppliesToAll]})}),!y.appliesToAll&&(0,t.jsxs)("div",{className:"space-y-4 rounded-xl border border-slate-200 p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs font-medium text-slate-600 mb-2",children:d.labelCategories}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>{g(t=>({...t,categories:t.categories.includes(e)?t.categories.filter(t=>t!==e):[...t.categories,e]}))},className:`px-3 py-1 text-xs rounded-full border transition-colors ${y.categories.includes(e)?"bg-blue-600 text-white border-blue-600":"border-slate-200 text-slate-600 hover:bg-slate-50"}`,children:d.categoryLabels[e]},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-slate-600",children:d.labelVehicles}),y.vehicleIds.length>0&&(0,t.jsx)("span",{className:"badge-blue",children:d.selected(y.vehicleIds.length)})]}),(0,t.jsxs)("div",{className:"relative mb-2",children:[(0,t.jsx)("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-slate-400 pointer-events-none",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-4.35-4.35M17 11A6 6 0 111 11a6 6 0 0116 0z"})}),(0,t.jsx)("input",{className:"input-field pl-8 text-xs py-1.5",value:O,onChange:e=>$(e.target.value),placeholder:d.labelVehicleSearch})]}),(0,t.jsx)("div",{className:"max-h-52 overflow-y-auto rounded-lg border border-slate-200 divide-y divide-slate-100",children:R?(0,t.jsx)("p",{className:"px-4 py-6 text-center text-xs text-slate-400",children:d.loadingVehicles}):0===Y.length?(0,t.jsx)("p",{className:"px-4 py-6 text-center text-xs text-slate-400",children:d.noVehiclesFound}):Y.map(e=>{let a=y.vehicleIds.includes(e.id);return(0,t.jsxs)("label",{className:`flex items-center gap-3 px-4 py-2.5 cursor-pointer transition-colors ${a?"bg-blue-50":"hover:bg-slate-50"}`,children:[(0,t.jsx)("input",{type:"checkbox",className:"h-4 w-4 shrink-0 rounded border-slate-300 accent-blue-600",checked:a,onChange:()=>{var t;return t=e.id,void g(e=>({...e,vehicleIds:e.vehicleIds.includes(t)?e.vehicleIds.filter(e=>e!==t):[...e.vehicleIds,t]}))}}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("p",{className:"text-sm font-medium text-slate-800 truncate",children:[e.year," ",e.make," ",e.model]}),(0,t.jsxs)("p",{className:"text-xs text-slate-400",children:[e.licensePlate," · ",d.categoryLabels[e.category]??e.category]})]})]},e.id)})})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-slate-600 mb-1",children:d.labelTerms}),(0,t.jsx)("textarea",{className:"input-field resize-none",rows:2,value:y.termsAndConds,onChange:e=>g(t=>({...t,termsAndConds:e.target.value})),placeholder:d.placeholderTerms})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-x-6 gap-y-2",children:[{key:"isActive",label:d.labelIsActive},{key:"isPublic",label:d.labelIsPublic},{key:"isFeatured",label:d.labelIsFeatured}].map(({key:e,label:a})=>(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm text-slate-700 cursor-pointer select-none",children:[(0,t.jsx)("input",{type:"checkbox",className:"h-4 w-4 rounded border-slate-300 accent-blue-600",checked:y[e],onChange:t=>g(a=>({...a,[e]:t.target.checked}))}),a]},e))}),D&&(0,t.jsx)("p",{className:"text-sm text-red-600",children:D}),(0,t.jsxs)("div",{className:`flex gap-3 pt-2 ${U?"flex-row-reverse":"justify-end"}`,children:[(0,t.jsx)("button",{type:"button",onClick:_,className:"btn-secondary",children:d.cancel}),(0,t.jsx)("button",{type:"submit",disabled:w,className:"btn-primary",children:w?d.saving:d.save})]})]})]})}),N&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-blue-950/50 p-4",children:(0,t.jsxs)("div",{className:"card p-6 w-full max-w-sm",dir:U?"rtl":"ltr",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-slate-900 mb-2",children:d.deleteOffer}),(0,t.jsx)("p",{className:"text-sm text-slate-600 mb-5",children:d.confirmDelete}),D&&(0,t.jsx)("p",{className:"text-sm text-red-600 mb-3",children:D}),(0,t.jsxs)("div",{className:`flex gap-3 ${U?"flex-row-reverse":"justify-end"}`,children:[(0,t.jsx)("button",{type:"button",onClick:()=>M(null),className:"btn-secondary",children:d.cancel}),(0,t.jsx)("button",{type:"button",onClick:I,disabled:T,className:"btn-danger",children:T?d.deleting:d.delete})]})]})})]})}])}]);