domma-cms 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/public/js/site.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "domma-cms",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "File-based CMS powered by Domma and Fastify. Run npx domma-cms my-site to create a new project.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "server/server.js",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@fastify/rate-limit": "^10.3.0",
|
|
69
69
|
"@fastify/static": "^8.1.0",
|
|
70
70
|
"bcryptjs": "^3.0.3",
|
|
71
|
-
"domma-js": "^0.19.
|
|
71
|
+
"domma-js": "^0.19.7",
|
|
72
72
|
"dotenv": "^17.2.3",
|
|
73
73
|
"fastify": "5.8.1",
|
|
74
74
|
"gray-matter": "^4.0.3",
|
package/public/js/site.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
$(()=>{const y=window.__CMS_NAV__||{},r=window.__CMS_SITE__||{};if(r.autoTheme?.enabled){let e=function(n){const u=(n||"07:00").split(":");return+u[0]*60+(+u[1]||0)},o=function(){const n=new Date,u=n.getHours()*60+n.getMinutes();return u>=e(t.dayStart)&&u<e(t.nightStart)?t.dayTheme:t.nightTheme};var s=e,l=o;const t=r.autoTheme;Domma.theme.set(o()),setInterval(()=>Domma.theme.set(o()),6e4)}if($("#site-navbar").length&&y.brand){const t={...y.brand};if(t.icon){let e=`<span data-icon="${t.icon}" style="width:1.1em;height:1.1em;margin-right:.35em;vertical-align:middle;"></span>`;t.text&&(e+=`<span class="navbar-brand-text">${t.text}</span>`),t.html=e}Domma.elements.navbar("#site-navbar",{brand:t,items:y.items||[],variant:y.variant||"dark",position:y.position||"sticky",collapsible:!0}),Domma.icons.scan("#site-navbar")}const v=$("#site-footer");if(v.length){const t=r.social||{},e={twitter:{label:"X / Twitter",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-4.714-6.231-5.401 6.231H2.742l7.73-8.835L1.254 2.25H8.08l4.259 5.629L18.244 2.25zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>'},facebook:{label:"Facebook",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg>'},instagram:{label:"Instagram",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z"/></svg>'},linkedin:{label:"LinkedIn",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>'},github:{label:"GitHub",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>'},youtube:{label:"YouTube",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M23.495 6.205a3.007 3.007 0 00-2.088-2.088c-1.87-.501-9.396-.501-9.396-.501s-7.507-.01-9.396.501A3.007 3.007 0 00.527 6.205a31.247 31.247 0 00-.522 5.805 31.247 31.247 0 00.522 5.783 3.007 3.007 0 002.088 2.088c1.868.502 9.396.502 9.396.502s7.506 0 9.396-.502a3.007 3.007 0 002.088-2.088 31.247 31.247 0 00.5-5.783 31.247 31.247 0 00-.5-5.805zM9.609 15.601V8.408l6.264 3.602z"/></svg>'}};let o='<div class="footer-inner container">';if(r.footer){const h=r.footer;o+=`<p>${h.copyright||""}</p>`,h.links?.length&&(o+='<nav class="footer-links">',h.links.forEach(i=>{o+=`<a href="${i.url}">${i.text}</a>`}),o+="</nav>");const f=Object.keys(e).filter(i=>t[i]);f.length&&(o+='<div class="footer-social">',f.forEach(i=>{const{label:d,svg:a}=e[i];o+=`<a href="${t[i]}" target="_blank" rel="noopener noreferrer" aria-label="${d}" class="footer-social-link">${a}</a>`}),o+="</div>")}const n=S.get("reduced_motion"),u=n!==null?!!n:!!(window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);o+=`<label class="form-switch footer-motion-switch" title="Reduce motion"><input type="checkbox" class="form-switch-input" id="dm-motion-switch"${u?" checked":""}><span class="form-switch-label">Reduce motion</span></label>`,o+="</div>",v.html(o,{safe:!1}),document.getElementById("dm-motion-switch").addEventListener("change",function(){S.set("reduced_motion",this.checked),window.location.reload()})}$("#site-sidebar").length&&Domma.elements.sidebar("#site-sidebar",{autoGenerate:!0,selector:"h2, h3",collapsible:!1,push:!0,contentSelector:".site-content"}),Domma.icons.scan();const c=$(".page-body");if(c.length&&(c.find(".accordion").each(function(){Domma.elements.accordion(this,{allowMultiple:this.dataset.multi==="true"})}),c.find(".tabs").each(function(){Domma.elements.tabs(this)}),c.find(".carousel").each(function(){Domma.elements.carousel(this,{autoplay:this.dataset.autoplay==="true",interval:parseInt(this.dataset.interval,10)||5e3,loop:this.dataset.loop!=="false",animation:this.dataset.animation||"slide"})}),c.find(".dm-countdown").each(function(){const t={autoStart:!0};this.dataset.to&&(t.targetDate=new Date(this.dataset.to)),this.dataset.duration&&(t.duration=parseInt(this.dataset.duration,10)),this.dataset.format&&(t.format=this.dataset.format),Domma.elements.timer(this,t)}),c.find("[data-tooltip]").each(function(){Domma.elements.tooltip(this,{content:$(this).data("tooltip"),position:$(this).data("tooltip-position")||"top"})}),c.find(".dm-progression").each(function(){Domma.elements.progression(this,{layout:this.dataset.layout||"vertical",theme:this.dataset.theme||"minimal",mode:this.dataset.mode||"timeline",statusIcons:!0})}),c.find(".card[data-collapsible]").each(function(){const t=this.querySelector(".card-header");t&&t.addEventListener("click",()=>this.classList.toggle("is-collapsed"))}),c.find(".dm-so-trigger").each(function(){this.addEventListener("click",()=>{const t=this.dataset.soTarget,e=document.getElementById(t);if(!e)return;const o=E.slideover({title:e.dataset.soTitle||"",size:e.dataset.soSize||"md",position:e.dataset.soPosition||"right"});e.style.display="",o.setContent(e),o.open()})})),typeof $.setup=="function"){const t=Object.assign({},window.__CMS_DCONFIG__||{});if(document.querySelectorAll(".dm-page-config[data-config]").forEach(e=>{try{const o=atob(e.dataset.config),n=JSON.parse(o);Object.assign(t,n)}catch{}}),Object.keys(t).length>0){const e={};for(const[o,n]of Object.entries(t)){const u=n?.events?.click,{confirm:h,toast:f,alert:i,prompt:d,...a}=u||{};h||f||i||d?($(o).on("click",async function(p){if(p.preventDefault(),h&&!await E.confirm(h))return;let C=null;if(!(d&&(C=await E.prompt(d,{inputPlaceholder:a.promptPlaceholder||"",inputValue:a.promptDefault||""}),C===null))){if(a.target){const w=$(a.target);a.toggleClass&&w.toggleClass(a.toggleClass),a.addClass&&w.addClass(a.addClass),a.removeClass&&w.removeClass(a.removeClass),C!==null&&(a.setText&&w.text(C),a.setVal&&w.val(C),a.setAttr&&w.attr(a.setAttr,C))}a.href&&(window.location.href=a.href),f&&E.toast(f,{type:a.toastType||"success"}),i&&E.alert(i)}}),Object.keys(a).length&&(e[o]={...n,events:{...n.events,click:a}})):e[o]=n}$.setup(e)}}c.length&&wireCTAButtons(c.get(0))});function wireCTAButtons(y){y.querySelectorAll(".dm-cta-trigger").forEach(r=>{r.addEventListener("click",async()=>{const b=r.dataset.action,v=r.dataset.entry,g=r.dataset.confirm;let c=S.get("auth_token");if(!c){E.toast("Please log in to perform this action.",{type:"warning"});return}if(g&&!await E.confirm(g))return;const s=Array.from(r.childNodes).map(t=>t.cloneNode(!0));r.disabled=!0,r.textContent="Running\u2026";const l=t=>fetch(`/api/actions/${b}/public`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({entryId:v})});try{let t=await l(c);if(t.status===401){const o=S.get("auth_refresh_token");if(o){const n=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:o})});if(n.ok){const{token:u}=await n.json();S.set("auth_token",u),c=u,t=await l(c)}}}const e=await t.json().catch(()=>({}));if(!t.ok)throw new Error(e.error||e.message||`Error ${t.status}`);E.toast(e.message||"Action completed.",{type:"success"})}catch(t){E.toast(t.message||"Action failed.",{type:"error"})}finally{r.disabled=!1,r.textContent="",s.forEach(t=>r.appendChild(t)),Domma.icons.scan(r)}})})}(function(){const r=document.querySelectorAll("[data-collection-table]");!r.length||typeof T>"u"||!T.create||r.forEach(b=>{let v;try{v=JSON.parse(atob(b.dataset.payload))}catch{return}const{columns:g,rows:c,search:s,sortable:l,exportable:t,pageSize:e,empty:o,ctaConfig:n}=v;if(!g?.length)return;if(n){const f=g.findIndex(i=>i.key==="_cta");f!==-1&&(g[f]={key:"_cta",title:"",render:(i,d)=>{const a=document.createElement("button");if(a.className=`btn btn-${n.style||"primary"} dm-cta-trigger`,a.dataset.action=n.action||"",a.dataset.entry=d._entryId||"",n.confirm&&(a.dataset.confirm=n.confirm),n.icon){const m=document.createElement("span");m.dataset.icon=n.icon,a.appendChild(m),a.appendChild(document.createTextNode(" "))}return a.appendChild(document.createTextNode(n.label||"Run")),a}})}const u="col-table-"+Math.random().toString(36).slice(2,7),h=document.createElement("div");h.id=u,b.replaceChildren(h),T.create("#"+u,{data:c,columns:g,search:s,sortable:l,exportable:t,pageSize:e,emptyMessage:o}),n&&wireCTAButtons(h)})})(),(function(){const r=document.querySelectorAll("[data-form-inline]");if(!r.length||typeof F>"u")return;function b(s,l){const t={};return(s||[]).forEach(e=>{if(e.type==="page-break"||e.type==="spacer"||!e.name)return;const o=e.type==="checkbox"?"boolean":e.type==="date"?"string":e.type,n={...e.formConfig||{}};n.span==="full"&&l&&(n.span=l),t[e.name]={type:o,label:e.label,required:e.required,options:e.options,formConfig:{...e.placeholder&&{placeholder:e.placeholder},...e.helper&&{hint:e.helper},...n}}}),t}function v(s){const l={};return(s||[]).forEach(t=>{if(!(!t.name||t.type==="page-break"||t.type==="spacer")&&(t.type==="select"||t.type==="multiselect")&&t.required){const e=(t.options||[])[0];e&&(l[t.name]=typeof e=="object"?e.value:e)}}),l}function g(s,l){(l||[]).forEach(t=>{if(t.type!=="date"||!t.name)return;const e=s.querySelector(`[name="${t.name}"]`);e&&e.type!=="date"&&(e.type="date")})}function c(s,l,t){let e=s.querySelector(".cms-form-message");e||(e=document.createElement("p"),e.className="cms-form-message",s.appendChild(e)),e.textContent=l,e.style.cssText=t?"color:var(--danger,#f87171);margin-top:.75rem;":"color:var(--success,#4ade80);margin-top:.75rem;"}r.forEach(s=>{let l;try{l=JSON.parse(atob(s.dataset.formInline))}catch{return}const t=l.fields||[],e=l.settings||{},o=e.columns||1,n=e.layout||"stacked",u=t.some(i=>i.type==="page-break"),h=async i=>{try{const d=s.querySelector('[name="website"]'),a=s.querySelector('[name="_t"]'),m=Object.assign({},i);d!==null&&(m._hp=d.value),a!==null&&(m._t=a.value);const p=await H.post(`/api/forms/submit/${l.slug}`,m);if(p?.redirect){window.location.href=p.redirect;return}for(;s.firstChild;)s.removeChild(s.firstChild);c(s,p?.message||e.successMessage||"Thank you for your submission.",!1)}catch(d){throw c(s,d.message||"Submission failed. Please try again.",!0),d}};function f(i){const d=i.querySelector("form");if(!d)return;const a=document.createElement("div");a.className="fb-form-honeypot",a.setAttribute("aria-hidden","true");const m=document.createElement("input");m.name="website",m.type="text",m.tabIndex=-1,m.autocomplete="url",m.placeholder="https://",a.appendChild(m);const p=document.createElement("input");p.name="_t",p.type="hidden",p.value=Date.now(),a.appendChild(p),d.appendChild(a)}if(u&&F.wizard){const i=[];let d=[],a=l.title||"Step 1",m="";t.forEach(p=>{p.type==="page-break"?(i.push({title:a,description:m,fields:b(d,o)}),d=[],a=p.label||`Step ${i.length+1}`,m=p.description||""):p.type!=="spacer"&&d.push(p)}),i.push({title:a,description:m,fields:b(d,o)}),F.wizard(s,{schema:{steps:i},onSubmit:h}),g(s,t),e.honeypot!==!1&&f(s)}else if(F.render){if(F.render(s,b(t,o),v(t),{submitText:e.submitText||"Submit",layout:n,columns:o,onSubmit:h}),n==="grid"&&e.submitSpan==="full"){const i=s.querySelector(".form-buttons");i&&i.classList.add("col-span-full")}g(s,t),e.honeypot!==!1&&f(s)}})})();
|
|
1
|
+
$(()=>{const y=window.__CMS_NAV__||{},r=window.__CMS_SITE__||{};if(r.autoTheme?.enabled){let e=function(n){const u=(n||"07:00").split(":");return+u[0]*60+(+u[1]||0)},o=function(){const n=new Date,u=n.getHours()*60+n.getMinutes();return u>=e(t.dayStart)&&u<e(t.nightStart)?t.dayTheme:t.nightTheme};var s=e,l=o;const t=r.autoTheme;Domma.theme.set(o()),setInterval(()=>Domma.theme.set(o()),6e4)}if($("#site-navbar").length&&y.brand){const t={...y.brand};if(t.icon){let e=`<span data-icon="${t.icon}" style="width:1.1em;height:1.1em;margin-right:.35em;vertical-align:middle;"></span>`;t.text&&(e+=`<span class="navbar-brand-text">${t.text}</span>`),t.html=e}Domma.elements.navbar("#site-navbar",{brand:t,items:y.items||[],variant:y.variant||"dark",position:y.position||"sticky",collapsible:!0}),Domma.icons.scan("#site-navbar")}const v=$("#site-footer");if(v.length){const t=r.social||{},e={twitter:{label:"X / Twitter",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-4.714-6.231-5.401 6.231H2.742l7.73-8.835L1.254 2.25H8.08l4.259 5.629L18.244 2.25zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>'},facebook:{label:"Facebook",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg>'},instagram:{label:"Instagram",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z"/></svg>'},linkedin:{label:"LinkedIn",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>'},github:{label:"GitHub",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>'},youtube:{label:"YouTube",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M23.495 6.205a3.007 3.007 0 00-2.088-2.088c-1.87-.501-9.396-.501-9.396-.501s-7.507-.01-9.396.501A3.007 3.007 0 00.527 6.205a31.247 31.247 0 00-.522 5.805 31.247 31.247 0 00.522 5.783 3.007 3.007 0 002.088 2.088c1.868.502 9.396.502 9.396.502s7.506 0 9.396-.502a3.007 3.007 0 002.088-2.088 31.247 31.247 0 00.5-5.783 31.247 31.247 0 00-.5-5.805zM9.609 15.601V8.408l6.264 3.602z"/></svg>'}};let o='<div class="footer-inner container">';if(r.footer){const h=r.footer;o+=`<p>${h.copyright||""}</p>`,h.links?.length&&(o+='<nav class="footer-links">',h.links.forEach(i=>{o+=`<a href="${i.url}">${i.text}</a>`}),o+="</nav>");const f=Object.keys(e).filter(i=>t[i]);f.length&&(o+='<div class="footer-social">',f.forEach(i=>{const{label:d,svg:a}=e[i];o+=`<a href="${t[i]}" target="_blank" rel="noopener noreferrer" aria-label="${d}" class="footer-social-link">${a}</a>`}),o+="</div>")}const n=S.get("reduced_motion"),u=n!==null?!!n:!!(window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);o+=`<label class="form-switch footer-motion-switch" title="Reduce motion"><input type="checkbox" class="form-switch-input" id="dm-motion-switch"${u?" checked":""}><span class="form-switch-label">Reduce motion</span></label>`,o+="</div>",v.html(o,{safe:!1}),document.getElementById("dm-motion-switch").addEventListener("change",function(){S.set("reduced_motion",this.checked),window.location.reload()})}$("#site-sidebar").length&&Domma.elements.sidebar("#site-sidebar",{autoGenerate:!0,selector:"h2, h3",collapsible:!1,push:!0,contentSelector:".site-content"}),Domma.icons.scan();const c=$(".page-body");if(c.length&&(c.find(".accordion").each(function(){Domma.elements.accordion(this,{allowMultiple:this.dataset.multi==="true"})}),c.find(".tabs").each(function(){Domma.elements.tabs(this)}),c.find(".carousel").each(function(){Domma.elements.carousel(this,{autoplay:this.dataset.autoplay==="true",interval:parseInt(this.dataset.interval,10)||5e3,loop:this.dataset.loop!=="false",animation:this.dataset.animation||"slide"})}),c.find(".dm-countdown").each(function(){const t={autoStart:!0};this.dataset.to&&(t.targetDate=new Date(this.dataset.to)),this.dataset.duration&&(t.duration=parseInt(this.dataset.duration,10)),this.dataset.format&&(t.format=this.dataset.format),Domma.elements.timer(this,t)}),c.find("[data-tooltip]").each(function(){Domma.elements.tooltip(this,{content:$(this).data("tooltip"),position:$(this).data("tooltip-position")||"top"})}),c.find(".dm-progression").each(function(){Domma.elements.progression(this,{layout:this.dataset.layout||"vertical",theme:this.dataset.theme||"minimal",mode:this.dataset.mode||"timeline",statusIcons:!0})}),Domma.effects.reveal(".page-body .hero",{animation:"slide-up",duration:480,threshold:.06,stagger:60,once:!1}),c.find(".card[data-collapsible]").each(function(){const t=this.querySelector(".card-header");t&&t.addEventListener("click",()=>this.classList.toggle("is-collapsed"))}),c.find(".dm-so-trigger").each(function(){this.addEventListener("click",()=>{const t=this.dataset.soTarget,e=document.getElementById(t);if(!e)return;const o=E.slideover({title:e.dataset.soTitle||"",size:e.dataset.soSize||"md",position:e.dataset.soPosition||"right"});e.style.display="",o.setContent(e),o.open()})})),typeof $.setup=="function"){const t=Object.assign({},window.__CMS_DCONFIG__||{});if(document.querySelectorAll(".dm-page-config[data-config]").forEach(e=>{try{const o=atob(e.dataset.config),n=JSON.parse(o);Object.assign(t,n)}catch{}}),Object.keys(t).length>0){const e={};for(const[o,n]of Object.entries(t)){const u=n?.events?.click,{confirm:h,toast:f,alert:i,prompt:d,...a}=u||{};h||f||i||d?($(o).on("click",async function(p){if(p.preventDefault(),h&&!await E.confirm(h))return;let C=null;if(!(d&&(C=await E.prompt(d,{inputPlaceholder:a.promptPlaceholder||"",inputValue:a.promptDefault||""}),C===null))){if(a.target){const w=$(a.target);a.toggleClass&&w.toggleClass(a.toggleClass),a.addClass&&w.addClass(a.addClass),a.removeClass&&w.removeClass(a.removeClass),C!==null&&(a.setText&&w.text(C),a.setVal&&w.val(C),a.setAttr&&w.attr(a.setAttr,C))}a.href&&(window.location.href=a.href),f&&E.toast(f,{type:a.toastType||"success"}),i&&E.alert(i)}}),Object.keys(a).length&&(e[o]={...n,events:{...n.events,click:a}})):e[o]=n}$.setup(e)}}c.length&&wireCTAButtons(c.get(0))});function wireCTAButtons(y){y.querySelectorAll(".dm-cta-trigger").forEach(r=>{r.addEventListener("click",async()=>{const b=r.dataset.action,v=r.dataset.entry,g=r.dataset.confirm;let c=S.get("auth_token");if(!c){E.toast("Please log in to perform this action.",{type:"warning"});return}if(g&&!await E.confirm(g))return;const s=Array.from(r.childNodes).map(t=>t.cloneNode(!0));r.disabled=!0,r.textContent="Running\u2026";const l=t=>fetch(`/api/actions/${b}/public`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({entryId:v})});try{let t=await l(c);if(t.status===401){const o=S.get("auth_refresh_token");if(o){const n=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:o})});if(n.ok){const{token:u}=await n.json();S.set("auth_token",u),c=u,t=await l(c)}}}const e=await t.json().catch(()=>({}));if(!t.ok)throw new Error(e.error||e.message||`Error ${t.status}`);E.toast(e.message||"Action completed.",{type:"success"})}catch(t){E.toast(t.message||"Action failed.",{type:"error"})}finally{r.disabled=!1,r.textContent="",s.forEach(t=>r.appendChild(t)),Domma.icons.scan(r)}})})}(function(){const r=document.querySelectorAll("[data-collection-table]");!r.length||typeof T>"u"||!T.create||r.forEach(b=>{let v;try{v=JSON.parse(atob(b.dataset.payload))}catch{return}const{columns:g,rows:c,search:s,sortable:l,exportable:t,pageSize:e,empty:o,ctaConfig:n}=v;if(!g?.length)return;if(n){const f=g.findIndex(i=>i.key==="_cta");f!==-1&&(g[f]={key:"_cta",title:"",render:(i,d)=>{const a=document.createElement("button");if(a.className=`btn btn-${n.style||"primary"} dm-cta-trigger`,a.dataset.action=n.action||"",a.dataset.entry=d._entryId||"",n.confirm&&(a.dataset.confirm=n.confirm),n.icon){const m=document.createElement("span");m.dataset.icon=n.icon,a.appendChild(m),a.appendChild(document.createTextNode(" "))}return a.appendChild(document.createTextNode(n.label||"Run")),a}})}const u="col-table-"+Math.random().toString(36).slice(2,7),h=document.createElement("div");h.id=u,b.replaceChildren(h),T.create("#"+u,{data:c,columns:g,search:s,sortable:l,exportable:t,pageSize:e,emptyMessage:o}),n&&wireCTAButtons(h)})})(),(function(){const r=document.querySelectorAll("[data-form-inline]");if(!r.length||typeof F>"u")return;function b(s,l){const t={};return(s||[]).forEach(e=>{if(e.type==="page-break"||e.type==="spacer"||!e.name)return;const o=e.type==="checkbox"?"boolean":e.type==="date"?"string":e.type,n={...e.formConfig||{}};n.span==="full"&&l&&(n.span=l),t[e.name]={type:o,label:e.label,required:e.required,options:e.options,formConfig:{...e.placeholder&&{placeholder:e.placeholder},...e.helper&&{hint:e.helper},...n}}}),t}function v(s){const l={};return(s||[]).forEach(t=>{if(!(!t.name||t.type==="page-break"||t.type==="spacer")&&(t.type==="select"||t.type==="multiselect")&&t.required){const e=(t.options||[])[0];e&&(l[t.name]=typeof e=="object"?e.value:e)}}),l}function g(s,l){(l||[]).forEach(t=>{if(t.type!=="date"||!t.name)return;const e=s.querySelector(`[name="${t.name}"]`);e&&e.type!=="date"&&(e.type="date")})}function c(s,l,t){let e=s.querySelector(".cms-form-message");e||(e=document.createElement("p"),e.className="cms-form-message",s.appendChild(e)),e.textContent=l,e.style.cssText=t?"color:var(--danger,#f87171);margin-top:.75rem;":"color:var(--success,#4ade80);margin-top:.75rem;"}r.forEach(s=>{let l;try{l=JSON.parse(atob(s.dataset.formInline))}catch{return}const t=l.fields||[],e=l.settings||{},o=e.columns||1,n=e.layout||"stacked",u=t.some(i=>i.type==="page-break"),h=async i=>{try{const d=s.querySelector('[name="website"]'),a=s.querySelector('[name="_t"]'),m=Object.assign({},i);d!==null&&(m._hp=d.value),a!==null&&(m._t=a.value);const p=await H.post(`/api/forms/submit/${l.slug}`,m);if(p?.redirect){window.location.href=p.redirect;return}for(;s.firstChild;)s.removeChild(s.firstChild);c(s,p?.message||e.successMessage||"Thank you for your submission.",!1)}catch(d){throw c(s,d.message||"Submission failed. Please try again.",!0),d}};function f(i){const d=i.querySelector("form");if(!d)return;const a=document.createElement("div");a.className="fb-form-honeypot",a.setAttribute("aria-hidden","true");const m=document.createElement("input");m.name="website",m.type="text",m.tabIndex=-1,m.autocomplete="url",m.placeholder="https://",a.appendChild(m);const p=document.createElement("input");p.name="_t",p.type="hidden",p.value=Date.now(),a.appendChild(p),d.appendChild(a)}if(u&&F.wizard){const i=[];let d=[],a=l.title||"Step 1",m="";t.forEach(p=>{p.type==="page-break"?(i.push({title:a,description:m,fields:b(d,o)}),d=[],a=p.label||`Step ${i.length+1}`,m=p.description||""):p.type!=="spacer"&&d.push(p)}),i.push({title:a,description:m,fields:b(d,o)}),F.wizard(s,{schema:{steps:i},onSubmit:h}),g(s,t),e.honeypot!==!1&&f(s)}else if(F.render){if(F.render(s,b(t,o),v(t),{submitText:e.submitText||"Submit",layout:n,columns:o,onSubmit:h}),n==="grid"&&e.submitSpan==="full"){const i=s.querySelector(".form-buttons");i&&i.classList.add("col-span-full")}g(s,t),e.honeypot!==!1&&f(s)}})})();
|