diff --git a/404.html b/404.html index ac2e4817..c4e0aaf6 100644 --- a/404.html +++ b/404.html @@ -35,5 +35,5 @@ - + diff --git a/6406.c75223de224c29cb.js b/6406.99dd912d181f49b2.js similarity index 81% rename from 6406.c75223de224c29cb.js rename to 6406.99dd912d181f49b2.js index 8821a195..dc40d62b 100644 --- a/6406.c75223de224c29cb.js +++ b/6406.99dd912d181f49b2.js @@ -1 +1 @@ -"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[6406],{86406:(q,y,r)=>{r.r(y),r.d(y,{TextComponent:()=>K});var _=r(10467),t=r(54438),s=r(89417),g=r(88834),M=r(65571),k=r(53719),f=r(99213),F=r(99631),N=r(36815),O=r(3902),v=r(60177),m=r(59115),j=r(36471),p=r(25596),C=r(14823),u=r(75351),E=r(82765);const I=["editor"];let R=(()=>{class l{constructor(){this.content="",this.contentChange=new t.bkB}ngAfterViewInit(){this.editor&&(this.editor.nativeElement.innerHTML=this.content,this.editor.nativeElement.addEventListener("input",()=>{this.contentChange.emit(this.editor.nativeElement.innerHTML)}))}pasteAsPlainText(){navigator.clipboard.readText().then(e=>{const o=window.getSelection();o&&o.rangeCount&&(o.deleteFromDocument(),o.getRangeAt(0).insertNode(document.createTextNode(e)))}).catch(e=>{console.error("Failed to read clipboard contents: ",e)})}changeFontFamily(e){document.execCommand("fontName",!1,e.target.value)}execCommand(e,o=null){document.execCommand(e,!1,o),this.emitContentChange()}changeColor(e,o){this.execCommand(e,o.target.value)}createLink(){const e=prompt("Enter the URL","http://");e&&this.execCommand("createLink",e)}changeFontSize(e){this.execCommand("fontSize",e.target.value)}emitContentChange(){const e=document.getElementById("editor");e&&(console.log(e),console.log("EMIT CHANGE!!"),console.log(e.innerHTML),this.contentChange.emit(e.innerHTML))}static{this.\u0275fac=function(o){return new(o||l)}}static{this.\u0275cmp=t.VBU({type:l,selectors:[["app-text-editor"]],viewQuery:function(o,n){if(1&o&&t.GBs(I,5),2&o){let i;t.mGM(i=t.lsd())&&(n.editor=i.first)}},inputs:{content:"content"},outputs:{contentChange:"contentChange"},standalone:!0,features:[t.aNF],decls:96,vars:1,consts:[["moreOptionsMenu","matMenu"],["editor",""],[1,"toolbar-actions","margin-bottom"],[1,"toolbar-actions"],["mat-icon-button","","matTooltip","Paste as text",3,"click"],["type","button","mat-icon-button","",3,"click"],["type","color","title","Font Color",3,"change"],["type","color","title","Highlight Color",3,"change"],[3,"change"],["value","1"],["value","2","selected",""],["value","3"],["value","4"],["value","5"],["mat-icon-button","",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["id","editor","contenteditable","true",1,"rich-text-editor"]],template:function(o,n){if(1&o){const i=t.RV6();t.j41(0,"mat-card",2)(1,"mat-card-content",3)(2,"button",4),t.bIt("click",function(){return t.eBV(i),t.Njj(n.pasteAsPlainText())}),t.j41(3,"mat-icon"),t.EFF(4,"content_paste"),t.k0s()(),t.j41(5,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("bold"))}),t.j41(6,"mat-icon"),t.EFF(7,"format_bold"),t.k0s()(),t.j41(8,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("italic"))}),t.j41(9,"mat-icon"),t.EFF(10,"format_italic"),t.k0s()(),t.j41(11,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("underline"))}),t.j41(12,"mat-icon"),t.EFF(13,"format_underlined"),t.k0s()(),t.j41(14,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("strikeThrough"))}),t.j41(15,"mat-icon"),t.EFF(16,"format_strikethrough"),t.k0s()(),t.j41(17,"input",6),t.bIt("change",function(d){return t.eBV(i),t.Njj(n.changeColor("foreColor",d))}),t.k0s(),t.j41(18,"input",7),t.bIt("change",function(d){return t.eBV(i),t.Njj(n.changeColor("hiliteColor",d))}),t.k0s(),t.j41(19,"select",8),t.bIt("change",function(d){return t.eBV(i),t.Njj(n.changeFontSize(d))}),t.j41(20,"option",9),t.EFF(21,"Small"),t.k0s(),t.j41(22,"option",10),t.EFF(23,"Normal"),t.k0s(),t.j41(24,"option",11),t.EFF(25,"Large"),t.k0s(),t.j41(26,"option",12),t.EFF(27,"X-Large"),t.k0s(),t.j41(28,"option",13),t.EFF(29,"XX-Large"),t.k0s()(),t.j41(30,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("insertOrderedList"))}),t.j41(31,"mat-icon"),t.EFF(32,"format_list_numbered"),t.k0s()(),t.j41(33,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("insertUnorderedList"))}),t.j41(34,"mat-icon"),t.EFF(35,"format_list_bulleted"),t.k0s()(),t.j41(36,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.createLink())}),t.j41(37,"mat-icon"),t.EFF(38,"insert_link"),t.k0s()(),t.j41(39,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("unlink"))}),t.j41(40,"mat-icon"),t.EFF(41,"link_off"),t.k0s()(),t.j41(42,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("indent"))}),t.j41(43,"mat-icon"),t.EFF(44,"format_indent_increase"),t.k0s()(),t.j41(45,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("outdent"))}),t.j41(46,"mat-icon"),t.EFF(47,"format_indent_decrease"),t.k0s()(),t.j41(48,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("undo"))}),t.j41(49,"mat-icon"),t.EFF(50,"undo"),t.k0s()(),t.j41(51,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("redo"))}),t.j41(52,"mat-icon"),t.EFF(53,"redo"),t.k0s()(),t.j41(54,"button",14)(55,"mat-icon"),t.EFF(56,"more_vert"),t.k0s()(),t.j41(57,"mat-menu",null,0)(59,"button",15),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("justifyLeft"))}),t.j41(60,"mat-icon"),t.EFF(61,"format_align_left"),t.k0s(),t.EFF(62," Left "),t.k0s(),t.j41(63,"button",15),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("justifyCenter"))}),t.j41(64,"mat-icon"),t.EFF(65,"format_align_center"),t.k0s(),t.EFF(66," Center "),t.k0s(),t.j41(67,"button",15),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("justifyRight"))}),t.j41(68,"mat-icon"),t.EFF(69,"format_align_right"),t.k0s(),t.EFF(70," Right "),t.k0s(),t.j41(71,"button",15),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("justifyFull"))}),t.j41(72,"mat-icon"),t.EFF(73,"format_align_justify"),t.k0s(),t.EFF(74," Justify "),t.k0s(),t.j41(75,"button",15),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("removeFormat"))}),t.j41(76,"mat-icon"),t.EFF(77,"format_clear"),t.k0s(),t.EFF(78," Clear "),t.k0s(),t.j41(79,"button",15),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("superscript"))}),t.j41(80,"mat-icon"),t.EFF(81,"superscript"),t.k0s(),t.j41(82,"span"),t.EFF(83,"Superscript"),t.k0s()(),t.j41(84,"button",15),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("subscript"))}),t.j41(85,"mat-icon"),t.EFF(86,"subscript"),t.k0s(),t.j41(87,"span"),t.EFF(88,"Subscript"),t.k0s()(),t.j41(89,"button",15),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("insertHorizontalRule"))}),t.j41(90,"mat-icon"),t.EFF(91,"horizontal_rule"),t.k0s(),t.j41(92,"span"),t.EFF(93,"Horizontal Rule"),t.k0s()()()()(),t.nrm(94,"div",16,1)}if(2&o){const i=t.sdS(58);t.R7$(54),t.Y8G("matMenuTriggerFor",i)}},dependencies:[g.Hl,g.iY,p.Hu,p.RN,p.m2,f.m_,f.An,m.Cn,m.kk,m.fb,m.Cp,C.uc,C.oV],styles:[".rich-text-editor[_ngcontent-%COMP%]{border:1px solid var(--mat-divider-color);padding:10px;min-height:200px;margin-top:10px;box-sizing:border-box;width:100%;height:100%;white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}.rich-text-editor[_ngcontent-%COMP%]:focus, .rich-text-editor[_ngcontent-%COMP%]:active{border-color:var(--mdc-outlined-text-field-caret-color, var(--mat-app-primary))}.toolbar-actions[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{display:inline-block;vertical-align:middle}input[type=color][_ngcontent-%COMP%]{border:none;background:none;height:32px;width:32px;padding:0;margin:0 4px;cursor:pointer}"]})}}return l})(),V=(()=>{class l{constructor(e,o){this.dialogRef=e,this.data=o,this.fb=(0,t.WQX)(s.ok),this.form=this.fb.group({title:[null],body:[null,s.k0.required],collaborators:["did:dht:6sf3y5rj4f8sq8rctpkp6w3npotmqrypnsdkc74j1n7uiu1raaco"],background:[null]}),this.dialogRef.updateSize("100vw","100vh"),this.data.body||(this.data.body="")}ngAfterViewInit(){}static{this.\u0275fac=function(o){return new(o||l)(t.rXU(u.CP),t.rXU(u.Vh))}}static{this.\u0275cmp=t.VBU({type:l,selectors:[["app-text-dialog"]],standalone:!0,features:[t.aNF],decls:17,vars:6,consts:[[1,"dialog-container"],[1,"dialog-content"],["appearance","outline",1,"full-width"],["matInput","","placeholder","Title","maxlength","200",3,"ngModelChange","ngModel"],["matInput","","placeholder","Image","maxlength","200",3,"ngModelChange","ngModel"],["matInput","","placeholder","Abstract",3,"ngModelChange","ngModel"],[1,"editor"],[3,"contentChange","content"],["align","end",1,"dialog-actions"],[1,"published-checkbox",3,"ngModelChange","ngModel"],["mat-button","","mat-dialog-close",""],["mat-flat-button","","type","submit","cdkFocusInitial","",3,"mat-dialog-close"]],template:function(o,n){1&o&&(t.j41(0,"div",0)(1,"mat-dialog-content",1)(2,"mat-form-field",2)(3,"input",3),t.mxI("ngModelChange",function(a){return t.DH7(n.data.title,a)||(n.data.title=a),a}),t.k0s()(),t.j41(4,"mat-form-field",2)(5,"input",4),t.mxI("ngModelChange",function(a){return t.DH7(n.data.image,a)||(n.data.image=a),a}),t.k0s()(),t.j41(6,"mat-form-field",2)(7,"textarea",5),t.mxI("ngModelChange",function(a){return t.DH7(n.data.abstract,a)||(n.data.abstract=a),a}),t.k0s()(),t.j41(8,"div",6)(9,"app-text-editor",7),t.mxI("contentChange",function(a){return t.DH7(n.data.body,a)||(n.data.body=a),a}),t.k0s()()(),t.j41(10,"mat-dialog-actions",8)(11,"mat-checkbox",9),t.mxI("ngModelChange",function(a){return t.DH7(n.data.published,a)||(n.data.published=a),a}),t.EFF(12,"Publish"),t.k0s(),t.j41(13,"button",10),t.EFF(14,"Cancel"),t.k0s(),t.j41(15,"button",11),t.EFF(16,"Save"),t.k0s()()()),2&o&&(t.R7$(3),t.R50("ngModel",n.data.title),t.R7$(2),t.R50("ngModel",n.data.image),t.R7$(2),t.R50("ngModel",n.data.abstract),t.R7$(2),t.R50("content",n.data.body),t.R7$(2),t.R50("ngModel",n.data.published),t.R7$(4),t.Y8G("mat-dialog-close",!0))},dependencies:[v.MD,C.uc,m.Cn,f.m_,g.Hl,g.$z,F.fS,F.fg,k.rl,u.hM,u.tx,u.E7,u.Yi,s.YN,s.me,s.BC,s.tU,s.vS,E.g7,E.So,R],styles:["form[_ngcontent-%COMP%]{display:inline}.published-checkbox[_ngcontent-%COMP%]{margin-left:.6em;margin-right:.6em}[_nghost-%COMP%]{display:block;height:100vh;width:100vw;margin:0;padding:0}mat-dialog-container[_ngcontent-%COMP%]{height:100%;width:100%;max-height:100vh;max-width:100vw;overflow:hidden}.full-width[_ngcontent-%COMP%]{width:100%}.dialog-content[_ngcontent-%COMP%]{padding-bottom:60px;box-sizing:border-box}.dialog-actions[_ngcontent-%COMP%]{position:fixed;bottom:0;left:0;width:100%;box-sizing:border-box}.dialog-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.dialog-content[_ngcontent-%COMP%]{flex:1;overflow:auto;box-sizing:border-box;max-height:calc(100vh - 64px)}.dialog-actions[_ngcontent-%COMP%]{flex-shrink:0;box-sizing:border-box}"]})}}return l})();var h=r(70669),B=r(37064),P=r(52778),T=r(82798),x=r(66969),S=r(48067);let w=(()=>{class l{transform(e,o=200){if(!e)return"...";let n=e.replace(/<\/?[^>]+(>|$)/g," ");n=n.replace(/ /g," ");const i=n.replace(/\s\s+/g," ").trim();let a=i;return i.length>o&&(a=i.substring(0,o)),a.trim()+"..."}static{this.\u0275fac=function(o){return new(o||l)}}static{this.\u0275pipe=t.EJ8({name:"stripHtml",type:l,pure:!0,standalone:!0})}}return l})();var $=r(42745),D=r(86600),G=r(71997);function X(l,c){if(1&l){const e=t.RV6();t.j41(0,"mat-chip-option",10),t.bIt("click",function(n){t.eBV(e);const i=t.XpG();return t.Njj(i.onSelectionChange(n))}),t.EFF(1),t.k0s()}if(2&l){const e=c.$implicit;t.Y8G("value",e),t.R7$(),t.JRh(e)}}function H(l,c){if(1&l){const e=t.RV6();t.j41(0,"mat-card-title",20),t.bIt("click",function(){t.eBV(e);const n=t.XpG().$implicit,i=t.XpG();return t.Njj(i.editText(n))}),t.EFF(1),t.k0s()}if(2&l){const e=t.XpG().$implicit;t.R7$(),t.JRh(e.data.title)}}function L(l,c){if(1&l&&t.nrm(0,"img",12),2&l){const e=t.XpG().$implicit;t.Y8G("src",e.data.image,t.B4B)}}function z(l,c){if(1&l&&t.EFF(0),2&l){const e=t.XpG().$implicit;t.SpI("",e.data.abstract," ")}}function A(l,c){if(1&l&&(t.EFF(0),t.nI1(1,"stripHtml")),2&l){const e=t.XpG().$implicit;t.SpI("",t.i5U(1,1,e.data.body,200)," ")}}function Q(l,c){1&l&&(t.j41(0,"mat-icon",14),t.EFF(1,"check_box"),t.k0s())}function Y(l,c){1&l&&(t.j41(0,"mat-icon",15),t.EFF(1,"check_box_outline_blank"),t.k0s())}function J(l,c){if(1&l&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&l){const e=t.XpG(2).$implicit;t.R7$(),t.Lme(" (+",((null==e.data.labels?null:e.data.labels.length)||0)-1," ",2===(null==e.data.labels?null:e.data.labels.length)?"other":"others",") ")}}function U(l,c){if(1&l&&(t.j41(0,"mat-option",7),t.EFF(1),t.k0s()),2&l){const e=c.$implicit;t.Y8G("value",e),t.R7$(),t.JRh(e)}}function W(l,c){if(1&l){const e=t.RV6();t.j41(0,"mat-card",21)(1,"mat-form-field",22)(2,"mat-label"),t.EFF(3,"Labels"),t.k0s(),t.j41(4,"mat-select",23),t.mxI("ngModelChange",function(n){t.eBV(e);const i=t.XpG().$implicit;return t.DH7(i.data.labels,n)||(i.data.labels=n),t.Njj(n)}),t.j41(5,"mat-select-trigger"),t.EFF(6),t.DNE(7,J,2,2,"span"),t.k0s(),t.Z7z(8,U,2,2,"mat-option",7,t.fX1),t.k0s()()()}if(2&l){const e=t.XpG().$implicit,o=t.XpG();t.R7$(4),t.R50("ngModel",e.data.labels),t.R7$(2),t.SpI(" ",(null==e.data.labels?null:e.data.labels[0])||""," "),t.R7$(),t.vxM(((null==e.data.labels?null:e.data.labels.length)||0)>1?7:-1),t.R7$(),t.Dyx(o.labels())}}function Z(l,c){if(1&l){const e=t.RV6();t.j41(0,"mat-card",9),t.DNE(1,H,2,1,"mat-card-title"),t.j41(2,"mat-card-content",11),t.bIt("click",function(){const n=t.eBV(e).$implicit,i=t.XpG();return t.Njj(i.editText(n))}),t.DNE(3,L,1,1,"img",12)(4,z,1,1)(5,A,2,4),t.k0s(),t.j41(6,"mat-card-footer")(7,"button",13),t.DNE(8,Q,2,0,"mat-icon",14)(9,Y,2,0,"mat-icon",15),t.k0s(),t.j41(10,"button",16,0),t.bIt("click",function(){const n=t.eBV(e).$implicit;return t.Njj(n.open=!n.open)}),t.j41(12,"mat-icon"),t.EFF(13,"new_label"),t.k0s()(),t.DNE(14,W,10,3,"ng-template",17),t.bIt("backdropClick",function(){const n=t.eBV(e).$implicit,i=t.XpG();return t.Njj(i.closeLabelsMenu(n))}),t.j41(15,"button",18)(16,"mat-icon"),t.EFF(17,"more_vert"),t.k0s()(),t.j41(18,"mat-menu",null,1)(20,"button",19),t.bIt("click",function(){const n=t.eBV(e).$implicit,i=t.XpG();return t.Njj(i.editText(n))}),t.j41(21,"mat-icon"),t.EFF(22,"edit"),t.k0s(),t.j41(23,"span"),t.EFF(24,"Edit text"),t.k0s()(),t.j41(25,"button",19),t.bIt("click",function(){const n=t.eBV(e).$implicit,i=t.XpG();return t.Njj(i.copyText(n))}),t.j41(26,"mat-icon"),t.EFF(27,"file_copy"),t.k0s(),t.j41(28,"span"),t.EFF(29,"Make a copy"),t.k0s()(),t.nrm(30,"mat-divider"),t.j41(31,"button",19),t.bIt("click",function(){const n=t.eBV(e).$implicit,i=t.XpG();return t.Njj(i.deleteText(n))}),t.j41(32,"mat-icon"),t.EFF(33,"delete"),t.k0s(),t.j41(34,"span"),t.EFF(35,"Delete text"),t.k0s()()()()()}if(2&l){const e=c.$implicit,o=t.sdS(11),n=t.sdS(19);t.R7$(),t.vxM(e.data.title?1:-1),t.R7$(2),t.vxM(e.data.image?3:-1),t.R7$(),t.vxM(e.data.abstract?4:5),t.R7$(3),t.Y8G("disabled",!0)("matTooltip",e.record.published?"Published":"Not published")("matTooltipDisabled",!1),t.R7$(),t.vxM(e.record.published?8:9),t.R7$(6),t.Y8G("cdkConnectedOverlayHasBackdrop",!0)("cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop")("cdkConnectedOverlayOrigin",o)("cdkConnectedOverlayOpen",e.open),t.R7$(),t.Y8G("matMenuTriggerFor",n)}}let K=(()=>{class l{closeLabelsMenu(e){var o=this;return(0,_.A)(function*(){e.open=!1,console.log("Menu closed:",e),yield o.saveText(e,e.data)})()}constructor(){var e=this;this.viewStyle=(0,t.geq)("card"),this.selectedTag="",this.bold=!1,this.bold2=!1,this.dialog=(0,t.WQX)(u.bZ),this.layout=(0,t.WQX)(N.Y),this.identity=(0,t.WQX)(B.K),this.app=(0,t.WQX)(P.d),this.toppings=new s.MJ(""),this.labels=(0,t.vPA)(["Travel","Inspiration","Lifestyle","Food","Photography"]),this.labelMap={Travel:"label1",Inspiration:"label2",Lifestyle:"label3",Food:"label4",Photography:"label5"},this.records=(0,t.vPA)([]),this.checkedColumns=[],this.columnsCopy=[{key:1,title:"test"}],this.layout.marginOn(),this.layout.disableNavigation(),this.layout.resetActions(),(0,t.QZP)((0,_.A)(function*(){e.app.initialized()&&(yield e.loadNotes())}))}deleteText(e){var o=this;return(0,_.A)(function*(){const{status:n}=yield e.record.delete();n&&o.records.update(i=>i.filter(a=>a.record!=e.record))})()}newNote(){this.editText({data:{title:"",body:"",background:"",collaborators:[],labels:[],published:!0}})}loadNotes(e){var o=this;return(0,_.A)(function*(){console.log("VALUE OF TAGS:",e);var{records:n}=yield o.identity.web5.dwn.records.query({message:{filter:{tags:e,protocol:h.Q.protocol,schema:h.Q.types.entry.schema,dataFormat:h.Q.types.entry.dataFormats[0]},dateSort:$.U0.CreatedDescending}});if(o.records.set([]),n)for(const i of n){let a=yield i.data.json(),d={record:i,data:a};o.records.update(b=>[...b,d])}console.log("All requests:",o.records())})()}onSelectionChange(e){console.log("Selection changed:",e),console.log(this.selectedTag),this.selectedTag?this.loadNotes({labels:this.selectedTag}):this.loadNotes()}ngOnDestroy(){this.layout.enableScrolling()}copyText(e){const o=JSON.parse(JSON.stringify(e.data));this.saveText({data:o},o)}editText(e){var o=this;let n={title:e.data.title,body:e.data.body,abstract:e.data.abstract,background:e.data.background,collaborators:[],labels:e.data.labels,published:e.record?e.record.published:e.data.published,image:e.data.image};const i=JSON.parse(JSON.stringify(n)),a=this.dialog.open(V,{width:"100vw",height:"100vh",maxWidth:"100vw",maxHeight:"100vh",panelClass:"full-screen-dialog",data:n});return a.afterClosed().subscribe(function(){var d=(0,_.A)(function*(b){b?(console.log("data result for saving:",n),e.data=n,yield o.saveText(e,n)):n=i});return function(b){return d.apply(this,arguments)}}()),a.afterClosed()}ngOnInit(){}selectColor(){}saveText(e,o){var n=this;return(0,_.A)(function*(){const i=o.published;if(e.record){e.record.tags.labels=o.labels;const{status:a}=yield e.record.update({data:o,published:i});console.log("Record status:",a),yield e.record.send()}else{const{record:a,status:d}=yield n.identity.web5.dwn.records.create({data:o,message:{published:i,tags:{labels:o.labels},protocol:h.Q.protocol,protocolPath:"entry",schema:h.Q.types.entry.schema,dataFormat:h.Q.types.entry.dataFormats[0]}});console.log("Record created:",a),console.log("Record status:",d),a&&(e.record=a,n.records.update(b=>[e,...b]),yield e.record.send())}})()}static{this.\u0275fac=function(o){return new(o||l)}}static{this.\u0275cmp=t.VBU({type:l,selectors:[["app-text"]],inputs:{viewStyle:[1,"viewStyle"]},outputs:{viewStyle:"viewStyleChange"},standalone:!0,features:[t.aNF],decls:14,vars:2,consts:[["trigger","cdkOverlayOrigin"],["menuActions","matMenu"],[1,"toolbar-actions","margin-bottom"],["type","button","mat-button","",3,"click"],[1,"notes"],[1,"notes-top"],[3,"ngModelChange","multiple","ngModel"],[3,"value"],[1,"notes-items"],[1,"marketplace-category"],[3,"click","value"],[1,"note-body",3,"click"],[1,"text-image",3,"src"],["mat-icon-button","",3,"disabled","matTooltip","matTooltipDisabled"],["title","Published"],["title","Not published"],["mat-icon-button","","matTooltip","Labels","type","button","cdkOverlayOrigin","",3,"click"],["cdkConnectedOverlay","",3,"backdropClick","cdkConnectedOverlayHasBackdrop","cdkConnectedOverlayBackdropClass","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen"],["mat-icon-button","","matTooltip","Options",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],[3,"click"],[1,"label-option"],["subscriptSizing","dynamic"],["multiple","",3,"ngModelChange","ngModel"]],template:function(o,n){1&o&&(t.j41(0,"mat-card",2)(1,"mat-card-content")(2,"button",3),t.bIt("click",function(){return n.newNote()}),t.j41(3,"mat-icon"),t.EFF(4,"create"),t.k0s(),t.EFF(5," New text "),t.k0s()()(),t.j41(6,"div",4)(7,"div",5)(8,"mat-chip-listbox",6),t.mxI("ngModelChange",function(a){return t.DH7(n.selectedTag,a)||(n.selectedTag=a),a}),t.Z7z(9,X,2,2,"mat-chip-option",7,t.fX1),t.k0s()(),t.j41(11,"div",8),t.Z7z(12,Z,36,12,"mat-card",9,t.fX1),t.k0s()()),2&o&&(t.R7$(8),t.Y8G("multiple",!1),t.R50("ngModel",n.selectedTag),t.R7$(),t.Dyx(n.labels()),t.R7$(3),t.Dyx(n.records()))},dependencies:[v.MD,T.Ve,k.rl,k.nJ,T.VO,T.$2,D.wT,u.hM,C.uc,C.oV,p.Hu,p.RN,p.m2,p.WQ,p.dh,j.YN,j.uI,j.gq,s.YN,s.BC,s.vS,g.Hl,g.$z,g.iY,f.m_,f.An,F.fS,O.Fg,G.q,m.Cn,m.kk,m.fb,m.Cp,M.Vg,k.RG,s.X1,x.z_,x.WB,x.$Q,S.iw,w],styles:[".notes[_ngcontent-%COMP%]{height:100%}.note-body[_ngcontent-%COMP%]{white-space:pre-wrap}.notes-top[_ngcontent-%COMP%]{margin-bottom:1em}.large-icon[_ngcontent-%COMP%]{transform:scale(2)}.label-option[_ngcontent-%COMP%]{min-width:200px}.text-image[_ngcontent-%COMP%]{width:100%;height:200px;object-fit:cover}.marketplace-category[_ngcontent-%COMP%]{display:inline-block;padding:12px 16px;margin-right:1em;margin-bottom:1em;max-width:210px;font-size:.9em}.notes-items[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%]{cursor:pointer;padding:0!important;margin-bottom:.4em}.notes-items[_ngcontent-%COMP%] mat-card-title[_ngcontent-%COMP%]{cursor:pointer}.notes-items[_ngcontent-%COMP%] mat-card-footer[_ngcontent-%COMP%]{font-size:1.2em;width:100%;text-align:center;display:block}"]})}}return l})()}}]); \ No newline at end of file +"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[6406],{86406:(q,y,r)=>{r.r(y),r.d(y,{TextComponent:()=>K});var _=r(10467),t=r(54438),s=r(89417),g=r(88834),M=r(65571),k=r(53719),f=r(99213),F=r(99631),N=r(36815),O=r(3902),v=r(60177),m=r(59115),j=r(36471),p=r(25596),C=r(14823),u=r(75351),E=r(82765);const I=["editor"];let R=(()=>{class l{constructor(){this.content="",this.contentChange=new t.bkB}ngAfterViewInit(){this.editor&&(this.editor.nativeElement.innerHTML=this.content,this.editor.nativeElement.addEventListener("input",()=>{this.contentChange.emit(this.editor.nativeElement.innerHTML)}))}pasteAsPlainText(){navigator.clipboard.readText().then(e=>{const o=window.getSelection();o&&o.rangeCount&&(o.deleteFromDocument(),o.getRangeAt(0).insertNode(document.createTextNode(e)))}).catch(e=>{console.error("Failed to read clipboard contents: ",e)})}changeFontFamily(e){document.execCommand("fontName",!1,e.target.value)}execCommand(e,o=null){document.execCommand(e,!1,o),this.emitContentChange()}changeColor(e,o){this.execCommand(e,o.target.value)}createLink(){const e=prompt("Enter the URL","http://");e&&this.execCommand("createLink",e)}changeFontSize(e){this.execCommand("fontSize",e.target.value)}emitContentChange(){const e=document.getElementById("editor");e&&(console.log(e),console.log("EMIT CHANGE!!"),console.log(e.innerHTML),this.contentChange.emit(e.innerHTML))}static{this.\u0275fac=function(o){return new(o||l)}}static{this.\u0275cmp=t.VBU({type:l,selectors:[["app-text-editor"]],viewQuery:function(o,n){if(1&o&&t.GBs(I,5),2&o){let i;t.mGM(i=t.lsd())&&(n.editor=i.first)}},inputs:{content:"content"},outputs:{contentChange:"contentChange"},standalone:!0,features:[t.aNF],decls:96,vars:1,consts:[["moreOptionsMenu","matMenu"],["editor",""],[1,"toolbar-actions","margin-bottom"],[1,"toolbar-actions"],["mat-icon-button","","matTooltip","Paste as text",3,"click"],["type","button","mat-icon-button","",3,"click"],["type","color","title","Font Color",3,"change"],["type","color","title","Highlight Color",3,"change"],[3,"change"],["value","1"],["value","2","selected",""],["value","3"],["value","4"],["value","5"],["mat-icon-button","",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["id","editor","contenteditable","true",1,"rich-text-editor"]],template:function(o,n){if(1&o){const i=t.RV6();t.j41(0,"mat-card",2)(1,"mat-card-content",3)(2,"button",4),t.bIt("click",function(){return t.eBV(i),t.Njj(n.pasteAsPlainText())}),t.j41(3,"mat-icon"),t.EFF(4,"content_paste"),t.k0s()(),t.j41(5,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("bold"))}),t.j41(6,"mat-icon"),t.EFF(7,"format_bold"),t.k0s()(),t.j41(8,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("italic"))}),t.j41(9,"mat-icon"),t.EFF(10,"format_italic"),t.k0s()(),t.j41(11,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("underline"))}),t.j41(12,"mat-icon"),t.EFF(13,"format_underlined"),t.k0s()(),t.j41(14,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("strikeThrough"))}),t.j41(15,"mat-icon"),t.EFF(16,"format_strikethrough"),t.k0s()(),t.j41(17,"input",6),t.bIt("change",function(d){return t.eBV(i),t.Njj(n.changeColor("foreColor",d))}),t.k0s(),t.j41(18,"input",7),t.bIt("change",function(d){return t.eBV(i),t.Njj(n.changeColor("hiliteColor",d))}),t.k0s(),t.j41(19,"select",8),t.bIt("change",function(d){return t.eBV(i),t.Njj(n.changeFontSize(d))}),t.j41(20,"option",9),t.EFF(21,"Small"),t.k0s(),t.j41(22,"option",10),t.EFF(23,"Normal"),t.k0s(),t.j41(24,"option",11),t.EFF(25,"Large"),t.k0s(),t.j41(26,"option",12),t.EFF(27,"X-Large"),t.k0s(),t.j41(28,"option",13),t.EFF(29,"XX-Large"),t.k0s()(),t.j41(30,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("insertOrderedList"))}),t.j41(31,"mat-icon"),t.EFF(32,"format_list_numbered"),t.k0s()(),t.j41(33,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("insertUnorderedList"))}),t.j41(34,"mat-icon"),t.EFF(35,"format_list_bulleted"),t.k0s()(),t.j41(36,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.createLink())}),t.j41(37,"mat-icon"),t.EFF(38,"insert_link"),t.k0s()(),t.j41(39,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("unlink"))}),t.j41(40,"mat-icon"),t.EFF(41,"link_off"),t.k0s()(),t.j41(42,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("indent"))}),t.j41(43,"mat-icon"),t.EFF(44,"format_indent_increase"),t.k0s()(),t.j41(45,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("outdent"))}),t.j41(46,"mat-icon"),t.EFF(47,"format_indent_decrease"),t.k0s()(),t.j41(48,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("undo"))}),t.j41(49,"mat-icon"),t.EFF(50,"undo"),t.k0s()(),t.j41(51,"button",5),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("redo"))}),t.j41(52,"mat-icon"),t.EFF(53,"redo"),t.k0s()(),t.j41(54,"button",14)(55,"mat-icon"),t.EFF(56,"more_vert"),t.k0s()(),t.j41(57,"mat-menu",null,0)(59,"button",15),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("justifyLeft"))}),t.j41(60,"mat-icon"),t.EFF(61,"format_align_left"),t.k0s(),t.EFF(62," Left "),t.k0s(),t.j41(63,"button",15),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("justifyCenter"))}),t.j41(64,"mat-icon"),t.EFF(65,"format_align_center"),t.k0s(),t.EFF(66," Center "),t.k0s(),t.j41(67,"button",15),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("justifyRight"))}),t.j41(68,"mat-icon"),t.EFF(69,"format_align_right"),t.k0s(),t.EFF(70," Right "),t.k0s(),t.j41(71,"button",15),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("justifyFull"))}),t.j41(72,"mat-icon"),t.EFF(73,"format_align_justify"),t.k0s(),t.EFF(74," Justify "),t.k0s(),t.j41(75,"button",15),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("removeFormat"))}),t.j41(76,"mat-icon"),t.EFF(77,"format_clear"),t.k0s(),t.EFF(78," Clear "),t.k0s(),t.j41(79,"button",15),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("superscript"))}),t.j41(80,"mat-icon"),t.EFF(81,"superscript"),t.k0s(),t.j41(82,"span"),t.EFF(83,"Superscript"),t.k0s()(),t.j41(84,"button",15),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("subscript"))}),t.j41(85,"mat-icon"),t.EFF(86,"subscript"),t.k0s(),t.j41(87,"span"),t.EFF(88,"Subscript"),t.k0s()(),t.j41(89,"button",15),t.bIt("click",function(){return t.eBV(i),t.Njj(n.execCommand("insertHorizontalRule"))}),t.j41(90,"mat-icon"),t.EFF(91,"horizontal_rule"),t.k0s(),t.j41(92,"span"),t.EFF(93,"Horizontal Rule"),t.k0s()()()()(),t.nrm(94,"div",16,1)}if(2&o){const i=t.sdS(58);t.R7$(54),t.Y8G("matMenuTriggerFor",i)}},dependencies:[g.Hl,g.iY,p.Hu,p.RN,p.m2,f.m_,f.An,m.Cn,m.kk,m.fb,m.Cp,C.uc,C.oV],styles:[".rich-text-editor[_ngcontent-%COMP%]{border:1px solid var(--mat-divider-color);padding:10px;min-height:200px;margin-top:10px;box-sizing:border-box;width:100%;height:100%;white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}.rich-text-editor[_ngcontent-%COMP%]:focus, .rich-text-editor[_ngcontent-%COMP%]:active{border-color:var(--mdc-outlined-text-field-caret-color, var(--mat-app-primary))}.toolbar-actions[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{display:inline-block;vertical-align:middle}input[type=color][_ngcontent-%COMP%]{border:none;background:none;height:32px;width:32px;padding:0;margin:0 4px;cursor:pointer}"]})}}return l})(),V=(()=>{class l{constructor(e,o){this.dialogRef=e,this.data=o,this.fb=(0,t.WQX)(s.ok),this.form=this.fb.group({title:[null],body:[null,s.k0.required],collaborators:["did:dht:6sf3y5rj4f8sq8rctpkp6w3npotmqrypnsdkc74j1n7uiu1raaco"],background:[null]}),this.dialogRef.updateSize("100vw","100vh"),this.data.body||(this.data.body="")}ngAfterViewInit(){}static{this.\u0275fac=function(o){return new(o||l)(t.rXU(u.CP),t.rXU(u.Vh))}}static{this.\u0275cmp=t.VBU({type:l,selectors:[["app-text-dialog"]],standalone:!0,features:[t.aNF],decls:17,vars:6,consts:[[1,"dialog-container"],[1,"dialog-content"],["appearance","outline",1,"full-width"],["matInput","","placeholder","Title","maxlength","200",3,"ngModelChange","ngModel"],["matInput","","placeholder","Image","maxlength","200",3,"ngModelChange","ngModel"],["matInput","","placeholder","Abstract",3,"ngModelChange","ngModel"],[1,"editor"],[3,"contentChange","content"],["align","end",1,"dialog-actions"],[1,"published-checkbox",3,"ngModelChange","ngModel"],["mat-button","","mat-dialog-close",""],["mat-flat-button","","type","submit","cdkFocusInitial","",3,"mat-dialog-close"]],template:function(o,n){1&o&&(t.j41(0,"div",0)(1,"mat-dialog-content",1)(2,"mat-form-field",2)(3,"input",3),t.mxI("ngModelChange",function(a){return t.DH7(n.data.title,a)||(n.data.title=a),a}),t.k0s()(),t.j41(4,"mat-form-field",2)(5,"input",4),t.mxI("ngModelChange",function(a){return t.DH7(n.data.image,a)||(n.data.image=a),a}),t.k0s()(),t.j41(6,"mat-form-field",2)(7,"textarea",5),t.mxI("ngModelChange",function(a){return t.DH7(n.data.abstract,a)||(n.data.abstract=a),a}),t.k0s()(),t.j41(8,"div",6)(9,"app-text-editor",7),t.mxI("contentChange",function(a){return t.DH7(n.data.body,a)||(n.data.body=a),a}),t.k0s()()(),t.j41(10,"mat-dialog-actions",8)(11,"mat-checkbox",9),t.mxI("ngModelChange",function(a){return t.DH7(n.data.published,a)||(n.data.published=a),a}),t.EFF(12,"Publish"),t.k0s(),t.j41(13,"button",10),t.EFF(14,"Cancel"),t.k0s(),t.j41(15,"button",11),t.EFF(16,"Save"),t.k0s()()()),2&o&&(t.R7$(3),t.R50("ngModel",n.data.title),t.R7$(2),t.R50("ngModel",n.data.image),t.R7$(2),t.R50("ngModel",n.data.abstract),t.R7$(2),t.R50("content",n.data.body),t.R7$(2),t.R50("ngModel",n.data.published),t.R7$(4),t.Y8G("mat-dialog-close",!0))},dependencies:[v.MD,C.uc,m.Cn,f.m_,g.Hl,g.$z,F.fS,F.fg,k.rl,u.hM,u.tx,u.E7,u.Yi,s.YN,s.me,s.BC,s.tU,s.vS,E.g7,E.So,R],styles:["form[_ngcontent-%COMP%]{display:inline}.published-checkbox[_ngcontent-%COMP%]{margin-left:.6em;margin-right:.6em}[_nghost-%COMP%]{display:block;height:100vh;width:100vw;margin:0;padding:0}mat-dialog-container[_ngcontent-%COMP%]{height:100%;width:100%;max-height:100vh;max-width:100vw;overflow:hidden}.full-width[_ngcontent-%COMP%]{width:100%}.dialog-content[_ngcontent-%COMP%]{padding-bottom:60px;box-sizing:border-box}.dialog-actions[_ngcontent-%COMP%]{position:fixed;bottom:0;left:0;width:100%;box-sizing:border-box}.dialog-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.dialog-content[_ngcontent-%COMP%]{flex:1;overflow:auto;box-sizing:border-box;max-height:calc(100vh - 64px)}.dialog-actions[_ngcontent-%COMP%]{flex-shrink:0;box-sizing:border-box}"]})}}return l})();var h=r(70669),B=r(37064),P=r(52778),T=r(82798),x=r(66969),S=r(48067);let w=(()=>{class l{transform(e,o=200){if(!e)return"...";let n=e.replace(/<\/?[^>]+(>|$)/g," ");n=n.replace(/ /g," ");const i=n.replace(/\s\s+/g," ").trim();let a=i;return i.length>o&&(a=i.substring(0,o)),a.trim()+"..."}static{this.\u0275fac=function(o){return new(o||l)}}static{this.\u0275pipe=t.EJ8({name:"stripHtml",type:l,pure:!0,standalone:!0})}}return l})();var $=r(42745),D=r(86600),G=r(71997);function X(l,c){if(1&l){const e=t.RV6();t.j41(0,"mat-chip-option",10),t.bIt("click",function(n){t.eBV(e);const i=t.XpG();return t.Njj(i.onSelectionChange(n))}),t.EFF(1),t.k0s()}if(2&l){const e=c.$implicit;t.Y8G("value",e),t.R7$(),t.JRh(e)}}function H(l,c){if(1&l){const e=t.RV6();t.j41(0,"mat-card-title",20),t.bIt("click",function(){t.eBV(e);const n=t.XpG().$implicit,i=t.XpG();return t.Njj(i.editText(n))}),t.EFF(1),t.k0s()}if(2&l){const e=t.XpG().$implicit;t.R7$(),t.JRh(e.data.title)}}function L(l,c){if(1&l&&t.nrm(0,"img",12),2&l){const e=t.XpG().$implicit;t.Y8G("src",e.data.image,t.B4B)}}function z(l,c){if(1&l&&t.EFF(0),2&l){const e=t.XpG().$implicit;t.SpI("",e.data.abstract," ")}}function A(l,c){if(1&l&&(t.EFF(0),t.nI1(1,"stripHtml")),2&l){const e=t.XpG().$implicit;t.SpI("",t.i5U(1,1,e.data.body,200)," ")}}function Q(l,c){1&l&&(t.j41(0,"mat-icon",14),t.EFF(1,"check_box"),t.k0s())}function Y(l,c){1&l&&(t.j41(0,"mat-icon",15),t.EFF(1,"check_box_outline_blank"),t.k0s())}function J(l,c){if(1&l&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&l){const e=t.XpG(2).$implicit;t.R7$(),t.Lme(" (+",((null==e.data.labels?null:e.data.labels.length)||0)-1," ",2===(null==e.data.labels?null:e.data.labels.length)?"other":"others",") ")}}function U(l,c){if(1&l&&(t.j41(0,"mat-option",7),t.EFF(1),t.k0s()),2&l){const e=c.$implicit;t.Y8G("value",e),t.R7$(),t.JRh(e)}}function W(l,c){if(1&l){const e=t.RV6();t.j41(0,"mat-card",21)(1,"mat-form-field",22)(2,"mat-label"),t.EFF(3,"Labels"),t.k0s(),t.j41(4,"mat-select",23),t.mxI("ngModelChange",function(n){t.eBV(e);const i=t.XpG().$implicit;return t.DH7(i.data.labels,n)||(i.data.labels=n),t.Njj(n)}),t.j41(5,"mat-select-trigger"),t.EFF(6),t.DNE(7,J,2,2,"span"),t.k0s(),t.Z7z(8,U,2,2,"mat-option",7,t.fX1),t.k0s()()()}if(2&l){const e=t.XpG().$implicit,o=t.XpG();t.R7$(4),t.R50("ngModel",e.data.labels),t.R7$(2),t.SpI(" ",(null==e.data.labels?null:e.data.labels[0])||""," "),t.R7$(),t.vxM(((null==e.data.labels?null:e.data.labels.length)||0)>1?7:-1),t.R7$(),t.Dyx(o.labels())}}function Z(l,c){if(1&l){const e=t.RV6();t.j41(0,"mat-card",9),t.DNE(1,H,2,1,"mat-card-title"),t.j41(2,"mat-card-content",11),t.bIt("click",function(){const n=t.eBV(e).$implicit,i=t.XpG();return t.Njj(i.editText(n))}),t.DNE(3,L,1,1,"img",12)(4,z,1,1)(5,A,2,4),t.k0s(),t.j41(6,"mat-card-footer")(7,"button",13),t.DNE(8,Q,2,0,"mat-icon",14)(9,Y,2,0,"mat-icon",15),t.k0s(),t.j41(10,"button",16,0),t.bIt("click",function(){const n=t.eBV(e).$implicit;return t.Njj(n.open=!n.open)}),t.j41(12,"mat-icon"),t.EFF(13,"new_label"),t.k0s()(),t.DNE(14,W,10,3,"ng-template",17),t.bIt("backdropClick",function(){const n=t.eBV(e).$implicit,i=t.XpG();return t.Njj(i.closeLabelsMenu(n))}),t.j41(15,"button",18)(16,"mat-icon"),t.EFF(17,"more_vert"),t.k0s()(),t.j41(18,"mat-menu",null,1)(20,"button",19),t.bIt("click",function(){const n=t.eBV(e).$implicit,i=t.XpG();return t.Njj(i.editText(n))}),t.j41(21,"mat-icon"),t.EFF(22,"edit"),t.k0s(),t.j41(23,"span"),t.EFF(24,"Edit text"),t.k0s()(),t.j41(25,"button",19),t.bIt("click",function(){const n=t.eBV(e).$implicit,i=t.XpG();return t.Njj(i.copyText(n))}),t.j41(26,"mat-icon"),t.EFF(27,"file_copy"),t.k0s(),t.j41(28,"span"),t.EFF(29,"Make a copy"),t.k0s()(),t.nrm(30,"mat-divider"),t.j41(31,"button",19),t.bIt("click",function(){const n=t.eBV(e).$implicit,i=t.XpG();return t.Njj(i.deleteText(n))}),t.j41(32,"mat-icon"),t.EFF(33,"delete"),t.k0s(),t.j41(34,"span"),t.EFF(35,"Delete text"),t.k0s()()()()()}if(2&l){const e=c.$implicit,o=t.sdS(11),n=t.sdS(19);t.R7$(),t.vxM(e.data.title?1:-1),t.R7$(2),t.vxM(e.data.image?3:-1),t.R7$(),t.vxM(e.data.abstract?4:5),t.R7$(3),t.Y8G("disabled",!0)("matTooltip",e.record.published?"Published":"Not published")("matTooltipDisabled",!1),t.R7$(),t.vxM(e.record.published?8:9),t.R7$(6),t.Y8G("cdkConnectedOverlayHasBackdrop",!0)("cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop")("cdkConnectedOverlayOrigin",o)("cdkConnectedOverlayOpen",e.open),t.R7$(),t.Y8G("matMenuTriggerFor",n)}}let K=(()=>{class l{closeLabelsMenu(e){var o=this;return(0,_.A)(function*(){e.open=!1,console.log("Menu closed:",e),yield o.saveText(e,e.data)})()}constructor(){var e=this;this.viewStyle=(0,t.geq)("card"),this.selectedTag="",this.bold=!1,this.bold2=!1,this.dialog=(0,t.WQX)(u.bZ),this.layout=(0,t.WQX)(N.Y),this.identity=(0,t.WQX)(B.K),this.app=(0,t.WQX)(P.d),this.toppings=new s.MJ(""),this.labels=(0,t.vPA)(["Travel","Inspiration","Lifestyle","Food","Photography"]),this.labelMap={Travel:"label1",Inspiration:"label2",Lifestyle:"label3",Food:"label4",Photography:"label5"},this.records=(0,t.vPA)([]),this.checkedColumns=[],this.columnsCopy=[{key:1,title:"test"}],this.layout.marginOn(),this.layout.disableNavigation(),this.layout.resetActions(),(0,t.QZP)((0,_.A)(function*(){e.app.initialized()&&(yield e.loadNotes())}))}deleteText(e){var o=this;return(0,_.A)(function*(){const{status:n}=yield e.record.delete();n&&o.records.update(i=>i.filter(a=>a.record!=e.record))})()}newNote(){this.editText({data:{title:"",body:"",background:"",collaborators:[],labels:[],published:!0}})}loadNotes(e){var o=this;return(0,_.A)(function*(){console.log("VALUE OF TAGS:",e);var{records:n}=yield o.identity.web5.dwn.records.query({message:{filter:{tags:e,protocol:h.Q.protocol,schema:h.Q.types.entry.schema,dataFormat:h.Q.types.entry.dataFormats[0]},dateSort:$.U0.CreatedDescending}});if(o.records.set([]),n)for(const i of n){let a=yield i.data.json(),d={record:i,data:a};o.records.update(b=>[...b,d])}console.log("All requests:",o.records())})()}onSelectionChange(e){console.log("Selection changed:",e),console.log(this.selectedTag),this.selectedTag?this.loadNotes({labels:this.selectedTag}):this.loadNotes()}ngOnDestroy(){this.layout.enableScrolling()}copyText(e){const o=JSON.parse(JSON.stringify(e.data));this.saveText({data:o},o)}editText(e){var o=this;let n={title:e.data.title,body:e.data.body,abstract:e.data.abstract,background:e.data.background,collaborators:[],labels:e.data.labels??[],published:e.record?e.record.published:e.data.published,image:e.data.image};const i=JSON.parse(JSON.stringify(n)),a=this.dialog.open(V,{width:"100vw",height:"100vh",maxWidth:"100vw",maxHeight:"100vh",panelClass:"full-screen-dialog",data:n});return a.afterClosed().subscribe(function(){var d=(0,_.A)(function*(b){b?(console.log("data result for saving:",n),e.data=n,yield o.saveText(e,n)):n=i});return function(b){return d.apply(this,arguments)}}()),a.afterClosed()}ngOnInit(){}selectColor(){}saveText(e,o){var n=this;return(0,_.A)(function*(){const i=o.published;if(e.record){e.record.tags.labels=o.labels;const{status:a}=yield e.record.update({data:o,published:i});console.log("Record status:",a),yield e.record.send()}else{const{record:a,status:d}=yield n.identity.web5.dwn.records.create({data:o,message:{published:i,tags:{labels:o.labels},protocol:h.Q.protocol,protocolPath:"entry",schema:h.Q.types.entry.schema,dataFormat:h.Q.types.entry.dataFormats[0]}});console.log("Record created:",a),console.log("Record status:",d),a&&(e.record=a,n.records.update(b=>[e,...b]),yield e.record.send())}})()}static{this.\u0275fac=function(o){return new(o||l)}}static{this.\u0275cmp=t.VBU({type:l,selectors:[["app-text"]],inputs:{viewStyle:[1,"viewStyle"]},outputs:{viewStyle:"viewStyleChange"},standalone:!0,features:[t.aNF],decls:14,vars:2,consts:[["trigger","cdkOverlayOrigin"],["menuActions","matMenu"],[1,"toolbar-actions","margin-bottom"],["type","button","mat-button","",3,"click"],[1,"notes"],[1,"notes-top"],[3,"ngModelChange","multiple","ngModel"],[3,"value"],[1,"notes-items"],[1,"marketplace-category"],[3,"click","value"],[1,"note-body",3,"click"],[1,"text-image",3,"src"],["mat-icon-button","",3,"disabled","matTooltip","matTooltipDisabled"],["title","Published"],["title","Not published"],["mat-icon-button","","matTooltip","Labels","type","button","cdkOverlayOrigin","",3,"click"],["cdkConnectedOverlay","",3,"backdropClick","cdkConnectedOverlayHasBackdrop","cdkConnectedOverlayBackdropClass","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen"],["mat-icon-button","","matTooltip","Options",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],[3,"click"],[1,"label-option"],["subscriptSizing","dynamic"],["multiple","",3,"ngModelChange","ngModel"]],template:function(o,n){1&o&&(t.j41(0,"mat-card",2)(1,"mat-card-content")(2,"button",3),t.bIt("click",function(){return n.newNote()}),t.j41(3,"mat-icon"),t.EFF(4,"create"),t.k0s(),t.EFF(5," New text "),t.k0s()()(),t.j41(6,"div",4)(7,"div",5)(8,"mat-chip-listbox",6),t.mxI("ngModelChange",function(a){return t.DH7(n.selectedTag,a)||(n.selectedTag=a),a}),t.Z7z(9,X,2,2,"mat-chip-option",7,t.fX1),t.k0s()(),t.j41(11,"div",8),t.Z7z(12,Z,36,12,"mat-card",9,t.fX1),t.k0s()()),2&o&&(t.R7$(8),t.Y8G("multiple",!1),t.R50("ngModel",n.selectedTag),t.R7$(),t.Dyx(n.labels()),t.R7$(3),t.Dyx(n.records()))},dependencies:[v.MD,T.Ve,k.rl,k.nJ,T.VO,T.$2,D.wT,u.hM,C.uc,C.oV,p.Hu,p.RN,p.m2,p.WQ,p.dh,j.YN,j.uI,j.gq,s.YN,s.BC,s.vS,g.Hl,g.$z,g.iY,f.m_,f.An,F.fS,O.Fg,G.q,m.Cn,m.kk,m.fb,m.Cp,M.Vg,k.RG,s.X1,x.z_,x.WB,x.$Q,S.iw,w],styles:[".notes[_ngcontent-%COMP%]{height:100%}.note-body[_ngcontent-%COMP%]{white-space:pre-wrap}.notes-top[_ngcontent-%COMP%]{margin-bottom:1em}.large-icon[_ngcontent-%COMP%]{transform:scale(2)}.label-option[_ngcontent-%COMP%]{min-width:200px}.text-image[_ngcontent-%COMP%]{width:100%;height:200px;object-fit:cover}.marketplace-category[_ngcontent-%COMP%]{display:inline-block;padding:12px 16px;margin-right:1em;margin-bottom:1em;max-width:210px;font-size:.9em}.notes-items[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%]{cursor:pointer;padding:0!important;margin-bottom:.4em}.notes-items[_ngcontent-%COMP%] mat-card-title[_ngcontent-%COMP%]{cursor:pointer}.notes-items[_ngcontent-%COMP%] mat-card-footer[_ngcontent-%COMP%]{font-size:1.2em;width:100%;text-align:center;display:block}"]})}}return l})()}}]); \ No newline at end of file diff --git a/index.html b/index.html index ac2e4817..c4e0aaf6 100644 --- a/index.html +++ b/index.html @@ -35,5 +35,5 @@ - + diff --git a/ngsw.json b/ngsw.json index 1f5114be..0807fe94 100644 --- a/ngsw.json +++ b/ngsw.json @@ -1,6 +1,6 @@ { "configVersion": 1, - "timestamp": 1729414674602, + "timestamp": 1729418891050, "index": "/index.html", "assetGroups": [], "dataGroups": [], diff --git a/runtime.dc2e1c55c7102355.js b/runtime.97c4efe2cdae8762.js similarity index 97% rename from runtime.dc2e1c55c7102355.js rename to runtime.97c4efe2cdae8762.js index 3e40a2b5..95b923a7 100644 --- a/runtime.dc2e1c55c7102355.js +++ b/runtime.97c4efe2cdae8762.js @@ -1 +1 @@ -(()=>{"use strict";var e,v={},g={};function t(e){var f=g[e];if(void 0!==f)return f.exports;var a=g[e]={id:e,loaded:!1,exports:{}};return v[e].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}t.m=v,e=[],t.O=(f,a,c,n)=>{if(!a){var r=1/0;for(d=0;d=n)&&Object.keys(t.O).every(p=>t.O[p](a[b]))?a.splice(b--,1):(l=!1,n0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[a,c,n]},t.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return t.d(f,{a:f}),f},(()=>{var f,e=Object.getPrototypeOf?a=>Object.getPrototypeOf(a):a=>a.__proto__;t.t=function(a,c){if(1&c&&(a=this(a)),8&c||"object"==typeof a&&a&&(4&c&&a.__esModule||16&c&&"function"==typeof a.then))return a;var n=Object.create(null);t.r(n);var d={};f=f||[null,e({}),e([]),e(e)];for(var r=2&c&&a;"object"==typeof r&&!~f.indexOf(r);r=e(r))Object.getOwnPropertyNames(r).forEach(l=>d[l]=()=>a[l]);return d.default=()=>a,t.d(n,d),n}})(),t.d=(e,f)=>{for(var a in f)t.o(f,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:f[a]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce((f,a)=>(t.f[a](e,f),f),[])),t.u=e=>(2076===e?"common":e)+"."+{60:"dd56a698bb4b11c7",450:"6408b8e5de5d627d",946:"e0aa46d375760727",959:"00e03a6ac8d59c63",1391:"5982e61fcbdbcc04",2076:"7c74642b429dcda2",2084:"16c5e5b6f2f8f212",2228:"bac7dfcdec1a22e5",2276:"2fb337eaca8d19d4",2320:"4e757c68ede48777",2429:"670ecda59bc9b574",2765:"e0758a1ca25e97e4",3028:"980e79967f7da69b",3287:"b916783a13394117",3416:"304a8aa6cf9d5681",3446:"1efa2ae7387f2256",3474:"a89da9b7a5cd2a40",3475:"1d4960c80daccb08",3907:"80853c42ae830ed8",4388:"b853de9ef7ccf425",4392:"0d56e23507a649aa",4500:"98c54e798a0bf78e",4630:"011622e7142da472",4885:"2028568dcacd00e6",5026:"9bf2c634b0697f7d",5216:"c0a7ccbf2feb7d2a",5680:"5ab52d5ad98743b3",5806:"cffa0be311c5c387",5832:"27caf219327f9705",5854:"5e08e8dd885a580f",5874:"7ddcec014d1c26ad",5962:"816a9fdaef6a9910",6195:"7857de4ac4543855",6406:"c75223de224c29cb",6471:"f9d95bbc4d6d59f9",6486:"25841275d6e3a658",6489:"eb1c54fc6ca2a2d0",6695:"d8e9a5f98e779dd2",6702:"e019b35863e618eb",6797:"12edfd8f3e319402",6850:"88865711a8a6fcb3",7160:"f6c774bdba21e57a",7358:"440b00fbfb0f64be",7380:"fb901ac05f068683",7660:"cdc4f01fe1d11d15",7848:"fcadeb3cc9aa00d2",7880:"9e4f91a77955f905",7988:"aa19765ddea12d37",8008:"4013eed772c0bedc",8012:"d806898cc1e5ac48",8067:"d53f5ca6c5591a04",8101:"a951e771414c47d0",8552:"222c77f601c5c66c",8834:"a54a62cabfc86a23",8864:"6764927e933490e0",8880:"b11a9499df5ed9f5",9128:"24964fbc6e92e42a",9158:"842ef26f15a3579f",9238:"d9292fac7f9d7c5a",9454:"fdb6542e7277673f",9466:"714e3e87a459230e",9533:"8a082b218354a8d2",9613:"90dea49e7e031027",9727:"df1eefe0b7f531c9",9847:"9d41f45158bbc07e",9996:"9d24d5958342a4f2"}[e]+".js",t.miniCssF=e=>{},t.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),(()=>{var e={},f="app:";t.l=(a,c,n,d)=>{if(e[a])e[a].push(c);else{var r,l;if(void 0!==n)for(var b=document.getElementsByTagName("script"),i=0;i{r.onerror=r.onload=null,clearTimeout(u);var h=e[a];if(delete e[a],r.parentNode&&r.parentNode.removeChild(r),h&&h.forEach(y=>y(p)),_)return _(p)},u=setTimeout(s.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=s.bind(null,r.onerror),r.onload=s.bind(null,r.onload),l&&document.head.appendChild(r)}}})(),t.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;t.tt=()=>(void 0===e&&(e={createScriptURL:f=>f},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),t.tu=e=>t.tt().createScriptURL(e),t.p="",(()=>{var e={9121:0};t.f.j=(c,n)=>{var d=t.o(e,c)?e[c]:void 0;if(0!==d)if(d)n.push(d[2]);else if(9121!=c){var r=new Promise((o,s)=>d=e[c]=[o,s]);n.push(d[2]=r);var l=t.p+t.u(c),b=new Error;t.l(l,o=>{if(t.o(e,c)&&(0!==(d=e[c])&&(e[c]=void 0),d)){var s=o&&("load"===o.type?"missing":o.type),u=o&&o.target&&o.target.src;b.message="Loading chunk "+c+" failed.\n("+s+": "+u+")",b.name="ChunkLoadError",b.type=s,b.request=u,d[1](b)}},"chunk-"+c,c)}else e[c]=0},t.O.j=c=>0===e[c];var f=(c,n)=>{var b,i,[d,r,l]=n,o=0;if(d.some(u=>0!==e[u])){for(b in r)t.o(r,b)&&(t.m[b]=r[b]);if(l)var s=l(t)}for(c&&c(n);o{"use strict";var e,v={},g={};function t(e){var f=g[e];if(void 0!==f)return f.exports;var a=g[e]={id:e,loaded:!1,exports:{}};return v[e].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}t.m=v,e=[],t.O=(f,a,c,n)=>{if(!a){var r=1/0;for(d=0;d=n)&&Object.keys(t.O).every(p=>t.O[p](a[b]))?a.splice(b--,1):(l=!1,n0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[a,c,n]},t.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return t.d(f,{a:f}),f},(()=>{var f,e=Object.getPrototypeOf?a=>Object.getPrototypeOf(a):a=>a.__proto__;t.t=function(a,c){if(1&c&&(a=this(a)),8&c||"object"==typeof a&&a&&(4&c&&a.__esModule||16&c&&"function"==typeof a.then))return a;var n=Object.create(null);t.r(n);var d={};f=f||[null,e({}),e([]),e(e)];for(var r=2&c&&a;"object"==typeof r&&!~f.indexOf(r);r=e(r))Object.getOwnPropertyNames(r).forEach(l=>d[l]=()=>a[l]);return d.default=()=>a,t.d(n,d),n}})(),t.d=(e,f)=>{for(var a in f)t.o(f,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:f[a]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce((f,a)=>(t.f[a](e,f),f),[])),t.u=e=>(2076===e?"common":e)+"."+{60:"dd56a698bb4b11c7",450:"6408b8e5de5d627d",946:"e0aa46d375760727",959:"00e03a6ac8d59c63",1391:"5982e61fcbdbcc04",2076:"7c74642b429dcda2",2084:"16c5e5b6f2f8f212",2228:"bac7dfcdec1a22e5",2276:"2fb337eaca8d19d4",2320:"4e757c68ede48777",2429:"670ecda59bc9b574",2765:"e0758a1ca25e97e4",3028:"980e79967f7da69b",3287:"b916783a13394117",3416:"304a8aa6cf9d5681",3446:"1efa2ae7387f2256",3474:"a89da9b7a5cd2a40",3475:"1d4960c80daccb08",3907:"80853c42ae830ed8",4388:"b853de9ef7ccf425",4392:"0d56e23507a649aa",4500:"98c54e798a0bf78e",4630:"011622e7142da472",4885:"2028568dcacd00e6",5026:"9bf2c634b0697f7d",5216:"c0a7ccbf2feb7d2a",5680:"5ab52d5ad98743b3",5806:"cffa0be311c5c387",5832:"27caf219327f9705",5854:"5e08e8dd885a580f",5874:"7ddcec014d1c26ad",5962:"816a9fdaef6a9910",6195:"7857de4ac4543855",6406:"99dd912d181f49b2",6471:"f9d95bbc4d6d59f9",6486:"25841275d6e3a658",6489:"eb1c54fc6ca2a2d0",6695:"d8e9a5f98e779dd2",6702:"e019b35863e618eb",6797:"12edfd8f3e319402",6850:"88865711a8a6fcb3",7160:"f6c774bdba21e57a",7358:"440b00fbfb0f64be",7380:"fb901ac05f068683",7660:"cdc4f01fe1d11d15",7848:"fcadeb3cc9aa00d2",7880:"9e4f91a77955f905",7988:"aa19765ddea12d37",8008:"4013eed772c0bedc",8012:"d806898cc1e5ac48",8067:"d53f5ca6c5591a04",8101:"a951e771414c47d0",8552:"222c77f601c5c66c",8834:"a54a62cabfc86a23",8864:"6764927e933490e0",8880:"b11a9499df5ed9f5",9128:"24964fbc6e92e42a",9158:"842ef26f15a3579f",9238:"d9292fac7f9d7c5a",9454:"fdb6542e7277673f",9466:"714e3e87a459230e",9533:"8a082b218354a8d2",9613:"90dea49e7e031027",9727:"df1eefe0b7f531c9",9847:"9d41f45158bbc07e",9996:"9d24d5958342a4f2"}[e]+".js",t.miniCssF=e=>{},t.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),(()=>{var e={},f="app:";t.l=(a,c,n,d)=>{if(e[a])e[a].push(c);else{var r,l;if(void 0!==n)for(var b=document.getElementsByTagName("script"),i=0;i{r.onerror=r.onload=null,clearTimeout(u);var h=e[a];if(delete e[a],r.parentNode&&r.parentNode.removeChild(r),h&&h.forEach(y=>y(p)),_)return _(p)},u=setTimeout(s.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=s.bind(null,r.onerror),r.onload=s.bind(null,r.onload),l&&document.head.appendChild(r)}}})(),t.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;t.tt=()=>(void 0===e&&(e={createScriptURL:f=>f},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),t.tu=e=>t.tt().createScriptURL(e),t.p="",(()=>{var e={9121:0};t.f.j=(c,n)=>{var d=t.o(e,c)?e[c]:void 0;if(0!==d)if(d)n.push(d[2]);else if(9121!=c){var r=new Promise((o,s)=>d=e[c]=[o,s]);n.push(d[2]=r);var l=t.p+t.u(c),b=new Error;t.l(l,o=>{if(t.o(e,c)&&(0!==(d=e[c])&&(e[c]=void 0),d)){var s=o&&("load"===o.type?"missing":o.type),u=o&&o.target&&o.target.src;b.message="Loading chunk "+c+" failed.\n("+s+": "+u+")",b.name="ChunkLoadError",b.type=s,b.request=u,d[1](b)}},"chunk-"+c,c)}else e[c]=0},t.O.j=c=>0===e[c];var f=(c,n)=>{var b,i,[d,r,l]=n,o=0;if(d.some(u=>0!==e[u])){for(b in r)t.o(r,b)&&(t.m[b]=r[b]);if(l)var s=l(t)}for(c&&c(n);o