1import{S as re,Vb as Ae,oa as Fe}from"./chunk-3CRHQLXM.js";import"./chunk-TE2Y25AR.js";import{d as se,e as le}from"./chunk-STMPALZZ.js";import"./chunk-536WE5LC.js";import"./chunk-OTPEMK3Z.js";import"./chunk-VDVLXFOB.js";import"./chunk-DQBUCUTG.js";import"./chunk-ZBBC47NR.js";import"./chunk-26U4GAJT.js";import"./chunk-OWLB4KQR.js";import"./chunk-ZLVEULFI.js";import"./chunk-IUIN2H2B.js";import"./chunk-TKBK4DJL.js";import"./chunk-SE2A5EU2.js";import{a as I,b as A,d as ye,f as oe,g as ae}from"./chunk-BL57X46V.js";import"./chunk-JJERB4PL.js";import"./chunk-K6CT6BLE.js";import"./chunk-MEBGCANM.js";import"./chunk-7MAPAGBV.js";import"./chunk-CCTI276G.js";import"./chunk-CDDMU5I7.js";import"./chunk-5EKDK4AG.js";import{a as Ie}from"./chunk-GC7LOUXY.js";import"./chunk-K2GM2WJR.js";import"./chunk-P7DPGQCC.js";import"./chunk-5SEL4UEK.js";import"./chunk-LWS6FRFU.js";import"./chunk-7LUASJVL.js";import"./chunk-7PCNSSAU.js";import"./chunk-2YGZFLSA.js";import"./chunk-KSA2XT52.js";import"./chunk-E2CY7A6Z.js";import"./chunk-HV5O2XYI.js";import"./chunk-SMFYSWG3.js";import"./chunk-QRHEDNNR.js";import{m as We}from"./chunk-RGB2UE6C.js";import"./chunk-SPNCR7PQ.js";import"./chunk-NETE2L4S.js";import"./chunk-YVAHGRJL.js";import"./chunk-UBXQ3ARX.js";import"./chunk-A5RTQKUB.js";import"./chunk-CZBBL65X.js";import"./chunk-2QSHLSQU.js";import{Sa as Te,jb as Ve}from"./chunk-U5NX3KNB.js";import"./chunk-VMANS2OU.js";import"./chunk-3UZPMT2Q.js";import"./chunk-MJ6JGXXD.js";import"./chunk-6CIVKB43.js";import"./chunk-UB2UQSB3.js";import"./chunk-YPONP45B.js";import"./chunk-3TCO6QH7.js";import"./chunk-C427NTRQ.js";import"./chunk-SC4PFAJ4.js";import"./chunk-Q5JJTNUA.js";import"./chunk-GAJMZKQT.js";import"./chunk-OTJCUAQG.js";import"./chunk-SURUF6PC.js";import"./chunk-7BWUUJBK.js";import"./chunk-73237AIC.js";import"./chunk-NJAVW26X.js";import"./chunk-THEPSAJC.js";import"./chunk-FJKA7753.js";import"./chunk-EDMONMU2.js";import"./chunk-PLZERQ42.js";
1import"./chunk-TR3GA3YV.js";import"./chunk-6DPZFDDY.js";import{R as we}from"./chunk-RUQXDU6X.js";import"./chunk-643AJZP5.js";import"./chunk-3KEIXVQY.js";import{g as Me}from"./chunk-2D6BJZHT.js";import{a as P}from"./chunk-PRMY6R25.js";import{$ as L,Ab as c,Ad as J,Ba as ve,Ca as N,Cd as X,Dd as Z,Ed as ge,Ia as n,L as T,Mb as K,Pb as l,Pe as Se,Qb as p,Qc as G,Rb as W,S as Ce,Te as Pe,Va as U,Vd as ee,Wa as $,Wc as be,Yb as H,Ye as De,Zb as j,_ as fe,_a as z,_b as Q,ca as f,db as D,eb as g,fa as h,ga as v,gb as u,hc as q,ib as ke,ic as xe,jb as V,k as me,kb as F,la as B,lb as k,mb as r,mc as _,nb as a,nc as C,ob as M,oc as E,p as _e,pa as x,pf as Ee,tc as Y,te,va as he,vb as S,xe as Oe,y as ue,yb as b,ye as ie,ze as ne}from"./chunk-A4SDJCJK.js";import{a as w,b as O}from"./chunk-JSL44SJU.js";var m=(function(t){return t[t.InventoryProduct=1]="InventoryProduct",t[t.SuggestedProductFamily=2]="SuggestedProductFamily",t[t.KnowledgeArticle=3]="KnowledgeArticle",t[t.Video=4]="Video",t[t.Page=5]="Page",t[t.Product=6]="Product",t[t.ProductDocument=7]="ProductDocument",t[t.Publication=8]="Publication",t[t.ElearningCourse=9]="ElearningCourse",t[t.SavedToolList=10]="SavedToolList",t[t.Quotation=11]="Quotation",t[t.Other=99]="Other",t})(m||{});var R=class t{static register(s,e){let i=new t;return i.name=s,i.renderer=e,i}},ce=class t{static register(s,e){let i=new t;return i.name=s,i.renderer=e,i}},Re=(()=>{class t{constructor(){this.sectionRenderers=[R.register("plain-text","plain-text"),R.register("resource-list","resource-list"),R.register("resource-grid","resource-grid")],this.itemRenderers=[ce.register("resource-card","resource-card"),ce.register("video-card","video-card")]}resolveSectionRenderer(e){let i=e.sectionLayoutHint?.trim().toLowerCase()??"",o=this.sectionRenderers.find(d=>d.name===i);return o?o.renderer:e.items.length>0?"resource-list":"plain-text"}resolveItemRenderer(e){let i=e.itemRenderHint?.trim().toLowerCase()??"",o=this.itemRenderers.find(d=>d.name===i);return o?o.renderer:i||e.type!==m.Video?"resource-card":"video-card"}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=fe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ye=()=>["../"],Le=(t,s)=>s.id;function Ge(t,s){t&1&&(r(0,"div",4),M(1,"div",7)(2,"div",8)(3,"div",9),a())}function Je(t,s){if(t&1&&(r(0,"p",14),l(1),a()),t&2){let e=c();n(),p(e.operationDescription)}}function Xe(t,s){if(t&1&&(r(0,"div",16)(1,"div",28),l(2),_(3,"translate"),a(),r(4,"div",28),l(5),_(6,"date"),a()()),t&2){let e=c();n(2),p(C(3,2,"OW_Created")),n(3),p(E(6,4,e.createdDate,"mediumDate"))}}function Ze(t,s){if(t&1&&(r(0,"div",16)(1,"div",28),l(2),_(3,"translate"),a(),r(4,"div",28),l(5),_(6,"date"),a()()),t&2){let e=c();n(2),p(C(3,2,"OW_LastUpdated")),n(3),p(E(6,4,e.lastModifiedDate,"mediumDate"))}}function et(t,s){if(t&1){let e=S();r(0,"button",38),b("click",function(){h(e);let o=c(4);return v(o.saveAndOpenAiAssistant(o.regenerateWorkspaceAssistantMessage))}),l(1),_(2,"translate"),a()}t&2&&(n(),W(" ",C(2,1,"OW_RecreateRecommendationsWithAi")," "))}function tt(t,s){if(t&1&&(r(0,"p",37),l(1),a()),t&2){let e=c(4);n(),p(e.saveError())}}function it(t,s){if(t&1){let e=S();r(0,"div",21)(1,"label",29)(2,"span",30),l(3),_(4,"translate"),a(),r(5,"input",31),Q("ngModelChange",function(o){let d=h(e);return j(d.title,o)||(d.title=o),v(o)}),b("ngModelChange",function(){h(e);let o=c(3);return v(o.onMetadataFieldChanged())}),a()(),r(6,"label",29)(7,"span",30),l(8),_(9,"translate"),a(),r(10,"textarea",32),Q("ngModelChange",function(o){let d=h(e);return j(d.operationDescription,o)||(d.operationDescription=o),v(o)}),b("ngModelChange",function(){h(e);let o=c(3);return v(o.onMetadataFieldChanged())}),a()(),r(11,"label",29)(12,"span",30),l(13),_(14,"translate"),a(),r(15,"textarea",33),Q("ngModelChange",function(o){let d=h(e);return j(d.notes,o)||(d.notes=o),v(o)}),b("ngModelChange",function(){h(e);let o=c(3);return v(o.onMetadataFieldChanged())}),a()(),r(16,"div",34)(17,"button",35),b("click",function(){h(e);let o=c(3);return v(o.saveWorkspace())}),l(18),_(19,"translate"),a(),g(20,et,3,3,"button",36),g(21,tt,2,1,"p",37),a()()}if(t&2){let e=s,i=c(3);n(3),p(C(4,10,"OW_Title")),n(2),H("ngModel",e.title),n(3),p(C(9,12,"OW_OperationDescription")),n(2),H("ngModel",e.operationDescription),n(3),p(C(14,14,"OW_Notes")),n(2),H("ngModel",e.notes),n(2),k("disabled",i.saving()||!i.metadataDirty()),n(),W(" ",C(19,16,"OW_SaveChanges")," "),n(2),u(i.metadataDirty()?20:-1),n(),u(i.saveError()?21:-1)}}function nt(t,s){t&1&&(r(0,"div",22),l(1),_(2,"translate"),a()),t&2&&(n(),p(C(2,1,"OW_NoItemsStoredYet")))}function ot(t,s){if(t&1&&(r(0,"h4",41),l(1),a()),t&2){let e=c().$implicit;n(),p(e.title)}}function at(t,s){if(t&1&&M(0,"p",42),t&2){let e=c().$implicit;k("innerHTML",e.bodyHtml,ve)}}function rt(t,s){if(t&1&&M(0,"img",53),t&2){let e=c(2).$implicit;k("src",e.thumbnailUrl,N)}}function st(t,s){t&1&&M(0,"div",54)}function lt(t,s){if(t&1&&(r(0,"p",58),l(1),a()),t&2){let e=c(2).$implicit;n(),p(e.description)}}function ct(t,s){if(t&1){let e=S();r(0,"div",47)(1,"div",49)(2,"div",50)(3,"button",51),b("click",function(o){h(e);let d=c().$implicit,y=c(6);return v(y.playVideo(o,d))}),r(4,"span",52),l(5,"play_arrow"),a()(),g(6,rt,1,1,"img",53)(7,st,1,0,"div",54),a(),r(8,"div",55)(9,"p",56),l(10),a(),r(11,"h6",57),l(12),a(),g(13,lt,2,1,"p",58),a()(),r(14,"button",59),b("click",function(){h(e);let o=c().$implicit,d=c(6);
1return v(d.deleteItem(o.id))}),r(15,"span",60),l(16,"delete"),a()()()}if(t&2){let e=c().$implicit,i=c(6);n(3),D("aria-label","Play video "+(e.title||e.referenceKey||e.id)),n(3),u(e.thumbnailUrl?6:7),n(4),p(e.typeLabel),n(2),p(e.title||e.referenceKey||e.id),n(),u(e.description?13:-1),n(),k("disabled",i.saving()||i.deletingItemIds()[e.id]),D("aria-label","Delete item "+(e.title||e.referenceKey||e.id))}}function dt(t,s){if(t&1&&(r(0,"div",63),M(1,"thumbnail",68),_(2,"contentUrl"),_(3,"contentUrl"),a()),t&2){let e=c(2).$implicit;n(),k("imageUrl",E(2,4,e.thumbnailUrl??"","thumbnails"))("documentUrl",E(3,7,e.url??"","thumbnails"))("generateOnError",!1)("title",e.title)}}function pt(t,s){if(t&1&&M(0,"img",64),t&2){let e=c(2).$implicit;k("src",e.thumbnailUrl,N)}}function mt(t,s){if(t&1&&(r(0,"p",66),l(1),a()),t&2){let e=c(2).$implicit;n(),p(e.description)}}function _t(t,s){if(t&1&&(r(0,"a",67),l(1),_(2,"translate"),a()),t&2){let e=c(2).$implicit;k("href",e.openUrl,N),D("target",e.isPublication?"_blank":null)("rel",e.isPublication?"noopener":null),n(),W(" ",C(2,4,"OW_OpenItem")," ")}}function gt(t,s){if(t&1){let e=S();r(0,"div",48)(1,"div")(2,"div",61)(3,"div",62),g(4,dt,4,10,"div",63)(5,pt,1,1,"img",64),r(6,"div")(7,"p",56),l(8),a(),r(9,"h4",65),l(10),a()()(),r(11,"button",59),b("click",function(){h(e);let o=c().$implicit,d=c(6);return v(d.deleteItem(o.id))}),r(12,"span",60),l(13,"delete"),a()()(),g(14,mt,2,1,"p",66),a(),g(15,_t,3,6,"a",67),a()}if(t&2){let e=c().$implicit,i=c(6);n(4),u(e.isPublication&&(e.thumbnailUrl||e.url)?4:e.thumbnailUrl?5:-1),n(4),p(e.typeLabel),n(2),p(e.title||e.referenceKey||e.id),n(),k("disabled",i.saving()||i.deletingItemIds()[e.id]),D("aria-label","Delete item "+(e.title||e.referenceKey||e.id)),n(3),u(e.description?14:-1),n(),u(e.openUrl?15:-1)}}function ut(t,s){if(t&1&&(r(0,"article",46),g(1,ct,17,7,"div",47)(2,gt,16,7,"div",48),a()),t&2){let e=s.$implicit;K("item-resource-card",e.renderer==="resource-card")("item-video-card",e.renderer==="video-card"),D("data-item-id",e.id),n(),u(e.renderer==="video-card"?1:2)}}function Ct(t,s){if(t&1&&(r(0,"div",44),V(1,ut,3,6,"article",45,Le),a()),t&2){let e=c().$implicit;K("item-list-list",e.renderer==="resource-list")("item-list-grid",e.renderer==="resource-grid"),n(),F(e.items)}}function ft(t,s){if(t&1&&(r(0,"section",40),g(1,ot,2,1,"h4",41),g(2,at,1,1,"p",42),g(3,Ct,3,4,"div",43),a()),t&2){let e=s.$implicit;K("section-plain-text",e.renderer==="plain-text")("section-resource-list",e.renderer==="resource-list")("section-resource-grid",e.renderer==="resource-grid"),n(),u(e.title?1:-1),n(),u(e.body?2:-1),n(),u(e.items.length>0?3:-1)}}function ht(t,s){if(t&1&&(r(0,"div",23),V(1,ft,4,9,"section",39,Le),a()),t&2){let e=c(3);n(),F(e.renderedSections())}}function vt(t,s){if(t&1&&(r(0,"p",26),l(1),a()),t&2){let e=c(3);n(),p(e.deleteError())}}function kt(t,s){if(t&1){let e=S();r(0,"div",5)(1,"div",10)(2,"div",11)(3,"h6",12),l(4),_(5,"translate"),a(),r(6,"h1",13),l(7),a(),g(8,Je,2,1,"p",14),a(),r(9,"div",15)(10,"h6",13),l(11),_(12,"translate"),a(),g(13,Xe,7,7,"div",16),g(14,Ze,7,7,"div",16),r(15,"div",17)(16,"h3",18),l(17),_(18,"translate"),a(),r(19,"p",19),l(20),_(21,"translate"),a(),r(22,"button",20),b("click",function(){h(e);let o=c(2);return v(o.openAiAssistant(o.genericWorkspaceAssistantMessage))}),l(23),_(24,"translate"),a()()()(),g(25,it,22,18,"div",21),r(26,"div",21),g(27,nt,3,3,"div",22),g(28,ht,3,0,"div",23),a(),r(29,"div",24)(30,"div",23)(31,"h2",25),l(32),_(33,"translate"),a(),g(34,vt,2,1,"p",26),r(35,"button",27),b("click",function(o){h(e);let d=c(2);return v(d.deleteWorkspace(o))}),l(36),_(37,"translate"),a()()()()}if(t&2){let e,i=s,o=c(2);n(4),p(C(5,17,"OW_OperationWorkspace")),n(3),p(i.title),n(),u(i.operationDescription?8:-1),n(3),p(C(12,19,"OW_WorkspaceDetails")),n(2),u(i.createdDate?13:-1),n(),u(i.lastModifiedDate?14:-1),n(3),p(C(18,21,"OW_WorkWithAiAssistant")),n(3),p(C(21,23,"OW_WorkWithAiAssistantDescription")),n(3),W(" ",C(24,25,"OW_OpenAiAssistant")," "),n(2),u((e=o.draftWorkspace())?25:-1,e),n(2),u(o.renderedSections().length===0?27:-1),n(),u(o.renderedSections().length>0?28:-1),n(4),p(C(33,27,"OW_WorkspaceActions")),n(2),u(o.deleteError()?34
1:-1),n(),k("disabled",o.deletingWorkspace()),D("aria-label","Delete workspace "+i.title),n(),W(" ",C(37,29,"OW_DeleteWorkspace")," ")}}function xt(t,s){t&1&&(r(0,"div",6),l(1),_(2,"translate"),a()),t&2&&(n(),W(" ",C(2,1,"OW_WorkspaceCouldNotBeLoaded")," "))}function bt(t,s){if(t&1&&(r(0,"div",2)(1,"a",3),l(2),_(3,"translate"),a(),g(4,Ge,4,0,"div",4),g(5,kt,38,31,"div",5),g(6,xt,3,3,"div",6),a()),t&2){let e,i=c();n(),k("routerLink",q(7,Ye)),n(),W(" ",C(3,5,"OW_BackToAllWorkspaces")," "),n(2),u(i.loading()?4:-1),n(),u((e=!i.loading()&&i.workspace())?5:-1,e),n(),u(!i.loading()&&!i.workspace()?6:-1)}}var wt=[m.InventoryProduct,m.SuggestedProductFamily,m.KnowledgeArticle,m.Video,m.Page,m.Product,m.ProductDocument,m.Publication,m.ElearningCourse,m.SavedToolList,m.Quotation,m.Other],Wt={[m.InventoryProduct]:"Inventory Products",[m.SuggestedProductFamily]:"Suggested Product Families",[m.KnowledgeArticle]:"Knowledge Articles",[m.Video]:"Videos",[m.Page]:"Pages",[m.Product]:"Products",[m.ProductDocument]:"Product Documents",[m.Publication]:"Publications",[m.ElearningCourse]:"Elearning Courses",[m.SavedToolList]:"Saved Tool Lists",[m.Quotation]:"Quotations",[m.Other]:"Other"},Be=(()=>{class t{constructor(){this.workspace=x(null),this.draftWorkspace=x(null),this.loading=x(!0),this.saving=x(!1),this.metadataDirty=x(!1),this.deletingWorksp
1ace=x(!1),this.deletingItemIds=x({}),this.saveError=x(null),this.deleteError=x(null),this.operationWorkspace="OperationWorkspace",this.destroyRef=f(B),this.route=f(J),this.router=f(X),this.operationWorkspaceService=f(re),this.rendererRegistry=f(Re),this.dialog=f(we),this.chatWindowService=f(ae),this.aiChatService=f(oe),this.resources=f(te),this.markdownService=f(ye),this.links=f(We),this.genericWorkspaceAssistantMessage=this.resources.getResource("OW_GenericWorkspaceAssistantMessage",!0)||"I need help with this workspace.",this.regenerateWorkspaceAssistantMessage=this.resources.getResource("OW_RegenerateWorkspaceAssistantMessage",!0)||"Please revise this workspace based on the changes I have just made to the title/description/notes.",this.renderedSections=Y(()=>this.createRenderedSections(this.draftWorkspace()?.document.sections??[]))}ngOnInit(){ue(this.route.paramMap.pipe(_e(e=>({id:e.get("id"),requestedId:null}))),this.operationWorkspaceService.refreshWorkspaceRequests$.pipe(_e(e=>({id:this.route.snapshot.paramMap.get("id"),requestedId:e})))).pipe(Ce(e=>this.loadWorkspace(e)),P(this.destroyRef)).subscribe(e=>{this.workspace.set(e),this.draftWorkspace.set(e?this.cloneWorkspace(e):null),this.metadataDirty.set(!1),this.saveError.set(null)})}onMetadataFieldChanged(){this.metadataDirty.set(this.hasMetadataChanges())}saveWorkspace(){let e=this.draftWorkspace();!e||this.saving()||this.persistWorkspaceChanges(this.cloneWorkspace(e))}deleteItem(e){if(this.deletingItemIds()[e]||this.saving())return;let i=this.draftWorkspace();if(!i)return;let o=this.markItemAsRemoved(i,e);o&&this.persistWorkspaceChanges(o,e)}deleteWorkspace(e){let i=this.workspace();
1!i||this.deletingWorkspace()||this.dialog.open(Ie,{data:{data:{description:"Delete this workspace?",cancel:"Cancel",confirm:"Delete"},trigger:new he(e.currentTarget),forceLeft:!1},backdropClass:"transparent-backdrop"}).afterClosed().pipe(P(this.destroyRef)).subscribe(o=>{o?.confirmed&&this.deleteConfirmedWorkspace(i.id)})}playVideo(e,i){i.url&&this.dialog.open(Fe,{data:{mediaUrl:i.url}})}openAiAssistant(e){this.chatWindowService.openChat(),this.aiChatService.restartConversation(),this.aiChatService.sendUserMessage(new I(e,A.User))}saveAndOpenAiAssistant(e){this.saveWorkspace(),this.chatWindowService.openChat(),this.aiChatService.restartConversation(),this.aiChatService.sendUserMessage(new I(e,A.User))}createRenderedSections(e){return[...e].sort((i,o)=>(i.displayOrder??0)-(o.displayOrder??0)).map(i=>{let o=[...i.items].filter(d=>!d.removed).sort((d,y)=>(d.displayOrder??0)-(y.displayOrder??0)).map(d=>{let y=d.type===m.Publication;return O(w({},d),{renderer:this.rendererRegistry.resolveItemRenderer(d),typeLabel:this.getItemTypeLabel(d.type),openUrl:this.getItemOpenUrl(d),isPublication:y})});return O(w({},i),{bodyHtml:this.markdownService.convertMarkdownToHtml(i.body??""),renderer:this.rendererRegistry.resolveSectionRenderer(O(w({},i),{items:o})),items:o})}).filter(i=>!!i.body?.trim()||i.items.length>0)}normalizeItemType(e){return wt.includes(e)?e:m.Other}getItemTypeLabel(e){return Wt[this.normalizeItemType(e)]}getItemOpenUrl(e){if(!e.url||e.type!==m.Publication)return e.url;let i=e.url.split(/[?#]/,1)[0],o=i.split("/").filter(Boolean),d=o[o.length-1];return d?this.links.publicationsViewUrl(i,d):e.url}loadWorkspace(e){return e.id?e.requestedId&&e.requestedId!==e.id?(this.router.navigate(["..",e.requestedId],{relativeTo:this.route}),me(this.workspace())):(this.loading.set(!0),this.operationWorkspaceService.getWorkspace(e.id).pipe(T(()=>this.loading.set(!1)))):me(this.workspace())}persistWorkspaceChanges(e,i){this.saving.set(!0),this.saveError.set(null),i&&this.setItemDeleting(i,!0),this.operationWorkspaceService.saveWorkspace(e).pipe(P(this.destroyRef),T(()=>{this.saving.set(!1),i&&this.setItemDeleting(i,!1)})).subscribe({next:o=>{this.workspace.set(o),this.draftWorkspace.set(this.cloneWorkspace(o)),this.metadataDirty.set(!1)},error:o=>{this.saveError.set(o instanceof Error?o.message:"The workspace could not be saved.")}})}
1deleteConfirmedWorkspace(e){this.deletingWorkspace()||(this.deletingWorkspace.set(!0),this.deleteError.set(null),this.operationWorkspaceService.deleteWorkspace(e).pipe(P(this.destroyRef),T(()=>this.deletingWorkspace.set(!1))).subscribe({next:i=>{if(i){this.router.navigate(["../"],{relativeTo:this.route});return}this.deleteError.set("The workspace could not be deleted.")},error:()=>this.deleteError.set("The workspace could not be deleted.")}))}markItemAsRemoved(e,i){let o=!1,d=this.cloneWorkspace(e);return d.document.sections=d.document.sections.map(y=>O(w({},y),{items:y.items.map(pe=>pe.id!==i?pe:(o=!0,O(w({},pe),{removed:!0})))})),o?d:null}cloneWorkspace(e){return O(w({},e),{document:{documentVersion:e.document.documentVersion,sections:e.document.sections.map(i=>O(w({},i),{items:i.items.map(o=>O(w({},o),{source:o.source?{name:o.source.name,query:o.source.query}:null}))}))}})}hasMetadataChanges(){let e=this.workspace(),i=this.draftWorkspace();return!e||!i?!1:this.normalizeMetadataValue(e.title)!==this.normalizeMetadataValue(i.title)||this.normalizeMetadataValue(e.operationDescription)!==this.normalizeMetadataValue(i.operationDescription)||this.normalizeMetadataValue(e.notes)!==this.normalizeMetadataValue(i.notes)}normalizeMetadataValue(e){return(e??"").trim()}setItemDeleting(e,i){this.deletingItemIds.update(o=>{let d=w({},o);return i?d[e]=!0:delete d[e],d})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=U({type:t,selectors:[["operation-workspace-detail"]],standalone:!1,decls:2,vars:1,consts:[["bannerVariant","toggle",3,"testKey"],["betaFeatureContent",""],[1,"container-xl","py-3","px-3"],["testName","operationWorkspace_backToList",1,"cor-link","back","ps-1",3,"routerLink"],[1,"skeleton","mt-4"],[1,"row","g-4","mt-2","pt-0"],[1,"empty","mt-4"],[1,"skeleton-box","animate","skeleton-title"],[1,"skeleton-box","animate","skeleton-copy"],[1,"skeleton-box","animate","skeleton-copy","skeleton-copy-short"],[1,"row","m-1","mb-3"],[1,"col-12","col-lg-8","cor-bg-gold-02","p-3"],[1,"cor-color-carbon-black","mt-0"],[1,"mb-3","mt-0"],[1,"description","mb-0"],[1,"col-12","col-lg-4","p-3"],[1,"col-12","row","border-bottom-1","py-1"],[1,"ai-assistant","mt-3"],[1,"h6","mt-0","mb-2"],[1,"mb-3"],["type","button","testName","operationWorkspace_openAiAssistant",1,"cor-btn-secondary",3,"click"],[1,"row","p-3"],[1,"empty"],[1,"col-12"],[1,"row","p-3","workspace-actions"],[1,"h5","mt-0","mb-3"],["role","alert",1,"delete-error","mb-2"],["type","button","testName","operationWorkspace_deleteWorkspace",1,"cor-btn-secondary",3,"click","disabled"],[1,"col-auto"],[1,"field"],[1,"field-label"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["rows","3",1,"form-control",3,"ngModelChange","ngModel"],["rows","5",1,"form-control",3,"ngModelChange","ngModel"],[1,"editor-actions"],["type","button","testName","operationWorkspace_saveWorkspace",1,"cor-btn-primary",3,"click","disabled"],["type","button","testName","operationWorkspace_recreateRecommendationsWithAi",1,"cor-btn-secondary"],[1,"save-error","mb-0"],["type","button","testName","operationWorkspace_recreateRecommendationsWithAi",1,"cor-btn-secondary",3,"click"],[1,"workspace-section","col-12",3,"section-plain-text","section-resource-list","section-resource-grid"],[1,"workspace-section","col-12"],[1,"cor-color-carbon-black","mb-4","mt-0"],[1,"cor-color-grey-05","mb-2",3,"innerHTML"],[1,"item-list",3,"item-list-list","item-list-grid"],[1,"item-list"],[1,"item",3,"item-resource-card","item-video-card"],[1,"item"],[1,"d-flex","flex-column","h-100","position-relative"],[1,"d-flex","flex-column","gap-3","h-100","justify-content-between","overflow-hidden"],[1,"video-action"],[1,"video-media"],["type","button","aria-hidden","true",1,"cor-btn-round","xs-medium","md-medium","play-control",3,"click"],[1,"cor-symbol","filled"],["alt","",3,"src"],["aria-hidden","true",1,"thumbnail-fallback"],[1,"p-1"],[1,"item-type","mb-1"],[1,"mb-0","mt-0"],[1,"mb-0","mt-2","text-muted","cor-line-clamp-5"],["type","button","title","Delete item","testName","operationWorkspace_deleteItem",1,"cor-btn-icon-only","item-delete",3,"click","disabled"],["aria-hidden","true",1,"cor-symbol"],[1,"item-header"],[1,"d-flex","align-items-start","flex-column","gap-2"],[1,"d-flex","publication-image"],["alt","",1,"product-image",3,"src"],[1,"d-flex","h6","mb-0","mt-0"],[1,"mb-0","text-muted","pt-2","cor-line-clamp-5"],[1,"cor-link",3,"href"],["alt","",3,"imageUrl","documentUrl","generateOnError","title"]],template:function(i,o){i&1&&(r(0,"cor-beta-feature-host",0),z(1,bt,7,8,"ng-template",1),a()),i&2&&k("testKey",o.operationWorkspace)},dependencies:[Se,Pe,De,Oe,Te,ee,ie,le,se,Z,G,Me,ne],styles:["[_nghost-%COMP%]{display:block}.back[_ngcontent-%COMP%]{display:inline-flex;margin-bottom:1rem}.empty[_ngcontent-%COMP%], .skeleton[_ngcontent-%COMP%]{background:#fff;padding:1.5rem}.description[_ngcontent-%COMP%]{color:#575757}.field[_ngcontent-%COMP%]{display:grid;gap:.5rem}.field[_ngcontent-%COMP%] + .field[_ngcontent-%COMP%]{margin-top:1rem}.field-label[_ngcontent-%COMP%]{color:#575757;font:700 .75rem/100% Sandvik Sans Regular,Tahoma,Verdana,sans-serif}.editor-actions[_ngcontent-%COMP%]{align-items:center;display:flex;gap:1rem;margin-top:1rem;flex-wrap:wrap}.ai-assistant[_ngcontent-%COMP%]{border-top:1px solid #e6e6e6;padding-top:1rem}.ai-assistant[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#575757}.workspace-actions[_ngcontent-%COMP%]{border-top:1px solid #e6e6e6;margin-top:.5rem}.save-error[_ngcontent-%COMP%]{color:#b42318;width:100%}.workspace-section[_ngcontent-%COMP%]{margin-bottom:2rem;padding-bottom:2rem;border-bottom:1px solid #e6e6e6}.workspace-section[_ngcontent-%COMP%]:last-child{border-bottom:0}.workspace-section[_ngcontent-%COMP%] .cor-table-responsive[_ngcontent-%COMP%] .scrollable[_ngcontent-%COMP%]{width:100%!important}.workspace-section[_ngcontent-%COMP%] .cor-table-responsive[_ngcontent-%COMP%] .scrollable[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{background-color:#fff}.workspace-section[_ngcontent-%COMP%] .cor-table-responsive[_ngcontent-%COMP%] .scrollable[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border:none;font:.75rem/100% Sandvik Sans Regular,Tahoma,Verdana,sans-serif}.workspace-section[_ngcontent-%COMP%] .cor-table-responsive[_ngcontent-%COMP%] .scrollable[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{border-bottom:1px solid #e6e6e6;border-left:1px solid #e6e6e6}.workspace-section[_ngcontent-%COMP%] .cor-table-responsive[_ngcontent-%COMP%] .scrollable[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-right:1px solid #e6e6e6}.item-list[_ngcontent-%COMP%]{display:grid;gap:1rem}.item-list-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(auto-fill,minmax(min(100%,14rem),1fr))}.item-list-list[_ngcontent-%COMP%]{grid-template-columns:1fr}.item[_ngcontent-%COMP%]{border:1px solid #e6e6e6;height:100%;padding:1rem}.item-header[_ngcontent-%COMP%]{align-items:flex-start;display:flex;gap:.75rem;justify-content:space-between}
1.item-delete[_ngcontent-%COMP%]{flex:0 0 auto}.item-delete[_ngcontent-%COMP%]:disabled{opacity:.45}.item-video-card[_ngcontent-%COMP%]{padding:0}.video-action[_ngcontent-%COMP%]{background:none;border:0;color:inherit;display:block;padding:0;text-align:left;width:100%}.video-action[_ngcontent-%COMP%]:disabled{cursor:default}.video-media[_ngcontent-%COMP%]{aspect-ratio:16/9;background:#e6e6e6;overflow:hidden;position:relative}.video-media[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .thumbnail-fallback[_ngcontent-%COMP%]{height:100%;object-fit:cover;width:100%}.play-control[_ngcontent-%COMP%]{left:50%;position:absolute;cursor:pointer;top:50%;transform:translate(-50%,-50%)}.item-video-card[_ngcontent-%COMP%] .item-delete[_ngcontent-%COMP%]{position:absolute;right:.5rem;top:.5rem}.item-type[_ngcontent-%COMP%]{color:#73644b;font:700 .75rem/100% Sandvik Sans Regular,Tahoma,Verdana,sans-serif}@media(max-width:576px){.editor-actions[_ngcontent-%COMP%]{align-items:stretch;flex-direction:column}}.skeleton-title[_ngcontent-%COMP%]{height:2.5rem;margin-bottom:1rem;width:60%}.skeleton-copy[_ngcontent-%COMP%]{height:1rem;margin-bottom:.75rem;width:100%}.skeleton-copy-short[_ngcontent-%COMP%]{margin-bottom:0;width:72%}.product-image[_ngcontent-%COMP%]{max-height:2.8rem}.publication-image[_ngcontent-%COMP%]{max-height:5rem}[_nghost-%COMP%] .publication-image img{max-height:5rem;width:auto} .cor-table-responsive table{border:1px solid #e6e6e6;min-width:50%} .cor-table-responsive table.scrollable thead{background-color:#fff!important} .cor-table-responsive table.scrollable thead th{border:none;border-right:1px solid #e6e6e6!important;font:.75rem/100% Sandvik Sans Regular,Tahoma,Verdana,sans-serif;padding:1rem 1rem 0} .cor-table-responsive table.scrollable tbody tr:hover{background-color:transparent!important;cursor:unset} .cor-table-responsive table.scrollable tbody td{border-right:1px solid #e6e6e6!important;color:#101010;padding:1rem}"],changeDetection:0})}}return t})();var Ot=()=>[0,1,2],Mt=t=>[t],yt=(t,s)=>s.id;function St(t,s){t&1&&(r(0,"div",6),M(1,"div",7)(2,"div",8),a())}function Pt(t,s){t&1&&(r(0,"div",4),V(1,St,3,0,"div",6,ke),a()),t&2&&(n(),F(q(0,Ot)))}function Dt(t,s){t&1&&(r(0,"div",9)(1,"h5",14),l(2),_(3,"translate"),a()()),t&2&&(n(2),p(C(3,1,"OW_NoWorkspacesYet")))}function Et(t,s){if(t&1&&(r(0,"p",18),l(1),a()),t&2){let e=c().$implicit;n(),p(e.operationDescription)}}function Tt(t,s){if(t&1&&(r(0,"span",19),l(1),_(2,"date"),a()),t&2){let e=c().$implicit;n(),p(E(2,1,e.lastModifiedDate,"mediumDate"))}}function Vt(t,s){if(t&1&&(r(0,"a",15)(1,"div",16)(2,"h4",17),l(3),a(),g(4,Et,2,1,"p",18),a(),g(5,Tt,3,4,"span",19),r(6,"span",20),l(7,"chevron_right"),a()()),t&2){let e=s.$implicit;k("routerLink",xe(4,Mt,e.id)),n(3),p(e.title),n(),u(e.operationDescription?4:-1),n(),u(e.lastModifiedDate?5:-1)}}function Ft(t,s){if(t&1&&(r(0,"div",13),V(1,Vt,8,6,"a",15,yt),a()),t&2){let e=c(3);n(),F(e.workspaces())}}function It(t,s){if(t&1){let e=S();r(0,"div",5),g(1,Dt,4,3,"div",9),r(2,"div",10)(3,"h5",11),l(4),_(5,"translate"),a(),r(6,"p"),l(7),_(8,"translate"),a(),r(9,"button",12),b("click",function(){h(e);let o=c(2);return v(o.openAiAssistant())}),l(10),_(11,"translate"),a()(),g(12,Ft,3,0,"div",13),a()}if(t&2){let e=c(2);n(),u(e.hasWorkspaces()?-1:1),n(3),p(C(5,5,"OW_WantToCreateOrInteractWithWorkspace")),n(3),p(C(8,7,"OW_AskAiAssistantForHelp")),n(3),W(" ",C(11,9,"OW_OpenAiAssistant")," "),n(2),u(e.hasWorkspaces()?12:-1)}}function At(t,s){if(t&1&&(r(0,"section",2)(1,"h1",3),l(2),_(3,"translate"),a(),g(4,Pt,3,1,"div",4),g(5,It,13,11,"div",5),a()),t&2){let e=c();n(2),p(C(3,3,"OW_MyWorkspaces")),n(2),u(e.loading()?4:-1),n(),u(e.loading()?-1:5)}}var Ne=(()=>{class t{constructor(){this.operationWorkspace="OperationWorkspace",this.workspaces=x([]),this.loading=x(!0),this.hasWorkspaces=Y(()=>this.workspaces().length>0),this.destroyRef=f(B),this.route=f(J),this.router=f(X),this.operationWorkspaceService=f(re),this.chatWindowService=f(ae),this.aiChatService=f(oe),this.resources=f(te)}ngOnInit(){this.operationWorkspaceService.refreshWorkspaceRequests$.pipe(P(this.destroyRef)).subscribe(e=>{e&&this.router.navigate([e],{relativeTo:this.route})}),this.operationWorkspaceService.getWorkspaces().pipe(P(this.destroyRef),T(()=>this.loading.set(!1))).subscribe(e=>this.workspaces.set(e))}openAiAssistant(){var e=this.resources.getResource("OW_NewWorkspaceAssistantMessage",!0)||"Let's create a new workspace.";this.chatWindowService.openChat(),this.aiChatService.restartConversation(),this.aiChatService.sendUserMessage(new I(e,A.User))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=U({type:t,selectors:[["operation-workspace-list"]],standalone:!1,decls:2,vars:1,consts:[["bannerVariant","toggle",3,"testKey"],["betaFeatureContent",""],[1,"container-xl","operation-workspace","workspace-page","py-5","py-lg-6"],[1,"mb-5","mt-0"],[1,"workspace-list"],[1,"row"],[1,"workspace-row","workspace-row-skeleton"],[1,"skeleton-box","animate","title"],[1,"skeleton-box","animate","description"],[1,"workspace-empty-state","col-12","col-lg-8","order-2","order-lg-1"],[1,"col-12","col-lg-4","order-1","order-lg-2","pb-2"],[1,"mt-0"],["type","button","testName","operationWorkspace_openAiAssistant",1,"cor-btn-secondary","mt-2",3,"click"],[1,"workspace-list","col-12","col-lg-8","order-2","order-lg-1"],[1,"mt-0","mb-2"],["testName","operationWorkspace_workspaceLink",1,"workspace-row","text-decoration-none",3,"routerLink"],[1,"content"],[1,"mt-0","mb-0"],[1,"description","mb-0"],[1,"date","align-self-end"],["aria-hidden","true",1,"cor-symbol","chevron"]],template:function(i,o){i&1&&(r(0,"cor-beta-feature-host",0),z(1,At,6,5,"ng-template",1),a()),i&2&&k("testKey",o.operationWorkspace)},dependencies:[ee,ie,le,se,Z,G,ne],styles:["[_nghost-%COMP%]{display:block}.workspace-list[_ngcontent-%COMP%]{display:grid;gap:.5rem}.workspace-row[_ngcontent-%COMP%]{align-items:center;background:#f7f5f1;border:1px solid #BEAF93;color:#101010;display:grid;gap:1rem;grid-template-columns:minmax(0,1fr) auto auto;min-height:5.75rem;padding:1.25rem;transition:background-color .2s ease,border-color .2s ease}.workspace-row[_ngcontent-%COMP%]:not(.workspace-row-skeleton):hover, .workspace-row[_ngcontent-%COMP%]:not(.workspace-row-skeleton):focus-visible{background:#f8f8f8;border-color:#101010}.content[_ngcontent-%COMP%]{min-width:0}.description[_ngcontent-%COMP%]{color:#575757;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.date[_ngcontent-%COMP%]{color:#6f6f6f;font:.75rem/100% Sandvik Sans Regular,Tahoma,Verdana,sans-serif;white-space:nowrap}.chevron[_ngcontent-%COMP%]{font-size:1.5rem}.workspace-row-skeleton[_ngcontent-%COMP%]{grid-template-columns:1fr;pointer-events:none}.workspace-row-skeleton[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{height:1.5rem;width:45%}.workspace-row-skeleton[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{height:1rem;width:70%}.workspace-empty-state[_ngcontent-%COMP%]{background:#f8f8f8;border:1px solid #e6e6e6;padding:2rem}"],changeDetection:0})}}return t})();var Rt=[{path:"",component:Ne,pathMatch:"full",data:{bodyClass:"container"}},{path:":id",component:Be,pathMatch:"full",data:{bodyClass:"container"}}],Ue=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=$({type:t})}static{this.\u0275inj=L({imports:[ge.forChild(Rt),ge]})}}return t})();var Li=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=$({type:t})}static{this.\u0275inj=L({imports:[be,Ee,Ve,Ae,Ue]})}}return t})();export{Li as OperationWorkspaceModule};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.