PageSourceSearch

https://assets.airlst.app/85cfa0fa-c6a6-4d6b-b5f7-71170c7ba690/build/assets/Create-TXO8m1W1.js

js airlst.app collected 2026-09-24 13:19:15 UTC 8,061 bytes, 2 lines download raw bytes

1import{b as F,x as f,ae as A,w,y as E,A as r,E as c,B as e,D as l,a8 as L,F as n,S as O,ai as R,R as k,V as S,W as N,a3 as $,U as b,e as q,z as a}from"./index-B7FuHUwY.js";import{am as z,o as _,aW as M,t as T,H as W,aL as H,aR as J}from"./vite.helpers-BT1FLFZY.js";import{_ as P}from"./SelectMultiple-uqO7-aku.js";import{v as h}from"./usePrecognition-90Es3cm6.js";import{_ as G}from"./NumberInput-BxZhaOoM.js";import"./_plugin-vue_export-helper-1Fh_g1AI.js";try{let i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new i.Error().stack;p&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[p]="5cedb9b5-42b7-428d-a4a6-155c5fc41c16",i._sentryDebugIdIdentifier="sentry-dbid-5cedb9b5-42b7-428d-a4a6-155c5fc41c16")}catch{}const K={class:"relative"},Q={class:"mx-auto max-w-[1000px] px-2 md:px-5 pt-8 md:pt-12 pb-20 2xl:px-[8%]"},X={class:"mb-4 flex items-center justify-center md:justify-between"},Y={class:"flex justify-center md:justify-start gap-3"},Z=["textContent"],ee=["textContent"],te={class:"card pb-[30px] pt-4 md:pt-7 tracking-[0.2px] subpixel-antialiased"},se={class:"mb-5 px-4 md:px-[30px]"},ne=["textContent"],oe={key:0},le={class:"mb-8 flex items-center gap-5 px-4 md:px-[30px]"},ae=["textContent"],ie={for:"enabled",class:"relative cursor-pointer"},de={class:"flex items-center gap-2 text-[13px]"},re=["textContent"],pe=["textContent"],ue={key:0,class:"w-full"},me={class:"bg-gray-50 table w-full table-fixed"},xe=["textContent"],ce=["textContent"],be=["textContent"],fe=["textContent"],_e={key:0},he=["textContent"],ve={class:"whitespace-nowrap border-b border-[#e0e0e0] p-[10px_15px] text-[13px] font-light text-gray-900"},ye=["textContent"],ge=["textContent"],Ce=["textContent"],we={class:"mb-10 px-4 md:px-[30px] pt-3 md:pt-6"},ke=["textContent"],$e=["textContent"],Ve={class:"flex items-center justify-end px-[25px]"},je=["textContent"],Ie=["disabled"],Ue=["textContent"],Oe={__name:"Create",props:{event:{type:Object,required:!0},fields:{type:Array,required:!0}},setup(i){const p=i,{t:v}=z(),u=F({}),V=s=>v(s==="booking"?"field.models.booking":`field.groups.${s}`),j=f(()=>p.fields.map(s=>({id:s.id,label:`${V(s.model)} › ${s.label}`}))),x=f(()=>_("events.extendedFields.limits.set",{event:p.event,field:t.field})),t=A({enabled:!0,field:null,limits:[],statuses:["confirmed"],public:!0}),y=f(()=>{var s;return((s=p.fields.find(({id:o})=>o===t.field))==null?void 0:s.options)??[]}),I=M().filter(({value:s})=>s!=="declined");w(y,s=>{t.limits=[],s.forEach(({id:o})=>t.limits.push({option_id:o})),g()}),w(t.statuses,()=>g());const g=async()=>{if(!t.field||t.statuses.length===0)return;u.value={};const{data:s}=await J(_("events.field.current-usage",{event:p.event,field:t.field}),{statuses:t.statuses});u.value=s.value.usage};return(s,o)=>{const U=E("FontAwesomeIcon");return a(),r("div",K,[c(T,{title:s.$t("limits.create_limit")},null,8,["title"]),e("div",Q,[e("div",X,[e("div",Y,[e("h3",{class:"text-lg md:text-[24px] font-extrabold text-[#3d4146]",textContent:l(s.$t("limits.create_limit"))},null,8,Z),e("span",{class:"hidden md:inline-block h-5 rounded-[5px] bg-white p-[2px_5px] text-[11px] font-bold text-black",textContent:l(i.event.name)},null,8,ee)])]),e("div",te,[e("form",{novalidate:"",onSubmit:o[6]||(o[6]=L(d=>n(t).post(x.value),["prevent"]))},[e("div",se,[e("label",{for:"field",class:"mb-[5px] flex items-center gap-1 text-[13px] font-semibold text-[#3d4146]",textContent:l(s.$t("common.field"))},null,8,ne),c(W,{id:"field",modelValue:n(t).field,"onUpdate:modelValue":o[0]||(o[0]=d=>n(t).field=d),name:"field",items:j.value,"key-label":"label","key-value":"id","btn-class":"border-[#d9e1e6]",onChange:o[1]||(o[1]=d=>n(h)("field",n(t),x.value))},null,8,["modelValue","items"])]),n(t).field?(a(),r("div",oe,[e("div",le,[e("label",{for:"enabled",class:"block text-[13px] font-semibold",textContent:l(s.$t("common.enabled"))},null,8,ae),e("label",ie,[O(e("input",{id:"enabled","onUpdate:modelValue":o[2]||(o[2]=d=>n(t).enabled=d),name:"enabled",type:"checkbox",class:"absolute top-0 left-0 h-full w-full opacity-0"},null,512),[[R,n(t).enabled]]),e("div",de,[e("span",{textContent:l(s.$t("common.no"))},null,8,re),e("div",{class:k([n(t).enabled?"justify-end border-2 border-primary bg-primary":"justify-start border-2 border-[#3d4146] bg-[#3d4146]","flex h-5 w-[37
1px] cursor-pointer items-center rounded-[20px]"])},[...o[7]||(o[7]=[e("div",{class:"h-full w-1/2 rounded-full bg-white"},null,-1)])],2),e("span",{textContent:l(s.$t("common.yes"))},null,8,pe)])])]),n(t).hasErrors?b("",!0):(a(),r("table",ue,[e("thead",me,[e("tr",null,[e("th",{scope:"col",class:"border-b border-[#e0e0e0] p-[7.5px_30px] text-left text-[13px] font-medium w-[35%]",textContent:l(s.$t("common.value"))},null,8,xe),e("th",{scope:"col",class:"border-b border-[#e0e0e0] p-[7.5px_15px] text-left text-[13px] font-medium",textContent:l(s.$t("common.limit"))},null,8,ce),e("th",{scope:"col",class:"border-b border-[#e0e0e0] p-[7.5px_15px] text-left text-[13px] font-medium",textContent:l(s.$t("common.current"))},null,8,be),e("th",{scope:"col",class:"border-b border-[#e0e0e0] p-[7.5px_30px_7.5px_15px] text-left text-[13px] font-medium",textContent:l(s.$t("common.free"))},null,8,fe)])]),Object.keys(u.value).length>0?(a(),r("tbody",_e,[(a(!0),r(S,null,N(y.value,({id:d,key:C,label:B},m)=>(a(),r("tr",{key:d,class:"bg-white hover:bg-[#f4f9fc] table w-full table-fixed","data-test":"field-options-row"},[e("td",{class:"border-b border-[#e0e0e0] p-[7.5px_30px] text-[13px] font-light text-gray-900 break-all w-[35%]","data-test":"option-value",textContent:l(B)},null,8,he),e("td",ve,[c(G,{modelValue:n(t).limits[m].limit,"onUpdate:modelValue":D=>n(t).limits[m].limit=D,placeholder:s.$t("common.unlimited"),class:"h-[35px] w-full rounded-[3px] border border-[#e0e0e0] p-[7.5px_15px] text-[13px] font-light outline-none","data-test":"option-limit",onBlur:()=>n(h)(`limits.${m}.limit`,n(t),x.value)},null,8,["modelValue","onUpdate:modelValue","placeholder","onBlur"])]),e("td",{class:"whitespace-nowrap border-b border-[#e0e0e0] p-[10px_15px] text-[13px] font-light text-gray-900","data-test":"option-current",textContent:l(u.value[C])},null,8,ye),e("td",{class:"whitespace-nowrap border-b border-[#e0e0e0] p-[7.5px_30px_7.5px_15px] text-[13px] text-[#04CAC3]",textContent:l(n(t).limits[m].limit===null||!Object.hasOwnProperty("limit")?s.$t("common.unlimited"):n(t).limits[m].limit-u.value[C])},null,8,ge)]))),128))])):(a(),$(H,{key:1}))])),n(t).errors.limits?(a(),r("small",{key:1,class:"pl-[30px] text-[10px] text-red-500 subpixel-antialiased",textContent:l(n(t).errors.limits)},null,8,Ce)):b("",!0)])):b("",!0),e("div",we,[e("label",{for:"max_number_status",class:"mb-[7px] block text-[13px] font-semibold",textContent:l(s.$t("field.max_number_status"))},null,8,ke),c(P,{id:"max_number_status",modelValue:n(t).statuses,"onUpdate:modelValue":[o[3]||(o[3]=d=>n(t).statuses=d),o[4]||(o[4]=()=>n(h)("statuses",n(t),x.value))],name:"max_number_status",class:"max-w-[300px]",items:n(I),"show-search":!1,"key-label":"label","key-value":"value"},null,8,["modelValue","items"]),n(t).errors.statuses?(a(),r("small",{key:0,class:"text-[10px] text-red-500 subpixel-antialiased",textContent:l(n(t).errors.statuses)},null,8,$e)):b("",!0)]),e("div",Ve,[e("button",{type:"button",class:"flex h-[35px] w-max min-w-[70px] items-center gap-2 rounded-[5px] px-[10px] text-[13px] text-[#e01249] outline-none","data-test":"cancel-button",onClick:o[5]||(o[5]=d=>n(q).get(n(_)("events.settings.fieldLimits.index",{event:i.event}))),textContent:l(s.$t("common.cancel"))},null,8,je),e("button",{type:"submit",disabled:n(t).processing,class:k(["h-[35px] min-w-[70px] rounded-[5px] bg-primary px-[25px] text-[13px] text-white outline-none"]),"data-test":"submit-button"},[n(t).processing?(a(),$(U,{key:0,icon:["fal","spinner"],class:"text-sm text-white",spin:""})):(a(),r("span",{key:1,textContent:l(s.$t("common.save"))},null,8,Ue))],8,Ie)])],32)])])])}}};export{Oe as default};
2//# sourceMappingURL=Create-TXO8m1W1.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.