PageSourceSearch

https://ticket.buildingthefuture.pt/assets/EditSession-Btog5R7Z.js

js buildingthefuture.pt collected 2026-10-02 14:34:41 UTC 3,966 bytes, 1 lines download raw bytes

1import{d as P,s as y,e as k,cc as T,ce as j,aT as L,o as r,c as f,f as U,g as b,z as q,u as n,a as I,b as c,t as u,n as G,ad as H,h as d,i as J,bs as K,S as M,aR as O,cd as Q}from"./index-CECfxDsp.js";import{u as S,_ as W}from"./SessionForm.vue_vue_type_style_index_0_lang-DFn2B1Zr.js";import{m as X}from"./index-7V5rfzVp.js";import{b as Y,g as Z}from"./speakers-C2_vojGY.js";import{a as ee}from"./files-Bwxkdus4.js";import"./input.vue_vue_type_style_index_0_lang-DYWz1_NN.js";import"./utils-DGnOM_Au.js";import"./isJson-BEZlTCKP.js";import"./switch.vue_vue_type_script_setup_true_lang-B4QnVBvk.js";import"./date-picker.vue_vue_type_style_index_0_lang-BYKUdF1q.js";import"./vue-select.css_vue_type_style_index_0_src_true_lang-BLGPd6of.js";import"./multi-select.vue_vue_type_style_index_1_lang-Cqs9JlH3.js";import"./checkbox.vue_vue_type_style_index_0_lang-CqUG8IxO.js";import"./cropper.vue_vue_type_style_index_0_lang-CoOM0uYD.js";const se={class:"session-edit"},ae={key:0,class:"title is-4"},te={key:1,class:"title is-4"},oe={class:"buttons"},be=P({__name:"EditSession",setup(ie){const _=d({...X}),t=d({}),p=d(!1),C=d(!1),w=d([]);let m={};const{translations:l,contextEvent:E,eventContextRoute:x,contextCheckinSession:h}=J(),{form:a,validateForm:z}=S(),{triggerPopupErrors:v}=K(),F=M(()=>t.value!==void 0&&(h.value._name==="check-in"||h.value._name==="checkin")&&t.value.id===h.value.id);let g=E.value.id;const N=async()=>{try{const o=await Z(g);w.value=o.data.results;const{inputs:s}=S();s.speakers&&(s.speakers.options=w.value.map(e=>({label:e.name,value:e.id})))}catch(o){console.error("Error loading speakers:",o)}},R=y.subscribeAction({after:async(o,s)=>{if(o.type==="editSession"){p.value=!1;try{const e=a.speakers.map(i=>i.value);await Y(e,o.payload.payload.id)}catch(e){v(e)}k.push(`${x.value}/manage-event/sessions`),a.chat?m.id||await T(o.payload.payload.id).catch(e=>{v(e)}):m.id&&await j(m.id).catch(e=>{v(e)})}}});L(()=>{R()});const V=()=>{y.dispatch("deleteSession",{payload:{...t.value,...a},event:g}),k.push(`${x.value}/manage-event/sessions`)},A=async()=>{let o=!1;if(p.value=!0,o=z(),o)p.value=!1;else{if(a.channels=a.channels.map(s=>{let e=s;return a.online_enabled?s.channel_type===a.online_type?e={...s,is_enabled:!0}:s.channel_type!=="in_person"&&(e={...s,is_enabled:!1}):s.channel_type!=="in_person"&&(e={...s,is_enabled:!1}),e}),a.image&&typeof a.image=="object"&&a.image.name){const s=new FormData;s.append("file",a.image);const e=await ee(s).catch(i=>{v(i)});e&&(a.image=e.data.id)}y.dispatch("editSession",{payload:{...t.value,...a},event:g})}},D=parseInt(k.currentRoute.value.params.session,10);return(async()=>{var i;await N();const o=await O(D);t.value=o.data;const{inputs:s}=S();if((i=t.value)!=null&&i.speakers&&s.speakers){const $=(t.value.speakers||[]).map(B=>({label:B.name,value:B.id}));a.speakers=$,s.speakers.value=$}const e=await Q(t.value.id);e.data.results.length>0&&(m=e.data.results[0],a.chat=!0,t.value&&(t.value.chat=!0)),C.value=!0})(),(o,s)=>(r(),f("div",se,[U(H,{config:_.value},{header:b(()=>{var e;return[(e=t.value)!=null&&e.hide_end_date&&t.value.hide_start_date?(r(),f("h4",ae,u(n(l).exhibitors.sessions.edit_spacer),1)):(r(),f("h4",te,u(n(l).exhibitors.sessions.edit_session),1))]}),footer:b(()=>[c("div",oe,[c("button",{type:"button",class:"button is-light",onClick:s[0]||(s[0]=e=>_.value.close&&_.value.close())},u(n(l).common.close),1),F.value?I("",!0):(r(),f("button",{key:0,type:"button",class:"button is-danger",onClick:s[1]||(s[1]=e=>V())},u(n(l).common.delete),1)),c("button",{type:"button",class:G(["button is-success is-pulled-right",{"is-loading":p.value}]),onClick:s[2]||(s[2]=e=>A())},[s[3]||(s[3]=c("span",{class:"material-icons-outlined",style:{"margin-right":"0.125rem"}}," save ",-1)),c("span",null,u(n(l).common.save),1)],2)])]),default:b(()=>[C.value?(r(),q(W,{key:0,form:n(a),session:t.value,isSpacer:!1},null,8,["form","session"])):I("",!0)]),_:1},8,["config"])]))}});export{be as default};

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.