Spaces:
Running
Running
import{s as be,e as v,a as P,b,d as L,f as D,g as h,h as g,i as N,j as m,l as ce,X as xe,c as vn,u as bn,m as yn,n as kn,q as Ne,w as Z,x as Q,ab as ue,z as ee,y as he,N as Je,p as x,t as lt,am as Be,an as Wt,ae as Xe,ac as Le,a7 as wn,ao as Ct,r as me,af as Cn,aa as rl,I as $n,J as En,O as ps,Y as Zt}from"../chunks/scheduler.C39PMv9a.js";import{S as ye,i as ke,b as Y,d as X,m as G,t as F,g as ge,a as B,c as _e,e as J,f as De,k as We,j as vt}from"../chunks/index.Te5Nl1-a.js";import{I as je,e as pe,a7 as Ze,a8 as Tn,a9 as it,aa as Sn,ab as In,ac as Oe,ad as Qt,ae as es,af as ts,ag as ol,ah as rt,ai as al,aj as cl,ak as St,al as Pt,am as gs,an as fl,ao as _s,ap as vs,aq as Ot,ar as ul,as as dl,at as ss,au as hl,av as ze,aw as yt,ax as It,ay as kt,az as bs,aA as ml,aB as pl,aC as gl,aD as ns,aE as Dt,aF as _l,aG as vl,aH as Nn,aI as st,aJ as An,aK as bl,aL as Lt,aM as yl,aN as kl,aO as wl,aP as Cl,aQ as $l,aR as El,aS as Tl,aT as Sl,z as Il,aU as Nl,u as Al,aV as Ol,s as Ll,B as $t}from"../chunks/VennDiagram.svelte_svelte_type_style_lang.-64_fZ65.js";import{p as Pl,i as Dl,a as jl}from"../chunks/entry.galzRTFy.js";import{f as ys,s as He,d as bt}from"../chunks/index.Cx6KSiTC.js";import{B as ot}from"../chunks/Button.CSceGTOW.js";import{I as Ml,k as On,l as Fl,m as Vl,D as Bl,n as Hl,F as ql,C as Rl,o as ls,p as Ln,H as Pn}from"../chunks/index.ta-mt3DI.js";import{s as Gt}from"../chunks/index.CGB6X0u6.js";import{C as Dn,b as at,d as ct}from"../chunks/CopyIcon.DryQyYGB.js";import{A as Ul,a as xl}from"../chunks/AccordionItem.DiMBMEbt.js";import{C as Kl,P as Ut}from"../chunks/Prismjs.DNQj8cib.js";function ks(l){let e,t,s;const n=l[5].default,r=vn(n,l,l[4],null);return{c(){e=v("span"),r&&r.c(),this.h()},l(i){e=b(i,"SPAN",{class:!0});var o=L(e);r&&r.l(o),o.forEach(h),this.h()},h(){g(e,"class","info-msg svelte-bozgwf")},m(i,o){N(i,e,o),r&&r.m(e,null),s=!0},p(i,o){r&&r.p&&(!s||o&16)&&bn(r,n,i,i[4],s?kn(n,i[4],o,null):yn(i[4]),null)},i(i){s||(F(r,i),i&&Ne(()=>{s&&(t||(t=De(e,ys,{},!0)),t.run(1))}),s=!0)},o(i){B(r,i),i&&(t||(t=De(e,ys,{},!1)),t.run(0)),s=!1},d(i){i&&h(e),r&&r.d(i),i&&t&&t.end()}}}function zl(l){let e,t,s,n,r,i;t=new je({props:{src:l[0],class:"w-5 h-5"}});let o=l[1]&&ks(l);return{c(){e=v("span"),Y(t.$$.fragment),s=P(),o&&o.c(),this.h()},l(a){e=b(a,"SPAN",{class:!0,role:!0});var c=L(e);X(t.$$.fragment,c),s=D(c),o&&o.l(c),c.forEach(h),this.h()},h(){g(e,"class","additional-info-icon svelte-bozgwf"),g(e,"role","tooltip")},m(a,c){N(a,e,c),G(t,e,null),m(e,s),o&&o.m(e,null),n=!0,r||(i=[ce(e,"focus",l[2]),ce(e,"blur",l[3]),ce(e,"mouseenter",l[2]),ce(e,"mouseleave",l[3])],r=!0)},p(a,[c]){const f={};c&1&&(f.src=a[0]),t.$set(f),a[1]?o?(o.p(a,c),c&2&&F(o,1)):(o=ks(a),o.c(),F(o,1),o.m(e,null)):o&&(ge(),B(o,1,1,()=>{o=null}),_e())},i(a){n||(F(t.$$.fragment,a),F(o),n=!0)},o(a){B(t.$$.fragment,a),B(o),n=!1},d(a){a&&h(e),J(t),o&&o.d(),r=!1,xe(i)}}}function Yl(l,e,t){let{$$slots:s={},$$scope:n}=e,{icon:r=Ml}=e,i=!1;const o=()=>t(1,i=!0),a=()=>t(1,i=!1);return l.$$set=c=>{"icon"in c&&t(0,r=c.icon),"$$scope"in c&&t(4,n=c.$$scope)},[r,i,o,a,n,s]}class jn extends ye{constructor(e){super(),ke(this,e,Yl,zl,be,{icon:0})}}function ws(l){let e,t;return{c(){e=v("span"),t=Z(l[1]),this.h()},l(s){e=b(s,"SPAN",{class:!0});var n=L(e);t=Q(n,l[1]),n.forEach(h),this.h()},h(){g(e,"class","text-red-500 font-bold text-sm")},m(s,n){N(s,e,n),m(e,t)},p(s,n){n&2&&he(t,s[1])},d(s){s&&h(e)}}}function Gl(l){let e,t,s,n,r,i,o,a=l[1]&&ws(l);return{c(){e=v("label"),t=Z(`Source name | |
`),s=v("input"),n=P(),r=v("div"),a&&a.c(),this.h()},l(c){e=b(c,"LABEL",{for:!0,class:!0});var f=L(e);t=Q(f,`Source name | |
`),s=b(f,"INPUT",{name:!0,class:!0}),f.forEach(h),n=D(c),r=b(c,"DIV",{class:!0});var u=L(r);a&&a.l(u),u.forEach(h),this.h()},h(){s.required=!0,g(s,"name","sourceName"),g(s,"class","rounded border border-gray-300 p-1 ml-auto w-2/3 text-gray-950 align-middle text-sm"),g(e,"for","sourceName"),g(e,"class","flex justify-between w-full"),g(r,"class","flex justify-end w-full")},m(c,f){N(c,e,f),m(e,t),m(e,s),ue(s,l[0]),N(c,n,f),N(c,r,f),a&&a.m(r,null),i||(o=[ce(s,"input",l[2]),ce(s,"change",l[3])],i=!0)},p(c,[f]){f&1&&s.value!==c[0]&&ue(s,c[0]),c[1]?a?a.p(c,f):(a=ws(c),a.c(),a.m(r,null)):a&&(a.d(1),a=null)},i:ee,o:ee,d(c){c&&(h(e),h(n),h(r)),a&&a.d(),i=!1,xe(o)}}}const Jl=/^[\w_]+$/,Mn=(l,e)=>l.length<1?"Source name must be set.":Jl.test(l)?l&&e.some(t=>t.name===l)?`A source named ${l} already exists.`:"":"Source names can only contain letters, numbers, and underscores.";function Xl(l,e,t){let{sourceName:s}=e,{nameError:n}=e;function r(){s=this.value,t(0,s)}const i=()=>t(1,n="");return l.$$set=o=>{"sourceName"in o&&t(0,s=o.sourceName),"nameError"in o&&t(1,n=o.nameError)},[s,n,r,i]}class Fn extends ye{constructor(e){super(),ke(this,e,Xl,Gl,be,{sourceName:0,nameError:1})}}function Cs(l,e,t){const s=l.slice();s[11]=e[t][0],s[12]=e[t][1];const n=s[12].package.package.evidence.datasources;return s[13]=n,s}function $s(l,e,t){const s=l.slice();return s[16]=e[t],s}function Wl(l){let e,t=l[16]+"",s,n;return{c(){e=v("option"),s=Z(t),this.h()},l(r){e=b(r,"OPTION",{});var i=L(e);s=Q(i,t),i.forEach(h),this.h()},h(){e.__value=n=l[16],ue(e,e.__value)},m(r,i){N(r,e,i),m(e,s)},p(r,i){i&1&&t!==(t=r[16]+"")&&he(s,t),i&1&&n!==(n=r[16])&&(e.__value=n,ue(e,e.__value))},d(r){r&&h(e)}}}function Zl(l){let e;function t(r,i){return r[16].length?ei:Ql}let s=t(l),n=s(l);return{c(){n.c(),e=me()},l(r){n.l(r),e=me()},m(r,i){n.m(r,i),N(r,e,i)},p(r,i){s===(s=t(r))&&n?n.p(r,i):(n.d(1),n=s(r),n&&(n.c(),n.m(e.parentNode,e)))},d(r){r&&h(e),n.d(r)}}}function Ql(l){return{c:ee,l:ee,m:ee,p:ee,d:ee}}function ei(l){let e,t=l[16][0]+"",s,n;return{c(){e=v("option"),s=Z(t),this.h()},l(r){e=b(r,"OPTION",{});var i=L(e);s=Q(i,t),i.forEach(h),this.h()},h(){e.__value=n=l[16][0],ue(e,e.__value)},m(r,i){N(r,e,i),m(e,s)},p(r,i){i&1&&t!==(t=r[16][0]+"")&&he(s,t),i&1&&n!==(n=r[16][0])&&(e.__value=n,ue(e,e.__value))},d(r){r&&h(e)}}}function Es(l){let e,t;function s(i,o){return o&1&&(e=null),e==null&&(e=!!Array.isArray(i[16])),e?Zl:Wl}let n=s(l,-1),r=n(l);return{c(){r.c(),t=me()},l(i){r.l(i),t=me()},m(i,o){r.m(i,o),N(i,t,o)},p(i,o){n===(n=s(i,o))&&r?r.p(i,o):(r.d(1),r=n(i),r&&(r.c(),r.m(t.parentNode,t)))},d(i){i&&h(t),r.d(i)}}}function Ts(l){let e,t,s=pe(l[13]),n=[];for(let r=0;r<s.length;r+=1)n[r]=Es($s(l,s,r));return{c(){e=v("optgroup");for(let r=0;r<n.length;r+=1)n[r].c();this.h()},l(r){e=b(r,"OPTGROUP",{label:!0});var i=L(e);for(let o=0;o<n.length;o+=1)n[o].l(i);i.forEach(h),this.h()},h(){g(e,"label",t=l[11])},m(r,i){N(r,e,i);for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(e,null)},p(r,i){if(i&1){s=pe(r[13]);let o;for(o=0;o<s.length;o+=1){const a=$s(r,s,o);n[o]?n[o].p(a,i):(n[o]=Es(a),n[o].c(),n[o].m(e,null))}for(;o<n.length;o+=1)n[o].d(1);n.length=s.length}i&1&&t!==(t=r[11])&&g(e,"label",t)},d(r){r&&h(e),Le(n,r)}}}function ti(l){let e;return{c(){e=Z("Confirm")},l(t){e=Q(t,"Confirm")},m(t,s){N(t,e,s)},d(t){t&&h(e)}}}function si(l){let e,t,s,n="Add new source",r,i,o,a,c,f,u,d,p,y,k,_,w,C,S,A,j=pe(Object.entries(l[0])),T=[];for(let O=0;O<j.length;O+=1)T[O]=Ts(Cs(l,j,O));function q(O){l[8](O)}function $(O){l[9](O)}let M={};return l[3]!==void 0&&(M.sourceName=l[3]),l[4]!==void 0&&(M.nameError=l[4]),u=new Fn({props:M}),Je.push(()=>We(u,"sourceName",q)),Je.push(()=>We(u,"nameError",$)),_=new ot({props:{size:"md",icon:On,variant:"success",type:"submit",$$slots:{default:[ti]},$$scope:{ctx:l}}}),{c(){e=v("div"),t=v("form"),s=v("h3"),s.textContent=n,r=P(),i=v("label"),o=Z(`Datasource Type | |
`),a=v("select");for(let O=0;O<T.length;O+=1)T[O].c();c=P(),f=v("div"),Y(u.$$.fragment),y=P(),k=v("div"),Y(_.$$.fragment),this.h()},l(O){e=b(O,"DIV",{class:!0});var E=L(e);t=b(E,"FORM",{class:!0});var V=L(t);s=b(V,"H3",{class:!0,"data-svelte-h":!0}),x(s)!=="svelte-1dhduhd"&&(s.textContent=n),r=D(V),i=b(V,"LABEL",{for:!0,class:!0});var H=L(i);o=Q(H,`Datasource Type | |
`),a=b(H,"SELECT",{name:!0,class:!0});var I=L(a);for(let W=0;W<T.length;W+=1)T[W].l(I);I.forEach(h),H.forEach(h),c=D(V),f=b(V,"DIV",{});var R=L(f);X(u.$$.fragment,R),R.forEach(h),y=D(V),k=b(V,"DIV",{class:!0});var U=L(k);X(_.$$.fragment,U),U.forEach(h),V.forEach(h),E.forEach(h),this.h()},h(){g(s,"class","text-sm uppercase gray-600 font-bold text-left"),a.required=!0,g(a,"name","sourceType"),g(a,"class","rounded border border-gray-300 p-1 ml-auto w-2/3 text-gray-950 align-middle text-sm"),l[2]===void 0&&Ne(()=>l[7].call(a)),g(i,"for","sourceType"),g(i,"class","flex justify-between w-full"),g(k,"class","ml-auto"),g(t,"class","flex flex-col w-full gap-4"),g(e,"class","col-span-4 w-full flex justify-end items-end flex-col py-4 px-4 rounded"),lt(e,"bg-gray-100",!l[1])},m(O,E){N(O,e,E),m(e,t),m(t,s),m(t,r),m(t,i),m(i,o),m(i,a);for(let V=0;V<T.length;V+=1)T[V]&&T[V].m(a,null);Be(a,l[2],!0),m(t,c),m(t,f),G(u,f,null),m(t,y),m(t,k),G(_,k,null),C=!0,S||(A=[ce(a,"change",l[7]),ce(t,"submit",Wt(l[5]))],S=!0)},p(O,[E]){if(E&1){j=pe(Object.entries(O[0]));let I;for(I=0;I<j.length;I+=1){const R=Cs(O,j,I);T[I]?T[I].p(R,E):(T[I]=Ts(R),T[I].c(),T[I].m(a,null))}for(;I<T.length;I+=1)T[I].d(1);T.length=j.length}E&5&&Be(a,O[2]);const V={};!d&&E&8&&(d=!0,V.sourceName=O[3],Xe(()=>d=!1)),!p&&E&16&&(p=!0,V.nameError=O[4],Xe(()=>p=!1)),u.$set(V);const H={};E&524288&&(H.$$scope={dirty:E,ctx:O}),_.$set(H),(!C||E&2)&<(e,"bg-gray-100",!O[1])},i(O){C||(F(u.$$.fragment,O),F(_.$$.fragment,O),O&&Ne(()=>{C&&(w||(w=De(e,He,{},!0)),w.run(1))}),C=!0)},o(O){B(u.$$.fragment,O),B(_.$$.fragment,O),O&&(w||(w=De(e,He,{},!1)),w.run(0)),C=!1},d(O){O&&h(e),Le(T,O),J(u),J(_),O&&w&&w.end(),S=!1,xe(A)}}}function ni(l,e,t){let{availablePackages:s}=e,{ghost:n=!1}=e,{existingSources:r=[]}=e,i="",o="";const a=wn();let c="";function f(){t(4,c=Mn(o,r)),!c&&(a("newSource",{newSourceType:i,newSourceName:o}),t(3,o=""))}function u(){i=Ct(this),t(2,i),t(0,s)}function d(y){o=y,t(3,o)}function p(y){c=y,t(4,c)}return l.$$set=y=>{"availablePackages"in y&&t(0,s=y.availablePackages),"ghost"in y&&t(1,n=y.ghost),"existingSources"in y&&t(6,r=y.existingSources)},[s,n,i,o,c,f,r,u,d,p]}class Vn extends ye{constructor(e){super(),ke(this,e,ni,si,be,{availablePackages:0,ghost:1,existingSources:6})}}var li={default:{a:{viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"#2c3e50",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},path:[{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2"},{d:"M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z"},{d:"M9 17v-4"},{d:"M12 17v-1"},{d:"M15 17v-2"},{d:"M12 17v-1"}]}},ii={default:{a:{viewBox:"0 0 200 200",style:"enable-background:new 0 0 791.9 221.6;"},path:[{fill:"currentColor",d:"M 13.53 126.114 C 13.53 126.114 64.492 162.546 67.591 164.363 C 70.582 166.179 74.963 166.606 78.808 165.111 C 82.655 163.615 85.54 160.196 86.395 156.777 C 87.356 153.358 99.002 91.819 99.002 91.819 C 99.108 90.964 99.428 88.507 98.147 86.156 C 96.331 82.951 92.271 81.242 88.638 82.31 C 85.754 83.165 84.258 85.302 83.83 86.049 C 83.19 87.224 82.014 89.148 79.877 90.857 C 78.275 92.139 76.672 92.887 75.924 93.208 C 69.407 95.879 62.142 93.635 57.975 88.293 C 55.411 84.981 50.817 83.699 46.757 85.302 C 42.697 86.904 40.347 91.071 40.667 95.238 C 41.415 101.862 37.676 108.486 31.052 111.156 C 27.526 112.546 23.787 112.546 20.475 111.477 C 19.727 111.263 17.056 110.623 14.385 112.118 C 11.073 113.828 9.363 117.887 10.218 121.52 C 10.859 123.978 12.783 125.58 13.53 126.114 Z",style:"transform-origin: 122.948px 117.753px;"},{fill:"currentColor",d:"M 98.467 46.305 C 98.467 46.305 116.63 106.349 117.912 109.554 C 119.194 112.866 122.399 115.858 126.352 117.032 C 130.306 118.101 134.686 117.247 137.463 115.11 C 140.242 112.973 187.143 71.412 187.143 71.412 C 187.785 70.879 189.494 69.062 189.922 66.391 C 190.455 62.759 188.212 58.912 184.793 57.523 C 182.015 56.455 179.451 57.203 178.703 57.523 C 177.528 58.057 175.391 58.805 172.72 58.912 C 170.583 59.019 168.981 58.592 168.126 58.378 C 161.395 56.455 156.908 50.259 156.908 43.528 C 156.802 39.361 154.023 35.515 149.857 34.339 C 145.583 33.164 141.203 34.98 138.959 38.506 C 135.434 44.275 128.489 47.16 121.651 45.237 C 118.019 44.168 115.027 41.925 113.104 39.04 C 112.57 38.399 110.86 36.263 107.869 35.728 C 104.236 35.087 100.283 37.224 98.788 40.536 C 97.612 43.1 98.254 45.451 98.467 46.305 Z",style:"transform-origin: 122.948px 117.753px;"}]}},ri={default:{a:{role:"img",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"#2c3e50",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},title:[{}],path:[{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"},{d:"M13.5 6.5l4 4"}]}};const Jt=Object.freeze(Object.defineProperty({__proto__:null,Clipboard:li,Motherduck:ii,Pencil:ri},Symbol.toStringTag,{value:"Module"}));function oi(l){const e=JSON.parse(l);return e.data&&(e.data=Pl(e.data)),e}function Ss(l){return HTMLElement.prototype.cloneNode.call(l)}function ai(l,e=()=>{}){const t=async({action:n,result:r,reset:i=!0,invalidateAll:o=!0})=>{r.type==="success"&&(i&&HTMLFormElement.prototype.reset.call(l),o&&await Dl()),(location.origin+location.pathname===n.origin+n.pathname||r.type==="redirect"||r.type==="error")&&jl(r)};async function s(n){var y,k,_,w;if(((y=n.submitter)!=null&&y.hasAttribute("formmethod")?n.submitter.formMethod:Ss(l).method)!=="post")return;n.preventDefault();const i=new URL((k=n.submitter)!=null&&k.hasAttribute("formaction")?n.submitter.formAction:Ss(l).action),o=new FormData(l),a=(_=n.submitter)==null?void 0:_.getAttribute("name");a&&o.append(a,((w=n.submitter)==null?void 0:w.getAttribute("value"))??"");const c=new AbortController;let f=!1;const d=await e({action:i,cancel:()=>f=!0,controller:c,formData:o,formElement:l,submitter:n.submitter})??t;if(f)return;let p;try{const C=await fetch(i,{method:"POST",headers:{accept:"application/json","x-sveltekit-action":"true"},cache:"no-store",body:o,signal:c.signal});p=oi(await C.text()),p.type==="error"&&(p.status=C.status)}catch(C){if((C==null?void 0:C.name)==="AbortError")return;p={type:"error",error:C}}d({action:i,formData:o,formElement:l,update:C=>t({action:i,result:p,reset:C==null?void 0:C.reset,invalidateAll:C==null?void 0:C.invalidateAll}),result:p})}return HTMLFormElement.prototype.addEventListener.call(l,"submit",s),{destroy(){HTMLFormElement.prototype.removeEventListener.call(l,"submit",s)}}}const ut={collection:"map",default:!0,nodeClass:Ze,tag:"tag:yaml.org,2002:map",resolve(l,e){return Tn(l)||e("Expected a mapping for this tag"),l},createNode:(l,e,t)=>Ze.from(l,e,t)},dt={collection:"seq",default:!0,nodeClass:it,tag:"tag:yaml.org,2002:seq",resolve(l,e){return Sn(l)||e("Expected a sequence for this tag"),l},createNode:(l,e,t)=>it.from(l,e,t)},jt={identify:l=>typeof l=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:l=>l,stringify(l,e,t,s){return e=Object.assign({actualString:!0},e),In(l,e,t,s)}},Mt={identify:l=>l==null,createNode:()=>new Oe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Oe(null),stringify:({source:l},e)=>typeof l=="string"&&Mt.test.test(l)?l:e.options.nullStr},is={identify:l=>typeof l=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:l=>new Oe(l[0]==="t"||l[0]==="T"),stringify({source:l,value:e},t){if(l&&is.test.test(l)){const s=l[0]==="t"||l[0]==="T";if(e===s)return l}return e?t.options.trueStr:t.options.falseStr}};function Ve({format:l,minFractionDigits:e,tag:t,value:s}){if(typeof s=="bigint")return String(s);const n=typeof s=="number"?s:Number(s);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let r=JSON.stringify(s);if(!l&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let i=r.indexOf(".");i<0&&(i=r.length,r+=".");let o=e-(r.length-i-1);for(;o-- >0;)r+="0"}return r}const Bn={identify:l=>typeof l=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:l=>l.slice(-3).toLowerCase()==="nan"?NaN:l[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ve},Hn={identify:l=>typeof l=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:l=>parseFloat(l),stringify(l){const e=Number(l.value);return isFinite(e)?e.toExponential():Ve(l)}},qn={identify:l=>typeof l=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(l){const e=new Oe(parseFloat(l)),t=l.indexOf(".");return t!==-1&&l[l.length-1]==="0"&&(e.minFractionDigits=l.length-t-1),e},stringify:Ve},Ft=l=>typeof l=="bigint"||Number.isInteger(l),rs=(l,e,t,{intAsBigInt:s})=>s?BigInt(l):parseInt(l.substring(e),t);function Rn(l,e,t){const{value:s}=l;return Ft(s)&&s>=0?t+s.toString(e):Ve(l)}const Un={identify:l=>Ft(l)&&l>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(l,e,t)=>rs(l,2,8,t),stringify:l=>Rn(l,8,"0o")},xn={identify:Ft,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(l,e,t)=>rs(l,0,10,t),stringify:Ve},Kn={identify:l=>Ft(l)&&l>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(l,e,t)=>rs(l,2,16,t),stringify:l=>Rn(l,16,"0x")},ci=[ut,dt,jt,Mt,is,Un,xn,Kn,Bn,Hn,qn];function Is(l){return typeof l=="bigint"||Number.isInteger(l)}const Nt=({value:l})=>JSON.stringify(l),fi=[{identify:l=>typeof l=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:l=>l,stringify:Nt},{identify:l=>l==null,createNode:()=>new Oe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Nt},{identify:l=>typeof l=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:l=>l==="true",stringify:Nt},{identify:Is,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(l,e,{intAsBigInt:t})=>t?BigInt(l):parseInt(l,10),stringify:({value:l})=>Is(l)?l.toString():JSON.stringify(l)},{identify:l=>typeof l=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:l=>parseFloat(l),stringify:Nt}],ui={default:!0,tag:"",test:/^/,resolve(l,e){return e(`Unresolved plain scalar ${JSON.stringify(l)}`),l}},di=[ut,dt].concat(fi,ui),os={identify:l=>l instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(l,e){if(typeof Buffer=="function")return Buffer.from(l,"base64");if(typeof atob=="function"){const t=atob(l.replace(/[\n\r]/g,"")),s=new Uint8Array(t.length);for(let n=0;n<t.length;++n)s[n]=t.charCodeAt(n);return s}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),l},stringify({comment:l,type:e,value:t},s,n,r){const i=t;let o;if(typeof Buffer=="function")o=i instanceof Buffer?i.toString("base64"):Buffer.from(i.buffer).toString("base64");else if(typeof btoa=="function"){let a="";for(let c=0;c<i.length;++c)a+=String.fromCharCode(i[c]);o=btoa(a)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e||(e=Oe.BLOCK_LITERAL),e!==Oe.QUOTE_DOUBLE){const a=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),c=Math.ceil(o.length/a),f=new Array(c);for(let u=0,d=0;u<c;++u,d+=a)f[u]=o.substr(d,a);o=f.join(e===Oe.BLOCK_LITERAL?` | |
`:" ")}return In({comment:l,type:e,value:o},s,n,r)}};function zn({value:l,source:e},t){return e&&(l?Yn:Gn).test.test(e)?e:l?t.options.trueStr:t.options.falseStr}const Yn={identify:l=>l===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Oe(!0),stringify:zn},Gn={identify:l=>l===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Oe(!1),stringify:zn},hi={identify:l=>typeof l=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:l=>l.slice(-3).toLowerCase()==="nan"?NaN:l[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ve},mi={identify:l=>typeof l=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:l=>parseFloat(l.replace(/_/g,"")),stringify(l){const e=Number(l.value);return isFinite(e)?e.toExponential():Ve(l)}},pi={identify:l=>typeof l=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(l){const e=new Oe(parseFloat(l.replace(/_/g,""))),t=l.indexOf(".");if(t!==-1){const s=l.substring(t+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:Ve},Et=l=>typeof l=="bigint"||Number.isInteger(l);function Vt(l,e,t,{intAsBigInt:s}){const n=l[0];if((n==="-"||n==="+")&&(e+=1),l=l.substring(e).replace(/_/g,""),s){switch(t){case 2:l=`0b${l}`;break;case 8:l=`0o${l}`;break;case 16:l=`0x${l}`;break}const i=BigInt(l);return n==="-"?BigInt(-1)*i:i}const r=parseInt(l,t);return n==="-"?-1*r:r}function as(l,e,t){const{value:s}=l;if(Et(s)){const n=s.toString(e);return s<0?"-"+t+n.substr(1):t+n}return Ve(l)}const gi={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(l,e,t)=>Vt(l,2,2,t),stringify:l=>as(l,2,"0b")},_i={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(l,e,t)=>Vt(l,1,8,t),stringify:l=>as(l,8,"0")},vi={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(l,e,t)=>Vt(l,0,10,t),stringify:Ve},bi={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(l,e,t)=>Vt(l,2,16,t),stringify:l=>as(l,16,"0x")};function cs(l,e){const t=l[0],s=t==="-"||t==="+"?l.substring(1):l,n=i=>e?BigInt(i):Number(i),r=s.replace(/_/g,"").split(":").reduce((i,o)=>i*n(60)+n(o),n(0));return t==="-"?n(-1)*r:r}function Jn(l){let{value:e}=l,t=i=>i;if(typeof e=="bigint")t=i=>BigInt(i);else if(isNaN(e)||!isFinite(e))return Ve(l);let s="";e<0&&(s="-",e*=t(-1));const n=t(60),r=[e%n];return e<60?r.unshift(0):(e=(e-r[0])/n,r.unshift(e%n),e>=60&&(e=(e-r[0])/n,r.unshift(e))),s+r.map(i=>String(i).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Xn={identify:l=>typeof l=="bigint"||Number.isInteger(l),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(l,e,{intAsBigInt:t})=>cs(l,t),stringify:Jn},Wn={identify:l=>typeof l=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:l=>cs(l,!1),stringify:Jn},Bt={identify:l=>l instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(l){const e=l.match(Bt.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,s,n,r,i,o]=e.map(Number),a=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(t,s-1,n,r||0,i||0,o||0,a);const f=e[8];if(f&&f!=="Z"){let u=cs(f,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:l})=>l.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},Ns=[ut,dt,jt,Mt,Yn,Gn,gi,_i,vi,bi,hi,mi,pi,os,Qt,es,ts,Xn,Wn,Bt],As=new Map([["core",ci],["failsafe",[ut,dt,jt]],["json",di],["yaml11",Ns],["yaml-1.1",Ns]]),Os={binary:os,bool:is,float:qn,floatExp:Hn,floatNaN:Bn,floatTime:Wn,int:xn,intHex:Kn,intOct:Un,intTime:Xn,map:ut,null:Mt,omap:Qt,pairs:es,seq:dt,set:ts,timestamp:Bt},yi={"tag:yaml.org,2002:binary":os,"tag:yaml.org,2002:omap":Qt,"tag:yaml.org,2002:pairs":es,"tag:yaml.org,2002:set":ts,"tag:yaml.org,2002:timestamp":Bt};function xt(l,e){let t=As.get(e);if(!t)if(Array.isArray(l))t=[];else{const s=Array.from(As.keys()).filter(n=>n!=="yaml11").map(n=>JSON.stringify(n)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(l))for(const s of l)t=t.concat(s);else typeof l=="function"&&(t=l(t.slice()));return t.map(s=>{if(typeof s!="string")return s;const n=Os[s];if(n)return n;const r=Object.keys(Os).map(i=>JSON.stringify(i)).join(", ");throw new Error(`Unknown custom tag "${s}"; use one of ${r}`)})}const ki=(l,e)=>l.key<e.key?-1:l.key>e.key?1:0;class Ht{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:n,schema:r,sortMapEntries:i,toStringDefaults:o}){this.compat=Array.isArray(e)?xt(e,"compat"):e?xt(null,e):null,this.merge=!!s,this.name=typeof r=="string"&&r||"core",this.knownTags=n?yi:{},this.tags=xt(t,this.name),this.toStringOptions=o??null,Object.defineProperty(this,ol,{value:ut}),Object.defineProperty(this,rt,{value:jt}),Object.defineProperty(this,al,{value:dt}),this.sortMapEntries=typeof i=="function"?i:i===!0?ki:null}clone(){const e=Object.create(Ht.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function wi(l,e){var a;const t=[];let s=e.directives===!0;if(e.directives!==!1&&l.directives){const c=l.directives.toString(l);c?(t.push(c),s=!0):l.directives.docStart&&(s=!0)}s&&t.push("---");const n=cl(l,e),{commentString:r}=n.options;if(l.commentBefore){t.length!==1&&t.unshift("");const c=r(l.commentBefore);t.unshift(St(c,""))}let i=!1,o=null;if(l.contents){if(Pt(l.contents)){if(l.contents.spaceBefore&&s&&t.push(""),l.contents.commentBefore){const u=r(l.contents.commentBefore);t.push(St(u,""))}n.forceBlockIndent=!!l.comment,o=l.contents.comment}const c=o?void 0:()=>i=!0;let f=gs(l.contents,n,()=>o=null,c);o&&(f+=fl(f,"",r(o))),(f[0]==="|"||f[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${f}`:t.push(f)}else t.push(gs(l.contents,n));if((a=l.directives)!=null&&a.docEnd)if(l.comment){const c=r(l.comment);c.includes(` | |
`)?(t.push("..."),t.push(St(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=l.comment;c&&i&&(c=c.replace(/^\n+/,"")),c&&((!i||o)&&t[t.length-1]!==""&&t.push(""),t.push(St(r(c),"")))}return t.join(` | |
`)+` | |
`}class ht{constructor(e,t,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,_s,{value:vs});let n=null;typeof t=="function"||Array.isArray(t)?n=t:s===void 0&&t&&(s=t,t=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:i}=r;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(i=this.directives.yaml.version)):this.directives=new Ot({version:i}),this.setSchema(i,s),this.contents=e===void 0?null:this.createNode(e,n,s)}clone(){const e=Object.create(ht.prototype,{[_s]:{value:vs}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Pt(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){et(this.contents)&&this.contents.add(e)}addIn(e,t){et(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const s=ul(this);e.anchor=!t||s.has(t)?dl(t||"a",s):t}return new ss(e.anchor)}createNode(e,t,s){let n;if(typeof t=="function")e=t.call({"":e},"",e),n=t;else if(Array.isArray(t)){const _=C=>typeof C=="number"||C instanceof String||C instanceof Number,w=t.filter(_).map(String);w.length>0&&(t=t.concat(w)),n=t}else s===void 0&&t&&(s=t,t=void 0);const{aliasDuplicateObjects:r,anchorPrefix:i,flow:o,keepUndefined:a,onTagObj:c,tag:f}=s??{},{onAnchor:u,setAnchors:d,sourceObjects:p}=gl(this,i||"a"),y={aliasDuplicateObjects:r??!0,keepUndefined:a??!1,onAnchor:u,onTagObj:c,replacer:n,schema:this.schema,sourceObjects:p},k=hl(e,f,y);return o&&ze(k)&&(k.flow=!0),d(),k}createPair(e,t,s={}){const n=this.createNode(e,null,s),r=this.createNode(t,null,s);return new yt(n,r)}delete(e){return et(this.contents)?this.contents.delete(e):!1}deleteIn(e){return It(e)?this.contents==null?!1:(this.contents=null,!0):et(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return ze(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return It(e)?!t&&kt(this.contents)?this.contents.value:this.contents:ze(this.contents)?this.contents.getIn(e,t):void 0}has(e){return ze(this.contents)?this.contents.has(e):!1}hasIn(e){return It(e)?this.contents!==void 0:ze(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=bs(this.schema,[e],t):et(this.contents)&&this.contents.set(e,t)}setIn(e,t){It(e)?this.contents=t:this.contents==null?this.contents=bs(this.schema,Array.from(e),t):et(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ot({version:"1.1"}),s={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Ot({version:e}),s={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const n=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(s)this.schema=new Ht(Object.assign(s,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:n,onAnchor:r,reviver:i}={}){const o={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=ml(this.contents,t??"",o);if(typeof r=="function")for(const{count:c,res:f}of o.anchors.values())r(f,c);return typeof i=="function"?pl(i,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return wi(this,e)}}function et(l){if(ze(l))return!0;throw new Error("Expected a YAML collection as document contents")}function ft(l,{flow:e,indicator:t,next:s,offset:n,onError:r,parentIndent:i,startOnNewline:o}){let a=!1,c=o,f=o,u="",d="",p=!1,y=!1,k=!1,_=null,w=null,C=null,S=null,A=null,j=null;for(const $ of l)switch(k&&($.type!=="space"&&$.type!=="newline"&&$.type!=="comma"&&r($.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),k=!1),_&&(c&&$.type!=="comment"&&$.type!=="newline"&&r(_,"TAB_AS_INDENT","Tabs are not allowed as indentation"),_=null),$.type){case"space":!e&&(t!=="doc-start"||(s==null?void 0:s.type)!=="flow-collection")&&$.source.includes(" ")&&(_=$),f=!0;break;case"comment":{f||r($,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const M=$.source.substring(1)||" ";u?u+=d+M:u=M,d="",c=!1;break}case"newline":c?u?u+=$.source:a=!0:d+=$.source,c=!0,p=!0,(w||C)&&(y=!0),f=!0;break;case"anchor":w&&r($,"MULTIPLE_ANCHORS","A node can have at most one anchor"),$.source.endsWith(":")&&r($.offset+$.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=$,j===null&&(j=$.offset),c=!1,f=!1,k=!0;break;case"tag":{C&&r($,"MULTIPLE_TAGS","A node can have at most one tag"),C=$,j===null&&(j=$.offset),c=!1,f=!1,k=!0;break}case t:(w||C)&&r($,"BAD_PROP_ORDER",`Anchors and tags must be after the ${$.source} indicator`),A&&r($,"UNEXPECTED_TOKEN",`Unexpected ${$.source} in ${e??"collection"}`),A=$,c=t==="seq-item-ind"||t==="explicit-key-ind",f=!1;break;case"comma":if(e){S&&r($,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=$,c=!1,f=!1;break}default:r($,"UNEXPECTED_TOKEN",`Unexpected ${$.type} token`),c=!1,f=!1}const T=l[l.length-1],q=T?T.offset+T.source.length:n;return k&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),_&&(c&&_.indent<=i||(s==null?void 0:s.type)==="block-map"||(s==null?void 0:s.type)==="block-seq")&&r(_,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:A,spaceBefore:a,comment:u,hasNewline:p,hasNewlineAfterProp:y,anchor:w,tag:C,end:q,start:j??q}}function wt(l){if(!l)return null;switch(l.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(l.source.includes(` | |
`))return!0;if(l.end){for(const e of l.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of l.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(wt(e.key)||wt(e.value))return!0}return!1;default:return!0}}function Xt(l,e,t){if((e==null?void 0:e.type)==="flow-collection"){const s=e.end[0];s.indent===l&&(s.source==="]"||s.source==="}")&&wt(e)&&t(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Zn(l,e,t){const{uniqueKeys:s}=l.options;if(s===!1)return!1;const n=typeof s=="function"?s:(r,i)=>r===i||kt(r)&&kt(i)&&r.value===i.value&&!(r.value==="<<"&&l.schema.merge);return e.some(r=>n(r.key,t))}const Ls="All mapping items must start at the same column";function Ci({composeNode:l,composeEmptyNode:e},t,s,n,r){var f;const i=(r==null?void 0:r.nodeClass)??Ze,o=new i(t.schema);t.atRoot&&(t.atRoot=!1);let a=s.offset,c=null;for(const u of s.items){const{start:d,key:p,sep:y,value:k}=u,_=ft(d,{indicator:"explicit-key-ind",next:p??(y==null?void 0:y[0]),offset:a,onError:n,parentIndent:s.indent,startOnNewline:!0}),w=!_.found;if(w){if(p&&(p.type==="block-seq"?n(a,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==s.indent&&n(a,"BAD_INDENT",Ls)),!_.anchor&&!_.tag&&!y){c=_.end,_.comment&&(o.comment?o.comment+=` | |
`+_.comment:o.comment=_.comment);continue}(_.hasNewlineAfterProp||wt(p))&&n(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((f=_.found)==null?void 0:f.indent)!==s.indent&&n(a,"BAD_INDENT",Ls);const C=_.end,S=p?l(t,p,_,n):e(t,C,d,null,_,n);t.schema.compat&&Xt(s.indent,p,n),Zn(t,o.items,S)&&n(C,"DUPLICATE_KEY","Map keys must be unique");const A=ft(y??[],{indicator:"map-value-ind",next:k,offset:S.range[2],onError:n,parentIndent:s.indent,startOnNewline:!p||p.type==="block-scalar"});if(a=A.end,A.found){w&&((k==null?void 0:k.type)==="block-map"&&!A.hasNewline&&n(a,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&_.start<A.found.offset-1024&&n(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const j=k?l(t,k,A,n):e(t,a,y,null,A,n);t.schema.compat&&Xt(s.indent,k,n),a=j.range[2];const T=new yt(S,j);t.options.keepSourceTokens&&(T.srcToken=u),o.items.push(T)}else{w&&n(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),A.comment&&(S.comment?S.comment+=` | |
`+A.comment:S.comment=A.comment);const j=new yt(S);t.options.keepSourceTokens&&(j.srcToken=u),o.items.push(j)}}return c&&c<a&&n(c,"IMPOSSIBLE","Map comment with trailing content"),o.range=[s.offset,a,c??a],o}function $i({composeNode:l,composeEmptyNode:e},t,s,n,r){const i=(r==null?void 0:r.nodeClass)??it,o=new i(t.schema);t.atRoot&&(t.atRoot=!1);let a=s.offset,c=null;for(const{start:f,value:u}of s.items){const d=ft(f,{indicator:"seq-item-ind",next:u,offset:a,onError:n,parentIndent:s.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||u)u&&u.type==="block-seq"?n(d.end,"BAD_INDENT","All sequence items must start at the same column"):n(a,"MISSING_CHAR","Sequence item without - indicator");else{c=d.end,d.comment&&(o.comment=d.comment);continue}const p=u?l(t,u,d,n):e(t,d.end,f,null,d,n);t.schema.compat&&Xt(s.indent,u,n),a=p.range[2],o.items.push(p)}return o.range=[s.offset,a,c??a],o}const Kt="Block collections are not allowed within flow collections",zt=l=>l&&(l.type==="block-map"||l.type==="block-seq");function Ei({composeNode:l,composeEmptyNode:e},t,s,n,r){const i=s.start.source==="{",o=i?"flow map":"flow sequence",a=(r==null?void 0:r.nodeClass)??(i?Ze:it),c=new a(t.schema);c.flow=!0;const f=t.atRoot;f&&(t.atRoot=!1);let u=s.offset+s.start.source.length;for(let _=0;_<s.items.length;++_){const w=s.items[_],{start:C,key:S,sep:A,value:j}=w,T=ft(C,{flow:o,indicator:"explicit-key-ind",next:S??(A==null?void 0:A[0]),offset:u,onError:n,parentIndent:s.indent,startOnNewline:!1});if(!T.found){if(!T.anchor&&!T.tag&&!A&&!j){_===0&&T.comma?n(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):_<s.items.length-1&&n(T.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),T.comment&&(c.comment?c.comment+=` | |
`+T.comment:c.comment=T.comment),u=T.end;continue}!i&&t.options.strict&&wt(S)&&n(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(_===0)T.comma&&n(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(T.comma||n(T.start,"MISSING_CHAR",`Missing , between ${o} items`),T.comment){let q="";e:for(const $ of C)switch($.type){case"comma":case"space":break;case"comment":q=$.source.substring(1);break e;default:break e}if(q){let $=c.items[c.items.length-1];ns($)&&($=$.value??$.key),$.comment?$.comment+=` | |
`+q:$.comment=q,T.comment=T.comment.substring(q.length+1)}}if(!i&&!A&&!T.found){const q=j?l(t,j,T,n):e(t,T.end,A,null,T,n);c.items.push(q),u=q.range[2],zt(j)&&n(q.range,"BLOCK_IN_FLOW",Kt)}else{const q=T.end,$=S?l(t,S,T,n):e(t,q,C,null,T,n);zt(S)&&n($.range,"BLOCK_IN_FLOW",Kt);const M=ft(A??[],{flow:o,indicator:"map-value-ind",next:j,offset:$.range[2],onError:n,parentIndent:s.indent,startOnNewline:!1});if(M.found){if(!i&&!T.found&&t.options.strict){if(A)for(const V of A){if(V===M.found)break;if(V.type==="newline"){n(V,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}T.start<M.found.offset-1024&&n(M.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else j&&("source"in j&&j.source&&j.source[0]===":"?n(j,"MISSING_CHAR",`Missing space after : in ${o}`):n(M.start,"MISSING_CHAR",`Missing , or : between ${o} items`));const O=j?l(t,j,M,n):M.found?e(t,M.end,A,null,M,n):null;O?zt(j)&&n(O.range,"BLOCK_IN_FLOW",Kt):M.comment&&($.comment?$.comment+=` | |
`+M.comment:$.comment=M.comment);const E=new yt($,O);if(t.options.keepSourceTokens&&(E.srcToken=w),i){const V=c;Zn(t,V.items,$)&&n(q,"DUPLICATE_KEY","Map keys must be unique"),V.items.push(E)}else{const V=new Ze(t.schema);V.flow=!0,V.items.push(E),c.items.push(V)}u=O?O.range[2]:M.end}}const d=i?"}":"]",[p,...y]=s.end;let k=u;if(p&&p.source===d)k=p.offset+p.source.length;else{const _=o[0].toUpperCase()+o.substring(1),w=f?`${_} must end with a ${d}`:`${_} in block collection must be sufficiently indented and end with a ${d}`;n(u,f?"MISSING_CHAR":"BAD_INDENT",w),p&&p.source.length!==1&&y.unshift(p)}if(y.length>0){const _=Dt(y,k,t.options.strict,n);_.comment&&(c.comment?c.comment+=` | |
`+_.comment:c.comment=_.comment),c.range=[s.offset,k,_.offset]}else c.range=[s.offset,k,k];return c}function Yt(l,e,t,s,n,r){const i=t.type==="block-map"?Ci(l,e,t,s,r):t.type==="block-seq"?$i(l,e,t,s,r):Ei(l,e,t,s,r),o=i.constructor;return n==="!"||n===o.tagName?(i.tag=o.tagName,i):(n&&(i.tag=n),i)}function Ti(l,e,t,s,n){var u;const r=s?e.directives.tagName(s.source,d=>n(s,"TAG_RESOLVE_FAILED",d)):null,i=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!s||!r||r==="!"||r===Ze.tagName&&i==="map"||r===it.tagName&&i==="seq"||!i)return Yt(l,e,t,n,r);let o=e.schema.tags.find(d=>d.tag===r&&d.collection===i);if(!o){const d=e.schema.knownTags[r];if(d&&d.collection===i)e.schema.tags.push(Object.assign({},d,{default:!1})),o=d;else return d!=null&&d.collection?n(s,"BAD_COLLECTION_TYPE",`${d.tag} used for ${i} collection, but expects ${d.collection}`,!0):n(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,!0),Yt(l,e,t,n,r)}const a=Yt(l,e,t,n,r,o),c=((u=o.resolve)==null?void 0:u.call(o,a,d=>n(s,"TAG_RESOLVE_FAILED",d),e.options))??a,f=Pt(c)?c:new Oe(c);return f.range=a.range,f.tag=r,o!=null&&o.format&&(f.format=o.format),f}function Qn(l,e,t,s){const{value:n,type:r,comment:i,range:o}=e.type==="block-scalar"?_l(l,e,s):vl(e,l.options.strict,s),a=t?l.directives.tagName(t.source,u=>s(t,"TAG_RESOLVE_FAILED",u)):null,c=t&&a?Si(l.schema,n,a,t,s):e.type==="scalar"?Ii(l,n,e,s):l.schema[rt];let f;try{const u=c.resolve(n,d=>s(t??e,"TAG_RESOLVE_FAILED",d),l.options);f=kt(u)?u:new Oe(u)}catch(u){const d=u instanceof Error?u.message:String(u);s(t??e,"TAG_RESOLVE_FAILED",d),f=new Oe(n)}return f.range=o,f.source=n,r&&(f.type=r),a&&(f.tag=a),c.format&&(f.format=c.format),i&&(f.comment=i),f}function Si(l,e,t,s,n){var o;if(t==="!")return l[rt];const r=[];for(const a of l.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)r.push(a);else return a;for(const a of r)if((o=a.test)!=null&&o.test(e))return a;const i=l.knownTags[t];return i&&!i.collection?(l.tags.push(Object.assign({},i,{default:!1,test:void 0})),i):(n(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),l[rt])}function Ii({directives:l,schema:e},t,s,n){const r=e.tags.find(i=>{var o;return i.default&&((o=i.test)==null?void 0:o.test(t))})||e[rt];if(e.compat){const i=e.compat.find(o=>{var a;return o.default&&((a=o.test)==null?void 0:a.test(t))})??e[rt];if(r.tag!==i.tag){const o=l.tagString(r.tag),a=l.tagString(i.tag),c=`Value may be parsed as either ${o} or ${a}`;n(s,"TAG_RESOLVE_FAILED",c,!0)}}return r}function Ni(l,e,t){if(e){t===null&&(t=e.length);for(let s=t-1;s>=0;--s){let n=e[s];switch(n.type){case"space":case"comment":case"newline":l-=n.source.length;continue}for(n=e[++s];(n==null?void 0:n.type)==="space";)l+=n.source.length,n=e[++s];break}}return l}const Ai={composeNode:el,composeEmptyNode:fs};function el(l,e,t,s){const{spaceBefore:n,comment:r,anchor:i,tag:o}=t;let a,c=!0;switch(e.type){case"alias":a=Oi(l,e,s),(i||o)&&s(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":a=Qn(l,e,o,s),i&&(a.anchor=i.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":a=Ti(Ai,l,e,o,s),i&&(a.anchor=i.source.substring(1));break;default:{const f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",f),a=fs(l,e.offset,void 0,null,t,s),c=!1}}return i&&a.anchor===""&&s(i,"BAD_ALIAS","Anchor cannot be an empty string"),n&&(a.spaceBefore=!0),r&&(e.type==="scalar"&&e.source===""?a.comment=r:a.commentBefore=r),l.options.keepSourceTokens&&c&&(a.srcToken=e),a}function fs(l,e,t,s,{spaceBefore:n,comment:r,anchor:i,tag:o,end:a},c){const f={type:"scalar",offset:Ni(e,t,s),indent:-1,source:""},u=Qn(l,f,o,c);return i&&(u.anchor=i.source.substring(1),u.anchor===""&&c(i,"BAD_ALIAS","Anchor cannot be an empty string")),n&&(u.spaceBefore=!0),r&&(u.comment=r,u.range[2]=a),u}function Oi({options:l},{offset:e,source:t,end:s},n){const r=new ss(t.substring(1));r.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&n(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const i=e+t.length,o=Dt(s,i,l.strict,n);return r.range=[e,i,o.offset],o.comment&&(r.comment=o.comment),r}function Li(l,e,{offset:t,start:s,value:n,end:r},i){const o=Object.assign({_directives:e},l),a=new ht(void 0,o),c={atRoot:!0,directives:a.directives,options:a.options,schema:a.schema},f=ft(s,{indicator:"doc-start",next:n??(r==null?void 0:r[0]),offset:t,onError:i,parentIndent:0,startOnNewline:!0});f.found&&(a.directives.docStart=!0,n&&(n.type==="block-map"||n.type==="block-seq")&&!f.hasNewline&&i(f.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),a.contents=n?el(c,n,f,i):fs(c,f.end,s,null,f,i);const u=a.contents.range[2],d=Dt(r,u,!1,i);return d.comment&&(a.comment=d.comment),a.range=[t,u,d.offset],a}function _t(l){if(typeof l=="number")return[l,l+1];if(Array.isArray(l))return l.length===2?l:[l[0],l[1]];const{offset:e,source:t}=l;return[e,e+(typeof t=="string"?t.length:1)]}function Ps(l){var n;let e="",t=!1,s=!1;for(let r=0;r<l.length;++r){const i=l[r];switch(i[0]){case"#":e+=(e===""?"":s?` | |
`:` | |
`)+(i.substring(1)||" "),t=!0,s=!1;break;case"%":((n=l[r+1])==null?void 0:n[0])!=="#"&&(r+=1),t=!1;break;default:t||(s=!0),t=!1}}return{comment:e,afterEmptyLine:s}}class us{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,s,n,r)=>{const i=_t(t);r?this.warnings.push(new Nn(i,s,n)):this.errors.push(new st(i,s,n))},this.directives=new Ot({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:s,afterEmptyLine:n}=Ps(this.prelude);if(s){const r=e.contents;if(t)e.comment=e.comment?`${e.comment} | |
${s}`:s;else if(n||e.directives.docStart||!r)e.commentBefore=s;else if(ze(r)&&!r.flow&&r.items.length>0){let i=r.items[0];ns(i)&&(i=i.key);const o=i.commentBefore;i.commentBefore=o?`${s} | |
${o}`:s}else{const i=r.commentBefore;r.commentBefore=i?`${s} | |
${i}`:s}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ps(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(const n of e)yield*this.next(n);yield*this.end(t,s)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,s,n)=>{const r=_t(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",s,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=Li(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new st(_t(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new st(_t(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const t=Dt(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const s=this.doc.comment;this.doc.comment=s?`${s} | |
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new st(_t(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const s=Object.assign({_directives:this.directives},this.options),n=new ht(void 0,s);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,t,t],this.decorate(n,!1),yield n}}}class tl{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,s=this.lineStarts.length;for(;t<s;){const r=t+s>>1;this.lineStarts[r]<e?t=r+1:s=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};const n=this.lineStarts[t-1];return{line:t,col:e-n+1}}}}function Ge(l,e){for(let t=0;t<l.length;++t)if(l[t].type===e)return!0;return!1}function Ds(l){for(let e=0;e<l.length;++e)switch(l[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function sl(l){switch(l==null?void 0:l.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function At(l){switch(l.type){case"document":return l.start;case"block-map":{const e=l.items[l.items.length-1];return e.sep??e.start}case"block-seq":return l.items[l.items.length-1].start;default:return[]}}function tt(l){var t;if(l.length===0)return[];let e=l.length;e:for(;--e>=0;)switch(l[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((t=l[++e])==null?void 0:t.type)==="space";);return l.splice(e,l.length)}function js(l){if(l.start.type==="flow-seq-start")for(const e of l.items)e.sep&&!e.value&&!Ge(e.start,"explicit-key-ind")&&!Ge(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,sl(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class ds{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new An,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(e,t))yield*this.next(s);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const t=bl(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{const s=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in s?s.indent:0:t.type==="flow-collection"&&s.type==="document"&&(t.indent=0),t.type==="flow-collection"&&js(t),s.type){case"document":s.value=t;break;case"block-scalar":s.props.push(t);break;case"block-map":{const n=s.items[s.items.length-1];if(n.value){s.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{const n=s.items[s.items.length-1];n.value?s.items.push({start:[],value:t}):n.value=t;break}case"flow-collection":{const n=s.items[s.items.length-1];!n||n.value?s.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&Ds(n.start)===-1&&(t.indent===0||n.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(s.type==="document"?s.end=n.start:s.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Ds(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const t=At(this.peek(2)),s=tt(t);let n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(` | |
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(` | |
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){var s;const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const n="end"in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;(r==null?void 0:r.type)==="comment"?n==null||n.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const n=e.items[e.items.length-2],r=(s=n==null?void 0:n.value)==null?void 0:s.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let i=[];if(r&&t.sep&&!t.value){const o=[];for(let a=0;a<t.sep.length;++a){const c=t.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ge(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(sl(t.key)&&!Ge(t.sep,"newline")){const o=tt(t.start),a=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(Ge(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const o=tt(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):Ge(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(e);if(o){n&&o.type!=="block-seq"&&e.items.push({start:i}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var s;const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const n="end"in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;(r==null?void 0:r.type)==="comment"?n==null||n.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const n=e.items[e.items.length-2],r=(s=n==null?void 0:n.value)==null?void 0:s.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||Ge(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s&&s.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const n=At(s),r=tt(n);js(e);const i=e.end.splice(1,e.end.length);i.push(this.sourceToken);const o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(` | |
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(` | |
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=At(e),s=tt(t);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=At(e),s=tt(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function nl(l){const e=l.prettyErrors!==!1;return{lineCounter:l.lineCounter||e&&new tl||null,prettyErrors:e}}function Pi(l,e={}){const{lineCounter:t,prettyErrors:s}=nl(e),n=new ds(t==null?void 0:t.addNewLine),r=new us(e),i=Array.from(r.compose(n.parse(l)));if(s&&t)for(const o of i)o.errors.forEach(Lt(l,t)),o.warnings.forEach(Lt(l,t));return i.length>0?i:Object.assign([],{empty:!0},r.streamInfo())}function ll(l,e={}){const{lineCounter:t,prettyErrors:s}=nl(e),n=new ds(t==null?void 0:t.addNewLine),r=new us(e);let i=null;for(const o of r.compose(n.parse(l),!0,l.length))if(!i)i=o;else if(i.options.logLevel!=="silent"){i.errors.push(new st(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&t&&(i.errors.forEach(Lt(l,t)),i.warnings.forEach(Lt(l,t))),i}function Di(l,e,t){let s;typeof e=="function"?s=e:t===void 0&&e&&typeof e=="object"&&(t=e);const n=ll(l,t);if(!n)return null;if(n.warnings.forEach(r=>yl(n.options.logLevel,r)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:s},t))}function ji(l,e,t){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){const n=Math.round(t);t=n<1?void 0:n>8?{indent:8}:{indent:n}}if(l===void 0){const{keepUndefined:n}=t??e??{};if(!n)return}return new ht(l,s,t).toString(t)}const Ms=Object.freeze(Object.defineProperty({__proto__:null,Alias:ss,CST:kl,Composer:us,Document:ht,Lexer:An,LineCounter:tl,Pair:yt,Parser:ds,Scalar:Oe,Schema:Ht,YAMLError:wl,YAMLMap:Ze,YAMLParseError:st,YAMLSeq:it,YAMLWarning:Nn,isAlias:Cl,isCollection:ze,isDocument:$l,isMap:Tn,isNode:Pt,isPair:ns,isScalar:kt,isSeq:Sn,parse:Di,parseAllDocuments:Pi,parseDocument:ll,stringify:ji,visit:El,visitAsync:Tl},Symbol.toStringTag,{value:"Module"}));function Fs(l,e,t){const s=l.slice();return s[22]=e[t],s}function Vs(l){let e,t;return e=new jn({props:{$$slots:{default:[Mi]},$$scope:{ctx:l}}}),{c(){Y(e.$$.fragment)},l(s){X(e.$$.fragment,s)},m(s,n){G(e,s,n),t=!0},p(s,n){const r={};n&33554433&&(r.$$scope={dirty:n,ctx:s}),e.$set(r)},i(s){t||(F(e.$$.fragment,s),t=!0)},o(s){B(e.$$.fragment,s),t=!1},d(s){J(e,s)}}}function Mi(l){let e=l[0].description+"",t;return{c(){t=Z(e)},l(s){t=Q(s,e)},m(s,n){N(s,t,n)},p(s,n){n&1&&e!==(e=s[0].description+"")&&he(t,e)},d(s){s&&h(t)}}}function Bs(l){let e,t="*";return{c(){e=v("sup"),e.textContent=t,this.h()},l(s){e=b(s,"SUP",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-1lfjahc"&&(e.textContent=t),this.h()},h(){g(e,"class","text-red-500")},m(s,n){N(s,e,n)},d(s){s&&h(e)}}}function Fi(l){let e,t,s;return{c(){e=v("input"),this.h()},l(n){e=b(n,"INPUT",{type:!0,class:!0}),this.h()},h(){e.disabled=l[6],g(e,"type","file"),g(e,"class","svelte-lgvtn0")},m(n,r){N(n,e,r),t||(s=ce(e,"change",l[8]),t=!0)},p(n,r){r&64&&(e.disabled=n[6])},d(n){n&&h(e),t=!1,s()}}}function Vi(l){let e,t,s,n,r,i=pe(l[0].options),o=[];for(let a=0;a<i.length;a+=1)o[a]=Hs(Fs(l,i,a));return{c(){e=v("select"),t=v("option");for(let a=0;a<o.length;a+=1)o[a].c();this.h()},l(a){e=b(a,"SELECT",{class:!0});var c=L(e);t=b(c,"OPTION",{}),L(t).forEach(h);for(let f=0;f<o.length;f+=1)o[f].l(c);c.forEach(h),this.h()},h(){t.disabled=s=l[0].required,t.__value=void 0,ue(t,t.__value),e.disabled=l[6],g(e,"class","svelte-lgvtn0"),l[4]===void 0&&Ne(()=>l[19].call(e))},m(a,c){N(a,e,c),m(e,t);for(let f=0;f<o.length;f+=1)o[f]&&o[f].m(e,null);Be(e,l[4],!0),n||(r=ce(e,"change",l[19]),n=!0)},p(a,c){if(c&1&&s!==(s=a[0].required)&&(t.disabled=s),c&1){i=pe(a[0].options);let f;for(f=0;f<i.length;f+=1){const u=Fs(a,i,f);o[f]?o[f].p(u,c):(o[f]=Hs(u),o[f].c(),o[f].m(e,null))}for(;f<o.length;f+=1)o[f].d(1);o.length=i.length}c&64&&(e.disabled=a[6]),c&17&&Be(e,a[4])},d(a){a&&h(e),Le(o,a),n=!1,r()}}}function Bi(l){let e,t,s,n;return{c(){e=v("input"),this.h()},l(r){e=b(r,"INPUT",{type:!0,class:!0}),this.h()},h(){e.disabled=l[6],e.required=t=l[0].required,g(e,"type","number"),g(e,"class","svelte-lgvtn0")},m(r,i){N(r,e,i),ue(e,l[4]),s||(n=ce(e,"input",l[18]),s=!0)},p(r,i){i&64&&(e.disabled=r[6]),i&1&&t!==(t=r[0].required)&&(e.required=t),i&17&&Cn(e.value)!==r[4]&&ue(e,r[4])},d(r){r&&h(e),s=!1,n()}}}function Hi(l){let e,t,s,n;return{c(){e=v("input"),this.h()},l(r){e=b(r,"INPUT",{class:!0,type:!0}),this.h()},h(){g(e,"class","!w-5 svelte-lgvtn0"),e.disabled=l[6],e.required=t=l[0].required,g(e,"type","checkbox")},m(r,i){N(r,e,i),e.checked=l[4],s||(n=ce(e,"change",l[17]),s=!0)},p(r,i){i&64&&(e.disabled=r[6]),i&1&&t!==(t=r[0].required)&&(e.required=t),i&17&&(e.checked=r[4])},d(r){r&&h(e),s=!1,n()}}}function qi(l){let e;function t(r,i){return r[0].secret&&!r[2]&&r[0].shown!==!0?Ki:xi}let s=t(l),n=s(l);return{c(){n.c(),e=me()},l(r){n.l(r),e=me()},m(r,i){n.m(r,i),N(r,e,i)},p(r,i){s===(s=t(r))&&n?n.p(r,i):(n.d(1),n=s(r),n&&(n.c(),n.m(e.parentNode,e)))},d(r){r&&h(e),n.d(r)}}}function Ri(l){let e,t=l[22].label+"",s,n;return{c(){e=v("option"),s=Z(t),this.h()},l(r){e=b(r,"OPTION",{});var i=L(e);s=Q(i,t),i.forEach(h),this.h()},h(){e.__value=n=l[22].value,ue(e,e.__value)},m(r,i){N(r,e,i),m(e,s)},p(r,i){i&1&&t!==(t=r[22].label+"")&&he(s,t),i&1&&n!==(n=r[22].value)&&(e.__value=n,ue(e,e.__value))},d(r){r&&h(e)}}}function Ui(l){let e,t=l[22]+"",s,n;return{c(){e=v("option"),s=Z(t),this.h()},l(r){e=b(r,"OPTION",{});var i=L(e);s=Q(i,t),i.forEach(h),this.h()},h(){e.__value=n=l[22],ue(e,e.__value)},m(r,i){N(r,e,i),m(e,s)},p(r,i){i&1&&t!==(t=r[22]+"")&&he(s,t),i&1&&n!==(n=r[22])&&(e.__value=n,ue(e,e.__value))},d(r){r&&h(e)}}}function Hs(l){let e;function t(r,i){return typeof r[22]=="string"?Ui:Ri}let s=t(l),n=s(l);return{c(){n.c(),e=me()},l(r){n.l(r),e=me()},m(r,i){n.m(r,i),N(r,e,i)},p(r,i){s===(s=t(r))&&n?n.p(r,i):(n.d(1),n=s(r),n&&(n.c(),n.m(e.parentNode,e)))},d(r){r&&h(e),n.d(r)}}}function xi(l){let e,t,s,n;return{c(){e=v("input"),this.h()},l(r){e=b(r,"INPUT",{type:!0,class:!0}),this.h()},h(){e.disabled=l[6],e.required=t=l[0].required,g(e,"type","text"),g(e,"class","svelte-lgvtn0")},m(r,i){N(r,e,i),ue(e,l[4]),s||(n=ce(e,"input",l[16]),s=!0)},p(r,i){i&64&&(e.disabled=r[6]),i&1&&t!==(t=r[0].required)&&(e.required=t),i&17&&e.value!==r[4]&&ue(e,r[4])},d(r){r&&h(e),s=!1,n()}}}function Ki(l){let e,t,s,n;return{c(){e=v("input"),this.h()},l(r){e=b(r,"INPUT",{type:!0,class:!0}),this.h()},h(){e.disabled=l[6],e.required=t=l[0].required,g(e,"type","password"),g(e,"class","svelte-lgvtn0")},m(r,i){N(r,e,i),ue(e,l[4]),s||(n=ce(e,"input",l[15]),s=!0)},p(r,i){i&64&&(e.disabled=r[6]),i&1&&t!==(t=r[0].required)&&(e.required=t),i&17&&e.value!==r[4]&&ue(e,r[4])},d(r){r&&h(e),s=!1,n()}}}function qs(l){let e,t,s,n;function r(o){l[20](o)}let i={rootOptions:l[1],reveal:l[2],disabled:l[6],optionSpec:l[0].children[l[4]]};return l[3]!==void 0&&(i.options=l[3]),t=new il({props:i}),Je.push(()=>We(t,"options",r)),{c(){e=v("section"),Y(t.$$.fragment),this.h()},l(o){e=b(o,"SECTION",{class:!0});var a=L(e);X(t.$$.fragment,a),a.forEach(h),this.h()},h(){g(e,"class","ml-4 flex flex-col gap-2 mt-2")},m(o,a){N(o,e,a),G(t,e,null),n=!0},p(o,a){const c={};a&2&&(c.rootOptions=o[1]),a&4&&(c.reveal=o[2]),a&64&&(c.disabled=o[6]),a&17&&(c.optionSpec=o[0].children[o[4]]),!s&&a&8&&(s=!0,c.options=o[3],Xe(()=>s=!1)),t.$set(c)},i(o){n||(F(t.$$.fragment,o),n=!0)},o(o){B(t.$$.fragment,o),n=!1},d(o){o&&h(e),J(t)}}}function zi(l){var T,q;let e,t,s,n,r,i,o,a,c,f,u,d,p,y=Object.keys(((q=(T=l[0])==null?void 0:T.children)==null?void 0:q[l[4]])??{}).length,k,_=l[0].description&&Vs(l),w=l[0].required&&Bs();function C($,M){if($[0].type==="string")return qi;if($[0].type==="boolean")return Hi;if($[0].type==="number")return Bi;if($[0].type==="select")return Vi;if($[0].type==="file")return Fi}let S=C(l),A=S&&S(l),j=y&&qs(l);return{c(){e=v("div"),t=v("label"),s=v("div"),n=v("p"),_&&_.c(),r=P(),i=v("span"),o=Z(l[7]),a=P(),w&&w.c(),c=P(),f=v("p"),u=Z(l[5]),d=P(),A&&A.c(),p=P(),j&&j.c(),this.h()},l($){e=b($,"DIV",{class:!0});var M=L(e);t=b(M,"LABEL",{class:!0});var O=L(t);s=b(O,"DIV",{class:!0});var E=L(s);n=b(E,"P",{class:!0});var V=L(n);_&&_.l(V),r=D(V),i=b(V,"SPAN",{});var H=L(i);o=Q(H,l[7]),a=D(H),w&&w.l(H),H.forEach(h),V.forEach(h),c=D(E),f=b(E,"P",{class:!0});var I=L(f);u=Q(I,l[5]),I.forEach(h),E.forEach(h),d=D(O),A&&A.l(O),O.forEach(h),p=D(M),j&&j.l(M),M.forEach(h),this.h()},h(){g(n,"class","flex items-center gap-1"),g(f,"class","text-red-500 text-xs font-bold"),g(s,"class","mr-2 inline-flex flex-col gap-1"),g(t,"class","flex justify-between w-full h-11 items-start"),g(e,"class","w-full")},m($,M){N($,e,M),m(e,t),m(t,s),m(s,n),_&&_.m(n,null),m(n,r),m(n,i),m(i,o),m(i,a),w&&w.m(i,null),m(s,c),m(s,f),m(f,u),m(t,d),A&&A.m(t,null),m(e,p),j&&j.m(e,null),k=!0},p($,[M]){var O,E;$[0].description?_?(_.p($,M),M&1&&F(_,1)):(_=Vs($),_.c(),F(_,1),_.m(n,r)):_&&(ge(),B(_,1,1,()=>{_=null}),_e()),(!k||M&128)&&he(o,$[7]),$[0].required?w||(w=Bs(),w.c(),w.m(i,null)):w&&(w.d(1),w=null),(!k||M&32)&&he(u,$[5]),S===(S=C($))&&A?A.p($,M):(A&&A.d(1),A=S&&S($),A&&(A.c(),A.m(t,null))),M&17&&(y=Object.keys(((E=(O=$[0])==null?void 0:O.children)==null?void 0:E[$[4]])??{}).length),y?j?(j.p($,M),M&17&&F(j,1)):(j=qs($),j.c(),F(j,1),j.m(e,null)):j&&(ge(),B(j,1,1,()=>{j=null}),_e())},i($){k||(F(_),F(j),k=!0)},o($){B(_),B(j),k=!1},d($){$&&h(e),_&&_.d(),w&&w.d(),A&&A.d(),j&&j.d()}}}function Yi(l,e,t){let s,n,r,{spec:i}=e,{key:o}=e,{options:a}=e,{disabled:c}=e,{rootOptions:f}=e,{reveal:u}=e;const d=`_${o}`;let p,y;i.children?i.nest?(p=d,y=a[o]??{}):(p=o,y=a):(p=o,y={});let k=a[p],_={};async function w(M){const{files:O}=M.target;if(!O)return;const[E]=O;switch(i.fileFormat){case"json":try{t(9,a[p]=await E.text().then(V=>JSON.parse(V)),a)}catch(V){t(5,C="Failed to parse YAML file"),console.warn(V)}break;case"yaml":try{t(9,a[p]=await E.text().then(V=>Ms.parse(V)),a)}catch(V){t(5,C="Failed to parse JSON file"),console.warn(V)}break;default:{const V=await E.text();try{t(9,a[p]=JSON.parse(V),a);break}catch{}try{t(9,a[p]=Ms.parse(V),a);break}catch{}t(9,a[p]=await E.text(),a);break}}}let C="";function S(){k=this.value,t(4,k),t(14,n),t(0,i),t(1,f),t(0,i)}function A(){k=this.value,t(4,k),t(14,n),t(0,i),t(1,f),t(0,i)}function j(){k=this.checked,t(4,k),t(14,n),t(0,i),t(1,f),t(0,i)}function T(){k=Cn(this.value),t(4,k),t(14,n),t(0,i),t(1,f),t(0,i)}function q(){k=Ct(this),t(4,k),t(14,n),t(0,i),t(1,f),t(0,i)}function $(M){y=M,t(3,y),t(0,i),t(4,k),t(10,o),t(9,a),t(13,_),t(12,p),t(14,n),t(1,f)}return l.$$set=M=>{"spec"in M&&t(0,i=M.spec),"key"in M&&t(10,o=M.key),"options"in M&&t(9,a=M.options),"disabled"in M&&t(11,c=M.disabled),"rootOptions"in M&&t(1,f=M.rootOptions),"reveal"in M&&t(2,u=M.reveal)},l.$$.update=()=>{var M,O,E;if(l.$$.dirty&1025&&t(7,s=i.title??o),l.$$.dirty&3&&t(14,n=i.references?Sl.query(f,i.references):null),l.$$.dirty&16384&&n!=null&&n.length&&t(4,k=n[0]),l.$$.dirty&13849)if(i!=null&&i.children&&!Object.keys(i.children[k]??{}).length){if(t(9,a[o]=k,a),delete a[d],typeof y=="object")for(const V of Object.keys(_))delete y[V];else console.warn(`child_value_target was unexpectedly not an object ${y}`,{key:o,options:a,spec:i});t(13,_=((M=i==null?void 0:i.children)==null?void 0:M[k])??{})}else(O=i==null?void 0:i.children)!=null&&O[k]&&(i.nest?(t(12,p=d),typeof a[o]!="object"&&t(9,a[o]={},a),t(3,y=a[o])):(t(12,p=o),t(3,y=a)),t(9,a[p]=k,a),t(13,_=((E=i==null?void 0:i.children)==null?void 0:E[k])??{}));l.$$.dirty&4112&&t(9,a[p]=k,a),l.$$.dirty&18433&&t(6,r=c||i.forceReference||i.reference&&n!==null)},[i,f,u,y,k,C,r,s,w,a,o,c,p,_,n,S,A,j,T,q,$]}class Gi extends ye{constructor(e){super(),ke(this,e,Yi,zi,be,{spec:0,key:10,options:9,disabled:11,rootOptions:1,reveal:2})}}function Rs(l,e,t){const s=l.slice();return s[6]=e[t][0],s[7]=e[t][1],s}function Us(l){let e,t,s;function n(i){l[5](i)}let r={reveal:l[4],disabled:l[2],key:l[6],spec:l[7],rootOptions:l[3]};return l[0]!==void 0&&(r.options=l[0]),e=new Gi({props:r}),Je.push(()=>We(e,"options",n)),{c(){Y(e.$$.fragment)},l(i){X(e.$$.fragment,i)},m(i,o){G(e,i,o),s=!0},p(i,o){const a={};o&16&&(a.reveal=i[4]),o&4&&(a.disabled=i[2]),o&2&&(a.key=i[6]),o&2&&(a.spec=i[7]),o&8&&(a.rootOptions=i[3]),!t&&o&1&&(t=!0,a.options=i[0],Xe(()=>t=!1)),e.$set(a)},i(i){s||(F(e.$$.fragment,i),s=!0)},o(i){B(e.$$.fragment,i),s=!1},d(i){J(e,i)}}}function Ji(l){let e,t,s=pe(Object.entries(l[1])),n=[];for(let i=0;i<s.length;i+=1)n[i]=Us(Rs(l,s,i));const r=i=>B(n[i],1,1,()=>{n[i]=null});return{c(){for(let i=0;i<n.length;i+=1)n[i].c();e=me()},l(i){for(let o=0;o<n.length;o+=1)n[o].l(i);e=me()},m(i,o){for(let a=0;a<n.length;a+=1)n[a]&&n[a].m(i,o);N(i,e,o),t=!0},p(i,[o]){if(o&31){s=pe(Object.entries(i[1]));let a;for(a=0;a<s.length;a+=1){const c=Rs(i,s,a);n[a]?(n[a].p(c,o),F(n[a],1)):(n[a]=Us(c),n[a].c(),F(n[a],1),n[a].m(e.parentNode,e))}for(ge(),a=s.length;a<n.length;a+=1)r(a);_e()}},i(i){if(!t){for(let o=0;o<s.length;o+=1)F(n[o]);t=!0}},o(i){n=n.filter(Boolean);for(let o=0;o<n.length;o+=1)B(n[o]);t=!1},d(i){i&&h(e),Le(n,i)}}}function Xi(l,e,t){let{optionSpec:s}=e,{options:n={}}=e,{disabled:r=!1}=e,{rootOptions:i=n}=e,{reveal:o}=e;for(const[c,f]of Object.entries(s))f.default&&!n[c]&&(n[c]=f.default);function a(c){n=c,t(0,n)}return l.$$set=c=>{"optionSpec"in c&&t(1,s=c.optionSpec),"options"in c&&t(0,n=c.options),"disabled"in c&&t(2,r=c.disabled),"rootOptions"in c&&t(3,i=c.rootOptions),"reveal"in c&&t(4,o=c.reveal)},[n,s,r,i,o,a]}class il extends ye{constructor(e){super(),ke(this,e,Xi,Ji,be,{optionSpec:1,options:0,disabled:2,rootOptions:3,reveal:4})}}function Wi(l){let e,t="Configuration Updated";return{c(){e=v("p"),e.textContent=t,this.h()},l(s){e=b(s,"P",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-c31ocd"&&(e.textContent=t),this.h()},h(){g(e,"class","text-green-500 font-bold text-xs")},m(s,n){N(s,e,n)},p:ee,d(s){s&&h(e)}}}function Zi(l){let e,t;return{c(){e=v("p"),t=Z(l[3]),this.h()},l(s){e=b(s,"P",{class:!0});var n=L(e);t=Q(n,l[3]),n.forEach(h),this.h()},h(){g(e,"class","text-red-500 font-bold text-xs")},m(s,n){N(s,e,n),m(e,t)},p(s,n){n&8&&he(t,s[3])},d(s){s&&h(e)}}}function xs(l){let e,t,s,n="Source Options",r,i,o,a;function c(u){l[15](u)}let f={reveal:l[2],disabled:l[4]||l[7],rootOptions:l[0].options,optionSpec:l[1].options};return l[0].options!==void 0&&(f.options=l[0].options),i=new il({props:f}),Je.push(()=>We(i,"options",c)),{c(){e=v("hr"),t=P(),s=v("h4"),s.textContent=n,r=P(),Y(i.$$.fragment),this.h()},l(u){e=b(u,"HR",{}),t=D(u),s=b(u,"H4",{class:!0,"data-svelte-h":!0}),x(s)!=="svelte-4l22ps"&&(s.textContent=n),r=D(u),X(i.$$.fragment,u),this.h()},h(){g(s,"class","text-xs uppercase text-gray-600 font-bold")},m(u,d){N(u,e,d),N(u,t,d),N(u,s,d),N(u,r,d),G(i,u,d),a=!0},p(u,d){const p={};d&4&&(p.reveal=u[2]),d&144&&(p.disabled=u[4]||u[7]),d&1&&(p.rootOptions=u[0].options),d&2&&(p.optionSpec=u[1].options),!o&&d&1&&(o=!0,p.options=u[0].options,Xe(()=>o=!1)),i.$set(p)},i(u){a||(F(i.$$.fragment,u),a=!0)},o(u){B(i.$$.fragment,u),a=!1},d(u){u&&(h(e),h(t),h(s),h(r)),J(i,u)}}}function Qi(l){let e,t="Connection Successful!";return{c(){e=v("p"),e.textContent=t,this.h()},l(s){e=b(s,"P",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-odatav"&&(e.textContent=t),this.h()},h(){g(e,"class","text-green-500 font-bold text-xs")},m(s,n){N(s,e,n)},p:ee,d(s){s&&h(e)}}}function er(l){let e,t;return{c(){e=v("p"),t=Z(l[6]),this.h()},l(s){e=b(s,"P",{class:!0});var n=L(e);t=Q(n,l[6]),n.forEach(h),this.h()},h(){g(e,"class","text-red-500 font-bold text-xs")},m(s,n){N(s,e,n),m(e,t)},p(s,n){n&64&&he(t,s[6])},d(s){s&&h(e)}}}function tr(l){let e=l[7]?"Loading...":"Test Connection",t;return{c(){t=Z(e)},l(s){t=Q(s,e)},m(s,n){N(s,t,n)},p(s,n){n&128&&e!==(e=s[7]?"Loading...":"Test Connection")&&he(t,e)},d(s){s&&h(t)}}}function sr(l){let e;return{c(){e=Z("Confirm Changes")},l(t){e=Q(t,"Confirm Changes")},m(t,s){N(t,e,s)},d(t){t&&h(e)}}}function nr(l){let e,t,s,n=l[0].name+"",r,i,o,a,c,f="Source Info",u,d,p,y,k,_,w,C,S,A,j,T,q,$,M=Object.keys(l[1].options).length,O,E,V,H,I,R,U,W,K,z,se,ne;function $e(te,le){if(te[3])return Zi;if(te[5])return Wi}let Te=$e(l),ae=Te&&Te(l);function Se(te){l[12](te)}function ie(te){l[13](te)}let fe={};l[0].name!==void 0&&(fe.sourceName=l[0].name),l[9]!==void 0&&(fe.nameError=l[9]),d=new Fn({props:fe}),Je.push(()=>We(d,"sourceName",Se)),Je.push(()=>We(d,"nameError",ie));let oe=M&&xs(l);function we(te,le){if(te[6])return er;if(te[8])return Qi}let Ce=we(l),re=Ce&&Ce(l);return U=new ot({props:{outline:!0,size:"md",formaction:"?/testSource",disabled:l[7]||l[4],icon:Fl,$$slots:{default:[tr]},$$scope:{ctx:l}}}),K=new ot({props:{variant:"success",icon:On,size:"md",disabled:l[4]||l[7],type:"submit",$$slots:{default:[sr]},$$scope:{ctx:l}}}),{c(){e=v("form"),t=v("h3"),s=Z("Configure "),r=Z(n),i=P(),o=v("section"),ae&&ae.c(),a=P(),c=v("h4"),c.textContent=f,u=P(),Y(d.$$.fragment),k=P(),_=v("label"),w=Z(`Source Type | |
`),C=v("input"),A=P(),j=v("label"),T=Z(`Reveal Secret Values | |
`),q=v("input"),$=P(),oe&&oe.c(),O=P(),E=v("input"),H=P(),I=v("div"),re&&re.c(),R=P(),Y(U.$$.fragment),W=P(),Y(K.$$.fragment),this.h()},l(te){e=b(te,"FORM",{action:!0,method:!0,class:!0});var le=L(e);t=b(le,"H3",{class:!0});var Ae=L(t);s=Q(Ae,"Configure "),r=Q(Ae,n),Ae.forEach(h),i=D(le),o=b(le,"SECTION",{class:!0});var Ee=L(o);ae&&ae.l(Ee),a=D(Ee),c=b(Ee,"H4",{class:!0,"data-svelte-h":!0}),x(c)!=="svelte-1itqiv6"&&(c.textContent=f),u=D(Ee),X(d.$$.fragment,Ee),k=D(Ee),_=b(Ee,"LABEL",{class:!0});var Me=L(_);w=Q(Me,`Source Type | |
`),C=b(Me,"INPUT",{class:!0}),Me.forEach(h),A=D(Ee),j=b(Ee,"LABEL",{class:!0});var Fe=L(j);T=Q(Fe,`Reveal Secret Values | |
`),q=b(Fe,"INPUT",{type:!0,class:!0}),Fe.forEach(h),$=D(Ee),oe&&oe.l(Ee),Ee.forEach(h),O=D(le),E=b(le,"INPUT",{type:!0,name:!0}),H=D(le),I=b(le,"DIV",{class:!0});var qe=L(I);re&&re.l(qe),R=D(qe),X(U.$$.fragment,qe),W=D(qe),X(K.$$.fragment,qe),qe.forEach(h),le.forEach(h),this.h()},h(){g(t,"class","text-sm uppercase gray-600 font-bold"),g(c,"class","text-xs uppercase text-gray-600 font-bold"),C.disabled=!0,C.value=S=l[0].type,g(C,"class","rounded border border-gray-300 p-1 ml-auto w-2/3 text-gray-950 align-middle text-sm"),g(_,"class","flex justify-between"),g(q,"type","checkbox"),g(q,"class","rounded border border-gray-300 p-1 ml-auto w-5 text-gray-950 align-middle text-sm"),g(j,"class","flex justify-between"),g(o,"class","flex flex-col gap-2"),g(E,"type","hidden"),E.value=V=JSON.stringify(l[0]),g(E,"name","source"),g(I,"class","flex gap-2 justify-end items-center mt-4"),g(e,"action","?/updateSource"),g(e,"method","POST"),g(e,"class","w-full bg-gray-100 px-4 py-2 rounded")},m(te,le){N(te,e,le),m(e,t),m(t,s),m(t,r),m(e,i),m(e,o),ae&&ae.m(o,null),m(o,a),m(o,c),m(o,u),G(d,o,null),m(o,k),m(o,_),m(_,w),m(_,C),m(o,A),m(o,j),m(j,T),m(j,q),q.checked=l[2],m(o,$),oe&&oe.m(o,null),m(e,O),m(e,E),m(e,H),m(e,I),re&&re.m(I,null),m(I,R),G(U,I,null),m(I,W),G(K,I,null),z=!0,se||(ne=[ce(q,"change",l[14]),rl(ai.call(null,e,l[10]))],se=!0)},p(te,[le]){(!z||le&1)&&n!==(n=te[0].name+"")&&he(r,n),Te===(Te=$e(te))&&ae?ae.p(te,le):(ae&&ae.d(1),ae=Te&&Te(te),ae&&(ae.c(),ae.m(o,a)));const Ae={};!p&&le&1&&(p=!0,Ae.sourceName=te[0].name,Xe(()=>p=!1)),!y&&le&512&&(y=!0,Ae.nameError=te[9],Xe(()=>y=!1)),d.$set(Ae),(!z||le&1&&S!==(S=te[0].type)&&C.value!==S)&&(C.value=S),le&4&&(q.checked=te[2]),le&2&&(M=Object.keys(te[1].options).length),M?oe?(oe.p(te,le),le&2&&F(oe,1)):(oe=xs(te),oe.c(),F(oe,1),oe.m(o,null)):oe&&(ge(),B(oe,1,1,()=>{oe=null}),_e()),(!z||le&1&&V!==(V=JSON.stringify(te[0])))&&(E.value=V),Ce===(Ce=we(te))&&re?re.p(te,le):(re&&re.d(1),re=Ce&&Ce(te),re&&(re.c(),re.m(I,R)));const Ee={};le&144&&(Ee.disabled=te[7]||te[4]),le&131200&&(Ee.$$scope={dirty:le,ctx:te}),U.$set(Ee);const Me={};le&144&&(Me.disabled=te[4]||te[7]),le&131072&&(Me.$$scope={dirty:le,ctx:te}),K.$set(Me)},i(te){z||(F(d.$$.fragment,te),F(oe),F(U.$$.fragment,te),F(K.$$.fragment,te),z=!0)},o(te){B(d.$$.fragment,te),B(oe),B(U.$$.fragment,te),B(K.$$.fragment,te),z=!1},d(te){te&&h(e),ae&&ae.d(),J(d),oe&&oe.d(),re&&re.d(),J(U),J(K),se=!1,xe(ne)}}}function lr(l,e,t){let{sourcePlugin:s}=e,{source:n}=e,{sources:r}=e;const i=wn();let o;n.initialName=n.name;let a="",c=!1,f=!1,u="",d=!1,p=!1,y="";const k=({action:A,cancel:j})=>{if(t(4,c=!1),t(7,d=!1),t(9,y=Mn(n.name,r.filter(T=>T!==n))),y){j();return}switch(A.search){case"?/updateSource":t(4,c=!0),t(3,a=""),t(5,f=!1);break;case"?/testSource":t(7,d=!0),t(6,u=""),t(8,p=!1);break}return({result:T,action:q})=>{var $,M,O;if(T.status>=300){typeof T.data=="string"?t(3,a=T.data):typeof T.data=="object"&&"message"in T.data?t(3,a=T.data.message):t(3,a="Error saving datasource."),t(4,c=!1),t(5,f=!1),t(7,d=!1),t(8,p=!1);return}switch(q.search){case"?/updateSource":Object.assign(n,($=T==null?void 0:T.data)==null?void 0:$.updatedSource),t(4,c=!1),t(5,f=!0),i("sourceUpdated",n);break;case"?/testSource":((M=T.data)==null?void 0:M.success)===!0?t(6,u=""):t(6,u=(O=T.data)==null?void 0:O.message),t(7,d=!1),t(8,p=!0);break}}};function _(A){l.$$.not_equal(n.name,A)&&(n.name=A,t(0,n))}function w(A){y=A,t(9,y)}function C(){o=this.checked,t(2,o)}function S(A){l.$$.not_equal(n.options,A)&&(n.options=A,t(0,n))}return l.$$set=A=>{"sourcePlugin"in A&&t(1,s=A.sourcePlugin),"source"in A&&t(0,n=A.source),"sources"in A&&t(11,r=A.sources)},[n,s,o,a,c,f,u,d,p,y,k,r,_,w,C,S]}class ir extends ye{constructor(e){super(),ke(this,e,lr,nr,be,{sourcePlugin:1,source:0,sources:11})}}function rr(l){let e,t;return e=new je({props:{src:Bl,class:"w-6 h-6"}}),{c(){Y(e.$$.fragment)},l(s){X(e.$$.fragment,s)},m(s,n){G(e,s,n),t=!0},p:ee,i(s){t||(F(e.$$.fragment,s),t=!0)},o(s){B(e.$$.fragment,s),t=!1},d(s){J(e,s)}}}function or(l){let e,t;return e=new je({props:{src:Hl,class:"w-6 h-6 text-red-500"}}),{c(){Y(e.$$.fragment)},l(s){X(e.$$.fragment,s)},m(s,n){G(e,s,n),t=!0},p:ee,i(s){t||(F(e.$$.fragment,s),t=!0)},o(s){B(e.$$.fragment,s),t=!1},d(s){J(e,s)}}}function ar(l){let e,t;return e=new je({props:{src:Jt[l[3].package.package.evidence.icon],class:"w-6 h-6"}}),{c(){Y(e.$$.fragment)},l(s){X(e.$$.fragment,s)},m(s,n){G(e,s,n),t=!0},p(s,n){const r={};n&8&&(r.src=Jt[s[3].package.package.evidence.icon]),e.$set(r)},i(s){t||(F(e.$$.fragment,s),t=!0)},o(s){B(e.$$.fragment,s),t=!1},d(s){J(e,s)}}}function cr(l){let e,t;return e=new je({props:{src:Gt[l[3].package.package.evidence.icon],class:"w-6 h-6"}}),{c(){Y(e.$$.fragment)},l(s){X(e.$$.fragment,s)},m(s,n){G(e,s,n),t=!0},p(s,n){const r={};n&8&&(r.src=Gt[s[3].package.package.evidence.icon]),e.$set(r)},i(s){t||(F(e.$$.fragment,s),t=!0)},o(s){B(e.$$.fragment,s),t=!1},d(s){J(e,s)}}}function Ks(l){let e,t,s=l[0].type+"",n,r,i,o,a;return o=new jn({props:{$$slots:{default:[fr]},$$scope:{ctx:l}}}),{c(){e=v("p"),t=Z("No connector for "),n=Z(s),r=Z(" is available"),i=P(),Y(o.$$.fragment),this.h()},l(c){e=b(c,"P",{class:!0});var f=L(e);t=Q(f,"No connector for "),n=Q(f,s),r=Q(f," is available"),f.forEach(h),i=D(c),X(o.$$.fragment,c),this.h()},h(){g(e,"class","text-red-500 font-bold")},m(c,f){N(c,e,f),m(e,t),m(e,n),m(e,r),N(c,i,f),G(o,c,f),a=!0},p(c,f){(!a||f&1)&&s!==(s=c[0].type+"")&&he(n,s);const u={};f&256&&(u.$$scope={dirty:f,ctx:c}),o.$set(u)},i(c){a||(F(o.$$.fragment,c),a=!0)},o(c){B(o.$$.fragment,c),a=!1},d(c){c&&(h(e),h(i)),J(o,c)}}}function fr(l){let e;return{c(){e=Z("Make sure you have installed it, and included it in your evidence.plugins.yaml file")},l(t){e=Q(t,"Make sure you have installed it, and included it in your evidence.plugins.yaml file")},m(t,s){N(t,e,s)},d(t){t&&h(e)}}}function ur(l){let e;return{c(){e=Z("Edit")},l(t){e=Q(t,"Edit")},m(t,s){N(t,e,s)},d(t){t&&h(e)}}}function zs(l){let e,t,s,n;return t=new ir({props:{sources:l[1],source:l[0],sourcePlugin:l[3]}}),t.$on("sourceUpdated",l[7]),{c(){e=v("div"),Y(t.$$.fragment),this.h()},l(r){e=b(r,"DIV",{class:!0});var i=L(e);X(t.$$.fragment,i),i.forEach(h),this.h()},h(){g(e,"class","col-span-4")},m(r,i){N(r,e,i),G(t,e,null),n=!0},p(r,i){const o={};i&2&&(o.sources=r[1]),i&1&&(o.source=r[0]),i&8&&(o.sourcePlugin=r[3]),t.$set(o)},i(r){n||(F(t.$$.fragment,r),r&&Ne(()=>{n&&(s||(s=De(e,He,{},!0)),s.run(1))}),n=!0)},o(r){B(t.$$.fragment,r),r&&(s||(s=De(e,He,{},!1)),s.run(0)),n=!1},d(r){r&&h(e),J(t),r&&s&&s.end()}}}function dr(l){let e,t,s,n,r,i=l[0].name+"",o,a,c,f,u=l[0].type+"",d,p,y,k,_,w,C,S,A;const j=[cr,ar,or,rr],T=[];function q(O,E){var V,H;return Gt[(V=O[3])==null?void 0:V.package.package.evidence.icon]?0:Jt[(H=O[3])==null?void 0:H.package.package.evidence.icon]?1:O[3]?3:2}t=q(l),s=T[t]=j[t](l);let $=!l[3]&&Ks(l);w=new ot({props:{size:"md",icon:Vl,disabled:!l[3],$$slots:{default:[ur]},$$scope:{ctx:l}}}),w.$on("click",l[6]);let M=l[2]&&zs(l);return{c(){e=v("div"),s.c(),n=P(),r=v("p"),o=Z(i),a=P(),c=v("div"),f=v("p"),d=Z(u),y=P(),$&&$.c(),k=P(),_=v("div"),Y(w.$$.fragment),C=P(),M&&M.c(),S=me(),this.h()},l(O){e=b(O,"DIV",{class:!0});var E=L(e);s.l(E),n=D(E),r=b(E,"P",{});var V=L(r);o=Q(V,i),V.forEach(h),a=D(E),c=b(E,"DIV",{class:!0});var H=L(c);f=b(H,"P",{title:!0});var I=L(f);d=Q(I,u),I.forEach(h),y=D(H),$&&$.l(H),H.forEach(h),k=D(E),_=b(E,"DIV",{class:!0});var R=L(_);X(w.$$.fragment,R),R.forEach(h),E.forEach(h),C=D(O),M&&M.l(O),S=me(),this.h()},h(){var O;g(f,"title",p=(O=l[3])==null?void 0:O.package.package.name),g(c,"class","flex gap-2 items-center"),g(_,"class","flex justify-end"),g(e,"class","contents text-xs odd:bg-gray-200")},m(O,E){N(O,e,E),T[t].m(e,null),m(e,n),m(e,r),m(r,o),m(e,a),m(e,c),m(c,f),m(f,d),m(c,y),$&&$.m(c,null),m(e,k),m(e,_),G(w,_,null),N(O,C,E),M&&M.m(O,E),N(O,S,E),A=!0},p(O,[E]){var I;let V=t;t=q(O),t===V?T[t].p(O,E):(ge(),B(T[V],1,1,()=>{T[V]=null}),_e(),s=T[t],s?s.p(O,E):(s=T[t]=j[t](O),s.c()),F(s,1),s.m(e,n)),(!A||E&1)&&i!==(i=O[0].name+"")&&he(o,i),(!A||E&1)&&u!==(u=O[0].type+"")&&he(d,u),(!A||E&8&&p!==(p=(I=O[3])==null?void 0:I.package.package.name))&&g(f,"title",p),O[3]?$&&(ge(),B($,1,1,()=>{$=null}),_e()):$?($.p(O,E),E&8&&F($,1)):($=Ks(O),$.c(),F($,1),$.m(c,null));const H={};E&8&&(H.disabled=!O[3]),E&256&&(H.$$scope={dirty:E,ctx:O}),w.$set(H),O[2]?M?(M.p(O,E),E&4&&F(M,1)):(M=zs(O),M.c(),F(M,1),M.m(S.parentNode,S)):M&&(ge(),B(M,1,1,()=>{M=null}),_e())},i(O){A||(F(s),F($),F(w.$$.fragment,O),F(M),A=!0)},o(O){B(s),B($),B(w.$$.fragment,O),B(M),A=!1},d(O){O&&(h(e),h(C),h(S)),T[t].d(),$&&$.d(),J(w),M&&M.d(O)}}}function hr(l,e,t){let s,{source:n}=e,{sources:r}=e,{availableSourcePlugins:i}=e,{startOpen:o=!1}=e,a=o;const c=()=>t(2,a=!a),f=u=>t(0,n=u.detail);return l.$$set=u=>{"source"in u&&t(0,n=u.source),"sources"in u&&t(1,r=u.sources),"availableSourcePlugins"in u&&t(4,i=u.availableSourcePlugins),"startOpen"in u&&t(5,o=u.startOpen)},l.$$.update=()=>{l.$$.dirty&17&&t(3,s=i==null?void 0:i[n.type])},[n,r,a,s,i,o,c,f]}class mr extends ye{constructor(e){super(),ke(this,e,hr,dr,be,{source:0,sources:1,availableSourcePlugins:4,startOpen:5})}}function Ys(l,e,t){const s=l.slice();return s[8]=e[t],s}function Gs(l,e,t){const s=l.slice();return s[11]=e[t],s}function pr(l){let e,t,s;return t=new Vn({props:{ghost:!0,availablePackages:l[5]}}),t.$on("newSource",l[6]),{c(){e=v("section"),Y(t.$$.fragment),this.h()},l(n){e=b(n,"SECTION",{class:!0});var r=L(e);X(t.$$.fragment,r),r.forEach(h),this.h()},h(){g(e,"class","col-span-4")},m(n,r){N(n,e,r),G(t,e,null),s=!0},p(n,r){const i={};r&32&&(i.availablePackages=n[5]),t.$set(i)},i(n){s||(F(t.$$.fragment,n),s=!0)},o(n){B(t.$$.fragment,n),s=!1},d(n){n&&h(e),J(t)}}}function gr(l){let e,t='<p class="w-4"></p> <p>Name</p> <p>Type</p> <p></p>',s,n,r,i,o,a,c,f,u=l[4].length&&Js(l),d=pe(l[1]),p=[];for(let _=0;_<d.length;_+=1)p[_]=Ws(Ys(l,d,_));const y=_=>B(p[_],1,1,()=>{p[_]=null});o=new ot({props:{icon:ql,size:"md",variant:"success",$$slots:{default:[_r]},$$scope:{ctx:l}}}),o.$on("click",l[7]);let k=l[2]&&Zs(l);return{c(){e=v("div"),e.innerHTML=t,s=P(),u&&u.c(),n=P();for(let _=0;_<p.length;_+=1)p[_].c();r=P(),i=v("div"),Y(o.$$.fragment),a=P(),k&&k.c(),c=me(),this.h()},l(_){e=b(_,"DIV",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-112wk9i"&&(e.innerHTML=t),s=D(_),u&&u.l(_),n=D(_);for(let C=0;C<p.length;C+=1)p[C].l(_);r=D(_),i=b(_,"DIV",{class:!0});var w=L(i);X(o.$$.fragment,w),w.forEach(h),a=D(_),k&&k.l(_),c=me(),this.h()},h(){g(e,"class","contents font-bold text-sm"),g(i,"class","col-start-4 flex justify-end items-center w-full")},m(_,w){N(_,e,w),N(_,s,w),u&&u.m(_,w),N(_,n,w);for(let C=0;C<p.length;C+=1)p[C]&&p[C].m(_,w);N(_,r,w),N(_,i,w),G(o,i,null),N(_,a,w),k&&k.m(_,w),N(_,c,w),f=!0},p(_,w){if(_[4].length?u?u.p(_,w):(u=Js(_),u.c(),u.m(n.parentNode,n)):u&&(u.d(1),u=null),w&11){d=pe(_[1]);let S;for(S=0;S<d.length;S+=1){const A=Ys(_,d,S);p[S]?(p[S].p(A,w),F(p[S],1)):(p[S]=Ws(A),p[S].c(),F(p[S],1),p[S].m(r.parentNode,r))}for(ge(),S=d.length;S<p.length;S+=1)y(S);_e()}const C={};w&16384&&(C.$$scope={dirty:w,ctx:_}),o.$set(C),_[2]?k?(k.p(_,w),w&4&&F(k,1)):(k=Zs(_),k.c(),F(k,1),k.m(c.parentNode,c)):k&&(ge(),B(k,1,1,()=>{k=null}),_e())},i(_){if(!f){for(let w=0;w<d.length;w+=1)F(p[w]);F(o.$$.fragment,_),F(k),f=!0}},o(_){p=p.filter(Boolean);for(let w=0;w<p.length;w+=1)B(p[w]);B(o.$$.fragment,_),B(k),f=!1},d(_){_&&(h(e),h(s),h(n),h(r),h(i),h(a),h(c)),u&&u.d(_),Le(p,_),J(o),k&&k.d(_)}}}function Js(l){let e,t,s="Duplicate Packages found; this could lead to unexpected behavior",n,r,i=pe(l[4]),o=[];for(let a=0;a<i.length;a+=1)o[a]=Xs(Gs(l,i,a));return{c(){e=v("div"),t=v("p"),t.textContent=s,n=P(),r=v("ul");for(let a=0;a<o.length;a+=1)o[a].c();this.h()},l(a){e=b(a,"DIV",{class:!0});var c=L(e);t=b(c,"P",{class:!0,"data-svelte-h":!0}),x(t)!=="svelte-1mupyve"&&(t.textContent=s),n=D(c),r=b(c,"UL",{});var f=L(r);for(let u=0;u<o.length;u+=1)o[u].l(f);f.forEach(h),c.forEach(h),this.h()},h(){g(t,"class","text-red-500 text-bold text-sm"),g(e,"class","col-span-4")},m(a,c){N(a,e,c),m(e,t),m(e,n),m(e,r);for(let f=0;f<o.length;f+=1)o[f]&&o[f].m(r,null)},p(a,c){if(c&16){i=pe(a[4]);let f;for(f=0;f<i.length;f+=1){const u=Gs(a,i,f);o[f]?o[f].p(u,c):(o[f]=Xs(u),o[f].c(),o[f].m(r,null))}for(;f<o.length;f+=1)o[f].d(1);o.length=i.length}},d(a){a&&h(e),Le(o,a)}}}function Xs(l){let e,t=l[11]+"",s;return{c(){e=v("li"),s=Z(t)},l(n){e=b(n,"LI",{});var r=L(e);s=Q(r,t),r.forEach(h)},m(n,r){N(n,e,r),m(e,s)},p(n,r){r&16&&t!==(t=n[11]+"")&&he(s,t)},d(n){n&&h(e)}}}function Ws(l){let e,t;return e=new mr({props:{availableSourcePlugins:l[0],source:l[8],sources:l[1],startOpen:l[3]===l[8].name}}),{c(){Y(e.$$.fragment)},l(s){X(e.$$.fragment,s)},m(s,n){G(e,s,n),t=!0},p(s,n){const r={};n&1&&(r.availableSourcePlugins=s[0]),n&2&&(r.source=s[8]),n&2&&(r.sources=s[1]),n&10&&(r.startOpen=s[3]===s[8].name),e.$set(r)},i(s){t||(F(e.$$.fragment,s),t=!0)},o(s){B(e.$$.fragment,s),t=!1},d(s){J(e,s)}}}function _r(l){let e;return{c(){e=Z("Add new source")},l(t){e=Q(t,"Add new source")},m(t,s){N(t,e,s)},d(t){t&&h(e)}}}function Zs(l){let e,t;return e=new Vn({props:{availablePackages:l[5],existingSources:l[1]}}),e.$on("newSource",l[6]),{c(){Y(e.$$.fragment)},l(s){X(e.$$.fragment,s)},m(s,n){G(e,s,n),t=!0},p(s,n){const r={};n&32&&(r.availablePackages=s[5]),n&2&&(r.existingSources=s[1]),e.$set(r)},i(s){t||(F(e.$$.fragment,s),t=!0)},o(s){B(e.$$.fragment,s),t=!1},d(s){J(e,s)}}}function vr(l){let e,t,s,n="Data Sources",r,i,o,a,c,f,u,d,p=`Learn more about | |
<a class="text-blue-600 no-underline" href="https://docs.evidence.dev/core-concepts/data-sources/">Configuring Data Sources →</a>`,y;const k=[gr,pr],_=[];function w(C,S){return C[1].length>0?0:1}return o=w(l),a=_[o]=k[o](l),{c(){e=v("section"),t=v("div"),s=v("h2"),s.textContent=n,r=P(),i=v("div"),a.c(),c=P(),f=v("div"),u=P(),d=v("div"),d.innerHTML=p,this.h()},l(C){e=b(C,"SECTION",{class:!0});var S=L(e);t=b(S,"DIV",{class:!0});var A=L(t);s=b(A,"H2",{class:!0,"data-svelte-h":!0}),x(s)!=="svelte-timue1"&&(s.textContent=n),r=D(A),i=b(A,"DIV",{class:!0});var j=L(i);a.l(j),j.forEach(h),c=D(A),f=b(A,"DIV",{}),L(f).forEach(h),A.forEach(h),u=D(S),d=b(S,"DIV",{class:!0,"data-svelte-h":!0}),x(d)!=="svelte-ple3bn"&&(d.innerHTML=p),S.forEach(h),this.h()},h(){g(s,"class","font-semibold text-lg mb-2"),g(i,"class","grid grid-rows-auto source-config-table gap-x-2 gap-y-2 justify-center items-center w-full svelte-2j5e0k"),g(t,"class","p-3 rounded-t w-full border-gray-200 border-t border-l border-r"),g(d,"class","p-4 rounded-b w-full bg-gray-100 text-sm border-[1px] border-gray-200"),g(e,"class","w-full mt-8")},m(C,S){N(C,e,S),m(e,t),m(t,s),m(t,r),m(t,i),_[o].m(i,null),m(t,c),m(t,f),m(e,u),m(e,d),y=!0},p(C,[S]){let A=o;o=w(C),o===A?_[o].p(C,S):(ge(),B(_[A],1,1,()=>{_[A]=null}),_e(),a=_[o],a?a.p(C,S):(a=_[o]=k[o](C),a.c()),F(a,1),a.m(i,null))},i(C){y||(F(a),y=!0)},o(C){B(a),y=!1},d(C){C&&h(e),_[o].d()}}}function br(l,e,t){let s,{availableSourcePlugins:n={}}=e,{sources:r=[]}=e,i=r.length===0,o;function a(u){const{newSourceType:d,newSourceName:p}=u.detail;if(!d)return;const y=n[d];r.push({name:p,type:d,package:y.package.package.name,options:{}}),t(3,o=p),t(2,i=!1)}let c=[];const f=()=>t(2,i=!i);return l.$$set=u=>{"availableSourcePlugins"in u&&t(0,n=u.availableSourcePlugins),"sources"in u&&t(1,r=u.sources)},l.$$.update=()=>{if(l.$$.dirty&1&&t(5,s=Object.values(n).reduce((u,d)=>{const p=d.package.package;return u[p.name]||(u[p.name]=d),u},{})),l.$$.dirty&2&&r.length){const u=r.reduce((d,p)=>(d.sourceNames.has(p.name)&&d.duplicateNames.add(p.name),d.sourceNames.add(p.name),d),{sourceNames:new Set,duplicateNames:new Set});t(4,c=Array.from(u.duplicateNames))}},[n,r,i,o,c,s,a,f]}class yr extends ye{constructor(e){super(),ke(this,e,br,vr,be,{availableSourcePlugins:0,sources:1})}}function kr(l){let e,t="Deploying to Evidence Cloud",s,n,r="Evidence Cloud allows you to:",i,o,a,c,f,u="<",d,p,y=">",k,_,w,C,S="Authenticate users",A,j,T="Schedule updates to your data",q,$,M="Re-build when you push changes to your project",O,E,V='<button type="button" class="svelte-1316edx"><a class="text-white no-underline hover:no-underline" target="_blank" rel="noreferrer" href="https://evidence.app">Sign Up</a></button>';return{c(){e=v("h2"),e.textContent=t,s=P(),n=v("p"),n.textContent=r,i=P(),o=v("ul"),a=v("li"),c=Z("Host your project at "),f=v("code"),d=Z(u),p=Z("project-name"),k=Z(y),_=Z(".evidence.app"),w=P(),C=v("li"),C.textContent=S,A=P(),j=v("li"),j.textContent=T,q=P(),$=v("li"),$.textContent=M,O=P(),E=v("div"),E.innerHTML=V,this.h()},l(H){e=b(H,"H2",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-18vqxr8"&&(e.textContent=t),s=D(H),n=b(H,"P",{class:!0,"data-svelte-h":!0}),x(n)!=="svelte-1p7rrak"&&(n.textContent=r),i=D(H),o=b(H,"UL",{class:!0});var I=L(o);a=b(I,"LI",{class:!0});var R=L(a);c=Q(R,"Host your project at "),f=b(R,"CODE",{});var U=L(f);d=Q(U,u),p=Q(U,"project-name"),k=Q(U,y),_=Q(U,".evidence.app"),U.forEach(h),R.forEach(h),w=D(I),C=b(I,"LI",{class:!0,"data-svelte-h":!0}),x(C)!=="svelte-19f0lwd"&&(C.textContent=S),A=D(I),j=b(I,"LI",{class:!0,"data-svelte-h":!0}),x(j)!=="svelte-lawnhl"&&(j.textContent=T),q=D(I),$=b(I,"LI",{class:!0,"data-svelte-h":!0}),x($)!=="svelte-1q65sxp"&&($.textContent=M),I.forEach(h),O=D(H),E=b(H,"DIV",{class:!0,"data-svelte-h":!0}),x(E)!=="svelte-1ki3osy"&&(E.innerHTML=V),this.h()},h(){g(e,"class","svelte-1316edx"),g(n,"class","svelte-1316edx"),g(a,"class","svelte-1316edx"),g(C,"class","svelte-1316edx"),g(j,"class","svelte-1316edx"),g($,"class","svelte-1316edx"),g(o,"class","svelte-1316edx"),g(E,"class","new-format-buttons my-3 svelte-1316edx")},m(H,I){N(H,e,I),N(H,s,I),N(H,n,I),N(H,i,I),N(H,o,I),m(o,a),m(a,c),m(a,f),m(f,d),m(f,p),m(f,k),m(f,_),m(o,w),m(o,C),m(o,A),m(o,j),m(o,q),m(o,$),N(H,O,I),N(H,E,I)},p:ee,i:ee,o:ee,d(H){H&&(h(e),h(s),h(n),h(i),h(o),h(O),h(E))}}}class wr extends ye{constructor(e){super(),ke(this,e,null,kr,be,{})}}function Cr(l){let e,t,s=(l[1]?"····················":l[0])+"",n;return{c(){e=v("span"),t=new $n(!1),this.h()},l(r){e=b(r,"SPAN",{});var i=L(e);t=En(i,!1),i.forEach(h),this.h()},h(){t.a=null,lt(e,"text-xs",l[2])},m(r,i){N(r,e,i),t.m(s,e)},p(r,i){i&3&&s!==(s=(r[1]?"····················":r[0])+"")&&t.p(s),i&4&<(e,"text-xs",r[2])},i(r){r&&(n||Ne(()=>{n=vt(e,bt,{}),n.start()}))},o:ee,d(r){r&&h(e)}}}function $r(l){let e,t="Copied",s;return{c(){e=v("span"),e.textContent=t},l(n){e=b(n,"SPAN",{"data-svelte-h":!0}),x(e)!=="svelte-18eylsc"&&(e.textContent=t)},m(n,r){N(n,e,r)},p:ee,i(n){n&&(s||Ne(()=>{s=vt(e,bt,{}),s.start()}))},o:ee,d(n){n&&h(e)}}}function Er(l){let e,t;return e=new Dn({props:{class:"bx--snippet__icon"}}),{c(){Y(e.$$.fragment)},l(s){X(e.$$.fragment,s)},m(s,n){G(e,s,n),t=!0},i(s){t||(F(e.$$.fragment,s),t=!0)},o(s){B(e.$$.fragment,s),t=!1},d(s){J(e,s)}}}function Tr(l){let e,t;return e=new Dn({props:{class:"bx--snippet__icon",color:"var(--green-900)"}}),{c(){Y(e.$$.fragment)},l(s){X(e.$$.fragment,s)},m(s,n){G(e,s,n),t=!0},i(s){t||(F(e.$$.fragment,s),t=!0)},o(s){B(e.$$.fragment,s),t=!1},d(s){J(e,s)}}}function Sr(l){let e,t,s,n,r,i,o,a,c;function f(_,w){return _[4]?$r:Cr}let u=f(l),d=u(l);const p=[Tr,Er],y=[];function k(_,w){return _[4]?0:1}return r=k(l),i=y[r]=p[r](l),{c(){e=v("button"),t=v("span"),d.c(),s=P(),n=v("div"),i.c(),this.h()},l(_){e=b(_,"BUTTON",{type:!0,class:!0});var w=L(e);t=b(w,"SPAN",{class:!0});var C=L(t);d.l(C),C.forEach(h),s=D(w),n=b(w,"DIV",{class:!0});var S=L(n);i.l(S),S.forEach(h),w.forEach(h),this.h()},h(){g(t,"class","var-value svelte-1bkhr6m"),g(n,"class","w-4 h-4"),g(e,"type","button"),g(e,"class","container h-6 w-6 svelte-1bkhr6m"),lt(e,"copied",l[4])},m(_,w){N(_,e,w),m(e,t),d.m(t,null),m(e,s),m(e,n),y[r].m(n,null),o=!0,a||(c=ce(e,"click",l[5]),a=!0)},p(_,[w]){u===(u=f(_))&&d?d.p(_,w):(d.d(1),d=u(_),d&&(d.c(),F(d,1),d.m(t,null)));let C=r;r=k(_),r!==C&&(ge(),B(y[C],1,1,()=>{y[C]=null}),_e(),i=y[r],i||(i=y[r]=p[r](_),i.c()),F(i,1),i.m(n,null)),(!o||w&16)&<(e,"copied",_[4])},i(_){o||(F(d),F(i),o=!0)},o(_){B(i),o=!1},d(_){_&&h(e),d.d(),y[r].d(),a=!1,c()}}}function Ir(l,e,t){let{text:s=void 0}=e,{hideText:n=!1}=e,{small:r=!1}=e,i=!1;const o=function(){t(4,i=!1)};let{copy:a=async f=>{try{i||(await navigator.clipboard.writeText(f),t(4,i=!0),setTimeout(o,2e3))}catch{}}}=e;const c=()=>{s!==void 0&&a(s)};return l.$$set=f=>{"text"in f&&t(0,s=f.text),"hideText"in f&&t(1,n=f.hideText),"small"in f&&t(2,r=f.small),"copy"in f&&t(3,a=f.copy)},[s,n,r,a,i,c]}class Ue extends ye{constructor(e){super(),ke(this,e,Ir,Sr,be,{text:0,hideText:1,small:2,copy:3})}}function Nr(l){let e,t="Deploying to Netlify",s,n,r='<li><a href="https://app.netlify.com/start" target="_blank" rel="noreferrer" class="svelte-xfr0fu">Start a new netlify project →</a></li> <li>Choose the repo containing this project</li> <li>Update the <code>site settings</code> to match those below</li>',i,o,a="Basic Build Settings",c,f,u,d="Build command",p,y,k,_,w,C,S="Publish directory",A,j,T,q,$,M="Advanced Build Settings",O,E,V=`Click 'Show Advanced' add your | |
<a href="https://docs.netlify.com/configure-builds/environment-variables/" target="_blank" rel="noreferrer" class="svelte-xfr0fu">environment variables.</a>`,H;return k=new Ue({props:{text:"npm run sources && npm run build"}}),T=new Ue({props:{text:"build/"}}),{c(){e=v("h2"),e.textContent=t,s=P(),n=v("ol"),n.innerHTML=r,i=P(),o=v("div"),o.textContent=a,c=P(),f=v("div"),u=v("span"),u.textContent=d,p=P(),y=v("div"),Y(k.$$.fragment),_=P(),w=v("div"),C=v("span"),C.textContent=S,A=P(),j=v("div"),Y(T.$$.fragment),q=P(),$=v("div"),$.textContent=M,O=P(),E=v("p"),E.innerHTML=V,this.h()},l(I){e=b(I,"H2",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-a8hbx"&&(e.textContent=t),s=D(I),n=b(I,"OL",{"data-svelte-h":!0}),x(n)!=="svelte-1krc6dk"&&(n.innerHTML=r),i=D(I),o=b(I,"DIV",{class:!0,"data-svelte-h":!0}),x(o)!=="svelte-dxwvxl"&&(o.textContent=a),c=D(I),f=b(I,"DIV",{class:!0});var R=L(f);u=b(R,"SPAN",{class:!0,"data-svelte-h":!0}),x(u)!=="svelte-1fx13w6"&&(u.textContent=d),p=D(R),y=b(R,"DIV",{class:!0});var U=L(y);X(k.$$.fragment,U),U.forEach(h),R.forEach(h),_=D(I),w=b(I,"DIV",{class:!0});var W=L(w);C=b(W,"SPAN",{class:!0,"data-svelte-h":!0}),x(C)!=="svelte-pc7ih"&&(C.textContent=S),A=D(W),j=b(W,"DIV",{class:!0});var K=L(j);X(T.$$.fragment,K),K.forEach(h),W.forEach(h),q=D(I),$=b(I,"DIV",{class:!0,"data-svelte-h":!0}),x($)!=="svelte-1rcjgh9"&&($.textContent=M),O=D(I),E=b(I,"P",{class:!0,"data-svelte-h":!0}),x(E)!=="svelte-9upacm"&&(E.innerHTML=V),this.h()},h(){g(e,"class","svelte-xfr0fu"),g(o,"class","separator svelte-xfr0fu"),g(u,"class","setting svelte-xfr0fu"),g(y,"class","setting-value svelte-xfr0fu"),g(f,"class","setting-row svelte-xfr0fu"),g(C,"class","setting svelte-xfr0fu"),g(j,"class","setting-value svelte-xfr0fu"),g(w,"class","setting-row svelte-xfr0fu"),g($,"class","separator svelte-xfr0fu"),g(E,"class","svelte-xfr0fu")},m(I,R){N(I,e,R),N(I,s,R),N(I,n,R),N(I,i,R),N(I,o,R),N(I,c,R),N(I,f,R),m(f,u),m(f,p),m(f,y),G(k,y,null),N(I,_,R),N(I,w,R),m(w,C),m(w,A),m(w,j),G(T,j,null),N(I,q,R),N(I,$,R),N(I,O,R),N(I,E,R),H=!0},i(I){H||(F(k.$$.fragment,I),F(T.$$.fragment,I),H=!0)},o(I){B(k.$$.fragment,I),B(T.$$.fragment,I),H=!1},d(I){I&&(h(e),h(s),h(n),h(i),h(o),h(c),h(f),h(_),h(w),h(q),h($),h(O),h(E)),J(k),J(T)}}}function Ar(l){let e,t="You'll need to set up a git repo before deploying to netlify.";return{c(){e=v("p"),e.textContent=t,this.h()},l(s){e=b(s,"P",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-drfbb5"&&(e.textContent=t),this.h()},h(){g(e,"class","svelte-xfr0fu")},m(s,n){N(s,e,n)},i:ee,o:ee,d(s){s&&h(e)}}}function Or(l){let e,t="You'll need to connect to at least one datasource before deploying to netlify.";return{c(){e=v("p"),e.textContent=t,this.h()},l(s){e=b(s,"P",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-1wqvgt"&&(e.textContent=t),this.h()},h(){g(e,"class","svelte-xfr0fu")},m(s,n){N(s,e,n)},i:ee,o:ee,d(s){s&&h(e)}}}function Lr(l){let e,t,s,n;const r=[Or,Ar,Nr],i=[];function o(a,c){return a[1].length?a[0].gitRepo?2:1:0}return e=o(l),t=i[e]=r[e](l),{c(){t.c(),s=me()},l(a){t.l(a),s=me()},m(a,c){i[e].m(a,c),N(a,s,c),n=!0},p(a,[c]){let f=e;e=o(a),e!==f&&(ge(),B(i[f],1,1,()=>{i[f]=null}),_e(),t=i[e],t||(t=i[e]=r[e](a),t.c()),F(t,1),t.m(s.parentNode,s))},i(a){n||(F(t),n=!0)},o(a){B(t),n=!1},d(a){a&&h(s),i[e].d(a)}}}function Pr(l,e,t){let{settings:s}=e,{datasourceSettings:n}=e;return l.$$set=r=>{"settings"in r&&t(0,s=r.settings),"datasourceSettings"in r&&t(1,n=r.datasourceSettings)},[s,n]}class Dr extends ye{constructor(e){super(),ke(this,e,Pr,Lr,be,{settings:0,datasourceSettings:1})}}function jr(l){let e,t="Deploying to Vercel",s,n,r='<li><a href="https://vercel.com/new" target="_blank" rel="noreferrer" class="svelte-1d62oiw">Start a new Vercel project →</a></li> <li>Choose the repo containing this project</li> <li>Configure your project to match the settings below</li>',i,o,a="Build and Output Settings",c,f,u,d="Build Command",p,y,k,_,w,C,S="Output Directory",A,j,T,q,$,M,O="Install Command",E,V,H,I;return k=new Ue({props:{text:"npm run sources && npm run build"}}),T=new Ue({props:{text:"build/"}}),H=new Ue({props:{text:"npm install"}}),{c(){e=v("h2"),e.textContent=t,s=P(),n=v("ol"),n.innerHTML=r,i=P(),o=v("div"),o.textContent=a,c=P(),f=v("div"),u=v("span"),u.textContent=d,p=P(),y=v("div"),Y(k.$$.fragment),_=P(),w=v("div"),C=v("span"),C.textContent=S,A=P(),j=v("div"),Y(T.$$.fragment),q=P(),$=v("div"),M=v("span"),M.textContent=O,E=P(),V=v("div"),Y(H.$$.fragment),this.h()},l(R){e=b(R,"H2",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-ly0hw5"&&(e.textContent=t),s=D(R),n=b(R,"OL",{"data-svelte-h":!0}),x(n)!=="svelte-13j0dqb"&&(n.innerHTML=r),i=D(R),o=b(R,"DIV",{class:!0,"data-svelte-h":!0}),x(o)!=="svelte-fbi9z5"&&(o.textContent=a),c=D(R),f=b(R,"DIV",{class:!0});var U=L(f);u=b(U,"SPAN",{class:!0,"data-svelte-h":!0}),x(u)!=="svelte-2ttm1i"&&(u.textContent=d),p=D(U),y=b(U,"DIV",{class:!0});var W=L(y);X(k.$$.fragment,W),W.forEach(h),U.forEach(h),_=D(R),w=b(R,"DIV",{class:!0});var K=L(w);C=b(K,"SPAN",{class:!0,"data-svelte-h":!0}),x(C)!=="svelte-wq73qv"&&(C.textContent=S),A=D(K),j=b(K,"DIV",{class:!0});var z=L(j);X(T.$$.fragment,z),z.forEach(h),K.forEach(h),q=D(R),$=b(R,"DIV",{class:!0});var se=L($);M=b(se,"SPAN",{class:!0,"data-svelte-h":!0}),x(M)!=="svelte-xn7157"&&(M.textContent=O),E=D(se),V=b(se,"DIV",{class:!0});var ne=L(V);X(H.$$.fragment,ne),ne.forEach(h),se.forEach(h),this.h()},h(){g(e,"class","svelte-1d62oiw"),g(o,"class","separator svelte-1d62oiw"),g(u,"class","setting svelte-1d62oiw"),g(y,"class","setting-value svelte-1d62oiw"),g(f,"class","setting-row svelte-1d62oiw"),g(C,"class","setting svelte-1d62oiw"),g(j,"class","setting-value svelte-1d62oiw"),g(w,"class","setting-row svelte-1d62oiw"),g(M,"class","setting svelte-1d62oiw"),g(V,"class","setting-value svelte-1d62oiw"),g($,"class","setting-row svelte-1d62oiw")},m(R,U){N(R,e,U),N(R,s,U),N(R,n,U),N(R,i,U),N(R,o,U),N(R,c,U),N(R,f,U),m(f,u),m(f,p),m(f,y),G(k,y,null),N(R,_,U),N(R,w,U),m(w,C),m(w,A),m(w,j),G(T,j,null),N(R,q,U),N(R,$,U),m($,M),m($,E),m($,V),G(H,V,null),I=!0},i(R){I||(F(k.$$.fragment,R),F(T.$$.fragment,R),F(H.$$.fragment,R),I=!0)},o(R){B(k.$$.fragment,R),B(T.$$.fragment,R),B(H.$$.fragment,R),I=!1},d(R){R&&(h(e),h(s),h(n),h(i),h(o),h(c),h(f),h(_),h(w),h(q),h($)),J(k),J(T),J(H)}}}function Mr(l){let e,t="You'll need to set up a git repo before deploying to Vercel.";return{c(){e=v("p"),e.textContent=t,this.h()},l(s){e=b(s,"P",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-1urjqdt"&&(e.textContent=t),this.h()},h(){g(e,"class","svelte-1d62oiw")},m(s,n){N(s,e,n)},i:ee,o:ee,d(s){s&&h(e)}}}function Fr(l){let e,t="You'll need to connect to at least one datasource before deploying to Vercel.";return{c(){e=v("p"),e.textContent=t,this.h()},l(s){e=b(s,"P",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-1evai4d"&&(e.textContent=t),this.h()},h(){g(e,"class","svelte-1d62oiw")},m(s,n){N(s,e,n)},i:ee,o:ee,d(s){s&&h(e)}}}function Vr(l){let e,t,s,n;const r=[Fr,Mr,jr],i=[];function o(a,c){return a[1].length?a[0].gitRepo?2:1:0}return e=o(l),t=i[e]=r[e](l),{c(){t.c(),s=me()},l(a){t.l(a),s=me()},m(a,c){i[e].m(a,c),N(a,s,c),n=!0},p(a,[c]){let f=e;e=o(a),e!==f&&(ge(),B(i[f],1,1,()=>{i[f]=null}),_e(),t=i[e],t||(t=i[e]=r[e](a),t.c()),F(t,1),t.m(s.parentNode,s))},i(a){n||(F(t),n=!0)},o(a){B(t),n=!1},d(a){a&&h(s),i[e].d(a)}}}function Br(l,e,t){let{settings:s}=e,{datasourceSettings:n}=e;return l.$$set=r=>{"settings"in r&&t(0,s=r.settings),"datasourceSettings"in r&&t(1,n=r.datasourceSettings)},[s,n]}class Hr extends ye{constructor(e){super(),ke(this,e,Br,Vr,be,{settings:0,datasourceSettings:1})}}function qr(l){let e,t="Deploying your Project",s,n,r="In production, Evidence functions like a static site generator:",i,o,a=`<li>Running <code>npm run build</code> will build a static site in the <code>/build</code> directory | |
using the credentials in the datasource connections panel, which you can host in a variety of environments</li>`,c,f,u="Building Your Project",d,p,y,k="Build command",_,w,C,S,A,j,T="Publish directory",q,$,M,O;return C=new Ue({props:{text:"npm run sources && npm run build"}}),M=new Ue({props:{text:"build/"}}),{c(){e=v("h2"),e.textContent=t,s=P(),n=v("p"),n.textContent=r,i=P(),o=v("ol"),o.innerHTML=a,c=P(),f=v("div"),f.textContent=u,d=P(),p=v("div"),y=v("span"),y.textContent=k,_=P(),w=v("div"),Y(C.$$.fragment),S=P(),A=v("div"),j=v("span"),j.textContent=T,q=P(),$=v("div"),Y(M.$$.fragment),this.h()},l(E){e=b(E,"H2",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-1bt7a83"&&(e.textContent=t),s=D(E),n=b(E,"P",{class:!0,"data-svelte-h":!0}),x(n)!=="svelte-1gcreas"&&(n.textContent=r),i=D(E),o=b(E,"OL",{"data-svelte-h":!0}),x(o)!=="svelte-1dvvhh6"&&(o.innerHTML=a),c=D(E),f=b(E,"DIV",{class:!0,"data-svelte-h":!0}),x(f)!=="svelte-1sj8kng"&&(f.textContent=u),d=D(E),p=b(E,"DIV",{class:!0});var V=L(p);y=b(V,"SPAN",{class:!0,"data-svelte-h":!0}),x(y)!=="svelte-1fx13w6"&&(y.textContent=k),_=D(V),w=b(V,"DIV",{class:!0});var H=L(w);X(C.$$.fragment,H),H.forEach(h),V.forEach(h),S=D(E),A=b(E,"DIV",{class:!0});var I=L(A);j=b(I,"SPAN",{class:!0,"data-svelte-h":!0}),x(j)!=="svelte-pc7ih"&&(j.textContent=T),q=D(I),$=b(I,"DIV",{class:!0});var R=L($);X(M.$$.fragment,R),R.forEach(h),I.forEach(h),this.h()},h(){g(e,"class","svelte-8zw4no"),g(n,"class","svelte-8zw4no"),g(f,"class","separator svelte-8zw4no"),g(y,"class","setting svelte-8zw4no"),g(w,"class","setting-value svelte-8zw4no"),g(p,"class","setting-row svelte-8zw4no"),g(j,"class","setting svelte-8zw4no"),g($,"class","setting-value svelte-8zw4no"),g(A,"class","setting-row svelte-8zw4no")},m(E,V){N(E,e,V),N(E,s,V),N(E,n,V),N(E,i,V),N(E,o,V),N(E,c,V),N(E,f,V),N(E,d,V),N(E,p,V),m(p,y),m(p,_),m(p,w),G(C,w,null),N(E,S,V),N(E,A,V),m(A,j),m(A,q),m(A,$),G(M,$,null),O=!0},p:ee,i(E){O||(F(C.$$.fragment,E),F(M.$$.fragment,E),O=!0)},o(E){B(C.$$.fragment,E),B(M.$$.fragment,E),O=!1},d(E){E&&(h(e),h(s),h(n),h(i),h(o),h(c),h(f),h(d),h(p),h(S),h(A)),J(C),J(M)}}}class Rr extends ye{constructor(e){super(),ke(this,e,null,qr,be,{})}}function Qs(l,e,t){const s=l.slice();return s[3]=e[t],s}function en(l,e,t){const s=l.slice();return s[6]=e[t][0],s[7]=e[t][1],s}function Ur(l){let e,t;return e=new Ul({props:{$$slots:{default:[Gr]},$$scope:{ctx:l}}}),{c(){Y(e.$$.fragment)},l(s){X(e.$$.fragment,s)},m(s,n){G(e,s,n),t=!0},p(s,n){const r={};n&1025&&(r.$$scope={dirty:n,ctx:s}),e.$set(r)},i(s){t||(F(e.$$.fragment,s),t=!0)},o(s){B(e.$$.fragment,s),t=!1},d(s){J(e,s)}}}function xr(l){let e,t,s,n=`GCloud authentication isn't supported in cloud deployments, as it needs access to a browser. Set | |
up one of the other authentication options for a deployment.`;return{c(){e=v("hr"),t=P(),s=v("p"),s.textContent=n},l(r){e=b(r,"HR",{}),t=D(r),s=b(r,"P",{"data-svelte-h":!0}),x(s)!=="svelte-x2laf0"&&(s.textContent=n)},m(r,i){N(r,e,i),N(r,t,i),N(r,s,i)},p:ee,i:ee,o:ee,d(r){r&&(h(e),h(t),h(s))}}}function Kr(l){let e,t,s,n=`External browser authentication isn't supported in cloud deployments, as it needs access to a | |
browser. Set up one of the other authentication options for a deployment.`;return{c(){e=v("hr"),t=P(),s=v("p"),s.textContent=n},l(r){e=b(r,"HR",{}),t=D(r),s=b(r,"P",{"data-svelte-h":!0}),x(s)!=="svelte-1m8xj5p"&&(s.textContent=n)},m(r,i){N(r,e,i),N(r,t,i),N(r,s,i)},p:ee,i:ee,o:ee,d(r){r&&(h(e),h(t),h(s))}}}function zr(l){let e;return{c(){e=Z("Copy All")},l(t){e=Q(t,"Copy All")},m(t,s){N(t,e,s)},d(t){t&&h(e)}}}function tn(l){let e,t,s,n,r,i,o,a;return s=new Ue({props:{text:l[6]}}),i=new Ue({props:{text:l[7],hideText:!0}}),{c(){e=v("div"),t=v("div"),Y(s.$$.fragment),n=P(),r=v("div"),Y(i.$$.fragment),o=P(),this.h()},l(c){e=b(c,"DIV",{class:!0});var f=L(e);t=b(f,"DIV",{class:!0});var u=L(t);X(s.$$.fragment,u),u.forEach(h),n=D(f),r=b(f,"DIV",{class:!0});var d=L(r);X(i.$$.fragment,d),d.forEach(h),o=D(f),f.forEach(h),this.h()},h(){g(t,"class","var-name svelte-172eppj"),g(r,"class","var-value svelte-172eppj"),g(e,"class","environment-variable svelte-172eppj")},m(c,f){N(c,e,f),m(e,t),G(s,t,null),m(e,n),m(e,r),G(i,r,null),m(e,o),a=!0},p(c,f){const u={};f&1&&(u.text=c[6]),s.$set(u);const d={};f&1&&(d.text=c[7]),i.$set(d)},i(c){a||(F(s.$$.fragment,c),F(i.$$.fragment,c),a=!0)},o(c){B(s.$$.fragment,c),B(i.$$.fragment,c),a=!1},d(c){c&&h(e),J(s),J(i)}}}function sn(l){let e,t,s=pe(Object.entries(l[3].environmentVariables)),n=[];for(let i=0;i<s.length;i+=1)n[i]=tn(en(l,s,i));const r=i=>B(n[i],1,1,()=>{n[i]=null});return{c(){for(let i=0;i<n.length;i+=1)n[i].c();e=me()},l(i){for(let o=0;o<n.length;o+=1)n[o].l(i);e=me()},m(i,o){for(let a=0;a<n.length;a+=1)n[a]&&n[a].m(i,o);N(i,e,o),t=!0},p(i,o){if(o&1){s=pe(Object.entries(i[3].environmentVariables));let a;for(a=0;a<s.length;a+=1){const c=en(i,s,a);n[a]?(n[a].p(c,o),F(n[a],1)):(n[a]=tn(c),n[a].c(),F(n[a],1),n[a].m(e.parentNode,e))}for(ge(),a=s.length;a<n.length;a+=1)r(a);_e()}},i(i){if(!t){for(let o=0;o<s.length;o+=1)F(n[o]);t=!0}},o(i){n=n.filter(Boolean);for(let o=0;o<n.length;o+=1)B(n[o]);t=!1},d(i){i&&h(e),Le(n,i)}}}function Yr(l){let e,t,s,n,r='<span class="title svelte-172eppj">Key</span><span class="title svelte-172eppj">Value</span>',i,o,a;t=new ot({props:{type:"button",outline:!0,icon:Rl,size:"sm",$$slots:{default:[zr]},$$scope:{ctx:l}}}),t.$on("click",l[2]);let c=pe(l[0]),f=[];for(let d=0;d<c.length;d+=1)f[d]=sn(Qs(l,c,d));const u=d=>B(f[d],1,1,()=>{f[d]=null});return{c(){e=v("div"),Y(t.$$.fragment),s=P(),n=v("div"),n.innerHTML=r,i=P();for(let d=0;d<f.length;d+=1)f[d].c();o=me(),this.h()},l(d){e=b(d,"DIV",{class:!0});var p=L(e);X(t.$$.fragment,p),p.forEach(h),s=D(d),n=b(d,"DIV",{class:!0,"data-svelte-h":!0}),x(n)!=="svelte-1bimtv3"&&(n.innerHTML=r),i=D(d);for(let y=0;y<f.length;y+=1)f[y].l(d);o=me(),this.h()},h(){g(e,"class","w-full flex justify-end items-center my-1 mb-2"),g(n,"class","titles svelte-172eppj")},m(d,p){N(d,e,p),G(t,e,null),N(d,s,p),N(d,n,p),N(d,i,p);for(let y=0;y<f.length;y+=1)f[y]&&f[y].m(d,p);N(d,o,p),a=!0},p(d,p){const y={};if(p&1024&&(y.$$scope={dirty:p,ctx:d}),t.$set(y),p&1){c=pe(d[0]);let k;for(k=0;k<c.length;k+=1){const _=Qs(d,c,k);f[k]?(f[k].p(_,p),F(f[k],1)):(f[k]=sn(_),f[k].c(),F(f[k],1),f[k].m(o.parentNode,o))}for(ge(),k=c.length;k<f.length;k+=1)u(k);_e()}},i(d){if(!a){F(t.$$.fragment,d);for(let p=0;p<c.length;p+=1)F(f[p]);a=!0}},o(d){B(t.$$.fragment,d),f=f.filter(Boolean);for(let p=0;p<f.length;p+=1)B(f[p]);a=!1},d(d){d&&(h(e),h(s),h(n),h(i),h(o)),J(t),Le(f,d)}}}function Gr(l){let e,t;return e=new xl({props:{title:"All Environment Variables",$$slots:{default:[Yr]},$$scope:{ctx:l}}}),{c(){Y(e.$$.fragment)},l(s){X(e.$$.fragment,s)},m(s,n){G(e,s,n),t=!0},p(s,n){const r={};n&1025&&(r.$$scope={dirty:n,ctx:s}),e.$set(r)},i(s){t||(F(e.$$.fragment,s),t=!0)},o(s){B(e.$$.fragment,s),t=!1},d(s){J(e,s)}}}function Jr(l){let e,t=`To use different data environments in production vs development, | |
<a class="docs-link svelte-172eppj" href="https://docs.evidence.dev/deployment/environments">use different environment variable values.</a>`,s,n,r,i,o;const a=[Kr,xr,Ur],c=[];function f(u,d){return u[1].authenticator==="externalbrowser"?0:u[1].authenticator==="gcloud-cli"?1:2}return n=f(l),r=c[n]=a[n](l),{c(){e=v("p"),e.innerHTML=t,s=P(),r.c(),i=me()},l(u){e=b(u,"P",{"data-svelte-h":!0}),x(e)!=="svelte-m9w29g"&&(e.innerHTML=t),s=D(u),r.l(u),i=me()},m(u,d){N(u,e,d),N(u,s,d),c[n].m(u,d),N(u,i,d),o=!0},p(u,[d]){r.p(u,d)},i(u){o||(F(r),o=!0)},o(u){B(r),o=!1},d(u){u&&(h(e),h(s),h(i)),c[n].d(u)}}}function Xr(l,e,t){let{datasourceSettings:s}=e,n={};function r(){const i=s.reduce((o,a)=>[o,Object.entries(a.environmentVariables).map(([c,f])=>`${c}="${f.replace(/\\n/g,` | |
`)}"`).join(` | |
`)].join(` | |
`),"");navigator.clipboard.writeText(i),Il.add({title:"",status:"success",message:"Copied environment variables to clipboard"})}return l.$$set=i=>{"datasourceSettings"in i&&t(0,s=i.datasourceSettings)},[s,n,r]}class Wr extends ye{constructor(e){super(),ke(this,e,Xr,Jr,be,{datasourceSettings:0})}}function nn(l,e,t){const s=l.slice();return s[5]=e[t],s}function ln(l){let e,t=l[5].name+"",s,n;return{c(){e=v("option"),s=Z(t),n=P(),this.h()},l(r){e=b(r,"OPTION",{});var i=L(e);s=Q(i,t),n=D(i),i.forEach(h),this.h()},h(){e.__value=l[5],ue(e,e.__value)},m(r,i){N(r,e,i),m(e,s),m(e,n)},p:ee,d(r){r&&h(e)}}}function rn(l){let e,t,s,n;var r=l[2].formComponent;function i(o,a){return{props:{settings:o[0],datasourceSettings:o[1]}}}return r&&(t=ps(r,i(l))),{c(){e=v("div"),t&&Y(t.$$.fragment),this.h()},l(o){e=b(o,"DIV",{class:!0});var a=L(e);t&&X(t.$$.fragment,a),a.forEach(h),this.h()},h(){g(e,"class","panel svelte-1kcncuj")},m(o,a){N(o,e,a),t&&G(t,e,null),n=!0},p(o,a){if(a&4&&r!==(r=o[2].formComponent)){if(t){ge();const c=t;B(c.$$.fragment,1,0,()=>{J(c,1)}),_e()}r?(t=ps(r,i(o)),Y(t.$$.fragment),F(t.$$.fragment,1),G(t,e,null)):t=null}else if(r){const c={};a&1&&(c.settings=o[0]),a&2&&(c.datasourceSettings=o[1]),t.$set(c)}},i(o){n||(t&&F(t.$$.fragment,o),o&&Ne(()=>{n&&(s||(s=De(e,He,{},!0)),s.run(1))}),n=!0)},o(o){t&&B(t.$$.fragment,o),o&&(s||(s=De(e,He,{},!1)),s.run(0)),n=!1},d(o){o&&h(e),t&&J(t),o&&s&&s.end()}}}function Zr(l){let e,t,s,n,r="Deployment",i,o,a=`Evidence projects can be deployed to a variety of cloud environments. The easiest way to | |
deploy your project is with <b>Evidence Cloud</b>.`,c,f,u="Environment Variables",d,p,y,k,_,w="Deployment Environment",C,S,A,j,T,q='<span>Learn more about <a class="docs-link svelte-1kcncuj" target="_blank" rel="noreferrer" href="https://docs.evidence.dev/deployment/overview">Deploying your Project →</a></span>',$,M,O;y=new Wr({props:{datasourceSettings:l[1]}});let E=pe(l[3]),V=[];for(let I=0;I<E.length;I+=1)V[I]=ln(nn(l,E,I));let H=l[2].formComponent&&rn(l);return{c(){e=v("form"),t=v("div"),s=v("div"),n=v("h2"),n.textContent=r,i=P(),o=v("p"),o.innerHTML=a,c=P(),f=v("h3"),f.textContent=u,d=P(),p=v("div"),Y(y.$$.fragment),k=P(),_=v("h3"),_.textContent=w,C=P(),S=v("select");for(let I=0;I<V.length;I+=1)V[I].c();A=P(),H&&H.c(),j=P(),T=v("footer"),T.innerHTML=q,this.h()},l(I){e=b(I,"FORM",{id:!0,class:!0});var R=L(e);t=b(R,"DIV",{class:!0});var U=L(t);s=b(U,"DIV",{class:!0});var W=L(s);n=b(W,"H2",{class:!0,"data-svelte-h":!0}),x(n)!=="svelte-ijr0uh"&&(n.textContent=r),i=D(W),o=b(W,"P",{class:!0,"data-svelte-h":!0}),x(o)!=="svelte-cdzzhm"&&(o.innerHTML=a),c=D(W),f=b(W,"H3",{class:!0,"data-svelte-h":!0}),x(f)!=="svelte-1qu7z5y"&&(f.textContent=u),d=D(W),p=b(W,"DIV",{});var K=L(p);X(y.$$.fragment,K),K.forEach(h),k=D(W),_=b(W,"H3",{class:!0,"data-svelte-h":!0}),x(_)!=="svelte-podbwu"&&(_.textContent=w),C=D(W),S=b(W,"SELECT",{class:!0});var z=L(S);for(let se=0;se<V.length;se+=1)V[se].l(z);z.forEach(h),W.forEach(h),A=D(U),H&&H.l(U),U.forEach(h),j=D(R),T=b(R,"FOOTER",{class:!0,"data-svelte-h":!0}),x(T)!=="svelte-199m7us"&&(T.innerHTML=q),R.forEach(h),this.h()},h(){g(n,"class","svelte-1kcncuj"),g(o,"class","svelte-1kcncuj"),g(f,"class","svelte-1kcncuj"),g(_,"class","svelte-1kcncuj"),g(S,"class","mb-2 svelte-1kcncuj"),l[2]===void 0&&Ne(()=>l[4].call(S)),g(s,"class","panel svelte-1kcncuj"),g(t,"class","deploy-settings-box svelte-1kcncuj"),g(T,"class","svelte-1kcncuj"),g(e,"id","deploy"),g(e,"class","svelte-1kcncuj")},m(I,R){N(I,e,R),m(e,t),m(t,s),m(s,n),m(s,i),m(s,o),m(s,c),m(s,f),m(s,d),m(s,p),G(y,p,null),m(s,k),m(s,_),m(s,C),m(s,S);for(let U=0;U<V.length;U+=1)V[U]&&V[U].m(S,null);Be(S,l[2],!0),m(t,A),H&&H.m(t,null),m(e,j),m(e,T),$=!0,M||(O=ce(S,"change",l[4]),M=!0)},p(I,[R]){const U={};if(R&2&&(U.datasourceSettings=I[1]),y.$set(U),R&8){E=pe(I[3]);let W;for(W=0;W<E.length;W+=1){const K=nn(I,E,W);V[W]?V[W].p(K,R):(V[W]=ln(K),V[W].c(),V[W].m(S,null))}for(;W<V.length;W+=1)V[W].d(1);V.length=E.length}R&12&&Be(S,I[2]),I[2].formComponent?H?(H.p(I,R),R&4&&F(H,1)):(H=rn(I),H.c(),F(H,1),H.m(t,null)):H&&(ge(),B(H,1,1,()=>{H=null}),_e())},i(I){$||(F(y.$$.fragment,I),F(H),$=!0)},o(I){B(y.$$.fragment,I),B(H),$=!1},d(I){I&&h(e),J(y),Le(V,I),H&&H.d(),M=!1,O()}}}function Qr(l,e,t){let{settings:s}=e,{datasourceSettings:n}=e,r=[{id:"evidence",name:"Evidence Cloud",formComponent:wr},{id:"netlify",name:"Netlify",formComponent:Dr},{id:"vercel",name:"Vercel",formComponent:Hr},{id:"other",name:"Self-host (other)",formComponent:Rr}],i=r[0];function o(){i=Ct(this),t(2,i),t(3,r)}return l.$$set=a=>{"settings"in a&&t(0,s=a.settings),"datasourceSettings"in a&&t(1,n=a.datasourceSettings)},[s,n,i,r,o]}class eo extends ye{constructor(e){super(),ke(this,e,Qr,Zr,be,{settings:0,datasourceSettings:1})}}function on(l,e,t){const s=l.slice();return s[2]=e[t],s[3]=e,s[4]=t,s}function an(l){let e,t,s=l[2].formatTag+"",n,r,i,o=l[2].formatCode+"",a,c,f,u,d,p,y,k,_=at(l[2])+"",w,C,S,A;function j(){l[1].call(u,l[3],l[4])}return{c(){e=v("tr"),t=v("td"),n=Z(s),r=P(),i=v("td"),a=Z(o),c=P(),f=v("td"),u=v("input"),y=P(),k=v("td"),w=Z(_),C=P(),this.h()},l(T){e=b(T,"TR",{});var q=L(e);t=b(q,"TD",{class:!0});var $=L(t);n=Q($,s),$.forEach(h),r=D(q),i=b(q,"TD",{class:!0});var M=L(i);a=Q(M,o),M.forEach(h),c=D(q),f=b(q,"TD",{class:!0});var O=L(f);u=b(O,"INPUT",{id:!0,placeholder:!0,class:!0}),O.forEach(h),y=D(q),k=b(q,"TD",{class:!0});var E=L(k);w=Q(E,_),E.forEach(h),C=D(q),q.forEach(h),this.h()},h(){g(t,"class","svelte-6vtoxm"),g(i,"class","svelte-6vtoxm"),g(u,"id",d="id_format_row"+l[2].formatTag),g(u,"placeholder",p=l[2].exampleInput||ct(l[2].valueType)),g(u,"class","align_left input_box svelte-6vtoxm"),g(f,"class","svelte-6vtoxm"),g(k,"class","align_right svelte-6vtoxm")},m(T,q){N(T,e,q),m(e,t),m(t,n),m(e,r),m(e,i),m(i,a),m(e,c),m(e,f),m(f,u),ue(u,l[2].userInput),m(e,y),m(e,k),m(k,w),m(e,C),S||(A=[ce(u,"input",j),ce(u,"blur",function(){Zt(l[2].userInput=void 0)&&(l[2].userInput=void 0).apply(this,arguments)})],S=!0)},p(T,q){l=T,q&1&&s!==(s=l[2].formatTag+"")&&he(n,s),q&1&&o!==(o=l[2].formatCode+"")&&he(a,o),q&1&&d!==(d="id_format_row"+l[2].formatTag)&&g(u,"id",d),q&1&&p!==(p=l[2].exampleInput||ct(l[2].valueType))&&g(u,"placeholder",p),q&1&&u.value!==l[2].userInput&&ue(u,l[2].userInput),q&1&&_!==(_=at(l[2])+"")&&he(w,_)},d(T){T&&h(e),S=!1,xe(A)}}}function to(l){let e,t,s='<th class="align_left narrow_column svelte-6vtoxm">Format Name</th> <th class="align_left wide_column svelte-6vtoxm">Format Code</th> <th class="align_left wide_column svelte-6vtoxm">Example Input</th> <th class="align_right wide_column svelte-6vtoxm">Example Output</th>',n,r=pe(l[0]),i=[];for(let o=0;o<r.length;o+=1)i[o]=an(on(l,r,o));return{c(){e=v("table"),t=v("thead"),t.innerHTML=s,n=P();for(let o=0;o<i.length;o+=1)i[o].c();this.h()},l(o){e=b(o,"TABLE",{class:!0});var a=L(e);t=b(a,"THEAD",{"data-svelte-h":!0}),x(t)!=="svelte-1t13w6h"&&(t.innerHTML=s),n=D(a);for(let c=0;c<i.length;c+=1)i[c].l(a);a.forEach(h),this.h()},h(){g(e,"class","svelte-6vtoxm")},m(o,a){N(o,e,a),m(e,t),m(e,n);for(let c=0;c<i.length;c+=1)i[c]&&i[c].m(e,null)},p(o,[a]){if(a&1){r=pe(o[0]);let c;for(c=0;c<r.length;c+=1){const f=on(o,r,c);i[c]?i[c].p(f,a):(i[c]=an(f),i[c].c(),i[c].m(e,null))}for(;c<i.length;c+=1)i[c].d(1);i.length=r.length}},i:ee,o:ee,d(o){o&&h(e),Le(i,o)}}}function so(l,e,t){let{formats:s}=e;function n(r,i){r[i].userInput=this.value,t(0,s)}return l.$$set=r=>{"formats"in r&&t(0,s=r.formats)},[s,n]}class hs extends ye{constructor(e){super(),ke(this,e,so,to,be,{formats:0})}}function cn(l){let e,t,s,n;const r=l[4].default,i=vn(r,l,l[3],null);return{c(){e=v("div"),i&&i.c(),this.h()},l(o){e=b(o,"DIV",{class:!0});var a=L(e);i&&i.l(a),a.forEach(h),this.h()},h(){g(e,"class","collapsibleContents svelte-hde9ry"),e.hidden=t=!l[0]},m(o,a){N(o,e,a),i&&i.m(e,null),n=!0},p(o,a){i&&i.p&&(!n||a&8)&&bn(i,r,o,o[3],n?kn(r,o[3],a,null):yn(o[3]),null),(!n||a&1&&t!==(t=!o[0]))&&(e.hidden=t)},i(o){n||(F(i,o),o&&Ne(()=>{n&&(s||(s=De(e,He,{},!0)),s.run(1))}),n=!0)},o(o){B(i,o),o&&(s||(s=De(e,He,{},!1)),s.run(0)),n=!1},d(o){o&&h(e),i&&i.d(o),o&&s&&s.end()}}}function no(l){let e,t,s,n,r,i,o,a,c,f,u;o=new Kl({props:{toggled:l[0],size:"16"}});let d=l[0]&&cn(l);return{c(){e=v("div"),t=v("collapsibleHeader"),s=v("button"),n=v("h3"),r=Z(l[1]),i=P(),Y(o.$$.fragment),a=P(),d&&d.c(),this.h()},l(p){e=b(p,"DIV",{class:!0});var y=L(e);t=b(y,"COLLAPSIBLEHEADER",{class:!0});var k=L(t);s=b(k,"BUTTON",{"area-expanded":!0,class:!0});var _=L(s);n=b(_,"H3",{class:!0});var w=L(n);r=Q(w,l[1]),w.forEach(h),i=D(_),X(o.$$.fragment,_),_.forEach(h),k.forEach(h),a=D(y),d&&d.l(y),y.forEach(h),this.h()},h(){g(n,"class","svelte-hde9ry"),g(s,"area-expanded",l[0]),g(s,"class","svelte-hde9ry"),g(t,"class","svelte-hde9ry"),g(e,"class","collapsibleSection svelte-hde9ry")},m(p,y){N(p,e,y),m(e,t),m(t,s),m(s,n),m(n,r),m(s,i),G(o,s,null),m(e,a),d&&d.m(e,null),c=!0,f||(u=ce(s,"click",Wt(l[2])),f=!0)},p(p,[y]){(!c||y&2)&&he(r,p[1]);const k={};y&1&&(k.toggled=p[0]),o.$set(k),(!c||y&1)&&g(s,"area-expanded",p[0]),p[0]?d?(d.p(p,y),y&1&&F(d,1)):(d=cn(p),d.c(),F(d,1),d.m(e,null)):d&&(ge(),B(d,1,1,()=>{d=null}),_e())},i(p){c||(F(o.$$.fragment,p),F(d),c=!0)},o(p){B(o.$$.fragment,p),B(d),c=!1},d(p){p&&h(e),J(o),d&&d.d(),f=!1,u()}}}function lo(l,e,t){let{$$slots:s={},$$scope:n}=e,{headerText:r}=e,{expanded:i=!0}=e,o=()=>{t(0,i=!i)};return l.$$set=a=>{"headerText"in a&&t(1,r=a.headerText),"expanded"in a&&t(0,i=a.expanded),"$$scope"in a&&t(3,n=a.$$scope)},[i,r,o,n,s]}class nt extends ye{constructor(e){super(),ke(this,e,lo,no,be,{headerText:1,expanded:0})}}function fn(l,e,t){const s=l.slice();return s[5]=e[t],s[6]=e,s[7]=t,s}function io(l,e,t){const s=l.slice();return s[8]=e[t],s}function ro(l){let e,t=l[8].displayName+"",s;return{c(){e=v("option"),s=Z(t),this.h()},l(n){e=b(n,"OPTION",{name:!0,id:!0});var r=L(e);s=Q(r,t),r.forEach(h),this.h()},h(){g(e,"name",l[8].primaryCode),g(e,"id",l[8].primaryCode),e.__value=l[8].primaryCode,ue(e,e.__value)},m(n,r){N(n,e,r),m(e,s)},p:ee,d(n){n&&h(e)}}}function un(l){let e,t,s,n='<th class="align_left narrow_column svelte-7x1lr6">Format Name</th> <th class="align_left wide_column svelte-7x1lr6">Format Code</th> <th class="align_left wide_column svelte-7x1lr6">Example Input</th> <th class="align_right wide_column svelte-7x1lr6">Example Output</th>',r,i=[],o=new Map,a,c,f=pe(l[0].filter(l[3]));const u=d=>d[5].formatTag;for(let d=0;d<f.length;d+=1){let p=fn(l,f,d),y=u(p);o.set(y,i[d]=dn(y,p))}return{c(){e=v("div"),t=v("table"),s=v("thead"),s.innerHTML=n,r=P();for(let d=0;d<i.length;d+=1)i[d].c();this.h()},l(d){e=b(d,"DIV",{});var p=L(e);t=b(p,"TABLE",{class:!0});var y=L(t);s=b(y,"THEAD",{"data-svelte-h":!0}),x(s)!=="svelte-1u3buyn"&&(s.innerHTML=n),r=D(y);for(let k=0;k<i.length;k+=1)i[k].l(y);y.forEach(h),p.forEach(h),this.h()},h(){g(t,"class","svelte-7x1lr6")},m(d,p){N(d,e,p),m(e,t),m(t,s),m(t,r);for(let y=0;y<i.length;y+=1)i[y]&&i[y].m(t,null);c=!0},p(d,p){p&3&&(f=pe(d[0].filter(d[3])),i=Al(i,p,u,1,d,f,o,t,Ol,dn,null,fn))},i(d){if(!c){for(let p=0;p<f.length;p+=1)F(i[p]);d&&Ne(()=>{c&&(a||(a=De(e,He,{},!0)),a.run(1))}),c=!0}},o(d){d&&(a||(a=De(e,He,{},!1)),a.run(0)),c=!1},d(d){d&&h(e);for(let p=0;p<i.length;p+=1)i[p].d();d&&a&&a.end()}}}function dn(l,e){let t,s,n=e[5].formatTag+"",r,i,o,a,c=e[5].formatCode+"",f,u,d,p,y,k,_,w,C,S=at(e[5])+"",A,j,T,q,$;function M(){e[4].call(y,e[6],e[7])}return{key:l,first:null,c(){t=v("tr"),s=v("td"),r=Z(n),o=P(),a=v("td"),f=Z(c),d=P(),p=v("td"),y=v("input"),w=P(),C=v("td"),A=Z(S),T=P(),this.h()},l(O){t=b(O,"TR",{});var E=L(t);s=b(E,"TD",{class:!0});var V=L(s);r=Q(V,n),V.forEach(h),o=D(E),a=b(E,"TD",{class:!0});var H=L(a);f=Q(H,c),H.forEach(h),d=D(E),p=b(E,"TD",{class:!0});var I=L(p);y=b(I,"INPUT",{id:!0,placeholder:!0,class:!0}),I.forEach(h),w=D(E),C=b(E,"TD",{class:!0});var R=L(C);A=Q(R,S),R.forEach(h),T=D(E),E.forEach(h),this.h()},h(){g(s,"class","svelte-7x1lr6"),g(a,"class","svelte-7x1lr6"),g(y,"id",k="id_format_row"+e[5].formatTag),g(y,"placeholder",_=e[5].exampleInput||ct(e[5].valueType)),g(y,"class","align_left input_box svelte-7x1lr6"),g(p,"class","svelte-7x1lr6"),g(C,"class","align_right svelte-7x1lr6"),this.first=t},m(O,E){N(O,t,E),m(t,s),m(s,r),m(t,o),m(t,a),m(a,f),m(t,d),m(t,p),m(p,y),ue(y,e[5].userInput),m(t,w),m(t,C),m(C,A),m(t,T),q||($=[ce(y,"input",M),ce(y,"blur",function(){Zt(e[5].userInput=void 0)&&(e[5].userInput=void 0).apply(this,arguments)})],q=!0)},p(O,E){e=O,E&3&&n!==(n=e[5].formatTag+"")&&he(r,n),E&3&&c!==(c=e[5].formatCode+"")&&he(f,c),E&3&&k!==(k="id_format_row"+e[5].formatTag)&&g(y,"id",k),E&3&&_!==(_=e[5].exampleInput||ct(e[5].valueType))&&g(y,"placeholder",_),E&3&&y.value!==e[5].userInput&&ue(y,e[5].userInput),E&3&&S!==(S=at(e[5])+"")&&he(A,S)},i(O){O&&(i||Ne(()=>{i=vt(s,bt,{}),i.start()})),O&&(u||Ne(()=>{u=vt(a,bt,{}),u.start()})),O&&(j||Ne(()=>{j=vt(C,bt,{}),j.start()}))},o:ee,d(O){O&&h(t),q=!1,xe($)}}}function oo(l){let e,t,s="Choose a currency",n,r,i,o,a,c=pe(Nl),f=[];for(let d=0;d<c.length;d+=1)f[d]=ro(io(l,c,d));let u=l[1]!="Choose a currency"&&un(l);return{c(){e=v("select"),t=v("option"),t.textContent=s,n=Z(` | |
$`);for(let d=0;d<f.length;d+=1)f[d].c();r=P(),u&&u.c(),i=me(),this.h()},l(d){e=b(d,"SELECT",{class:!0});var p=L(e);t=b(p,"OPTION",{"data-svelte-h":!0}),x(t)!=="svelte-877q5p"&&(t.textContent=s),n=Q(p,` | |
$`);for(let y=0;y<f.length;y+=1)f[y].l(p);p.forEach(h),r=D(d),u&&u.l(d),i=me(),this.h()},h(){t.__value="Choose a currency",ue(t,t.__value),g(e,"class","svelte-7x1lr6"),l[1]===void 0&&Ne(()=>l[2].call(e))},m(d,p){N(d,e,p),m(e,t),m(e,n);for(let y=0;y<f.length;y+=1)f[y]&&f[y].m(e,null);Be(e,l[1],!0),N(d,r,p),u&&u.m(d,p),N(d,i,p),o||(a=ce(e,"change",l[2]),o=!0)},p(d,[p]){p&2&&Be(e,d[1]),d[1]!="Choose a currency"?u?(u.p(d,p),p&2&&F(u,1)):(u=un(d),u.c(),F(u,1),u.m(i.parentNode,i)):u&&(ge(),B(u,1,1,()=>{u=null}),_e())},i(d){F(u)},o(d){B(u)},d(d){d&&(h(e),h(r),h(i)),Le(f,d),u&&u.d(d),o=!1,a()}}}function ao(l,e,t){let{formats:s}=e,n="Choose a currency";function r(){n=Ct(this),t(1,n)}const i=a=>a.parentFormat===n;function o(a,c){a[c].userInput=this.value,t(0,s),t(1,n)}return l.$$set=a=>{"formats"in a&&t(0,s=a.formats)},[s,n,r,i,o]}class co extends ye{constructor(e){super(),ke(this,e,ao,oo,be,{formats:0})}}function hn(l,e,t){const s=l.slice();return s[4]=e[t],s[5]=e,s[6]=t,s}function mn(l){let e,t,s=l[4].formatTag+"",n,r,i,o=l[4].formatCode+"",a,c,f,u,d,p,y,k,_=at(l[4])+"",w,C,S,A,j,T,q,$,M,O;function E(){l[2].call(u,l[5],l[6])}T=new je({props:{src:ls}});function V(){return l[3](l[4])}return{c(){e=v("tr"),t=v("td"),n=Z(s),r=P(),i=v("td"),a=Z(o),c=P(),f=v("td"),u=v("input"),y=P(),k=v("td"),w=Z(_),C=P(),S=v("td"),A=v("button"),j=v("div"),Y(T.$$.fragment),q=P(),this.h()},l(H){e=b(H,"TR",{});var I=L(e);t=b(I,"TD",{class:!0});var R=L(t);n=Q(R,s),R.forEach(h),r=D(I),i=b(I,"TD",{class:!0});var U=L(i);a=Q(U,o),U.forEach(h),c=D(I),f=b(I,"TD",{class:!0});var W=L(f);u=b(W,"INPUT",{id:!0,placeholder:!0,class:!0}),W.forEach(h),y=D(I),k=b(I,"TD",{class:!0});var K=L(k);w=Q(K,_),K.forEach(h),C=D(I),S=b(I,"TD",{class:!0});var z=L(S);A=b(z,"BUTTON",{type:!0,tooltip:!0,class:!0});var se=L(A);j=b(se,"DIV",{class:!0});var ne=L(j);X(T.$$.fragment,ne),ne.forEach(h),se.forEach(h),z.forEach(h),q=D(I),I.forEach(h),this.h()},h(){g(t,"class","svelte-hjwpz"),g(i,"class","svelte-hjwpz"),g(u,"id",d="id_format_row"+l[4].formatTag),g(u,"placeholder",p=l[4].exampleInput||ct(l[4].valueType)),g(u,"class","align_left input_box svelte-hjwpz"),g(f,"class","svelte-hjwpz"),g(k,"class","align_right svelte-hjwpz"),g(j,"class","deleteIcon svelte-hjwpz"),g(A,"type","button"),g(A,"tooltip","Remove"),g(A,"class","mb-0.5 svelte-hjwpz"),g(S,"class","svelte-hjwpz")},m(H,I){N(H,e,I),m(e,t),m(t,n),m(e,r),m(e,i),m(i,a),m(e,c),m(e,f),m(f,u),ue(u,l[4].userInput),m(e,y),m(e,k),m(k,w),m(e,C),m(e,S),m(S,A),m(A,j),G(T,j,null),m(e,q),$=!0,M||(O=[ce(u,"input",E),ce(u,"blur",function(){Zt(l[4].userInput=void 0)&&(l[4].userInput=void 0).apply(this,arguments)}),ce(A,"click",V)],M=!0)},p(H,I){l=H,(!$||I&1)&&s!==(s=l[4].formatTag+"")&&he(n,s),(!$||I&1)&&o!==(o=l[4].formatCode+"")&&he(a,o),(!$||I&1&&d!==(d="id_format_row"+l[4].formatTag))&&g(u,"id",d),(!$||I&1&&p!==(p=l[4].exampleInput||ct(l[4].valueType)))&&g(u,"placeholder",p),I&1&&u.value!==l[4].userInput&&ue(u,l[4].userInput),(!$||I&1)&&_!==(_=at(l[4])+"")&&he(w,_)},i(H){$||(F(T.$$.fragment,H),$=!0)},o(H){B(T.$$.fragment,H),$=!1},d(H){H&&h(e),J(T),M=!1,xe(O)}}}function fo(l){let e,t,s='<th class="align_left narrow_column svelte-hjwpz">Format Name</th> <th class="align_left wide_column svelte-hjwpz">Format Code</th> <th class="align_left wide_column svelte-hjwpz">Example Input</th> <th class="align_right wide_column svelte-hjwpz">Example Output</th> <th class="svelte-hjwpz"></th>',n,r,i=pe(l[0]),o=[];for(let c=0;c<i.length;c+=1)o[c]=mn(hn(l,i,c));const a=c=>B(o[c],1,1,()=>{o[c]=null});return{c(){e=v("table"),t=v("thead"),t.innerHTML=s,n=P();for(let c=0;c<o.length;c+=1)o[c].c();this.h()},l(c){e=b(c,"TABLE",{class:!0});var f=L(e);t=b(f,"THEAD",{"data-svelte-h":!0}),x(t)!=="svelte-wrgjmw"&&(t.innerHTML=s),n=D(f);for(let u=0;u<o.length;u+=1)o[u].l(f);f.forEach(h),this.h()},h(){g(e,"class","svelte-hjwpz")},m(c,f){N(c,e,f),m(e,t),m(e,n);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(e,null);r=!0},p(c,[f]){if(f&3){i=pe(c[0]);let u;for(u=0;u<i.length;u+=1){const d=hn(c,i,u);o[u]?(o[u].p(d,f),F(o[u],1)):(o[u]=mn(d),o[u].c(),F(o[u],1),o[u].m(e,null))}for(ge(),u=i.length;u<o.length;u+=1)a(u);_e()}},i(c){if(!r){for(let f=0;f<i.length;f+=1)F(o[f]);r=!0}},o(c){o=o.filter(Boolean);for(let f=0;f<o.length;f+=1)B(o[f]);r=!1},d(c){c&&h(e),Le(o,c)}}}function uo(l,e,t){let{formats:s}=e,{deleteHandler:n}=e;function r(o,a){o[a].userInput=this.value,t(0,s)}const i=o=>n(o);return l.$$set=o=>{"formats"in o&&t(0,s=o.formats),"deleteHandler"in o&&t(1,n=o.deleteHandler)},[s,n,r,i]}class ho extends ye{constructor(e){super(),ke(this,e,uo,fo,be,{formats:0,deleteHandler:1})}}function pn(l,e,t){const s=l.slice();return s[14]=e[t],s}function gn(l){let e,t;return e=new nt({props:{headerText:"Saved Custom Formats",expanded:!1,$$slots:{default:[mo]},$$scope:{ctx:l}}}),{c(){Y(e.$$.fragment)},l(s){X(e.$$.fragment,s)},m(s,n){G(e,s,n),t=!0},p(s,n){const r={};n&131073&&(r.$$scope={dirty:n,ctx:s}),e.$set(r)},i(s){t||(F(e.$$.fragment,s),t=!0)},o(s){B(e.$$.fragment,s),t=!1},d(s){J(e,s)}}}function mo(l){let e,t;return e=new ho({props:{formats:l[0].customFormats,deleteHandler:l[6]}}),{c(){Y(e.$$.fragment)},l(s){X(e.$$.fragment,s)},m(s,n){G(e,s,n),t=!0},p(s,n){const r={};n&1&&(r.formats=s[0].customFormats),e.$set(r)},i(s){t||(F(e.$$.fragment,s),t=!0)},o(s){B(e.$$.fragment,s),t=!1},d(s){J(e,s)}}}function _n(l){let e,t=l[14]+"",s,n;return{c(){e=v("option"),s=Z(t),n=P(),this.h()},l(r){e=b(r,"OPTION",{});var i=L(e);s=Q(i,t),n=D(i),i.forEach(h),this.h()},h(){e.__value=l[14],ue(e,e.__value)},m(r,i){N(r,e,i),m(e,s),m(e,n)},p:ee,d(r){r&&h(e)}}}function po(l){let e,t,s,n,r="Value Type",i,o,a,c,f,u="Format Name",d,p,y,k,_,w="Format Code",C,S,A,j,T,q,$,M,O,E,V,H,I,R,U=l[0].customFormats&&l[0].customFormats.length>0&&gn(l),W=pe(l[5]),K=[];for(let z=0;z<W.length;z+=1)K[z]=_n(pn(l,W,z));return{c(){U&&U.c(),e=P(),t=v("form"),s=v("div"),n=v("label"),n.textContent=r,i=P(),o=v("select");for(let z=0;z<K.length;z+=1)K[z].c();a=P(),c=v("div"),f=v("label"),f.textContent=u,d=P(),p=v("input"),y=P(),k=v("div"),_=v("label"),_.textContent=w,C=P(),S=v("input"),j=P(),T=v("div"),q=v("button"),$=Z("Add Custom Format"),O=P(),E=v("div"),V=new $n(!1),this.h()},l(z){U&&U.l(z),e=D(z),t=b(z,"FORM",{autocomplete:!0,class:!0});var se=L(t);s=b(se,"DIV",{class:!0});var ne=L(s);n=b(ne,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),x(n)!=="svelte-1msyeo8"&&(n.textContent=r),i=D(ne),o=b(ne,"SELECT",{id:!0,class:!0});var $e=L(o);for(let oe=0;oe<K.length;oe+=1)K[oe].l($e);$e.forEach(h),ne.forEach(h),a=D(se),c=b(se,"DIV",{class:!0});var Te=L(c);f=b(Te,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),x(f)!=="svelte-1xqhxuv"&&(f.textContent=u),d=D(Te),p=b(Te,"INPUT",{id:!0,type:!0,placeholder:!0,class:!0}),Te.forEach(h),y=D(se),k=b(se,"DIV",{class:!0});var ae=L(k);_=b(ae,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),x(_)!=="svelte-x5dqk4"&&(_.textContent=w),C=D(ae),S=b(ae,"INPUT",{id:!0,type:!0,placeholder:!0,class:!0}),ae.forEach(h),j=D(se),T=b(se,"DIV",{class:!0});var Se=L(T);q=b(Se,"BUTTON",{id:!0,type:!0,class:!0});var ie=L(q);$=Q(ie,"Add Custom Format"),ie.forEach(h),Se.forEach(h),O=D(se),E=b(se,"DIV",{class:!0});var fe=L(E);V=En(fe,!1),fe.forEach(h),se.forEach(h),this.h()},h(){g(n,"for","valueType"),g(n,"class","svelte-19ljrgt"),g(o,"id","valueType"),g(o,"class","svelte-19ljrgt"),l[3]===void 0&&Ne(()=>l[9].call(o)),g(s,"class","input-item svelte-19ljrgt"),g(f,"for","formatTag"),g(f,"class","svelte-19ljrgt"),g(p,"id","formatTag"),g(p,"type","text"),g(p,"placeholder","myformat"),g(p,"class","svelte-19ljrgt"),g(c,"class","input-item svelte-19ljrgt"),g(_,"for","formatCode"),g(_,"class","svelte-19ljrgt"),g(S,"id","formatCode"),g(S,"type","text"),g(S,"placeholder",A=l[3]==="date"?"mm/dd/yyyy":"$#,##0.0"),g(S,"class","svelte-19ljrgt"),g(k,"class","input-item svelte-19ljrgt"),g(q,"id","submitCustomFormatButton"),g(q,"type","submit"),q.disabled=M=!(l[1]&&l[2]),g(q,"class","svelte-19ljrgt"),g(T,"class","new-format-buttons svelte-19ljrgt"),V.a=null,g(E,"class","error svelte-19ljrgt"),g(t,"autocomplete","off"),g(t,"class","addFormatForm")},m(z,se){U&&U.m(z,se),N(z,e,se),N(z,t,se),m(t,s),m(s,n),m(s,i),m(s,o);for(let ne=0;ne<K.length;ne+=1)K[ne]&&K[ne].m(o,null);Be(o,l[3],!0),m(t,a),m(t,c),m(c,f),m(c,d),m(c,p),ue(p,l[1]),m(t,y),m(t,k),m(k,_),m(k,C),m(k,S),ue(S,l[2]),m(t,j),m(t,T),m(T,q),m(q,$),m(t,O),m(t,E),V.m(l[4],E),H=!0,I||(R=[ce(o,"change",l[9]),ce(p,"input",l[10]),ce(S,"input",l[11]),ce(t,"submit",Wt(l[7]))],I=!0)},p(z,[se]){if(z[0].customFormats&&z[0].customFormats.length>0?U?(U.p(z,se),se&1&&F(U,1)):(U=gn(z),U.c(),F(U,1),U.m(e.parentNode,e)):U&&(ge(),B(U,1,1,()=>{U=null}),_e()),se&32){W=pe(z[5]);let ne;for(ne=0;ne<W.length;ne+=1){const $e=pn(z,W,ne);K[ne]?K[ne].p($e,se):(K[ne]=_n($e),K[ne].c(),K[ne].m(o,null))}for(;ne<K.length;ne+=1)K[ne].d(1);K.length=W.length}se&40&&Be(o,z[3]),se&2&&p.value!==z[1]&&ue(p,z[1]),(!H||se&40&&A!==(A=z[3]==="date"?"mm/dd/yyyy":"$#,##0.0"))&&g(S,"placeholder",A),se&4&&S.value!==z[2]&&ue(S,z[2]),(!H||se&6&&M!==(M=!(z[1]&&z[2])))&&(q.disabled=M),(!H||se&16)&&V.p(z[4])},i(z){H||(F(U),H=!0)},o(z){B(U),H=!1},d(z){z&&(h(e),h(t)),U&&U.d(z),Le(K,z),I=!1,xe(R)}}}function go(l,e,t){let{builtInFormats:s={}}=e,{customFormattingSettings:n={}}=e;const r=["number","date"];let i,o,a,c="";async function f(w){let S=await(await fetch("/api/customFormattingSettings.json",{method:"DELETE",body:JSON.stringify({formatTag:w.formatTag})})).json();S&&t(0,n=S)}async function u(){let w=p();if(w&&w.length>0)t(4,c=w.join("<br/>"));else{let S=await(await fetch("/api/customFormattingSettings.json",{method:"POST",body:JSON.stringify({newCustomFormat:{formatTag:i,formatCode:o,valueType:a}})})).json();S?(t(0,n=S),d()):t(4,c=`Unable to create new custom format ${i}`)}}function d(){t(1,i=void 0),t(2,o=void 0),t(3,a="number"),t(4,c="")}function p(){var j;let w=[];/^[a-zA-Z][a-zA-Z0-9]*$/.test(i)||w.push(`"${i}" is not a valid format name. The format name should always start with a letter and only contain letters and numbers.`);let C=10,S,A;a==="date"&&(C=new Date);try{S=Ll.format(o,C)}catch(T){A=T}return S||w.push(`Format "${o}" is invalid for type "${a}".`),A&&w.push(A),(s.find(T=>T.formatTag===i)||(j=n.customFormats)!=null&&j.find(T=>T.formatTag===i))&&w.push(`The format name "${i}"" is already assigned to an existing format.`),w}function y(){a=Ct(this),t(3,a),t(5,r)}function k(){i=this.value,t(1,i)}function _(){o=this.value,t(2,o)}return l.$$set=w=>{"builtInFormats"in w&&t(8,s=w.builtInFormats),"customFormattingSettings"in w&&t(0,n=w.customFormattingSettings)},[n,i,o,a,c,r,f,u,s,y,k,_]}class _o extends ye{constructor(e){super(),ke(this,e,go,po,be,{builtInFormats:8,customFormattingSettings:0})}}function vo(l){let e,t;return e=new hs({props:{formats:$t.filter(Co)}}),{c(){Y(e.$$.fragment)},l(s){X(e.$$.fragment,s)},m(s,n){G(e,s,n),t=!0},p:ee,i(s){t||(F(e.$$.fragment,s),t=!0)},o(s){B(e.$$.fragment,s),t=!1},d(s){J(e,s)}}}function bo(l){let e,t;return e=new co({props:{formats:$t.filter($o)}}),{c(){Y(e.$$.fragment)},l(s){X(e.$$.fragment,s)},m(s,n){G(e,s,n),t=!0},p:ee,i(s){t||(F(e.$$.fragment,s),t=!0)},o(s){B(e.$$.fragment,s),t=!1},d(s){J(e,s)}}}function yo(l){let e,t;return e=new hs({props:{formats:$t.filter(Eo)}}),{c(){Y(e.$$.fragment)},l(s){X(e.$$.fragment,s)},m(s,n){G(e,s,n),t=!0},p:ee,i(s){t||(F(e.$$.fragment,s),t=!0)},o(s){B(e.$$.fragment,s),t=!1},d(s){J(e,s)}}}function ko(l){let e,t;return e=new hs({props:{formats:$t.filter(To)}}),{c(){Y(e.$$.fragment)},l(s){X(e.$$.fragment,s)},m(s,n){G(e,s,n),t=!0},p:ee,i(s){t||(F(e.$$.fragment,s),t=!0)},o(s){B(e.$$.fragment,s),t=!1},d(s){J(e,s)}}}function wo(l){let e,t,s,n,r="Value Formatting",i,o,a=`Evidence supports built-in formats (like <code>usd</code> and <code>pct</code>) and | |
Excel-style formats (like <code>$#,##0.0</code>). The easiest way to apply these formats is | |
using component props. For example:`,c,f,u="In the Value component, you can use the <code>fmt</code> prop",d,p,y,k,_,w,C,S="In charts, you can use the <code>xFmt</code> and <code>yFmt</code> props",A,j,T,q,$,M,O,E=`You can also set formats within your SQL queries using SQL format tags. Use these by | |
aliasing your column names and appending a format. For example:`,V,H,I,R,U,W,K,z,se="Built-in Formats",ne,$e,Te="All built-in formats are listed below for reference.",ae,Se,ie,fe,oe,we,Ce,re,te,le,Ae,Ee="Custom Formats",Me,Fe,qe='Add new formats to your project. Custom formats use <a class="docs-link svelte-e6lr4p" target="_blank" rel="noreferrer" href="https://support.microsoft.com/en-us/office/number-format-codes-5026bbd6-04bc-48cd-bf33-80f18b4eae68">excel-style format codes.</a>',qt,Ke,Rt,Ye,ms='<span>Learn more about <a class="docs-link svelte-e6lr4p" target="_blank" rel="noreferrer" href="https://docs.evidence.dev/core-concepts/formatting/">formatting in Evidence →</a></span>',Tt;return y=new Ut({props:{language:"html",code:l[3]}}),T=new Ut({props:{language:"jsx",code:l[2]}}),I=new Ut({props:{language:"sql",code:l[1]}}),Se=new nt({props:{headerText:"Dates",expanded:!1,$$slots:{default:[vo]},$$scope:{ctx:l}}}),fe=new nt({props:{headerText:"Currencies",expanded:!1,$$slots:{default:[bo]},$$scope:{ctx:l}}}),we=new nt({props:{headerText:"Numbers",expanded:!1,$$slots:{default:[yo]},$$scope:{ctx:l}}}),re=new nt({props:{headerText:"Percentages",expanded:!1,$$slots:{default:[ko]},$$scope:{ctx:l}}}),Ke=new _o({props:{builtInFormats:$t,customFormattingSettings:l[0]}}),{c(){e=v("form"),t=v("div"),s=v("div"),n=v("h2"),n.textContent=r,i=P(),o=v("p"),o.innerHTML=a,c=P(),f=v("p"),f.innerHTML=u,d=P(),p=v("div"),Y(y.$$.fragment),k=P(),_=v("br"),w=P(),C=v("p"),C.innerHTML=S,A=P(),j=v("div"),Y(T.$$.fragment),q=P(),$=v("br"),M=P(),O=v("p"),O.textContent=E,V=P(),H=v("div"),Y(I.$$.fragment),R=P(),U=v("p"),W=P(),K=v("div"),z=v("h2"),z.textContent=se,ne=P(),$e=v("p"),$e.textContent=Te,ae=P(),Y(Se.$$.fragment),ie=P(),Y(fe.$$.fragment),oe=P(),Y(we.$$.fragment),Ce=P(),Y(re.$$.fragment),te=P(),le=v("div"),Ae=v("h2"),Ae.textContent=Ee,Me=P(),Fe=v("p"),Fe.innerHTML=qe,qt=P(),Y(Ke.$$.fragment),Rt=P(),Ye=v("footer"),Ye.innerHTML=ms,this.h()},l(de){e=b(de,"FORM",{id:!0,class:!0});var Ie=L(e);t=b(Ie,"DIV",{class:!0});var Re=L(t);s=b(Re,"DIV",{class:!0});var ve=L(s);n=b(ve,"H2",{class:!0,"data-svelte-h":!0}),x(n)!=="svelte-1pt91sq"&&(n.textContent=r),i=D(ve),o=b(ve,"P",{class:!0,"data-svelte-h":!0}),x(o)!=="svelte-y867uy"&&(o.innerHTML=a),c=D(ve),f=b(ve,"P",{class:!0,"data-svelte-h":!0}),x(f)!=="svelte-1b5sps4"&&(f.innerHTML=u),d=D(ve),p=b(ve,"DIV",{class:!0});var mt=L(p);X(y.$$.fragment,mt),mt.forEach(h),k=D(ve),_=b(ve,"BR",{}),w=D(ve),C=b(ve,"P",{class:!0,"data-svelte-h":!0}),x(C)!=="svelte-1uln7kb"&&(C.innerHTML=S),A=D(ve),j=b(ve,"DIV",{class:!0});var pt=L(j);X(T.$$.fragment,pt),pt.forEach(h),q=D(ve),$=b(ve,"BR",{}),M=D(ve),O=b(ve,"P",{class:!0,"data-svelte-h":!0}),x(O)!=="svelte-146t22d"&&(O.textContent=E),V=D(ve),H=b(ve,"DIV",{class:!0});var gt=L(H);X(I.$$.fragment,gt),gt.forEach(h),R=D(ve),U=b(ve,"P",{class:!0}),L(U).forEach(h),ve.forEach(h),W=D(Re),K=b(Re,"DIV",{class:!0});var Pe=L(K);z=b(Pe,"H2",{class:!0,"data-svelte-h":!0}),x(z)!=="svelte-ef4j4e"&&(z.textContent=se),ne=D(Pe),$e=b(Pe,"P",{class:!0,"data-svelte-h":!0}),x($e)!=="svelte-1uuy1j1"&&($e.textContent=Te),ae=D(Pe),X(Se.$$.fragment,Pe),ie=D(Pe),X(fe.$$.fragment,Pe),oe=D(Pe),X(we.$$.fragment,Pe),Ce=D(Pe),X(re.$$.fragment,Pe),Pe.forEach(h),te=D(Re),le=b(Re,"DIV",{class:!0});var Qe=L(le);Ae=b(Qe,"H2",{class:!0,"data-svelte-h":!0}),x(Ae)!=="svelte-1avfhcl"&&(Ae.textContent=Ee),Me=D(Qe),Fe=b(Qe,"P",{class:!0,"data-svelte-h":!0}),x(Fe)!=="svelte-zf74ph"&&(Fe.innerHTML=qe),qt=D(Qe),X(Ke.$$.fragment,Qe),Qe.forEach(h),Re.forEach(h),Rt=D(Ie),Ye=b(Ie,"FOOTER",{class:!0,"data-svelte-h":!0}),x(Ye)!=="svelte-1yt3qws"&&(Ye.innerHTML=ms),Ie.forEach(h),this.h()},h(){g(n,"class","svelte-e6lr4p"),g(o,"class","svelte-e6lr4p"),g(f,"class","svelte-e6lr4p"),g(p,"class","code-container p-2 svelte-e6lr4p"),g(C,"class","svelte-e6lr4p"),g(j,"class","code-container p-2 svelte-e6lr4p"),g(O,"class","svelte-e6lr4p"),g(H,"class","code-container p-2 svelte-e6lr4p"),g(U,"class","svelte-e6lr4p"),g(s,"class","panel svelte-e6lr4p"),g(z,"class","svelte-e6lr4p"),g($e,"class","svelte-e6lr4p"),g(K,"class","panel svelte-e6lr4p"),g(Ae,"class","svelte-e6lr4p"),g(Fe,"class","svelte-e6lr4p"),g(le,"class","panel svelte-e6lr4p"),g(t,"class","formatting-settings-box svelte-e6lr4p"),g(Ye,"class","svelte-e6lr4p"),g(e,"id","formatting"),g(e,"class","svelte-e6lr4p")},m(de,Ie){N(de,e,Ie),m(e,t),m(t,s),m(s,n),m(s,i),m(s,o),m(s,c),m(s,f),m(s,d),m(s,p),G(y,p,null),m(s,k),m(s,_),m(s,w),m(s,C),m(s,A),m(s,j),G(T,j,null),m(s,q),m(s,$),m(s,M),m(s,O),m(s,V),m(s,H),G(I,H,null),m(s,R),m(s,U),m(t,W),m(t,K),m(K,z),m(K,ne),m(K,$e),m(K,ae),G(Se,K,null),m(K,ie),G(fe,K,null),m(K,oe),G(we,K,null),m(K,Ce),G(re,K,null),m(t,te),m(t,le),m(le,Ae),m(le,Me),m(le,Fe),m(le,qt),G(Ke,le,null),m(e,Rt),m(e,Ye),Tt=!0},p(de,[Ie]){const Re={};Ie&16&&(Re.$$scope={dirty:Ie,ctx:de}),Se.$set(Re);const ve={};Ie&16&&(ve.$$scope={dirty:Ie,ctx:de}),fe.$set(ve);const mt={};Ie&16&&(mt.$$scope={dirty:Ie,ctx:de}),we.$set(mt);const pt={};Ie&16&&(pt.$$scope={dirty:Ie,ctx:de}),re.$set(pt);const gt={};Ie&1&&(gt.customFormattingSettings=de[0]),Ke.$set(gt)},i(de){Tt||(F(y.$$.fragment,de),F(T.$$.fragment,de),F(I.$$.fragment,de),F(Se.$$.fragment,de),F(fe.$$.fragment,de),F(we.$$.fragment,de),F(re.$$.fragment,de),F(Ke.$$.fragment,de),Tt=!0)},o(de){B(y.$$.fragment,de),B(T.$$.fragment,de),B(I.$$.fragment,de),B(Se.$$.fragment,de),B(fe.$$.fragment,de),B(we.$$.fragment,de),B(re.$$.fragment,de),B(Ke.$$.fragment,de),Tt=!1},d(de){de&&h(e),J(y),J(T),J(I),J(Se),J(fe),J(we),J(re),J(Ke)}}}const Co=l=>l.formatCategory==="date",$o=l=>l.formatCategory==="currency",Eo=l=>l.formatCategory==="number",To=l=>l.formatCategory==="percent";function So(l,e,t){let{customFormattingSettings:s}=e,n=`select | |
growth as growth_pct, -- formatted as a percentage | |
sales as sales_usd -- formatted as US dollars | |
from table`,r=`<LineChart | |
data={sales_data} | |
x=date | |
y=sales | |
yFmt=euro | |
/>`,i="<Value data={sales_data} column=sales fmt='$#,##0' />";return l.$$set=o=>{"customFormattingSettings"in o&&t(0,s=o.customFormattingSettings)},[s,n,r,i]}class Io extends ye{constructor(e){super(),ke(this,e,So,wo,be,{customFormattingSettings:0})}}function No(l){let e,t,s="Each time you run a query, we get the following pieces of information:",n,r,i="<li>A random identifier that is stored in <code>.evidence/customization/.profile.json</code></li> <li>An anonymized identifier based on the git repository you're using for the project</li> <li>Whether your project is running in development or build mode</li> <li>Whether your query returned from the cache, from your datasource, or returned an error</li> <li>The type of Evidence datasource connectors you are using (postgres, snowflake, etc.)</li> <li>The operating system your project is running on (windows, mac, etc.)</li>",o,a,c="Sharing anonymous usage data is one of the best ways you can support Evidence.",f,u,d,p="Share anonymous usage data",y,k,_,w,C,S,A;return{c(){e=v("div"),t=v("p"),t.textContent=s,n=P(),r=v("ol"),r.innerHTML=i,o=P(),a=v("p"),a.textContent=c,f=P(),u=v("div"),d=v("label"),d.textContent=p,y=P(),k=v("label"),_=v("input"),w=P(),C=v("span"),this.h()},l(j){e=b(j,"DIV",{});var T=L(e);t=b(T,"P",{class:!0,"data-svelte-h":!0}),x(t)!=="svelte-5h9nz3"&&(t.textContent=s),n=D(T),r=b(T,"OL",{class:!0,"data-svelte-h":!0}),x(r)!=="svelte-1yd05qf"&&(r.innerHTML=i),o=D(T),a=b(T,"P",{class:!0,"data-svelte-h":!0}),x(a)!=="svelte-1o2o3k3"&&(a.textContent=c),f=D(T),u=b(T,"DIV",{class:!0});var q=L(u);d=b(q,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),x(d)!=="svelte-2u0hrt"&&(d.textContent=p),y=D(q),k=b(q,"LABEL",{class:!0});var $=L(k);_=b($,"INPUT",{type:!0,id:!0,class:!0}),w=D($),C=b($,"SPAN",{class:!0}),L(C).forEach(h),$.forEach(h),q.forEach(h),T.forEach(h),this.h()},h(){g(t,"class","svelte-v1sgh9"),g(r,"class","list-decimal px-8"),g(a,"class","svelte-v1sgh9"),g(d,"for","telemetry-toggle"),g(d,"class","svelte-v1sgh9"),g(_,"type","checkbox"),g(_,"id","telemetry-toggle"),g(_,"class","svelte-v1sgh9"),g(C,"class","slider svelte-v1sgh9"),g(k,"class","switch svelte-v1sgh9"),g(u,"class","input-item svelte-v1sgh9")},m(j,T){N(j,e,T),m(e,t),m(e,n),m(e,r),m(e,o),m(e,a),m(e,f),m(e,u),m(u,d),m(u,y),m(u,k),m(k,_),_.checked=l[0],m(k,w),m(k,C),S||(A=[ce(_,"change",l[3]),ce(_,"change",l[1])],S=!0)},p(j,T){T&1&&(_.checked=j[0])},d(j){j&&h(e),S=!1,xe(A)}}}function Ao(l){let e,t,s,n,r="Telemetry",i,o,a=`Evidence collects anonymous usage data to help us understand how often the tool is being | |
used.`,c,f,u,d,p='<span>The source code for our telemetry can be <a class="docs-link svelte-v1sgh9" href="https://github.com/evidence-dev/evidence/blob/main/packages/telemetry/index.cjs" target="_blank" rel="noreferrer">found here →</a></span>',y;return f=new nt({props:{headerText:"More",expanded:!1,$$slots:{default:[No]},$$scope:{ctx:l}}}),{c(){e=v("form"),t=v("div"),s=v("div"),n=v("h2"),n.textContent=r,i=P(),o=v("p"),o.textContent=a,c=P(),Y(f.$$.fragment),u=P(),d=v("footer"),d.innerHTML=p,this.h()},l(k){e=b(k,"FORM",{id:!0,class:!0});var _=L(e);t=b(_,"DIV",{class:!0});var w=L(t);s=b(w,"DIV",{class:!0});var C=L(s);n=b(C,"H2",{class:!0,"data-svelte-h":!0}),x(n)!=="svelte-picrrj"&&(n.textContent=r),i=D(C),o=b(C,"P",{class:!0,"data-svelte-h":!0}),x(o)!=="svelte-1tknaya"&&(o.textContent=a),c=D(C),X(f.$$.fragment,C),C.forEach(h),w.forEach(h),u=D(_),d=b(_,"FOOTER",{class:!0,"data-svelte-h":!0}),x(d)!=="svelte-1fitj1j"&&(d.innerHTML=p),_.forEach(h),this.h()},h(){g(n,"class","svelte-v1sgh9"),g(o,"class","svelte-v1sgh9"),g(s,"class","panel svelte-v1sgh9"),g(t,"class","telemetry-settings-box svelte-v1sgh9"),g(d,"class","svelte-v1sgh9"),g(e,"id","telemetry"),g(e,"class","svelte-v1sgh9")},m(k,_){N(k,e,_),m(e,t),m(t,s),m(s,n),m(s,i),m(s,o),m(s,c),G(f,s,null),m(e,u),m(e,d),y=!0},p(k,[_]){const w={};_&17&&(w.$$scope={dirty:_,ctx:k}),f.$set(w)},i(k){y||(F(f.$$.fragment,k),y=!0)},o(k){B(f.$$.fragment,k),y=!1},d(k){k&&h(e),J(f)}}}function Oo(l,e,t){let{settings:s}=e,n=(s.send_anonymous_usage_stats??"yes")==="yes";async function r(){t(2,s.send_anonymous_usage_stats=n?"yes":"no",s),await fetch("/api/settings.json",{method:"POST",body:JSON.stringify({settings:s})})}function i(){n=this.checked,t(0,n)}return l.$$set=o=>{"settings"in o&&t(2,s=o.settings)},[n,r,s,i]}class Lo extends ye{constructor(e){super(),ke(this,e,Oo,Ao,be,{settings:2})}}function Po(l){let e,t,s;return t=new je({props:{src:ls,theme:"filled",class:"h-6 w-6 text-red-700"}}),{c(){e=v("span"),Y(t.$$.fragment),this.h()},l(n){e=b(n,"SPAN",{class:!0});var r=L(e);X(t.$$.fragment,r),r.forEach(h),this.h()},h(){g(e,"class","gitx-icon svelte-1riw2gy")},m(n,r){N(n,e,r),G(t,e,null),s=!0},i(n){s||(F(t.$$.fragment,n),s=!0)},o(n){B(t.$$.fragment,n),s=!1},d(n){n&&h(e),J(t)}}}function Do(l){let e,t,s;return t=new je({props:{src:Ln,theme:"filled",class:"h-6 w-6 text-green-700"}}),{c(){e=v("span"),Y(t.$$.fragment),this.h()},l(n){e=b(n,"SPAN",{class:!0});var r=L(e);X(t.$$.fragment,r),r.forEach(h),this.h()},h(){g(e,"class","gitcheck-icon svelte-1riw2gy")},m(n,r){N(n,e,r),G(t,e,null),s=!0},i(n){s||(F(t.$$.fragment,n),s=!0)},o(n){B(t.$$.fragment,n),s=!1},d(n){n&&h(e),J(t)}}}function jo(l){let e,t,s,n,r="Use your code editor to initialize a repo or run `git init` in a terminal",i;return t=new je({props:{src:Pn,class:"h-5 w-5 pb-0.5"}}),{c(){e=v("span"),Y(t.$$.fragment),s=P(),n=v("span"),n.textContent=r,this.h()},l(o){e=b(o,"SPAN",{class:!0});var a=L(e);X(t.$$.fragment,a),s=D(a),n=b(a,"SPAN",{class:!0,"data-svelte-h":!0}),x(n)!=="svelte-qlaf2o"&&(n.textContent=r),a.forEach(h),this.h()},h(){g(n,"class","info-msg svelte-1riw2gy"),g(e,"class","help-icon svelte-1riw2gy")},m(o,a){N(o,e,a),G(t,e,null),m(e,s),m(e,n),i=!0},p:ee,i(o){i||(F(t.$$.fragment,o),i=!0)},o(o){B(t.$$.fragment,o),i=!1},d(o){o&&h(e),J(t)}}}function Mo(l){let e,t,s,n=l[0].localGitRepo+"",r;return{c(){e=v("div"),t=v("span"),s=Z("Tracking "),r=Z(n),this.h()},l(i){e=b(i,"DIV",{class:!0});var o=L(e);t=b(o,"SPAN",{class:!0});var a=L(t);s=Q(a,"Tracking "),r=Q(a,n),a.forEach(h),o.forEach(h),this.h()},h(){g(t,"class","repo-location svelte-1riw2gy"),g(e,"class","result-msg svelte-1riw2gy")},m(i,o){N(i,e,o),m(e,t),m(t,s),m(t,r)},p(i,o){o&1&&n!==(n=i[0].localGitRepo+"")&&he(r,n)},i:ee,o:ee,d(i){i&&h(e)}}}function Fo(l){let e,t,s;return t=new je({props:{src:ls,theme:"filled",class:"h-6 w-6 text-red-700"}}),{c(){e=v("span"),Y(t.$$.fragment),this.h()},l(n){e=b(n,"SPAN",{class:!0});var r=L(e);X(t.$$.fragment,r),r.forEach(h),this.h()},h(){g(e,"class","gitx-icon svelte-1riw2gy")},m(n,r){N(n,e,r),G(t,e,null),s=!0},i(n){s||(F(t.$$.fragment,n),s=!0)},o(n){B(t.$$.fragment,n),s=!1},d(n){n&&h(e),J(t)}}}function Vo(l){let e,t,s;return t=new je({props:{src:Ln,theme:"filled",class:"h-6 w-6 text-green-700"}}),{c(){e=v("span"),Y(t.$$.fragment),this.h()},l(n){e=b(n,"SPAN",{class:!0});var r=L(e);X(t.$$.fragment,r),r.forEach(h),this.h()},h(){g(e,"class","gitcheck-icon svelte-1riw2gy")},m(n,r){N(n,e,r),G(t,e,null),s=!0},i(n){s||(F(t.$$.fragment,n),s=!0)},o(n){B(t.$$.fragment,n),s=!1},d(n){n&&h(e),J(t)}}}function Bo(l){let e,t,s,n,r="Publish your git repo to a platform like GitHub or GitLab",i;return t=new je({props:{src:Pn,class:"h-5 w-5 pb-0.5"}}),{c(){e=v("span"),Y(t.$$.fragment),s=P(),n=v("span"),n.textContent=r,this.h()},l(o){e=b(o,"SPAN",{class:!0});var a=L(e);X(t.$$.fragment,a),s=D(a),n=b(a,"SPAN",{class:!0,"data-svelte-h":!0}),x(n)!=="svelte-mv1gko"&&(n.textContent=r),a.forEach(h),this.h()},h(){g(n,"class","info-msg svelte-1riw2gy"),g(e,"class","help-icon svelte-1riw2gy")},m(o,a){N(o,e,a),G(t,e,null),m(e,s),m(e,n),i=!0},p:ee,i(o){i||(F(t.$$.fragment,o),i=!0)},o(o){B(t.$$.fragment,o),i=!1},d(o){o&&h(e),J(t)}}}function Ho(l){let e,t,s,n=l[0].gitRepo.replace(".git","")+"",r,i;return{c(){e=v("div"),t=v("a"),s=v("span"),r=Z(n),this.h()},l(o){e=b(o,"DIV",{class:!0});var a=L(e);t=b(a,"A",{href:!0,target:!0,rel:!0});var c=L(t);s=b(c,"SPAN",{class:!0});var f=L(s);r=Q(f,n),f.forEach(h),c.forEach(h),a.forEach(h),this.h()},h(){g(s,"class","repo-location svelte-1riw2gy"),g(t,"href",i=l[0].gitRepo.replace(".git","")),g(t,"target","_blank"),g(t,"rel","noreferrer"),g(e,"class","result-msg svelte-1riw2gy")},m(o,a){N(o,e,a),m(e,t),m(t,s),m(s,r)},p(o,a){a&1&&n!==(n=o[0].gitRepo.replace(".git","")+"")&&he(r,n),a&1&&i!==(i=o[0].gitRepo.replace(".git",""))&&g(t,"href",i)},i:ee,o:ee,d(o){o&&h(e)}}}function qo(l){let e,t,s,n,r="Version Control",i,o,a,c,f,u,d="Local Git Repo",p,y,k,_,w,C,S,A,j,T="Git Repo Published",q,$,M,O,E,V='<span>Learn more about <a class="docs-link svelte-1riw2gy" target="_blank" rel="noreferrer" href="https://docs.github.com/en/get-started/using-git/about-git">Setting Up Version Control →</a></span>',H;const I=[Do,Po],R=[];function U(ie,fe){return ie[0].localGitRepo?0:1}a=U(l),c=R[a]=I[a](l);const W=[Mo,jo],K=[];function z(ie,fe){return ie[0].localGitRepo?0:1}y=z(l),k=K[y]=W[y](l);const se=[Vo,Fo],ne=[];function $e(ie,fe){return ie[0].gitRepo?0:1}C=$e(l),S=ne[C]=se[C](l);const Te=[Ho,Bo],ae=[];function Se(ie,fe){return ie[0].gitRepo?0:1}return $=Se(l),M=ae[$]=Te[$](l),{c(){e=v("form"),t=v("div"),s=v("div"),n=v("h2"),n.textContent=r,i=Z(` | |
Use version control to keep track of changes to your project. A published git repo is needed if | |
you want to deploy your Evidence project online. | |
`),o=v("div"),c.c(),f=P(),u=v("span"),u.textContent=d,p=P(),k.c(),_=P(),w=v("div"),S.c(),A=P(),j=v("span"),j.textContent=T,q=P(),M.c(),O=P(),E=v("footer"),E.innerHTML=V,this.h()},l(ie){e=b(ie,"FORM",{id:!0,class:!0});var fe=L(e);t=b(fe,"DIV",{class:!0});var oe=L(t);s=b(oe,"DIV",{class:!0});var we=L(s);n=b(we,"H2",{class:!0,"data-svelte-h":!0}),x(n)!=="svelte-n9hgtt"&&(n.textContent=r),i=Q(we,` | |
Use version control to keep track of changes to your project. A published git repo is needed if | |
you want to deploy your Evidence project online. | |
`),o=b(we,"DIV",{class:!0});var Ce=L(o);c.l(Ce),f=D(Ce),u=b(Ce,"SPAN",{class:!0,"data-svelte-h":!0}),x(u)!=="svelte-moy7v6"&&(u.textContent=d),p=D(Ce),k.l(Ce),Ce.forEach(h),_=D(we),w=b(we,"DIV",{class:!0});var re=L(w);S.l(re),A=D(re),j=b(re,"SPAN",{class:!0,"data-svelte-h":!0}),x(j)!=="svelte-1wsobt7"&&(j.textContent=T),q=D(re),M.l(re),re.forEach(h),we.forEach(h),oe.forEach(h),O=D(fe),E=b(fe,"FOOTER",{class:!0,"data-svelte-h":!0}),x(E)!=="svelte-1e01ncp"&&(E.innerHTML=V),fe.forEach(h),this.h()},h(){g(n,"class","svelte-1riw2gy"),g(u,"class","item-label svelte-1riw2gy"),g(o,"class","git-item svelte-1riw2gy"),g(j,"class","item-label svelte-1riw2gy"),g(w,"class","git-item svelte-1riw2gy"),g(s,"class","panel svelte-1riw2gy"),g(t,"class","version-control-box svelte-1riw2gy"),g(E,"class","svelte-1riw2gy"),g(e,"id","version-control"),g(e,"class","svelte-1riw2gy")},m(ie,fe){N(ie,e,fe),m(e,t),m(t,s),m(s,n),m(s,i),m(s,o),R[a].m(o,null),m(o,f),m(o,u),m(o,p),K[y].m(o,null),m(s,_),m(s,w),ne[C].m(w,null),m(w,A),m(w,j),m(w,q),ae[$].m(w,null),m(e,O),m(e,E),H=!0},p(ie,[fe]){let oe=a;a=U(ie),a!==oe&&(ge(),B(R[oe],1,1,()=>{R[oe]=null}),_e(),c=R[a],c||(c=R[a]=I[a](ie),c.c()),F(c,1),c.m(o,f));let we=y;y=z(ie),y===we?K[y].p(ie,fe):(ge(),B(K[we],1,1,()=>{K[we]=null}),_e(),k=K[y],k?k.p(ie,fe):(k=K[y]=W[y](ie),k.c()),F(k,1),k.m(o,null));let Ce=C;C=$e(ie),C!==Ce&&(ge(),B(ne[Ce],1,1,()=>{ne[Ce]=null}),_e(),S=ne[C],S||(S=ne[C]=se[C](ie),S.c()),F(S,1),S.m(w,A));let re=$;$=Se(ie),$===re?ae[$].p(ie,fe):(ge(),B(ae[re],1,1,()=>{ae[re]=null}),_e(),M=ae[$],M?M.p(ie,fe):(M=ae[$]=Te[$](ie),M.c()),F(M,1),M.m(w,null))},i(ie){H||(F(c),F(k),F(S),F(M),H=!0)},o(ie){B(c),B(k),B(S),B(M),H=!1},d(ie){ie&&h(e),R[a].d(),K[y].d(),ne[C].d(),ae[$].d()}}}function Ro(l,e,t){let{settings:s}=e;return l.$$set=n=>{"settings"in n&&t(0,s=n.settings)},[s]}class Uo extends ye{constructor(e){super(),ke(this,e,Ro,qo,be,{settings:0})}}const xo=async({fetch:l,data:e})=>({...e,settings:{},gitIgnore:""}),ra=Object.freeze(Object.defineProperty({__proto__:null,load:xo},Symbol.toStringTag,{value:"Module"}));function Ko(l){let e,t="Settings are only available in development mode.";return{c(){e=v("p"),e.textContent=t},l(s){e=b(s,"P",{"data-svelte-h":!0}),x(e)!=="svelte-591hpj"&&(e.textContent=t)},m(s,n){N(s,e,n)},p:ee,i:ee,o:ee,d(s){s&&h(e)}}}function zo(l){let e,t,s,n,r,i,o,a,c,f,u,d,p;return t=new Uo({props:{settings:l[0]}}),n=new yr({props:{availableSourcePlugins:l[3],sources:l[2]}}),i=new eo({props:{settings:l[0],datasourceSettings:l[2]}}),a=new Io({props:{settings:l[0],customFormattingSettings:l[1]}}),f=new Lo({props:{settings:l[0]}}),{c(){e=v("div"),Y(t.$$.fragment),s=P(),Y(n.$$.fragment),r=P(),Y(i.$$.fragment),o=P(),Y(a.$$.fragment),c=P(),Y(f.$$.fragment),u=P(),d=v("br"),this.h()},l(y){e=b(y,"DIV",{class:!0});var k=L(e);X(t.$$.fragment,k),s=D(k),X(n.$$.fragment,k),r=D(k),X(i.$$.fragment,k),o=D(k),X(a.$$.fragment,k),c=D(k),X(f.$$.fragment,k),k.forEach(h),u=D(y),d=b(y,"BR",{}),this.h()},h(){g(e,"class","mt-12")},m(y,k){N(y,e,k),G(t,e,null),m(e,s),G(n,e,null),m(e,r),G(i,e,null),m(e,o),G(a,e,null),m(e,c),G(f,e,null),N(y,u,k),N(y,d,k),p=!0},p(y,k){const _={};k&1&&(_.settings=y[0]),t.$set(_);const w={};k&8&&(w.availableSourcePlugins=y[3]),k&4&&(w.sources=y[2]),n.$set(w);const C={};k&1&&(C.settings=y[0]),k&4&&(C.datasourceSettings=y[2]),i.$set(C);const S={};k&1&&(S.settings=y[0]),k&2&&(S.customFormattingSettings=y[1]),a.$set(S);const A={};k&1&&(A.settings=y[0]),f.$set(A)},i(y){p||(F(t.$$.fragment,y),F(n.$$.fragment,y),F(i.$$.fragment,y),F(a.$$.fragment,y),F(f.$$.fragment,y),p=!0)},o(y){B(t.$$.fragment,y),B(n.$$.fragment,y),B(i.$$.fragment,y),B(a.$$.fragment,y),B(f.$$.fragment,y),p=!1},d(y){y&&(h(e),h(u),h(d)),J(t),J(n),J(i),J(a),J(f)}}}function Yo(l){let e,t,s,n;const r=[zo,Ko],i=[];function o(a,c){return 1}return e=o(),t=i[e]=r[e](l),{c(){t.c(),s=me()},l(a){t.l(a),s=me()},m(a,c){i[e].m(a,c),N(a,s,c),n=!0},p(a,[c]){t.p(a,c)},i(a){n||(F(t),n=!0)},o(a){B(t),n=!1},d(a){a&&h(s),i[e].d(a)}}}function Go(l,e,t){let{data:s}=e,{settings:n,customFormattingSettings:r,datasourceSettings:i,plugins:o}=s;return l.$$set=a=>{"data"in a&&t(4,s=a.data)},l.$$.update=()=>{l.$$.dirty&16&&t(0,{settings:n,customFormattingSettings:r,datasourceSettings:i,plugins:o}=s,n,(t(1,r),t(4,s)),(t(2,i),t(4,s)),(t(3,o),t(4,s)))},[n,r,i,o,s]}class oa extends ye{constructor(e){super(),ke(this,e,Go,Yo,be,{data:4})}}export{oa as component,ra as universal}; | |