PageSourceSearch

https://store.gemnote.com/_nuxt/BbQ9sR2d.js

js gemnote.com collected 2026-10-02 06:15:43 UTC 4,395 bytes, 1 lines download raw bytes

1import{_ as P,e as T,r as h,x as E,d,c as m,o as f,a as e,i as v,h as s,p as _,f as b,k as w,D as B,v as D,aB as k,aM as F,A as V,j as I}from"./SuPpnckH.js";import{u as O,a as U,R as H}from"./CXPEL8V5.js";import{u as G}from"./Dp2UzT0L.js";import"./W9H1toHc.js";import"./JiKMaLLI.js";import"./BU1Wq2eS.js";import"./jdmn6HMp.js";import"./QVoDY9p2.js";const K={"data-testid":"redemption-create-page"},j={key:0,class:"trending-container","data-testid":"step-1-container"},q={class:"form-holder mb-0 flex flex-col md:flex-row"},J={class:"form-input form-input-value"},L={class:"form-input-value input-value"},Q={key:0,class:"trending-container","data-testid":"step-2-container"},W={class:"form-holder mb-5 flex flex-col md:flex-row gap-4"},X={class:"form-input form-input-value"},Y={class:"form-input-value input-value w-max flex gap-4 flex-wrap items-center"},Z={class:"toggle-button","data-testid":"show-prices-toggle"},$={class:"margin-top-2"},ee={class:"form-holder flex flex-col md:flex-row gap-4"},te={class:"form-input form-input-value"},ae={class:"form-input-value input-value w-max flex flex-wrap xl:flex-nowrap gap-4 items-center"},se=["checked","disabled"],ie={__name:"index",setup(ne){T({title:"Create Redemption"});const i=O(),n=U(),u=i.redemptionId,y=i.currentStep,R=i.isEditMode,{redemption:c}=G(u),o=h(""),l=h(null);E(c,a=>{a&&(o.value||(o.value=a.name||""),l.value===null&&(l.value=a.showPrices??!0))},{immediate:!0});const r=d(()=>y.value),S=d(()=>r.value===1?"Redemption page name":"General Settings"),z=d(()=>r.value===1?R.value?"Update redemption page":"Create a new redemption page":"Set up initial configurations"),N=d(()=>{switch(c.value?.state){case"auto_finalising":case"validating_recipients":case"validating_subscription":return!0;default:return!1}}),g=d(()=>{const a=c.value?.state;return!a||a==="lock_finalisation"?!0:a==="pending"||a==="auto_finalising"}),A=d(()=>n.isCreating.value||n.isUpdating.value);async function x(){try{if(r.value===1)if(u.value)await n.updateRedemption(u.value,{name:o.value})&&i.next();else{const a=await n.createRedemption({name:o.value,showPrices:l.value});a?.id&&i.next(a.id)}else await n.updateRedemption(u.value,{name:o.value,showPrices:l.value})&&i.next()}catch{}}function C(){i.prev()}async function M(a){const t=a.target.checked;await n.toggleAutoFinalize(u.value,t)}return(a,t)=>(f(),m("div",K,[t[10]||(t[10]=e("h2",{class:"page-titles","data-testid":"page-title"},"REDEMPTION PAGE",-1)),v(H,{title:s(z),"header-text":s(S),"current-step":s(r),"is-submitting":s(A),onOnPrevStep:C,onOnNextStep:x},null,8,["title","header-text","current-step","is-submitting"]),v(k,{name:"slide-fade"},{default:_(()=>[s(r)===1?(f(),m("div",j,[e("div",q,[t[3]||(t[3]=e("div",{class:"form-label"},[e("p",null,[e("strong",null,"Page Name*")]),e("span",null,"Required.")],-1)),e("div",J,[e("div",L,[w(e("input",{"onUpdate:modelValue":t[0]||(t[0]=p=>o.value=p),autocomplete:"off",placeholder:"e.g., Holiday Swag or Employee Appreciation.",type:"text",class:"form-control redemption-input","data-testid":"name-input",onKeyup:B(x,["enter"])},null,544),[[D,o.value]])])])])])):b("",!0)]),_:1}),v(k,{name:"slide-fade"},{default:_(()=>[s(r)===2?(f(),m("div",Q,[e("div",W,[t[6]||(t[6]=e("div",{class:"form-label"},[e("p",null,[e("strong",null,"Show prices.")])],-1)),e("div",X,[e("div",Y,[e("label",Z,[w(e("input",{"onUpdate:modelValue":t[1]||(t[1]=p=>l.value=p),type:"checkbox","data-testid":"show-prices-checkbox"},null,512),[[F,l.value]]),t[4]||(t[4]=e("span",{class:"toggle-slider round"},null,-1))]),t[5]||(t[5]=e("span",{class:"text-xs"},"Display product prices on redemption page.",-1))])])]),e("div",$,[e("div",ee,[t[9]||(t[9]=e("div",{class:"form-label"},[e("p",null,[e("strong",null,"Auto-finalize")])],-1)),e("div",te,[e("div",ae,[e("label",{class:V(["toggle-button",{"toggle-button--disabled":!s(g)}]),"data-testid":"auto-finalize-toggle"},[e("input",{type:"checkbox",checked:s(N),disabled:!s(g)||s(n).isTogglingAutoFinalize.value,"data-testid":"auto-finalize-checkbox",onClick:t[2]||(t[2]=I(p=>M(p),["prevent"]))},null,8,se),t[7]||(t[7]=e("span",{class:"toggle-slider round"},null,-1))],2),t[8]||(t[8]=e("span",{class:"text-xs"}," Orders are created instantly as submissions are received, and no further action on orders can be taken if enabled. ",-1))])])])])])):b("",!0)]),_:1})]))}},fe=P(ie,[["__scopeId","data-v-5dd51aba"]]);export{fe 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.