PageSourceSearch

https://learn.americanai.org/chunk-JYNPUFMU.js

js americanai.org collected 2026-10-05 22:57:26 UTC 16,290 bytes, 1 lines download raw bytes

1import{a as st}from"./chunk-HRG4ZLBQ.js";import{a as lt,b as mt}from"./chunk-BSV6ZV4Z.js";import{a as dt}from"./chunk-PKO7YMCA.js";import{c as it}from"./chunk-WHD4EJD4.js";import"./chunk-MRCA5OJJ.js";import"./chunk-VQXNXRXD.js";import"./chunk-H56U5JD7.js";import{a as M,b as rt,c as R}from"./chunk-IPNNVI3O.js";import"./chunk-WCGCOQVP.js";import{a as at,b as ct}from"./chunk-24TWORQO.js";import"./chunk-6I7PGR76.js";import"./chunk-BUNR6PC6.js";import"./chunk-RI7OQJ43.js";import"./chunk-3Q77PNU6.js";import{a as Z,c as tt,d as et,e as ot,f as nt}from"./chunk-EILDYX27.js";import"./chunk-J4OYH7H6.js";import{g as $,j as G,p as J,q as K,r as U,t as X}from"./chunk-EAQ5LFAL.js";import{a as Y,c as I}from"./chunk-5DN27PVL.js";import"./chunk-WPCBDL5J.js";import"./chunk-JN4DMXBZ.js";import{a as q}from"./chunk-FQBLPB57.js";import{f as x,h as Q}from"./chunk-HXNDRLAU.js";import"./chunk-623CW2JR.js";import"./chunk-HPOPUXXC.js";import{Cb as d,Ib as f,Mb as i,Nb as r,Ob as u,Pb as N,Qb as z,Sb as v,Vb as _,Xb as l,ac as B,bb as V,bc as j,cc as H,ec as c,gc as h,gd as W,hd as A,ia as g,ib as a,jc as S,kc as k,lc as T,ma as y,nc as w,oc as L,uc as D,v as F,vc as E,xa as C,ya as b,zb as p}from"./chunk-Y2QVL34R.js";import"./chunk-2AVGQ2MQ.js";var Ct=()=>({height:"150px"});function bt(n,e){if(n&1){let t=v();i(0,"div",13)(1,"mat-card")(2,"mat-card-content")(3,"quill-editor",14),T("ngModelChange",function(s){C(t);let m=l();return k(m.newPostContent,s)||(m.newPostContent=s),b(s)}),r()(),i(4,"mat-card-actions",15)(5,"button",16),_("click",function(){C(t);let s=l();return b(s.submitPost())}),c(6," Post "),r(),i(7,"button",17),_("click",function(){C(t);let s=l();return b(s.cancelPost())}),c(8,"Cancel"),r()()()()}if(n&2){let t=l();a(3),S("ngModel",t.newPostContent),d("styles",L(4,Ct))("placeholder","Write your post here..."),a(2),d("disabled",t.submittingPost||!t.newPostContent.trim())}}function ft(n,e){if(n&1&&(i(0,"div",39),c(1),r()),n&2){let t=l().$implicit;a(),h(" ",t.user_name," ")}}function vt(n,e){n&1&&(i(0,"div",39)(1,"i"),c(2,"deleted user "),r()())}function ht(n,e){n&1&&(i(0,"span",40),c(1,"Instructor"),r())}function Pt(n,e){if(n&1&&(u(0,"div",41),D(1,"sanitizeHtml")),n&2){let t=l().$implicit,o=l();d("innerHTML",E(1,1,o.cleanContent(t.content)),V)}}function yt(n,e){n&1&&(i(0,"div",33)(1,"span")(2,"i"),c(3,"This message has been removed by moderation team."),r()()())}function wt(n,e){n&1&&(i(0,"div",33)(1,"span")(2,"i"),c(3,"This message has been deleted by the user."),r()()())}function xt(n,e){if(n&1){let t=v();i(0,"button",43),_("click",function(s){C(t);let m=l(3);return b(m.openReportDialog(s))}),u(1,"i",44),c(2," Report "),r()}}function It(n,e){if(n&1){let t=v();i(0,"button",43),_("click",function(s){C(t);let m=l(2).$implicit,O=l();return b(O.openConfirmationDialog(s,m.id))}),c(1," Delete "),r()}}function Mt(n,e){if(n&1&&(N(0),p(1,xt,3,0,"button",42)(2,It,2,0,"button",42),z()),n&2){let t=l().$implicit;a(),d("ngIf",!t.self_comment),a(),d("ngIf",t.self_comment)}}function Ot(n,e){if(n&1){let t=v();i(0,"div",13)(1,"mat-card",18),_("click",function(){let s=C(t).$implicit,m=l();return b(m.goToReplies(s.id))}),i(2,"mat-card-header",19)(3,"div",20)(4,"div",21)(5,"div",22),u(6,"i",23),r(),i(7,"div",24),p(8,ft,2,1,"div",25)(9,vt,3,0,"div",25),i(10,"div",26),p(11,ht,2,0,"span",27),r(),i(12,"small",28),u(13,"i",29),c(14),r()()(),i(15,"small",30),c(16),D(17,"timeAgo"),r()()(),i(18,"mat-card-content",31),p(19,Pt,2,3,"div",32)(20,yt,4,0,"div",33)(21,wt,4,0,"div",33),r(),i(22,"mat-card-actions",34)(23,"div",35),p(24,Mt,3,2,"ng-container",36),r(),i(25,"button",7),_("click",function(){let s=C(t).$implicit,m=l();return b(m.goToReplies(s.id))}),u(26,"i",37),c(27," View Thread "),i(28,"span",38),c(29),r()()()()()}if(n&2){let t=e.$implicit,o=l();a(8),d("ngIf",!t.removed),a(),d("ngIf",t.removed),a(2),d("ngIf",t==null?null:t.is_instructor),a(3),h(" ",t.views," views "),a(),d("title",o.getFullDate(t.created_at)),a(),h(" ",E(17,10,t.created_at)," "),a(3),d("ngIf",!t.removed&&!t.deleted),a(),f(t.removed?20:t.deleted?21:-1),a(4),d("ngIf",!(t!=null&&t.deleted)&&!(t!=null&&t.removed)),a(5),h("(",t.reply_count,")")}}function St(n,e){n&1&&(i(0,"div",12)(1,"h2"),c(2,"No posts available."),r()())}var P=class n{_router=g(Q);_discussionService=g(M);_toastr=g(q);dialog=g(it);_activateRoute=g(x);sortOption="newest";post;originalPostData;postId;discussionId;courseId;categoryId;isSocietyContext=!1;showPostForm=!1;newPostContent="";submittingPost=!1;ngOnInit(){this._activateRoute.data.subscribe(e=>{this.isSocietyContext=e.context==="society"}),this.onSortChange()}cleanContent(e){return e?e.replace(/ /g," "):""}vote(e,t){e.voting=!0;let o={id:e.id,board:e.board,upvotes:t==="upvote"?e.upvotes+1:e.upvotes,downvotes:t==="downvote"?e.downvotes+1:e.downvotes};this._discussionService.updateReply(e.id,o).subscribe({next:s=>{e.upvotes=s.upvotes,e.downvotes=s.downvotes,e.voting=!1},error:()=>{this._toastr.error("Failed to update vote."),e.voting=!1}})}
1cancelPost(){this.newPostContent="",this.showPostForm=!1}submitPost(){let e=this.newPostContent.trim();if(!e)return;this.submittingPost=!0;let t={content:e,board:this.postId};this._discussionService.createPost(t).subscribe({next:o=>{this._toastr.success("Post Created"),this.post.unshift(o),this.cancelPost()},error:o=>{console.error(o),this._toastr.error("Failed to create post.")},complete:()=>{this.submittingPost=!1}})}goToReplies(e){if(this.isSocietyContext){this._router.navigate(["/societies/",this.courseId,"discussions",this.categoryId,this.discussionId,"boards",this.postId,"posts",e,"replies",e]);return}this._router.navigate(["/microenvironments/details/",this.courseId,"discussion",this.courseId,"boards",this.discussionId,"posts",this.postId,"replies",e])}onSortChange(){this.post.length>0&&(this.sortOption==="newest"?this.post=[...this.originalPostData].sort((e,t)=>new Date(t.created_at).getTime()-new Date(e.created_at).getTime()):this.sortOption==="views"&&(this.post=[...this.originalPostData].sort((e,t)=>t.views-e.views)))}getFullDate(e){return R.formatFull(new Date(e))}openReportDialog(e){e.stopPropagation();let t=this.dialog.open(lt,{width:"500px",data:{postId:this.postId}});t.componentInstance.reportConfirmed.subscribe(o=>{console.log("Report submitted:",o),t.close()})}openConfirmationDialog(e,t){e.stopPropagation();let o=this.dialog.open(mt,{width:"500px",data:{postId:t}});o.componentInstance.confirm.subscribe(s=>{s==="post"&&this._discussionService.deletePost(t).subscribe(m=>{this._toastr.success("Post deleted");let O=this.post.find(ut=>ut.id===t);O.deleted=!0}),o.close()})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=y({type:n,selectors:[["app-post-card"]],inputs:{post:"post",originalPostData:"originalPostData",postId:"postId",discussionId:"discussionId",courseId:"courseId",categoryId:"categoryId"},standalone:!0,features:[w],decls:18,vars:4,consts:[[1,"m-2","p-2"],[1,"d-flex","justify-content-between","align-items-center","mb-3","mr13"],[1,"d-flex","align-items-center"],[1,"me-2","mb-0","fw-semibold","text-muted"],[1,"form-select","w-auto",3,"ngModelChange","change","ngModel"],["value","newest"],["value","views"],["mat-button","","type","submit",1,"reply-btn",3,"click"],[1,"ri-add-line","me-1"],["class","mb-3",4,"ngIf"],[1,"card"],["class","mb-3",4,"ngFor","ngForOf"],[1,"mt50","spinner","text-center"],[1,"mb-3"],[1,"w-100","p-2",3,"ngModelChange","ngModel","styles","placeholder"],[1,"d-flex","justify-content-end"],["mat-button","","type","submit",1,"reply-btn","me-2",3,"click","disabled"],["mat-button","",3,"click"],[1,"shadow-sm","border-0","hover-shadow",2,"cursor","pointer",3,"click"],[1,"p-2"],[1,"w-100","d-flex","justify-content-between","align-items-center"],[1,"d-flex","align-items-center","flex-grow-1"],[1,"avatar-icon","text-primary","me-2"],[1,"ri-user-3-line"],[1,"d-flex","flex-column","w-100"],["class","fs18",4,"ngIf"],[1,"mt-1"],["class","badge bg-info text-dark me-1",4,"ngIf"],[1,"text-muted"],[1,"ri-eye-line","me-1"],[1,"text-muted",3,"title"],[1,"ps-3","pt-2","pb-1","pe-2"],["class","mb-0 post-content",3,"innerHTML",4,"ngIf"],[1,"mb-0"],[1,"d-flex","justify-content-between","align-items-center"],[1,"d-flex","align-items-center","m7"],[4,"ngIf"],[1,"ri-chat-3-line","me-1"],[1,"reply-count","ms-1"],[1,"fs18"],[1,"badge","bg-info","text-dark","me-1"],[1,"mb-0","post-content",3,"innerHTML"],["mat-button","","class","ms-2 report-btn","type","submit",3,"click",4,"ngIf"],["mat-button","","type","submit",1,"ms-2","report-btn",3,"click"],[1,"ri-flag-line"]],template:function(t,o){t&1&&(u(0,"app-board-listing",0),i(1,"div",1)(2,"div",2)(3,"label",3),c(4,"Sort by:"),r(),i(5,"select",4),T("ngModelChange",function(m){return k(o.sortOption,m)||(o.sortOption=m),m}),_("change",function(){return o.onSortChange()}),i(6,"option",5),c(7,"Newest"),r(),i(8,"option",6),c(9,"Most Popular"),r()()(),i(10,"button",7),_("click",function(){return o.showPostForm=!o.showPostForm}),u(11,"i",8),c(12," Create Post "),r()(),p(13,bt,9,5,"div",9),i(14,"div",10)(15,"div",0),p(16,Ot,30,12,"div",11),r()(),p(17,St,3,0,"div",12)),t&2&&(a(5),S("ngModel",o.sortOption),a(8),d("ngIf",o.showPostForm),a(3),d("ngForOf",o.post),a(),f(o.post.length===0?17:-1))},dependencies:[nt,Z,et,tt,ot,I,Y,A,W,ct,at,X,K,U,J,$,G,dt,R,st],styles:["f.hover-shadow[_ngcontent-%COMP%]:hover{box-shadow:0 0 .5rem #00000026;
1transition:box-shadow .2s ease-in-out}.card.hover-shadow[_ngcontent-%COMP%]{transition:all .2s ease-in-out;cursor:pointer}.card.hover-shadow[_ngcontent-%COMP%]:hover{box-shadow:0 .5rem 1rem #00000026;background-color:#f8f9fa}.badge[_ngcontent-%COMP%]{transition:background-color .2s ease-in-out}.badge.bg-success[_ngcontent-%COMP%]:hover{background-color:#198754}.badge.bg-danger[_ngcontent-%COMP%]:hover{background-color:#bb2d3b}.badge.bg-secondary[_ngcontent-%COMP%]:hover{background-color:#6c757d}.mat-mdc-raised-button[_ngcontent-%COMP%]:not(:disabled){color:#006bf4!important}.badge[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{cursor:pointer}.card[_ngcontent-%COMP%]{border:0!important}.avatar-icon[_ngcontent-%COMP%]{background-color:#e0f0ff;border-radius:50%;width:2rem;height:2rem;display:flex;align-items:center;justify-content:center;font-size:1.125rem}.reply-btn[_ngcontent-%COMP%]{top:-.125rem;font-size:.875rem;position:relative;display:inline-block;padding:.5rem .9375rem .4375rem;transition:var(--transition);background-color:var(--primaryColor);cursor:pointer!important;color:var(--whiteColor)!important}.reply-btn[_ngcontent-%COMP%]:hover{background-color:var(--primaryColor);color:var(--whiteColor)}.report-btn[_ngcontent-%COMP%]{top:-.125rem;font-size:.875rem;position:relative;display:inline-block;padding:.5rem .9375rem .4375rem;transition:var(--transition);background-color:transparent;cursor:pointer!important;color:#000!important}.report-btn[_ngcontent-%COMP%]:hover{text-decoration:underline}.show-more-btn[_ngcontent-%COMP%]{top:-.125rem;font-size:.875rem;position:relative;display:inline-block;padding:.5rem .25rem .4375rem;transition:var(--transition);background-color:transparent;cursor:pointer!important;color:#000!important;margin-left:.625rem;border:.0625rem solid var(--primaryColor)}.show-more-btn[_ngcontent-%COMP%]:hover{color:#000}.fw400[_ngcontent-%COMP%]{font-weight:400!important}.nowrap[_ngcontent-%COMP%]{white-space:nowrap}.hover-shadow[_ngcontent-%COMP%]:hover{box-shadow:0 .5rem 1rem #00000026!important}.mr13[_ngcontent-%COMP%]{margin-right:.8125rem}.m7[_ngcontent-%COMP%]{margin:-.4375rem!important}.reply-count[_ngcontent-%COMP%]{font-weight:500;color:#888}.post-content[_ngcontent-%COMP%]{white-space:normal!important;word-break:normal!important;overflow-wrap:break-word!important}.post-content[_ngcontent-%COMP%]     *{white-space:normal!important;word-break:normal!important;overflow-wrap:break-word!important}.post-content[_ngcontent-%COMP%]     span, .post-content[_ngcontent-%COMP%]     p, .post-content[_ngcontent-%COMP%]     div, .post-content[_ngcontent-%COMP%]     h1, .post-content[_ngcontent-%COMP%]     h2, .post-content[_ngcontent-%COMP%]     h3, .post-content[_ngcontent-%COMP%]     h4, .post-content[_ngcontent-%COMP%]     h5, .post-content[_ngcontent-%COMP%]     h6{white-space:normal!important;word-break:normal!important;overflow-wrap:break-word!important}"]})};function kt(n,e){if(n&1&&(i(0,"div"),u(1,"app-post-card",2),r()),n&2){let t=l();a(),d("courseId",t.courseId!=null?t.courseId:t.societyId)("postId",t.postId)("discussionId",t.discussionId)("post",t.postData)("originalPostData",t.originalPostData)("categoryId",t.categoryId)}}var pt=class n{postCard;_activateRoute=g(x);_discussionService=g(M);postId;discussionId;courseId;societyId;isSocietyContext=!1;postData=[];originalPostData=[];boardId;categoryId;ngOnInit(){this._activateRoute.data.subscribe(e=>{this.isSocietyContext=e.context==="society"}),F([this._activateRoute.params,this._activateRoute.parent?.params||[]]).subscribe(([e,t])=>{this.isSocietyContext?(this.societyId=t.societyId,this.categoryId=t.category):this.courseId=parseInt(e.id),this.discussionId=parseInt(e.discussionId),this.boardId=parseInt(e.boardId),this.postId=parseInt(e.postId),this.getPosts(this.postId)})}getPosts(e){this._discussionService.getPosts(e).subscribe(t=>{this.originalPostData=t.results,this.postData=[...this.originalPostData],setTimeout(()=>{this.postCard.onSortChange()},500)})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=y({type:n,selectors:[["app-post-thread"]],viewQuery:function(t,o){if(t&1&&B(P,5),t&2){let s;j(s=H())&&(o.postCard=s.first)}}
1,standalone:!0,features:[w],decls:3,vars:8,consts:[[3,"discussionId","boardId","postId","societyId","courseId","isSocietyContext","categoryId"],[1,"mt-4"],[3,"courseId","postId","discussionId","post","originalPostData","categoryId"]],template:function(t,o){t&1&&(u(0,"app-discussion-breadcrumb",0),i(1,"div",1),p(2,kt,2,6,"div"),r()),t&2&&(d("discussionId",o.discussionId)("boardId",o.boardId)("postId",o.postId)("societyId",o.societyId)("courseId",o.courseId)("isSocietyContext",o.isSocietyContext)("categoryId",o.categoryId),a(2),f(o.discussionId?2:-1))},dependencies:[P,I,rt],styles:["f.hover-shadow[_ngcontent-%COMP%]:hover{box-shadow:0 0 .5rem #00000026;transition:box-shadow .2s ease-in-out}.card.hover-shadow[_ngcontent-%COMP%]{transition:all .2s ease-in-out;cursor:pointer}.card.hover-shadow[_ngcontent-%COMP%]:hover{box-shadow:0 .5rem 1rem #00000026;background-color:#f8f9fa}.badge[_ngcontent-%COMP%]{transition:background-color .2s ease-in-out}.badge.bg-success[_ngcontent-%COMP%]:hover{background-color:#198754}.badge.bg-danger[_ngcontent-%COMP%]:hover{background-color:#bb2d3b}.badge.bg-secondary[_ngcontent-%COMP%]:hover{background-color:#6c757d}.mat-mdc-raised-button[_ngcontent-%COMP%]:not(:disabled){color:#006bf4!important}.badge[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{cursor:pointer}.card[_ngcontent-%COMP%]{border:0!important}.avatar-icon[_ngcontent-%COMP%]{background-color:#e0f0ff;border-radius:50%;width:2rem;height:2rem;display:flex;align-items:center;justify-content:center;font-size:1.125rem}.reply-btn[_ngcontent-%COMP%]{top:-.125rem;font-size:.875rem;position:relative;display:inline-block;padding:.5rem .9375rem .4375rem;transition:var(--transition);background-color:var(--primaryColor);cursor:pointer!important;color:var(--whiteColor)!important}.reply-btn[_ngcontent-%COMP%]:hover{background-color:var(--primaryColor);color:var(--whiteColor)}.report-btn[_ngcontent-%COMP%]{top:-.125rem;font-size:.875rem;position:relative;display:inline-block;padding:.5rem .9375rem .4375rem;transition:var(--transition);background-color:transparent;cursor:pointer!important;color:#000!important}.report-btn[_ngcontent-%COMP%]:hover{text-decoration:underline}.show-more-btn[_ngcontent-%COMP%]{top:-.125rem;font-size:.875rem;position:relative;display:inline-block;padding:.5rem .25rem .4375rem;transition:var(--transition);background-color:transparent;cursor:pointer!important;color:#000!important;margin-left:.625rem;border:.0625rem solid var(--primaryColor)}.show-more-btn[_ngcontent-%COMP%]:hover{color:#000}.fw400[_ngcontent-%COMP%]{font-weight:400!important}.nowrap[_ngcontent-%COMP%]{white-space:nowrap}.hover-shadow[_ngcontent-%COMP%]:hover{box-shadow:0 .5rem 1rem #00000026!important}"]})};export{pt as PostThreadComponent};

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.