nsthorat's picture
Push
7c35231
raw
history blame
No virus
11.3 kB
import{S as me,i as de,s as he,y as O,z as R,A as j,g as w,d as I,B as z,R as x,k as S,a as M,e as J,l as T,m as B,h as g,c as U,n as P,b as D,J as V,v as K,f as G,a1 as W,a5 as ge,q,r as A,u as Y,a3 as ie,a6 as fe,a7 as be,H as ee,K as $e,a8 as ve,P as ke}from"../chunks/index.01827105.js";import{g as ye}from"../chunks/navigation.d2b4b49c.js";import{P as Ce,q as we,d as Ee,a as Ie,h as ue}from"../chunks/Page.635e2ebb.js";import{g as Ve,C as De,t as Se,a as Te,I as ne,d as Be,b as Pe,c as Ne,V as qe,T as Ae}from"../chunks/ConceptView.4261977c.js";import{a as He,B as Le}from"../chunks/taskMonitoringStore.f29f8009.js";import{M as Oe,u as Re}from"../chunks/urlHashStore.ac1cecd5.js";import{c as te,S as _e}from"../chunks/utils.9f56da00.js";function le(o,t,n){const e=o.slice();return e[3]=t[n].namespace,e[13]=t[n].concepts,e}function oe(o,t,n){const e=o.slice();e[23]=t[n];const l=e[23].acls.write;return e[24]=l,e}function je(o){let t,n,e=o[7],l=[];for(let a=0;a<e.length;a+=1)l[a]=se(le(o,e,a));const c=a=>I(l[a],1,1,()=>{l[a]=null});return{c(){for(let a=0;a<l.length;a+=1)l[a].c();t=J()},l(a){for(let _=0;_<l.length;_+=1)l[_].l(a);t=J()},m(a,_){for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(a,_);D(a,t,_),n=!0},p(a,_){if(_&211){e=a[7];let r;for(r=0;r<e.length;r+=1){const m=le(a,e,r);l[r]?(l[r].p(m,_),w(l[r],1)):(l[r]=se(m),l[r].c(),w(l[r],1),l[r].m(t.parentNode,t))}for(K(),r=e.length;r<l.length;r+=1)c(r);G()}},i(a){if(!n){for(let _=0;_<e.length;_+=1)w(l[_]);n=!0}},o(a){l=l.filter(Boolean);for(let _=0;_<l.length;_+=1)I(l[_]);n=!1},d(a){ie(l,a),a&&g(t)}}}function ze(o){let t,n;return t=new _e({}),{c(){O(t.$$.fragment)},l(e){R(t.$$.fragment,e)},m(e,l){j(t,e,l),n=!0},p:W,i(e){n||(w(t.$$.fragment,e),n=!0)},o(e){I(t.$$.fragment,e),n=!1},d(e){z(t,e)}}}function Me(o){let t=o[3]+"",n;return{c(){n=q(t)},l(e){n=A(e,t)},m(e,l){D(e,n,l)},p(e,l){l&128&&t!==(t=e[3]+"")&&Y(n,t)},d(e){e&&g(n)}}}function Ue(o){let t,n;return{c(){t=q(o[6]),n=q("'s concepts")},l(e){t=A(e,o[6]),n=A(e,"'s concepts")},m(e,l){D(e,t,l),D(e,n,l)},p(e,l){l&64&&Y(t,e[6])},d(e){e&&g(t),e&&g(n)}}}function re(o){let t,n;return t=new qe({}),{c(){O(t.$$.fragment)},l(e){R(t.$$.fragment,e)},m(e,l){j(t,e,l),n=!0},i(e){n||(w(t.$$.fragment,e),n=!0)},o(e){I(t.$$.fragment,e),n=!1},d(e){z(t,e)}}}function ae(o){let t,n,e,l=o[23].name+"",c,a,_,r,m,y,v,b,f,h,p,E;y=new Ae({props:{size:16}});function u(){return o[17](o[23])}return{c(){t=S("div"),n=S("a"),e=S("span"),c=q(l),_=M(),r=S("div"),m=S("button"),O(y.$$.fragment),f=M(),this.h()},l(d){t=T(d,"DIV",{class:!0});var i=B(t);n=T(i,"A",{href:!0,class:!0});var N=B(n);e=T(N,"SPAN",{});var $=B(e);c=A($,l),$.forEach(g),N.forEach(g),_=U(i),r=T(i,"DIV",{});var s=B(r);m=T(s,"BUTTON",{title:!0,class:!0});var C=B(m);R(y.$$.fragment,C),C.forEach(g),s.forEach(g),f=U(i),i.forEach(g),this.h()},h(){P(n,"href",a=te(o[23].namespace,o[23].name)),P(n,"class","flex w-full flex-row items-center whitespace-pre px-8 py-2"),P(m,"title","Remove concept"),m.disabled=v=!o[24],P(m,"class","p-3 opacity-50 hover:text-red-400 hover:opacity-100"),ee(r,"opacity-40",!o[24]),P(t,"class","flex justify-between border-b border-gray-200 hover:bg-gray-100"),ee(t,"bg-blue-100",o[23].name===o[0])},m(d,i){D(d,t,i),V(t,n),V(n,e),V(e,c),V(t,_),V(t,r),V(r,m),j(y,m,null),V(t,f),h=!0,p||(E=[$e(m,"click",u),fe(b=ue.call(null,r,{text:o[24]?"":"User does not have access to delete this concept."}))],p=!0)},p(d,i){o=d,(!h||i&128)&&l!==(l=o[23].name+"")&&Y(c,l),(!h||i&128&&a!==(a=te(o[23].namespace,o[23].name)))&&P(n,"href",a),(!h||i&128&&v!==(v=!o[24]))&&(m.disabled=v),b&&ve(b.update)&&i&128&&b.update.call(null,{text:o[24]?"":"User does not have access to delete this concept."}),(!h||i&128)&&ee(r,"opacity-40",!o[24]),(!h||i&129)&&ee(t,"bg-blue-100",o[23].name===o[0])},i(d){h||(w(y.$$.fragment,d),h=!0)},o(d){I(y.$$.fragment,d),h=!1},d(d){d&&g(t),z(y),p=!1,ke(E)}}}function se(o){let t,n,e,l,c,a,_,r,m;function y(u,d){return u[3]===u[1]?Ue:Me}let v=y(o),b=v(o),f=o[3]===o[1]&&re(),h=o[13],p=[];for(let u=0;u<h.length;u+=1)p[u]=ae(oe(o,h,u));const E=u=>I(p[u],1,1,()=>{p[u]=null});return{c(){t=S("div"),n=S("div"),b.c(),e=M(),l=S("div"),f&&f.c(),c=M();for(let u=0;u<p.length;u+=1)p[u].c();a=J(),this.h()},l(u){t=T(u,"DIV",{class:!0});var d=B(t);n=T(d,"DIV",{});var i=B(n);b.l(i),i.forEach(g),e=U(d),l=T(d,"DIV",{class:!0});var N=B(l);f&&f.l(N),N.forEach(g),d.forEach(g),c=U(u);for(let $=0;$<p.length;$+=1)p[$].l(u);a=J(),this.h()},h(){P(l,"class","opacity-70"),P(t,"class","flex flex-row justify-between border-b border-gray-200 bg-neutral-50 p-3 text-sm opacity-80 hover:bg-gray-100")},m(u,d){D(u,t,d),V(t,n),b.m(n,null),V(t,e),V(t,l),f&&f.m(l,null),D(u,c,d);for(let i=0;i<p.length;i+=1)p[i]&&p[i].m(u,d);D(u,a,d),_=!0,r||(m=fe(ue.call(null,l,{text:"Your concepts are only visible to you when logged in with Google."})),r=!0)},p(u,d){if(v===(v=y(u))&&b?b.p(u,d):(b.d(1),b=v(u),b&&(b.c(),b.m(n,null))),u[3]===u[1]?f?d&130&&w(f,1):(f=re(),f.c(),w(f,1),f.m(l,null)):f&&(K(),I(f,1,1,()=>{f=null}),G()),d&145){h=u[13];let i;for(i=0;i<h.length;i+=1){const N=oe(u,h,i);p[i]?(p[i].p(N,d),w(p[i],1)):(p[i]=ae(N),p[i].c(),w(p[i],1),p[i].m(a.parentNode,a))}for(K(),i=h.length;i<p.length;i+=1)E(i);G()}},i(u){if(!_){w(f);for(let d=0;d<h.length;d+=1)w(p[d]);_=!0}},o(u){I(f),p=p.filter(Boolean);for(let d=0;d<p.length;d+=1)I(p[d]);_=!1},d(u){u&&g(t),b.d(),f&&f.d(),u&&g(c),ie(p,u),u&&g(a),r=!1,m()}}}function Ke(o){let t,n;return t=new Pe({props:{concept:o[9].data}}),{c(){O(t.$$.fragment)},l(e){R(t.$$.fragment,e)},m(e,l){j(t,e,l),n=!0},p(e,l){const c={};l&512&&(c.concept=e[9].data),t.$set(c)},i(e){n||(w(t.$$.fragment,e),n=!0)},o(e){I(t.$$.fragment,e),n=!1},d(e){z(t,e)}}}function Ge(o){let t,n=o[9].error+"",e;return{c(){t=S("p"),e=q(n)},l(l){t=T(l,"P",{});var c=B(t);e=A(c,n),c.forEach(g)},m(l,c){D(l,t,c),V(t,e)},p(l,c){c&512&&n!==(n=l[9].error+"")&&Y(e,n)},i:W,o:W,d(l){l&&g(t)}}}function Je(o){let t,n;return t=new _e({}),{c(){O(t.$$.fragment)},l(e){R(t.$$.fragment,e)},m(e,l){j(t,e,l),n=!0},p:W,i(e){n||(w(t.$$.fragment,e),n=!0)},o(e){I(t.$$.fragment,e),n=!1},d(e){z(t,e)}}}function ce(o){let t,n;return t=new Oe({props:{danger:!0,open:!0,modalHeading:"Delete concept",primaryButtonText:"Delete",primaryButtonIcon:o[8].isLoading?ne:void 0,secondaryButtonText:"Cancel",$$slots:{default:[Ye]},$$scope:{ctx:o}}}),t.$on("click:button--secondary",o[18]),t.$on("close",o[19]),t.$on("submit",o[20]),{c(){O(t.$$.fragment)},l(e){R(t.$$.fragment,e)},m(e,l){j(t,e,l),n=!0},p(e,l){const c={};l&256&&(c.primaryButtonIcon=e[8].isLoading?ne:void 0),l&134217744&&(c.$$scope={dirty:l,ctx:e}),t.$set(c)},i(e){n||(w(t.$$.fragment,e),n=!0)},o(e){I(t.$$.fragment,e),n=!1},d(e){z(t,e)}}}function Ye(o){let t,n,e,l=o[4].namespace+"",c,a,_=o[4].name+"",r,m,y,v,b;return{c(){t=S("p"),n=q("Confirm deleting "),e=S("code"),c=q(l),a=q("/"),r=q(_),m=q(" ?"),y=M(),v=S("p"),b=q("This is a permanent action and cannot be undone."),this.h()},l(f){t=T(f,"P",{class:!0});var h=B(t);n=A(h,"Confirm deleting "),e=T(h,"CODE",{});var p=B(e);c=A(p,l),a=A(p,"/"),r=A(p,_),p.forEach(g),m=A(h," ?"),h.forEach(g),y=U(f),v=T(f,"P",{class:!0});var E=B(v);b=A(E,"This is a permanent action and cannot be undone."),E.forEach(g),this.h()},h(){P(t,"class","!text-lg"),P(v,"class","mt-2")},m(f,h){D(f,t,h),V(t,n),V(t,e),V(e,c),V(e,a),V(e,r),V(t,m),D(f,y,h),D(f,v,h),V(v,b)},p(f,h){h&16&&l!==(l=f[4].namespace+"")&&Y(c,l),h&16&&_!==(_=f[4].name+"")&&Y(r,_)},d(f){f&&g(t),f&&g(y),f&&g(v)}}}function Fe(o){let t,n,e,l,c,a,_,r,m,y,v,b,f,h;const p=[ze,je],E=[];function u(s,C){return s[2].isLoading?0:s[2].isSuccess?1:-1}~(n=u(o))&&(e=E[n]=p[n](o));const d=[Je,Ge,Ke],i=[];function N(s,C){var H,L,k;return(H=s[9])!=null&&H.isLoading?0:(L=s[9])!=null&&L.isError?1:(k=s[9])!=null&&k.isSuccess?2:-1}~(r=N(o))&&(m=i[r]=d[r](o)),v=new De({});let $=o[4]&&ce(o);return{c(){t=S("div"),e&&e.c(),l=M(),c=S("div"),a=S("div"),_=S("div"),m&&m.c(),y=M(),O(v.$$.fragment),b=M(),$&&$.c(),f=J(),this.h()},l(s){t=T(s,"DIV",{class:!0});var C=B(t);e&&e.l(C),C.forEach(g),l=U(s),c=T(s,"DIV",{class:!0});var H=B(c);a=T(H,"DIV",{class:!0});var L=B(a);_=T(L,"DIV",{class:!0});var k=B(_);m&&m.l(k),k.forEach(g),L.forEach(g),H.forEach(g),y=U(s),R(v.$$.fragment,s),b=U(s),$&&$.l(s),f=J(),this.h()},h(){P(t,"class","flex-col border-r border-gray-200"),P(_,"class","lilac-page flex"),P(a,"class","lilac-container"),P(c,"class","flex h-full w-full")},m(s,C){D(s,t,C),~n&&E[n].m(t,null),D(s,l,C),D(s,c,C),V(c,a),V(a,_),~r&&i[r].m(_,null),D(s,y,C),j(v,s,C),D(s,b,C),$&&$.m(s,C),D(s,f,C),h=!0},p(s,C){let H=n;n=u(s),n===H?~n&&E[n].p(s,C):(e&&(K(),I(E[H],1,1,()=>{E[H]=null}),G()),~n?(e=E[n],e?e.p(s,C):(e=E[n]=p[n](s),e.c()),w(e,1),e.m(t,null)):e=null);let L=r;r=N(s),r===L?~r&&i[r].p(s,C):(m&&(K(),I(i[L],1,1,()=>{i[L]=null}),G()),~r?(m=i[r],m?m.p(s,C):(m=i[r]=d[r](s),m.c()),w(m,1),m.m(_,null)):m=null),s[4]?$?($.p(s,C),C&16&&w($,1)):($=ce(s),$.c(),w($,1),$.m(f.parentNode,f)):$&&(K(),I($,1,1,()=>{$=null}),G())},i(s){h||(w(e),w(m),w(v.$$.fragment,s),w($),h=!0)},o(s){I(e),I(m),I(v.$$.fragment,s),I($),h=!1},d(s){s&&g(t),~n&&E[n].d(),s&&g(l),s&&g(c),~r&&i[r].d(),s&&g(y),z(v,s),s&&g(b),$&&$.d(s),s&&g(f)}}}function Qe(o){let t;return{c(){t=q("Add Concept")},l(n){t=A(n,"Add Concept")},m(n,e){D(n,t,e)},d(n){n&&g(t)}}}function We(o){let t,n,e;return n=new Le({props:{size:"small",$$slots:{default:[Qe]},$$scope:{ctx:o}}}),n.$on("click",o[16]),{c(){t=S("div"),O(n.$$.fragment),this.h()},l(l){t=T(l,"DIV",{slot:!0});var c=B(t);R(n.$$.fragment,c),c.forEach(g),this.h()},h(){P(t,"slot","header-right")},m(l,c){D(l,t,c),j(n,t,null),e=!0},p(l,c){const a={};c&134217728&&(a.$$scope={dirty:c,ctx:l}),n.$set(a)},i(l){e||(w(n.$$.fragment,l),e=!0)},o(l){I(n.$$.fragment,l),e=!1},d(l){l&&g(t),z(n)}}}function Xe(o){let t,n;return t=new Ce({props:{title:"Concepts",$$slots:{"header-right":[We],default:[Fe]},$$scope:{ctx:o}}}),{c(){O(t.$$.fragment)},l(e){R(t.$$.fragment,e)},m(e,l){j(t,e,l),n=!0},p(e,[l]){const c={};l&134218711&&(c.$$scope={dirty:l,ctx:e}),t.$set(c)},i(e){n||(w(t.$$.fragment,e),n=!0)},o(e){I(t.$$.fragment,e),n=!1},d(e){z(t,e)}}}function Ze(o,t,n){let e,l,c,a,_,r,m,y,v,b=W,f=()=>(b(),b=ge(a,k=>n(9,v=k)),a);x(o,Re,k=>n(15,y=k)),o.$$.on_destroy.push(()=>b());let h,p,E=null;const u=we();x(o,u,k=>n(2,m=k));const d=Ee();x(o,d,k=>n(8,_=k));const i=He();x(o,i,k=>n(14,r=k));function N(){if(E==null)return;const{namespace:k,name:F}=E;_.mutate([k,F],{onSuccess:()=>{var Q;for(const[X,Z]of Object.entries(Be)){const pe=(Q=be(Ne[X]).selectRowsSchema)==null?void 0:Q.data;Z.deleteConcept(k,F,pe)}n(4,E=null)}})}const $=()=>Se({command:Te.CreateConcept,onCreate:k=>ye(te(k.detail.namespace,k.detail.name))}),s=k=>n(4,E={namespace:k.namespace,name:k.name}),C=()=>n(4,E=null),H=()=>n(4,E=null),L=()=>N();return o.$$.update=()=>{var k,F,Q,X;o.$$.dirty&32768&&y.onHashChange("",()=>{n(3,h=void 0),n(0,p=void 0)}),o.$$.dirty&32768&&y.onHashChange("/(?<namespace>.+)/(?<conceptName>.+)",Z=>{n(3,h=Z.namespace),n(0,p=Z.conceptName)}),o.$$.dirty&16384&&n(1,e=(F=(k=r.data)==null?void 0:k.user)==null?void 0:F.id),o.$$.dirty&6&&n(7,l=Ve(m.data||[],e)),o.$$.dirty&16384&&n(6,c=(X=(Q=r.data)==null?void 0:Q.user)==null?void 0:X.given_name),o.$$.dirty&9&&f(n(5,a=h&&p?Ie(h,p):void 0))},[p,e,m,h,E,a,c,l,_,v,d,i,N,u,r,y,$,s,C,H,L]}class at extends me{constructor(t){super(),de(this,t,Ze,Xe,he,{})}}export{at as component};