PageSourceSearch

https://ncmaz-faust-delta.vercel.app/_next/static/chunks/5551-09abb35d6e04f12a.js

js ncmaz-faust-delta.vercel.app collected 2026-10-03 07:22:23 UTC 9,981 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5551],{75551:(e,t,r)=>{r.d(t,{A:()=>x});var a=r(37876),s=r(32067),l=r(14232),i=r(97685),n=r(81033);async function o(e){if(!/^(ftp|http|https):\/\/[^ "]+$/.test(e))return!1;try{var t;let r=await (t=e,new Promise(function(e,r){let a,s=new Image;s.onerror=s.onabort=function(){a&&clearTimeout(a),r("error")},s.onload=function(){a&&clearTimeout(a),e("success")},a=setTimeout(function(){a&&clearTimeout(a),s.src="//!!!!/test.jpg",r("timeout")},5e3),s.src=t}));return"success"===r}catch(e){return!1}}var d=r(97842),c=r(17633),u=r(62276),m=r(36879);let x=e=>{var t;let{className:r="flex-1",contentClassName:x="px-3 py-8",onChangeImage:h=()=>{},defaultImage:p={sourceUrl:""}}=e,[f,g]=(0,l.useState)(p),[v,j]=(0,l.useState)(!1),[b,y]=(0,l.useState)(!1),w=(0,c.A)();function N(){j(!1),g(p)}function k(){j(!0)}let A=()=>{h({sourceUrl:"",altText:"",id:""}),g({sourceUrl:"",altText:"",id:""}),N()};return(0,l.useEffect)(()=>{g(p)},[p.sourceUrl]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:r,children:(0,a.jsx)("div",{className:"group block ".concat(b?"animate-pulse cursor-not-allowed":"cursor-pointer"),children:(0,a.jsxs)("div",{className:"relative z-0 mt-1 flex justify-center rounded-xl border border-dashed border-neutral-300 transition-colors group-hover:border-neutral-400 dark:border-neutral-600",children:[(0,a.jsxs)("div",{className:"flex-1 text-center",children:[!f.sourceUrl&&(0,a.jsx)("div",{className:"p-2",children:(0,a.jsxs)("div",{className:"text-center ".concat(x),children:[(0,a.jsx)("svg",{className:"mx-auto h-12 w-12 text-neutral-400",stroke:"currentColor",fill:"none",viewBox:"0 0 48 48","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,a.jsx)("div",{className:"mt-3 flex justify-center text-sm text-neutral-600 dar
1k:text-neutral-300",children:(0,a.jsx)("div",{className:"shrink-0 cursor-pointer rounded-md font-medium text-primary-600 focus-within:outline-hidden focus-within:ring-2 focus-within:ring-primary-500 focus-within:ring-offset-2 hover:text-primary-500 dark:text-primary-400",children:b?(0,a.jsx)(s.A,{className:"ml-3 text-blue-600",childClassName:"w-5 h-5"}):(0,a.jsx)("span",{children:w.pageSubmission["Upload a file"]})})}),(0,a.jsx)("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"PNG, JPG, GIF, WEBP, SVG ..."})]})}),f.sourceUrl&&(0,a.jsx)("div",{className:"",children:(0,a.jsx)("img",{src:f.sourceUrl,className:"w-full rounded-lg shadow-lg",sizes:"(max-width: 475px) 100vw, 600px",alt:f.altText||"image"})})]}),(0,a.jsx)("div",{className:"absolute inset-0 rounded-xl ".concat(f.sourceUrl?"transition-colors group-hover:bg-black/10":""),"aria-hidden":"true",onClick:k}),!!f.sourceUrl&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"absolute inset-s-2.5 top-2.5 z-20 flex cursor-pointer items-center gap-1 rounded-md bg-white p-1.5 pl-2 pr-2.5 text-xs font-medium text-black opacity-0 transition-opacity group-hover:opacity-100",title:w["Edit image"],onClick:k,children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),w.Edit]}),(0,a.jsx)("div",{className:"absolute inset-e-1 top-1 z-20 flex cursor-pointer items-center gap-1 rounded-full bg-white p-1.5 text-xs text-black",title:w["Delete image"],onClick:A,children:(0,a.jsx)(m.A,{className:"h-4 w-4"})})]})]})})}),(0,a.jsx)(n.A,{onClickApply:e=>{let{url:t,alt:r}=e;y(!0),o(t).then(e=>{if(!e)return void i.Ay.error(w.pageSubmission["The url is not an image, please try again."]);h({sourceUrl:t,altText:r,id:""}),g({sourceUrl:t,altText:r,id:""}),N()}).catch(e=>{i.Ay.error("Error: ".concat(e.message))}).finally(()=>{y(!1)})},onDelete:A,open:v,hanldeClose:N,isLoading:b,defaultImage:{alt:f.altText,url:f.sourceUrl},enableUpload:null==(t=u.g["submissions-settings"])?void 0:t.allow_upload_media})]})}},81033:(e,t,r)=>{r.d(t,{A:()=>g});var a=r(37876),s=r(28724),l=r(97685),i=r(66453),n=r(49105);let o=e=>(0,a.jsx)(n.A,{...e,pattern:"third"});var d=r(72187),c=r(40959),u=r(72975),m=r(14232),x=r(17633),h=r(32067),p=r(85356),f=r(62276);let g=e=>{let{onClickApply:t,onDelete:r,open:g=!1,hanldeClose:v,isLoading:j,defaultImage:b,enableUpload:y=!0}=e,w=(0,x.A)(),[N]=(0,m.useState)(["Upload","Insert from URL"]),[k,A]=(0,m.useState)((null==b?void 0:b.url)||""),[U,C]=(0,m.useState)((null==b?void 0:b.alt)||""),[S,T]=(0,m.useState)(!1),L=j||S;(0,m.useEffect)(()=>{A((null==b?void 0:b.url)||""),C((null==b?void 0:b.alt)||"")},[g]);let _=()=>{t({url:k,alt:U})};return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(u.A,{contentPaddingClass:"",isOpenProp:g,onCloseModal:function(){v&&v()},contentExtraClass:"max-w-(--breakpoint-md)",renderContent:()=>(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"relative flex flex-col space-y-5 px-5 py-6",children:(0,a.jsx)("div",{children:(0,a.jsxs)(s.fu,{children:[(0,a.jsx)(s.wb,{className:"flex space-x-1 rounded-xl bg-primary-900/10 p-1 dark:bg-primary-100/10",children:N.map(e=>(0,a.jsx)(s.oz,{className:e=>{let{selected:t}=e;return"w-full rounded-lg py-2.5 text-sm font-medium leading-5 ring-white/60 ring-offset-2 ring-offset-blue-400 focus:outline-hidden focus:ring-2 dark:ring-black/0 ".concat(t?"bg-white text-primary-700 shadow-sm dark:bg-neutral-900/80 dark:text-primary-100":"text-neutral-600 hover:bg-white/30 dark:text-primary-200 dark:hover:bg-black/15")},children:e},e))}),(0,a.jsx)(s.T2,{className:"mt-2",children:N.map((e,t)=>(0,a.jsx)(s.Kp,{className:"space-y-5 rounded-xl bg-neutral-50 p-4 focus:outline-hidden focus:ring-0 dark:bg-black/10",children:t?(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("form",{className:"block space-y-5",onSubmit:e=>{e.preventDefault(),_()},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(c.A,{children:w.pageSubmission["Image URL"]}),(0,a.jsx)(d.A,{className:"mt-1",rounded:"rounded-xl",type:"url",placeholder:w.pageSubmission["Paste or type URL"],onChange:e=>A(e.target.value),defaultValue:k,name:"url"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.A,{children:w.pageSubmission["Alt text (alternative text)"]}),(0,a.jsx)(d.A,{className:"mt-1",rounded:"rounded-xl",type:"text",onCh
1ange:e=>C(e.target.value),defaultValue:U,name:"alt"})]})]})}):(()=>{if(!y)return(0,a.jsx)("div",{className:"py-5",children:(0,a.jsx)(p.A,{type:"info",children:w.pageSubmission["Sorry this feature is not available yet. Please use the URL option."]})});let e=async()=>{let e=await fetch("/api/faust/auth/token",{method:"GET"});return(await e.json()).accessToken},t=async t=>{if(f._)return l.Ay.error("This is a demo site. Uploading file is disabled.");try{var r,a,s,i;T(!0);let n=null==t||null==(a=t.target)||null==(r=a.files)?void 0:r[0];if(!n)return T(!1),l.Ay.error("No file selected");let o=Number(null==(s=f.g["submissions-settings"])?void 0:s.allow_upload_media_max_size_mb)||10;if(n.size>1048576*o)return T(!1),l.Ay.error("File size must be less than ".concat(o,"MB"));let d=await e();if(!d)return T(!1),l.Ay.error("Error in getting access token!");A(URL.createObjectURL(n));let c=new FormData;c.append("file",n);let u=(i="https://ncmaz-faust.booliitheme.com/",void 0===i)?void 0:i.replace(/\/$/,""),m=await fetch("".concat(u,"/wp-json/wp/v2/media"),{method:"POST",headers:{Authorization:"Bearer ".concat(d)},body:c}),x=await m.json();T(!1);let h=x.source_url;h?(l.Ay.success("File Uploaded"),A(h)):(A((null==b?void 0:b.url)||""),l.Ay.error("string"==typeof x.message?x.message:"Error in Uploading File!"))}catch(e){return console.log("File Upload error___",e),T(!1),A((null==b?void 0:b.url)||""),l.Ay.error("Error in Uploading File")}};return(0,a.jsxs)("div",{className:"min-h-[140px]",children:[(0,a.jsx)("div",{className:"mx-auto w-full max-w-40",children:k?(0,a.jsx)("div",{className:"aspect-h-3 aspect-w-4 relative z-0 overflow-hidden rounded-2xl border-2 border-primary-100",children:(0,a.jsx)("img",{src:k,sizes:"400px",alt:U,className:"absolute inset-0 object-contain"})}):(0,a.jsx)("svg",{className:"mx-auto h-12 w-12 text-neutral-400",stroke:"currentColor",fill:"none",viewBox:"0 0 48 48","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,a.jsx)("div",{className:"mt-3 flex justify-center text-sm text-neutral-600 dar
1k:text-neutral-300",children:(0,a.jsxs)("label",{htmlFor:"file-upload",className:"shrink-0 cursor-pointer rounded-md font-medium text-primary-600 focus-within:outline-hidden focus-within:ring-2 focus-within:ring-primary-500 focus-within:ring-offset-2 hover:text-primary-500 dark:text-primary-400",children:[S?(0,a.jsx)(h.A,{className:"block p-2 text-blue-600",childClassName:"w-5 h-5"}):(0,a.jsx)("span",{children:k?w.Replace:w.pageSubmission["Upload a file"]}),(0,a.jsx)("input",{id:"file-upload",type:"file",className:"sr-only",onChange:t,accept:"image/*"})]})}),(0,a.jsx)("p",{className:"mt-1 flex justify-center text-xs text-neutral-500 dark:text-neutral-400",children:"PNG, JPG, GIF, WEBP, SVG ..."}),k&&(0,a.jsxs)("div",{className:"mt-6",children:[(0,a.jsx)(c.A,{children:"Alt text (alternative text)"}),(0,a.jsx)(d.A,{className:"mt-1",rounded:"rounded-xl",type:"text",onChange:e=>C(e.target.value),defaultValue:U,name:"alt"})]})]})})()},t))})]})})})}),renderTrigger:()=>null,modalTitle:"Add Image",renderFooter:e=>(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(n.A,{pattern:"link",onClick:e,children:w.Cancel}),(0,a.jsxs)("div",{className:"flex gap-2",children:[!!k&&(0,a.jsx)(o,{loading:L,onClick:()=>{A(""),C(""),r()},className:"text-red-500",children:w.Remove}),(0,a.jsx)(i.A,{loading:L,onClick:()=>{k?_():e()},children:w.Apply})]})]})})})}}}]);

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.