lula2 0.3.5-nightly.4 → 0.4.0-nightly.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ import{b2 as Ae,o as $e,g as U,h as L,d as P,bi as wt,ai as De}from"./B8sFn9qB.js";class le{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Se{constructor(t,n){this.status=t,this.location=n}}class Re extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function yt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function vt(e){return e.split("%25").map(decodeURI).join("%25")}function bt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function _e({href:e}){return e.split("#")[0]}function kt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(i,o){if(o==="get"||o==="getAll"||o==="has")return f=>(n(f),i[o](f));t();const c=Reflect.get(i,o);return typeof c=="function"?c.bind(i):c}}),enumerable:!0,configurable:!0});const s=["href","pathname","search","toString","toJSON"];r&&s.push("hash");for(const i of s)Object.defineProperty(a,i,{get(){return t(),e[i]},enumerable:!0,configurable:!0});return a}function Et(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;const At=new TextDecoder;function St(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const Rt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&H.delete(Te(e)),Rt(e,t));const H=new Map;function Tt(e,t){const n=Te(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&H.set(n,{body:a,init:s,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=St(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,t)}function It(e,t,n){if(H.size>0){const r=Te(e,n),a=H.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);H.delete(r)}}return window.fetch(t,n)}function Te(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${Et(...a)}"]`}return r}const Ut=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Lt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${xt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return t.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return me(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return me(String.fromCharCode(...c.slice(2).split("-").map(y=>parseInt(y,16))));const d=Ut.exec(c),[,p,u,l,h]=d;return t.push({name:l,matcher:h,optional:!!p,rest:!!u,chained:u?f===1&&i[0]==="":!1}),u?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return me(c)}).join("")}).join("")}/?$`),params:t}}function Pt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function xt(e){return e.slice(1).split("/").filter(Pt)}function Ct(e,t,n){const r={},a=e.slice(1),s=a.filter(o=>o!==void 0);let i=0;for(let o=0;o<t.length;o+=1){const c=t[o];let f=a[o-i];if(c.chained&&c.rest&&i&&(f=a.slice(o-i,o+1).filter(d=>d).join("/"),i=0),f===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||n[c.matcher](f)){r[c.name]=f;const d=t[o+1],p=a[o+1];d&&!d.rest&&d.optional&&p&&c.chained&&(i=0),!d&&!p&&Object.keys(r).length===s.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function me(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Nt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[c,f,d]])=>{const{pattern:p,params:u}=Lt(o),l={id:o,exec:h=>{const y=p.exec(h);if(y)return Ct(y,u,r)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...f||[]].map(i),leaf:s(c)};return l.errors.length=l.layouts.length=Math.max(l.errors.length,l.layouts.length),l});function s(o){const c=o<0;return c&&(o=~o),[c,e[o]]}function i(o){return o===void 0?o:[a.has(o),e[o]]}}function Je(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Fe(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const I=globalThis.__sveltekit_wgx1o2?.base??"",Ot=globalThis.__sveltekit_wgx1o2?.assets??I??"",jt="1758846661430",ze="sveltekit:snapshot",Xe="sveltekit:scroll",Ze="sveltekit:states",$t="sveltekit:pageurl",B="sveltekit:history",W="sveltekit:navigation",j={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Z=location.origin;function Ie(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function fe(){return{x:pageXOffset,y:pageYOffset}}function F(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Be={...j,"":j.hover};function Qe(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function et(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Qe(e)}}function ve(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,s=!r||!!a||ue(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),i=r?.origin===Z&&e.hasAttribute("download");return{url:r,external:s,target:a,download:i}}function te(e){let t=null,n=null,r=null,a=null,s=null,i=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=F(o,"preload-code")),a===null&&(a=F(o,"preload-data")),t===null&&(t=F(o,"keepfocus")),n===null&&(n=F(o,"noscroll")),s===null&&(s=F(o,"reload")),i===null&&(i=F(o,"replacestate")),o=Qe(o);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Be[r??"off"],preload_data:Be[a??"off"],keepfocus:c(t),noscroll:c(n),reload:c(s),replace_state:c(i)}}function Ve(e){const t=Ae(e);let n=!0;function r(){n=!0,t.update(i=>i)}function a(i){n=!1,t.set(i)}function s(i){let o;return t.subscribe(c=>{(o===void 0||n&&c!==o)&&i(o=c)})}return{notify:r,set:a,subscribe:s}}const tt={v:()=>{}};function Dt(){const{set:e,subscribe:t}=Ae(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Ot}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==jt;return i&&(e(!0),tt.v(),clearTimeout(n)),i}catch{return!1}}return{subscribe:t,check:r}}function ue(e,t,n){return e.origin!==Z||!e.pathname.startsWith(t)?!0:n?!(e.pathname===t+"/"||e.pathname===t+"/index.html"||e.protocol==="file:"&&e.pathname.replace(/\/[^/]+\.html?$/,"")===t):!1}function An(e){}function Ft(e){const t=Vt(e),n=new ArrayBuffer(t.length),r=new DataView(n);for(let a=0;a<n.byteLength;a++)r.setUint8(a,t.charCodeAt(a));return n}const Bt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Vt(e){e.length%4===0&&(e=e.replace(/==?$/,""));let t="",n=0,r=0;for(let a=0;a<e.length;a++)n<<=6,n|=Bt.indexOf(e[a]),r+=6,r===24&&(t+=String.fromCharCode((n&16711680)>>16),t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255),n=r=0);return r===12?(n>>=4,t+=String.fromCharCode(n)):r===18&&(n>>=2,t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255)),t}const Mt=-1,qt=-2,Gt=-3,Ht=-4,Kt=-5,Yt=-6;function Wt(e,t){if(typeof e=="number")return a(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const n=e,r=Array(n.length);function a(s,i=!1){if(s===Mt)return;if(s===Gt)return NaN;if(s===Ht)return 1/0;if(s===Kt)return-1/0;if(s===Yt)return-0;if(i||typeof s!="number")throw new Error("Invalid input");if(s in r)return r[s];const o=n[s];if(!o||typeof o!="object")r[s]=o;else if(Array.isArray(o))if(typeof o[0]=="string"){const c=o[0],f=t?.[c];if(f)return r[s]=f(a(o[1]));switch(c){case"Date":r[s]=new Date(o[1]);break;case"Set":const d=new Set;r[s]=d;for(let l=1;l<o.length;l+=1)d.add(a(o[l]));break;case"Map":const p=new Map;r[s]=p;for(let l=1;l<o.length;l+=2)p.set(a(o[l]),a(o[l+1]));break;case"RegExp":r[s]=new RegExp(o[1],o[2]);break;case"Object":r[s]=Object(o[1]);break;case"BigInt":r[s]=BigInt(o[1]);break;case"null":const u=Object.create(null);r[s]=u;for(let l=1;l<o.length;l+=2)u[o[l]]=a(o[l+1]);break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":{const l=globalThis[c],h=new l(a(o[1]));r[s]=o[2]!==void 0?h.subarray(o[2],o[3]):h;break}case"ArrayBuffer":{const l=o[1],h=Ft(l);r[s]=h;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const l=c.slice(9);r[s]=Temporal[l].from(o[1]);break}case"URL":{const l=new URL(o[1]);r[s]=l;break}case"URLSearchParams":{const l=new URLSearchParams(o[1]);r[s]=l;break}default:throw new Error(`Unknown type ${c}`)}}else{const c=new Array(o.length);r[s]=c;for(let f=0;f<o.length;f+=1){const d=o[f];d!==qt&&(c[f]=a(d))}}else{const c={};r[s]=c;for(const f in o){if(f==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const d=o[f];c[f]=a(d)}}return r[s]}return a(0)}const nt=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...nt];const Jt=new Set([...nt]);[...Jt];function zt(e){return e.filter(t=>t!=null)}const Xt="x-sveltekit-invalidated",Zt="x-sveltekit-trailing-slash";function ne(e){return e instanceof le||e instanceof Re?e.status:500}function Qt(e){return e instanceof Re?e.text:"Internal Error"}let S,J,we;const en=$e.toString().includes("$$")||/function \w+\(\) \{\}/.test($e.toString());en?(S={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},J={current:null},we={current:!1}):(S=new class{#e=U({});get data(){return L(this.#e)}set data(t){P(this.#e,t)}#t=U(null);get form(){return L(this.#t)}set form(t){P(this.#t,t)}#n=U(null);get error(){return L(this.#n)}set error(t){P(this.#n,t)}#r=U({});get params(){return L(this.#r)}set params(t){P(this.#r,t)}#a=U({id:null});get route(){return L(this.#a)}set route(t){P(this.#a,t)}#o=U({});get state(){return L(this.#o)}set state(t){P(this.#o,t)}#s=U(-1);get status(){return L(this.#s)}set status(t){P(this.#s,t)}#i=U(new URL("https://example.com"));get url(){return L(this.#i)}set url(t){P(this.#i,t)}},J=new class{#e=U(null);get current(){return L(this.#e)}set current(t){P(this.#e,t)}},we=new class{#e=U(!1);get current(){return L(this.#e)}set current(t){P(this.#e,t)}},tt.v=()=>we.current=!0);function tn(e){Object.assign(S,e)}const nn="/__data.json",rn=".html__data.json";function an(e){return e.endsWith(".html")?e.replace(/\.html$/,rn):e.replace(/\/$/,"")+nn}const Me={spanContext(){return on},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},on={traceId:"",spanId:"",traceFlags:0},{tick:sn}=wt,cn=new Set(["icon","shortcut icon","apple-touch-icon"]),D=Je(Xe)??{},z=Je(ze)??{},O={url:Ve({}),page:Ve({}),navigating:Ae(null),updated:Dt()};function Ue(e){D[e]=fe()}function ln(e,t){let n=e+1;for(;D[n];)delete D[n],n+=1;for(n=t+1;z[n];)delete z[n],n+=1}function q(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function rt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(I||"/");e&&await e.update()}}function qe(){}let Le,be,re,x,ke,v;const ae=[],oe=[];let C=null;const ee=new Map,at=new Set,fn=new Set,K=new Set;let w={branch:[],error:null,url:null},Pe=!1,se=!1,Ge=!0,X=!1,G=!1,ot=!1,xe=!1,st,A,T,$;const Y=new Set,He=new Map;async function In(e,t,n){globalThis.__sveltekit_wgx1o2?.data&&globalThis.__sveltekit_wgx1o2.data,document.URL!==location.href&&(location.href=location.href),v=e,await e.hooks.init?.(),Le=Nt(e),x=document.documentElement,ke=t,be=e.nodes[0],re=e.nodes[1],be(),re(),A=history.state?.[B],T=history.state?.[W],A||(A=T=Date.now(),history.replaceState({...history.state,[B]:A,[W]:T},""));const r=D[A];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await vn(ke,n)):(await V({type:"enter",url:Ie(v.hash?kn(new URL(location.href)):location.href),replace_state:!0}),a()),yn()}function un(){ae.length=0,xe=!1}function it(e){oe.some(t=>t?.snapshot)&&(z[e]=oe.map(t=>t?.snapshot?.capture()))}function ct(e){z[e]?.forEach((t,n)=>{oe[n]?.snapshot?.restore(t)})}function Ke(){Ue(A),Fe(Xe,D),it(T),Fe(ze,z)}async function lt(e,t,n,r){let a;t.invalidateAll&&(C=null),await V({type:"goto",url:Ie(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(xe=!0,a=[...He.keys()]),t.invalidate&&t.invalidate.forEach(wn)}}),t.invalidateAll&&De().then(De).then(()=>{He.forEach(({resource:s},i)=>{a?.includes(i)&&s.refresh?.()})})}async function dn(e){if(e.id!==C?.id){const t={};Y.add(t),C={id:e.id,token:t,promise:dt({...e,preload:t}).then(n=>(Y.delete(t),n.type==="loaded"&&n.state.error&&(C=null),n))}}return C.promise}async function ye(e){const t=(await he(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].map(n=>n?.[1]()))}function ft(e,t,n){w=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(S,e.props.page),st=new v.root({target:t,props:{...e.props,stores:O,components:oe},hydrate:n,sync:!1}),ct(T),n){const a={from:null,to:{params:w.params,route:{id:w.route?.id??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};K.forEach(s=>s(a))}se=!0}function ie({url:e,params:t,branch:n,status:r,error:a,route:s,form:i}){let o="never";if(I&&(e.pathname===I||e.pathname===I+"/"))o="always";else for(const l of n)l?.slash!==void 0&&(o=l.slash);e.pathname=yt(e.pathname,o),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:s},props:{constructors:zt(n).map(l=>l.node.component),page:je(S)}};i!==void 0&&(c.props.form=i);let f={},d=!S,p=0;for(let l=0;l<Math.max(n.length,w.branch.length);l+=1){const h=n[l],y=w.branch[l];h?.data!==y?.data&&(d=!0),h&&(f={...f,...h.data},d&&(c.props[`data_${p}`]=f),p+=1)}return(!w.url||e.href!==w.url.href||w.error!==a||i!==void 0&&i!==S.form||d)&&(c.props.page={error:a,params:t,route:{id:s?.id??null},state:{},status:r,url:new URL(e),form:i??null,data:d?f:S.data}),c}async function Ce({loader:e,parent:t,url:n,params:r,route:a,server_data_node:s}){let i=null,o=!0;const c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},f=await e();if(f.universal?.load){let d=function(...u){for(const l of u){const{href:h}=new URL(l,n);c.dependencies.add(h)}};const p={tracing:{enabled:!1,root:Me,current:Me},route:new Proxy(a,{get:(u,l)=>(o&&(c.route=!0),u[l])}),params:new Proxy(r,{get:(u,l)=>(o&&c.params.add(l),u[l])}),data:s?.data??null,url:kt(n,()=>{o&&(c.url=!0)},u=>{o&&c.search_params.add(u)},v.hash),async fetch(u,l){u instanceof Request&&(l={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:[...u.headers].length>0?u?.headers:void 0,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...l});const{resolved:h,promise:y}=ut(u,l,n);return o&&d(h.href),y},setHeaders:()=>{},depends:d,parent(){return o&&(c.parent=!0),t()},untrack(u){o=!1;try{return u()}finally{o=!0}}};i=await f.universal.load.call(null,p)??null}return{node:f,loader:e,server:s,universal:f.universal?.load?{type:"data",data:i,uses:c}:null,data:i??s?.data??null,slash:f.universal?.trailingSlash??s?.slash}}function ut(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const s=se?It(r,a.href,t):Tt(r,t);return{resolved:a,promise:s}}function Ye(e,t,n,r,a,s){if(xe)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(s[i]!==w.params[i])return!0;for(const i of a.dependencies)if(ae.some(o=>o(new URL(i))))return!0;return!1}function Ne(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function hn(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),s=t.searchParams.getAll(r);a.every(i=>s.includes(i))&&s.every(i=>a.includes(i))&&n.delete(r)}return n}function We({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:je(S),constructors:[]}}}async function dt({id:e,invalidating:t,url:n,params:r,route:a,preload:s}){if(C?.id===e)return Y.delete(C.token),C.promise;const{errors:i,layouts:o,leaf:c}=a,f=[...o,c];i.forEach(m=>m?.().catch(()=>{})),f.forEach(m=>m?.[1]().catch(()=>{}));let d=null;const p=w.url?e!==ce(w.url):!1,u=w.route?a.id!==w.route.id:!1,l=hn(w.url,n);let h=!1;const y=f.map((m,g)=>{const b=w.branch[g],k=!!m?.[0]&&(b?.loader!==m[1]||Ye(h,u,p,l,b.server?.uses,r));return k&&(h=!0),k});if(y.some(Boolean)){try{d=await gt(n,y)}catch(m){const g=await M(m,{url:n,params:r,route:{id:e}});return Y.has(s)?We({error:g,url:n,params:r,route:a}):de({status:ne(m),error:g,url:n,route:a})}if(d.type==="redirect")return d}const E=d?.nodes;let _=!1;const N=f.map(async(m,g)=>{if(!m)return;const b=w.branch[g],k=E?.[g];if((!k||k.type==="skip")&&m[1]===b?.loader&&!Ye(_,u,p,l,b.universal?.uses,r))return b;if(_=!0,k?.type==="error")throw k;return Ce({loader:m[1],url:n,params:r,route:a,parent:async()=>{const pe={};for(let ge=0;ge<g;ge+=1)Object.assign(pe,(await N[ge])?.data);return pe},server_data_node:Ne(k===void 0&&m[0]?{type:"skip"}:k??null,m[0]?b?.server:void 0)})});for(const m of N)m.catch(()=>{});const R=[];for(let m=0;m<f.length;m+=1)if(f[m])try{R.push(await N[m])}catch(g){if(g instanceof Se)return{type:"redirect",location:g.location};if(Y.has(s))return We({error:await M(g,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let b=ne(g),k;if(E?.includes(g))b=g.status??b,k=g.error;else if(g instanceof le)k=g.body;else{if(await O.updated.check())return await rt(),await q(n);k=await M(g,{params:r,url:n,route:{id:a.id}})}const Q=await pn(m,R,i);return Q?ie({url:n,params:r,branch:R.slice(0,Q.idx).concat(Q.node),status:b,error:k,route:a}):await pt(n,{id:a.id},k,b)}else R.push(void 0);return ie({url:n,params:r,branch:R,status:200,error:null,route:a,form:t?void 0:null})}async function pn(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function de({status:e,error:t,url:n,route:r}){const a={};let s=null;if(v.server_loads[0]===0)try{const o=await gt(n,[!0]);if(o.type!=="data"||o.nodes[0]&&o.nodes[0].type!=="data")throw 0;s=o.nodes[0]??null}catch{(n.origin!==Z||n.pathname!==location.pathname||Pe)&&await q(n)}try{const o=await Ce({loader:be,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Ne(s)}),c={node:await re(),loader:re,universal:null,server:null,data:null};return ie({url:n,params:a,branch:[o,c],status:e,error:t,route:null})}catch(o){if(o instanceof Se)return lt(new URL(o.location,location.href),{},0);throw o}}async function gn(e){const t=e.href;if(ee.has(t))return ee.get(t);let n;try{const r=(async()=>{let a=await v.hooks.reroute({url:new URL(e),fetch:async(s,i)=>ut(s,i,e).promise})??e;if(typeof a=="string"){const s=new URL(e);v.hash?s.hash=a:s.pathname=a,a=s}return a})();ee.set(t,r),n=await r}catch{ee.delete(t);return}return n}async function he(e,t){if(e&&!ue(e,I,v.hash)){const n=await gn(e);if(!n)return;const r=_n(n);for(const a of Le){const s=a.exec(r);if(s)return{id:ce(e),invalidating:t,route:a,params:bt(s),url:e}}}}function _n(e){return vt(v.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(I.length))||"/"}function ce(e){return(v.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function ht({url:e,type:t,intent:n,delta:r,event:a}){let s=!1;const i=Oe(w,n,e,t);r!==void 0&&(i.navigation.delta=r),a!==void 0&&(i.navigation.event=a);const o={...i.navigation,cancel:()=>{s=!0,i.reject(new Error("navigation cancelled"))}};return X||at.forEach(c=>c(o)),s?null:i}async function V({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i={},redirect_count:o=0,nav_token:c={},accept:f=qe,block:d=qe,event:p}){const u=$;$=c;const l=await he(t,!1),h=e==="enter"?Oe(w,l,t,e):ht({url:t,type:e,delta:n?.delta,intent:l,event:p});if(!h){d(),$===c&&($=u);return}const y=A,E=T;f(),X=!0,se&&h.navigation.type!=="enter"&&O.navigating.set(J.current=h.navigation);let _=l&&await dt(l);if(!_){if(ue(t,I,v.hash))return await q(t,s);_=await pt(t,{id:null},await M(new Re(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,s)}if(t=l?.url||t,$!==c)return h.reject(new Error("navigation aborted")),!1;if(_.type==="redirect"){if(o<20){await V({type:e,url:new URL(_.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i,redirect_count:o+1,nav_token:c}),h.fulfil(void 0);return}_=await de({status:500,error:await M(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else _.props.page.status>=400&&await O.updated.check()&&(await rt(),await q(t,s));if(un(),Ue(y),it(E),_.props.page.url.pathname!==t.pathname&&(t.pathname=_.props.page.url.pathname),i=n?n.state:i,!n){const g=s?0:1,b={[B]:A+=g,[W]:T+=g,[Ze]:i};(s?history.replaceState:history.pushState).call(history,b,"",t),s||ln(A,T)}if(C=null,_.props.page.state=i,se){const g=(await Promise.all(Array.from(fn,b=>b(h.navigation)))).filter(b=>typeof b=="function");if(g.length>0){let b=function(){g.forEach(k=>{K.delete(k)})};g.push(b),g.forEach(k=>{K.add(k)})}w=_.state,_.props.page&&(_.props.page.url=t),st.$set(_.props),tn(_.props.page),ot=!0}else ft(_,ke,!1);const{activeElement:N}=document;await sn();const R=n?n.scroll:a?fe():null;if(Ge){const g=t.hash&&document.getElementById(mt(t));R?scrollTo(R.x,R.y):g?g.scrollIntoView():scrollTo(0,0)}const m=document.activeElement!==N&&document.activeElement!==document.body;!r&&!m&&bn(t),Ge=!0,_.props.page&&Object.assign(S,_.props.page),X=!1,e==="popstate"&&ct(T),h.fulfil(void 0),K.forEach(g=>g(h.navigation)),O.navigating.set(J.current=null)}async function pt(e,t,n,r,a){return e.origin===Z&&e.pathname===location.pathname&&!Pe?await de({status:r,error:n,url:e,route:t}):await q(e,a)}function mn(){let e,t,n;x.addEventListener("mousemove",o=>{const c=o.target;clearTimeout(e),e=setTimeout(()=>{s(c,j.hover)},20)});function r(o){o.defaultPrevented||s(o.composedPath()[0],j.tap)}x.addEventListener("mousedown",r),x.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const c of o)c.isIntersecting&&(ye(new URL(c.target.href)),a.unobserve(c.target))},{threshold:0});async function s(o,c){const f=et(o,x),d=f===t&&c>=n;if(!f||d)return;const{url:p,external:u,download:l}=ve(f,I,v.hash);if(u||l)return;const h=te(f),y=p&&ce(w.url)===ce(p);if(!(h.reload||y))if(c<=h.preload_data){t=f,n=j.tap;const E=await he(p,!1);if(!E)return;dn(E)}else c<=h.preload_code&&(t=f,n=c,ye(p))}function i(){a.disconnect();for(const o of x.querySelectorAll("a")){const{url:c,external:f,download:d}=ve(o,I,v.hash);if(f||d)continue;const p=te(o);p.reload||(p.preload_code===j.viewport&&a.observe(o),p.preload_code===j.eager&&ye(c))}}K.add(i),i()}function M(e,t){if(e instanceof le)return e.body;const n=ne(e),r=Qt(e);return v.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Un(e,t={}){return e=new URL(Ie(e)),e.origin!==Z?Promise.reject(new Error("goto: invalid URL")):lt(e,t,0)}function wn(e){if(typeof e=="function")ae.push(e);else{const{href:t}=new URL(e,location.href);ae.push(n=>n.href===t)}}function yn(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(Ke(),!X){const r=Oe(w,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};at.forEach(s=>s(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ke()}),navigator.connection?.saveData||mn(),x.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=et(t.composedPath()[0],x);if(!n)return;const{url:r,external:a,target:s,download:i}=ve(n,I,v.hash);if(!r)return;if(s==="_parent"||s==="_top"){if(window.parent!==window)return}else if(s&&s!=="_self")return;const o=te(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||i)return;const[f,d]=(v.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=f===_e(location);if(a||o.reload&&(!p||!d)){ht({url:r,type:"link",event:t})?X=!0:t.preventDefault();return}if(d!==void 0&&p){const[,u]=w.url.href.split("#");if(u===d){if(t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null)window.scrollTo({top:0});else{const l=n.ownerDocument.getElementById(decodeURIComponent(d));l&&(l.scrollIntoView(),l.focus())}return}if(G=!0,Ue(A),e(r),!o.replace_state)return;G=!1}t.preventDefault(),await new Promise(u=>{requestAnimationFrame(()=>{setTimeout(u,0)}),setTimeout(u,100)}),await V({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href,event:t})}),x.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const i=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(ue(i,I,!1))return;const o=t.target,c=te(o);if(c.reload)return;t.preventDefault(),t.stopPropagation();const f=new FormData(o,r);i.search=new URLSearchParams(f).toString(),V({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!Ee){if(t.state?.[B]){const n=t.state[B];if($={},n===A)return;const r=D[n],a=t.state[Ze]??{},s=new URL(t.state[$t]??location.href),i=t.state[W],o=w.url?_e(location)===_e(w.url):!1;if(i===T&&(ot||o)){a!==S.state&&(S.state=a),e(s),D[A]=fe(),r&&scrollTo(r.x,r.y),A=n;return}const f=n-A;await V({type:"popstate",url:s,popped:{state:a,scroll:r,delta:f},accept:()=>{A=n,T=i},block:()=>{history.go(-f)},nav_token:$,event:t})}else if(!G){const n=new URL(location.href);e(n),v.hash&&location.reload()}}}),addEventListener("hashchange",()=>{G&&(G=!1,history.replaceState({...history.state,[B]:++A,[W]:T},"",location.href))});for(const t of document.querySelectorAll("link"))cn.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&O.navigating.set(J.current=null)});function e(t){w.url=S.url=t,O.page.set(je(S)),O.page.notify()}}async function vn(e,{status:t=200,error:n,node_ids:r,params:a,route:s,server_route:i,data:o,form:c}){Pe=!0;const f=new URL(location.href);let d;({params:a={},route:s={id:null}}=await he(f,!1)||{}),d=Le.find(({id:l})=>l===s.id);let p,u=!0;try{const l=r.map(async(y,E)=>{const _=o[E];return _?.uses&&(_.uses=_t(_.uses)),Ce({loader:v.nodes[y],url:f,params:a,route:s,parent:async()=>{const N={};for(let R=0;R<E;R+=1)Object.assign(N,(await l[R]).data);return N},server_data_node:Ne(_)})}),h=await Promise.all(l);if(d){const y=d.layouts;for(let E=0;E<y.length;E++)y[E]||h.splice(E,0,void 0)}p=ie({url:f,params:a,branch:h,status:t,error:n,form:c,route:d??null})}catch(l){if(l instanceof Se){await q(new URL(l.location,location.href));return}p=await de({status:ne(l),error:await M(l,{url:f,params:a,route:s}),url:f,route:s}),e.textContent="",u=!1}p.props.page&&(p.props.page.state={}),ft(p,e,u)}async function gt(e,t){const n=new URL(e);n.pathname=an(e.pathname),e.pathname.endsWith("/")&&n.searchParams.append(Zt,"1"),n.searchParams.append(Xt,t.map(s=>s?"1":"0").join(""));const r=window.fetch,a=await r(n.href,{});if(!a.ok){let s;throw a.headers.get("content-type")?.includes("application/json")?s=await a.json():a.status===404?s="Not Found":a.status===500&&(s="Internal Error"),new le(a.status,s)}return new Promise(async s=>{const i=new Map,o=a.body.getReader();function c(d){return Wt(d,{...v.decoders,Promise:p=>new Promise((u,l)=>{i.set(p,{fulfil:u,reject:l})})})}let f="";for(;;){const{done:d,value:p}=await o.read();if(d&&!f)break;for(f+=!p&&f?`
2
+ `:At.decode(p,{stream:!0});;){const u=f.indexOf(`
3
+ `);if(u===-1)break;const l=JSON.parse(f.slice(0,u));if(f=f.slice(u+1),l.type==="redirect")return s(l);if(l.type==="data")l.nodes?.forEach(h=>{h?.type==="data"&&(h.uses=_t(h.uses),h.data=c(h.data))}),s(l);else if(l.type==="chunk"){const{id:h,data:y,error:E}=l,_=i.get(h);i.delete(h),E?_.reject(c(E)):_.fulfil(c(y))}}}})}function _t(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let Ee=!1;function bn(e){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const n=mt(e);if(n&&document.getElementById(n)){const{x:a,y:s}=fe();setTimeout(()=>{const i=history.state;Ee=!0,location.replace(`#${n}`),v.hash&&location.replace(e.hash),history.replaceState(i,"",e.hash),scrollTo(a,s),Ee=!1})}else{const a=document.body,s=a.getAttribute("tabindex");a.tabIndex=-1,a.focus({preventScroll:!0,focusVisible:!1}),s!==null?a.setAttribute("tabindex",s):a.removeAttribute("tabindex")}const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let s=0;s<r.rangeCount;s+=1)a.push(r.getRangeAt(s));setTimeout(()=>{if(r.rangeCount===a.length){for(let s=0;s<r.rangeCount;s+=1){const i=a[s],o=r.getRangeAt(s);if(i.commonAncestorContainer!==o.commonAncestorContainer||i.startContainer!==o.startContainer||i.endContainer!==o.endContainer||i.startOffset!==o.startOffset||i.endOffset!==o.endOffset)return}r.removeAllRanges()}})}}}function Oe(e,t,n,r){let a,s;const i=new Promise((c,f)=>{a=c,s=f});return i.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n},willUnload:!t,type:r,complete:i},fulfil:a,reject:s}}function je(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function kn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function mt(e){let t;if(v.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{In as a,Un as g,An as l,S as p,O as s};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.CfcnqqSS.js","../chunks/DsnmJJEf.js","../chunks/B8sFn9qB.js","../chunks/AMsv4DTs.js","../chunks/DUYNrdfy.js","../chunks/DMUWw_xB.js","../chunks/DL7cUWpq.js","../chunks/d2wclEM1.js","../chunks/D6AXzSy_.js","../assets/0.D6CB7gA7.css","../nodes/1.Dy6JXIaq.js","../nodes/2.CIH2PoiR.js","../chunks/QPd3iGhF.js","../chunks/DPYPcVpy.js","../assets/DynamicControlEditor.DoNLxeLe.css","../nodes/3.DjScTeV8.js","../nodes/4.BLFN0K7u.js"])))=>i.map(i=>d[i]);
2
- import{d as O,aa as Y,h as f,ae as B,af as G,ag as J,Y as K,ah as W,T as z,p as F,C as H,u as Q,o as X,g as x,ai as Z,f as V,a as k,s as $,b as E,e as ee,aj as L,c as te,r as re,ak as S,al as se,J as ae,K as ne}from"../chunks/B8sFn9qB.js";import"../chunks/DsnmJJEf.js";import{p as A,i as C}from"../chunks/AMsv4DTs.js";import{c as j}from"../chunks/DL7cUWpq.js";import{b as T}from"../chunks/DPYPcVpy.js";function oe(c){return class extends ce{constructor(e){super({component:c,...e})}}}class ce{#t;#e;constructor(e){var a=new Map,i=(r,t)=>{var s=z(t,!1,!1);return a.set(r,s),s};const l=new Proxy({...e.props||{},$$events:{}},{get(r,t){return f(a.get(t)??i(t,Reflect.get(r,t)))},has(r,t){return t===Y?!0:(f(a.get(t)??i(t,Reflect.get(r,t))),Reflect.has(r,t))},set(r,t,s){return O(a.get(t)??i(t,s),s),Reflect.set(r,t,s)}});this.#e=(e.hydrate?B:G)(e.component,{target:e.target,anchor:e.anchor,props:l,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&J(),this.#t=l.$$events;for(const r of Object.keys(this.#e))r==="$set"||r==="$destroy"||r==="$on"||K(this,r,{get(){return this.#e[r]},set(t){this.#e[r]=t},enumerable:!0});this.#e.$set=r=>{Object.assign(l,r)},this.#e.$destroy=()=>{W(this.#e)}}$set(e){this.#e.$set(e)}$on(e,a){this.#t[e]=this.#t[e]||[];const i=(...l)=>a.call(this,...l);return this.#t[e].push(i),()=>{this.#t[e]=this.#t[e].filter(l=>l!==i)}}$destroy(){this.#e.$destroy()}}const ie="modulepreload",le=function(c,e){return new URL(c,e).href},I={},R=function(e,a,i){let l=Promise.resolve();if(a&&a.length>0){let w=function(o){return Promise.all(o.map(d=>Promise.resolve(d).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};const t=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),p=s?.nonce||s?.getAttribute("nonce");l=w(a.map(o=>{if(o=le(o,i),o in I)return;I[o]=!0;const d=o.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(i)for(let h=t.length-1;h>=0;h--){const n=t[h];if(n.href===o&&(!d||n.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${m}`))return;const u=document.createElement("link");if(u.rel=d?"stylesheet":ie,d||(u.as="script"),u.crossOrigin="",u.href=o,p&&u.setAttribute("nonce",p),document.head.appendChild(u),d)return new Promise((h,n)=>{u.addEventListener("load",h),u.addEventListener("error",()=>n(new Error(`Unable to preload CSS for ${o}`)))})}))}function r(t){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=t,window.dispatchEvent(s),!s.defaultPrevented)throw t}return l.then(t=>{for(const s of t||[])s.status==="rejected"&&r(s.reason);return e().catch(r)})},Pe={};var ue=V('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),de=V("<!> <!>",1);function fe(c,e){F(e,!0);let a=A(e,"components",23,()=>[]),i=A(e,"data_0",3,null),l=A(e,"data_1",3,null);H(()=>e.stores.page.set(e.page)),Q(()=>{e.stores,e.page,e.constructors,a(),e.form,i(),l(),e.stores.page.notify()});let r=x(!1),t=x(!1),s=x(null);X(()=>{const n=e.stores.page.subscribe(()=>{f(r)&&(O(t,!0),Z().then(()=>{O(s,document.title||"untitled page",!0)}))});return O(r,!0),n});const p=S(()=>e.constructors[1]);var w=de(),o=k(w);{var d=n=>{const _=S(()=>e.constructors[0]);var v=L(),b=k(v);j(b,()=>f(_),(g,y)=>{T(y(g,{get data(){return i()},get form(){return e.form},get params(){return e.page.params},children:(P,_e)=>{var D=L(),M=k(D);j(M,()=>f(p),(N,q)=>{T(q(N,{get data(){return l()},get form(){return e.form},get params(){return e.page.params}}),U=>a()[1]=U,()=>a()?.[1])}),E(P,D)},$$slots:{default:!0}}),P=>a()[0]=P,()=>a()?.[0])}),E(n,v)},m=n=>{const _=S(()=>e.constructors[0]);var v=L(),b=k(v);j(b,()=>f(_),(g,y)=>{T(y(g,{get data(){return i()},get form(){return e.form},get params(){return e.page.params}}),P=>a()[0]=P,()=>a()?.[0])}),E(n,v)};C(o,n=>{e.constructors[1]?n(d):n(m,!1)})}var u=$(o,2);{var h=n=>{var _=ue(),v=te(_);{var b=g=>{var y=se();ae(()=>ne(y,f(s))),E(g,y)};C(v,g=>{f(t)&&g(b)})}re(_),E(n,_)};C(u,n=>{f(r)&&n(h)})}E(c,w),ee()}const Re=oe(fe),pe=[()=>R(()=>import("../nodes/0.CfcnqqSS.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),()=>R(()=>import("../nodes/1.Dy6JXIaq.js"),__vite__mapDeps([10,1,8,2,4]),import.meta.url),()=>R(()=>import("../nodes/2.CIH2PoiR.js"),__vite__mapDeps([11,1,8,2,3,12,7,5,4,6,13,14]),import.meta.url),()=>R(()=>import("../nodes/3.DjScTeV8.js"),__vite__mapDeps([15,1,2,3,4,5,6,7,8,12,13,14]),import.meta.url),()=>R(()=>import("../nodes/4.BLFN0K7u.js"),__vite__mapDeps([16,1,8,2,3,7,4]),import.meta.url)],we=[],ke={"/":[2],"/control/[id]":[3],"/setup":[4]},me={handleError:(({error:c})=>{console.error(c)}),reroute:(()=>{}),transport:{}},he=Object.fromEntries(Object.entries(me.transport).map(([c,e])=>[c,e.decode])),Oe=!1,xe=(c,e)=>he[c](e);export{xe as decode,he as decoders,ke as dictionary,Oe as hash,me as hooks,Pe as matchers,pe as nodes,Re as root,we as server_loads};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BIF2SnDb.js","../chunks/DsnmJJEf.js","../chunks/B8sFn9qB.js","../chunks/AMsv4DTs.js","../chunks/xZlTocHV.js","../chunks/C3_XvBfw.js","../chunks/DL7cUWpq.js","../chunks/d2wclEM1.js","../chunks/D6AXzSy_.js","../assets/0.D6CB7gA7.css","../nodes/1.C51hCwd8.js","../nodes/2.i7a08Ot_.js","../chunks/C3vRXKjP.js","../chunks/DPYPcVpy.js","../assets/DynamicControlEditor.DoNLxeLe.css","../nodes/3.BkiMJt_d.js","../nodes/4.DIgBotc9.js"])))=>i.map(i=>d[i]);
2
+ import{d as O,aa as Y,h as f,ae as B,af as G,ag as J,Y as K,ah as W,T as z,p as F,C as H,u as Q,o as X,g as x,ai as Z,f as V,a as k,s as $,b as E,e as ee,aj as L,c as te,r as re,ak as S,al as se,J as ae,K as ne}from"../chunks/B8sFn9qB.js";import"../chunks/DsnmJJEf.js";import{p as A,i as C}from"../chunks/AMsv4DTs.js";import{c as j}from"../chunks/DL7cUWpq.js";import{b as T}from"../chunks/DPYPcVpy.js";function oe(c){return class extends ce{constructor(e){super({component:c,...e})}}}class ce{#t;#e;constructor(e){var a=new Map,i=(r,t)=>{var s=z(t,!1,!1);return a.set(r,s),s};const l=new Proxy({...e.props||{},$$events:{}},{get(r,t){return f(a.get(t)??i(t,Reflect.get(r,t)))},has(r,t){return t===Y?!0:(f(a.get(t)??i(t,Reflect.get(r,t))),Reflect.has(r,t))},set(r,t,s){return O(a.get(t)??i(t,s),s),Reflect.set(r,t,s)}});this.#e=(e.hydrate?B:G)(e.component,{target:e.target,anchor:e.anchor,props:l,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&J(),this.#t=l.$$events;for(const r of Object.keys(this.#e))r==="$set"||r==="$destroy"||r==="$on"||K(this,r,{get(){return this.#e[r]},set(t){this.#e[r]=t},enumerable:!0});this.#e.$set=r=>{Object.assign(l,r)},this.#e.$destroy=()=>{W(this.#e)}}$set(e){this.#e.$set(e)}$on(e,a){this.#t[e]=this.#t[e]||[];const i=(...l)=>a.call(this,...l);return this.#t[e].push(i),()=>{this.#t[e]=this.#t[e].filter(l=>l!==i)}}$destroy(){this.#e.$destroy()}}const ie="modulepreload",le=function(c,e){return new URL(c,e).href},I={},R=function(e,a,i){let l=Promise.resolve();if(a&&a.length>0){let w=function(o){return Promise.all(o.map(d=>Promise.resolve(d).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};const t=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),p=s?.nonce||s?.getAttribute("nonce");l=w(a.map(o=>{if(o=le(o,i),o in I)return;I[o]=!0;const d=o.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(i)for(let h=t.length-1;h>=0;h--){const n=t[h];if(n.href===o&&(!d||n.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${m}`))return;const u=document.createElement("link");if(u.rel=d?"stylesheet":ie,d||(u.as="script"),u.crossOrigin="",u.href=o,p&&u.setAttribute("nonce",p),document.head.appendChild(u),d)return new Promise((h,n)=>{u.addEventListener("load",h),u.addEventListener("error",()=>n(new Error(`Unable to preload CSS for ${o}`)))})}))}function r(t){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=t,window.dispatchEvent(s),!s.defaultPrevented)throw t}return l.then(t=>{for(const s of t||[])s.status==="rejected"&&r(s.reason);return e().catch(r)})},Pe={};var ue=V('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),de=V("<!> <!>",1);function fe(c,e){F(e,!0);let a=A(e,"components",23,()=>[]),i=A(e,"data_0",3,null),l=A(e,"data_1",3,null);H(()=>e.stores.page.set(e.page)),Q(()=>{e.stores,e.page,e.constructors,a(),e.form,i(),l(),e.stores.page.notify()});let r=x(!1),t=x(!1),s=x(null);X(()=>{const n=e.stores.page.subscribe(()=>{f(r)&&(O(t,!0),Z().then(()=>{O(s,document.title||"untitled page",!0)}))});return O(r,!0),n});const p=S(()=>e.constructors[1]);var w=de(),o=k(w);{var d=n=>{const _=S(()=>e.constructors[0]);var v=L(),b=k(v);j(b,()=>f(_),(g,y)=>{T(y(g,{get data(){return i()},get form(){return e.form},get params(){return e.page.params},children:(P,_e)=>{var D=L(),M=k(D);j(M,()=>f(p),(N,q)=>{T(q(N,{get data(){return l()},get form(){return e.form},get params(){return e.page.params}}),U=>a()[1]=U,()=>a()?.[1])}),E(P,D)},$$slots:{default:!0}}),P=>a()[0]=P,()=>a()?.[0])}),E(n,v)},m=n=>{const _=S(()=>e.constructors[0]);var v=L(),b=k(v);j(b,()=>f(_),(g,y)=>{T(y(g,{get data(){return i()},get form(){return e.form},get params(){return e.page.params}}),P=>a()[0]=P,()=>a()?.[0])}),E(n,v)};C(o,n=>{e.constructors[1]?n(d):n(m,!1)})}var u=$(o,2);{var h=n=>{var _=ue(),v=te(_);{var b=g=>{var y=se();ae(()=>ne(y,f(s))),E(g,y)};C(v,g=>{f(t)&&g(b)})}re(_),E(n,_)};C(u,n=>{f(r)&&n(h)})}E(c,w),ee()}const Re=oe(fe),pe=[()=>R(()=>import("../nodes/0.BIF2SnDb.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),()=>R(()=>import("../nodes/1.C51hCwd8.js"),__vite__mapDeps([10,1,8,2,4]),import.meta.url),()=>R(()=>import("../nodes/2.i7a08Ot_.js"),__vite__mapDeps([11,1,8,2,3,12,7,5,4,6,13,14]),import.meta.url),()=>R(()=>import("../nodes/3.BkiMJt_d.js"),__vite__mapDeps([15,1,2,3,4,5,6,7,8,12,13,14]),import.meta.url),()=>R(()=>import("../nodes/4.DIgBotc9.js"),__vite__mapDeps([16,1,8,2,3,7,4]),import.meta.url)],we=[],ke={"/":[2],"/control/[id]":[3],"/setup":[4]},me={handleError:(({error:c})=>{console.error(c)}),reroute:(()=>{}),transport:{}},he=Object.fromEntries(Object.entries(me.transport).map(([c,e])=>[c,e.decode])),Oe=!1,xe=(c,e)=>he[c](e);export{xe as decode,he as decoders,ke as dictionary,Oe as hash,me as hooks,Pe as matchers,pe as nodes,Re as root,we as server_loads};
@@ -0,0 +1 @@
1
+ import{l as o,a as r}from"../chunks/xZlTocHV.js";export{o as load_css,r as start};
@@ -1 +1 @@
1
- import"../chunks/DsnmJJEf.js";import{at as le,p as R,am as y,d as k,T as $,G as m,h as u,an as F,ao as M,c as i,n as A,r as n,b as v,e as N,J as B,K as D,aj as Q,a as U,f as P,o as xe,au as be,s as V,av as ie}from"../chunks/B8sFn9qB.js";import{l as z,p as C,i as w,a as te,s as de}from"../chunks/AMsv4DTs.js";import{g as me}from"../chunks/DUYNrdfy.js";import{p as _e,D as we}from"../chunks/DMUWw_xB.js";import{i as Y}from"../chunks/D6AXzSy_.js";import{a as K,f as ce,w as q}from"../chunks/d2wclEM1.js";le(["change"]);var ye=M("<title> </title>"),ke=M('<svg><!><path d="M11.41 26.59L7.83 23 28 23 28 21 7.83 21 11.41 17.41 10 16 4 22 10 28 11.41 26.59zM28 10L22 4 20.59 5.41 24.17 9 4 9 4 11 24.17 11 20.59 14.59 22 16 28 10z"></path></svg>');function $e(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),Y();var s=ke();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=ye(),c=i(a,!0);n(a),B(()=>D(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(),n(s),v(b,s),N()}var ze=P('<a href="/setup" class="inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors" title="Switch control set"><!> Switch</a>'),Ce=P('<div class="text-sm text-gray-500 dark:text-gray-400">Loading...</div>');function Me(b,t){R(t,!1);const e=()=>te(ce,"$appState",l),[l,o]=de();Y();var g=Q(),f=U(g);{var r=p=>{var x=ze(),d=i(x);$e(d,{size:16}),A(),n(x),v(p,x)},s=p=>{var x=Ce();v(p,x)};w(f,p=>{e().isConnected?p(r):p(s,!1)})}v(b,g),N(),o()}var Se=M("<title> </title>"),Le=M('<svg><!><path d="M31 16L24 23 22.59 21.59 28.17 16 22.59 10.41 24 9 31 16zM1 16L8 9 9.41 10.41 3.83 16 9.41 21.59 8 23 1 16z"></path><path d="M5.91 15H26.080000000000002V17H5.91z" transform="rotate(-75 15.996 16)"></path></svg>');function Ae(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),Y();var s=Le();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=Se(),c=i(a,!0);n(a),B(()=>D(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(2),n(s),v(b,s),N()}var Ee=M("<title> </title>"),He=M('<svg><!><path d="M13 21L26.17 21 23.59 23.59 25 25 30 20 25 15 23.59 16.41 26.17 19 13 19 13 21z"></path><path d="M22,14V10a1,1,0,0,0-.29-.71l-7-7A1,1,0,0,0,14,2H4A2,2,0,0,0,2,4V28a2,2,0,0,0,2,2H20a2,2,0,0,0,2-2V26H20v2H4V4h8v6a2,2,0,0,0,2,2h6v2Zm-8-4V4.41L19.59,10Z"></path></svg>');function Ve(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),Y();var s=He();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=Ee(),c=i(a,!0);n(a),B(()=>D(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(2),n(s),v(b,s),N()}var Re=M("<title> </title>"),Ne=M('<svg><!><path d="M26 24v4H6V24H4v4H4a2 2 0 002 2H26a2 2 0 002-2h0V24zM26 14L24.59 12.59 17 20.17 17 2 15 2 15 20.17 7.41 12.59 6 14 16 24 26 14z"></path></svg>');function ne(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),Y();var s=Ne();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=Re(),c=i(a,!0);n(a),B(()=>D(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(),n(s),v(b,s),N()}var Pe=M("<title> </title>"),Te=M('<svg><!><path fill-rule="evenodd" d="M16,2a14,14,0,0,0-4.43,27.28c.7.13,1-.3,1-.67s0-1.21,0-2.38c-3.89.84-4.71-1.88-4.71-1.88A3.71,3.71,0,0,0,6.24,22.3c-1.27-.86.1-.85.1-.85A2.94,2.94,0,0,1,8.48,22.9a3,3,0,0,0,4.08,1.16,2.93,2.93,0,0,1,.88-1.87c-3.1-.36-6.37-1.56-6.37-6.92a5.4,5.4,0,0,1,1.44-3.76,5,5,0,0,1,.14-3.7s1.17-.38,3.85,1.43a13.3,13.3,0,0,1,7,0c2.67-1.81,3.84-1.43,3.84-1.43a5,5,0,0,1,.14,3.7,5.4,5.4,0,0,1,1.44,3.76c0,5.38-3.27,6.56-6.39,6.91a3.33,3.33,0,0,1,.95,2.59c0,1.87,0,3.38,0,3.84s.25.81,1,.67A14,14,0,0,0,16,2Z"></path></svg>');function je(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),Y();var s=Te();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=Pe(),c=i(a,!0);n(a),B(()=>D(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(),n(s),v(b,s),N()}var Be=(b,t)=>t("csv"),De=(b,t)=>t("excel"),Ye=(b,t)=>t("json"),Ge=P('<div class="space-y-1 p-1"><button class="w-full text-left px-3 py-2 text-sm rounded-md transition-colors duration-200 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"><div class="flex items-center gap-2"><!> <span>Export as CSV</span></div></button> <button class="w-full text-left px-3 py-2 text-sm rounded-md transition-colors duration-200 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"><div class="flex items-center gap-2"><!> <span>Export as Excel</span></div></button> <button class="w-full text-left px-3 py-2 text-sm rounded-md transition-colors duration-200 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"><div class="flex items-center gap-2"><!> <span>Export as JSON</span></div></button></div>'),Ie=P('<div class="flex-1 flex justify-center items-center"><div class="text-center"><div class="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"></div> <p class="text-gray-500 dark:text-gray-400">Switching control set...</p></div></div>'),Ze=P('<div class="flex-1 flex justify-center items-center"><div class="text-center"><div class="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"></div> <p class="text-gray-500 dark:text-gray-400"> </p></div></div>'),Je=P('<header class="bg-white dark:bg-gray-900 shadow-sm border-b border-gray-200 dark:border-gray-700 flex-shrink-0"><div class="w-full px-6 lg:px-8"><div class="flex justify-between items-center h-16"><div class="flex items-center"><a href="/" class="flex items-center space-x-3 hover:opacity-80 transition-opacity"><img src="/lula.png" class="h-8 w-8" alt="Lula Logo"/> <div class="flex flex-col"><span class="text-xl font-bold text-gray-900 dark:text-white">Lula</span> <span class="text-xs text-gray-500 dark:text-gray-400 -mt-1">Gitops for Compliance</span></div></a></div> <div class="flex items-center space-x-4"><!> <!> <a class="p-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors" title="Github" href="https://github.com/defenseunicorns/lula" target="_blank"><!></a></div></div></div></header> <div class="flex-1 flex gap-6 p-6 overflow-hidden"><!></div>',1),Ue=P('<div class="h-screen flex flex-col"><!></div>');function et(b,t){R(t,!0);const e=()=>te(_e,"$page",o),l=()=>te(ce,"$appState",o),[o,g]=de();let f=!1;async function r(a){try{const c=`/api/export-controls?format=${a}`,h=document.createElement("a");h.href=c,h.download="",document.body.appendChild(h),h.click(),document.body.removeChild(h)}catch(c){console.error("Export failed:",c)}}xe(()=>{q.connect();let a=null;const c=async()=>{if(f||e().url.pathname==="/setup"||l().isSwitchingControlSet)return;const h=l();if(h.isConnected){if(f=!0,(!h.name||h.name==="Unknown Control Set"||h.id==="unknown"||h.id==="default")&&(!h.controls||h.controls.length===0)){await q.scanControlSets();const E=await new Promise(G=>{const T=O=>{window.removeEventListener("control-sets-list",T),G(O.detail)};window.addEventListener("control-sets-list",T),setTimeout(()=>{window.removeEventListener("control-sets-list",T),G(null)},2e3)});E&&Array.isArray(E)&&E.length===1?(console.log("Auto-loading single control set:",E[0].path),await q.switchControlSet(E[0].path)):me("/setup")}}else a=window.setTimeout(c,500)};return a=window.setTimeout(c,100),()=>{a&&clearTimeout(a)}}),be(()=>{q.disconnect()});var s=Ue(),p=i(s);{var x=a=>{var c=Je(),h=U(c),E=i(h),G=i(E),T=V(i(G),2),O=i(T);Me(O,{});var ae=V(O,2);{var ve=_=>{we(_,{buttonLabel:"Export",get buttonIcon(){return ne},buttonClass:"inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors",dropdownClass:"w-48",children:W=>{var Z=Ge(),j=i(Z);j.__click=[Be,r];var S=i(j),H=i(S);Ve(H,{class:"w-4 h-4"}),A(2),n(S),n(j);var L=V(j,2);L.__click=[De,r];var J=i(L),X=i(J);ne(X,{class:"w-4 h-4"}),A(2),n(J),n(L);var ee=V(L,2);ee.__click=[Ye,r];var oe=i(ee),pe=i(oe);Ae(pe,{class:"w-4 h-4"}),A(2),n(oe),n(ee),n(Z),v(W,Z)},$$slots:{default:!0}})};w(ae,_=>{l().isConnected&&l().controls&&l().controls.length>0&&_(ve)})}var re=V(ae,2),ue=i(re);je(ue,{class:"w-5 h-5"}),n(re),n(T),n(G),n(E),n(h);var se=V(h,2),ge=i(se);{var fe=_=>{var I=Ie();v(_,I)},he=_=>{var I=Q(),W=U(I);{var Z=S=>{var H=Ze(),L=i(H),J=V(i(L),2),X=i(J,!0);n(J),n(L),n(H),B(()=>D(X,l().isConnected?l().fieldSchema?"Loading controls...":"Loading schema...":"Connecting...")),v(S,H)},j=S=>{var H=Q(),L=U(H);ie(L,()=>t.children),v(S,H)};w(W,S=>{!l().isConnected||!l().controls||l().controls.length===0||!l().fieldSchema?S(Z):S(j,!1)},!0)}v(_,I)};w(ge,_=>{l().isSwitchingControlSet?_(fe):_(he,!1)})}n(se),v(a,c)},d=a=>{var c=Q(),h=U(c);ie(h,()=>t.children),v(a,c)};w(p,a=>{e().url.pathname!=="/setup"?a(x):a(d,!1)})}n(s),v(b,s),N(),g()}le(["click"]);export{et as component};
1
+ import"../chunks/DsnmJJEf.js";import{at as le,p as R,am as y,d as k,T as $,G as m,h as u,an as F,ao as M,c as i,n as A,r as n,b as v,e as N,J as B,K as D,aj as Q,a as U,f as P,o as xe,au as be,s as V,av as ie}from"../chunks/B8sFn9qB.js";import{l as z,p as C,i as w,a as te,s as de}from"../chunks/AMsv4DTs.js";import{g as me}from"../chunks/xZlTocHV.js";import{p as _e,D as we}from"../chunks/C3_XvBfw.js";import{i as Y}from"../chunks/D6AXzSy_.js";import{a as K,f as ce,w as q}from"../chunks/d2wclEM1.js";le(["change"]);var ye=M("<title> </title>"),ke=M('<svg><!><path d="M11.41 26.59L7.83 23 28 23 28 21 7.83 21 11.41 17.41 10 16 4 22 10 28 11.41 26.59zM28 10L22 4 20.59 5.41 24.17 9 4 9 4 11 24.17 11 20.59 14.59 22 16 28 10z"></path></svg>');function $e(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),Y();var s=ke();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=ye(),c=i(a,!0);n(a),B(()=>D(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(),n(s),v(b,s),N()}var ze=P('<a href="/setup" class="inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors" title="Switch control set"><!> Switch</a>'),Ce=P('<div class="text-sm text-gray-500 dark:text-gray-400">Loading...</div>');function Me(b,t){R(t,!1);const e=()=>te(ce,"$appState",l),[l,o]=de();Y();var g=Q(),f=U(g);{var r=p=>{var x=ze(),d=i(x);$e(d,{size:16}),A(),n(x),v(p,x)},s=p=>{var x=Ce();v(p,x)};w(f,p=>{e().isConnected?p(r):p(s,!1)})}v(b,g),N(),o()}var Se=M("<title> </title>"),Le=M('<svg><!><path d="M31 16L24 23 22.59 21.59 28.17 16 22.59 10.41 24 9 31 16zM1 16L8 9 9.41 10.41 3.83 16 9.41 21.59 8 23 1 16z"></path><path d="M5.91 15H26.080000000000002V17H5.91z" transform="rotate(-75 15.996 16)"></path></svg>');function Ae(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),Y();var s=Le();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=Se(),c=i(a,!0);n(a),B(()=>D(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(2),n(s),v(b,s),N()}var Ee=M("<title> </title>"),He=M('<svg><!><path d="M13 21L26.17 21 23.59 23.59 25 25 30 20 25 15 23.59 16.41 26.17 19 13 19 13 21z"></path><path d="M22,14V10a1,1,0,0,0-.29-.71l-7-7A1,1,0,0,0,14,2H4A2,2,0,0,0,2,4V28a2,2,0,0,0,2,2H20a2,2,0,0,0,2-2V26H20v2H4V4h8v6a2,2,0,0,0,2,2h6v2Zm-8-4V4.41L19.59,10Z"></path></svg>');function Ve(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),Y();var s=He();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=Ee(),c=i(a,!0);n(a),B(()=>D(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(2),n(s),v(b,s),N()}var Re=M("<title> </title>"),Ne=M('<svg><!><path d="M26 24v4H6V24H4v4H4a2 2 0 002 2H26a2 2 0 002-2h0V24zM26 14L24.59 12.59 17 20.17 17 2 15 2 15 20.17 7.41 12.59 6 14 16 24 26 14z"></path></svg>');function ne(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),Y();var s=Ne();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=Re(),c=i(a,!0);n(a),B(()=>D(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(),n(s),v(b,s),N()}var Pe=M("<title> </title>"),Te=M('<svg><!><path fill-rule="evenodd" d="M16,2a14,14,0,0,0-4.43,27.28c.7.13,1-.3,1-.67s0-1.21,0-2.38c-3.89.84-4.71-1.88-4.71-1.88A3.71,3.71,0,0,0,6.24,22.3c-1.27-.86.1-.85.1-.85A2.94,2.94,0,0,1,8.48,22.9a3,3,0,0,0,4.08,1.16,2.93,2.93,0,0,1,.88-1.87c-3.1-.36-6.37-1.56-6.37-6.92a5.4,5.4,0,0,1,1.44-3.76,5,5,0,0,1,.14-3.7s1.17-.38,3.85,1.43a13.3,13.3,0,0,1,7,0c2.67-1.81,3.84-1.43,3.84-1.43a5,5,0,0,1,.14,3.7,5.4,5.4,0,0,1,1.44,3.76c0,5.38-3.27,6.56-6.39,6.91a3.33,3.33,0,0,1,.95,2.59c0,1.87,0,3.38,0,3.84s.25.81,1,.67A14,14,0,0,0,16,2Z"></path></svg>');function je(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),Y();var s=Te();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=Pe(),c=i(a,!0);n(a),B(()=>D(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(),n(s),v(b,s),N()}var Be=(b,t)=>t("csv"),De=(b,t)=>t("excel"),Ye=(b,t)=>t("json"),Ge=P('<div class="space-y-1 p-1"><button class="w-full text-left px-3 py-2 text-sm rounded-md transition-colors duration-200 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"><div class="flex items-center gap-2"><!> <span>Export as CSV</span></div></button> <button class="w-full text-left px-3 py-2 text-sm rounded-md transition-colors duration-200 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"><div class="flex items-center gap-2"><!> <span>Export as Excel</span></div></button> <button class="w-full text-left px-3 py-2 text-sm rounded-md transition-colors duration-200 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"><div class="flex items-center gap-2"><!> <span>Export as JSON</span></div></button></div>'),Ie=P('<div class="flex-1 flex justify-center items-center"><div class="text-center"><div class="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"></div> <p class="text-gray-500 dark:text-gray-400">Switching control set...</p></div></div>'),Ze=P('<div class="flex-1 flex justify-center items-center"><div class="text-center"><div class="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"></div> <p class="text-gray-500 dark:text-gray-400"> </p></div></div>'),Je=P('<header class="bg-white dark:bg-gray-900 shadow-sm border-b border-gray-200 dark:border-gray-700 flex-shrink-0"><div class="w-full px-6 lg:px-8"><div class="flex justify-between items-center h-16"><div class="flex items-center"><a href="/" class="flex items-center space-x-3 hover:opacity-80 transition-opacity"><img src="/lula.png" class="h-8 w-8" alt="Lula Logo"/> <div class="flex flex-col"><span class="text-xl font-bold text-gray-900 dark:text-white">Lula</span> <span class="text-xs text-gray-500 dark:text-gray-400 -mt-1">Gitops for Compliance</span></div></a></div> <div class="flex items-center space-x-4"><!> <!> <a class="p-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors" title="Github" href="https://github.com/defenseunicorns/lula" target="_blank"><!></a></div></div></div></header> <div class="flex-1 flex gap-6 p-6 overflow-hidden"><!></div>',1),Ue=P('<div class="h-screen flex flex-col"><!></div>');function et(b,t){R(t,!0);const e=()=>te(_e,"$page",o),l=()=>te(ce,"$appState",o),[o,g]=de();let f=!1;async function r(a){try{const c=`/api/export-controls?format=${a}`,h=document.createElement("a");h.href=c,h.download="",document.body.appendChild(h),h.click(),document.body.removeChild(h)}catch(c){console.error("Export failed:",c)}}xe(()=>{q.connect();let a=null;const c=async()=>{if(f||e().url.pathname==="/setup"||l().isSwitchingControlSet)return;const h=l();if(h.isConnected){if(f=!0,(!h.name||h.name==="Unknown Control Set"||h.id==="unknown"||h.id==="default")&&(!h.controls||h.controls.length===0)){await q.scanControlSets();const E=await new Promise(G=>{const T=O=>{window.removeEventListener("control-sets-list",T),G(O.detail)};window.addEventListener("control-sets-list",T),setTimeout(()=>{window.removeEventListener("control-sets-list",T),G(null)},2e3)});E&&Array.isArray(E)&&E.length===1?(console.log("Auto-loading single control set:",E[0].path),await q.switchControlSet(E[0].path)):me("/setup")}}else a=window.setTimeout(c,500)};return a=window.setTimeout(c,100),()=>{a&&clearTimeout(a)}}),be(()=>{q.disconnect()});var s=Ue(),p=i(s);{var x=a=>{var c=Je(),h=U(c),E=i(h),G=i(E),T=V(i(G),2),O=i(T);Me(O,{});var ae=V(O,2);{var ve=_=>{we(_,{buttonLabel:"Export",get buttonIcon(){return ne},buttonClass:"inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors",dropdownClass:"w-48",children:W=>{var Z=Ge(),j=i(Z);j.__click=[Be,r];var S=i(j),H=i(S);Ve(H,{class:"w-4 h-4"}),A(2),n(S),n(j);var L=V(j,2);L.__click=[De,r];var J=i(L),X=i(J);ne(X,{class:"w-4 h-4"}),A(2),n(J),n(L);var ee=V(L,2);ee.__click=[Ye,r];var oe=i(ee),pe=i(oe);Ae(pe,{class:"w-4 h-4"}),A(2),n(oe),n(ee),n(Z),v(W,Z)},$$slots:{default:!0}})};w(ae,_=>{l().isConnected&&l().controls&&l().controls.length>0&&_(ve)})}var re=V(ae,2),ue=i(re);je(ue,{class:"w-5 h-5"}),n(re),n(T),n(G),n(E),n(h);var se=V(h,2),ge=i(se);{var fe=_=>{var I=Ie();v(_,I)},he=_=>{var I=Q(),W=U(I);{var Z=S=>{var H=Ze(),L=i(H),J=V(i(L),2),X=i(J,!0);n(J),n(L),n(H),B(()=>D(X,l().isConnected?l().fieldSchema?"Loading controls...":"Loading schema...":"Connecting...")),v(S,H)},j=S=>{var H=Q(),L=U(H);ie(L,()=>t.children),v(S,H)};w(W,S=>{!l().isConnected||!l().controls||l().controls.length===0||!l().fieldSchema?S(Z):S(j,!1)},!0)}v(_,I)};w(ge,_=>{l().isSwitchingControlSet?_(fe):_(he,!1)})}n(se),v(a,c)},d=a=>{var c=Q(),h=U(c);ie(h,()=>t.children),v(a,c)};w(p,a=>{e().url.pathname!=="/setup"?a(x):a(d,!1)})}n(s),v(b,s),N(),g()}le(["click"]);export{et as component};
@@ -1 +1 @@
1
- import"../chunks/DsnmJJEf.js";import{i as u}from"../chunks/D6AXzSy_.js";import{p as h,f as g,a as l,J as v,b as d,e as _,c as s,r as a,s as x,K as o}from"../chunks/B8sFn9qB.js";import{s as $,p}from"../chunks/DUYNrdfy.js";const b={get error(){return p.error},get status(){return p.status}};$.updated.check;const i=b;var k=g("<h1> </h1> <p> </p>",1);function q(m,c){h(c,!1),u();var t=k(),r=l(t),n=s(r,!0);a(r);var e=x(r,2),f=s(e,!0);a(e),v(()=>{o(n,i.status),o(f,i.error?.message)}),d(m,t),_()}export{q as component};
1
+ import"../chunks/DsnmJJEf.js";import{i as u}from"../chunks/D6AXzSy_.js";import{p as h,f as g,a as l,J as v,b as d,e as _,c as s,r as a,s as x,K as o}from"../chunks/B8sFn9qB.js";import{s as $,p}from"../chunks/xZlTocHV.js";const b={get error(){return p.error},get status(){return p.status}};$.updated.check;const i=b;var k=g("<h1> </h1> <p> </p>",1);function q(m,c){h(c,!1),u();var t=k(),r=l(t),n=s(r,!0);a(r);var e=x(r,2),f=s(e,!0);a(e),v(()=>{o(n,i.status),o(f,i.error?.message)}),d(m,t),_()}export{q as component};
@@ -1 +1 @@
1
- import"../chunks/DsnmJJEf.js";import"../chunks/D6AXzSy_.js";import{f,a as y,b as n,c as t,r,s as w,n as C}from"../chunks/B8sFn9qB.js";import{i as k,s as $,a as D}from"../chunks/AMsv4DTs.js";import{C as S,a as j,D as L}from"../chunks/QPd3iGhF.js";import{s as N}from"../chunks/DMUWw_xB.js";var P=f('<div class=" h-full flex flex-col"><div class="flex-1 flex items-center justify-center p-8"><div class="text-center text-gray-500 dark:text-gray-400"><!> <h3 class="text-xl font-semibold text-gray-900 dark:text-white mb-2">No Control Selected</h3> <p class="text-gray-600 dark:text-gray-400">Select a control from the list to view and edit its details</p></div></div></div>'),q=f('<div class="w-1/2 flex flex-col"><div class="bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg shadow-sm h-full flex flex-col"><!></div></div> <div class="w-1/2 flex flex-col"><!></div>',1);function H(m){const o=()=>D(N,"$selectedControl",x),[x,g]=$();var l=q(),a=y(l),i=t(a),p=t(i);S(p,{}),r(i),r(a);var d=w(a,2),_=t(d);{var h=e=>{j(e,{get control(){return o()}})},b=e=>{var s=P(),c=t(s),v=t(c),u=t(v);L(u,{class:"mx-auto h-16 w-16 mb-4"}),C(4),r(v),r(c),r(s),n(e,s)};k(_,e=>{o()?e(h):e(b,!1)})}r(d),n(m,l),g()}export{H as component};
1
+ import"../chunks/DsnmJJEf.js";import"../chunks/D6AXzSy_.js";import{f,a as y,b as n,c as t,r,s as w,n as C}from"../chunks/B8sFn9qB.js";import{i as k,s as $,a as D}from"../chunks/AMsv4DTs.js";import{C as S,a as j,D as L}from"../chunks/C3vRXKjP.js";import{s as N}from"../chunks/C3_XvBfw.js";var P=f('<div class=" h-full flex flex-col"><div class="flex-1 flex items-center justify-center p-8"><div class="text-center text-gray-500 dark:text-gray-400"><!> <h3 class="text-xl font-semibold text-gray-900 dark:text-white mb-2">No Control Selected</h3> <p class="text-gray-600 dark:text-gray-400">Select a control from the list to view and edit its details</p></div></div></div>'),q=f('<div class="w-1/2 flex flex-col"><div class="bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg shadow-sm h-full flex flex-col"><!></div></div> <div class="w-1/2 flex flex-col"><!></div>',1);function H(m){const o=()=>D(N,"$selectedControl",x),[x,g]=$();var l=q(),a=y(l),i=t(a),p=t(i);S(p,{}),r(i),r(a);var d=w(a,2),_=t(d);{var h=e=>{j(e,{get control(){return o()}})},b=e=>{var s=P(),c=t(s),v=t(c),u=t(v);L(u,{class:"mx-auto h-16 w-16 mb-4"}),C(4),r(v),r(c),r(s),n(e,s)};k(_,e=>{o()?e(h):e(b,!1)})}r(d),n(m,l),g()}export{H as component};
@@ -1 +1 @@
1
- import"../chunks/DsnmJJEf.js";import{p as S,u as A,d as x,o as B,f as n,a as F,b as i,e as H,c as s,g as N,r as a,s as h,h as P,n as R}from"../chunks/B8sFn9qB.js";import{a as C,i as b,s as U}from"../chunks/AMsv4DTs.js";import{g as V}from"../chunks/DUYNrdfy.js";import{p as q,s as _}from"../chunks/DMUWw_xB.js";import{C as G,a as J,D as K}from"../chunks/QPd3iGhF.js";import{w}from"../chunks/d2wclEM1.js";var O=n('<div class="absolute top-4 right-4 z-10"><div class="w-8 h-8 flex items-center justify-center rounded-full bg-blue-100 dark:bg-blue-900/30" title="Loading control..."><svg class="w-5 h-5 text-blue-600 dark:text-blue-400 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg></div></div>'),Q=n('<div class=" h-full flex flex-col"><div class="flex-1 flex items-center justify-center p-8"><div class="text-center text-gray-500 dark:text-gray-400"><!> <h3 class="text-xl font-semibold text-gray-900 dark:text-white mb-2">No Control Selected</h3> <p class="text-gray-600 dark:text-gray-400">Select a control from the list to view and edit its details</p></div></div></div>'),T=n('<div class="w-1/2 flex flex-col"><div class="bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg shadow-sm h-full flex flex-col"><!></div></div> <div class="w-1/2 flex flex-col relative"><!> <!></div>',1);function se(y,k){S(k,!0);const $=()=>C(q,"$page",c),d=()=>C(_,"$selectedControl",c),[c,D]=U();let v="",r=N(!1);A(()=>{const e=$().params.id;if(!e)return;const t=decodeURIComponent(e);t&&t!==v&&w.isConnected()&&(v=t,x(r,!0),w.getControlDetails(t))}),B(()=>{const e=t=>{const o=t.detail;x(r,!1),o?_.set(o):V("/")};return window.addEventListener("control-details",e),()=>{window.removeEventListener("control-details",e)}});var f=T(),l=F(f),p=s(l),L=s(p);G(L,{}),a(p),a(l);var g=h(l,2),m=s(g);{var I=e=>{var t=O();i(e,t)};b(m,e=>{P(r)&&e(I)})}var z=h(m,2);{var j=e=>{J(e,{get control(){return d()}})},E=e=>{var t=Q(),o=s(t),u=s(o),M=s(u);K(M,{class:"mx-auto h-16 w-16 mb-4"}),R(4),a(u),a(o),a(t),i(e,t)};b(z,e=>{d()?e(j):e(E,!1)})}a(g),i(y,f),H(),D()}export{se as component};
1
+ import"../chunks/DsnmJJEf.js";import{p as S,u as A,d as x,o as B,f as n,a as F,b as i,e as H,c as s,g as N,r as a,s as h,h as P,n as R}from"../chunks/B8sFn9qB.js";import{a as C,i as b,s as U}from"../chunks/AMsv4DTs.js";import{g as V}from"../chunks/xZlTocHV.js";import{p as q,s as _}from"../chunks/C3_XvBfw.js";import{C as G,a as J,D as K}from"../chunks/C3vRXKjP.js";import{w}from"../chunks/d2wclEM1.js";var O=n('<div class="absolute top-4 right-4 z-10"><div class="w-8 h-8 flex items-center justify-center rounded-full bg-blue-100 dark:bg-blue-900/30" title="Loading control..."><svg class="w-5 h-5 text-blue-600 dark:text-blue-400 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg></div></div>'),Q=n('<div class=" h-full flex flex-col"><div class="flex-1 flex items-center justify-center p-8"><div class="text-center text-gray-500 dark:text-gray-400"><!> <h3 class="text-xl font-semibold text-gray-900 dark:text-white mb-2">No Control Selected</h3> <p class="text-gray-600 dark:text-gray-400">Select a control from the list to view and edit its details</p></div></div></div>'),T=n('<div class="w-1/2 flex flex-col"><div class="bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg shadow-sm h-full flex flex-col"><!></div></div> <div class="w-1/2 flex flex-col relative"><!> <!></div>',1);function se(y,k){S(k,!0);const $=()=>C(q,"$page",c),d=()=>C(_,"$selectedControl",c),[c,D]=U();let v="",r=N(!1);A(()=>{const e=$().params.id;if(!e)return;const t=decodeURIComponent(e);t&&t!==v&&w.isConnected()&&(v=t,x(r,!0),w.getControlDetails(t))}),B(()=>{const e=t=>{const o=t.detail;x(r,!1),o?_.set(o):V("/")};return window.addEventListener("control-details",e),()=>{window.removeEventListener("control-details",e)}});var f=T(),l=F(f),p=s(l),L=s(p);G(L,{}),a(p),a(l);var g=h(l,2),m=s(g);{var I=e=>{var t=O();i(e,t)};b(m,e=>{P(r)&&e(I)})}var z=h(m,2);{var j=e=>{J(e,{get control(){return d()}})},E=e=>{var t=Q(),o=s(t),u=s(o),M=s(u);K(M,{class:"mx-auto h-16 w-16 mb-4"}),R(4),a(u),a(o),a(t),i(e,t)};b(z,e=>{d()?e(j):e(E,!1)})}a(g),i(y,f),H(),D()}export{se as component};
@@ -1,4 +1,4 @@
1
- import"../chunks/DsnmJJEf.js";import{i as Je}from"../chunks/D6AXzSy_.js";import{p as Ye,am as Te,d as o,T as k,G as ge,h as e,an as $r,ao as Ve,c as a,n as _e,r as t,b as d,e as We,J as F,K as E,ap as Lr,f as h,s as i,aq as g,a as ye,ar as mr,aj as Me,a0 as De,ak as hr,al as rr,as as yr,k as de,o as ot,W as lt}from"../chunks/B8sFn9qB.js";import{l as tr,p as Ue,i as M,a as st,s as it}from"../chunks/AMsv4DTs.js";import{a as Nr,s as se,r as Vr,e as ce,b as qe,c as jr,d as _r,i as Cr,f as Sr,w as wr}from"../chunks/d2wclEM1.js";import{g as nt}from"../chunks/DUYNrdfy.js";function dt(pe){return function(...q){var z=q[0];return z.stopPropagation(),pe?.apply(this,q)}}var vt=Ve("<title> </title>"),ct=Ve('<svg><!><path d="M11 18L12.41 19.41 15 16.83 15 29 17 29 17 16.83 19.59 19.41 21 18 16 13 11 18z"></path><path d="M23.5,22H23V20h.5a4.5,4.5,0,0,0,.36-9L23,11l-.1-.82a7,7,0,0,0-13.88,0L9,11,8.14,11a4.5,4.5,0,0,0,.36,9H9v2H8.5A6.5,6.5,0,0,1,7.2,9.14a9,9,0,0,1,17.6,0A6.5,6.5,0,0,1,23.5,22Z"></path></svg>');function gt(pe,q){const z=tr(q,["children","$$slots","$$events","$$legacy"]),X=tr(z,["size","title"]);Ye(q,!1);const O=k(),L=k();let N=Ue(q,"size",8,16),f=Ue(q,"title",8,void 0);Te(()=>(ge(z),ge(f())),()=>{o(O,z["aria-label"]||z["aria-labelledby"]||f())}),Te(()=>(e(O),ge(z)),()=>{o(L,{"aria-hidden":e(O)?void 0:!0,role:e(O)?"img":void 0,focusable:Number(z.tabindex)===0?!0:void 0})}),$r(),Je();var S=ct();Nr(S,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:N(),height:N(),...e(L),...X}));var K=a(S);{var re=P=>{var p=vt(),U=a(p,!0);t(p),F(()=>E(U,f())),d(P,p)};M(K,P=>{f()&&P(re)})}_e(2),t(S),d(pe,S),We()}var pt=Ve("<title> </title>"),ut=Ve('<svg><!><path d="M10 6H14V10H10zM18 6H22V10H18zM10 14H14V18H10zM18 14H22V18H18zM10 22H14V26H10zM18 22H22V26H18z"></path></svg>');function kr(pe,q){const z=tr(q,["children","$$slots","$$events","$$legacy"]),X=tr(z,["size","title"]);Ye(q,!1);const O=k(),L=k();let N=Ue(q,"size",8,16),f=Ue(q,"title",8,void 0);Te(()=>(ge(z),ge(f())),()=>{o(O,z["aria-label"]||z["aria-labelledby"]||f())}),Te(()=>(e(O),ge(z)),()=>{o(L,{"aria-hidden":e(O)?void 0:!0,role:e(O)?"img":void 0,focusable:Number(z.tabindex)===0?!0:void 0})}),$r(),Je();var S=ut();Nr(S,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:N(),height:N(),...e(L),...X}));var K=a(S);{var re=P=>{var p=pt(),U=a(p,!0);t(p),F(()=>E(U,f())),d(P,p)};M(K,P=>{f()&&P(re)})}_e(),t(S),d(pe,S),We()}var bt=h('<div class="p-4 text-sm text-blue-800 rounded-lg bg-blue-50 dark:bg-gray-800 dark:text-blue-400"><div class="flex items-center"><svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"></path></svg> <div><span class="font-medium">File loaded:</span> <div class="mt-1"><span class="font-medium">Sheets:</span> <span class="font-medium">Fields:</span> <span class="font-medium">Controls found:</span> </div></div></div></div>'),ft=h('<div class="p-4 text-sm text-red-800 rounded-lg bg-red-50 dark:bg-gray-800 dark:text-red-400"><div class="flex items-center"><svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"></path></svg> <span> </span></div></div>'),xt=h('<div class="p-4 text-sm text-green-800 rounded-lg bg-green-50 dark:bg-gray-800 dark:text-green-400"><div class="flex items-center"><svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"></path></svg> <span> </span></div></div>'),mt=h("<option> </option>"),ht=h("<option> </option>"),yt=h("<option> </option>"),_t=h('<span class="ml-auto text-xs text-blue-600 dark:text-blue-400">ID</span>'),wt=h('<div draggable="true" role="button" tabindex="0" class="flex items-center px-3 py-2 bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400 rounded text-sm cursor-move hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors opacity-75"><svg class="w-3 h-3 mr-2 flex-shrink-0" fill="currentColor" viewBox="0 0 20 20"><path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"></path></svg> <span class="truncate line-through"> </span> <!></div>'),kt=h('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">No excluded fields</p>'),Ct=h('<div draggable="true" role="button" tabindex="0"><!> <span class="truncate"> </span></div>'),St=h('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p>'),$t=h('<div draggable="true" role="button" tabindex="0"><!> <span class="truncate"> </span></div>'),Dt=h('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p>'),Mt=h('<div draggable="true" role="button" tabindex="0"><!> <span class="truncate"> </span></div>'),zt=h('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p>'),At=h('<div draggable="false" role="button" tabindex="0" class="flex items-center px-3 py-2 bg-orange-100 dark:bg-orange-900/30 text-orange-800 dark:text-orange-300 rounded text-sm hover:bg-orange-200 dark:hover:bg-orange-800/30 transition-colors"><span class="truncate"> </span> <button class="ml-auto text-gray-400 hover:text-red-500 dark:text-gray-500 dark:hover:text-red-400" title="Remove from mappings">×</button></div>'),Ft=h('<div role="region" aria-label="Justification field drop zone"><p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p></div>'),Ot=h('<th class="px-4 py-2"> </th>'),Pt=h('<td class="px-4 py-2"> </td>'),Ht=h('<tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700"></tr>'),Et=h('<div class="bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-700"><h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-4">Sample Data Preview</h3> <div class="overflow-x-auto"><table class="w-full text-sm text-left text-gray-500 dark:text-gray-400"><thead class="text-xs text-gray-700 uppercase bg-gray-100 dark:bg-gray-600 dark:text-gray-400"><tr></tr></thead><tbody></tbody></table></div></div>'),It=h('<span class="flex items-center"><svg class="animate-spin -ml-1 mr-3 h-5 w-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> Importing...</span>'),Tt=h(`<div class="bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-700"><h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-4">Import Options</h3> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"><div><label for="controlSetName" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Control Set Name <span class="text-red-500">*</span></label> <input type="text" id="controlSetName" placeholder="e.g., NIST 800-53 Rev 4" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white" required/> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">This will be used as the display name and folder name</p></div> <div><label for="controlSetDescription" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Description</label> <input type="text" id="controlSetDescription" placeholder="Optional description" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white"/> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Brief description of this control set</p></div></div> <div class="grid grid-cols-1 md:grid-cols-2 gap-4"><div><label for="sheet" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Sheet</label> <select id="sheet" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white"></select> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Select which worksheet contains your control data</p></div> <div><label for="headerRow" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Select Header Row</label> <select id="headerRow" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white"></select> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Select the row containing column headers</p></div> <div><label for="controlIdField" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Control ID Field <span class="text-red-500">*</span></label> <select id="controlIdField" required><option disabled>Select Control ID field</option><!></select> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Column containing unique control identifiers (e.g., AC-1, SC-7)</p></div></div></div> <div class="bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-700"><h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-2">Organize Fields</h3> <p class="text-sm text-gray-600 dark:text-gray-400 mb-4">Drag fields to organize them. <strong>Overview fields</strong> will appear as table columns in
1
+ import"../chunks/DsnmJJEf.js";import{i as Je}from"../chunks/D6AXzSy_.js";import{p as Ye,am as Te,d as o,T as k,G as ge,h as e,an as $r,ao as Ve,c as a,n as _e,r as t,b as d,e as We,J as F,K as E,ap as Lr,f as h,s as i,aq as g,a as ye,ar as mr,aj as Me,a0 as De,ak as hr,al as rr,as as yr,k as de,o as ot,W as lt}from"../chunks/B8sFn9qB.js";import{l as tr,p as Ue,i as M,a as st,s as it}from"../chunks/AMsv4DTs.js";import{a as Nr,s as se,r as Vr,e as ce,b as qe,c as jr,d as _r,i as Cr,f as Sr,w as wr}from"../chunks/d2wclEM1.js";import{g as nt}from"../chunks/xZlTocHV.js";function dt(pe){return function(...q){var z=q[0];return z.stopPropagation(),pe?.apply(this,q)}}var vt=Ve("<title> </title>"),ct=Ve('<svg><!><path d="M11 18L12.41 19.41 15 16.83 15 29 17 29 17 16.83 19.59 19.41 21 18 16 13 11 18z"></path><path d="M23.5,22H23V20h.5a4.5,4.5,0,0,0,.36-9L23,11l-.1-.82a7,7,0,0,0-13.88,0L9,11,8.14,11a4.5,4.5,0,0,0,.36,9H9v2H8.5A6.5,6.5,0,0,1,7.2,9.14a9,9,0,0,1,17.6,0A6.5,6.5,0,0,1,23.5,22Z"></path></svg>');function gt(pe,q){const z=tr(q,["children","$$slots","$$events","$$legacy"]),X=tr(z,["size","title"]);Ye(q,!1);const O=k(),L=k();let N=Ue(q,"size",8,16),f=Ue(q,"title",8,void 0);Te(()=>(ge(z),ge(f())),()=>{o(O,z["aria-label"]||z["aria-labelledby"]||f())}),Te(()=>(e(O),ge(z)),()=>{o(L,{"aria-hidden":e(O)?void 0:!0,role:e(O)?"img":void 0,focusable:Number(z.tabindex)===0?!0:void 0})}),$r(),Je();var S=ct();Nr(S,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:N(),height:N(),...e(L),...X}));var K=a(S);{var re=P=>{var p=vt(),U=a(p,!0);t(p),F(()=>E(U,f())),d(P,p)};M(K,P=>{f()&&P(re)})}_e(2),t(S),d(pe,S),We()}var pt=Ve("<title> </title>"),ut=Ve('<svg><!><path d="M10 6H14V10H10zM18 6H22V10H18zM10 14H14V18H10zM18 14H22V18H18zM10 22H14V26H10zM18 22H22V26H18z"></path></svg>');function kr(pe,q){const z=tr(q,["children","$$slots","$$events","$$legacy"]),X=tr(z,["size","title"]);Ye(q,!1);const O=k(),L=k();let N=Ue(q,"size",8,16),f=Ue(q,"title",8,void 0);Te(()=>(ge(z),ge(f())),()=>{o(O,z["aria-label"]||z["aria-labelledby"]||f())}),Te(()=>(e(O),ge(z)),()=>{o(L,{"aria-hidden":e(O)?void 0:!0,role:e(O)?"img":void 0,focusable:Number(z.tabindex)===0?!0:void 0})}),$r(),Je();var S=ut();Nr(S,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:N(),height:N(),...e(L),...X}));var K=a(S);{var re=P=>{var p=pt(),U=a(p,!0);t(p),F(()=>E(U,f())),d(P,p)};M(K,P=>{f()&&P(re)})}_e(),t(S),d(pe,S),We()}var bt=h('<div class="p-4 text-sm text-blue-800 rounded-lg bg-blue-50 dark:bg-gray-800 dark:text-blue-400"><div class="flex items-center"><svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"></path></svg> <div><span class="font-medium">File loaded:</span> <div class="mt-1"><span class="font-medium">Sheets:</span> <span class="font-medium">Fields:</span> <span class="font-medium">Controls found:</span> </div></div></div></div>'),ft=h('<div class="p-4 text-sm text-red-800 rounded-lg bg-red-50 dark:bg-gray-800 dark:text-red-400"><div class="flex items-center"><svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"></path></svg> <span> </span></div></div>'),xt=h('<div class="p-4 text-sm text-green-800 rounded-lg bg-green-50 dark:bg-gray-800 dark:text-green-400"><div class="flex items-center"><svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"></path></svg> <span> </span></div></div>'),mt=h("<option> </option>"),ht=h("<option> </option>"),yt=h("<option> </option>"),_t=h('<span class="ml-auto text-xs text-blue-600 dark:text-blue-400">ID</span>'),wt=h('<div draggable="true" role="button" tabindex="0" class="flex items-center px-3 py-2 bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400 rounded text-sm cursor-move hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors opacity-75"><svg class="w-3 h-3 mr-2 flex-shrink-0" fill="currentColor" viewBox="0 0 20 20"><path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"></path></svg> <span class="truncate line-through"> </span> <!></div>'),kt=h('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">No excluded fields</p>'),Ct=h('<div draggable="true" role="button" tabindex="0"><!> <span class="truncate"> </span></div>'),St=h('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p>'),$t=h('<div draggable="true" role="button" tabindex="0"><!> <span class="truncate"> </span></div>'),Dt=h('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p>'),Mt=h('<div draggable="true" role="button" tabindex="0"><!> <span class="truncate"> </span></div>'),zt=h('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p>'),At=h('<div draggable="false" role="button" tabindex="0" class="flex items-center px-3 py-2 bg-orange-100 dark:bg-orange-900/30 text-orange-800 dark:text-orange-300 rounded text-sm hover:bg-orange-200 dark:hover:bg-orange-800/30 transition-colors"><span class="truncate"> </span> <button class="ml-auto text-gray-400 hover:text-red-500 dark:text-gray-500 dark:hover:text-red-400" title="Remove from mappings">×</button></div>'),Ft=h('<div role="region" aria-label="Justification field drop zone"><p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p></div>'),Ot=h('<th class="px-4 py-2"> </th>'),Pt=h('<td class="px-4 py-2"> </td>'),Ht=h('<tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700"></tr>'),Et=h('<div class="bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-700"><h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-4">Sample Data Preview</h3> <div class="overflow-x-auto"><table class="w-full text-sm text-left text-gray-500 dark:text-gray-400"><thead class="text-xs text-gray-700 uppercase bg-gray-100 dark:bg-gray-600 dark:text-gray-400"><tr></tr></thead><tbody></tbody></table></div></div>'),It=h('<span class="flex items-center"><svg class="animate-spin -ml-1 mr-3 h-5 w-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> Importing...</span>'),Tt=h(`<div class="bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-700"><h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-4">Import Options</h3> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"><div><label for="controlSetName" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Control Set Name <span class="text-red-500">*</span></label> <input type="text" id="controlSetName" placeholder="e.g., NIST 800-53 Rev 4" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white" required/> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">This will be used as the display name and folder name</p></div> <div><label for="controlSetDescription" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Description</label> <input type="text" id="controlSetDescription" placeholder="Optional description" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white"/> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Brief description of this control set</p></div></div> <div class="grid grid-cols-1 md:grid-cols-2 gap-4"><div><label for="sheet" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Sheet</label> <select id="sheet" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white"></select> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Select which worksheet contains your control data</p></div> <div><label for="headerRow" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Select Header Row</label> <select id="headerRow" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white"></select> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Select the row containing column headers</p></div> <div><label for="controlIdField" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Control ID Field <span class="text-red-500">*</span></label> <select id="controlIdField" required><option disabled>Select Control ID field</option><!></select> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Column containing unique control identifiers (e.g., AC-1, SC-7)</p></div></div></div> <div class="bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-700"><h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-2">Organize Fields</h3> <p class="text-sm text-gray-600 dark:text-gray-400 mb-4">Drag fields to organize them. <strong>Overview fields</strong> will appear as table columns in
2
2
  the controls list.</p> <div class="grid grid-cols-1 lg:grid-cols-5 gap-4"><div class="border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800"><div class="p-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-700 rounded-t-lg"><h4 class="text-sm font-semibold text-gray-700 dark:text-gray-300">Excluded Fields</h4> <p class="text-xs text-gray-500 dark:text-gray-400 mt-1">Not imported</p></div> <div role="region" aria-label="Excluded fields drop zone"><!> <!></div></div> <div class="border border-blue-300 dark:border-blue-700 rounded-lg bg-white dark:bg-gray-800"><div class="p-3 border-b border-blue-200 dark:border-blue-800 bg-blue-50 dark:bg-blue-900/20 rounded-t-lg"><h4 class="text-sm font-semibold text-blue-700 dark:text-blue-300">Overview Tab</h4> <p class="text-xs text-blue-600 dark:text-blue-400 mt-1">Shows in details & table columns</p></div> <div role="region" aria-label="Overview tab drop zone"><!> <!></div></div> <div class="border border-green-300 dark:border-green-700 rounded-lg bg-white dark:bg-gray-800"><div class="p-3 border-b border-green-200 dark:border-green-800 bg-green-50 dark:bg-green-900/20 rounded-t-lg"><h4 class="text-sm font-semibold text-green-700 dark:text-green-300">Implementation Tab</h4> <p class="text-xs text-green-600 dark:text-green-400 mt-1">Status & compliance</p></div> <div role="region" aria-label="Implementation tab drop zone"><!> <!></div></div> <div class="border border-purple-300 dark:border-purple-700 rounded-lg bg-white dark:bg-gray-800"><div class="p-3 border-b border-purple-200 dark:border-purple-800 bg-purple-50 dark:bg-purple-900/20 rounded-t-lg"><h4 class="text-sm font-semibold text-purple-700 dark:text-purple-300">Custom Tab</h4> <p class="text-xs text-purple-600 dark:text-purple-400 mt-1">Additional fields</p></div> <div role="region" aria-label="Custom fields drop zone"><!> <!></div></div> <div class="border border-orange-300 dark:border-orange-700 rounded-lg bg-white dark:bg-gray-800"><div class="p-3 border-b border-orange-200 dark:border-orange-800 bg-orange-50 dark:bg-orange-900/20 rounded-t-lg"><h4 class="text-sm font-semibold text-orange-700 dark:text-orange-300">Mappings Tab</h4> <p class="text-xs text-orange-600 dark:text-orange-400 mt-1">Pre-populate justification for a control mapping</p></div> <div role="region" aria-label="Justifications tab drop zone"><div class="space-y-2"><!></div></div></div></div></div> <!> <div class="flex justify-center"><button class="px-5 py-2.5 text-white bg-blue-600 hover:bg-blue-700 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm disabled:opacity-50 disabled:cursor-not-allowed"><!></button></div>`,1),Vt=h('<div class="space-y-6"><div role="button" tabindex="0" class="relative"><label><div class="flex flex-col items-center justify-center pt-5 pb-6"><!> <p class="mb-2 text-sm text-gray-500 dark:text-gray-400"><span class="font-semibold">Click to upload</span> or drag and drop</p> <p class="text-xs text-gray-500 dark:text-gray-400">XLSX, XLS or CSV files</p></div> <input type="file" class="hidden" accept=".xlsx,.xls,.csv"/></label></div> <!> <!> <!> <!></div>');function jt(pe,q){Ye(q,!1);const z=Lr();let X=k(null),O=k(""),L=k(""),N=k([]),f=k([]),S=k([]),K=k(0),re=k([]),P=k([]),p=k(new Map),U=k(1),V=k(""),fe=k(""),J=k(""),G=k(!1),Q=k(""),ue=k(""),we=k(!1),te=k(!1),$=k(null),B=k(null),ae=k(null);function ke(){o(f,[]),o(S,[]),o(K,0),e(p).clear(),o(p,new Map),o(P,[]),o(V,""),o(Q,""),o(ue,""),o($,null),o(B,null),o(ae,null)}function u(l){l.preventDefault(),o(te,!0)}function b(){o(te,!1)}function D(l){l.preventDefault(),o(te,!1);const n=l.dataTransfer?.files;n&&n.length>0&&I(n[0])}function T(l){const n=l.target;n.files&&n.files.length>0&&I(n.files[0])}async function I(l){ke(),o(O,l.name),o(X,l),o(Q,""),o(G,!0),o(fe,e(O).replace(/\.[^.]+$/,"").replace(/[-_]/g," ")),o(J,`Imported from ${e(O)}`);try{const n=new FormData;n.append("file",l);const y=await fetch("/api/parse-excel",{method:"POST",body:n});if(!y.ok){const w=await y.json();throw new Error(w.error||"Failed to parse file")}const _=await y.json();o(N,_.sheets||[]),o(L,_.selectedSheet||e(N)[0]),o(re,_.rowPreviews||[]),e(re).length>0&&e(U)===1&&o(U,e(re)[0].row),await Z(),o(we,!0)}catch(n){o(Q,"Error reading file: "+n.message)}finally{o(G,!1)}}async function Z(){if(!(!e(X)||!e(L))){o(G,!0),e(p).clear(),o(p,new Map),o(V,"");try{const l=new FormData;l.append("file",e(X)),l.append("sheetName",e(L)),l.append("headerRow",e(U).toString());const n=await fetch("/api/parse-excel-sheet",{method:"POST",body:l});if(!n.ok){const _=await n.json();throw new Error(_.error||"Failed to parse sheet")}const y=await n.json();if(o(f,y.fields||[]),o(S,y.sampleData||[]),o(K,y.controlCount||0),e(f).forEach((_,w)=>{const v=_.toLowerCase();let H="custom",R="text";v.includes("implementation")||v.includes("status")||v.includes("narrative")||v.includes("guidance")?H="implementation":(v.includes("id")||v.includes("title")||v.includes("family")||v.includes("cci")||v.includes("control")||v.includes("acronym"))&&(H="overview"),v.includes("description")||v.includes("narrative")||v.includes("guidance")||v.includes("statement")?R="textarea":v.includes("status")||v.includes("type")||v.includes("designation")?R="select":v.includes("date")?R="date":(v.includes("count")||v.includes("number"))&&(R="number"),e(p).set(_,{originalName:_,tab:H,displayOrder:w,fieldType:R,required:v.includes("id")||v.includes("title")})}),o(p,e(p)),e(V)&&!e(f).includes(e(V))&&o(V,""),!e(V)&&e(f).includes("AP Acronym")){const _=!e(S).length||e(S).every(ee=>!ee["AP Acronym"]||String(ee["AP Acronym"]).length<25),w=e(S).map(ee=>ee["AP Acronym"]).filter(ee=>ee!=null&&ee!==""&&String(ee).trim()!==""),v=new Set(w),H=!w.length||v.size===w.length,R=w.length>0;_&&H&&R&&o(V,"AP Acronym")}}catch(l){o(Q,"Error loading sheet data: "+l.message)}finally{o(G,!1)}}}function ve(l){if(!l)return l;let n=l.trim().replace(/\r?\n/g," ").replace(/\s+/g," ").trim();return je(n)}function je(l){return l.replace(/\W+/g," ").split(/ |\s/).map(n=>n.toLowerCase()).join("-")}function xe(l,n){o($,n),l.dataTransfer&&(l.dataTransfer.effectAllowed="move",l.dataTransfer.setData("text/plain",n))}function oe(){o($,null),o(B,null),o(ae,null)}function C(l,n){l.preventDefault(),o(B,n),l.dataTransfer&&(l.dataTransfer.dropEffect="move")}function ie(){o(B,null)}function ne(l,n,y){if(l.preventDefault(),e($)&&e(p).has(e($))){const _=e(p).get(e($));if(n==="mappings")e(P).includes(e($))||o(P,[...e(P),e($)]);else{if(_.tab=n,y!==void 0&&n!==null){const v=Array.from(e(p).entries()).filter(([H,R])=>R.tab===n).sort((H,R)=>H[1].displayOrder-R[1].displayOrder).filter(([H])=>H!==e($));v.splice(y,0,[e($),_]),v.forEach(([H,R],ee)=>{R.displayOrder=ee,e(p).set(H,R)})}else if(n!==null){const w=Math.max(0,...Array.from(e(p).values()).filter(v=>v.tab===n).map(v=>v.displayOrder));_.displayOrder=w+1}e(p).set(e($),_),o(p,e(p))}}o($,null),o(B,null)}function ze(l,n){l.preventDefault(),l.stopPropagation(),o(ae,n)}function Ce(){o(ae,null)}function Se(l,n,y){if(l.preventDefault(),l.stopPropagation(),e($)&&e($)!==n){const w=Array.from(e(p).entries()).filter(([v,H])=>H.tab===y).sort((v,H)=>v[1].displayOrder-H[1].displayOrder).findIndex(([v])=>v===n);w!==-1&&ne(l,y,w)}o(ae,null)}async function Le(){if(!(!e(X)||!e(O))){if(!e(V)){o(Q,"Please select a Control ID field before importing"),o(ue,"");return}if(!e(fe)||e(fe).trim()===""){o(Q,"Please enter a Control Set Name before importing"),o(ue,"");return}o(G,!0),o(Q,""),o(ue,"");try{const l=new FormData;l.append("file",e(X),e(O)),l.append("controlIdField",e(V)),l.append("startRow",e(U).toString()),l.append("namingConvention","kebab-case"),l.append("skipEmpty","true"),l.append("skipEmptyRows","true"),l.append("controlSetName",e(fe)||e(O).replace(/\.[^.]+$/,"")),l.append("controlSetDescription",e(J)||`Imported from ${e(O)}`);const n=Array.from(e(p).entries()).filter(([w,v])=>v.tab!==null).map(([w,v])=>({fieldName:ve(w),...v}));l.append("fieldSchema",JSON.stringify(n)),l.append("justificationFields",JSON.stringify(e(P).map(w=>ve(w))));const y=await fetch("/api/import-spreadsheet",{method:"POST",body:l});if(!y.ok){const w=await y.json();throw new Error(w.error||"Import failed")}const _=await y.json();o(ue,`Successfully imported ${_.controlCount} controls into ${_.families.length} families`),z("created",{path:_.outputDir})}catch(l){o(Q,"Error importing spreadsheet: "+l.message)}finally{o(G,!1)}}}Je();var Ne=Vt(),me=a(Ne),Be=a(me),Ae=a(Be),ar=a(Ae);gt(ar,{class:"w-8 h-8 mb-4 text-gray-500 dark:text-gray-400"}),_e(4),t(Ae);var Xe=i(Ae,2);t(Be),t(me);var Fe=i(me,2);{var or=l=>{var n=bt(),y=a(n),_=i(a(y),2),w=i(a(_)),v=i(w),H=i(a(v)),R=i(H,2),ee=i(R,2);t(v),t(_),t(y),t(n),F(()=>{E(w,` ${e(O)??""} `),E(H,` ${e(N).length??""} | `),E(R,` ${e(f).length??""} | `),E(ee,` ${e(K)??""}`)}),d(l,n)};M(Fe,l=>{e(O)&&l(or)})}var Ke=i(Fe,2);{var lr=l=>{var n=ft(),y=a(n),_=i(a(y),2),w=a(_,!0);t(_),t(y),t(n),F(()=>E(w,e(Q))),d(l,n)};M(Ke,l=>{e(Q)&&l(lr)})}var Ze=i(Ke,2);{var sr=l=>{var n=xt(),y=a(n),_=i(a(y),2),w=a(_,!0);t(_),t(y),t(n),F(()=>E(w,e(ue))),d(l,n)};M(Ze,l=>{e(ue)&&l(sr)})}var ir=i(Ze,2);{var nr=l=>{var n=Tt(),y=ye(n),_=i(a(y),2),w=a(_),v=i(a(w),2);Vr(v),_e(2),t(w);var H=i(w,2),R=i(a(H),2);Vr(R),_e(2),t(H),t(_);var ee=i(_,2),dr=a(ee),Ge=i(a(dr),2);F(()=>{e(L),mr(()=>{e(N)})}),ce(Ge,5,()=>e(N),r=>r,(r,s)=>{var x=mt(),m=a(x,!0);t(x);var c={};F(()=>{E(m,e(s)),c!==(c=e(s))&&(x.value=(x.__value=e(s))??"")}),d(r,x)}),t(Ge),_e(2),t(dr);var vr=i(dr,2),Qe=i(a(vr),2);F(()=>{e(U),mr(()=>{e(re)})}),ce(Qe,5,()=>e(re),r=>r.row,(r,s)=>{var x=ht(),m=a(x);t(x);var c={};F(()=>{E(m,`Row ${e(s).row??""}: ${e(s).preview??""}`),c!==(c=e(s).row)&&(x.value=(x.__value=e(s).row)??"")}),d(r,x)}),t(Qe),_e(2),t(vr);var Dr=i(vr,2),er=i(a(Dr),2);F(()=>{e(V),mr(()=>{e(f),e(S)})});var cr=a(er);cr.value=cr.__value="";var Br=i(cr);ce(Br,1,()=>e(f),r=>r,(r,s)=>{const x=De(()=>e(S).length>0&&e(S)[0][e(s)]?String(e(S)[0][e(s)]).slice(0,30):""),m=De(()=>!e(S).length||e(S).every(le=>!le[e(s)]||String(le[e(s)]).length<25)),c=De(()=>e(S).map(le=>le[e(s)]).filter(le=>le!=null&&le!==""&&String(le).trim()!=="")),Y=De(()=>new Set(e(c))),W=De(()=>!e(c).length||e(Y).size===e(c).length),j=De(()=>e(c).length>0);var A=Me(),be=ye(A);{var $e=le=>{var he=yt(),xr=a(he);t(he);var Tr={};F(()=>{E(xr,`${e(s)??""}${e(x)?` (e.g., ${e(x)})`:""}`),Tr!==(Tr=e(s))&&(he.value=(he.__value=e(s))??"")}),d(le,he)};M(be,le=>{e(m)&&e(W)&&e(j)&&le($e)})}d(r,A)}),t(er),_e(2),t(Dr),t(ee),t(y);var gr=i(y,2),Mr=i(a(gr),4),pr=a(Mr),Oe=i(a(pr),2),zr=a(Oe);ce(zr,1,()=>e(f).filter(r=>!e(p).get(r)||e(p).get(r)?.tab===null),r=>r,(r,s)=>{var x=wt(),m=i(a(x),2),c=a(m,!0);t(m);var Y=i(m,2);{var W=j=>{var A=_t();d(j,A)};M(Y,j=>{e(s)===e(V)&&j(W)})}t(x),F(()=>{qe(x,"aria-label",`Drag ${e(s)??""} field`),E(c,e(s))}),g("dragstart",x,j=>xe(j,e(s))),g("dragend",x,oe),d(r,x)});var Zr=i(zr,2);{var Rr=r=>{var s=kt();d(r,s)};M(Zr,r=>{e(f).filter(s=>!e(p).get(s)||e(p).get(s)?.tab===null).length===0&&r(Rr)})}t(Oe),t(pr);var ur=i(pr,2),Pe=i(a(ur),2),Ar=a(Pe);ce(Ar,3,()=>Array.from(e(p).entries()).filter(([r,s])=>s.tab==="overview").sort((r,s)=>r[1].displayOrder-s[1].displayOrder),([r,s])=>r,(r,s)=>{var x=hr(()=>yr(e(s),2));let m=()=>e(x)[0];var c=Ct(),Y=a(c);kr(Y,{class:"w-3 h-3 mr-2 flex-shrink-0"});var W=i(Y,2),j=a(W,!0);t(W),t(c),F(()=>{qe(c,"aria-label",`${m()??""} field in Overview tab`),se(c,1,`flex items-center px-3 py-2 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-300 rounded text-sm cursor-move hover:bg-blue-200 dark:hover:bg-blue-800/30 transition-colors
3
3
  ${e(ae)===m()&&e($)!==m()?"border-t-2 border-blue-500":""}`),E(j,m())}),g("dragstart",c,A=>xe(A,m())),g("dragend",c,oe),g("dragover",c,A=>ze(A,m())),g("dragleave",c,Ce),g("drop",c,A=>Se(A,m(),"overview")),d(r,c)});var qr=i(Ar,2);{var Ur=r=>{var s=St();d(r,s)};M(qr,r=>{Array.from(e(p).entries()).filter(([s,x])=>x.tab==="overview").length===0&&r(Ur)})}t(Pe),t(ur);var br=i(ur,2),He=i(a(br),2),Fr=a(He);ce(Fr,3,()=>Array.from(e(p).entries()).filter(([r,s])=>s.tab==="implementation").sort((r,s)=>r[1].displayOrder-s[1].displayOrder),([r,s])=>r,(r,s)=>{var x=hr(()=>yr(e(s),2));let m=()=>e(x)[0];var c=$t(),Y=a(c);kr(Y,{class:"w-3 h-3 mr-2 flex-shrink-0"});var W=i(Y,2),j=a(W,!0);t(W),t(c),F(()=>{qe(c,"aria-label",`${m()??""} field in Implementation tab`),se(c,1,`flex items-center px-3 py-2 bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300 rounded text-sm cursor-move hover:bg-green-200 dark:hover:bg-green-800/30 transition-colors
4
4
  ${e(ae)===m()&&e($)!==m()?"border-t-2 border-green-500":""}`),E(j,m())}),g("dragstart",c,A=>xe(A,m())),g("dragend",c,oe),g("dragover",c,A=>ze(A,m())),g("dragleave",c,Ce),g("drop",c,A=>Se(A,m(),"implementation")),d(r,c)});var Jr=i(Fr,2);{var Yr=r=>{var s=Dt();d(r,s)};M(Jr,r=>{Array.from(e(p).entries()).filter(([s,x])=>x.tab==="implementation").length===0&&r(Yr)})}t(He),t(br);var fr=i(br,2),Ee=i(a(fr),2),Or=a(Ee);ce(Or,3,()=>Array.from(e(p).entries()).filter(([r,s])=>s.tab==="custom").sort((r,s)=>r[1].displayOrder-s[1].displayOrder),([r,s])=>r,(r,s)=>{var x=hr(()=>yr(e(s),2));let m=()=>e(x)[0];var c=Mt(),Y=a(c);kr(Y,{class:"w-3 h-3 mr-2 flex-shrink-0"});var W=i(Y,2),j=a(W,!0);t(W),t(c),F(()=>{qe(c,"aria-label",`${m()??""} field in Custom tab`),se(c,1,`flex items-center px-3 py-2 bg-purple-100 dark:bg-purple-900/30 text-purple-800 dark:text-purple-300 rounded text-sm cursor-move hover:bg-purple-200 dark:hover:bg-purple-800/30 transition-colors
@@ -1 +1 @@
1
- {"version":"1758673933685"}
1
+ {"version":"1758846661430"}
@@ -1755,7 +1755,7 @@ var init_fileStore = __esm({
1755
1755
  if (!parsed.id) {
1756
1756
  try {
1757
1757
  parsed.id = getControlId(parsed, this.baseDir);
1758
- } catch (error) {
1758
+ } catch {
1759
1759
  parsed.id = controlId;
1760
1760
  }
1761
1761
  }
@@ -1782,7 +1782,7 @@ var init_fileStore = __esm({
1782
1782
  if (!parsed.id) {
1783
1783
  try {
1784
1784
  parsed.id = getControlId(parsed, this.baseDir);
1785
- } catch (error) {
1785
+ } catch {
1786
1786
  parsed.id = controlId;
1787
1787
  }
1788
1788
  }
@@ -2000,14 +2000,16 @@ var init_fileStore = __esm({
2000
2000
  /**
2001
2001
  * Delete a single mapping
2002
2002
  */
2003
- async deleteMapping(uuid) {
2003
+ async deleteMapping(compositeKey) {
2004
2004
  const mappingFiles = this.getAllMappingFiles();
2005
2005
  for (const file of mappingFiles) {
2006
2006
  try {
2007
2007
  const content = readFileSync2(file, "utf8");
2008
2008
  let mappings = yaml2.load(content) || [];
2009
2009
  const originalLength = mappings.length;
2010
- mappings = mappings.filter((m) => m.uuid !== uuid);
2010
+ mappings = mappings.filter((m) => {
2011
+ return `${m.control_id}:${m.uuid}` !== compositeKey;
2012
+ });
2011
2013
  if (mappings.length < originalLength) {
2012
2014
  if (mappings.length === 0) {
2013
2015
  unlinkSync(file);
@@ -2809,7 +2811,8 @@ async function loadAllData() {
2809
2811
  debug(`Loaded ${controls.length} controls from individual files`);
2810
2812
  const mappings = await state.fileStore.loadMappings();
2811
2813
  for (const mapping of mappings) {
2812
- state.mappingsCache.set(mapping.uuid, mapping);
2814
+ const compositeKey = `${mapping.control_id}:${mapping.uuid}`;
2815
+ state.mappingsCache.set(compositeKey, mapping);
2813
2816
  addMappingToIndexes(mapping);
2814
2817
  }
2815
2818
  debug(`Loaded ${mappings.length} mappings`);
@@ -4586,7 +4589,8 @@ var WebSocketManager = class {
4586
4589
  mapping.uuid = crypto2.randomUUID();
4587
4590
  }
4588
4591
  await state.fileStore.saveMapping(mapping);
4589
- state.mappingsCache.set(mapping.uuid, mapping);
4592
+ const compositeKey = `${mapping.control_id}:${mapping.uuid}`;
4593
+ state.mappingsCache.set(compositeKey, mapping);
4590
4594
  const family = mapping.control_id.split("-")[0];
4591
4595
  if (!state.mappingsByFamily.has(family)) {
4592
4596
  state.mappingsByFamily.set(family, /* @__PURE__ */ new Set());
@@ -4611,7 +4615,8 @@ var WebSocketManager = class {
4611
4615
  if (payload && payload.uuid) {
4612
4616
  const mapping = payload;
4613
4617
  await state.fileStore.saveMapping(mapping);
4614
- state.mappingsCache.set(mapping.uuid, mapping);
4618
+ const compositeKey = `${mapping.control_id}:${mapping.uuid}`;
4619
+ state.mappingsCache.set(compositeKey, mapping);
4615
4620
  ws.send(
4616
4621
  JSON.stringify({
4617
4622
  type: "mapping-updated",
@@ -1737,7 +1737,7 @@ var init_fileStore = __esm({
1737
1737
  if (!parsed.id) {
1738
1738
  try {
1739
1739
  parsed.id = getControlId(parsed, this.baseDir);
1740
- } catch (error) {
1740
+ } catch {
1741
1741
  parsed.id = controlId;
1742
1742
  }
1743
1743
  }
@@ -1764,7 +1764,7 @@ var init_fileStore = __esm({
1764
1764
  if (!parsed.id) {
1765
1765
  try {
1766
1766
  parsed.id = getControlId(parsed, this.baseDir);
1767
- } catch (error) {
1767
+ } catch {
1768
1768
  parsed.id = controlId;
1769
1769
  }
1770
1770
  }
@@ -1982,14 +1982,16 @@ var init_fileStore = __esm({
1982
1982
  /**
1983
1983
  * Delete a single mapping
1984
1984
  */
1985
- async deleteMapping(uuid) {
1985
+ async deleteMapping(compositeKey) {
1986
1986
  const mappingFiles = this.getAllMappingFiles();
1987
1987
  for (const file of mappingFiles) {
1988
1988
  try {
1989
1989
  const content = readFileSync2(file, "utf8");
1990
1990
  let mappings = yaml2.load(content) || [];
1991
1991
  const originalLength = mappings.length;
1992
- mappings = mappings.filter((m) => m.uuid !== uuid);
1992
+ mappings = mappings.filter((m) => {
1993
+ return `${m.control_id}:${m.uuid}` !== compositeKey;
1994
+ });
1993
1995
  if (mappings.length < originalLength) {
1994
1996
  if (mappings.length === 0) {
1995
1997
  unlinkSync(file);
@@ -2791,7 +2793,8 @@ async function loadAllData() {
2791
2793
  debug(`Loaded ${controls.length} controls from individual files`);
2792
2794
  const mappings = await state.fileStore.loadMappings();
2793
2795
  for (const mapping of mappings) {
2794
- state.mappingsCache.set(mapping.uuid, mapping);
2796
+ const compositeKey = `${mapping.control_id}:${mapping.uuid}`;
2797
+ state.mappingsCache.set(compositeKey, mapping);
2795
2798
  addMappingToIndexes(mapping);
2796
2799
  }
2797
2800
  debug(`Loaded ${mappings.length} mappings`);
@@ -4563,7 +4566,8 @@ var WebSocketManager = class {
4563
4566
  mapping.uuid = crypto2.randomUUID();
4564
4567
  }
4565
4568
  await state.fileStore.saveMapping(mapping);
4566
- state.mappingsCache.set(mapping.uuid, mapping);
4569
+ const compositeKey = `${mapping.control_id}:${mapping.uuid}`;
4570
+ state.mappingsCache.set(compositeKey, mapping);
4567
4571
  const family = mapping.control_id.split("-")[0];
4568
4572
  if (!state.mappingsByFamily.has(family)) {
4569
4573
  state.mappingsByFamily.set(family, /* @__PURE__ */ new Set());
@@ -4588,7 +4592,8 @@ var WebSocketManager = class {
4588
4592
  if (payload && payload.uuid) {
4589
4593
  const mapping = payload;
4590
4594
  await state.fileStore.saveMapping(mapping);
4591
- state.mappingsCache.set(mapping.uuid, mapping);
4595
+ const compositeKey = `${mapping.control_id}:${mapping.uuid}`;
4596
+ state.mappingsCache.set(compositeKey, mapping);
4592
4597
  ws.send(
4593
4598
  JSON.stringify({
4594
4599
  type: "mapping-updated",
@@ -1737,7 +1737,7 @@ var init_fileStore = __esm({
1737
1737
  if (!parsed.id) {
1738
1738
  try {
1739
1739
  parsed.id = getControlId(parsed, this.baseDir);
1740
- } catch (error) {
1740
+ } catch {
1741
1741
  parsed.id = controlId;
1742
1742
  }
1743
1743
  }
@@ -1764,7 +1764,7 @@ var init_fileStore = __esm({
1764
1764
  if (!parsed.id) {
1765
1765
  try {
1766
1766
  parsed.id = getControlId(parsed, this.baseDir);
1767
- } catch (error) {
1767
+ } catch {
1768
1768
  parsed.id = controlId;
1769
1769
  }
1770
1770
  }
@@ -1982,14 +1982,16 @@ var init_fileStore = __esm({
1982
1982
  /**
1983
1983
  * Delete a single mapping
1984
1984
  */
1985
- async deleteMapping(uuid) {
1985
+ async deleteMapping(compositeKey) {
1986
1986
  const mappingFiles = this.getAllMappingFiles();
1987
1987
  for (const file of mappingFiles) {
1988
1988
  try {
1989
1989
  const content = readFileSync2(file, "utf8");
1990
1990
  let mappings = yaml2.load(content) || [];
1991
1991
  const originalLength = mappings.length;
1992
- mappings = mappings.filter((m) => m.uuid !== uuid);
1992
+ mappings = mappings.filter((m) => {
1993
+ return `${m.control_id}:${m.uuid}` !== compositeKey;
1994
+ });
1993
1995
  if (mappings.length < originalLength) {
1994
1996
  if (mappings.length === 0) {
1995
1997
  unlinkSync(file);
@@ -2791,7 +2793,8 @@ async function loadAllData() {
2791
2793
  debug(`Loaded ${controls.length} controls from individual files`);
2792
2794
  const mappings = await state.fileStore.loadMappings();
2793
2795
  for (const mapping of mappings) {
2794
- state.mappingsCache.set(mapping.uuid, mapping);
2796
+ const compositeKey = `${mapping.control_id}:${mapping.uuid}`;
2797
+ state.mappingsCache.set(compositeKey, mapping);
2795
2798
  addMappingToIndexes(mapping);
2796
2799
  }
2797
2800
  debug(`Loaded ${mappings.length} mappings`);
@@ -4563,7 +4566,8 @@ var WebSocketManager = class {
4563
4566
  mapping.uuid = crypto2.randomUUID();
4564
4567
  }
4565
4568
  await state.fileStore.saveMapping(mapping);
4566
- state.mappingsCache.set(mapping.uuid, mapping);
4569
+ const compositeKey = `${mapping.control_id}:${mapping.uuid}`;
4570
+ state.mappingsCache.set(compositeKey, mapping);
4567
4571
  const family = mapping.control_id.split("-")[0];
4568
4572
  if (!state.mappingsByFamily.has(family)) {
4569
4573
  state.mappingsByFamily.set(family, /* @__PURE__ */ new Set());
@@ -4588,7 +4592,8 @@ var WebSocketManager = class {
4588
4592
  if (payload && payload.uuid) {
4589
4593
  const mapping = payload;
4590
4594
  await state.fileStore.saveMapping(mapping);
4591
- state.mappingsCache.set(mapping.uuid, mapping);
4595
+ const compositeKey = `${mapping.control_id}:${mapping.uuid}`;
4596
+ state.mappingsCache.set(compositeKey, mapping);
4592
4597
  ws.send(
4593
4598
  JSON.stringify({
4594
4599
  type: "mapping-updated",
@@ -158,7 +158,7 @@ var FileStore = class {
158
158
  if (!parsed.id) {
159
159
  try {
160
160
  parsed.id = getControlId(parsed, this.baseDir);
161
- } catch (error) {
161
+ } catch {
162
162
  parsed.id = controlId;
163
163
  }
164
164
  }
@@ -185,7 +185,7 @@ var FileStore = class {
185
185
  if (!parsed.id) {
186
186
  try {
187
187
  parsed.id = getControlId(parsed, this.baseDir);
188
- } catch (error) {
188
+ } catch {
189
189
  parsed.id = controlId;
190
190
  }
191
191
  }
@@ -403,14 +403,16 @@ var FileStore = class {
403
403
  /**
404
404
  * Delete a single mapping
405
405
  */
406
- async deleteMapping(uuid) {
406
+ async deleteMapping(compositeKey) {
407
407
  const mappingFiles = this.getAllMappingFiles();
408
408
  for (const file of mappingFiles) {
409
409
  try {
410
410
  const content = readFileSync2(file, "utf8");
411
411
  let mappings = yaml2.load(content) || [];
412
412
  const originalLength = mappings.length;
413
- mappings = mappings.filter((m) => m.uuid !== uuid);
413
+ mappings = mappings.filter((m) => {
414
+ return `${m.control_id}:${m.uuid}` !== compositeKey;
415
+ });
414
416
  if (mappings.length < originalLength) {
415
417
  if (mappings.length === 0) {
416
418
  unlinkSync(file);
@@ -1186,7 +1188,8 @@ async function loadAllData() {
1186
1188
  debug(`Loaded ${controls.length} controls from individual files`);
1187
1189
  const mappings = await state.fileStore.loadMappings();
1188
1190
  for (const mapping of mappings) {
1189
- state.mappingsCache.set(mapping.uuid, mapping);
1191
+ const compositeKey = `${mapping.control_id}:${mapping.uuid}`;
1192
+ state.mappingsCache.set(compositeKey, mapping);
1190
1193
  addMappingToIndexes(mapping);
1191
1194
  }
1192
1195
  debug(`Loaded ${mappings.length} mappings`);