1import{u as V,o as d,c as k,w as p,a as r,b as n,p as o,i as u,F as S,l as C,t as g,m as I,s as v,j as _,d as c}from"./app-xLVlCRxi.js";import{A as T}from"./AppLayout-Ga7k3sVZ.js";import{_ as $}from"./TextInput.vue_vue_type_script_setup_true_lang-BzYMpROF.js";import{_ as D}from"./PrimaryButton-Bwrn-3rM.js";import{_ as N}from"./SecondaryButton-DYX8LZhW.js";import{m as A,a as B}from"./composables-CTp1paw4.js";import{C as h}from"./GlobalModalManager-Cd7hPCoP.js";import{S as F}from"./ScenarioSection-mFRqF9Jh.js";import"./_plugin-vue_export-helper-C8tdCacw.js";import"./ShinyButton-Begpq0XM.js";import"./PersoneoLogo-C5EbmV-z.js";import"./AidvisorLogo-DeagN9oL.js";import"./transition-C-SQPkQy.js";import"./CheckIcon-jomwxdhh.js";import"./PlusIcon-BHhLRZV3.js";import"./AvatarTextual-BvKOOHz9.js";import"./ChatBubbleOvalLeftEllipsisIcon-nqFrPwfJ.js";/* empty css */import"./InformationCircleIcon-CucgfLX6.js";import"./Spinner-DQGA236w.js";import"./ConfirmationDialog-NQNPMxUi.js";import"./TextAreaInput.vue_vue_type_script_setup_true_lang-DdX2FMKZ.js";import"./TrashIcon-mwVpO1tS.js";import"./ChevronDownIcon-CNtda2dX.js";import"./ArrowDownTrayIcon-C3IzCDrD.js";import"./ArrowUpTrayIcon-DsTCZWe_.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new i.Error().stack;l&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[l]="917b6afa-7ffd-4f95-8551-54b7dd11f256",i._sentryDebugIdIdentifier="sentry-dbid-917b6afa-7ffd-4f95-8551-54b7dd11f256")}catch{}})();const U={class:"max-w-3xl mx-auto p-6"},E={class:"bg-white rounded-2xl shadow-sm p-6 md:p-8 mb-6"},j={key:0,class:"mt-5"},L={class:"bg-gray-50 p-4 rounded-lg overflow-y-auto"},q={class:"space-y-2 max-h-60 overflow-y-auto border border-gray-200 rounded-md p-3"},z={class:"flex items-center"},M=["for"],P={class:"bg-white rounded-2xl shadow-sm p-6 md:p-8 mb-6"},G={class:"flex justify-end items-center gap-x-4"},ye={__name:"Create",props:{availableTeams:{type:Array,required:!1,default:()=>[]}},setup(i){const l=i,{can:f}=B(),x=c(()=>l.availableTeams),s=V({name:"",opening_phrase:"",conversation_phases:[],editors:{teamIds:[],company:!1}}),b=c({get:()=>({opening_phrase:s.opening_phrase,conversation_phases:s.conversation_phases}),set:a=>{s.opening_phrase=a.opening_phrase,s.conversation_phases=a.conversation_phases}}),y=c({get(){return s.editors.teamIds},set(a){s.editors.teamIds=a}});A(s.editors);function w(){s.transform(a=>({name:a.name,opening_phrase:a.opening_phrase,conversation_phases:a.conversation_phases.map(({id:e,minimized:t,...m})=>m),editors:a.editors})).post(route("scenarioSets.store"),{preserveScroll:!0,onSuccess:()=>v.visit(route("library.scenarios"))})}return(a,e)=>(d(),k(T,null,{default:p(()=>[r("div",U,[r("div",E,[e[9]||(e[9]=r("h1",{class:"text-3xl font-bold text-gray-900 mb-8"},"Create Scenario Set",-1)),n($,{modelValue:o(s).name,"onUpdate:modelValue":e[0]||(e[0]=t=>o(s).name=t),label:"Name",placeholder:"e.g. Cold Call Introduction",errors:o(s).errors.name?[o(s).errors.name]:[],class:"mb-6"},null,8,["modelValue","errors"]),o(f)("manage users")?(d(),u("div",j,[e[8]||(e[8]=r("div",{class:"cursor-pointer text-base font-bold text-[#3F4A55] mb-2 inline-block"}," Teams that can edit this scenario set ",-1)),r("div",L,[e[7]||(e[7]=r("p",{class:"text-sm text-gray-500 mb-2"},"Select teams to share this scenario set editability with. If no teams are selected, only you will be able to edit it.",-1)),r("div",q,[r("div",z,[n(o(h),{id:"share-to-company",modelValue:o(s).editors.company,"onUpdate:modelValue":e[1]||(e[1]=t=>o(s).editors.company=t),class:"shrink-0 mr-2"},null,8,["modelValue"]),e[5]||(e[5]=r("label",{for:"share-to-company",class:"ml-2 block text-sm text-gray-900 font-medium"}," Share to all ",-1))]),e[6]||(e[6]=r("div",{class:"border-t border-gray-200 my-2"},null,-1)),(d(!0),u(S,null,C(x.value,t=>(d(),u("div",{key:t.id,class:"flex items-center"},[n(o(h),{id:`team-${t.id}`,value:t.id,modelValue:y.value,"onUpdate:modelValue":e[2]||(e[2]=m=>y.value=m),class:"shrink-0 mr-2"},null,8,["id","value","modelValue"]),r("label",{for:`team-${t.id}`,class:"ml-2 block text-sm text-gray-900"}
1,g(t.name),9,M)]))),128))])])])):I("",!0)]),r("div",P,[n(o(F),{modelValue:b.value,"onUpdate:modelValue":e[3]||(e[3]=t=>b.value=t),errors:o(s).errors,"show-save-load":!1,title:"Scenario"},null,8,["modelValue","errors"])]),r("div",G,[n(N,{onClick:e[4]||(e[4]=t=>o(v).visit(a.route("library.scenarios")))},{default:p(()=>[...e[10]||(e[10]=[_("Cancel",-1)])]),_:1}),n(D,{onClick:w,disabled:o(s).processing},{default:p(()=>[_(g(o(s).processing?"Creating...":"Create"),1)]),_:1},8,["disabled"])])])]),_:1}))}};export{ye 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.