1import{S as y,b as H,a as M,e as w,U,x as L,y as E,a5 as B,bc as N,w as D,C as F,P as A,j as z}from"./common-DA6v5qPI.js";import{a0 as T,a9 as t,a1 as s,a7 as $,ac as c,ab as r,aa as b,a3 as o,ao as I,af as P,aE as R,X as j,aF as S,aG as O,a2 as C,a8 as _,F as G,ah as J,an as W,a5 as X}from"./vendor-WhJxQAne.js";import"./sdui-app-switcher-B1W1d0j_.js";import"./bootstrap-C-7OD816.js";import"./sdui-lang-de-CiT0j-u3.js";import"./sdui-tracking-DIkZmxzc.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"sdui-frontend@production-2025.1.0-ecca8ab01543e423a48c4cbd431f15a4c6ede54a"};var n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a3b72992-e240-4e1f-b710-d4a7c14c73ef",e._sentryDebugIdIdentifier="sentry-dbid-a3b72992-e240-4e1f-b710-d4a7c14c73ef")}catch{}})();const Y={name:"ChannelCreationHint",components:{SModalPortalTo:H,SCheckbox:y},data:()=>({hint:!1}),methods:{setHintStatus(e){this.hint=e,window.localStorage.setItem("shouldSkipCreateChannelHint",e)}},created(){localStorage&&(this.hint=localStorage&&JSON.parse(localStorage.getItem("shouldSkipCreateChannelHint"))||!1)}},q={class:"d-flex justify-content-center mb-4"},K={class:"my-3"};function Q(e,n,i,d,v,h){const u=t("sdui-icon"),l=t("SCheckbox"),p=t("SListItem"),f=t("b-button"),m=t("SModalPortalTo");return s(),$("div",null,[c("div",q,[r(u,{class:"icon-info-o orange"})]),c("div",null,[c("p",null,b(e.$t("channels.create_group.hint")),1),c("div",K,[r(p,{title:e.$t("channels.create_group.toggle"),"aria-pressed":e.hint?"true":"false",onClick:n[1]||(n[1]=I(g=>h.setHintStatus(!e.hint),["prevent"]))},{"right-action":o(()=>[r(l,{modelValue:e.hint,"onUpdate:modelValue":n[0]||(n[0]=g=>e.hint=g),name:"toggle-hint","label-text":e.$t("channels.create_group.toggle"),"checkbox-type":"switch"},null,8,["modelValue","label-text"])]),_:1},8,["title","aria-pressed"])])]),r(m,null,{default:o(()=>[r(f,{variant:"primary",block:"",size:"lg",type:"submit",onClick:n[2]||(n[2]=g=>e.$router.push({name:"create-channel-start"}))},{default:o(()=>[P(b(e.$t("channels.create_group.submit")),1)],void 0,!0),_:1})],void 0,!0),_:1})])}const Z=T(Y,[["render",Q],["__scopeId","data-v-1cbdcadc"]]),x={class:"my-3"},ee=R({__name:"TeacherParentChannelHint",setup(e){const{t:n}=M(),i=j(),d=O(!1);function v(u){d.value=u,localStorage==null||localStorage.setItem("shouldSkipTeacherParentHint",u.toString())}function h(){w.trackChannel("channel").start.createTeacherParentChannel(),i.push({name:"create-teacher-parent-channel-grade-selection"})}return(u,l)=>{const p=t("SListItem"),f=t("b-button");return s(),$("div",null,[c("p",null,b(S(n)("channels.teacher_parent_channel_creation.modal_hint")),1),c("div",x,[r(p,{title:S(n)("channels.create_group.toggle"),"aria-pressed":d.value?"true":"false",onClick:l[1]||(l[1]=I(m=>v(!d.value),["prevent"]))},{"right-action":o(()=>[r(y,{modelValue:d.value,"onUpdate:modelValue":l[0]||(l[0]=m=>d.value=m),name:"toggle-hint","label-text":S(n)("channels.create_group.toggle"),"checkbox-type":"switch"},null,8,["modelValue","label-text"])]),_:1},8,["title","aria-pressed"])]),r(H,null,{default:o(()=>[r(f,{variant:"primary",block:"",size:"lg",onClick:h},{default:o(()=>[P(b(S(n)("channels.teacher_parent_channel_creation.confirm")),1)],void 0,!0),_:1})],void 0,!0),_:1})])}}}),ne={name:"ChannelCreationList",components:{TeacherParentChannelHint:ee,HeaderNavigation:N,SduiUserListItem:B,ChannelCreationHint:Z,SduiWaterfallSearch:E},mixins:[L],props:{},data:()=>({url:`${z.userContactableUrl()}?`,contactableUsers:[],User:U,searchString:"",showChannelCreationHintModal:!1,showTeacherParentHintModal:!1}),computed:{shouldSkipChannelCreationHint(){return(localStorage==null?void 0:localStorage.getItem("shouldSkipCreateChannelHint"))==="true"},shouldSkipTeacherParentHint(){return(localStorage==null?void 0:localStorage.getItem("shouldSkipTeacherParentHint"))==="true"}},methods:{startConversation:D("conversationBegin",async function(e){const n=`conversation${e}`;this.$wait.start(n);try{const i=await F.postChannelsStartConversation({user_id:e});
1await A.insertOrUpdate({data:i.data}),w.trackChannel("channel").end.conversation(),await this.$router.push({name:"channel-single-chat",hash:"#read",params:{id:i.data.id}})}catch(i){throw w.trackChannel("channel","FAILED",i.message).end.conversation(),i}this.$wait.end(n)}),startChannelCreation(){if(this.shouldSkipChannelCreationHint)return this.$router.push({name:"create-channel-start"});this.showChannelCreationHintModal=!0},startTeacherParentChannelCreation(){if(this.shouldSkipTeacherParentHint)return w.trackChannel("channel").start.createTeacherParentChannel(),this.$router.push({name:"create-teacher-parent-channel-grade-selection"});this.showTeacherParentHintModal=!0}},async created(){!this.$can("create-channel",this.$me)&&!this.$can("create-conversation",this.$me)&&this.$router.push({name:"channels"})}},te={class:"alert-warning-card container"};function ae(e,n,i,d,v,h){const u=t("header-navigation"),l=t("b-container"),p=t("SListItem"),f=t("sdui-user-list-item"),m=t("sdui-waterfall-search"),g=t("channel-creation-hint"),k=t("SModal"),V=t("teacher-parent-channel-hint");return s(),$("div",null,[r(u,{title:e.$t("channels.channel_creation.new_chat")},null,8,["title"]),r(l,{class:"aux-custom-top-spacing pb-4"},{default:o(()=>[c("div",te,b(e.$t("channels.channel_creation.hint_only_registered_users")),1)],void 0,!0),_:1}),r(m,{modelValue:e.contactableUsers,"onUpdate:modelValue":n[0]||(n[0]=a=>e.contactableUsers=a),url:e.url,model:e.User,class:"contactable-users-waterfall",onSearch:n[1]||(n[1]=a=>this.searchString=a)},{default:o(()=>[!e.searchString.length&&e.$can("create-channel",e.$me)?(s(),C(p,{key:0,title:e.$t("channels.channel_creation.list_title"),icon:"icon-group","primary-text-color":"",onClick:h.startChannelCreation},null,8,["title","onClick"])):_("",!0),!e.searchString.length&&e.$can("create-teacher-parent-channel",e.$me)?(s(),C(p,{key:1,title:e.$t("channels.teacher_parent_channel_creation.create_chats"),icon:"icon-user-parent","primary-text-color":"",onClick:h.startTeacherParentChannelCreation},null,8,["title","onClick"])):_("",!0),e.$can("create-conversation",e.$me)?(s(!0),$(G,{key:2},J(e.contactableUsers,a=>(s(),C(f,{key:a.id,user:a,disabled:e.$wait.waiting("conversationBegin")&&!e.$wait.waiting("conversation"+a.id),onClick:re=>e.$wait.waiting("conversationBegin")?"":h.startConversation(a.id)},W({_:2},[e.$wait.waiting("conversation"+a.id)?{name:"action",fn:o(()=>[c("div",{class:X({"spinner-input":e.$wait.waiting("conversation"+a.id)})},null,2)]),key:"0"}:void 0]),1032,["user","disabled","onClick"]))),128)):_("",!0)],void 0,!0),_:1},8,["modelValue","url","model"]),r(k,{modelValue:e.showChannelCreationHintModal,"onUpdate:modelValue":n[2]||(n[2]=a=>e.showChannelCreationHintModal=a),"header-title":e.$t("channels.create_group.title"),centered:"","show-footer-gradient":!1},{default:o(()=>[e.showChannelCreationHintModal?(s(),C(g,{key:0})):_("",!0)],void 0,!0),_:1},8,["modelValue","header-title"]),r(k,{modelValue:e.showTeacherParentHintModal,"onUpdate:modelValue":n[3]||(n[3]=a=>e.showTeacherParentHintModal=a),"header-title":e.$t("channels.teacher_parent_channel_creation.parent_chats"),centered:"","show-footer-gradient":!1},{default:o(()=>[e.showTeacherParentHintModal?(s(),C(V,{key:0})):_("",!0)],void 0,!0),_:1},8,["modelValue","header-title"])])}const he=T(ne,[["render",ae],["__scopeId","data-v-db366d52"]]);export{he as default}; 2//# sourceMappingURL=ChannelCreationList-DsXNjIfj.js.map
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.