1import{P as p,u as g,a as D}from"./app-Dz29Y-_o.js";import{_ as h,b as F,B as N,u as R,T as A,M as P}from"./TheLayout-7CxdW8xd.js";import{P as m,D as q,_ as E,b as I,v as _,h as r,y as f,E as S,w as k,i as L,t as n,u as e,l as M,f as b,g as O,r as T}from"./vendor-CmvP_IxA.js";import{R as $}from"./ResourceWithFeaturesCard-h4GRV1-L.js";import"./vendor-toast-BZnr3OGI.js";import"./vendor-tippy-Cx0C5gxh.js";import"./init-analytics-DgC8uJlS.js";import"./ResourceFeatures-DrZ25jv6.js";import"./AvailableLabel-D99PL8Rx.js";import"./CircleIcon-BUZdNZtS.js";import"./date-jIVG4UNH.js";import"./LocationIcon-pUseWnei.js";import"./transport-type-B7QzNzeU.js";import"./TruckIcon-b4DGz3lX.js";const j=()=>({create:async(a,t)=>(await axios.post(p("sample.store",{resource:a}),t)).data}),U={class:"sample__inputs"},W={__name:"SampleForm",props:{resource:{type:Object,required:!0},addresses:{type:Array,default:()=>[]}},emits:["onSubmit"],setup(s,{emit:a}){const{t}=g(),c=j(),i=D(),u=a,y=s,d=m({}),o=m(!1),v=m(),V=q(()=>[{name:"address_id",required:!0,type:"address",label:t("address"),hideLabel:!0,options:y.addresses,rules:E()}]),x=async()=>{if(!(o.value||!await v.value.isValid()))try{o.value=!0;const l=await c.create(y.resource.id,{...d.value});u("onSubmit",l.order.id)}catch(l){console.error(l),i.error(t("error"))}finally{o.value=!1}},B=()=>S.reload({only:["addresses"]});return(w,l)=>(_(),I("form",{novalidate:"",class:"sample",onSubmit:M(x,["prevent"])},[r("div",U,[f(F,{ref_key:"inputsRef",ref:v,modelValue:d.value,"onUpdate:modelValue":l[0]||(l[0]=C=>d.value=C),loading:o.value,"input-definitions":V.value,onRefreshAddresses:B},null,8,["modelValue","loading","input-definitions"])]),f(N,{loading:o.value,disabled:o.value,type:"submit",class:"sample__button"},{default:k(()=>[L(n(e(t)("sample_create_action")),1)]),_:1},8,["loading","disabled"])],32))}},z=h(W,[["__scopeId","data-v-8c651f36"]]),G={class:"sample__card"},H={class:"sr-only"},J={class:"sample__container"},K={class:"sample__title"},Q={class:"heading--4"},X={class:"body-text--sm"},Y={__name:"CreateSamplePage",props:{resource:{type:Object,required:!0},addresses:{type:Array,default:()=>[]}},setup(s){const{t:a}=g(),{isComputer:t}=R();return(c,i)=>(_(),b(T(e(t)?A:P),{"button-link":e(p)("resource.view",{slug:s.resource.slug,categorySlug:s.resource.category.slug,subcategorySlug:s.resource.subcategory.slug}),"header-title":e(a)("sample_create_title"),class:"sample",background:e(t)?"grey":null,"back-button":"",sticky:""},{default:k(()=>[r("div",G,[r("h1",H,n(e(a)("sample_create_title")),1),r("div",J,[e(t)?(_(),b($,{key:0,resource:s.resource,class:"sample__resource"},null,8,["resource"])):O("",!0),r("div",null,[r("header",K,[r("h2",Q,n(e(a)("sample_create_address")),1),r("div",X,n(e(a)("sample_create_address_hint")),1)]),f(z,{class:"sample__form",resource:s.resource,addresses:s.addresses,onOnSubmit:i[0]||(i[0]=u=>e(S).visit(e(p)("cart.order.confirm",{id:u})))},null,8,["resource","addresses"])])])])]),_:1},8,["button-link","header-title","background"]))}},pe=h(Y,[["__scopeId","data-v-61aeae49"]]);export{pe 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.