PageSourceSearch

https://portals.to/_next/static/chunks/pages/control-panel/glbs/ai-generated-703da5b9ded7fbcd.js

js portals.to collected 2026-10-10 02:25:30 UTC 8,357 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1162],{20536:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/control-panel/glbs/ai-generated",function(){return s(15133)}])},28016:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var l=s(74848);function a(e){let{className:t=""}=e;return(0,l.jsxs)("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,l.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,l.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}},82762:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var l=s(74848),a=s(20053);function i(e){let{className:t="",children:s,color:i="indigo",onClick:n,isDisabled:r=!1,size:c="md"}=e;return(0,l.jsx)("button",{type:"button",onClick:n,className:(0,a.A)("rounded-full font-medium transition-all duration-200 flex items-center justify-center gap-1.5 center-fix","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring-focus)]",{indigo:"bg-[var(--accent-btn)] hover:bg-[var(--accent-btn-hover)] text-[var(--slate-1)]",sky:"bg-[var(--accent-btn)] hover:bg-[var(--accent-btn-hover)] text-[var(--slate-1)]",gray:"bg-[var(--btn-subtle-bg)] hover:bg-[var(--btn-subtle-bg-hover)] text-[var(--text-primary)]",red:"bg-[var(--feedback-error)] hover:opacity-90 text-white",green:"bg-[var(--feedback-success)] hover:opacity-90 text-white"}[i],r&&"opacity-50 cursor-not-allowed pointer-events-none","sm"===c&&"px-3 py-1 text-xs","md"===c&&"px-4 py-1.5 text-sm",t),disabled:r,children:s})}},15133:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>h});var l=s(74848),a=s(98780),i=s(96540),n=s(23041),r=s(2206),c=s(4549),o=s(28016),d=s(82762);function x(){let[e,t]=(0,i.useState)([]),[s,a]=(0,i.useState)(!1),[x,h]=(0,i.useState)(!1),[u,f]=(0,i.useState)(""),g=(0,i.useCallback)(async()=>{try{a(!0);let e=await n.A.get("/api/v2/control-panel/glbs/get-ai-generated");t(e.data.glbs)}catch(e){}a(!1)},[]);(0,i.useEffect)(()=>{g()},[g]);let w=(0,i.useMemo)(()=>e,[e]),j=async()=>{if(x)return;h(!0);let s=e[e.length-1];if(s){let e=await n.A.get(`/api/v2/control-panel/glbs/get-ai-generated?lastDocId=${s.id}`);t(t=>[...t,...e.data.glbs])}h(!1)},v=e=>{let t=new Date(e);return new Intl.DateTimeFormat("en-US",{dateStyle:"medium",timeStyle:"short"}).format(t)},b=(e,t)=>{let s=new Date(e);return((new Date(t).getTime()-s.getTime())/1e3).toFixed(2)},[y,N]=(0,i.useState)([]),[A,k]=(0,i.useState)([]),[C,I]=(0,i.useState)([]);async function _(e){let{docId:t}=e;alert("WIP")}async function S(s){let{docId:l}=s;k(e=>[...e,l]);let a=await n.A.post("/api/v2/control-panel/glbs/delete-ai-generated",{docId:l});if(k(e=>[...e.filter(e=>e!==l)]),200!==a.status)return;let i=e.findIndex(e=>e.docId===l);if(i<0)return;let r=[...e];r[i].isDeleted=!0,t([...r])}async function D(s){let{docId:l}=s;I(e=>[...e,l]);let a=await n.A.post("/api/v2/control-panel/glbs/restore-ai-generated",{docId:l});if(I(e=>[...e.filter(e=>e!==l)]),200!==a.status)return;let i=e.findIndex(e=>e.docId===l);if(i<0)return;let r=[...e];r[i].isDeleted=!1,t([...r])}return(0,l.jsxs)(r.A,{active:"glbs-ai-generated",children:[(0,l.jsx)(c.A,{children:"AI Generated GLBs"}),s?(0,l.jsx)(o.A,{className:"w-10 animate-spin mt-5"}):(0,l.jsx)("div",{className:"py-6",children:(0,l.jsx)("div",{className:"px-4 sm:px-6 lg:px-8",children:(0,l.jsx)("div",{className:"flow-root",children:(0,l.jsx)("div",{className:"-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8",children:(0,l.jsxs)("div",{className:"inline-block min-w-full py-2 align-middle",children:[(0,l.jsxs)("table",{className:"min-w-full divide-y divide-gray-700",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{scope:"col",className:"py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-white sm:pl-0",children:"User"}),(0,l.jsx)("th",{scope:"col",className:"py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-white",children:"Actions"}),(0,l.jsx)("th",{scope:"col",className:"py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-white",children:"Status"}),(0,l.jsx)("th",{scope:"col",className:"py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-white",children:"Image"}),(0,l.jsx)("th",{scope:"col",className:"py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-white",children:"GLB"}),(0,l.jsx)("th",{scope:"col",className:"py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-white",children:"Attempts"}),(0,l.jsx)("th",{scope:"col",className:"py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-white",children:"Started At"}),(0,l.jsx)("th",{scope:"col",className:"py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-white",children:"Finished In"})]})}),(0,l.jsx)("tbody",{className:"divide-y divide-gray-800",children:w.map(e=>{let{docId:t,userId:s,isDeleted:a,status:i,image:n,glb:r,attempts:c,createdAt:x,completedAt:h}=e,g=A.findIndex(e=>e===t)>=0,w=C.findIndex(e=>e===t)>=0;return(0,l.jsxs)("tr",{className:"relative",children:[(0,l.jsx)("td",{className:"whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-white sm:pl-0",children:(0,l.jsxs)("div",{className:"flex items-center h-full gap-2",children:[s?(0,l.jsx)("i",{className:"text-gray-400",children:`(${s.substring(0,6)}...${s.substring(s.length-6)})`}):"",s?(0,l.jsx)(d.A,{size:"sm",color:"gray",className:"flex items-center justify-center",onClick:()=>{navigator.clipboard.writeText(s),f(s),setTimeout(()=>f(""),2e3)},children:s===u?"Copied!":"Copy"}):""]})}),(0,l.jsx)("td",{className:"whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-white",children:(0,l.jsxs)("div",{className:"flex gap-1",children:[(0,l.jsx)(d.A,{size:"sm",color:"sky",className:"flex items-center justify-center",onClick:()=>{_({docId:t})},children:"Refund"}),!0===a?(0,l.jsx)(d.A,{size:"sm",color:"green",className:"flex items-center justify-center",onClick:()=>{D({docId:t})},isDisabled:w,children:w?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.A,{className:"animate-spin w-4"}),"Restoring"]}):"Restore"}):(0,l.jsx)(d.A,{size:"sm",color:"red",className:"flex items-center justify-center",onClick:()=>{S({docId:t})},isDisabled:g,children:g?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.A,{className:"animate-spin w-4"}),"Deleting"]}):"Delete"})]})}),(0,l.jsx)("td",{className:"whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-white",children:i}),(0,l.jsx)("td",{className:"whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-white",children:(0,l.jsx)(m,{src:n,alt:"Glb Image"})}),(0,l.jsx)("td",{className:"whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-white",children:r&&"succeeded"===i?(0,l.jsxs)("a",{className:"flex gap-1 w-[50px] h-[50px] text-sky-400 items-center justify-center",target:"_blank",href:r,children:["Link",(0,l.jsx)(p,{className:"w-[24px]"})]}):(0,l.jsx)("i",{children:"Not Available"})}),(0,l.jsx)("td",{className:"whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-white",children:c||1}),(0,l.jsx)("td",{className:"whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-white",children:x?v(x):(0,l.jsx)("i",{children:"Not Recorded"})}),(0,l.jsx)("td",{className:"whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-white",children:x&&h?` ${b(x,h)} secs`:""})]},t)})})]}),(0,l.jsx)("div",{children:(0,l.jsx)(d.A,{onClick:()=>{j()},isDisabled:x,children:x?(0,l.jsxs)("div",{className:"flex items-center justify-center gap-1",children:[(0,l.jsx)(o.A,{className:"w-[16px] animate-spin"}),"Loading More..."]}):"Load More"})})]})})})})})]})}function m(e){let{src:t,alt:s}=e,[a,n]=(0,i.useState)(!1);return!t||a?(0,l.jsx)("i",{children:"No Image"}):(0,l.jsx)("a",{href:t,target:"_blank",children:(0,l.jsx)("img",{className:"w-[50px] h-[50px]",src:t,alt:s,onError:()=>n(!0)})})}function p(e){let{className:t=""}=e;return(0,l.jsx)("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{fill:"currentColor",d:"M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83l1.41 1.41L19 6.41V10h2V3z"})})}function h(){let{isAuthenticated:e}=(0,a.G)(e=>e.auth.user);return e?(0,l.jsx)(x,{}):(0,l.jsx)("div",{className:"w-screen h-screen bg-[#14171A]"})}}},e=>{var t=t=>e(e.s=t);e.O(0,[2588,5253,2866,636,6593,8792],()=>t(20536)),_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.