File size: 11,394 Bytes
ce592f8
1
2
import{S as _e,i as de,s as he,E as x,_ as J,$ as Q,m as C,h as d,n as E,a0 as te,b as y,J as $,O as Ce,a1 as Y,D as ne,F as ae,q as N,r as P,u as U,y as V,z as L,A as q,g as w,d as S,B as H,R as F,k as B,a as j,e as le,l as T,c as K,v as W,f as X,a5 as we,K as ge,a3 as Ee,H as G,a6 as Se,a7 as ye,P as Ae,a8 as Be}from"../chunks/index.c7ccf096.js";import{g as se,c as Z,S as be}from"../chunks/utils.d5b83cd1.js";import{P as Te,h as De,R as re}from"../chunks/Page.c565e4f4.js";import{q as Ie,d as Me,a as Ne,C as Pe,t as oe,b as ie,I as ce,c as Re,T as ze,e as Ve,f as Le}from"../chunks/ConceptView.83e55fef.js";import{a as qe}from"../chunks/taskQueries.d9517cd8.js";import{M as He,u as Oe}from"../chunks/urlHashStore.f5ca7f47.js";import{B as Ye}from"../chunks/taskMonitoringStore.a15b9cd5.js";function fe(l){let e,n;return{c(){e=J("title"),n=N(l[1])},l(t){e=Q(t,"title",{});var a=C(e);n=P(a,l[1]),a.forEach(d)},m(t,a){y(t,e,a),$(e,n)},p(t,a){a&2&&U(n,t[1])},d(t){t&&d(e)}}}function je(l){let e,n,t,a=l[1]&&fe(l),o=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:l[0]},{height:l[0]},l[2],l[3]],g={};for(let u=0;u<o.length;u+=1)g=x(g,o[u]);return{c(){e=J("svg"),a&&a.c(),n=J("path"),t=J("path"),this.h()},l(u){e=Q(u,"svg",{xmlns:!0,viewBox:!0,fill:!0,preserveAspectRatio:!0,width:!0,height:!0});var i=C(e);a&&a.l(i),n=Q(i,"path",{d:!0}),C(n).forEach(d),t=Q(i,"path",{d:!0}),C(t).forEach(d),i.forEach(d),this.h()},h(){E(n,"d","M16,4c6.6,0,12,5.4,12,12s-5.4,12-12,12S4,22.6,4,16S9.4,4,16,4 M16,2C8.3,2,2,8.3,2,16s6.3,14,14,14s14-6.3,14-14	S23.7,2,16,2z"),E(t,"d","M24 15L17 15 17 8 15 8 15 15 8 15 8 17 15 17 15 24 17 24 17 17 24 17z"),te(e,g)},m(u,i){y(u,e,i),a&&a.m(e,null),$(e,n),$(e,t)},p(u,[i]){u[1]?a?a.p(u,i):(a=fe(u),a.c(),a.m(e,n)):a&&(a.d(1),a=null),te(e,g=Ce(o,[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},i&1&&{width:u[0]},i&1&&{height:u[0]},i&4&&u[2],i&8&&u[3]]))},i:Y,o:Y,d(u){u&&d(e),a&&a.d()}}}function Ke(l,e,n){let t,a;const o=["size","title"];let g=ne(e,o),{size:u=16}=e,{title:i=void 0}=e;return l.$$set=r=>{n(5,e=x(x({},e),ae(r))),n(3,g=ne(e,o)),"size"in r&&n(0,u=r.size),"title"in r&&n(1,i=r.title)},l.$$.update=()=>{n(4,t=e["aria-label"]||e["aria-labelledby"]||i),n(2,a={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=ae(e),[u,i,a,g,t]}class Ue extends _e{constructor(e){super(),de(this,e,Ke,je,he,{size:0,title:1})}}function ue(l,e,n){const t=l.slice();return t[20]=e[n],t}function Fe(l){let e,n,t,a,o,g,u,i=l[5].data,r=[];for(let f=0;f<i.length;f+=1)r[f]=me(ue(l,i,f));const k=f=>S(r[f],1,1,()=>{r[f]=null});return t=new Ue({}),{c(){for(let f=0;f<r.length;f+=1)r[f].c();e=j(),n=B("button"),V(t.$$.fragment),a=N(" Add Concept"),this.h()},l(f){for(let s=0;s<r.length;s+=1)r[s].l(f);e=K(f),n=T(f,"BUTTON",{class:!0});var m=C(n);L(t.$$.fragment,m),a=P(m," Add Concept"),m.forEach(d),this.h()},h(){E(n,"class","mt-4 flex w-full items-center gap-x-1 px-4 py-2 text-left text-sm text-gray-500 hover:text-blue-500")},m(f,m){for(let s=0;s<r.length;s+=1)r[s]&&r[s].m(f,m);y(f,e,m),y(f,n,m),q(t,n,null),$(n,a),o=!0,g||(u=ge(n,"click",l[16]),g=!0)},p(f,m){if(m&43){i=f[5].data;let s;for(s=0;s<i.length;s+=1){const h=ue(f,i,s);r[s]?(r[s].p(h,m),w(r[s],1)):(r[s]=me(h),r[s].c(),w(r[s],1),r[s].m(e.parentNode,e))}for(W(),s=i.length;s<r.length;s+=1)k(s);X()}},i(f){if(!o){for(let m=0;m<i.length;m+=1)w(r[m]);w(t.$$.fragment,f),o=!0}},o(f){r=r.filter(Boolean);for(let m=0;m<r.length;m+=1)S(r[m]);S(t.$$.fragment,f),o=!1},d(f){Ee(r,f),f&&d(e),f&&d(n),H(t),g=!1,u()}}}function Ge(l){let e,n;return e=new be({}),{c(){V(e.$$.fragment)},l(t){L(e.$$.fragment,t)},m(t,a){q(e,t,a),n=!0},p:Y,i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){S(e.$$.fragment,t),n=!1},d(t){H(e,t)}}}function me(l){let e,n,t,a=l[20].namespace+"",o,g,u,i=l[20].name+"",r,k,f,m,s,h,D,v,z,O;h=new ze({props:{size:16}});function R(){return l[15](l[20])}return{c(){e=B("div"),n=B("a"),t=B("span"),o=N(a),g=N(" / "),u=B("span"),r=N(i),f=j(),m=B("div"),s=B("button"),V(h.$$.fragment),this.h()},l(A){e=T(A,"DIV",{class:!0});var p=C(e);n=T(p,"A",{href:!0,class:!0});var c=C(n);t=T(c,"SPAN",{class:!0});var b=C(t);o=P(b,a),g=P(b," / "),b.forEach(d),u=T(c,"SPAN",{});var I=C(u);r=P(I,i),I.forEach(d),c.forEach(d),f=K(p),m=T(p,"DIV",{});var _=C(m);s=T(_,"BUTTON",{title:!0,class:!0});var M=C(s);L(h.$$.fragment,M),M.forEach(d),_.forEach(d),p.forEach(d),this.h()},h(){E(t,"class","opacity-50"),E(n,"href",k=Z(l[20].namespace,l[20].name)),E(n,"class","flex w-full flex-row items-center whitespace-pre px-4 py-2"),E(s,"title","Remove concept"),s.disabled=l[3],E(s,"class","p-3 opacity-50 hover:text-red-400 hover:opacity-100"),G(m,"opacity-40",l[3]),E(e,"class","flex justify-between border-b border-gray-200 hover:bg-gray-100"),G(e,"bg-blue-100",l[20].name===l[0])},m(A,p){y(A,e,p),$(e,n),$(n,t),$(t,o),$(t,g),$(n,u),$(u,r),$(e,f),$(e,m),$(m,s),q(h,s,null),v=!0,z||(O=[ge(s,"click",R),Se(D=De.call(null,m,{text:l[3]?re:""}))],z=!0)},p(A,p){l=A,(!v||p&32)&&a!==(a=l[20].namespace+"")&&U(o,a),(!v||p&32)&&i!==(i=l[20].name+"")&&U(r,i),(!v||p&32&&k!==(k=Z(l[20].namespace,l[20].name)))&&E(n,"href",k),(!v||p&8)&&(s.disabled=l[3]),D&&ye(D.update)&&p&8&&D.update.call(null,{text:l[3]?re:""}),(!v||p&8)&&G(m,"opacity-40",l[3]),(!v||p&33)&&G(e,"bg-blue-100",l[20].name===l[0])},i(A){v||(w(h.$$.fragment,A),v=!0)},o(A){S(h.$$.fragment,A),v=!1},d(A){A&&d(e),H(h),z=!1,Ae(O)}}}function Je(l){let e,n;return e=new Ve({props:{concept:l[6].data}}),{c(){V(e.$$.fragment)},l(t){L(e.$$.fragment,t)},m(t,a){q(e,t,a),n=!0},p(t,a){const o={};a&64&&(o.concept=t[6].data),e.$set(o)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){S(e.$$.fragment,t),n=!1},d(t){H(e,t)}}}function Qe(l){let e,n=l[6].error.message+"",t;return{c(){e=B("p"),t=N(n)},l(a){e=T(a,"P",{});var o=C(e);t=P(o,n),o.forEach(d)},m(a,o){y(a,e,o),$(e,t)},p(a,o){o&64&&n!==(n=a[6].error.message+"")&&U(t,n)},i:Y,o:Y,d(a){a&&d(e)}}}function We(l){let e,n;return e=new be({}),{c(){V(e.$$.fragment)},l(t){L(e.$$.fragment,t)},m(t,a){q(e,t,a),n=!0},p:Y,i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){S(e.$$.fragment,t),n=!1},d(t){H(e,t)}}}function pe(l){let e,n;return e=new He({props:{danger:!0,open:!0,modalHeading:"Delete concept",primaryButtonText:"Delete",primaryButtonIcon:l[4].isLoading?ce:void 0,secondaryButtonText:"Cancel",$$slots:{default:[Xe]},$$scope:{ctx:l}}}),e.$on("click:button--secondary",l[17]),e.$on("close",l[18]),e.$on("submit",l[19]),{c(){V(e.$$.fragment)},l(t){L(e.$$.fragment,t)},m(t,a){q(e,t,a),n=!0},p(t,a){const o={};a&16&&(o.primaryButtonIcon=t[4].isLoading?ce:void 0),a&8388610&&(o.$$scope={dirty:a,ctx:t}),e.$set(o)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){S(e.$$.fragment,t),n=!1},d(t){H(e,t)}}}function Xe(l){let e,n,t,a=l[1].namespace+"",o,g,u=l[1].name+"",i,r,k,f,m;return{c(){e=B("p"),n=N("Confirm deleting "),t=B("code"),o=N(a),g=N("/"),i=N(u),r=N(" ?"),k=j(),f=B("p"),m=N("This is a permanent action and cannot be undone."),this.h()},l(s){e=T(s,"P",{class:!0});var h=C(e);n=P(h,"Confirm deleting "),t=T(h,"CODE",{});var D=C(t);o=P(D,a),g=P(D,"/"),i=P(D,u),D.forEach(d),r=P(h," ?"),h.forEach(d),k=K(s),f=T(s,"P",{class:!0});var v=C(f);m=P(v,"This is a permanent action and cannot be undone."),v.forEach(d),this.h()},h(){E(e,"class","!text-lg"),E(f,"class","mt-2")},m(s,h){y(s,e,h),$(e,n),$(e,t),$(t,o),$(t,g),$(t,i),$(e,r),y(s,k,h),y(s,f,h),$(f,m)},p(s,h){h&2&&a!==(a=s[1].namespace+"")&&U(o,a),h&2&&u!==(u=s[1].name+"")&&U(i,u)},d(s){s&&d(e),s&&d(k),s&&d(f)}}}function Ze(l){let e,n,t,a,o,g,u,i,r,k,f,m,s,h;const D=[Ge,Fe],v=[];function z(c,b){return c[5].isLoading?0:c[5].isSuccess?1:-1}~(n=z(l))&&(t=v[n]=D[n](l));const O=[We,Qe,Je],R=[];function A(c,b){var I,_,M;return(I=c[6])!=null&&I.isLoading?0:(_=c[6])!=null&&_.isError?1:(M=c[6])!=null&&M.isSuccess?2:-1}~(i=A(l))&&(r=R[i]=O[i](l)),f=new Pe({});let p=l[1]&&pe(l);return{c(){e=B("div"),t&&t.c(),a=j(),o=B("div"),g=B("div"),u=B("div"),r&&r.c(),k=j(),V(f.$$.fragment),m=j(),p&&p.c(),s=le(),this.h()},l(c){e=T(c,"DIV",{class:!0});var b=C(e);t&&t.l(b),b.forEach(d),a=K(c),o=T(c,"DIV",{class:!0});var I=C(o);g=T(I,"DIV",{class:!0});var _=C(g);u=T(_,"DIV",{class:!0});var M=C(u);r&&r.l(M),M.forEach(d),_.forEach(d),I.forEach(d),k=K(c),L(f.$$.fragment,c),m=K(c),p&&p.l(c),s=le(),this.h()},h(){E(e,"class","flex-col border-r border-gray-200"),E(u,"class","lilac-page flex"),E(g,"class","lilac-container"),E(o,"class","flex h-full w-full")},m(c,b){y(c,e,b),~n&&v[n].m(e,null),y(c,a,b),y(c,o,b),$(o,g),$(g,u),~i&&R[i].m(u,null),y(c,k,b),q(f,c,b),y(c,m,b),p&&p.m(c,b),y(c,s,b),h=!0},p(c,b){let I=n;n=z(c),n===I?~n&&v[n].p(c,b):(t&&(W(),S(v[I],1,1,()=>{v[I]=null}),X()),~n?(t=v[n],t?t.p(c,b):(t=v[n]=D[n](c),t.c()),w(t,1),t.m(e,null)):t=null);let _=i;i=A(c),i===_?~i&&R[i].p(c,b):(r&&(W(),S(R[_],1,1,()=>{R[_]=null}),X()),~i?(r=R[i],r?r.p(c,b):(r=R[i]=O[i](c),r.c()),w(r,1),r.m(u,null)):r=null),c[1]?p?(p.p(c,b),b&2&&w(p,1)):(p=pe(c),p.c(),w(p,1),p.m(s.parentNode,s)):p&&(W(),S(p,1,1,()=>{p=null}),X())},i(c){h||(w(t),w(r),w(f.$$.fragment,c),w(p),h=!0)},o(c){S(t),S(r),S(f.$$.fragment,c),S(p),h=!1},d(c){c&&d(e),~n&&v[n].d(),c&&d(a),c&&d(o),~i&&R[i].d(),c&&d(k),H(f,c),c&&d(m),p&&p.d(c),c&&d(s)}}}function xe(l){let e;return{c(){e=N("Add Concept")},l(n){e=P(n,"Add Concept")},m(n,t){y(n,e,t)},d(n){n&&d(e)}}}function et(l){let e,n,t;return n=new Ye({props:{$$slots:{default:[xe]},$$scope:{ctx:l}}}),n.$on("click",l[14]),{c(){e=B("div"),V(n.$$.fragment),this.h()},l(a){e=T(a,"DIV",{slot:!0});var o=C(e);L(n.$$.fragment,o),o.forEach(d),this.h()},h(){E(e,"slot","header-right")},m(a,o){y(a,e,o),q(n,e,null),t=!0},p(a,o){const g={};o&8388608&&(g.$$scope={dirty:o,ctx:a}),n.$set(g)},i(a){t||(w(n.$$.fragment,a),t=!0)},o(a){S(n.$$.fragment,a),t=!1},d(a){a&&d(e),H(n)}}}function tt(l){let e,n;return e=new Te({props:{title:"Concepts",$$slots:{"header-right":[et],default:[Ze]},$$scope:{ctx:l}}}),{c(){V(e.$$.fragment)},l(t){L(e.$$.fragment,t)},m(t,a){q(e,t,a),n=!0},p(t,[a]){const o={};a&8388731&&(o.$$scope={dirty:a,ctx:t}),e.$set(o)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){S(e.$$.fragment,t),n=!1},d(t){H(e,t)}}}function nt(l,e,n){let t,a,o,g,u,i,r,k=Y,f=()=>(k(),k=we(a,_=>n(6,r=_)),a);F(l,Oe,_=>n(13,u=_)),l.$$.on_destroy.push(()=>k());let m,s,h=null;const D=Ie();F(l,D,_=>n(5,i=_));const v=Me();F(l,v,_=>n(4,o=_));const z=qe();F(l,z,_=>n(12,g=_));function O(){if(h==null)return;const{namespace:_,name:M}=h;o.mutate([_,M],{onSuccess:()=>{var ee;for(const[ve,$e]of Object.entries(Re)){const ke=(ee=Be(Le[ve]).selectRowsSchema)==null?void 0:ee.data;$e.deleteConcept(_,M,ke)}n(1,h=null)}})}const R=()=>oe({command:ie.CreateConcept,onCreate:_=>se(Z(_.detail.namespace,_.detail.name))}),A=_=>n(1,h={namespace:_.namespace,name:_.name}),p=()=>oe({command:ie.CreateConcept,onCreate:_=>se(Z(_.detail.namespace,_.detail.name))}),c=()=>n(1,h=null),b=()=>n(1,h=null),I=()=>O();return l.$$.update=()=>{var _;l.$$.dirty&8192&&u.onHashChange("",()=>{n(11,m=void 0),n(0,s=void 0)}),l.$$.dirty&8192&&u.onHashChange("/(?<namespace>.+)/(?<conceptName>.+)",M=>{n(11,m=M.namespace),n(0,s=M.conceptName)}),l.$$.dirty&4096&&n(3,t=((_=g.data)==null?void 0:_.read_only)??!0),l.$$.dirty&2049&&f(n(2,a=m&&s?Ne(m,s):void 0))},[s,h,a,t,o,i,r,D,v,z,O,m,g,u,R,A,p,c,b,I]}class ft extends _e{constructor(e){super(),de(this,e,nt,tt,he,{})}}export{ft as component};