@qaecy/cue-ui 0.0.27 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/112.js +1 -1
- package/360.js +1 -0
- package/368.js +1 -0
- package/376.js +1 -1
- package/393.js +1 -1
- package/418.js +1 -1
- package/446.js +1 -0
- package/499.js +1 -0
- package/571.js +1 -1
- package/611.js +1 -0
- package/{873.js → 629.js} +1 -1
- package/773.js +1 -0
- package/919.js +1 -0
- package/964.js +1 -0
- package/common.js +1 -1
- package/index.js +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/104.js +0 -1
- package/382.js +0 -1
- package/540.js +0 -1
- package/60.js +0 -1
- package/960.js +0 -1
package/112.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[112],{3112(Ve,V,h){h.d(V,{CueDocumentViewer:()=>Te});var p=h(467),d=h(7705),g=h(2271),r=h(5802),e=h(5547),x=h(9769),M=h(5381),E=h(2245),j=h(1024),P=h(9421),S=h(5903),C=h(9352),N=h(6117),A=h(8547),D=h(3319),w=h(5971),L=h(7573);const k=(o,u)=>t=>t.isHighlight;function G(o,u){if(1&o&&(e.j41(0,"span",3),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2).$implicit;e.R7$(),e.JRh(t.highlight.label)}}function $(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-button",5),e.bIt("click",function(i){r.eBV(t);const a=e.XpG(2).$implicit,l=e.XpG();return r.Njj(l.onDeleteHighlight(i,a.highlight))}),e.nrm(1,"cue-button-icon",6),e.k0s()}}function B(o,u){if(1&o){const t=e.RV6();e.j41(0,"span",2),e.bIt("click",function(){r.eBV(t);const i=e.XpG().$implicit,a=e.XpG();return r.Njj(a.onHighlightClick(i.highlight))}),e.nVh(1,G,2,1,"span",3),e.EFF(2),e.nVh(3,$,2,0,"cue-button",4),e.k0s()}if(2&o){const t=e.XpG().$implicit,n=e.XpG();e.BMQ("data-segment-start",t.segmentStart),e.R7$(),e.vxM(t.highlight.label?1:-1),e.R7$(),e.SpI(" ",t.text," "),e.R7$(),e.vxM(n.allowDelete()?3:-1)}}function O(o,u){if(1&o&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&o){const t=e.XpG().$implicit;e.BMQ("data-segment-start",t.segmentStart),e.R7$(),e.JRh(t.text)}}function X(o,u){if(1&o&&e.nVh(0,B,4,4,"span",1)(1,O,2,2,"span"),2&o){const t=u.$implicit;e.vxM(t.isHighlight&&t.highlight?0:1)}}let U=(()=>{class o{path=d.hFB.required();highlights=(0,d.hFB)([]);allowDelete=(0,d.hFB)(!1);allowAdd=(0,d.hFB)(!1);size=(0,d.hFB)("m");highlightClick=(0,d.CGW)();deleteHighlight=(0,d.CGW)();textSelected=(0,d.CGW)();segments=(0,g.EW)(()=>this.parseSegments(this.path(),this.highlights()));parseSegments(t,n){const i=n.filter(c=>c.path===t);if(0===i.length)return[{text:t,isHighlight:!1,segmentStart:0}];const a=[...i].sort((c,f)=>c.start-f.start),l=[];let s=0;for(const c of a)c.start>s&&l.push({text:t.substring(s,c.start),isHighlight:!1,segmentStart:s}),l.push({text:t.substring(c.start,c.end),isHighlight:!0,highlight:c,segmentStart:c.start}),s=c.end;return s<t.length&&l.push({text:t.substring(s),isHighlight:!1,segmentStart:s}),l}onHighlightClick(t){const n=this.path().substring(t.start,t.end);this.highlightClick.emit({path:this.path(),highlight:t,text:n})}onDeleteHighlight(t,n){t.stopPropagation(),this.deleteHighlight.emit({path:this.path(),highlight:n})}onMouseUp(t){if(!this.allowAdd())return;const n=window.getSelection();if(!n||n.isCollapsed||!n.rangeCount||!n.toString().trim())return;const a=n.getRangeAt(0),l=t.currentTarget,s=this.getAbsoluteOffset(l,a.startContainer,a.startOffset),c=this.getAbsoluteOffset(l,a.endContainer,a.endOffset);n.removeAllRanges(),c>s&&this.textSelected.emit({path:this.path(),start:s,end:c,text:this.path().substring(s,c)})}getAbsoluteOffset(t,n,i){let a=n.nodeType===Node.TEXT_NODE?n.parentElement:n;for(;a&&a!==t;){if(a instanceof HTMLElement&&a.hasAttribute("data-segment-start")){const f=parseInt(a.getAttribute("data-segment-start"),10);let m=0;const v=document.createTreeWalker(a,NodeFilter.SHOW_TEXT);let _=v.nextNode();for(;_&&_!==n;)m+=_.textContent?.length??0,_=v.nextNode();return f+m+i}a=a.parentElement}const l=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let s=0,c=l.nextNode();for(;c&&c!==n;)s+=c.textContent?.length??0,c=l.nextNode();return s+i}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-file-path-viewer"]],inputs:{path:[1,"path"],highlights:[1,"highlights"],allowDelete:[1,"allowDelete"],allowAdd:[1,"allowAdd"],size:[1,"size"]},outputs:{highlightClick:"highlightClick",deleteHighlight:"deleteHighlight",textSelected:"textSelected"},decls:3,vars:7,consts:[[1,"path-content",3,"mouseup"],[1,"highlight-segment"],[1,"highlight-segment",3,"click"],[1,"highlight-label"],["size","xs","aria-label","Remove highlight",1,"delete-button"],["size","xs","aria-label","Remove highlight",1,"delete-button",3,"click"],["icon","close"]],template:function(n,i){1&n&&(e.j41(0,"div",0),e.bIt("mouseup",function(l){return i.onMouseUp(l)}),e.Z7z(1,X,2,1,null,null,e.Vm6),e.k0s()),2&n&&(e.AVh("size-s","s"===i.size())("allow-add",i.allowAdd())("has-highlights",i.segments().some(e._m7(6,k,i))),e.R7$(),e.Dyx(i.segments()))},dependencies:[x.MD,w.$,D.a],styles:["[_nghost-%COMP%]{display:contents}.path-content[_ngcontent-%COMP%]{display:block;flex:1;min-width:0;word-break:break-all;text-align:start;font-family:var(--cue-font-family);font-size:var(--cue-font-m-size);line-height:var(--cue-font-m-line-height);letter-spacing:var(--cue-font-m-letter-spacing);font-weight:var(--cue-font-weight-regular)}.path-content.size-s[_ngcontent-%COMP%]{font-size:var(--cue-font-s-size);line-height:var(--cue-font-s-line-height);letter-spacing:var(--cue-font-s-letter-spacing)}.path-content.allow-add[_ngcontent-%COMP%]{cursor:text;-webkit-user-select:text;user-select:text}.path-content.has-highlights[_ngcontent-%COMP%]{padding-top:.8rem;line-height:2.3rem}.highlight-segment[_ngcontent-%COMP%]{display:inline-block;vertical-align:text-bottom;position:relative;line-height:normal;font-weight:var(--cue-font-weight-medium);cursor:pointer;padding:0 .2rem;border-radius:3px;border:1px solid currentColor;transition:all .2s ease}.highlight-segment[_ngcontent-%COMP%] .highlight-label[_ngcontent-%COMP%]{font-family:var(--cue-font-family);position:absolute;bottom:100%;left:0;font-size:.5rem;line-height:1;opacity:.7;margin-bottom:.15rem;white-space:nowrap;pointer-events:none}.highlight-segment[_ngcontent-%COMP%] .delete-button[_ngcontent-%COMP%]{position:absolute;top:-12px;right:-12px;z-index:10;opacity:0;transition:opacity .2s ease;pointer-events:none}.highlight-segment[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,currentColor 12%,transparent)}.highlight-segment[_ngcontent-%COMP%]:hover .delete-button[_ngcontent-%COMP%]{opacity:1;pointer-events:all}"],changeDetection:0})}return o})();var H=h(5745),W=h(2444),z=h(9695),Y=h(5448),J=h(6950);const F=o=>({count:o}),Q=(o,u)=>t=>t.iri;function q(o,u){1&o&&(e.j41(0,"cue-typography",11),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"components.documentInfo.infoLoadingFilePaths")))}function K(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-ag-grid",16),e.bIt("selectedRows",function(i){r.eBV(t);const a=e.XpG(4);return r.Njj(a.onMatchedPathsSelectionChange(i))}),e.k0s()}if(2&o){const t=e.XpG(4);e.Y8G("rowData",t._matchTableRowData())("columnDefs",t._matchTableColDefs())("rowSelection",t._matchTableRowSelection)}}function Z(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",12)(1,"cue-button",13),e.bIt("click",function(){r.eBV(t);const i=e.XpG(3);return r.Njj(i._matchTableExpanded.set(!i._matchTableExpanded()))}),e.nrm(2,"cue-button-icon",14),e.j41(3,"cue-button-label"),e.EFF(4),e.nI1(5,"transloco"),e.k0s()(),e.nVh(6,K,1,3,"cue-ag-grid",15),e.k0s(),e.j41(7,"cue-typography",11),e.EFF(8),e.nI1(9,"transloco"),e.k0s()}if(2&o){const t=e.XpG(3);e.R7$(2),e.Y8G("icon",t._matchTableExpanded()?"arrow-up":"arrow-dropdown"),e.R7$(2),e.JRh(e.i5U(5,4,1===t._matchCount()?"components.documentInfo.filePathMatched":"components.documentInfo.filePathsMatched",e.eq3(10,F,t._matchCount()))),e.R7$(2),e.vxM(t._matchTableExpanded()?6:-1),e.R7$(2),e.JRh(e.i5U(9,7,"components.documentInfo.applyToNPaths",e.eq3(12,F,t._selectedPaths().length)))}}function ee(o,u){if(1&o&&e.nVh(0,q,3,3,"cue-typography",11)(1,Z,10,14),2&o){const t=e.XpG(2);e.vxM(t._fileLocationsLoading()?0:null!==t._fileLocations()?1:-1)}}function te(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",9)(1,"cue-input-switch",10),e.bIt("toggleChange",function(i){r.eBV(t);const a=e.XpG();return r.Njj(a.onApplyToAllChange(i))}),e.k0s(),e.j41(2,"cue-typography",11),e.EFF(3),e.nI1(4,"transloco"),e.k0s()(),e.nVh(5,ee,2,1)}if(2&o){const t=e.XpG();e.R7$(),e.Y8G("checked",t._applyToAllFiles()),e.R7$(2),e.JRh(e.bMT(4,3,"components.documentInfo.applyToAllFiles")),e.R7$(2),e.vxM(t._applyToAllFiles()?5:-1)}}function ne(o,u){if(1&o&&(e.j41(0,"cue-typography",8),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.Lme("",e.bMT(2,2,"components.documentInfo.errorSavingEntityMention"),": ",t._saveError())}}let ie=(()=>{class o{selection=d.hFB.required();availableEntityCategories=(0,d.hFB)([]);fileLocations=(0,d.hFB)([]);requestFileLocations=(0,d.hFB)(void 0);requestFilePathEntityAdd=(0,d.hFB)(void 0);confirm=(0,d.CGW)();cancel=(0,d.CGW)();_selectedEntityCategory=(0,r.vPA)("");_applyToAllFiles=(0,r.vPA)(!1);_fileLocations=(0,r.vPA)(null);_fileLocationsLoading=(0,r.vPA)(!1);_matchTableExpanded=(0,r.vPA)(!1);_selectedPaths=(0,r.vPA)([]);_saving=(0,r.vPA)(!1);_saveError=(0,r.vPA)(null);_dirPrefix=(0,g.EW)(()=>{const t=this.selection();return t.path.substring(0,t.end)});_matchedLocations=(0,g.EW)(()=>{const t=this._fileLocations();if(!t)return[];const n=this._dirPrefix();return t.filter(i=>i.path.startsWith(n))});_matchCount=(0,g.EW)(()=>this._matchedLocations().length);_matchTableRowData=(0,g.EW)(()=>this._matchedLocations().map(t=>({iri:t.iri,path:t.path,providerId:t.providerId})));_entityCategoryLabelMap=(0,g.EW)(()=>this.availableEntityCategories().reduce((t,n)=>(t[n.iri]=n.label,t),{}));_matchTableRowSelection={mode:"multiRow",selectAll:"filtered"};_filePathLabel=(0,C.Xx)("components.contentBlocks.documentViewer.labelFilePath");_matchTableColDefs=(0,g.EW)(()=>[{headerName:this._filePathLabel(),field:"path",flex:1,filter:!0,sortable:!0}]);onEntityCategoryChange(t){this._selectedEntityCategory.set("string"==typeof t?t:String(t??""))}onApplyToAllChange(t){var n=this;return(0,p.A)(function*(){if(n._applyToAllFiles.set(t),n._matchTableExpanded.set(!1),!t)return n._fileLocations.set(null),void n._selectedPaths.set([]);const i=n.requestFileLocations();if(i){n._fileLocationsLoading.set(!0);try{const a=yield i();n._fileLocations.set(a);const l=n._dirPrefix();n._selectedPaths.set(a.filter(s=>s.path.startsWith(l)))}finally{n._fileLocationsLoading.set(!1)}}})()}onMatchedPathsSelectionChange(t){const n=this._fileLocations()??[];this._selectedPaths.set(t.map(i=>n.find(a=>a.path===i.path)??{iri:"",path:i.path}))}onConfirm(){var t=this;return(0,p.A)(function*(){const n=t._selectedEntityCategory();if(!n)return;const i=t.selection().path,a=t._fileLocations()?.find(c=>c.path===i)??t.fileLocations().find(c=>c.path===i)??{iri:"",path:i},l=t._applyToAllFiles()&&t._selectedPaths().length>0?t._selectedPaths():[a],s=t.requestFilePathEntityAdd();if(s){t._saving.set(!0),t._saveError.set(null);try{yield s(n,l)}catch(c){return console.error("[EntityMentionModal] Failed to save entity mention:",c),t._saveError.set(c instanceof Error?c.message:String(c)),void t._saving.set(!1)}t._saving.set(!1)}t.confirm.emit({entityCategory:n,paths:l})})()}onCancel(){this.cancel.emit()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-entity-mention-modal"]],inputs:{selection:[1,"selection"],availableEntityCategories:[1,"availableEntityCategories"],fileLocations:[1,"fileLocations"],requestFileLocations:[1,"requestFileLocations"],requestFilePathEntityAdd:[1,"requestFilePathEntityAdd"]},outputs:{confirm:"confirm",cancel:"cancel"},decls:18,vars:24,consts:[[3,"close","displayCloseBtn","closeOnBackgroundClick"],[1,"modal-content"],["direction","column","gap","m"],[3,"key","val"],[3,"valueChange","value","options","labelMap","label","showFilter"],["direction","row","justify","center"],[3,"click","disabled"],["variant","secondary",3,"click","disabled"],["size","s",2,"color","var(--cue-error)"],["direction","row","gap","s","align","center"],[3,"toggleChange","checked"],["size","s"],["direction","column","gap","xs"],["variant","ghost","size","xs",3,"click"],[3,"icon"],["size","s","height","220px",3,"rowData","columnDefs","rowSelection"],["size","s","height","220px",3,"selectedRows","rowData","columnDefs","rowSelection"]],template:function(n,i){1&n&&(e.j41(0,"cue-modal",0),e.bIt("close",function(){return i.onCancel()}),e.j41(1,"div",1)(2,"cue-flexcontainer",2),e.nrm(3,"cue-key-val",3),e.nI1(4,"transloco"),e.j41(5,"cue-select",4),e.nI1(6,"transloco"),e.bIt("valueChange",function(l){return i.onEntityCategoryChange(l)}),e.k0s(),e.nVh(7,te,6,5),e.j41(8,"cue-flexcontainer",5)(9,"cue-button",6),e.bIt("click",function(){return i.onCancel()}),e.j41(10,"cue-button-label"),e.EFF(11),e.nI1(12,"transloco"),e.k0s()(),e.j41(13,"cue-button",7),e.bIt("click",function(){return i.onConfirm()}),e.j41(14,"cue-button-label"),e.EFF(15),e.nI1(16,"transloco"),e.k0s()()(),e.nVh(17,ne,3,4,"cue-typography",8),e.k0s()()()),2&n&&(e.Y8G("displayCloseBtn",!1)("closeOnBackgroundClick",!1),e.R7$(3),e.Y8G("key",e.bMT(4,15,"components.documentInfo.labelSelectedText"))("val",i.selection().text),e.R7$(2),e.Y8G("value",i._selectedEntityCategory())("options",i.availableEntityCategories().map(e._m7(17,Q,i)))("labelMap",i._entityCategoryLabelMap())("label",e.bMT(6,18,"components.entityInfo.labelEntityCategory"))("showFilter",i.availableEntityCategories().length>5),e.R7$(2),e.vxM(i.requestFileLocations()?7:-1),e.R7$(2),e.Y8G("disabled",i._saving()),e.R7$(2),e.JRh(e.bMT(12,20,"components.modals.rdfEdit.buttonCancel")),e.R7$(2),e.Y8G("disabled",!i._selectedEntityCategory()||i._saving()),e.R7$(2),e.JRh(e.bMT(16,22,"components.modals.rdfEdit.buttonSave")),e.R7$(2),e.vxM(i._saveError()?17:-1))},dependencies:[M.n,P.F,D.a,w.$,Y.L,E.Typography,H.a,W.l,z.d,J.R,C.Kj],styles:[".modal-content[_ngcontent-%COMP%]{width:640px;max-width:calc(100vw - 32px)}"],changeDetection:0})}return o})();const oe=()=>[];function ae(o,u){if(1&o&&(e.nrm(0,"cue-key-val",6),e.nI1(1,"transloco")),2&o){const t=e.XpG(2);e.Y8G("key",e.bMT(1,2,"components.contentBlocks.documentViewer.labelSubject"))("val",t.subject())}}function le(o,u){if(1&o&&(e.j41(0,"cue-key-val-list"),e.nVh(1,ae,2,4,"cue-key-val",6),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.vxM(t.subject()?1:-1)}}function se(o,u){if(1&o&&(e.j41(0,"cue-flexcontainer",4)(1,"cue-menu",7)(2,"cue-button",8,0),e.nrm(4,"cue-button-icon",9),e.k0s(),e.nrm(5,"cue-menu-nested",10),e.k0s()()),2&o){const t=e.XpG();e.R7$(5),e.Y8G("items",t.menuItems())}}function re(o,u){if(1&o&&(e.nrm(0,"cue-key-val-editable",11),e.nI1(1,"transloco"),e.nI1(2,"transloco")),2&o){const t=e.XpG(2);e.Y8G("key",1===t.contentCategories().length?e.bMT(1,4,"components.contentBlocks.documentViewer.labelContentCategory"):e.bMT(2,6,"components.contentBlocks.documentViewer.labelContentCategories"))("val",t.contentCategoriesString())("rdfConfig",t.rdfEditConfig())("editDisabled",!t.contentCategoriesEditable())}}function ce(o,u){if(1&o&&(e.j41(0,"span",15),e.EFF(1),e.k0s()),2&o){const t=e.XpG(3);e.R7$(),e.Lme("(",t.currentFilePathIndex()+1,"/",t.fileLocations().length,")")}}function de(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){r.eBV(t);const i=e.XpG(3);return r.Njj(i.prevFilePath())}),e.nrm(1,"cue-button-icon",20),e.k0s()}if(2&o){const t=e.XpG(3);e.Y8G("disabled",0===t.currentFilePathIndex())}}function ue(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){r.eBV(t);const i=e.XpG(3);return r.Njj(i.nextFilePath())}),e.nrm(1,"cue-button-icon",21),e.k0s()}if(2&o){const t=e.XpG(3);e.Y8G("disabled",t.currentFilePathIndex()===t.fileLocations().length-1)}}function he(o,u){if(1&o){const t=e.RV6();e.j41(0,"dl",12)(1,"dt",13)(2,"cue-typography",14),e.EFF(3),e.nI1(4,"transloco"),e.nVh(5,ce,2,2,"span",15),e.k0s()(),e.j41(6,"dd",16),e.nVh(7,de,2,1,"cue-button",17),e.j41(8,"cue-file-path-viewer",18),e.bIt("textSelected",function(i){r.eBV(t);const a=e.XpG(2);return r.Njj(a.onTextSelected(i))}),e.k0s(),e.nVh(9,ue,2,1,"cue-button",17),e.k0s()()}if(2&o){const t=e.XpG(2);e.R7$(3),e.SpI(" ",e.bMT(4,8,"components.contentBlocks.documentViewer.labelFilePath")," "),e.R7$(2),e.vxM(t.fileLocations().length>1?5:-1),e.R7$(2),e.vxM(t.fileLocations().length>1?7:-1),e.R7$(),e.Y8G("path",t.fileLocations()[t.currentFilePathIndex()].path)("highlights",t.filePathEntitiesVisible()?t.filePathHighlights():e.lJ4(10,oe))("allowDelete",t.filePathEntitiesEditable())("allowAdd",t.filePathEntitiesEditable()),e.R7$(),e.vxM(t.fileLocations().length>1?9:-1)}}function ge(o,u){if(1&o&&(e.j41(0,"cue-key-val-list"),e.nrm(1,"hr"),e.nVh(2,re,3,8,"cue-key-val-editable",11),e.nVh(3,he,10,11,"dl",12),e.k0s()),2&o){const t=e.XpG();e.R7$(2),e.vxM(t.contentCategories()&&t.contentCategories().length>0?2:-1),e.R7$(),e.vxM(t.fileLocations().length>0?3:-1)}}function fe(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-entity-mention-modal",22),e.bIt("confirm",function(i){r.eBV(t);const a=e.XpG();return r.Njj(a.onEntityMentionConfirm(i))})("cancel",function(){r.eBV(t);const i=e.XpG();return r.Njj(i.onEntityMentionCancel())}),e.k0s()}if(2&o){const t=e.XpG();e.Y8G("selection",t._pendingSelection())("availableEntityCategories",t.availableEntityCategories())("fileLocations",t.fileLocations())("requestFileLocations",t._fileLocationsProvider())("requestFilePathEntityAdd",t._requestFilePathEntityAdd())}}let me=(()=>{class o{subject=d.hFB.required();handlers=d.hFB.required();dataChanged=(0,d.CGW)();filePathEntityAdded=(0,d.CGW)();fileLocations=(0,d.hFB)([]);_fileLocationsProvider=(0,g.EW)(()=>{const t=this.handlers().requestFileLocations;if(t)return t;const n=this.fileLocations();return n.length?()=>Promise.resolve(n):void 0});filePathEntities=(0,d.geq)([]);contentCategories=(0,d.hFB)([]);contentCategoriesEditable=(0,d.hFB)(!1);filePathEntitiesVisible=(0,d.hFB)(!1);filePathEntitiesEditable=(0,d.hFB)(!1);menuItems=(0,d.hFB)([]);availableContentCategories=(0,d.hFB)([]);availableEntityCategories=(0,d.hFB)([]);collapsed=(0,d.hFB)(!1);hasDocInfo=(0,g.EW)(()=>{const t=""!==this.subject(),n=this.fileLocations().length>0;return t||n});currentFilePathIndex=(0,r.vPA)(0);_entityCategoryModalVisible=(0,r.vPA)(!1);_pendingSelection=(0,r.vPA)(null);_requestFilePathEntityAdd=(0,g.EW)(()=>{var t=this;const n=this.handlers().requestFilePathEntityAdd;if(n)return function(){var i=(0,p.A)(function*(a,l){const s=t._pendingSelection();s&&(yield n({paths:l,start:s.start,end:s.end,text:s.text,entityCategory:a,folderPath:s.path.substring(0,s.end)}))});return function(a,l){return i.apply(this,arguments)}}()});prevFilePath(){this.currentFilePathIndex()>0&&this.currentFilePathIndex.update(t=>t-1)}nextFilePath(){this.currentFilePathIndex()<this.fileLocations().length-1&&this.currentFilePathIndex.update(t=>t+1)}filePathHighlights=(0,g.EW)(()=>this.filePathEntities().map(t=>({path:t.path,start:t.startIndex,end:t.endIndex,label:this.availableEntityCategories().find(n=>n.iri===t.entityCategory)?.label??t.entityCategory.split("/").pop()??t.entityCategory})));entityCategoryLabelMap=(0,g.EW)(()=>this.availableEntityCategories().reduce((t,n)=>(t[n.iri]=n.label,t),{}));onTextSelected(t){this._pendingSelection.set(t),this._entityCategoryModalVisible.set(!0)}onEntityMentionConfirm(t){const n=this._pendingSelection();n&&(this.filePathEntities.update(i=>[...i,...t.paths.map(a=>({path:a.path,entityCategory:t.entityCategory,startIndex:n.start,endIndex:n.end}))]),this.filePathEntityAdded.emit({paths:t.paths,start:n.start,end:n.end,text:n.text,entityCategory:t.entityCategory,folderPath:n.path.substring(0,n.end)}),this._entityCategoryModalVisible.set(!1),this._pendingSelection.set(null))}onEntityMentionCancel(){this._entityCategoryModalVisible.set(!1),this._pendingSelection.set(null)}_contentCategories=(0,g.uu)(()=>this.contentCategories());contentCategoriesString=(0,g.EW)(()=>this._contentCategories().map(t=>this._iriToString(t)).sort().join(", "));_iriToString(t){const n=this.availableContentCategories()?.find(i=>i.iri===t);return n?n.label:t}infoChangeContentCategory=(0,C.Xx)("components.documentInfo.infoChangeContentCategory");rdfEditConfig=(0,g.EW)(()=>{var t=this;const n=this.handlers()?.requestRDFChange;var i;if(void 0!==n)return{message:this.infoChangeContentCategory(),existingValue:this._contentCategories(),dataType:"multiselect",options:this.availableContentCategories()?.map(i=>i.iri),optionLabelMap:this.availableContentCategories()?.reduce((i,a)=>(i[a.iri]=a.label,i),{}),requestSave:(i=(0,p.A)(function*(a){console.log(a);const l={subject:t.subject(),predicate:`${L.E.qcy}contentCategory`,objects:t._contentCategories(),newObjects:a.newValue,type:"contentCategory",comment:a.comment};yield n(l),t._contentCategories.set(a.newValue),t.dataChanged.emit({contentCategories:a.newValue})}),function(l){return i.apply(this,arguments)})};console.warn("No RDF change request handler defined")});static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-document-info"]],inputs:{subject:[1,"subject"],handlers:[1,"handlers"],fileLocations:[1,"fileLocations"],filePathEntities:[1,"filePathEntities"],contentCategories:[1,"contentCategories"],contentCategoriesEditable:[1,"contentCategoriesEditable"],filePathEntitiesVisible:[1,"filePathEntitiesVisible"],filePathEntitiesEditable:[1,"filePathEntitiesEditable"],menuItems:[1,"menuItems"],availableContentCategories:[1,"availableContentCategories"],availableEntityCategories:[1,"availableEntityCategories"],collapsed:[1,"collapsed"]},outputs:{dataChanged:"dataChanged",filePathEntityAdded:"filePathEntityAdded",filePathEntities:"filePathEntitiesChange"},decls:7,vars:4,consts:[["trigger",""],["direction","column",2,"min-height","50px"],["direction","row"],["direction","column",2,"flex","1 1"],["direction","column",2,"width","50px"],[3,"selection","availableEntityCategories","fileLocations","requestFileLocations","requestFilePathEntityAdd"],["size","l",3,"key","val"],["positioning","bottomleft"],["trigger","","variant","tertiary"],["icon","more-vert"],["menu","",3,"items"],["size","s",3,"key","val","rdfConfig","editDisabled"],[1,"file-path-nav-container"],[1,"file-path-label"],["size","xs"],[1,"path-counter"],[1,"file-path-row"],["variant","tertiary","size","xs",3,"disabled"],["size","s",3,"textSelected","path","highlights","allowDelete","allowAdd"],["variant","tertiary","size","xs",3,"click","disabled"],["icon","paginator-back"],["icon","paginator-next"],[3,"confirm","cancel","selection","availableEntityCategories","fileLocations","requestFileLocations","requestFilePathEntityAdd"]],template:function(n,i){1&n&&(e.j41(0,"cue-flexcontainer",1)(1,"cue-flexcontainer",2)(2,"cue-flexcontainer",3),e.nVh(3,le,2,1,"cue-key-val-list"),e.k0s(),e.nVh(4,se,6,1,"cue-flexcontainer",4),e.k0s(),e.nVh(5,ge,4,2,"cue-key-val-list"),e.k0s(),e.nVh(6,fe,1,5,"cue-entity-mention-modal",5)),2&n&&(e.R7$(3),e.vxM(i.fileLocations().length>0||i.subject()?3:-1),e.R7$(),e.vxM(i.menuItems().length>0?4:-1),e.R7$(),e.vxM(!i.collapsed()&&i.hasDocInfo()?5:-1),e.R7$(),e.vxM(i._entityCategoryModalVisible()&&i._pendingSelection()?6:-1))},dependencies:[M.n,j.p,P.F,S.L,N.W,A.T,D.a,w.$,U,E.Typography,ie,C.Kj],styles:[".file-path-nav-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px}.file-path-label[_ngcontent-%COMP%]{display:block;margin:0}.file-path-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;margin:0;overflow:visible;padding:1px}.file-path-row[_ngcontent-%COMP%] cue-file-path-viewer[_ngcontent-%COMP%]{flex:1;overflow:visible;min-width:0}.path-counter[_ngcontent-%COMP%]{opacity:.6}"],changeDetection:0})}return o})();class pe{requestRDFChange;requestFileLocations;requestFilePathEntityAdd}var _e=h(2065),ve=h(5187);const be=["viewerHost"];function Ce(o,u){if(1&o&&e.nrm(0,"cue-document-info",4),2&o){const t=e.XpG(2);e.Y8G("subject",t._docSubject())("handlers",t._docInfoHandlers)("menuItems",t._menuItems())}}function ye(o,u){1&o&&(e.j41(0,"cue-flexcontainer",5)(1,"cue-typography"),e.EFF(2,"Loading\u2026"),e.k0s()())}function xe(o,u){if(1&o&&(e.j41(0,"cue-flexcontainer",5)(1,"cue-typography",7),e.EFF(2),e.k0s()()),2&o){const t=e.XpG(2);e.R7$(2),e.JRh(t.errorMessage())}}function Me(o,u){if(1&o&&(e.j41(0,"div",3),e.nVh(1,Ce,1,3,"cue-document-info",4),e.nVh(2,ye,3,0,"cue-flexcontainer",5)(3,xe,3,1,"cue-flexcontainer",5),e.j41(4,"div",6),e.eu8(5,null,1),e.k0s()()),2&o){const t=e.XpG();e.R7$(),e.vxM(t.showDocumentInfo()&&"ready"===t.state()?1:-1),e.R7$(),e.vxM("loading"===t.state()?2:"error"===t.state()?3:-1)}}function Ee(o,u){1&o&&e.eu8(0)}function De(o,u){if(1&o&&(e.j41(0,"cue-card",2),e.DNE(1,Ee,1,0,"ng-container",8),e.k0s()),2&o){const t=e.XpG(),n=e.sdS(1);e.Y8G("variant",t._cardVariant())("padded",!0),e.R7$(),e.Y8G("ngTemplateOutlet",n)}}function we(o,u){1&o&&e.eu8(0)}function Pe(o,u){if(1&o&&e.DNE(0,we,1,0,"ng-container",8),2&o){e.XpG();const t=e.sdS(1);e.Y8G("ngTemplateOutlet",t)}}const Fe=[".fragments",".dxf",".pdf",".png",".jpg",".jpeg",".svg",".gif",".webp",".bmp",".avif",".apng",".xlsx",".xls",".csv",".json",".jsonld",".xml",".css",".js",".html",".htm",".sh",".txt",".rst",".md"];function I(o){const[u,t]=o.split("?"),n=u.trim();let i=null;if(t){const l=new URLSearchParams(t).get("page");if(null!==l){const s=parseInt(l,10);!isNaN(s)&&s>0&&(i=s)}}return{uuid:n,page:i}}let Te=(()=>{class o{set _viewerHostRef(t){if(this._viewerHost=t,t&&this._lastRenderArgs){const{url:n,suffix:i,page:a,viewerTypeOverride:l}=this._lastRenderArgs;this._renderViewer(n,i,a,l)}}_viewerHost;_lastRenderArgs;currentViewerRef;cue=(0,d.hFB)(void 0);uuid=(0,d.hFB)(void 0);projectId=(0,d.hFB)(void 0);showDocumentInfo=(0,d.hFB)(!0);extraMenuItems=(0,d.hFB)([]);portalBaseURL=(0,d.hFB)("https://cue.qaecy.com");variant=(0,d.hFB)("none");_cardVariant=(0,g.EW)(()=>this.variant());state=(0,r.vPA)("idle");errorMessage=(0,r.vPA)(null);resolvedUrl=(0,r.vPA)(null);resolvedSuffix=(0,r.vPA)(null);_docSubject=(0,r.vPA)("");_alternatives=(0,r.vPA)([]);_originalUuid=(0,r.vPA)(null);_originalDocSuffix=(0,r.vPA)(null);_cueSnapshot=null;_projectIdSnapshot=null;_docInfoHandlers=new pe;_menuItems=(0,g.EW)(()=>{const t=[],n=this._originalUuid(),i=this._originalDocSuffix();n&&i&&t.push({icon:"download",label:"Download file",action:()=>this._downloadOriginal()});const a=this.uuid(),l=this.projectId();if(a&&l){const{uuid:c}=I(a),f=this.portalBaseURL().replace(/\/$/,"");t.push({icon:"external-link",label:"Open in Cue",action:()=>window.open(`${f}/r/${l}/${c}`,"_blank","noopener,noreferrer")})}const s=this._alternatives();if(s.length>1){const c=this.resolvedSuffix();t.push({icon:"document",label:"Alternative representation",children:s.map(f=>({label:f.original?`Original (${f.suffix.replace(".","").toUpperCase()})`:f.suffix.replace(".","").toUpperCase(),tooltip:c===f.suffix?"Currently shown":void 0,action:()=>this._switchToAlternative(f)}))})}return t.push(...this.extraMenuItems()),t});constructor(){(0,r.QZP)(()=>{const t=this.cue(),n=this.uuid(),i=this.projectId();t&&n&&i?this._load(t,n,i):this.state.set("idle")})}_load(t,n,i){var a=this;return(0,p.A)(function*(){if(t&&n&&i){a.state.set("loading"),a.resolvedUrl.set(null),a.resolvedSuffix.set(null),a.errorMessage.set(null),a._docSubject.set(""),a._originalUuid.set(null),a._originalDocSuffix.set(null),a._alternatives.set([]),a._viewerHost?.clear(),a.currentViewerRef?.destroy(),a.currentViewerRef=void 0,a._lastRenderArgs=void 0;try{a._cueSnapshot=t,a._projectIdSnapshot=i;const{uuid:l,page:s}=I(n),c=t.createProjectDocuments(i),m=(yield c.fetchDocumentData([l]))[l];if(!m)throw new Error(`Document '${l}' not found in project '${i}'.`);a._docSubject.set(m.subject??""),a._originalUuid.set(l),a._originalDocSuffix.set(m.suffix);const v=yield c.fetchAlternativeRepresentations(l);a._alternatives.set([{uuid:l,suffix:m.suffix,original:!0},...v.filter(b=>b.id!==l).map(b=>({uuid:b.id,suffix:b.suffix,original:!1,remoteRelativePath:b.remoteRelativePath}))]);const{uuid:_,suffix:y,remoteRelativePath:T}=function Ie(o,u){const t=[o,...u];let n,i=1/0;for(const a of t){const l=Fe.indexOf(a.suffix);-1!==l&&l<i&&(i=l,n=a)}return n?{uuid:n.id,suffix:n.suffix,remoteRelativePath:n.remoteRelativePath}:{uuid:o.id,suffix:o.suffix}}(m,v),R=T?yield t.storage.getAltRepDownloadUrl(T):yield t.storage.getDownloadUrl(i,_,y);a.resolvedUrl.set(R),a.resolvedSuffix.set(y);const Re=[".eml",".msg",".emlx",".mbx"].includes(m.suffix)&&".json"===y?"email":void 0;yield a._renderViewer(R,y,s,Re),a.state.set("ready")}catch(l){const s=l instanceof Error?l.message:String(l);console.error("[CueDocumentViewerWC] Failed to load document:",s),a.errorMessage.set(s),a.state.set("error")}}else a.state.set("idle")})()}_renderViewer(t,n,i,a){var l=this;return(0,p.A)(function*(){try{const{DocumentViewer:s}=yield Promise.all([h.e(418),h.e(645),h.e(76),h.e(741)]).then(h.bind(h,1741)),{DocumentViewerSettings:c}=yield h.e(418).then(h.bind(h,3418));l._viewerHost?.clear(),l.currentViewerRef?.destroy();const f=new c;if(null!==i&&(f.pdf.page=String(i)),!l._viewerHost)throw new Error("viewerHost is not yet available \u2014 view has not been initialized.");l._lastRenderArgs={url:t,suffix:n,page:i,viewerTypeOverride:a},l.currentViewerRef=l._viewerHost.createComponent(s),l.currentViewerRef.setInput("url",t),l.currentViewerRef.setInput("suffix",n),l.currentViewerRef.setInput("settings",f),a&&l.currentViewerRef.setInput("viewerTypeOverride",a)}catch(s){throw new Error(`Failed to load viewer component: ${s instanceof Error?s.message:String(s)}`)}})()}_switchToAlternative(t){var n=this;return(0,p.A)(function*(){const i=n._cueSnapshot,a=n._projectIdSnapshot;if(i&&a)try{const l=t.remoteRelativePath?yield i.storage.getAltRepDownloadUrl(t.remoteRelativePath):yield i.storage.getDownloadUrl(a,t.uuid,t.suffix);n.resolvedUrl.set(l),n.resolvedSuffix.set(t.suffix),yield n._renderViewer(l,t.suffix,null)}catch(l){console.error("[CueDocumentViewerWC] Failed to switch to alternative:",l)}})()}_downloadOriginal(){var t=this;return(0,p.A)(function*(){const n=t._cueSnapshot,i=t._projectIdSnapshot,a=t._originalUuid(),l=t._originalDocSuffix();if(n&&i&&a&&l)try{const s=yield n.storage.getDownloadUrl(i,a,l),f=yield(yield fetch(s)).blob();(0,_e.KE)(f,`${a}${l}`)}catch(s){console.error("[CueDocumentViewerWC] Failed to download original:",s)}})()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-document-viewer-wc"]],viewQuery:function(n,i){if(1&n&&e.GBs(be,5,e.c1b),2&n){let a;e.mGM(a=e.lsd())&&(i._viewerHostRef=a.first)}},inputs:{cue:[1,"cue"],uuid:[1,"uuid"],projectId:[1,"projectId"],showDocumentInfo:[1,"showDocumentInfo"],extraMenuItems:[1,"extraMenuItems"],portalBaseURL:[1,"portalBaseURL"],variant:[1,"variant"]},decls:4,vars:1,consts:[["body",""],["viewerHost",""],[2,"height","100%","width","100%",3,"variant","padded"],[2,"display","flex","flex-direction","column","height","100%","width","100%"],[3,"subject","handlers","menuItems"],["direction","column","align","center","justify","center",2,"flex","1","width","100%"],[2,"flex","1","min-height","0","overflow","hidden"],[2,"color","#c44","font-size","13px"],[4,"ngTemplateOutlet"]],template:function(n,i){1&n&&(e.DNE(0,Me,7,2,"ng-template",null,0,e.C5r),e.nVh(2,De,2,3,"cue-card",2)(3,Pe,1,1,"ng-container")),2&n&&(e.R7$(2),e.vxM("none"!==i.variant()?2:3))},dependencies:[x.MD,x.T3,M.n,E.Typography,me,ve.Z],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return o})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[112],{4853(B,I,l){l.d(I,{H:()=>L});var _=l(7705),u=l(5802),m=l(7089),c=l(7023),e=l(5381),f=l(5971),E=l(3319),x=l(356),R=l(6279),r=l(5547);const y=()=>({position:"bottomleft"}),p=(C,T)=>T.label||C;function P(C,T){if(1&C){const v=r.RV6();r.j41(0,"cue-menu-item",4),r.bIt("click",function(){const D=u.eBV(v).$implicit;return u.Njj(D.action())}),r.EFF(1),r.k0s()}if(2&C){const v=T.$implicit;r.Y8G("selected",v.selected),r.R7$(),r.JRh(v.label)}}function F(C,T){if(1&C&&(r.j41(0,"cue-menu-wrap"),r.Z7z(1,P,2,2,"cue-menu-item",3,p),r.k0s()),2&C){const v=r.XpG();r.R7$(),r.Dyx(v.contextMenuItems())}}function O(C,T){if(1&C){const v=r.RV6();r.j41(0,"cue-button",5),r.bIt("click",function(D){const j=u.eBV(v).$implicit,k=r.XpG();return u.Njj(k.handleClick(D,j))}),r.nrm(1,"cue-button-icon",6),r.k0s()}if(2&C){const v=T.$implicit,b=r.XpG(),D=r.sdS(1);r.Y8G("cueTooltip",v.label)("variant",v.variant?v.variant:b.variant())("size",b.size())("cueContextMenu",D)("contextMenuData",r.lJ4(7,y))("cueContextEnabled",void 0!==v.contextMenuItems&&v.contextMenuItems.length>0),r.R7$(),r.Y8G("icon",v.icon)}}let L=(()=>{class C{items=_.hFB.required();noGap=(0,_.hFB)(!0);direction=(0,_.hFB)("row");size=(0,_.hFB)("xs");variant=(0,_.hFB)("tertiary");mouseEnter=(0,_.CGW)();mouseLeave=(0,_.CGW)();contextMenuItems=(0,u.vPA)([]);handleClick(v,b){v.stopPropagation(),b.contextMenuItems&&b.contextMenuItems.length>0?this.contextMenuItems.set(b.contextMenuItems):b.action&&(this.contextMenuItems.set([]),b.action())}static \u0275fac=function(b){return new(b||C)};static \u0275cmp=r.VBU({type:C,selectors:[["cue-entity-menu"]],inputs:{items:[1,"items"],noGap:[1,"noGap"],direction:[1,"direction"],size:[1,"size"],variant:[1,"variant"]},outputs:{mouseEnter:"mouseEnter",mouseLeave:"mouseLeave"},decls:5,vars:2,consts:[["contextMenu",""],["gap","s","justify","end",2,"width","100%",3,"mouseenter","mouseleave","direction","noGap"],["trigger","leftclick",3,"cueTooltip","variant","size","cueContextMenu","contextMenuData","cueContextEnabled"],[3,"selected"],[3,"click","selected"],["trigger","leftclick",3,"click","cueTooltip","variant","size","cueContextMenu","contextMenuData","cueContextEnabled"],[3,"icon"]],template:function(b,D){1&b&&(r.DNE(0,F,3,0,"ng-template",null,0,r.C5r),r.j41(2,"cue-flexcontainer",1),r.bIt("mouseenter",function(){return D.mouseEnter.emit()})("mouseleave",function(){return D.mouseLeave.emit()}),r.Z7z(3,O,2,8,"cue-button",2,p),r.k0s()),2&b&&(r.R7$(2),r.Y8G("direction",D.direction())("noGap",D.noGap()),r.R7$(),r.Dyx(D.items()))},dependencies:[e.n,f.$,m.d,E.a,c.Q,x.M,R.D],encapsulation:2,changeDetection:0})}return C})()},1024(B,I,l){l.d(I,{p:()=>m});var _=l(5547);const u=["*"];let m=(()=>{class c{static \u0275fac=function(E){return new(E||c)};static \u0275cmp=_.VBU({type:c,selectors:[["cue-key-val-list"]],ngContentSelectors:u,decls:2,vars:0,consts:[[1,"key-val-list"]],template:function(E,x){1&E&&(_.NAR(),_.rj2(0,"div",0),_.SdG(1),_.eux())},styles:[".key-val-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--cue-grid-gap-s)}"]})}return c})()},9421(B,I,l){l.d(I,{F:()=>E});var _=l(7705),u=l(5802),m=l(2271),c=l(7335),e=l(2245),f=l(5547);let E=(()=>{class x{entityMenuDirective;size=(0,_.hFB)("m");key=_.hFB.required();val=_.geq.required();options=(0,_.hFB)([]);suffix=(0,_.hFB)("");valueChange=(0,_.CGW)();editModeEnabled=(0,u.vPA)(!1);valueChanged=(0,m.EW)(()=>this.val()!==this.newValue());newValue=(0,m.uu)(()=>this.val());labelSize=(0,m.EW)(()=>{switch(this.size()){case"s":return"xs";case"m":return"s";case"l":return"m";case"xl":return"l"}});onKeyPress(r){this.editModeEnabled()&&("Escape"===r.key?(this._reset(),r.stopPropagation()):"Enter"===r.key&&this._emitChange())}saveCancelMenu=(0,m.EW)(()=>{const r=[{icon:"close",label:"Cancel",action:()=>this._reset()}];return this.valueChanged()&&r.push({icon:"save",label:"Save",action:()=>this._emitChange()}),r});selectionChange(r){this.newValue.set(r?.toString()??"")}inputChange(r){this.newValue.set(r)}_emitChange(){this.valueChange.emit(this.newValue()),this.val.set(this.newValue()),this.editModeEnabled.set(!1)}_reset(){this.newValue.set(this.val()),this.editModeEnabled.set(!1)}static \u0275fac=function(y){return new(y||x)};static \u0275cmp=f.VBU({type:x,selectors:[["cue-key-val"]],viewQuery:function(y,p){if(1&y&&f.GBs(c.e,5),2&y){let P;f.mGM(P=f.lsd())&&(p.entityMenuDirective=P.first)}},hostBindings:function(y,p){1&y&&f.bIt("keydown",function(F){return p.onKeyPress(F)},f.EBC)},inputs:{size:[1,"size"],key:[1,"key"],val:[1,"val"],options:[1,"options"],suffix:[1,"suffix"]},outputs:{val:"valChange",valueChange:"valueChange"},decls:8,vars:5,consts:[[1,"key-val-container"],[3,"size"],[1,"value-content"]],template:function(y,p){1&y&&(f.j41(0,"dl",0)(1,"dt")(2,"cue-typography",1),f.EFF(3),f.k0s()(),f.j41(4,"dd")(5,"cue-typography",1)(6,"span",2),f.EFF(7),f.k0s()()()()),2&y&&(f.R7$(2),f.Y8G("size",p.labelSize()),f.R7$(),f.JRh(p.key()),f.R7$(2),f.Y8G("size",p.size()),f.R7$(2),f.Lme("",p.val()," ",p.suffix()))},dependencies:[e.Typography],styles:[".key-val-container[_ngcontent-%COMP%]{margin:0;display:flex;flex-direction:column;gap:var(--cue-grid-gap-s, 8px)}dt[_ngcontent-%COMP%], dd[_ngcontent-%COMP%]{margin:0}.read-mode-container[_ngcontent-%COMP%]{display:inline-flex;align-items:center;width:100%;position:relative}.read-mode-container.interactive[_ngcontent-%COMP%]:hover{cursor:pointer}.value-content[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%]{color:var(--cue-typography-text-color, inherit)}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], .value-content[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}[_ngcontent-%COMP%]:deep(cue-svg-icon), [_ngcontent-%COMP%]:deep(cue-entity-menu cue-svg-icon){color:var(--cue-icon-color, inherit)!important}.dirty-indicator[_ngcontent-%COMP%]{opacity:.8;margin-left:4px;color:var(--cue-typography-text-color, inherit)!important;font-weight:700;font-size:.4em;transform:translateY(-1em)}"]})}return x})()},7335(B,I,l){l.d(I,{e:()=>x});var _=l(7705),u=l(5802),m=l(5547),c=l(8359),e=l(6939),f=l(63),E=l(4853);let x=(()=>{class R{_targetEl=(0,u.WQX)(m.aKT);_overlay=(0,u.WQX)(f.hJ);_overlayRef;_isOverlayHovered=!1;_subscriptions;display=(0,_.hFB)("on-hover");menuItems=_.hFB.required();menuEnabled=(0,_.hFB)(!0);onMouseEnter(){if("on-hover"===this.display()){if(!this.menuItems().length)return void this.removeOverlayMenu();this.appendOverlayMenu()}}onMouseLeave(){this._checkShouldRemoveOverlay()}appendOverlayMenu(){if(!this.menuItems().length||this._overlayRef)return;const y=this._overlay.create({positionStrategy:this._overlay.position().flexibleConnectedTo(this._targetEl).withPositions([{originX:"end",originY:"center",overlayX:"start",overlayY:"center",offsetX:2,offsetY:0}])});this._overlayRef=y;const p=window.getComputedStyle(this._targetEl.nativeElement).color;y.overlayElement.style.color=p;const P=new e.A8(E.H),F=y.attach(P);F.instance.items=this.menuItems,this._subscriptions&&this._subscriptions.unsubscribe(),this._subscriptions=new c.yU,this._subscriptions.add(F.instance.mouseEnter.subscribe(()=>{this._isOverlayHovered=!0})),this._subscriptions.add(F.instance.mouseLeave.subscribe(()=>{this._isOverlayHovered=!1,this._checkShouldRemoveOverlay()}))}removeOverlayMenu(){this._overlayRef&&(this._subscriptions&&(this._subscriptions.unsubscribe(),this._subscriptions=void 0),this._overlayRef.detach(),this._overlayRef.dispose(),this._overlayRef=void 0)}_checkShouldRemoveOverlay(){setTimeout(()=>{this._isOverlayHovered||this.removeOverlayMenu()},300)}static \u0275fac=function(p){return new(p||R)};static \u0275dir=m.FsC({type:R,selectors:[["","cueEntityMenu",""]],hostBindings:function(p,P){1&p&&m.bIt("mouseenter",function(){return P.onMouseEnter()})("mouseleave",function(){return P.onMouseLeave()})},inputs:{display:[1,"display"],menuItems:[1,"menuItems"],menuEnabled:[1,"menuEnabled"]}})}return R})()},3112(B,I,l){l.d(I,{CueDocumentViewer:()=>Te});var _=l(467),u=l(7705),m=l(2271),c=l(5802),e=l(5547),f=l(9769),E=l(5381),x=l(2245),R=l(1024),r=l(9421),y=l(5903),p=l(9352),P=l(6117),F=l(8547),O=l(3319),L=l(5971),C=l(7573);const T=(o,h)=>t=>t.isHighlight;function v(o,h){if(1&o&&(e.j41(0,"span",3),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2).$implicit;e.R7$(),e.JRh(t.highlight.label)}}function b(o,h){if(1&o){const t=e.RV6();e.j41(0,"cue-button",5),e.bIt("click",function(i){c.eBV(t);const a=e.XpG(2).$implicit,s=e.XpG();return c.Njj(s.onDeleteHighlight(i,a.highlight))}),e.nrm(1,"cue-button-icon",6),e.k0s()}}function D(o,h){if(1&o){const t=e.RV6();e.j41(0,"span",2),e.bIt("click",function(){c.eBV(t);const i=e.XpG().$implicit,a=e.XpG();return c.Njj(a.onHighlightClick(i.highlight))}),e.nVh(1,v,2,1,"span",3),e.EFF(2),e.nVh(3,b,2,0,"cue-button",4),e.k0s()}if(2&o){const t=e.XpG().$implicit,n=e.XpG();e.BMQ("data-segment-start",t.segmentStart),e.R7$(),e.vxM(t.highlight.label?1:-1),e.R7$(),e.SpI(" ",t.text," "),e.R7$(),e.vxM(n.allowDelete()?3:-1)}}function j(o,h){if(1&o&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&o){const t=e.XpG().$implicit;e.BMQ("data-segment-start",t.segmentStart),e.R7$(),e.JRh(t.text)}}function k(o,h){if(1&o&&e.nVh(0,D,4,4,"span",1)(1,j,2,2,"span"),2&o){const t=h.$implicit;e.vxM(t.isHighlight&&t.highlight?0:1)}}let z=(()=>{class o{path=u.hFB.required();highlights=(0,u.hFB)([]);allowDelete=(0,u.hFB)(!1);allowAdd=(0,u.hFB)(!1);size=(0,u.hFB)("m");highlightClick=(0,u.CGW)();deleteHighlight=(0,u.CGW)();textSelected=(0,u.CGW)();segments=(0,m.EW)(()=>this.parseSegments(this.path(),this.highlights()));parseSegments(t,n){const i=n.filter(g=>g.path===t);if(0===i.length)return[{text:t,isHighlight:!1,segmentStart:0}];const a=[...i].sort((g,M)=>g.start-M.start),s=[];let d=0;for(const g of a)g.start>d&&s.push({text:t.substring(d,g.start),isHighlight:!1,segmentStart:d}),s.push({text:t.substring(g.start,g.end),isHighlight:!0,highlight:g,segmentStart:g.start}),d=g.end;return d<t.length&&s.push({text:t.substring(d),isHighlight:!1,segmentStart:d}),s}onHighlightClick(t){const n=this.path().substring(t.start,t.end);this.highlightClick.emit({path:this.path(),highlight:t,text:n})}onDeleteHighlight(t,n){t.stopPropagation(),this.deleteHighlight.emit({path:this.path(),highlight:n})}onMouseUp(t){if(!this.allowAdd())return;const n=window.getSelection();if(!n||n.isCollapsed||!n.rangeCount||!n.toString().trim())return;const a=n.getRangeAt(0),s=t.currentTarget,d=this.getAbsoluteOffset(s,a.startContainer,a.startOffset),g=this.getAbsoluteOffset(s,a.endContainer,a.endOffset);n.removeAllRanges(),g>d&&this.textSelected.emit({path:this.path(),start:d,end:g,text:this.path().substring(d,g)})}getAbsoluteOffset(t,n,i){let a=n.nodeType===Node.TEXT_NODE?n.parentElement:n;for(;a&&a!==t;){if(a instanceof HTMLElement&&a.hasAttribute("data-segment-start")){const M=parseInt(a.getAttribute("data-segment-start"),10);let w=0;const N=document.createTreeWalker(a,NodeFilter.SHOW_TEXT);let V=N.nextNode();for(;V&&V!==n;)w+=V.textContent?.length??0,V=N.nextNode();return M+w+i}a=a.parentElement}const s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let d=0,g=s.nextNode();for(;g&&g!==n;)d+=g.textContent?.length??0,g=s.nextNode();return d+i}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-file-path-viewer"]],inputs:{path:[1,"path"],highlights:[1,"highlights"],allowDelete:[1,"allowDelete"],allowAdd:[1,"allowAdd"],size:[1,"size"]},outputs:{highlightClick:"highlightClick",deleteHighlight:"deleteHighlight",textSelected:"textSelected"},decls:3,vars:7,consts:[[1,"path-content",3,"mouseup"],[1,"highlight-segment"],[1,"highlight-segment",3,"click"],[1,"highlight-label"],["size","xs","aria-label","Remove highlight",1,"delete-button"],["size","xs","aria-label","Remove highlight",1,"delete-button",3,"click"],["icon","close"]],template:function(n,i){1&n&&(e.j41(0,"div",0),e.bIt("mouseup",function(s){return i.onMouseUp(s)}),e.Z7z(1,k,2,1,null,null,e.Vm6),e.k0s()),2&n&&(e.AVh("size-s","s"===i.size())("allow-add",i.allowAdd())("has-highlights",i.segments().some(e._m7(6,T,i))),e.R7$(),e.Dyx(i.segments()))},dependencies:[f.MD,L.$,O.a],styles:["[_nghost-%COMP%]{display:contents}.path-content[_ngcontent-%COMP%]{display:block;flex:1;min-width:0;word-break:break-all;text-align:start;font-family:var(--cue-font-family);font-size:var(--cue-font-m-size);line-height:var(--cue-font-m-line-height);letter-spacing:var(--cue-font-m-letter-spacing);font-weight:var(--cue-font-weight-regular)}.path-content.size-s[_ngcontent-%COMP%]{font-size:var(--cue-font-s-size);line-height:var(--cue-font-s-line-height);letter-spacing:var(--cue-font-s-letter-spacing)}.path-content.allow-add[_ngcontent-%COMP%]{cursor:text;-webkit-user-select:text;user-select:text}.path-content.has-highlights[_ngcontent-%COMP%]{padding-top:.8rem;line-height:2.3rem}.highlight-segment[_ngcontent-%COMP%]{display:inline-block;vertical-align:text-bottom;position:relative;line-height:normal;font-weight:var(--cue-font-weight-medium);cursor:pointer;padding:0 .2rem;border-radius:3px;border:1px solid currentColor;transition:all .2s ease}.highlight-segment[_ngcontent-%COMP%] .highlight-label[_ngcontent-%COMP%]{font-family:var(--cue-font-family);position:absolute;bottom:100%;left:0;font-size:.5rem;line-height:1;opacity:.7;margin-bottom:.15rem;white-space:nowrap;pointer-events:none}.highlight-segment[_ngcontent-%COMP%] .delete-button[_ngcontent-%COMP%]{position:absolute;top:-12px;right:-12px;z-index:10;opacity:0;transition:opacity .2s ease;pointer-events:none}.highlight-segment[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,currentColor 12%,transparent)}.highlight-segment[_ngcontent-%COMP%]:hover .delete-button[_ngcontent-%COMP%]{opacity:1;pointer-events:all}"],changeDetection:0})}return o})();var H=l(5745),X=l(2444),K=l(9695),Y=l(5448),J=l(6950);const G=o=>({count:o}),Q=(o,h)=>t=>t.iri;function Z(o,h){1&o&&(e.j41(0,"cue-typography",11),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"components.documentInfo.infoLoadingFilePaths")))}function q(o,h){if(1&o){const t=e.RV6();e.j41(0,"cue-ag-grid",16),e.bIt("selectedRows",function(i){c.eBV(t);const a=e.XpG(4);return c.Njj(a.onMatchedPathsSelectionChange(i))}),e.k0s()}if(2&o){const t=e.XpG(4);e.Y8G("rowData",t._matchTableRowData())("columnDefs",t._matchTableColDefs())("rowSelection",t._matchTableRowSelection)}}function ee(o,h){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",12)(1,"cue-button",13),e.bIt("click",function(){c.eBV(t);const i=e.XpG(3);return c.Njj(i._matchTableExpanded.set(!i._matchTableExpanded()))}),e.nrm(2,"cue-button-icon",14),e.j41(3,"cue-button-label"),e.EFF(4),e.nI1(5,"transloco"),e.k0s()(),e.nVh(6,q,1,3,"cue-ag-grid",15),e.k0s(),e.j41(7,"cue-typography",11),e.EFF(8),e.nI1(9,"transloco"),e.k0s()}if(2&o){const t=e.XpG(3);e.R7$(2),e.Y8G("icon",t._matchTableExpanded()?"arrow-up":"arrow-dropdown"),e.R7$(2),e.JRh(e.i5U(5,4,1===t._matchCount()?"components.documentInfo.filePathMatched":"components.documentInfo.filePathsMatched",e.eq3(10,G,t._matchCount()))),e.R7$(2),e.vxM(t._matchTableExpanded()?6:-1),e.R7$(2),e.JRh(e.i5U(9,7,"components.documentInfo.applyToNPaths",e.eq3(12,G,t._selectedPaths().length)))}}function te(o,h){if(1&o&&e.nVh(0,Z,3,3,"cue-typography",11)(1,ee,10,14),2&o){const t=e.XpG(2);e.vxM(t._fileLocationsLoading()?0:null!==t._fileLocations()?1:-1)}}function ne(o,h){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",9)(1,"cue-input-switch",10),e.bIt("toggleChange",function(i){c.eBV(t);const a=e.XpG();return c.Njj(a.onApplyToAllChange(i))}),e.k0s(),e.j41(2,"cue-typography",11),e.EFF(3),e.nI1(4,"transloco"),e.k0s()(),e.nVh(5,te,2,1)}if(2&o){const t=e.XpG();e.R7$(),e.Y8G("checked",t._applyToAllFiles()),e.R7$(2),e.JRh(e.bMT(4,3,"components.documentInfo.applyToAllFiles")),e.R7$(2),e.vxM(t._applyToAllFiles()?5:-1)}}function ie(o,h){if(1&o&&(e.j41(0,"cue-typography",8),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.Lme("",e.bMT(2,2,"components.documentInfo.errorSavingEntityMention"),": ",t._saveError())}}let oe=(()=>{class o{selection=u.hFB.required();availableEntityCategories=(0,u.hFB)([]);fileLocations=(0,u.hFB)([]);requestFileLocations=(0,u.hFB)(void 0);requestFilePathEntityAdd=(0,u.hFB)(void 0);confirm=(0,u.CGW)();cancel=(0,u.CGW)();_selectedEntityCategory=(0,c.vPA)("");_applyToAllFiles=(0,c.vPA)(!1);_fileLocations=(0,c.vPA)(null);_fileLocationsLoading=(0,c.vPA)(!1);_matchTableExpanded=(0,c.vPA)(!1);_selectedPaths=(0,c.vPA)([]);_saving=(0,c.vPA)(!1);_saveError=(0,c.vPA)(null);_dirPrefix=(0,m.EW)(()=>{const t=this.selection();return t.path.substring(0,t.end)});_matchedLocations=(0,m.EW)(()=>{const t=this._fileLocations();if(!t)return[];const n=this._dirPrefix();return t.filter(i=>i.path.startsWith(n))});_matchCount=(0,m.EW)(()=>this._matchedLocations().length);_matchTableRowData=(0,m.EW)(()=>this._matchedLocations().map(t=>({iri:t.iri,path:t.path,providerId:t.providerId})));_entityCategoryLabelMap=(0,m.EW)(()=>this.availableEntityCategories().reduce((t,n)=>(t[n.iri]=n.label,t),{}));_matchTableRowSelection={mode:"multiRow",selectAll:"filtered"};_filePathLabel=(0,p.Xx)("components.contentBlocks.documentViewer.labelFilePath");_matchTableColDefs=(0,m.EW)(()=>[{headerName:this._filePathLabel(),field:"path",flex:1,filter:!0,sortable:!0}]);onEntityCategoryChange(t){this._selectedEntityCategory.set("string"==typeof t?t:String(t??""))}onApplyToAllChange(t){var n=this;return(0,_.A)(function*(){if(n._applyToAllFiles.set(t),n._matchTableExpanded.set(!1),!t)return n._fileLocations.set(null),void n._selectedPaths.set([]);const i=n.requestFileLocations();if(i){n._fileLocationsLoading.set(!0);try{const a=yield i();n._fileLocations.set(a);const s=n._dirPrefix();n._selectedPaths.set(a.filter(d=>d.path.startsWith(s)))}finally{n._fileLocationsLoading.set(!1)}}})()}onMatchedPathsSelectionChange(t){const n=this._fileLocations()??[];this._selectedPaths.set(t.map(i=>n.find(a=>a.path===i.path)??{iri:"",path:i.path}))}onConfirm(){var t=this;return(0,_.A)(function*(){const n=t._selectedEntityCategory();if(!n)return;const i=t.selection().path,a=t._fileLocations()?.find(g=>g.path===i)??t.fileLocations().find(g=>g.path===i)??{iri:"",path:i},s=t._applyToAllFiles()&&t._selectedPaths().length>0?t._selectedPaths():[a],d=t.requestFilePathEntityAdd();if(d){t._saving.set(!0),t._saveError.set(null);try{yield d(n,s)}catch(g){return console.error("[EntityMentionModal] Failed to save entity mention:",g),t._saveError.set(g instanceof Error?g.message:String(g)),void t._saving.set(!1)}t._saving.set(!1)}t.confirm.emit({entityCategory:n,paths:s})})()}onCancel(){this.cancel.emit()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-entity-mention-modal"]],inputs:{selection:[1,"selection"],availableEntityCategories:[1,"availableEntityCategories"],fileLocations:[1,"fileLocations"],requestFileLocations:[1,"requestFileLocations"],requestFilePathEntityAdd:[1,"requestFilePathEntityAdd"]},outputs:{confirm:"confirm",cancel:"cancel"},decls:18,vars:24,consts:[[3,"close","displayCloseBtn","closeOnBackgroundClick"],[1,"modal-content"],["direction","column","gap","m"],[3,"key","val"],[3,"valueChange","value","options","labelMap","label","showFilter"],["direction","row","justify","center"],[3,"click","disabled"],["variant","secondary",3,"click","disabled"],["size","s",2,"color","var(--cue-error)"],["direction","row","gap","s","align","center"],[3,"toggleChange","checked"],["size","s"],["direction","column","gap","xs"],["variant","ghost","size","xs",3,"click"],[3,"icon"],["size","s","height","220px",3,"rowData","columnDefs","rowSelection"],["size","s","height","220px",3,"selectedRows","rowData","columnDefs","rowSelection"]],template:function(n,i){1&n&&(e.j41(0,"cue-modal",0),e.bIt("close",function(){return i.onCancel()}),e.j41(1,"div",1)(2,"cue-flexcontainer",2),e.nrm(3,"cue-key-val",3),e.nI1(4,"transloco"),e.j41(5,"cue-select",4),e.nI1(6,"transloco"),e.bIt("valueChange",function(s){return i.onEntityCategoryChange(s)}),e.k0s(),e.nVh(7,ne,6,5),e.j41(8,"cue-flexcontainer",5)(9,"cue-button",6),e.bIt("click",function(){return i.onCancel()}),e.j41(10,"cue-button-label"),e.EFF(11),e.nI1(12,"transloco"),e.k0s()(),e.j41(13,"cue-button",7),e.bIt("click",function(){return i.onConfirm()}),e.j41(14,"cue-button-label"),e.EFF(15),e.nI1(16,"transloco"),e.k0s()()(),e.nVh(17,ie,3,4,"cue-typography",8),e.k0s()()()),2&n&&(e.Y8G("displayCloseBtn",!1)("closeOnBackgroundClick",!1),e.R7$(3),e.Y8G("key",e.bMT(4,15,"components.documentInfo.labelSelectedText"))("val",i.selection().text),e.R7$(2),e.Y8G("value",i._selectedEntityCategory())("options",i.availableEntityCategories().map(e._m7(17,Q,i)))("labelMap",i._entityCategoryLabelMap())("label",e.bMT(6,18,"components.entityInfo.labelEntityCategory"))("showFilter",i.availableEntityCategories().length>5),e.R7$(2),e.vxM(i.requestFileLocations()?7:-1),e.R7$(2),e.Y8G("disabled",i._saving()),e.R7$(2),e.JRh(e.bMT(12,20,"components.modals.rdfEdit.buttonCancel")),e.R7$(2),e.Y8G("disabled",!i._selectedEntityCategory()||i._saving()),e.R7$(2),e.JRh(e.bMT(16,22,"components.modals.rdfEdit.buttonSave")),e.R7$(2),e.vxM(i._saveError()?17:-1))},dependencies:[E.n,r.F,O.a,L.$,Y.L,x.Typography,H.a,X.l,K.d,J.R,p.Kj],styles:[".modal-content[_ngcontent-%COMP%]{width:640px;max-width:calc(100vw - 32px)}"],changeDetection:0})}return o})();const ae=()=>[];function se(o,h){if(1&o&&(e.nrm(0,"cue-key-val",6),e.nI1(1,"transloco")),2&o){const t=e.XpG(2);e.Y8G("key",e.bMT(1,2,"components.contentBlocks.documentViewer.labelSubject"))("val",t.subject())}}function le(o,h){if(1&o&&(e.j41(0,"cue-key-val-list"),e.nVh(1,se,2,4,"cue-key-val",6),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.vxM(t.subject()?1:-1)}}function re(o,h){if(1&o&&(e.j41(0,"cue-flexcontainer",4)(1,"cue-menu",7)(2,"cue-button",8,0),e.nrm(4,"cue-button-icon",9),e.k0s(),e.nrm(5,"cue-menu-nested",10),e.k0s()()),2&o){const t=e.XpG();e.R7$(5),e.Y8G("items",t.menuItems())}}function ce(o,h){if(1&o&&(e.nrm(0,"cue-key-val-editable",11),e.nI1(1,"transloco"),e.nI1(2,"transloco")),2&o){const t=e.XpG(2);e.Y8G("key",1===t.contentCategories().length?e.bMT(1,4,"components.contentBlocks.documentViewer.labelContentCategory"):e.bMT(2,6,"components.contentBlocks.documentViewer.labelContentCategories"))("val",t.contentCategoriesString())("rdfConfig",t.rdfEditConfig())("editDisabled",!t.contentCategoriesEditable())}}function ue(o,h){if(1&o&&(e.j41(0,"span",15),e.EFF(1),e.k0s()),2&o){const t=e.XpG(3);e.R7$(),e.Lme("(",t.currentFilePathIndex()+1,"/",t.fileLocations().length,")")}}function de(o,h){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){c.eBV(t);const i=e.XpG(3);return c.Njj(i.prevFilePath())}),e.nrm(1,"cue-button-icon",20),e.k0s()}if(2&o){const t=e.XpG(3);e.Y8G("disabled",0===t.currentFilePathIndex())}}function ge(o,h){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){c.eBV(t);const i=e.XpG(3);return c.Njj(i.nextFilePath())}),e.nrm(1,"cue-button-icon",21),e.k0s()}if(2&o){const t=e.XpG(3);e.Y8G("disabled",t.currentFilePathIndex()===t.fileLocations().length-1)}}function he(o,h){if(1&o){const t=e.RV6();e.j41(0,"dl",12)(1,"dt",13)(2,"cue-typography",14),e.EFF(3),e.nI1(4,"transloco"),e.nVh(5,ue,2,2,"span",15),e.k0s()(),e.j41(6,"dd",16),e.nVh(7,de,2,1,"cue-button",17),e.j41(8,"cue-file-path-viewer",18),e.bIt("textSelected",function(i){c.eBV(t);const a=e.XpG(2);return c.Njj(a.onTextSelected(i))}),e.k0s(),e.nVh(9,ge,2,1,"cue-button",17),e.k0s()()}if(2&o){const t=e.XpG(2);e.R7$(3),e.SpI(" ",e.bMT(4,8,"components.contentBlocks.documentViewer.labelFilePath")," "),e.R7$(2),e.vxM(t.fileLocations().length>1?5:-1),e.R7$(2),e.vxM(t.fileLocations().length>1?7:-1),e.R7$(),e.Y8G("path",t.fileLocations()[t.currentFilePathIndex()].path)("highlights",t.filePathEntitiesVisible()?t.filePathHighlights():e.lJ4(10,ae))("allowDelete",t.filePathEntitiesEditable())("allowAdd",t.filePathEntitiesEditable()),e.R7$(),e.vxM(t.fileLocations().length>1?9:-1)}}function _e(o,h){if(1&o&&(e.j41(0,"cue-key-val-list"),e.nrm(1,"hr"),e.nVh(2,ce,3,8,"cue-key-val-editable",11),e.nVh(3,he,10,11,"dl",12),e.k0s()),2&o){const t=e.XpG();e.R7$(2),e.vxM(t.contentCategories()&&t.contentCategories().length>0?2:-1),e.R7$(),e.vxM(t.fileLocations().length>0?3:-1)}}function me(o,h){if(1&o){const t=e.RV6();e.j41(0,"cue-entity-mention-modal",22),e.bIt("confirm",function(i){c.eBV(t);const a=e.XpG();return c.Njj(a.onEntityMentionConfirm(i))})("cancel",function(){c.eBV(t);const i=e.XpG();return c.Njj(i.onEntityMentionCancel())}),e.k0s()}if(2&o){const t=e.XpG();e.Y8G("selection",t._pendingSelection())("availableEntityCategories",t.availableEntityCategories())("fileLocations",t.fileLocations())("requestFileLocations",t._fileLocationsProvider())("requestFilePathEntityAdd",t._requestFilePathEntityAdd())}}let fe=(()=>{class o{subject=u.hFB.required();handlers=u.hFB.required();dataChanged=(0,u.CGW)();filePathEntityAdded=(0,u.CGW)();fileLocations=(0,u.hFB)([]);_fileLocationsProvider=(0,m.EW)(()=>{const t=this.handlers().requestFileLocations;if(t)return t;const n=this.fileLocations();return n.length?()=>Promise.resolve(n):void 0});filePathEntities=(0,u.geq)([]);contentCategories=(0,u.hFB)([]);contentCategoriesEditable=(0,u.hFB)(!1);filePathEntitiesVisible=(0,u.hFB)(!1);filePathEntitiesEditable=(0,u.hFB)(!1);menuItems=(0,u.hFB)([]);availableContentCategories=(0,u.hFB)([]);availableEntityCategories=(0,u.hFB)([]);collapsed=(0,u.hFB)(!1);hasDocInfo=(0,m.EW)(()=>{const t=""!==this.subject(),n=this.fileLocations().length>0;return t||n});currentFilePathIndex=(0,c.vPA)(0);_entityCategoryModalVisible=(0,c.vPA)(!1);_pendingSelection=(0,c.vPA)(null);_requestFilePathEntityAdd=(0,m.EW)(()=>{var t=this;const n=this.handlers().requestFilePathEntityAdd;if(n)return function(){var i=(0,_.A)(function*(a,s){const d=t._pendingSelection();d&&(yield n({paths:s,start:d.start,end:d.end,text:d.text,entityCategory:a,folderPath:d.path.substring(0,d.end)}))});return function(a,s){return i.apply(this,arguments)}}()});prevFilePath(){this.currentFilePathIndex()>0&&this.currentFilePathIndex.update(t=>t-1)}nextFilePath(){this.currentFilePathIndex()<this.fileLocations().length-1&&this.currentFilePathIndex.update(t=>t+1)}filePathHighlights=(0,m.EW)(()=>this.filePathEntities().map(t=>({path:t.path,start:t.startIndex,end:t.endIndex,label:this.availableEntityCategories().find(n=>n.iri===t.entityCategory)?.label??t.entityCategory.split("/").pop()??t.entityCategory})));entityCategoryLabelMap=(0,m.EW)(()=>this.availableEntityCategories().reduce((t,n)=>(t[n.iri]=n.label,t),{}));onTextSelected(t){this._pendingSelection.set(t),this._entityCategoryModalVisible.set(!0)}onEntityMentionConfirm(t){const n=this._pendingSelection();n&&(this.filePathEntities.update(i=>[...i,...t.paths.map(a=>({path:a.path,entityCategory:t.entityCategory,startIndex:n.start,endIndex:n.end}))]),this.filePathEntityAdded.emit({paths:t.paths,start:n.start,end:n.end,text:n.text,entityCategory:t.entityCategory,folderPath:n.path.substring(0,n.end)}),this._entityCategoryModalVisible.set(!1),this._pendingSelection.set(null))}onEntityMentionCancel(){this._entityCategoryModalVisible.set(!1),this._pendingSelection.set(null)}_contentCategories=(0,m.uu)(()=>this.contentCategories());contentCategoriesString=(0,m.EW)(()=>this._contentCategories().map(t=>this._iriToString(t)).sort().join(", "));_iriToString(t){const n=this.availableContentCategories()?.find(i=>i.iri===t);return n?n.label:t}infoChangeContentCategory=(0,p.Xx)("components.documentInfo.infoChangeContentCategory");rdfEditConfig=(0,m.EW)(()=>{var t=this;const n=this.handlers()?.requestRDFChange;var i;if(void 0!==n)return{message:this.infoChangeContentCategory(),existingValue:this._contentCategories(),dataType:"multiselect",options:this.availableContentCategories()?.map(i=>i.iri),optionLabelMap:this.availableContentCategories()?.reduce((i,a)=>(i[a.iri]=a.label,i),{}),requestSave:(i=(0,_.A)(function*(a){console.log(a);const s={subject:t.subject(),predicate:`${C.E.qcy}contentCategory`,objects:t._contentCategories(),newObjects:a.newValue,type:"contentCategory",comment:a.comment};yield n(s),t._contentCategories.set(a.newValue),t.dataChanged.emit({contentCategories:a.newValue})}),function(s){return i.apply(this,arguments)})};console.warn("No RDF change request handler defined")});static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-document-info"]],inputs:{subject:[1,"subject"],handlers:[1,"handlers"],fileLocations:[1,"fileLocations"],filePathEntities:[1,"filePathEntities"],contentCategories:[1,"contentCategories"],contentCategoriesEditable:[1,"contentCategoriesEditable"],filePathEntitiesVisible:[1,"filePathEntitiesVisible"],filePathEntitiesEditable:[1,"filePathEntitiesEditable"],menuItems:[1,"menuItems"],availableContentCategories:[1,"availableContentCategories"],availableEntityCategories:[1,"availableEntityCategories"],collapsed:[1,"collapsed"]},outputs:{dataChanged:"dataChanged",filePathEntityAdded:"filePathEntityAdded",filePathEntities:"filePathEntitiesChange"},decls:7,vars:4,consts:[["trigger",""],["direction","column",2,"min-height","50px"],["direction","row"],["direction","column",2,"flex","1 1"],["direction","column",2,"width","50px"],[3,"selection","availableEntityCategories","fileLocations","requestFileLocations","requestFilePathEntityAdd"],["size","l",3,"key","val"],["positioning","bottomleft"],["trigger","","variant","tertiary"],["icon","more-vert"],["menu","",3,"items"],["size","s",3,"key","val","rdfConfig","editDisabled"],[1,"file-path-nav-container"],[1,"file-path-label"],["size","xs"],[1,"path-counter"],[1,"file-path-row"],["variant","tertiary","size","xs",3,"disabled"],["size","s",3,"textSelected","path","highlights","allowDelete","allowAdd"],["variant","tertiary","size","xs",3,"click","disabled"],["icon","paginator-back"],["icon","paginator-next"],[3,"confirm","cancel","selection","availableEntityCategories","fileLocations","requestFileLocations","requestFilePathEntityAdd"]],template:function(n,i){1&n&&(e.j41(0,"cue-flexcontainer",1)(1,"cue-flexcontainer",2)(2,"cue-flexcontainer",3),e.nVh(3,le,2,1,"cue-key-val-list"),e.k0s(),e.nVh(4,re,6,1,"cue-flexcontainer",4),e.k0s(),e.nVh(5,_e,4,2,"cue-key-val-list"),e.k0s(),e.nVh(6,me,1,5,"cue-entity-mention-modal",5)),2&n&&(e.R7$(3),e.vxM(i.fileLocations().length>0||i.subject()?3:-1),e.R7$(),e.vxM(i.menuItems().length>0?4:-1),e.R7$(),e.vxM(!i.collapsed()&&i.hasDocInfo()?5:-1),e.R7$(),e.vxM(i._entityCategoryModalVisible()&&i._pendingSelection()?6:-1))},dependencies:[E.n,R.p,r.F,y.L,P.W,F.T,O.a,L.$,z,x.Typography,oe,p.Kj],styles:[".file-path-nav-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px}.file-path-label[_ngcontent-%COMP%]{display:block;margin:0}.file-path-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;margin:0;overflow:visible;padding:1px}.file-path-row[_ngcontent-%COMP%] cue-file-path-viewer[_ngcontent-%COMP%]{flex:1;overflow:visible;min-width:0}.path-counter[_ngcontent-%COMP%]{opacity:.6}"],changeDetection:0})}return o})();class pe{requestRDFChange;requestFileLocations;requestFilePathEntityAdd}var ve=l(2065),ye=l(5187);const Ce=["viewerHost"];function be(o,h){if(1&o&&e.nrm(0,"cue-document-info",4),2&o){const t=e.XpG(2);e.Y8G("subject",t._docSubject())("handlers",t._docInfoHandlers)("menuItems",t._menuItems())}}function Me(o,h){1&o&&(e.j41(0,"cue-flexcontainer",5)(1,"cue-typography"),e.EFF(2,"Loading\u2026"),e.k0s()())}function Ee(o,h){if(1&o&&(e.j41(0,"cue-flexcontainer",5)(1,"cue-typography",7),e.EFF(2),e.k0s()()),2&o){const t=e.XpG(2);e.R7$(2),e.JRh(t.errorMessage())}}function xe(o,h){if(1&o&&(e.j41(0,"div",3),e.nVh(1,be,1,3,"cue-document-info",4),e.nVh(2,Me,3,0,"cue-flexcontainer",5)(3,Ee,3,1,"cue-flexcontainer",5),e.j41(4,"div",6),e.eu8(5,null,1),e.k0s()()),2&o){const t=e.XpG();e.R7$(),e.vxM(t.showDocumentInfo()&&"ready"===t.state()?1:-1),e.R7$(),e.vxM("loading"===t.state()?2:"error"===t.state()?3:-1)}}function De(o,h){1&o&&e.eu8(0)}function Pe(o,h){if(1&o&&(e.j41(0,"cue-card",2),e.DNE(1,De,1,0,"ng-container",8),e.k0s()),2&o){const t=e.XpG(),n=e.sdS(1);e.Y8G("variant",t._cardVariant())("padded",!0),e.R7$(),e.Y8G("ngTemplateOutlet",n)}}function Fe(o,h){1&o&&e.eu8(0)}function Ie(o,h){if(1&o&&e.DNE(0,Fe,1,0,"ng-container",8),2&o){e.XpG();const t=e.sdS(1);e.Y8G("ngTemplateOutlet",t)}}const we=[".fragments",".dxf",".pdf",".png",".jpg",".jpeg",".svg",".gif",".webp",".bmp",".avif",".apng",".xlsx",".xls",".csv",".json",".jsonld",".xml",".css",".js",".html",".htm",".sh",".txt",".rst",".md"];function $(o){const[h,t]=o.split("?"),n=h.trim();let i=null;if(t){const s=new URLSearchParams(t).get("page");if(null!==s){const d=parseInt(s,10);!isNaN(d)&&d>0&&(i=d)}}return{uuid:n,page:i}}let Te=(()=>{class o{set _viewerHostRef(t){if(this._viewerHost=t,t&&this._lastRenderArgs){const{url:n,suffix:i,page:a,viewerTypeOverride:s}=this._lastRenderArgs;this._renderViewer(n,i,a,s)}}_viewerHost;_lastRenderArgs;currentViewerRef;cue=(0,u.hFB)(void 0);uuid=(0,u.hFB)(void 0);projectId=(0,u.hFB)(void 0);showDocumentInfo=(0,u.hFB)(!0);extraMenuItems=(0,u.hFB)([]);portalBaseURL=(0,u.hFB)("https://cue.qaecy.com");variant=(0,u.hFB)("none");_cardVariant=(0,m.EW)(()=>this.variant());state=(0,c.vPA)("idle");errorMessage=(0,c.vPA)(null);resolvedUrl=(0,c.vPA)(null);resolvedSuffix=(0,c.vPA)(null);_docSubject=(0,c.vPA)("");_alternatives=(0,c.vPA)([]);_originalUuid=(0,c.vPA)(null);_originalDocSuffix=(0,c.vPA)(null);_cueSnapshot=null;_projectIdSnapshot=null;_docInfoHandlers=new pe;_menuItems=(0,m.EW)(()=>{const t=[],n=this._originalUuid(),i=this._originalDocSuffix();n&&i&&t.push({icon:"download",label:"Download file",action:()=>this._downloadOriginal()});const a=this.uuid(),s=this.projectId();if(a&&s){const{uuid:g}=$(a),M=this.portalBaseURL().replace(/\/$/,"");t.push({icon:"external-link",label:"Open in Cue",action:()=>window.open(`${M}/r/${s}/${g}`,"_blank","noopener,noreferrer")})}const d=this._alternatives();if(d.length>1){const g=this.resolvedSuffix();t.push({icon:"document",label:"Alternative representation",children:d.map(M=>({label:M.original?`Original (${M.suffix.replace(".","").toUpperCase()})`:M.suffix.replace(".","").toUpperCase(),tooltip:g===M.suffix?"Currently shown":void 0,action:()=>this._switchToAlternative(M)}))})}return t.push(...this.extraMenuItems()),t});constructor(){(0,c.QZP)(()=>{const t=this.cue(),n=this.uuid(),i=this.projectId();t&&n&&i?this._load(t,n,i):this.state.set("idle")})}_load(t,n,i){var a=this;return(0,_.A)(function*(){if(t&&n&&i){a.state.set("loading"),a.resolvedUrl.set(null),a.resolvedSuffix.set(null),a.errorMessage.set(null),a._docSubject.set(""),a._originalUuid.set(null),a._originalDocSuffix.set(null),a._alternatives.set([]),a._viewerHost?.clear(),a.currentViewerRef?.destroy(),a.currentViewerRef=void 0,a._lastRenderArgs=void 0;try{a._cueSnapshot=t,a._projectIdSnapshot=i;const{uuid:s,page:d}=$(n),g=t.createProjectDocuments(i),w=(yield g.fetchDocumentData([s]))[s];if(!w)throw new Error(`Document '${s}' not found in project '${i}'.`);a._docSubject.set(w.subject??""),a._originalUuid.set(s),a._originalDocSuffix.set(w.suffix);const N=yield g.fetchAlternativeRepresentations(s);a._alternatives.set([{uuid:s,suffix:w.suffix,original:!0},...N.filter(A=>A.id!==s).map(A=>({uuid:A.id,suffix:A.suffix,original:!1,remoteRelativePath:A.remoteRelativePath}))]);const{uuid:V,suffix:S,remoteRelativePath:W}=function Re(o,h){const t=[o,...h];let n,i=1/0;for(const a of t){const s=we.indexOf(a.suffix);-1!==s&&s<i&&(i=s,n=a)}return n?{uuid:n.id,suffix:n.suffix,remoteRelativePath:n.remoteRelativePath}:{uuid:o.id,suffix:o.suffix}}(w,N),U=W?yield t.storage.getAltRepDownloadUrl(W):yield t.storage.getDownloadUrl(i,V,S);a.resolvedUrl.set(U),a.resolvedSuffix.set(S);const Ve=[".eml",".msg",".emlx",".mbx"].includes(w.suffix)&&".json"===S?"email":void 0;yield a._renderViewer(U,S,d,Ve),a.state.set("ready")}catch(s){const d=s instanceof Error?s.message:String(s);console.error("[CueDocumentViewerWC] Failed to load document:",d),a.errorMessage.set(d),a.state.set("error")}}else a.state.set("idle")})()}_renderViewer(t,n,i,a){var s=this;return(0,_.A)(function*(){try{const{DocumentViewer:d}=yield Promise.all([l.e(418),l.e(645),l.e(76),l.e(741)]).then(l.bind(l,1741)),{DocumentViewerSettings:g}=yield l.e(418).then(l.bind(l,3418));s._viewerHost?.clear(),s.currentViewerRef?.destroy();const M=new g;if(null!==i&&(M.pdf.page=String(i)),!s._viewerHost)throw new Error("viewerHost is not yet available \u2014 view has not been initialized.");s._lastRenderArgs={url:t,suffix:n,page:i,viewerTypeOverride:a},s.currentViewerRef=s._viewerHost.createComponent(d),s.currentViewerRef.setInput("url",t),s.currentViewerRef.setInput("suffix",n),s.currentViewerRef.setInput("settings",M),a&&s.currentViewerRef.setInput("viewerTypeOverride",a)}catch(d){throw new Error(`Failed to load viewer component: ${d instanceof Error?d.message:String(d)}`)}})()}_switchToAlternative(t){var n=this;return(0,_.A)(function*(){const i=n._cueSnapshot,a=n._projectIdSnapshot;if(i&&a)try{const s=t.remoteRelativePath?yield i.storage.getAltRepDownloadUrl(t.remoteRelativePath):yield i.storage.getDownloadUrl(a,t.uuid,t.suffix);n.resolvedUrl.set(s),n.resolvedSuffix.set(t.suffix),yield n._renderViewer(s,t.suffix,null)}catch(s){console.error("[CueDocumentViewerWC] Failed to switch to alternative:",s)}})()}_downloadOriginal(){var t=this;return(0,_.A)(function*(){const n=t._cueSnapshot,i=t._projectIdSnapshot,a=t._originalUuid(),s=t._originalDocSuffix();if(n&&i&&a&&s)try{const d=yield n.storage.getDownloadUrl(i,a,s),M=yield(yield fetch(d)).blob();(0,ve.KE)(M,`${a}${s}`)}catch(d){console.error("[CueDocumentViewerWC] Failed to download original:",d)}})()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-document-viewer-wc"]],viewQuery:function(n,i){if(1&n&&e.GBs(Ce,5,e.c1b),2&n){let a;e.mGM(a=e.lsd())&&(i._viewerHostRef=a.first)}},inputs:{cue:[1,"cue"],uuid:[1,"uuid"],projectId:[1,"projectId"],showDocumentInfo:[1,"showDocumentInfo"],extraMenuItems:[1,"extraMenuItems"],portalBaseURL:[1,"portalBaseURL"],variant:[1,"variant"]},decls:4,vars:1,consts:[["body",""],["viewerHost",""],[2,"height","100%","width","100%",3,"variant","padded"],[2,"display","flex","flex-direction","column","height","100%","width","100%"],[3,"subject","handlers","menuItems"],["direction","column","align","center","justify","center",2,"flex","1","width","100%"],[2,"flex","1","min-height","0","overflow","hidden"],[2,"color","#c44","font-size","13px"],[4,"ngTemplateOutlet"]],template:function(n,i){1&n&&(e.DNE(0,xe,7,2,"ng-template",null,0,e.C5r),e.nVh(2,Pe,2,3,"cue-card",2)(3,Ie,1,1,"ng-container")),2&n&&(e.R7$(2),e.vxM("none"!==i.variant()?2:3))},dependencies:[f.MD,f.T3,E.n,x.Typography,fe,ye.Z],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return o})()}}]);
|
package/360.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[360],{6170(_,C,r){r.d(C,{R:()=>M});var d=r(7705),c=r(5802),s=r(2271),b=r(5547);let M=(()=>{class u{destroyRef=(0,c.WQX)(c.abz);_isDarkMode=(0,c.vPA)(this.hasDarkClass());isDarkMode=(0,s.EW)(()=>this._isDarkMode());darkModeChange=(0,d.CGW)();constructor(){const y=new MutationObserver(m=>{m.forEach(f=>{if("attributes"===f.type&&"class"===f.attributeName){const v=this.hasDarkClass();v!==this._isDarkMode()&&this._isDarkMode.set(v)}})});y.observe(document.body,{attributes:!0,attributeFilter:["class"]}),this.destroyRef.onDestroy(()=>y.disconnect()),(0,c.QZP)(()=>{this.darkModeChange.emit(this._isDarkMode()),document.documentElement.style.colorScheme=this._isDarkMode()?"dark":"light"})}hasDarkClass(){return document.body.classList.contains("dark")}toggleDarkMode(){document.body.classList.toggle("dark")}static \u0275fac=function(m){return new(m||u)};static \u0275dir=b.FsC({type:u,selectors:[["","cueDarkMode",""]],outputs:{darkModeChange:"darkModeChange"},exportAs:["darkModeDetector"]})}return u})()},8493(_,C,r){r.d(C,{CueEntityList:()=>U});var d=r(7705),c=r(2271),s=r(5802),b=r(467),M=r(6950),u=r(9352),E=r(1951),y=r(6455),m=r(8334),f=r(5949),v=r(2843),k=r(3646),x=r(8017),N=r(2306),P=r(6103);let R=(()=>{class a{mapboxToken=(0,s.vPA)(void 0);entityData=(0,s.vPA)({});availableEntityRelationships=(0,s.vPA)([]);settings=(0,c.EW)(()=>{const e=this.mapboxToken();if(!e)return;const n=new N.yY;return n.mapboxToken=e,n.contextMenu.showFlyTo=!1,n.contextMenu.showProperties=!1,n});layers=(0,c.EW)(()=>{const e=this.entityData(),n=this.availableEntityRelationships();return(0,P.N)({entityData:e,availableEntityRelationships:n})});static \u0275fac=function(n){return new(n||a)};static \u0275prov=s.jDH({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();var B=r(3183),T=r(5902);let L=(()=>{class a{entities=(0,s.vPA)([]);entityData=(0,s.vPA)({});orderByMentionCount=(0,s.vPA)(!1);availableEntityCategories=(0,s.vPA)(void 0);labelValue=(0,u.Xx)("components.entityList.labelValue");labelCategories=(0,u.Xx)("components.entityList.labelCategories");labelMentions=(0,u.Xx)("components.entityList.labelMentionCount");_filterChangeCounter=(0,s.vPA)(0);filterChangeCounter=this._filterChangeCounter.asReadonly();onFilterChanged(){this._filterChangeCounter.update(e=>e+1)}columnDefs=(0,c.EW)(()=>{const e=[{field:"value",headerName:this.labelValue(),flex:2,filter:T.U,valueGetter:n=>!n.data?.value&&n.data?.loading?"Loading...":n.data?.value||n.data?.entity},{field:"categories",headerName:this.labelCategories(),flex:1.5,filter:B.A,valueGetter:n=>{const i=n.data?.categories;if(!i)return n.data?.loading?"...":"";const o=Array.isArray(i)?i:[i],l=this._leafEntityCategoryIris();return(l?o.filter(p=>l.has(p)):o).map(p=>this._getEntityCategoryLabel(p)).join(", ")}}];return this.orderByMentionCount()&&e.push({field:"mentionCount",headerName:this.labelMentions(),flex:1,filter:"agNumberColumnFilter",valueGetter:n=>{const i=n.data;if(i?.loading)return"...";const o=i?.mentionCount??0;return o>0?o:""},cellStyle:{textAlign:"center"}}),e});rows=(0,c.EW)(()=>{const e=this.entities()||[],n=this.entityData()||{},i=e.map(o=>{const l=n[o];return{entity:o,value:l?.value,categories:l?.categories,mentionCount:l?.mentionCount,loading:!l}});return this.orderByMentionCount()?i.sort((o,l)=>(l.mentionCount||0)-(o.mentionCount||0)):i});_leafEntityCategoryIris=(0,c.EW)(()=>{const e=this.availableEntityCategories();if(!e)return null;const n=new Set(e.map(i=>i.parent).filter(i=>!!i));return new Set(e.filter(i=>!n.has(i.iri)).map(i=>i.iri))});_getEntityCategoryLabel(e){const n=this.availableEntityCategories();if(void 0!==n){const i=n.find(o=>o.iri===e);if(i)return i.label}return this._prettifyCategory(e)}_prettifyCategory(e){if(!e)return"";const n=e.split("#");return(n[n.length-1]||e).replace(/([A-Z])/g," $1").trim()}static \u0275fac=function(n){return new(n||a)};static \u0275prov=s.jDH({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();var A=r(5971),S=r(5448),I=r(2014),D=r(5381),t=r(5547);function w(a,h){if(1&a){const e=t.RV6();t.j41(0,"cue-flexcontainer",2)(1,"cue-button",5),t.bIt("click",function(){s.eBV(e);const i=t.XpG();return s.Njj(i.onOrderByMentionCountClick())}),t.nrm(2,"cue-button-padder"),t.j41(3,"cue-button-label"),t.EFF(4),t.nI1(5,"transloco"),t.k0s(),t.nrm(6,"cue-button-padder"),t.k0s()()}if(2&a){const e=t.XpG();t.R7$(),t.Y8G("tooltip",e.infoOrderByMentionCount()),t.R7$(3),t.JRh(t.bMT(5,2,"components.entityList.labelOrderByMentionCount"))}}function O(a,h){if(1&a){const e=t.RV6();t.j41(0,"cue-tab",1),t.nI1(1,"transloco"),t.j41(2,"cue-map",6),t.bIt("clickedFeature",function(i){s.eBV(e);const o=t.XpG();return s.Njj(o.onMapFeatureClick(i))}),t.k0s()()}if(2&a){t.XpG();const e=t.r8f(6),n=t.r8f(7);t.Y8G("label",t.bMT(1,3,"components.entityList.tabMap")),t.R7$(2),t.Y8G("layers",n)("settings",e)}}let G=(()=>{class a{map=(0,s.WQX)(R);table=(0,s.WQX)(L);entities=d.hFB.required();mapboxToken=(0,d.hFB)(void 0);handlers=d.hFB.required();orderByMentionCount=(0,d.geq)(!1);availableEntityCategories=(0,d.hFB)(void 0);availableEntityRelationships=(0,d.hFB)();entityData=(0,d.hFB)({});paginationPageSize=(0,d.hFB)(10);rowClicked=(0,d.CGW)();clickedOpen=(0,d.CGW)();_gridApi=null;_requestedIris=new Set;_requestedLocationIris=new Set;_isSorted=!1;_pendingMapClickIri=(0,s.vPA)(null);labelOpenInEntityViewer=(0,u.Xx)("components.entityList.labelOpenInEntityViewer");infoOrderByMentionCount=(0,u.Xx)("components.entityList.infoOrderByMentionCount");overlaySettings={...new E.K,mode:"row"};overlayActions=(0,c.EW)(()=>[{label:this.labelOpenInEntityViewer(),icon:"info",action:e=>{this.handlers().requestOpen?.(e.rowData),this.clickedOpen.emit(e.rowData)}}]);constructor(){(0,s.QZP)(()=>this.map.mapboxToken.set(this.mapboxToken())),(0,s.QZP)(()=>{const e=this.entityData();this.map.entityData.update(n=>{let i=!1;const o={...n};for(const[l,g]of Object.entries(e))(g.directMapGeometries?.length||g.indirectMapGeometries?.length)&&(o[l]={value:"",categories:[],directMapGeometries:g.directMapGeometries,indirectMapGeometries:g.indirectMapGeometries},i=!0);return i?o:n})}),(0,s.QZP)(()=>this.map.availableEntityRelationships.set(this.availableEntityRelationships()??[])),(0,s.QZP)(()=>this.table.availableEntityCategories.set(this.availableEntityCategories())),(0,s.QZP)(()=>this.table.entities.set(this.entities())),(0,s.QZP)(()=>this.table.entityData.set(this.entityData())),(0,s.QZP)(()=>this.table.orderByMentionCount.set(this.orderByMentionCount())),(0,s.QZP)(()=>{const e=this._pendingMapClickIri();if(!e)return;const n=this.entityData()[e];n&&(this._pendingMapClickIri.set(null),this.rowClicked.emit({entity:e,value:n.value,categories:n.categories,mentionCount:n.mentionCount,loading:!1}))}),(0,s.QZP)(()=>{const e=[...this.entities()];if(e?.length&&void 0!==this.handlers().requestLocations){const n=e.filter(i=>!this._requestedLocationIris.has(i));n.length>0&&(n.forEach(i=>this._requestedLocationIris.add(i)),this.handlers().requestLocations?.(n))}}),(0,s.QZP)(()=>{const e=this.orderByMentionCount(),n=this.table.filterChangeCounter();if(e||n>0){const l=this.entities().filter(g=>!this._requestedIris.has(g));l.length>0&&(l.forEach(g=>this._requestedIris.add(g)),this.handlers().requestData(l,e))}})}rowSelection={mode:"singleRow",checkboxes:!1,enableClickSelection:!0};onGridReady(e){this._gridApi=e,e.addEventListener("viewportChanged",()=>this._checkViewport()),e.addEventListener("modelUpdated",()=>this._checkViewport()),e.addEventListener("sortChanged",()=>{const n=e.getColumnState();this._isSorted=n.some(i=>null!=i.sort),this._isSorted&&this._requestAllUnloaded()}),e.addEventListener("filterChanged",()=>{this.table.onFilterChanged()}),setTimeout(()=>this._checkViewport(),100)}onMapFeatureClick(e){var n=this;return(0,b.A)(function*(){const o=e.feature.properties?.iri;o&&(n._pendingMapClickIri.set(o),yield n.handlers().requestData?.([o],n.orderByMentionCount()))})()}_checkViewport(){if(!this._gridApi)return;if(this._isSorted)return void this._requestAllUnloaded();const n=this._gridApi.getRenderedNodes().map(i=>i.data).filter(i=>!i.value&&i.loading).map(i=>i.entity).filter(i=>!this._requestedIris.has(i));if(n.length>0){const i=Array.from(new Set(n));i.forEach(o=>this._requestedIris.add(o)),this.handlers().requestData(i,this.orderByMentionCount())}}_requestAllUnloaded(){if(!this._gridApi)return;const e=[];if(this._gridApi.forEachNode(n=>{const i=n.data;i?.loading&&!this._requestedIris.has(i.entity)&&e.push(i.entity)}),e.length>0){const n=Array.from(new Set(e));n.forEach(i=>this._requestedIris.add(i)),this.handlers().requestData(n,this.orderByMentionCount())}}onOrderByMentionCountClick(){this.orderByMentionCount.set(!this.orderByMentionCount())}static \u0275fac=function(n){return new(n||a)};static \u0275cmp=t.VBU({type:a,selectors:[["cue-ent-list"]],inputs:{entities:[1,"entities"],mapboxToken:[1,"mapboxToken"],handlers:[1,"handlers"],orderByMentionCount:[1,"orderByMentionCount"],availableEntityCategories:[1,"availableEntityCategories"],availableEntityRelationships:[1,"availableEntityRelationships"],entityData:[1,"entityData"],paginationPageSize:[1,"paginationPageSize"]},outputs:{orderByMentionCount:"orderByMentionCountChange",rowClicked:"rowClicked",clickedOpen:"clickedOpen"},features:[t.Jv_([f.u,v.M,k.B])],decls:9,vars:13,consts:[[2,"position","relative","width","100%","height","100%","display","flex","flex-direction","column","gap","12px"],[3,"label"],["direction","row","justify","end",2,"width","100%","padding-bottom","6px"],[2,"flex","1","min-height","0","position","relative"],["height","100%",3,"gridApiReady","selectedRows","columnDefs","rowData","rowSelection","paginationPageSize","overlaySettings","overlayActions"],["size","xs","variant","secondary",3,"click","tooltip"],[3,"clickedFeature","layers","settings"]],template:function(n,i){if(1&n&&(t.j41(0,"cue-tabs",0)(1,"cue-tab",1),t.nI1(2,"transloco"),t.nVh(3,w,7,4,"cue-flexcontainer",2),t.j41(4,"div",3)(5,"cue-ag-grid",4),t.bIt("gridApiReady",function(l){return i.onGridReady(l)})("selectedRows",function(l){return l[0]&&i.rowClicked.emit(l[0])}),t.k0s()()(),t.SS7(6)(7),t.nVh(8,O,3,5,"cue-tab",1),t.k0s()),2&n){t.R7$(),t.Y8G("label",t.bMT(2,9,"components.entityList.tabList")),t.R7$(2),t.vxM(i.orderByMentionCount()?-1:3),t.R7$(2),t.Y8G("columnDefs",i.table.columnDefs())("rowData",i.table.rows())("rowSelection",i.rowSelection)("paginationPageSize",i.paginationPageSize())("overlaySettings",i.overlaySettings)("overlayActions",i.overlayActions()),t.R7$();const o=t.bH3(i.map.settings());t.R7$();const l=t.bH3(i.map.layers());t.R7$(),t.vxM(l.length>0&&o?8:-1)}},dependencies:[M.R,y.t,m.o,x.T,A.$,S.L,I.z,D.n,u.Kj],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}"],changeDetection:0})}return a})();var F=r(2245),j=r(5187),V=r(9769);function W(a,h){if(1&a&&(t.j41(0,"cue-flexcontainer",3)(1,"cue-typography",5),t.EFF(2),t.k0s()()),2&a){const e=t.XpG(2);t.R7$(2),t.SpI(" ",e.errorMessage()," ")}}function z(a,h){if(1&a){const e=t.RV6();t.j41(0,"cue-ent-list",6),t.bIt("rowClicked",function(i){s.eBV(e);const o=t.XpG(2);return s.Njj(o.rowClicked.emit(i))})("clickedOpen",function(i){s.eBV(e);const o=t.XpG(2);return s.Njj(o.clickedOpen.emit(i))}),t.k0s()}if(2&a){const e=t.XpG(2);t.Y8G("entities",e.iris())("entityData",e.entityData())("handlers",e.handlers())("mapboxToken",e.mapboxToken())("paginationPageSize",e.paginationPageSize())}}function X(a,h){1&a&&(t.j41(0,"cue-flexcontainer",3)(1,"cue-typography",7),t.EFF(2," No project connected. "),t.k0s()())}function Q(a,h){if(1&a&&t.nVh(0,W,3,1,"cue-flexcontainer",3)(1,z,1,5,"cue-ent-list",4)(2,X,3,0,"cue-flexcontainer",3),2&a){const e=t.XpG();t.vxM("error"===e.state()?0:e.handlers()?1:2)}}function Z(a,h){if(1&a&&(t.j41(0,"cue-card",1),t.eu8(1,2),t.k0s()),2&a){const e=t.XpG(),n=t.sdS(1);t.Y8G("variant",e._cardVariant())("padded",!1),t.R7$(),t.Y8G("ngTemplateOutlet",n)}}function $(a,h){if(1&a&&t.eu8(0,2),2&a){t.XpG();const e=t.sdS(1);t.Y8G("ngTemplateOutlet",e)}}let U=(()=>{class a{iris=(0,d.hFB)([]);sdkState=(0,d.hFB)(void 0);mapboxToken=(0,d.hFB)(void 0);paginationPageSize=(0,d.hFB)(10);variant=(0,d.hFB)("none");_cardVariant=(0,c.EW)(()=>this.variant());rowClicked=(0,d.CGW)();clickedOpen=(0,d.CGW)();state=(0,s.vPA)("idle");errorMessage=(0,s.vPA)(null);entityData=(0,s.vPA)({});_entities=(0,s.vPA)(void 0);_unsubscribe;handlers=(0,c.EW)(()=>{const e=this._entities();if(e)return{requestData:(n,i)=>{const o=n.map(l=>l.split("/").pop()).filter(Boolean);e.requestEntityData(o,i)},requestLocations:n=>{const i=n.map(o=>o.split("/").pop()).filter(Boolean);e.requestEntityLocations(i)}}});constructor(){(0,s.QZP)(()=>{this._setupEntities(this.sdkState()?.entities)})}ngOnDestroy(){this._teardown()}_setupEntities(e){if(this._teardown(),!e)return this._entities.set(void 0),this.entityData.set({}),void this.state.set("idle");this._entities.set(e),this.state.set("ready"),this._syncEntityData(e),this._unsubscribe=e.entityInfoMap.subscribe(()=>{this._syncEntityData(e)})}_syncEntityData(e){const n=e.entityInfoMap.get(),i={};for(const o of Object.keys(n)){const l=n[o],g=Array.isArray(l.documentRefs)?l.documentRefs.map(p=>"string"==typeof p?{id:p}:p):l.documentRefs;i[e.entityIri(o)]={...l,documentRefs:g}}this.entityData.set(i)}_teardown(){this._unsubscribe?.(),this._unsubscribe=void 0}static \u0275fac=function(n){return new(n||a)};static \u0275cmp=t.VBU({type:a,selectors:[["cue-ent-list"]],inputs:{iris:[1,"iris"],sdkState:[1,"sdkState"],mapboxToken:[1,"mapboxToken"],paginationPageSize:[1,"paginationPageSize"],variant:[1,"variant"]},outputs:{rowClicked:"rowClicked",clickedOpen:"clickedOpen"},decls:4,vars:1,consts:[["body",""],[2,"height","100%","width","100%",3,"variant","padded"],[3,"ngTemplateOutlet"],["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[2,"height","100%",3,"entities","entityData","handlers","mapboxToken","paginationPageSize"],[2,"color","#c44","font-size","13px"],[2,"height","100%",3,"rowClicked","clickedOpen","entities","entityData","handlers","mapboxToken","paginationPageSize"],[2,"color","#9ca3af","font-size","13px"]],template:function(n,i){1&n&&(t.DNE(0,Q,3,1,"ng-template",null,0,t.C5r),t.nVh(2,Z,2,3,"cue-card",1)(3,$,1,1,"ng-container",2)),2&n&&(t.R7$(2),t.vxM("none"!==i.variant()?2:3))},dependencies:[a,G,D.n,F.Typography,j.Z,V.T3],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}"],changeDetection:0})}return a})()}}]);
|
package/368.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[368],{9695(z,B,f){"use strict";f.d(B,{d:()=>g});var _=f(7705),S=f(29),u=f(5547);function D(e,a){if(1&e&&u.nrm(0,"cue-svg-icon",2),2&e){const b=u.XpG();u.Y8G("name",b.iconChecked())}}function P(e,a){if(1&e&&u.nrm(0,"cue-svg-icon",2),2&e){const b=u.XpG();u.Y8G("name",b.icon())}}let g=(()=>{class e{size=(0,_.hFB)("m");icon=(0,_.hFB)(void 0);iconChecked=(0,_.hFB)(void 0);disabled=(0,_.hFB)(!1);checked=(0,_.geq)(!1);toggleChange=(0,_.CGW)();toggle(){this.checked.set(!this.checked()),this.toggleChange.emit(this.checked())}static \u0275fac=function(v){return new(v||e)};static \u0275cmp=u.VBU({type:e,selectors:[["cue-input-switch"]],hostVars:5,hostBindings:function(v,m){2&v&&(u.BMQ("size",m.size()),u.AVh("checked",m.checked())("disabled",m.disabled()))},inputs:{size:[1,"size"],icon:[1,"icon"],iconChecked:[1,"iconChecked"],disabled:[1,"disabled"],checked:[1,"checked"]},outputs:{checked:"checkedChange",toggleChange:"toggleChange"},decls:4,vars:3,consts:[["type","checkbox",3,"click","checked","disabled"],[1,"indicator"],[3,"name"]],template:function(v,m){1&v&&(u.j41(0,"input",0),u.bIt("click",function(){return m.toggle()}),u.k0s(),u.j41(1,"div",1),u.nVh(2,D,1,1,"cue-svg-icon",2)(3,P,1,1,"cue-svg-icon",2),u.k0s()),2&v&&(u.Y8G("checked",m.checked())("disabled",m.disabled()),u.R7$(2),u.vxM(m.checked()&&m.iconChecked()?2:m.icon()?3:-1))},dependencies:[S.A],styles:["[_nghost-%COMP%]{--cue-input-switch-height: 18px;--cue-input-switch-width: calc(var(--cue-input-switch-height) * 1.7);--cue-input-switch-inset: 2px;--cue-input-switch-indicator-width: calc( var(--cue-input-switch-height) - (2 * var(--cue-input-switch-inset)) );--cue-input-switch-icon-width: calc( var(--cue-input-switch-indicator-width) - (2 * var(--cue-input-switch-inset)) );display:block;flex-shrink:0;position:relative;height:var(--cue-input-switch-height);width:var(--cue-input-switch-width);border-radius:var(--cue-input-switch-height);--cue-icon-width: var(--cue-input-switch-icon-width);background:var(--cue-input-switch-background);transition:background-color .4s ease}[size=xs][_nghost-%COMP%]{--cue-input-switch-height: 12px;--cue-input-switch-inset: 1px}[size=s][_nghost-%COMP%]{--cue-input-switch-height: 14px;--cue-input-switch-inset: 1px}[size=m][_nghost-%COMP%]{--cue-input-switch-height: 18px;--cue-input-switch-inset: 2px}[size=l][_nghost-%COMP%]{--cue-input-switch-height: 22px;--cue-input-switch-inset: 3px}[size=xl][_nghost-%COMP%]{--cue-input-switch-height: 28px;--cue-input-switch-inset: 3px}@container cue-container (width < 20em){[_nghost-%COMP%]{--cue-input-switch-height: 16px}[size=xs][_nghost-%COMP%]{--cue-input-switch-height: 10px}[size=s][_nghost-%COMP%]{--cue-input-switch-height: 12px}[size=m][_nghost-%COMP%]{--cue-input-switch-height: 16px}[size=l][_nghost-%COMP%]{--cue-input-switch-height: 18px}[size=xl][_nghost-%COMP%]{--cue-input-switch-height: 20px}}.checked[_nghost-%COMP%]{background:var(--cue-input-switch-checked-background)}.disabled[_nghost-%COMP%]{background:var(--cue-input-switch-disabled-background);cursor:default}[_nghost-%COMP%] .indicator[_ngcontent-%COMP%]{pointer-events:none;position:absolute;left:var(--cue-input-switch-inset);top:var(--cue-input-switch-inset);width:var(--cue-input-switch-indicator-width);aspect-ratio:1;border-radius:50%;display:flex;align-items:center;justify-content:center;background-color:var(--cue-input-switch-indicator-background);color:var(--cue-input-switch-indicator-foreground);transition:left .4s ease,background-color .4s ease,color .4s ease}.checked[_nghost-%COMP%] .indicator[_ngcontent-%COMP%]{left:calc(var(--cue-input-switch-width) - var(--cue-input-switch-inset) - var( --cue-input-switch-indicator-width ));background:var(--cue-input-switch-checked-indicator-background);color:var(--cue-input-switch-checked-indicator-foreground)}.disabled[_nghost-%COMP%] .indicator[_ngcontent-%COMP%]{background:var(--cue-input-switch-disabled-indicator-background);color:var(--cue-input-switch-disabled-indicator-foreground)}input[_ngcontent-%COMP%]{all:unset;position:absolute;inset:0;cursor:pointer;border-radius:var(--cue-input-switch-height)}input[_ngcontent-%COMP%]:focus-visible:not(:disabled) + .indicator[_ngcontent-%COMP%]{outline:1px solid var(--cue-input-switch-focus-color);outline-offset:2px}"]})}return e})()},5745(z,B,f){"use strict";f.d(B,{a:()=>H});var _=f(7705),S=f(5802),u=f(5187),D=f(5381),P=f(29),g=f(2245),e=f(5547);const a=["dialog"],b=["*"];function v($,I){if(1&$&&(e.j41(0,"cue-typography",4),e.EFF(1),e.k0s()),2&$){const h=e.XpG(2);e.R7$(),e.JRh(h.label())}}function m($,I){if(1&$){const h=e.RV6();e.j41(0,"cue-svg-icon",7),e.bIt("click",function(){S.eBV(h);const O=e.XpG(2);return S.Njj(O.onClose())}),e.k0s()}}function W($,I){if(1&$&&(e.j41(0,"cue-flexcontainer",3),e.bIt("click",function(C){return C.stopPropagation()}),e.nVh(1,v,2,1,"cue-typography",4),e.j41(2,"cue-card",5),e.bIt("click",function(C){return C.stopPropagation()}),e.nVh(3,m,1,0,"cue-svg-icon",6),e.j41(4,"cue-flexcontainer"),e.SdG(5),e.k0s()()()),2&$){const h=e.XpG();e.R7$(),e.vxM(h.label()?1:-1),e.R7$(),e.Aen(h.minWidth()?"position: relative; min-width: min("+h.minWidth()+", 80vw)":"position: relative"),e.R7$(),e.vxM(h.displayCloseBtn()?3:-1),e.R7$(),e.Aen("width: 100%; margin-top: "+(h.displayCloseBtn()?"16px":"0"))}}let H=(()=>{class ${visible=(0,_.geq)(!0);closeOnBackgroundClick=(0,_.hFB)(!0);displayCloseBtn=(0,_.hFB)(!0);label=(0,_.hFB)("");minWidth=(0,_.hFB)();close=(0,_.CGW)();dialogRef=_.ebz.required("dialog");constructor(){(0,S.QZP)(()=>{const h=this.dialogRef().nativeElement;this.visible()?h.open||h.showModal():h.open&&h.close()})}onBackdropClick(){this.closeOnBackgroundClick()&&this.onClose()}onClose(){this.visible.set(!1),this.close.emit()}static \u0275fac=function(C){return new(C||$)};static \u0275cmp=e.VBU({type:$,selectors:[["cue-modal"]],viewQuery:function(C,O){1&C&&e.wEZ(O.dialogRef,a,5),2&C&&e.NyB()},inputs:{visible:[1,"visible"],closeOnBackgroundClick:[1,"closeOnBackgroundClick"],displayCloseBtn:[1,"displayCloseBtn"],label:[1,"label"],minWidth:[1,"minWidth"]},outputs:{visible:"visibleChange",close:"close"},ngContentSelectors:b,decls:3,vars:1,consts:[["dialog",""],[1,"modal-dialog",3,"cancel","click"],["direction","column","gap","s","align","center",2,"max-width","80vw"],["direction","column","gap","s","align","center",2,"max-width","80vw",3,"click"],["weight","medium"],[3,"click"],["name","close",1,"close-btn"],["name","close",1,"close-btn",3,"click"]],template:function(C,O){1&C&&(e.NAR(),e.j41(0,"dialog",1,0),e.bIt("cancel",function(){return O.onClose()})("click",function(){return O.onBackdropClick()}),e.nVh(2,W,6,6,"cue-flexcontainer",2),e.k0s()),2&C&&(e.R7$(2),e.vxM(O.visible()?2:-1))},dependencies:[u.Z,D.n,P.A,g.Typography],styles:[".close-btn[_ngcontent-%COMP%]{position:absolute;right:8px;top:8px;cursor:pointer}.modal-dialog[_ngcontent-%COMP%]{padding:0;border:none;background:transparent;overflow:visible;margin:auto;outline:none}.modal-dialog[_ngcontent-%COMP%]::backdrop{background-color:var(--cue-modal-overlay-color, rgba(0, 0, 0, .5))}"]})}return $})()},2065(z,B,f){"use strict";function u(g,e,a="text/plain"){return function _(g,e="data.zip"){const a=document.createElement("a"),b=URL.createObjectURL(g);a.href=b,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(b)}(new Blob([g],{type:a}),e)}function D(g,e){const a=document.createElement("a");a.style.display="hidden",a.setAttribute("href",window.URL.createObjectURL(g)),a.setAttribute("download",e),document.body.appendChild(a),a.click(),a.remove()}f.d(B,{KE:()=>D,YN:()=>u})},7374(z){z.exports=function(){"use strict";var f=6e4,_=36e5,S="millisecond",u="second",D="minute",P="hour",g="day",e="week",a="month",b="quarter",v="year",m="date",W="Invalid Date",H=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,$=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,I={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(o){var i=["th","st","nd","rd"],t=o%100;return"["+o+(i[(t-20)%10]||i[t]||i[0])+"]"}},h=function(o,i,t){var c=String(o);return!c||c.length>=i?o:""+Array(i+1-c.length).join(t)+o},C={s:h,z:function(o){var i=-o.utcOffset(),t=Math.abs(i),c=Math.floor(t/60),n=t%60;return(i<=0?"+":"-")+h(c,2,"0")+":"+h(n,2,"0")},m:function o(i,t){if(i.date()<t.date())return-o(t,i);var c=12*(t.year()-i.year())+(t.month()-i.month()),n=i.clone().add(c,a),s=t-n<0,r=i.clone().add(c+(s?-1:1),a);return+(-(c+(t-n)/(s?n-r:r-n))||0)},a:function(o){return o<0?Math.ceil(o)||0:Math.floor(o)},p:function(o){return{M:a,y:v,w:e,d:g,D:m,h:P,m:D,s:u,ms:S,Q:b}[o]||String(o||"").toLowerCase().replace(/s$/,"")},u:function(o){return void 0===o}},O="en",E={};E[O]=I;var G="$isDayjsObject",V=function(o){return o instanceof F||!(!o||!o[G])},N=function o(i,t,c){var n;if(!i)return O;if("string"==typeof i){var s=i.toLowerCase();E[s]&&(n=s),t&&(E[s]=t,n=s);var r=i.split("-");if(!n&&r.length>1)return o(r[0])}else{var l=i.name;E[l]=i,n=l}return!c&&n&&(O=n),n||!c&&O},M=function(o,i){if(V(o))return o.clone();var t="object"==typeof i?i:{};return t.date=o,t.args=arguments,new F(t)},d=C;d.l=N,d.i=V,d.w=function(o,i){return M(o,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var F=function(){function o(t){this.$L=N(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[G]=!0}var i=o.prototype;return i.parse=function(t){this.$d=function(c){var n=c.date,s=c.utc;if(null===n)return new Date(NaN);if(d.u(n))return new Date;if(n instanceof Date)return new Date(n);if("string"==typeof n&&!/Z$/i.test(n)){var r=n.match(H);if(r){var l=r[2]-1||0,p=(r[7]||"0").substring(0,3);return s?new Date(Date.UTC(r[1],l,r[3]||1,r[4]||0,r[5]||0,r[6]||0,p)):new Date(r[1],l,r[3]||1,r[4]||0,r[5]||0,r[6]||0,p)}}return new Date(n)}(t),this.init()},i.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},i.$utils=function(){return d},i.isValid=function(){return this.$d.toString()!==W},i.isSame=function(t,c){var n=M(t);return this.startOf(c)<=n&&n<=this.endOf(c)},i.isAfter=function(t,c){return M(t)<this.startOf(c)},i.isBefore=function(t,c){return this.endOf(c)<M(t)},i.$g=function(t,c,n){return d.u(t)?this[c]:this.set(n,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,c){var n=this,s=!!d.u(c)||c,r=d.p(t),l=function(R,y){var T=d.w(n.$u?Date.UTC(n.$y,y,R):new Date(n.$y,y,R),n);return s?T:T.endOf(g)},p=function(R,y){return d.w(n.toDate()[R].apply(n.toDate("s"),(s?[0,0,0,0]:[23,59,59,999]).slice(y)),n)},w=this.$W,k=this.$M,x=this.$D,L="set"+(this.$u?"UTC":"");switch(r){case v:return s?l(1,0):l(31,11);case a:return s?l(1,k):l(0,k+1);case e:var A=this.$locale().weekStart||0,U=(w<A?w+7:w)-A;return l(s?x-U:x+(6-U),k);case g:case m:return p(L+"Hours",0);case P:return p(L+"Minutes",1);case D:return p(L+"Seconds",2);case u:return p(L+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,c){var n,s=d.p(t),r="set"+(this.$u?"UTC":""),l=(n={},n[g]=r+"Date",n[m]=r+"Date",n[a]=r+"Month",n[v]=r+"FullYear",n[P]=r+"Hours",n[D]=r+"Minutes",n[u]=r+"Seconds",n[S]=r+"Milliseconds",n)[s],p=s===g?this.$D+(c-this.$W):c;if(s===a||s===v){var w=this.clone().set(m,1);w.$d[l](p),w.init(),this.$d=w.set(m,Math.min(this.$D,w.daysInMonth())).$d}else l&&this.$d[l](p);return this.init(),this},i.set=function(t,c){return this.clone().$set(t,c)},i.get=function(t){return this[d.p(t)]()},i.add=function(t,c){var n,s=this;t=Number(t);var r=d.p(c),l=function(k){var x=M(s);return d.w(x.date(x.date()+Math.round(k*t)),s)};if(r===a)return this.set(a,this.$M+t);if(r===v)return this.set(v,this.$y+t);if(r===g)return l(1);if(r===e)return l(7);var p=(n={},n[D]=f,n[P]=_,n[u]=1e3,n)[r]||1,w=this.$d.getTime()+t*p;return d.w(w,this)},i.subtract=function(t,c){return this.add(-1*t,c)},i.format=function(t){var c=this,n=this.$locale();if(!this.isValid())return n.invalidDate||W;var s=t||"YYYY-MM-DDTHH:mm:ssZ",r=d.z(this),l=this.$H,p=this.$m,w=this.$M,k=n.weekdays,x=n.months,A=function(y,T,j,Y){return y&&(y[T]||y(c,s))||j[T].slice(0,Y)},U=function(y){return d.s(l%12||12,y,"0")},R=n.meridiem||function(y,T,j){var Y=y<12?"AM":"PM";return j?Y.toLowerCase():Y};return s.replace($,function(y,T){return T||function(j){switch(j){case"YY":return String(c.$y).slice(-2);case"YYYY":return d.s(c.$y,4,"0");case"M":return w+1;case"MM":return d.s(w+1,2,"0");case"MMM":return A(n.monthsShort,w,x,3);case"MMMM":return A(x,w);case"D":return c.$D;case"DD":return d.s(c.$D,2,"0");case"d":return String(c.$W);case"dd":return A(n.weekdaysMin,c.$W,k,2);case"ddd":return A(n.weekdaysShort,c.$W,k,3);case"dddd":return k[c.$W];case"H":return String(l);case"HH":return d.s(l,2,"0");case"h":return U(1);case"hh":return U(2);case"a":return R(l,p,!0);case"A":return R(l,p,!1);case"m":return String(p);case"mm":return d.s(p,2,"0");case"s":return String(c.$s);case"ss":return d.s(c.$s,2,"0");case"SSS":return d.s(c.$ms,3,"0");case"Z":return r}return null}(y)||r.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,c,n){var s,r=this,l=d.p(c),p=M(t),w=(p.utcOffset()-this.utcOffset())*f,k=this-p,x=function(){return d.m(r,p)};switch(l){case v:s=x()/12;break;case a:s=x();break;case b:s=x()/3;break;case e:s=(k-w)/6048e5;break;case g:s=(k-w)/864e5;break;case P:s=k/_;break;case D:s=k/f;break;case u:s=k/1e3;break;default:s=k}return n?s:d.a(s)},i.daysInMonth=function(){return this.endOf(a).$D},i.$locale=function(){return E[this.$L]},i.locale=function(t,c){if(!t)return this.$L;var n=this.clone(),s=N(t,c,!0);return s&&(n.$L=s),n},i.clone=function(){return d.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},o}(),K=F.prototype;return M.prototype=K,[["$ms",S],["$s",u],["$m",D],["$H",P],["$W",g],["$M",a],["$y",v],["$D",m]].forEach(function(o){K[o[1]]=function(i){return this.$g(i,o[0],o[1])}}),M.extend=function(o,i){return o.$i||(o(i,F,M),o.$i=!0),M},M.locale=N,M.isDayjs=V,M.unix=function(o){return M(1e3*o)},M.en=E[O],M.Ls=E,M.p={},M}()}}]);
|