PageSourceSearch

https://rawcutzai.vercel.app/_next/static/chunks/1860-6af40883b97cc19d.js

js rawcutzai.vercel.app collected 2026-10-03 07:36:13 UTC 16,058 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1860],{8726:function(e,t,a){var l=a(5893);a(7294),t.Z=e=>{let{className:t,type:a="button",loading:s,children:n,onClick:r}=e;return(0,l.jsxs)("button",{type:a,className:"btn btn-primary btn-block !hover:opacity-50"+t,onClick:r,disabled:s,children:[n,s&&(0,l.jsxs)("svg",{className:"animate-spin ml-1 mr-3 h-5 w-5 text-black",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"})]})]})}},7297:function(e,t,a){a.d(t,{Z:function(){return s}});var l=a(5893);function s(e){let{loading:t,size:a,color:s}=e;return t?(0,l.jsxs)("svg",{className:"animate-spin m-auto ".concat(a," ").concat(s),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"})]}):null}a(7294)},2824:function(e,t,a){a.d(t,{il:function(){return d},ZP:function(){return h}});var l=a(5893),s=a(7294),n=a(4291),r=a(1716),i=e=>{let{options:t,onChange:a,className:n=""}=e,[i,o]=(0,s.useState)(!1),[c,m]=(0,s.useState)({label:"All",value:""}),u=(0,s.useRef)(null),d=e=>{m(e),o(!1),a&&a(e)},x=e=>{u.current&&!u.current.contains(e.target)&&o(!1)};return(0,s.useEffect)(()=>(document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x)}),[]),(0,l.jsxs)("div",{className:(0,r.A)("relative inline-block text-xs rounded-md",n),ref:u,children:[(0,l.jsxs)("div",{className:(0,r.A)("bg-black pl-3 pr-10 py-1 text-[#ea9850] cursor-pointer whitespace-nowrap text-center",i?"rounded-t-md":"rounded-md"),onClick:()=>o(!i),children:[c?c.label:"All",(0,l.jsx)("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none bottom-[5px]",children:(0,l.jsx)("svg",{className:"h-5 w-5 text-white",viewBox:"0 0 20 20",fill:"currentColor",children:(0,l.jsx)("path",{d:"M10 15l-5-5h10l-5 5z"})})})]}),i&&(0,l.jsx)("ul",{className:"absolute z-50 w-full bg-black py-2 shadow-lg max-h-96 no-scrollbar text-xs ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none rounded-b-md",children:t.map(e=>(0,l.jsx)("li",{className:(0,r.A)("cursor-pointer select-none relative py-[2px] px-4  text-white hover:bg-[#ea9850] text-center",c.value==e.value?"bg-[#ea9850]":"bg-black"),onClick:()=>d(e),children:(0,l.jsx)("span",{className:(0,r.A)("whitespace-nowrap"),children:e.label})},e.value))})]})},o=a(7297),c=a(5675),m=a.n(c),u={src:"/_next/static/media/shuffle.ef8a116e.png",height:90,width:90,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAIVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABt0UjBAAAAC3RSTlMCeTqgxlIUQWMf5zOcHccAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAsSURBVHicPYpJDgAwCIQYtXb5/4ObJlVOJADFNNgjBstlriNAkeSLXzr1XFwWFACdgLN7kAAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:8};let d=["Amaj","Am","A#maj","A#m","Bmaj","Bm","Cmaj","Cm","C#maj","C#m","Dmaj","Dm","D#maj","D#m","Emaj","Em","Fmaj","Fm","F#maj","F#m","Gmaj","Gm","G#maj","G#m"],x=["61 - 70","71 - 80","81 - 90","91 - 100"],p=["randomNumberOne","randomNumberTwo","randomNumberThree","randomNumberFour"];function h(e){let{query:t,setQuery:a,points:c,setIsFavourites:d,isFavourites:h,loading:g}=e,[f,v]=s.useState(t.bpm),[j,A]=s.useState(t.type),[b,w]=s.useState(t.key),[y,N]=s.useState(t.element),[k,C]=s.useState(1);async function S(){let e={sortBy:t.sortBy};b&&"all"!=b&&(e.key=b),"all"!==f&&(e.bpm=f.toString()),"all"!==j&&(e.type=j),"all"!==y&&(e.element=y),a(e)}return(0,l.jsxs)("div",{className:"mt-4 p-4 w-full mb-4 sm:mb-0 flex justify-end items-center gap-4 query-bg text-xs text-white flex-wrap xl:flex-nowrap xl:justify-between rounded-md",children:[(0,l.jsxs)("div",{className:"flex items-center justify-end sm:justify-start gap-4 flex-wrap",children:[(0,l.jsx)("div",{className:"px-4 py-1 text-xs select-none  bg-black rounded-md",children:(0,l.jsxs)("p",{className:"text-xs text-white whitespace-nowrap",children:["User Points: ",(0,l.jsx)("span",{className:"text-[#ea9850]",children:c})]})}),(0,l.jsx)("div",{className:(0,r.A)("px-4 py-1 text-xs select-none cursor-pointer rounded-md",h?"bg-black":"bg-[#ea9850]"),onClick:()=>d(!1),children:(0,l.jsx)("p",{className:"hover:opacity-70",children:"All"})}),(0,l.jsx)("div",{className:(0,r.A)("bg-[#ea9850] px-4 py-1 text-xs select-none cursor-pointer rounded-md",h?"bg-[#ea9850]":"bg-black"),onClick:()=>d(!0),children:(0,l.jsx)("p",{className:"hover:opacity-70",children:"Favourites"})})]}),(0,l.jsxs)("div",{className:"flex items-center justify-end gap-4 flex-wrap",children:[(0,l.jsxs)("div",{className:" flex items-center gap-2",children:[(0,l.jsx)("label",{htmlFor:"bpm",className:"block text-xs font-medium leading-6 text-white",children:"BPM"}),(0,l.jsx)(i,{onChange:e=>v(e.value),className:"min-w-[118px]",options:[{value:0,label:"All"},...x.map(e=>({value:parseInt(e.split(" - ")[0]),label:e}))]})]}),(0,l.jsxs)("div",{className:" flex items-center gap-2",children:[(0,l.jsx)("label",{htmlFor:"type",className:"block text-xs font-medium leading-6 text-white",children:"Type"}),(0,l.jsx)(i,{onChange:e=>A(e.value),className:"min-w-[123px]",options:[{value:"all",label:"All"},{value:"one-shot",label:"One Shot"},{value:"loop",label:"Loop"}]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("label",{htmlFor:"element",className:"block text-xs font-medium leading-6 text-white",children:"Element"}),(0,l.jsx)(i,{onChange:e=>N(e.value),className:"min-w-[140px] h-fit",options:[{value:"all",label:"All"},...n.ELEMENTS.map(e=>({value:e.value,label:e.name}))]})]}),(0,l.jsx)("div",{className:"bg-[#ea9850] px-4 py-1 text-xs select-none cursor-pointer flex justify-center items-center rounded-md w-[72px]",onClick:S,children:g?(0,l.jsx)(o.Z,{size:"size-4",loading:!0,color:"black"}):(0,l.jsx)("p",{className:"hover:opacity-70",children:"Search"})}),(0,l.jsx)(m(),{src:u,alt:"shuffle",width:20,height:20,className:"invert cursor-pointer",onClick:function(){let e=p[k];a(t=>({...t,sortBy:e})),C(e=>(e+1)%p.length)}})]})]})}},7976:function(e,t,a){var l=a(5893);a(7294),t.Z=e=>{let{onFileChange:t,id:a,className:s,reference:n}=e;return(0,l.jsx)("input",{type:"file",id:a,className:s,onChange:e=>{let a=e.target.files;a&&t(a)},multiple:!0,ref:n})}},9092:function(e,t,a){var l=a(7066),s=a(6501),n=a(1163),r=a.n(n),i=a(316),o=a(104);let c=l.Z.create({baseURL:"/api"}),m=()=>new Promise((e,t)=>
1{(0,i.Aj)(o.I,async a=>{if(a)try{let t=await a.getIdToken();return e({token:t,error:null})}catch(e){return t({error:e})}})});c.interceptors.request.use(async e=>{let{token:t}=await m();return t&&(e.headers.Authorization=t),e},e=>Promise.reject(e)),c.interceptors.response.use(function(e){return e},function(e){var t,a,l,n;let i="";return(null===(t=e.response)||void 0===t?void 0:t.status)===401?r().push("/signin"):i=(null===(a=e.response)||void 0===a?void 0:a.status)===403?"You are not authorized to use this feature.":(null==e?void 0:null===(n=e.response)||void 0===n?void 0:null===(l=n.data)||void 0===l?void 0:l.error)||e.message||e.toString(),e.message="string"==typeof i?i:JSON.stringify(i),console.error(e.message),e.message?(console.log("error message",e.message),s.Am.error(e.message)):s.Am.error("something went wrong..."),Promise.reject(e)}),t.Z=c},4291:function(e,t,a){a.r(t),a.d(t,{ELEMENTS:function(){return x},default:function(){return h}});var l=a(5893),s=a(9092),n=a(9821),r=a(7294),i=a(7976),o=a(8726),c=a(7066),m=a(6501),u=a(2824);let d="https://pub-612e1f618fdb4b298a869589819c8c78.r2.dev",x=[{name:"Kick",value:"kick"},{name:"Snare",value:"snare"},{name:"HiHat Cl",value:"hihatcl"},{name:"HiHat Op",value:"hihatop"},{name:"Drum Break",value:"drum-break"},{name:"Bass",value:"bass"},{name:"FX",value:"fx"},{name:"Guitar",value:"guitar"},{name:"Horns",value:"horns"},{name:"Music",value:"music"},{name:"Pads",value:"pads"},{name:"Percussion",value:"percussion"},{name:"Rhodes",value:"rhodes"},{name:"Scratch",value:"scratch"},{name:"Synth",value:"synth"},{name:"Vox",value:"vox"}];function p(e){return e.replace(/[^a-zA-Z0-9.]/g,"")}function h(){let[e,t]=r.useState(!1),[a,h]=r.useState([]),[g,f]=r.useState(null),[v,j]=r.useState(120),[A,b]=r.useState("loop"),[w,y]=r.useState(""),[N,k]=r.useState([]),[C,S]=r.useState("kick"),Z=r.useRef(null);async function F(e,t){let{data:a}=await s.Z.post("/storage/upload",{keys:t,bucket:e});return a.urls}async function P(e,t){let a=new FormData;a.append("file",t);try{return await c.Z.put(e,t,{headers:{"Content-Type":t.type}}),!0}catch(e){return console.log(e.message),!1}}async function E(){let e=a.filter(e=>e.name.includes(".mp3")),t=e.map(e=>p(e.name)),l=await F("demos",t),s=await Promise.all(l.map((t,a)=>{let{url:l}=t;return P(l,e[a])}));return s.some(e=>!e)?[]:t.map(e=>"".concat(d,"/").concat(e))}async function B(){let e="images/"+[p(g.name)],t=await F("images",[e]),a=await P(t[0].url,g);return a?d+"/"+e:""}async function D(){let e=a.filter(e=>e.name.includes(".wav")),t=e.map(e=>({key:(0,n.V)()+"_"+p(e.name),name:e.name})),l=await F("downloads",t.map(e=>{let{key:t}=e;return t})),s=await Promise.all(l.map((t,a)=>{let{url:l}=t;return P(l,e[a])}));return s.some(e=>!e)?[]:t}async function L(){t(!0);let e=await E();if(m.ZP.success("Demos uploaded"),0===e.length){m.ZP.error("Error uploading demos"),t(!1);return}let a=await B();if(m.ZP.success("Image uploaded"),""===a){m.ZP.error("Error uploading image"),t(!1);return}let l=await D();if(m.ZP.success("Downloads uploaded"),0===l.length){m.ZP.error("Error uploading downloads"),t(!1);return}let s=l.map(t=>{let{key:l,name:s}=t,n={id:l,key:l,published:!0,productType:"SINGLE_SOUND",tags:N,musicalKey:w,bpm:v,type:A,element:C,image:a,preview:e.find(e=>e.includes(p(s).replace(".wav",".mp3"))),price:1,name:s,createdAt:new Date,updatedAt:new Date};return n});await M(s),m.ZP.success("Products created"),h([]),f(null),j(120),b("loop"),y(""),k([]),S("drum"),Z.current.value="",t(!1)}async function M(e){let{data:t}=await s.Z.post("/product/create",e);return t}return(0,l.jsx)("div",{className:"min-h-screen mb-8 flex justify-start flex-col m-auto p-8 pt-12 max-w-7xl",children:(0,l.jsxs)("div",{className:"bg-white p-8",children:[(0,l.jsx)("h1",{className:"text-3xl font-bold",children:"Create Products"}),(0,l.jsxs)("div",{className:"flex w-full justify-end items-center gap-4 mt-8",children:[(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsx)("label",{htmlFor:"sample-key",className:"block text-sm font-medium leading-6 text-gray-900",children:"Key"}),(0,l.jsxs)("select",{name:"sample-key",id:"sample-key",className:"input input-bordered border-gray-300 text-sm w-full placeholder:opacity-60",onChange:e=>y(e.target.value),value:w,children:[(0,l.jsx)("option",{value:""}),u.il.map(e=>(0,l.jsx)("option",{value:e,children:e},e))]})]}),(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsx)("label",{htmlFor:"bpm",className:"block text-sm font-medium leading-6 text-gray-900",children:"BPM"}),(0,l.jsx)("input",{type:"number",name:"bpm",id:"bpm",className:"input input-bordered border-gray-300 w-full text-sm placeholder:opacity-60",onChange:e=>
1j(parseInt(e.target.value)),value:v})]}),(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsx)("label",{htmlFor:"type",className:"block text-sm font-medium leading-6 text-gray-900",children:"Type"}),(0,l.jsxs)("select",{name:"type",id:"type",className:"input input-bordered border-gray-300 w-full text-sm placeholder:opacity-60",onChange:e=>b(e.target.value),value:A,children:[(0,l.jsx)("option",{value:"one-shot",children:"One Shot"}),(0,l.jsx)("option",{value:"loop",children:"Loop"})]})]}),(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsx)("label",{htmlFor:"element",className:"block text-sm font-medium leading-6 text-gray-900",children:"Element"}),(0,l.jsx)("select",{name:"element",id:"element",className:"input input-bordered border-gray-300 text-sm w-full placeholder:opacity-60",onChange:e=>S(e.target.value),value:C,children:x.map(e=>(0,l.jsx)("option",{value:e.value,children:e.name},e.value))})]})]}),(0,l.jsxs)("div",{className:"flex w-full gap-4 mb-4 mt-4",children:[(0,l.jsxs)("div",{className:"w-full",children:[(0,l.jsx)("label",{htmlFor:"cover-photo",className:"block text-sm font-medium leading-6 text-gray-900",children:"Downloads and Demos"}),(0,l.jsx)("div",{className:"mt-2 flex justify-center rounded-lg border border-dashed border-gray-900/25 px-6 py-10",children:(0,l.jsxs)("div",{className:"text-center flex justify-center flex-col items-center",children:[(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"mx-auto h-12 w-12 text-gray-300",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"})}),(0,l.jsx)("div",{className:"mt-4 flex text-sm leading-6 text-gray-600",children:(0,l.jsxs)("label",{htmlFor:"file-upload",className:"relative cursor-pointer rounded-md bg-white font-semibold text-indigo-600 focus-within:outline-none focus-within:ring-2 focus-within:ring-indigo-600 focus-within:ring-offset-2 hover:text-indigo-500 flex justify-center",children:[(0,l.jsx)("span",{children:"Upload files"}),(0,l.jsx)(i.Z,{id:"file-upload",className:"sr-only",onFileChange:function(e){let t=Array.from(e);h(t)}})]})}),(0,l.jsx)("p",{className:"text-xs leading-5 text-gray-600",children:"MP3 demos and WAV downloads only"})]})}),a.length>0&&(0,l.jsxs)("p",{children:["Files to upload: ",a.length]})]}),(0,l.jsxs)("div",{className:"w-full",children:[(0,l.jsx)("label",{htmlFor:"cover-photo",className:"block text-sm font-medium leading-6 text-gray-900",children:"Image"}),(0,l.jsx)("div",{className:"mt-2 flex justify-center rounded-lg border border-dashed border-gray-900/25 px-6 py-10",children:(0,l.jsxs)("div",{className:"text-center flex justify-center flex-col items-center",children:[(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"mx-auto h-12 w-12 text-gray-300",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"})}),(0,l.jsx)("div",{className:"mt-4 flex text-sm leading-6 text-gray-600",children:(0,l.jsxs)("label",{htmlFor:"image-upload",className:"relative cursor-pointer rounded-md bg-white font-semibold text-indigo-600 focus-within:outline-none focus-within:ring-2 focus-within:ring-indigo-600 focus-within:ring-offset-2 hover:text-indigo-500 flex justify-center",children:[(0,l.jsx)("span",{children:"Upload Image"}),(0,l.jsx)(i.Z,{id:"image-upload",className:"sr-only",onFileChange:e=>f(e[0]),reference:Z})]})}),(0,l.jsx)("p",{className:"text-xs leading-5 text-gray-600",children:"PNG file only"})]})}),g&&(0,l.jsx)("p",{children:g.name})]})]}),(0,l.jsx)(o.Z,{onClick:L,loading:e,className:"mt-4 border-gray-300",children:"Create Products"})]})})}},9821:function(e,t,a){a.d(t,{V:function(){return l}});function l(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}}}]);

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.