PageSourceSearch

https://www.iswari.com/_nuxt/DI3JbxhU.js

js iswari.com collected 2026-10-03 21:18:54 UTC 6,323 bytes, 1 lines download raw bytes

1import{U as T,d as j,D as U,a5 as R,e as F,c as z,r as b,o as H,G,j as n,m as c,q as r,k as i,l as E,I as K,n as e,p as _,v as o,x as p,F as v,z as y,A as J,T as I,S as Q,C as W}from"#entry";import{I as k}from"./6CfiZuU-.js";import{u as X}from"./CNPYaZ7N.js";import{u as Y}from"./i9lUt7Fq.js";import{buildCsrfHeaders as Z}from"./2LkvLMTB.js";import{S as x,a as ee}from"./BLayULwm.js";import{u as te}from"./Di1HVPD4.js";import"./BXbXQwXt.js";import"./f1skldu7.js";import"./D3qEf_Sw.js";const se=T("/img/icons/reorder.svg"),oe={key:0,class:"floating-orders-wrapper"},ae={key:1,class:"mobile-orders-section show-mobile"},ie={class:"modal-title mobile-title"},ne={class:"floating-order-card mt-2"},re={class:"floating-order-card__header"},le={class:"floating-order-card__left"},de={class:"floating-order-card__right"},ce=["onClick"],ue={class:"floating-order-card__price"},_e={class:"floating-order-card__image"},he=["src","alt"],fe={class:"floating-order-card__name"},me={class:"floating-order-card__weight"},ge={class:"floating-order-card__qty"},pe=["onClick","disabled"],ve={class:"hide-mobile"},ye={key:0,class:"side-modal-small"},we={class:"modal-header"},be={class:"modal-title"},ke={class:"modal-content"},$e={key:0,class:"no-orders"},Ce={class:"floating-order-card__header"},Se={class:"floating-order-card__left"},Oe={class:"floating-order-card__right"},Ae=["onClick"],Be={class:"floating-order-card__price"},Fe={class:"floating-order-card__image"},Ee=["src","alt"],Ie={class:"floating-order-card__name"},Ne={class:"floating-order-card__weight"},Le={class:"floating-order-card__qty"},Ve=["onClick","disabled"],qe=j({__name:"FloatingOrdersCard",props:{isMobile:{type:Boolean,default:!1}},setup(De){const $=X(),N=U().$apiNativeFetch,{isLoggedIn:m}=R($),{currentLocale:L,storeCode:V}=te(),C="https://www.iswari.com",q={slidesPerView:1.1,spaceBetween:10,navigation:!1,pagination:!1,breakpoints:{769:{slidesPerView:2,spaceBetween:16}}},{data:D,refresh:M}=Y(()=>`user-last-orders-${String(L.value)}-${String(V.value||"")}-${String($.user?.id||"guest")}`,()=>`${C}/api/v1/user/last-orders`,{watch:[m],immediate:!0,enabled:m});F(m,t=>{t&&M()});const h=z(()=>D.value?.orders||[]),g=b([]);function S(t){const l=g.value.indexOf(t);l===-1?g.value.push(t):g.value.splice(l,1)}function f(t){return g.value.includes(t)}function O(t){return f(t.id)?t.items:t.items.slice(0,2)}const d=b(!1);function P(){d.value=!d.value}function w(){d.value=!1}const u=b(null);async function A(t){if(!u.value){u.value=t;try{const l=await Z(),s=await N(`${C}/api/v1/user/orders/${t}/duplicate`,{method:"POST",headers:{Accept:"application/json",...l},credentials:"include"});if(s.ok){const a=await s.json().catch(()=>({}));typeof window<"u"&&a.redirect_url&&(window.location.href=a.redirect_url)}else console.error("Failed to duplicate order")}catch(l){console.error("Error duplicating order:",l)}finally{u.value=null}}}function B(t){t.key==="Escape"&&d.value&&w()}return F(d,t=>{typeof document<"u"&&(document.body.style.overflow=t?"hidden":"")}),H(()=>{typeof document<"u"&&document.addEventListener("keydown",B)}),G(()=>{typeof document<"u"&&(document.body.style.overflow="",document.removeEventListener("keydown",B))}),(t,l)=>r(m)?(i(),n("div",oe,[r(h).length>0?(i(),n("aside",{key:0,class:K(["floating-left-cards hide-mobile",{"modal-open-shift":d.value}]),"aria-label":"Ações rápidas"},[e("button",{class:"floating-card","aria-label":"Ver últimas encomendas",onClick:P},[...l[0]||(l[0]=[e("img",{src:se,alt:"Reorder Icon"},null,-1)])])],2)):c("",!0),r(h).length>0?(i(),n("div",ae,[e("h3",ie,o(t.$t("home.last_orders")),1),_(r(ee),J(q,{class:"mobile-orders-swiper"}),{default:p(()=>[(i(!0),n(v,null,y(r(h),s=>(i(),E(r(x),{key:s.id},{default:p(()=>[e("div",ne,[e("div",re,[e("div",le,[e("strong",null,"Nº #"+o(s.number),1),e("span",null,o(s.date),1)]),e("div",de,[s.items.length>2?(i(),n("div",{key:0,class:"floating-order-card__articles",onClick:a=>S(s.id),style:{cursor:"pointer"}},[_(r(k),{icon:f(s.id)?"heroicons:eye-slash":"heroicons:eye",width:"18",height:"18","aria-hidden":"true"},null,8,["icon"]),e("span",null,o(f(s.id)?`- ${t.$t("home.articles")}`:`+ ${t.$t("home.articles")}`),1)],8,ce)):c("",!0),e("div",ue,o(s.total),1)])]),(i(!0),n(v,null,y(O(s),a=>(i(),n("div",{key:a.id,class:"floating-order-card__item"},[e("div",_e,[e("img",{src:a.image,alt:a.name},null,8,he)]),e("div",fe,o(a.name),1),e("div",me,o(a.weight),1),e("div",ge,o(a.qty)+" "+o(t.$t("home.unit_short")),1)]))),128)),e("button",{class:"floating-order-card__button",type:"button",onClick:a=>A(s.id),disabled:u.value===s.id},o(u.value===s.id?t.$t("home.adding"):t.$t("home.order_again")),9,pe)])]),_:2},1024))),128))]),_:1},16)])):c("",!0),(i(),E(Q,{to:"body"},[e("div",ve,[_(I,{name:"fade"},{default:p(()=>[d.value?(i(),n("div",{key:0,class:"modal-overlay",onClick:w})):c("",!0)]),_:1}),_(I,{name:"slide"},{default:p(()=>[d.value?(i(),n("div",ye,[e("div",we,[e("h3",be,o(t.$t("home.last_orders")),1),e("button",{class:"close-btn",onClick:w,"aria-label":"Fechar"},[_(r(k),{icon:"heroicons:x-mark",width:"22",height:"22"})])]),e("div",ke,[r(h).length===0?(i(),n("div",$e,o(t.$t("home.no_orders_found")),1)):c("",!0),(i(!0),n(v,null,y(r(h),s=>(i(),n("div",{key:s.id,class:"floating-order-card"},[e("div",Ce,[e("div",Se,[e("strong",null,"Nº #"+o(s.number),1),e("span",null,o(s.date),1)]),e("div",Oe,[s.items.length>2?(i(),n("div",{key:0,class:"floating-order-card__articles",onClick:a=>S(s.id),style:{cursor:"pointer"}},[_(r(k),{icon:f(s.id)?"heroicons:eye-slash":"heroicons:eye",width:"18",height:"18","aria-hidden":"true"},null,8,["icon"]),e("span",null,o(f(s.id)?`- ${t.$t("home.articles")}`:`+ ${t.$t("home.articles")}`),1)],8,Ae)):c("",!0),e("div",Be,o(s.total),1)])]),(i(!0),n(v,null,y(O(s),a=>(i(),n("div",{key:a.id,class:"floating-order-card__item"},[e("div",Fe,[e("img",{src:a.image,alt:a.name},null,8,Ee)]),e("div",Ie,o(a.name),1),e("div",Ne,o(a.weight),1),e("div",Le,o(a.qty)+" "+o(t.$t("home.unit_short")),1)]))),128)),e("button",{class:"floating-order-card__button",type:"button",onClick:a=>A(s.id),disabled:u.value===s.id},o(u.value===s.id?t.$t("home.adding"):t.$t("home.order_again")),9,Ve)]))),128))])])):c("",!0)]),_:1})])]))])):c("",!0)}}),Je=Object.assign(W(qe,[["__scopeId","data-v-f7546056"]]),{__name:"UiFloatingOrdersCard"});export{Je 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.