1import{n as e}from"./client-DBpB_GqA.js";var t={enabled:!1,autoplay:!0,intervalMs:6e3,transition:`fade`,slides:[]},n=`banner_ads`,r=null,i=null;function a(e){if(!e||typeof e!=`object`)return{...t};let n=e,r=(Array.isArray(n.slides)?n.slides:[]).filter(e=>!!e&&typeof e==`object`).map((e,t)=>({id:typeof e.id==`string`&&e.id?e.id:`slide-${t}-${Date.now()}`,visible:e.visible!==!1,sponsorEn:o(e.sponsorEn),sponsorAr:o(e.sponsorAr),imageUrl:o(e.imageUrl),brandColor:o(e.brandColor)||`22 49% 32%`,overlayOpacity:s(e.overlayOpacity,0,1,.35),accentColor:o(e.accentColor)||`24 50% 80%`,textColor:o(e.textColor)||`24 79% 91%`,titleEn:o(e.titleEn)||``,titleAr:o(e.titleAr)||``,highlightEn:o(e.highlightEn),highlightAr:o(e.highlightAr),bodyEn:o(e.bodyEn),bodyAr:o(e.bodyAr),primaryLabelEn:o(e.primaryLabelEn),primaryLabelAr:o(e.primaryLabelAr),primaryHref:o(e.primaryHref),secondaryLabelEn:o(e.secondaryLabelEn),secondaryLabelAr:o(e.secondaryLabelAr),secondaryHref:o(e.secondaryHref)}));return{enabled:!!n.enabled,autoplay:n.autoplay!==!1,intervalMs:s(n.intervalMs,3e3,2e4,6e3),transition:n.transition===`slide`?`slide`:`fade`,slides:r}}function o(e){return typeof e==`string`&&e.trim()?e:void 0}function s(e,t,n,r){return Math.min(n,Math.max(t,typeof e==`number`&&Number.isFinite(e)?e:r))}function c(e={}){return{id:`slide-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,visible:!0,brandColor:`22 49% 32%`,accentColor:`24 50% 80%`,textColor:`24 79% 91%`,overlayOpacity:.35,titleEn:`New banner`,titleAr:`Ø¨Ø§ÙØ± Ø¬Ø¯ÙØ¯`,...e}}async function l(t=!1){if(!t&&r)return r;if(i)return i;i=(async()=>{let{data:t}=await e.from(`settings`).select(`value`).eq(`key`,n).maybeSingle(),i=a(t?.value);return r=i,i})();try{return await i}finally{i=null}}function u(){r=null}async function d(t){let i=a(t),{data:o}=await e.from(`settings`).select(`id`).eq(`key`,n).maybeSingle();if(o?.id){let{error:t}=await e.from(`settings`).update({value:i,updated_at:new Date().toISOString()}).eq(`id`,o.id);if(t)throw t}else{let{error:t}=await e.from(`settings`).insert({key:n,value:i});if(t)throw t}r=i}function f(t){let r=e.channel(`banner_ads-settings`).on(`postgres_changes`,{event:`*`,schema:`public`,table:`settings`,filter:`key=eq.${n}`},()=>{u(),l(!0).then(t).catch(()=>{})}).subscribe();return()=>{e.removeChannel(r)}}export{f as i,c as n,d as r,l as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.