PageSourceSearch

https://www.graodireto.com.br/_next/static/chunks/pages/web-app/ma…/sales-offers/create-abbcfd80d7b0041c.js

js graodireto.com.br collected 2026-09-24 10:16:21 UTC 11,916 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2826],{45354:(e,a,t)=>{"use strict";t.r(a),t.d(a,{__N_SSP:()=>J,default:()=>K});var i=t(23798),r=t(92191),n=t(12954),l=t(91755),s=t(37642),o=t(2531),c=t(64106),d=t(89590),u=t(83440),p=t(24296),m=t(78722),f=t(76159),h=t(76460),x=t(89509),y=t(14948),g=t(21462),j=t(532),b=t(64004),v=t(5303),C=t(73586),S=t(12030);function w(e){let{userCityId:a}=e,[t,r]=(0,g.useState)(""),{getValues:n,trigger:l}=(0,j.xW)(),{setEventOccurrence:s}=(0,m.X)(),{setPreviousStep:c}=(0,p.sd)(),{data:d}=(0,o.lh)({name:t}),u=async()=>{let e=await l("city");s(f.F.SalePMCEditCity,{cityId:n("city.id")}),e&&c()},h=async e=>{"Enter"===e.key&&(e.preventDefault(),await u())};return(0,g.useEffect)(()=>{s(f.F.SaleReducedCity)},[s]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(C.a,{children:[(0,i.jsx)(C.a.Title,{children:"Cidade"}),(0,i.jsx)(C.a.Subheading,{children:"Selecione a cidade"})]}),(0,i.jsx)(S.j,{name:"city",placeholder:"Cidade",listLikeButton:!0,onChange:r,onKeyDown:h,trigger:u,options:(null!=d?d:[]).map(e=>({id:e.id,label:"".concat(e.name," - ").concat(e.state),value:{id:e.id,region:{id:e.region.id,name:e.region.name}},tag:"".concat(e.id===a?"Minha cidade":""),suggestion:e.id===a}))})]})}var I=t(64648),N=t(14804),T=t(92121),E=t(6648),P=t(10210),k=t(47835),D=t(21299),M=function(e){return e.MODALITY="MODALITY",e.CITY="CITY",e.QUANTITY="QUANTITY",e.PRICE="PRICE",e.DOCUMENT="DOCUMENT",e}({});function A(e){let{enabledProducts:a}=e,[t,r]=(0,g.useState)(!1),{setValue:n,watch:l}=(0,j.xW)(),{setEventOccurrence:s}=(0,m.X)(),{setStepByKey:o}=(0,p.sd)(),c=(0,D.useSearchParams)(),d=l("city");return(0,g.useEffect)(()=>{n("modality",null),n("futureModalityDate",null),n("quantity",""),n("price","")},[n]),(0,g.useEffect)(()=>{(null==c?void 0:c.get("source"))===P.X.WHATSAPP&&s(f.F.WppSalePMC),s(f.F.SalePMC)},[c,s]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(C.a,{children:(0,i.jsx)(C.a.Subheading,{children:"Procurar ofertas em:"})}),(0,i.jsx)(T.$,{size:"sm",intent:"secondary",leftIcon:k.A,onClick:()=>{o(M.CITY)},children:d.label}),(0,i.jsx)("h2",{className:"mt-4 text-mobile-subheading-2 font-semibold",children:"Qual gr\xe3o voc\xea quer vender?"}),(0,i.jsx)(N.i,{enabledProducts:a,offerType:"sale",onSelectModality:(e,a,t)=>{let{transactionTypeId:i,isFuture:l}=e;n("modality",{isFuture:l,productId:a,productName:t,transactionTypeId:i}),s(f.F.SalePMCSelectModality,{transactionTypeId:i,cityId:d.id}),l?r(!0):o(M.QUANTITY)}}),(0,i.jsx)(I.w,{offerType:E.p.SALE,open:t,onClose:()=>r(!1),onSelect:()=>o(M.QUANTITY)})]})}var F=t(39863),R=t(88661),_=t(54492),O=t(29032);function Y(e){var a,t;let{isLoading:r,quotationsData:n,userHasDocument:l}=e,{getValues:s,trigger:o}=(0,j.xW)(),{setEventOccurrence:c}=(0,m.X)(),{setNextStep:d}=(0,p.sd)(),{city:u,modality:h}=s(),x=()=>c(f.F.SellerReducedInsertPrice,{price:s("price")}),y=async()=>{let e=await o("price");x(),e&&d()},b=async e=>{"Enter"!==e.key||l||(e.preventDefault(),await y())};return(0,g.useEffect)(()=>{c(f.F.SellerReducedPrice)},[c]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(C.a,{children:[(0,i.jsx)(C.a.Title,{children:"Pre\xe7o"}),(0,i.jsx)(C.a.Subheading,{children:"Informe o pre\xe7o inicial por saca."})]}),(0,i.jsxs)(_.p.Field,{children:[(0,i.jsx)(_.p.Entry,{name:"price",placeholder:"Pre\xe7o inicial por saca",inputMode:"decimal",mask:[{mask:"R$ num",blocks:{num:{mask:Number,thousandsSeparator:".",radix:",",scale:2,mapToRadix:[",","."]}},lazy:!0,placeholderChar:"0",autofix:!0,prefix:"R$ "}],onKeyDown:b}),(0,i.jsx)(_.p.Errors,{field:"price"})]}),(null==h?void 0:h.productName)&&(null==u||null==(t=u.value)||null==(a=t.region)?void 0:a.name)&&n&&(0,i.jsx)(F.k,{productName:h.productName,regionName:u.value.region.name,quotationsData:n}),(0,i.jsxs)("div",{className:"flex flex-col gap-6 max-md:mt-auto",children:[(0,i.jsx)(R.J,{}),l?(0,i.jsx)(T.$,{fill:!0,size:"sm",type:"submit",disabled:r,onClick:x,children:r?(0,i.jsx)(O.A,{color:"gray"}):"Negociar"}):(0,i.jsx)(T.$,{fill:!0,size:"sm",type:"button",onClick:y,children:"Pr\xf3ximo"})]})]})}function q(){let{getValues:e,trigger:a}=(0,j.xW)(),{setEventOccurrence:t}=(0,m.X)(),{setNextStep:r}=(0,p.sd)(),n=async()=>{let i=await a("quantity");t(f.F.SellerReducedInsertQuantity,{quantity:e("quantity")}),i&&r()},l=async e=>{"Enter"===e.key&&(e.preventDefault(),await n())};return(0,g.useEffect)(()=>{t(f.F.SellerReducedQuantity)},[t]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(C.a,{children:[(0,i.jsx)(C.a.Title,{children:"Quantidade"}),(0,i.jsx)(C.a.Subheading,{children:"Informe a quantidade de sacas que voc\xea deseja vender."})]}),(0,i.jsxs)(_.p.Field,{children:[(0,i.jsx)(_.p.Entry,{name:"quantity",placeholder:"Quantidade de sacas",inputMode:"numeric",mask:[{mask:Number,scale:0,thousandsSeparator:"."}],maxLength:8,onKeyDown:l}),(0,i.jsx)(_.p.Errors,{field:"quantity"})]}),(0,i.jsx)(T.$,{fill:!0,size:"sm",type:"button",onClick:n,className:"max-md:mt-auto",children:"Pr\xf3ximo"})]})}var L=t(77109),U=t(42488);let Q=U.Ik({modality:U.Ik({isFuture:U.zM(),productId:U.ai(),productName:U.Yj(),transactionTypeId:U.ai()}).nullable().refine(e=>null!==e,{message:"\xc9 obrigat\xf3rio selecionar uma modalidade"}),quantity:U.Yj().transform(e=>Number(e.replace(/\./g,""))).refine(e=>e>=200,{message:"Quantidade m\xednima: 200 sacas"}),city:U.Ik({id:U.ai(),label:U.Yj(),value:U.Ik({region:U.Ik({id:U.ai(),name:U.Yj()})})},{errorMap:()=>({message:"\xc9 obrigat\xf3rio selecionar uma cidade"})}),price:U.Yj().transform(e=>Number(e.replace("R$","").trim().replace(/\./g,"").replace(",","."))).refine(e=>e>0,{message:"\xc9 obrigat\xf3rio informar um pre\xe7o"}),futureModalityDate:U.p6().nullable(),document:U.Yj().regex(/([0-9]{3}[\.]?[0-9]{3}[\.]?[0-9]{3}[-]?[0-9]{2})/,"Insira um CPF v\xe1lido").length(14,"Insira um CPF v\xe1lido").refine(e=>
1L.A.isValid(e),{message:"Insira um CPF v\xe1lido"}).optional()}).refine(e=>{var a;return null==(a=e.modality)||!a.isFuture||null!==e.futureModalityDate},{path:["futureModalityDate"],message:"\xc9 obrigat\xf3rio informar a data da modalidade futura"});function X(e){let{enabledProducts:a,hasActiveSaleOffer:t,userProfile:r}=e,{step:C,setPreviousStep:S}=(0,p.sd)(),[I,N]=(0,g.useState)(!1),{setEventOccurrence:T}=(0,m.X)(),E=(0,y.useRouter)(),P=(0,j.mN)({resolver:(0,x.u)(Q),defaultValues:{modality:null,city:{id:r.city.id,label:"".concat(r.city.name," - ").concat(r.city.state),value:{region:{id:r.city.region.id,name:r.city.region.name}}},futureModalityDate:null,quantity:"",price:""}}),[k,D]=P.watch(["city.value.region.id","modality.transactionTypeId"]),{quotationsData:F}=(0,s.B)({regionId:k,transactionTypeId:D}),{mutateAsync:R,isLoading:_}=(0,c.vu)(),{mutateAsync:O,isLoading:L}=(0,o.H6)(),U=(0,h.Z)(r),X=async()=>{let e="gd-vip"===E.query.from;return C===M.MODALITY?e?E.push("/web-app/gd-vip?activePanel=".concat(l.w.OFFERS,"&activeTab=quero-vender")):t?E.push("/web-app/marketplace/sales-offers"):E.push("/web-app"):C!==M.CITY||await P.trigger("city")?S():void 0},W=async e=>{try{if(e.document){let a=await O(e.document);if(null==a?void 0:a.hasUserBeenDisabled)return void N(!0)}let a={productId:e.modality.productId,transactionTypeId:e.modality.transactionTypeId,quantity:e.quantity,cityId:e.city.id,price:e.price,futureModalityDate:e.futureModalityDate},t=await R(a);t&&E.push("/web-app/marketplace/sales-matchmaking/".concat(t.id))}catch(e){b.Ay.error("Erro ao criar oferta de venda!",{id:"create-sale-offer-error"}),t?E.push("/web-app/marketplace/sales-offers"):E.push("/web-app")}},$=L||_;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(v.r,{titlePage:"Quero vender",backAction:X}),(0,i.jsx)(j.Op,{...P,children:(0,i.jsxs)("form",{onSubmit:P.handleSubmit(W),className:"flex w-full max-w-3xl grow flex-col gap-4 self-center p-6",children:[(0,i.jsx)(u.C.Step,{step:M.MODALITY,children:(0,i.jsx)(A,{enabledProducts:a})}),(0,i.jsx)(u.C.Step,{step:M.CITY,children:(0,i.jsx)(w,{userCityId:r.city.id})}),(0,i.jsx)(u.C.Step,{step:M.QUANTITY,children:(0,i.jsx)(q,{})}),(0,i.jsx)(u.C.Step,{step:M.PRICE,children:(0,i.jsx)(Y,{isLoading:$,quotationsData:F,userHasDocument:U})}),(0,i.jsx)(u.C.Step,{step:M.DOCUMENT,children:(0,i.jsx)(n.d.Form,{isLoading:$,handleSubmitButtonClick:()=>{T(f.F.SellerReducedSubmitCpf)},pageViewEvent:f.F.SellerReducedCpf})})]})}),(0,i.jsx)(d.$,{isOpenModal:I,closeModal:()=>{N(!1),E.push("/web-app/configuracoes/minha-conta")}})]})}var W=t(41074),$=t(80055),z=t(54741),B=t(95975),H=t.n(B),J=!0;function K(e){let{offers:a,isFromGdVip:t,userProfile:n}=e,[l,s]=(0,g.useState)(t),{setEventOccurrence:o}=(0,m.X)(),{getRemoteConfigObject:c}=(0,W.Cm)(),d=(0,z.O)(),u=(0,y.useRouter)(),h=c($.ai.WEB_APP_REDUCED_JOURNEY_ENABLED_PRODUCTS),x=n.admin?h:null==h?void 0:h.filter(e=>!e.onlyAdmin),j=void 0!==x;return(0,g.useEffect)(()=>{u.query.source===P.X.WHATSAPP&&o(f.F.WppSellerJourneyCity),d("graodiretoapp://www.graodireto.com.br/home/load-marketplace",()=>{})},[d,u.query.source,o]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(H(),{children:[(0,i.jsx)("title",{children:"Gr\xe3o Direto | Pre\xe7os m\xe9dios, cota\xe7\xf5es, compra e venda de Milho, Soja, Sorgo e outros gr\xe3os!"}),(0,i.jsx)("link",{rel:"shortcut icon",type:"image/x-icon",href:"/assets/favicon.ico"})]}),j?(0,i.jsxs)(p.Pm,{steps:M,children:[(0,i.jsx)(X,{enabledProducts:x,hasActiveSaleOffer:a.length>0,userProfile:n}),(0,i.jsx)(r.I,{isOpen:l,toggleIsModalOpen:()=>s(!l),offerTypeToSee:"purchase"})]}):(0,i.jsx)(O.A,{containerClassName:"grow"})]})}},46779:(e,a,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/web-app/marketplace/sales-offers/create",function(){return t(45354)}])},84268:(e,a,t)=>{"use strict";t.d(a,{A:()=>l});var i,r=t(21462);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var i in t)({}).hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(null,arguments)}let l=function(e){return r.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),i||(i=r.createElement("path",{fill:"#303030",fillRule:"evenodd",d:"M22.442 15.953 15.436 3.978a3.974 3.974 0 0 0-6.873 0l-7.008 11.98a4.007 4.007 0 0 0 3.419 6.04h14.038a4.005 4.005 0 0 0 3.43-6.045m-19.164 1.02 7.013-11.988a1.976 1.976 0 0 1 3.416-.003l7.01 11.985a2.007 2.007 0 0 1-1.714 3.031H4.983a2.004 2.004 0 0 1-1.705-3.024M12 17.999a1 1 0 1 0 0-2 1 1 0 0 0 0 2m1.004-10h-2.001v7h2z",clipRule:"evenodd"})))}},89590:(e,a,t)=>{"use strict";t.d(a,{$:()=>m});
1var i=t(23798),r=t(78244),n=t(92121),l=t(41074),s=t(80055),o=t(78722),c=t(76159),d=t(84268),u=t(58067),p=t(14948);function m(e){let{isOpenModal:a,closeModal:t}=e,{getRemoteConfigObject:m}=(0,l.Cm)(),{setEventOccurrence:f}=(0,o.X)(),h=(0,p.useRouter)(),x=m(s.ai.DISABLED_USER_WARNING_ALERT_CONTENT);return(0,i.jsxs)(r.a,{open:a,closeModal:t,type:(0,u.a)()?"vertical":"floating",showCloseIcon:!0,children:[(0,i.jsx)("div",{className:"flex justify-center",children:(0,i.jsx)("div",{className:"flex h-[100px] w-[100px] items-center justify-center rounded-full bg-status-alert bg-opacity-20",children:(0,i.jsx)(d.A,{className:"h-[60px] w-[60px] [&_*]:fill-status-alert"})})}),(0,i.jsx)("h1",{className:"px-6 py-3 text-center text-mobile-title font-semibold",children:x.title||"Conta Desabilitada"}),(0,i.jsx)("div",{className:"px-6 py-3",children:(0,i.jsx)("div",{className:"mt-3 flex",children:(0,i.jsx)("p",{className:"text-center text-mobile-subheading-2",children:x.body||"Para habilitar sua conta realize a verifica\xe7\xe3o de identidade e continue negociando com seguran\xe7a."})})}),(0,i.jsx)("div",{className:"flex flex-col px-6 py-3",children:(0,i.jsx)(n.$,{intent:"primary",onClick:()=>{f(c.F.DisabledUserAlertFaceMatch),t(),h.push("/web-app/face-match")},children:x.buttonText||"Habilitar conta"})})]})}}},e=>{e.O(0,[4343,2064,532,4690,4478,1100,9323,1299,4350,2576,9145,7214,6299,5303,1725,8545,5963,86,1671,636,6593,8792],()=>e(e.s=46779)),_N_E=e.O()}]);

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.