PageSourceSearch

https://orygofrontend-production.up.railway.app/_next/static/chunks/pages/form/[agent_id]-500136e62d667516.js

js orygofrontend-production.up.railway.app collected 2026-10-03 12:15:27 UTC 10,133 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4202],{8641:(e,t,r)=>{"use strict";r.d(t,{S:()=>a,f:()=>i});let[a,i]=(0,r(31889).q)({name:"FieldContext",hookName:"useFieldContext",providerName:"<FieldProvider />",strict:!1})},25915:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSP:()=>v,default:()=>y});var a=r(37876),i=r(43123),n=r(95563),o=r(39822),s=r(30488),l=r(66134),d=r(14232),c=r(89099),u=r(77328),m=r.n(u),h=r(80161),g=r(12647),f=r(53602),p=r(70294);let w=()=>(0,a.jsxs)(m(),{children:[(0,a.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content"}),(0,a.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n  .orygo-form-fullheight {\n    height: 100vh;\n    height: 100svh;\n    height: 100dvh;\n  }\n  .orygo-form-min-fullheight {\n    min-height: 100vh;\n    min-height: 100svh;\n    min-height: 100dvh;\n  }\n  html, body {\n    overscroll-behavior: none;\n    -webkit-text-size-adjust: 100%;\n    text-size-adjust: 100%;\n  }\n"}})]});var v=!0;function y(){let e=(0,c.useRouter)(),t=e.query.agent_id||void 0,r=e.query.config||void 0,l=r?function(e){try{return JSON.parse(decodeURIComponent(e))}catch(e){return null}}(r):null,[u,m]=(0,d.useState)(null),[h,v]=(0,d.useState)(!l),[y,b]=(0,d.useState)(!1),[x,j]=(0,d.useState)(!1),[_,E]=(0,d.useState)(!1),F=l||u;(0,d.useEffect)(()=>{!l&&t&&(v(!0),fetch("".concat("https://orygobackend-production.up.railway.app","/fetch_form_config/").concat(t)).then(e=>{if(!e.ok)throw Error("Failed to fetch");return e.json()}).then(e=>{m(e.data),v(!1)}).catch(()=>{b(!0),v(!1)}))},[t,l]),(0,d.useEffect)(()=>{let e=e=>{var t;(null==(t=e.data)?void 0:t.type)==="form-reset"&&E(!1)};return window.addEventListener("message",e),window.parent&&window.parent!==window&&window.parent.postMessage({type:"form-ready"},"*"),()=>window.removeEventListener("message",e)},[]);let N=(0,d.useCallback)(async e=>{if(t){j(!0);try{var r;let a={...e,images:null==(r=e.images)?void 0:r.map(f.vz)},i=await fetch("".concat("https://orygobackend-production.up.railway.app","/submit_form/").concat(t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e.detail||"Submission failed")}E(!0),window.parent&&window.parent!==window&&window.parent.postMessage({type:"form-submitted"},"*")}catch(e){console.error("Form submission failed:",e)}finally{j(!1)}}},[t]);if(!e.query.agent_id)return null;if(h)return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w,{}),(0,a.jsx)(i.s,{className:"orygo-form-fullheight",width:"100vw",alignItems:"center",justifyContent:"center",bg:"white",children:(0,a.jsx)(n.y,{size:"lg",color:(null==F?void 0:F.color)||"blue.500"})})]});if(y||!F)return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w,{}),(0,a.jsx)(i.s,{className:"orygo-form-fullheight",width:"100vw",alignItems:"center",justifyContent:"center",bg:"white",p:6,textAlign:"center",children:(0,a.jsxs)(o.a,{children:[(0,a.jsx)(s.E,{fontSize:"md",fontWeight:"bold",color:"gray.800",children:"Form unavailable"}),(0,a.jsx)(s.E,{fontSize:"sm",color:"gray.500",mt:2,children:"Please try again later"})]})})]});let S=F.color||"#4206E4";return _?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w,{}),(0,a.jsx)(i.s,{className:"orygo-form-min-fullheight",width:"100%",alignItems:"center",justifyContent:"center",bg:"white",p:6,children:(0,a.jsxs)(o.a,{textAlign:"center",maxW:"400px",children:[(0,a.jsx)(o.a,{w:14,h:14,borderRadius:"full",bg:"".concat(S,"1A"),display:"flex",alignItems:"center",justifyContent:"center",mx:"auto",mb:4,children:(0,a.jsx)(p.YrT,{size:28,color:S})}),(0,a.jsx)(s.E,{fontSize:"lg",fontWeight:"bold",color:"gray.800",mb:2,children:F.success_message||"Thank you! We will get back to you shortly."})]})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w,{}),(0,a.jsx)(i.s,{className:"orygo-form-min-fullheight",width:"100%",alignItems:"center",justifyContent:"center",bg:"white",p:4,children:(0,a.jsx)(g.A,{config:F,isPreview:!1,onSubmit:N,isSubmitting:x})})]})}y.getLayout=function(e){return(0,a.jsx)(l.s,{value:h.uB,children:e})}},53602:(e,t,r)=>{"use strict";r.d(t,{LX:()=>i,ZL:()=>d,_E:()=>a,r3:()=>u,vz:()=>m,wk:()=>c});let a=["image/jpeg","image/png","image/webp","image/heic","image/heif"],i=".jpg,.jpeg,.png,.webp,.heic,.heif",n=new Set(["image/jpeg","image/png","image/webp"]),o=e=>a.includes(e.type)?e.size>0xa00000?{valid:!1,error:"Image size exceeds maximum allowed (10MB)"}:{valid:!0}:{valid:!1,error:"Unsupported image format. Supported formats: JPEG, PNG, WebP, HEIC, HEIF"},s=e=>new Promise((t,r)=>{let a=new FileReader;a.onload=()=>{let e=a.result,r=e.indexOf(",");t(r>
1=0?e.slice(r+1):e)},a.onerror=()=>r(Error("Failed to read blob")),a.readAsDataURL(e)}),l=async(e,t,r)=>{if("undefined"==typeof document||!n.has(e.type))return null;let a=URL.createObjectURL(e);try{let i=await new Promise((e,t)=>{let r=new Image;r.onload=()=>e(r),r.onerror=()=>t(Error("Failed to decode image")),r.decoding="async",r.src=a}),n=Math.max(i.naturalWidth,i.naturalHeight);if(!n)return null;let o=Math.min(1,t/n),s=Math.max(1,Math.round(i.naturalWidth*o)),l=Math.max(1,Math.round(i.naturalHeight*o)),d=document.createElement("canvas");d.width=s,d.height=l;let c=d.getContext("2d");if(!c)return null;c.drawImage(i,0,0,s,l);let u="image/png"===e.type&&1===o&&e.size<204800?"image/png":"image/jpeg",m=await new Promise(e=>{d.toBlob(t=>e(t),u,r)});if(!m)return null;return{blob:m,mimeType:u}}catch(e){return null}finally{URL.revokeObjectURL(a)}},d=async e=>{let t,r,a,i,n=await l(e,1600,.85);n&&n.blob.size<.95*e.size?(t=await s(n.blob),r=n.mimeType):(t=await new Promise((t,r)=>{let a=new FileReader;a.onload=()=>{let e=a.result,r=e.indexOf(",");t(r>=0?e.slice(r+1):e)},a.onerror=()=>r(Error("Failed to read image file")),a.readAsDataURL(e)}),r=e.type);let o=await l(e,200,.75);if(o)try{a=await s(o.blob),i=o.mimeType}catch(e){a=void 0}return{data:t,mime_type:r,thumbnail_data:a,thumbnail_mime_type:i}},c=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[],a=[],i=Array.from(e);if(t.length+i.length>10)return r.push("Maximum ".concat(10," images allowed per message")),{images:t,errors:r};for(let e of i){let t=o(e);if(!t.valid){r.push("".concat(e.name,": ").concat(t.error));continue}try{let t=await d(e);a.push(t)}catch(t){r.push("".concat(e.name,": Failed to process image"))}}return{images:[...t,...a],errors:r}},u=e=>e.thumbnail_data&&e.thumbnail_mime_type?"data:".concat(e.thumbnail_mime_type,";base64,").concat(e.thumbnail_data):"data:".concat(e.mime_type,";base64,").concat(e.data),m=e=>({data:e.data,mime_type:e.mime_type})},56977:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/form/[agent_id]",function(){return r(25915)}])},63132:(e,t,r)=>{"use strict";r.d(t,{uT:()=>_,Nv:()=>E,MQ:()=>x});var a=r(37876),i=r(8641),n=r(5661),o=r(14232),s=r(61112);let l=(0,o.forwardRef)((e,t)=>{let r=(0,i.f)(),o=(0,n.v6)(r?.getSelectProps(),e);return(0,a.jsx)(s.X.select,{...o,ref:t})});l.displayName="FieldSelect";var d=r(65981),c=r(5794),u=r(57175),m=r(95094),h=r(32850),g=r(6206);let[f,p]=(0,d.q)({name:"NativeSelectBasePropsContext",hookName:"useNativeSelectBaseProps",providerName:"<NativeSelectRoot />",strict:!1}),{withProvider:w,useClassNames:v,useStyles:y,PropsProvider:b}=(0,c.c)({key:"nativeSelect"}),x=w("div","root",{wrapElement(e,t){let r=(0,i.f)(),n=!!(r?.disabled??t.disabled),o=!!(r?.invalid??t.invalid);return(0,a.jsx)(f,{value:{disabled:n,invalid:o},children:e})}}),j=(0,u.B)(l,{},{forwardAsChild:!0}),_=(0,o.forwardRef)(function(e,t){let{children:r,placeholder:i,unstyled:n,...o}=e,{disabled:s,invalid:l}=p(),d=y(),c=v();return(0,a.jsxs)(j,{disabled:s,"data-invalid":(0,m.s)(l),...o,ref:t,className:(0,h.cx)(c.field,e.className),css:[n?void 0:d.field,e.css],children:[i&&(0,a.jsx)("option",{value:"",children:i}),r]})});function E(e){let{unstyled:t,...r}=e,i=y(),{disabled:n,invalid:o}=p(),s=v();return(0,a.jsx)(u.B.div,{...r,"data-disabled":(0,m.s)(n),"data-invalid":(0,m.s)(o),className:(0,h.cx)(s.indicator,e.className),css:[t?void 0:i.indicator,e.css],children:e.children??(0,a.jsx)(g.D3,{})})}},76839:(e,t,r)=>{"use strict";r.d(t,{T:()=>h});var a=r(37876),i=r(98773),n=r(5661),o=r(14232),s=r(80134),l=r(61112),d=r(8641);let c=(0,o.forwardRef)((e,t)=>{let{autoresize:r,...c}=e,u=(0,o.useRef)(null),m=(0,d.f)(),h=(0,n.v6)(m?.getTextareaProps(),{style:{resize:r?"none":void 0}},c);return(0,o.useEffect)(()=>{if(r)return(e=>{if(!e)return;let t=(0,i.L9)(e),r=(0,i.zk)(e),a=(0,i.YE)(e),n=()=>{requestAnimationFrame(()=>{let r;e.style.height="auto",r="content-box"===t.boxSizing?e.scrollHeight-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):e.scrollHeight+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),"none"!==t.maxHeight&&r>parseFloat(t.maxHeight)?("hidden"===t.overflowY&&(e.style.overflowY="scroll"),r=parseFloat(t.maxHeight)):"hidden"!==t.overflowY&&(e.style.overflowY="hidden"),e.style.height=`${r}px`})};e.addEventListener("input",n),e.form?.addEventListener("reset",n);let o=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),"value");Object.defineProperty(e,"value",{...o,set(){o?.set?.apply(this,arguments),n()}});let s=new r.ResizeObserver(()=>{requestAnimationFrame(()=>n())});s.observe(e);let l=new r.MutationObserver(()=>n());return l.observe(e,{attributes:!0,attributeFilter:["rows","placeholder"]}
1),a.fonts?.addEventListener("loadingdone",n),()=>{e.removeEventListener("input",n),e.form?.removeEventListener("reset",n),a.fonts?.removeEventListener("loadingdone",n),s.disconnect(),l.disconnect()}})(u.current)},[r]),(0,a.jsx)(l.X.textarea,{...h,ref:(0,s.t)(t,u)})});c.displayName="FieldTextarea";let{withContext:u,PropsProvider:m}=(0,r(68391).a)({key:"textarea"}),h=u(c)},77362:(e,t,r)=>{"use strict";r.d(t,{p:()=>u});var a=r(37876),i=r(5661),n=r(14232),o=r(61112),s=r(8641);let l=(0,n.forwardRef)((e,t)=>{let r=(0,s.f)(),n=(0,i.v6)(r?.getInputProps(),e);return(0,a.jsx)(o.X.input,{...n,ref:t})});l.displayName="FieldInput";let{withContext:d,PropsProvider:c}=(0,r(68391).a)({key:"input"}),u=d(l)}},e=>{e.O(0,[2647,636,6593,8792],()=>e(e.s=56977)),_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.