1import{r as d,a as Nr,g as Fr,R as kr}from"./vendor-hNfcizNV.js";import{_ as B,a as Se,b as Ne,c as Ve}from"./transformers-BOsqbiXW.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function t(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(a){if(a.ep)return;a.ep=!0;const i=t(a);fetch(a.href,i)}})();var lr={exports:{}},xe={};/** 2 * @license React 3 * react-jsx-runtime.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var Cr=d,Ir=Symbol.for("react.element"),Pr=Symbol.for("react.fragment"),Rr=Object.prototype.hasOwnProperty,Mr=Cr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Lr={key:!0,ref:!0,__self:!0,__source:!0};function cr(e,r,t){var o,a={},i=null,l=null;t!==void 0&&(i=""+t),r.key!==void 0&&(i=""+r.key),r.ref!==void 0&&(l=r.ref);for(o in r)Rr.call(r,o)&&!Lr.hasOwnProperty(o)&&(a[o]=r[o]);if(e&&e.defaultProps)for(o in r=e.defaultProps,r)a[o]===void 0&&(a[o]=r[o]);return{$$typeof:Ir,type:e,key:i,ref:l,props:a,_owner:Mr.current}}xe.Fragment=Pr;xe.jsx=cr;xe.jsxs=cr;lr.exports=xe;var n=lr.exports,ur,qe=Nr;ur=qe.createRoot,qe.hydrateRoot;var dr={exports:{}},Tr="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",zr=Tr,Ur=zr;function fr(){}function pr(){}pr.resetWarningCache=fr;var Br=function(){function e(o,a,i,l,u,g){if(g!==Ur){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function r(){return e}var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:pr,resetWarningCache:fr};return t.PropTypes=t,t};dr.exports=Br();var $r=dr.exports;const v=Fr($r);function te(e,r,t,o){function a(i){return i instanceof t?i:new t(function(l){l(i)})}return new(t||(t=Promise))(function(i,l){function u(m){try{c(o.next(m))}catch(b){l(b)}}function g(m){try{c(o.throw(m))}catch(b){l(b)}}function c(m){m.done?i(m.value):a(m.value).then(u,g)}c((o=o.apply(e,r||[])).next())})}function ne(e,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,a,i,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=u(0),l.throw=u(1),l.return=u(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(c){return function(m){return g([c,m])}}function g(c){if(o)throw new TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(t=0)),t;)try{if(o=1,a&&(i=c[0]&2?a.return:c[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,c[1])).done)return i;switch(a=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,a=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1],i=c;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(c);break}i[2]&&t.ops.pop(),t.trys.pop();continue}c=r.call(e,t)}catch(m){c=[6,m],a=0}finally{o=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Ye(e,r){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var o=t.call(e),a,i=[],l;try{for(;(r===void 0||r-- >0)&&!(a=o.next()).done;)i.push(a.value)}catch(u){l={error:u}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(l)throw l.error}}return i}function Qe(e,r,t){if(t||arguments.length===2)for(var o=0,a=r.length,i;o<a;o++)(i||!(o in r))&&(i||(i=Array.prototype.slice.call(r,0,o)),i[o]=r[o]);return e.concat(i||Array.prototype.slice.call(r))}var Wr=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function se(e,r){var t=Gr(e);if(typeof t.path!="string"){var o=e.webkitRelativePath;Object.defineProperty(t,"path",{value:typeof r=="string"?r:typeof o=="str
9ing"&&o.length>0?o:e.name,writable:!1,configurable:!1,enumerable:!0})}return t}function Gr(e){var r=e.name,t=r&&r.lastIndexOf(".")!==-1;if(t&&!e.type){var o=r.split(".").pop().toLowerCase(),a=Wr.get(o);a&&Object.defineProperty(e,"type",{value:a,writable:!1,configurable:!1,enumerable:!0})}return e}var Kr=[".DS_Store","Thumbs.db"];function Hr(e){return te(this,void 0,void 0,function(){return ne(this,function(r){return ge(e)&&Vr(e.dataTransfer)?[2,Jr(e.dataTransfer,e.type)]:qr(e)?[2,Yr(e)]:Array.isArray(e)&&e.every(function(t){return"getFile"in t&&typeof t.getFile=="function"})?[2,Qr(e)]:[2,[]]})})}function Vr(e){return ge(e)}function qr(e){return ge(e)&&ge(e.target)}function ge(e){return typeof e=="object"&&e!==null}function Yr(e){return Fe(e.target.files).map(function(r){return se(r)})}function Qr(e){return te(this,void 0,void 0,function(){var r;return ne(this,function(t){switch(t.label){case 0:return[4,Promise.all(e.map(function(o){return o.getFile()}))];case 1:return r=t.sent(),[2,r.map(function(o){return se(o)})]}})})}function Jr(e,r){return te(this,void 0,void 0,function(){var t,o;return ne(this,function(a){switch(a.label){case 0:return e.items?(t=Fe(e.items).filter(function(i){return i.kind==="file"}),r!=="drop"?[2,t]:[4,Promise.all(t.map(Xr))]):[3,2];case 1:return o=a.sent(),[2,Je(mr(o))];case 2:return[2,Je(Fe(e.files).map(function(i){return se(i)}))]}})})}function Je(e){return e.filter(function(r){return Kr.indexOf(r.name)===-1})}function Fe(e){if(e===null)return[];for(var r=[],t=0;t<e.length;t++){var o=e[t];r.push(o)}return r}function Xr(e){if(typeof e.webkitGetAsEntry!="function")return Xe(e);var r=e.webkitGetAsEntry();return r&&r.isDirectory?gr(r):Xe(e)}function mr(e){return e.reduce(function(r,t){return Qe(Qe([],Ye(r),!1),Ye(Array.isArray(t)?mr(t):[t]),!1)},[])}function Xe(e){var r=e.getAsFile();if(!r)return Promise.reject("".concat(e," is not a File"));var t=se(r);return Promise.resolve(t)}function Zr(e){return te(this,void 0,void 0,function(){return ne(this,function(r){return[2,e.isDirectory?gr(e):et(e)]})})}function gr(e){var r=e.createReader();return new Promise(function(t,o){var a=[];function i(){var l=this;r.readEntries(function(u){return te(l,void 0,void 0,function(){var g,c,m;return ne(this,function(b){switch(b.label){case 0:if(u.length)return[3,5];b.label=1;case 1:return b.trys.push([1,3,,4]),[4,Promise.all(a)];case 2:return g=b.sent(),t(g),[3,4];case 3:return c=b.sent(),o(c),[3,4];case 4:return[3,6];case 5:m=Promise.all(u.map(Zr)),a.push(m),i(),b.label=6;case 6:return[2]}})})},function(u){o(u)})}i()})}function et(e){return te(this,void 0,void 0,function(){return ne(this,function(r){return[2,new Promise(function(t,o){e.file(function(a){var i=se(a,e.fullPath);t(i)},function(a){o(a)})})]})})}var rt=function(e,r){if(e&&r){var t=Array.isArray(r)?r:r.split(","),o=e.name||"",a=(e.type||"").toLowerCase(),i=a.replace(/\/.*$/,"");return t.some(function(l){var u=l.trim().toLowerCase();return u.charAt(0)==="."?o.toLowerCase().endsWith(u):u.endsWith("/*")?i===u.replace(/\/.*$/,""):a===u})}return!0};function Ze(e){return ot(e)||nt(e)||br(e)||tt()}function tt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 10In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ot(e){if(Array.isArray(e))return ke(e)}function er(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,o)}return t}function rr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?er(Object(t),!0).forEach(function(o){hr(e,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):er(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))})}return e}function hr(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ie(e,r){return st(e)||it(e,r)||br(e,r)||at()}
vendor: 14,666 bytes, lines 10-13
10function at(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 11In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function br(e,r){if(e){if(typeof e=="string")return ke(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ke(e,r)}}function ke(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o}function it(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var o=[],a=!0,i=!1,l,u;try{for(t=t.call(e);!(a=(l=t.next()).done)&&(o.push(l.value),!(r&&o.length===r));a=!0);}catch(g){i=!0,u=g}finally{try{!a&&t.return!=null&&t.return()}finally{if(i)throw u}}return o}}function st(e){if(Array.isArray(e))return e}var lt="file-invalid-type",ct="file-too-large",ut="file-too-small",dt="too-many-files",ft=function(r){r=Array.isArray(r)&&r.length===1?r[0]:r;var t=Array.isArray(r)?"one of ".concat(r.join(", ")):r;return{code:lt,message:"File type must be ".concat(t)}},tr=function(r){return{code:ct,message:"File is larger than ".concat(r," ").concat(r===1?"byte":"bytes")}},nr=function(r){return{code:ut,message:"File is smaller than ".concat(r," ").concat(r===1?"byte":"bytes")}},pt={code:dt,message:"Too many files"};function xr(e,r){var t=e.type==="application/x-moz-file"||rt(e,r);return[t,t?null:ft(r)]}function vr(e,r,t){if(Y(e.size))if(Y(r)&&Y(t)){if(e.size>t)return[!1,tr(t)];if(e.size<r)return[!1,nr(r)]}else{if(Y(r)&&e.size<r)return[!1,nr(r)];if(Y(t)&&e.size>t)return[!1,tr(t)]}return[!0,null]}function Y(e){return e!=null}function mt(e){var r=e.files,t=e.accept,o=e.minSize,a=e.maxSize,i=e.multiple,l=e.maxFiles,u=e.validator;return!i&&r.length>1||i&&l>=1&&r.length>l?!1:r.every(function(g){var c=xr(g,t),m=ie(c,1),b=m[0],O=vr(g,o,a),I=ie(O,1),P=I[0],M=u?u(g):null;return b&&P&&!M})}function he(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function me(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(r){return r==="Files"||r==="application/x-moz-file"}):!!e.target&&!!e.target.files}function or(e){e.preventDefault()}function gt(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function ht(e){return e.indexOf("Edge/")!==-1}function bt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return gt(e)||ht(e)}function z(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return function(o){for(var a=arguments.length,i=new Array(a>1?a-1:0),l=1;l<a;l++)i[l-1]=arguments[l];return r.some(function(u){return!he(o)&&u&&u.apply(void 0,[o].concat(i)),he(o)})}}function xt(){return"showOpenFilePicker"in window}function vt(e){if(Y(e)){var r=Object.entries(e).filter(function(t){var o=ie(t,2),a=o[0],i=o[1],l=!0;return yr(a)||(console.warn('Skipped "'.concat(a,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),l=!1),(!Array.isArray(i)||!i.every(wr))&&(console.warn('Skipped "'.concat(a,'" because an invalid file extension was provided.')),l=!1),l}).reduce(function(t,o){var a=ie(o,2),i=a[0],l=a[1];return rr(rr({},t),{},hr({},i,l))},{});return[{description:"Files",accept:r}]}return e}function yt(e){if(Y(e))return Object.entries(e).reduce(function(r,t){var o=ie(t,2),a=o[0],i=o[1];return[].concat(Ze(r),[a],Ze(i))},[]).filter(function(r){return yr(r)||wr(r)}).join(",")}function wt(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function jt(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function yr(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function wr(e){return/^.*\.[\w]+$/.test(e)}var At=["children"],Dt=["open"],_t=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Et=["refKey","onChange","onClick"];function Ot(e){return Ft(e)||Nt(e)||jr(e)||St()}function St(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 12In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ft(e){if(Array.isArray(e))return Ce(e)}function Oe(e,r){return It(e)||Ct(e,r)||jr(e,r)||kt()}function kt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 13In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jr(e,r){if(e){if(typeof e=="string")return Ce(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ce(e,r)}}function Ce(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o}function Ct(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var o=[],a=!0,i=!1,l,u;try{for(t=t.call(e);!(a=(l=t.next()).done)&&(o.push(l.value),!(r&&o.length===r));a=!0);}catch(g){i=!0,u=g}finally{try{!a&&t.return!=null&&t.return()}finally{if(i)throw u}}return o}}function It(e){if(Array.isArray(e))return e}function ar(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,o)}return t}function y(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?ar(Object(t),!0).forEach(function(o){Ie(e,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ar(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))})}return e}function Ie(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function be(e,r){if(e==null)return{};var t=Pt(e,r),o,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)o=i[a],!(r.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(t[o]=e[o])}return t}function Pt(e,r){if(e==null)return{};var t={},o=Object.keys(e),a,i;for(i=0;i<o.length;i++)a=o[i],!(r.indexOf(a)>=0)&&(t[a]=e[a]);return t}var Me=d.forwardRef(function(e,r){var t=e.children,o=be(e,At),a=Dr(o),i=a.open,l=be(a,Dt);return d.useImperativeHandle(r,function(){return{open:i}},[i]),kr.createElement(d.Fragment,null,t(y(y({},l),{},{open:i})))});Me.displayName="Dropzone";var Ar={disabled:!1,getFilesFromEvent:Hr,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Me.defaultProps=Ar;Me.propTypes={children:v.func,accept:v.objectOf(v.arrayOf(v.string)),multiple:v.bool,preventDropOnDocument:v.bool,noClick:v.bool,noKeyboard:v.bool,noDrag:v.bool,noDragEventsBubbling:v.bool,minSize:v.number,maxSize:v.number,maxFiles:v.number,disabled:v.bool,getFilesFromEvent:v.func,onFileDialogCancel:v.func,onFileDialogOpen:v.func,useFsAccessApi:v.bool,autoFocus:v.bool,onDragEnter:v.func,onDragLeave:v.func,onDragOver:v.func,onDrop:v.func,onDropAccepted:v.func,onDropRejected:v.func,onError:v.func,validator:v.func};var Pe={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Dr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=y(y({},Ar),e),t=r.accept,o=r.disabled,a=r.getFilesFromEvent,i=r.maxSize,l=r.minSize,u=r.multiple,g=r.maxFiles,c=r.onDragEnter,m=r.onDragLeave,b=r.onDragOver,O=r.onDrop,I=r.onDropAccepted,P=r.onDropRejected,M=r.onFileDialogCancel,L=r.onFileDialogOpen,Q=r.useFsAccessApi,W=r.autoFocus,G=r.preventDropOnDocument,$=r.noClick,K=r.noKeyboard,H=r.noDrag,x=r.noDragEventsBubbling,A=r.onError,h=r.validator,w=d.useMemo(function(){return yt(t)},[t]),p=d.useMemo(function(){return vt(t)},[t]),D=d.useMemo(function(){return typeof L=="function"?L:ir},[L]),T=d.useMemo(function(){return typeof M=="function"?M:ir},[M]),F=d.useRef(null),j=d.useRef(null),N=d.useReducer(Rt,Pe),V=Oe(N,2),J=V[0],k=V[1],S=J.isFocused,Le=J.isFileDialogActive,le=d.useRef(typeof window<"u"&&window.isSecureContext&&Q&&xt()),Te=function(){!le.current&&Le&&setTimeout(function(){if(j.current){var f=j.current.files;f.length||(k({type:"closeDialog"}),T())}},300)};d.useEffect(function(){return window.addEventListener("focus",Te,!1),function(){window.removeEventListener("focus",Te,!1)}},[j,Le,T,le]);var X=d.useRef([]),ze=function(f){F.current&&F.current.contains(f.target)||(f.preventDefault(),X.current=[])};d.useEffect(function(){return G&&(document.addEventListener("dragover",or,!1),document.addEventListener("drop",ze,!1)),function(){G&&(document.removeEventListener("dragover",or),document.removeEventListener("drop",ze))}},[F,G]),d.useEffect(function(){return!o&&W&&F.current&&F.current.focus(),function(){}},[F,W,o]);var q=d.useCallback(function(s){A?A(s):console.error(s)},[A]),Ue=d.useCallback(function(s){s.preventDefault(),s.persist(),fe(s),X.current=[].concat(Ot(X.current),[s.target]),me(s)&&Promise.resolve(a(s)).then(function(f){if(!(he(s)&&!x)){var _=f.length,C=_>0&&mt({files:f,accept:w,minSize:l,maxSize:i,multiple:u,maxFiles:g,validator:h}),R=_>0&&!C;k({isDragAccept:C,isDragReject:R,isDragActive:!0,type:"setDraggedFiles"}),c&&c(s)}}).catch(function(f){return q(f)})},[a,c,q,x,w,l,i,u,g,h]),Be=d.useCallback(function(s){s.preventDefault(),s.persist(),fe(s);var f=me(s);if(f&&s.dataTransfer)try{s.dataTransfer.dropEffect="copy"}catch{}return f&&b&&b(s),!1},[b,x]),$e=d.useCallback(function(s){s.preventDefault(),s.persist(),fe(s);var f=X.current.filter(function(C){return F.current&&F.current.contains(C)}),_=f.indexOf(s.target);_!==-1&&f.splice(_,1),X.current=f,!(f.length>0)&&(k({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),me(s)&&m&&m(s))},[F,m,x]),ce=d.useCallback(function(s,f){var _=[],C=[];s.forEach(function(R){var oe=xr(R,w),re=Oe(oe,2),ye=re[0],we=re[1],je=vr(R,l,i),pe=Oe(je,2),Ae=pe[0],De=pe[1],_e=h?h(R):null;if(ye&&Ae&&!_e)_.push(R);else{var Ee=[we,De];_e&&(Ee=Ee.concat(_e)),C.push({file:R,errors:Ee.filter(function(Sr){return Sr})})}}),(!u&&_.length>1||u&&g>=1&&_.length>g)&&(_.forEach(function(R){C.push({file:R,errors:[pt]})}),_.splice(0)),k({acceptedFiles:_,fileRejections:C,type:"setFiles"}),O&&O(_,C,f),C.length>0&&P&&P(C,f),_.length>0&&I&&I(_,f)},[k,u,w,l,i,g,O,I,P,h]),ue=d.useCallback(function(s){s.preventDefault(),s.persist(),fe(s),X.current=[],me(s)&&Promise.resolve(a(s)).then(function(f){he(s)&&!x||ce(f,s)}).catch(function(f){return q(f)}),k({type:"reset"})},[a,ce,q,x]),Z=d.useCallback(function(){if(le.current){k({type:"openDialog"}),D();var s={multiple:u,types:p};window.showOpenFilePicker(s).then(function(f){return a(f)}).then(function(f){ce(f,null),k({type:"closeDialog"})}).catch(function(f){wt(f)?(T(f),k({type:"closeDialog"})):jt(f)?(le.current=!1,j.current?(j.current.value=null,j.current.click()):q(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):q(f)});return}j.current&&(k({type:"openDialog"}),D(),j.current.value=null,j.current.click())},[k,D,T,Q,ce,q,p,u]),We=d.useCallback(function(s){!F.current||!F.current.isEqualNode(s.target)||(s.key===" "||s.key==="Enter"||s.keyCode===32||s.keyCode===13)&&(s.preventDefault(),Z())},[F,Z]),Ge=d.useCallback(function(){k({type:"focus"})},[]),Ke=d.useCallback(function(){k({type:"blur"})},[]),He=d.useCallback(function(){$||(bt()?setTimeout(Z,0):Z())},[$,Z]),ee=function(f){return o?null:f},ve=function(f){return K?null:ee(f)},de=function(f){return H?null:ee(f)},fe=function(f){x&&f.stopPropagation()},_r=d.useMemo(function(){return function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},f=s.refKey,_=f===void 0?"ref":f,C=s.role,R=s.onKeyDown,oe=s.onFocus,re=s.onBlur,ye=s.onClick,we=s.onDragEnter,je=s.onDragOver,pe=s.onDragLeave,Ae=s.onDrop,De=be(s,_t);return y(y(Ie({onKeyDown:ve(z(R,We)),onFocus:ve(z(oe,Ge)),onBlur:ve(z(re,Ke)),onClick:ee(z(ye,He)),onDragEnter:de(z(we,Ue)),onDragOver:de(z(je,Be)),onDragLeave:de(z(pe,$e)),onDrop:de(z(Ae,ue)),role:typeof C=="string"&&C!==""?C:"presentation"},_,F),!o&&!K?{tabIndex:0}:{}),De)}},[F,We,Ge,Ke,He,Ue,Be,$e,ue,K,H,o]),Er=d.useCallback(function(s){s.stopPropagation()},[]),Or=d.useMemo(function(){return function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},f=s.refKey,_=f===void 0?"ref":f,C=s.onChange,R=s.onClick,oe=be(s,Et),re=Ie({accept:w,multiple:u,type:"file",style:{display:"none"},onChange:ee(z(C,ue)),onClick:ee(z(R,Er)),tabIndex:-1},_,j);return y(y({},re),oe)}},[j,t,u,ue,o]);return y(y({},J),{},{isFocused:S&&!o,getRootProps:_r,getInputProps:Or,rootRef:F,inputRef:j,open:ee(Z)})}function Rt(e,r){switch(r.type){case"focus":return y(y({},e),{},{isFocused:!0});case"blur":return y(y({},e),{},{isFocused:!1});case"openDialog":return y(y({},Pe),{},{isFileDialogActive:!0});case"closeDialog":return y(y({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return y(y({},e),{},{isDragActive:r.isDragActive,isDragAccept:r.isDragAccept,isDragReject:r.isDragReject});case"setFiles":return y(y({},e),{},{acceptedFiles:r.acceptedFiles,fileRejections:r.fileRejections});case"reset":return y({},Pe);default:return e}}function ir(){}const Mt=[{id:"color",label:"ØªÛØªØ§Ø´ رÛÚ"},{id:"image",label:"Ø±ÛØ³ÙÙ "}],Lt=[{id:"none",label:"ÙÙÙ"},{id:"blur",label:"غÛÛØ§ÙØ§Ø´ØªÛØ±ÛØ´"},{id:"brightness",label:"ÙÙØ±ÛÙÙÛÙ"},{id:"contrast",label:"ئÛÙÙÙÙÙÙ"}],Tt=["#ffffff","#000000","#ff0000","#00ff00","#0000ff","#ffff00","#00ffff","#ff00ff","#808080","#c0c0c0"];function zt({image:e,isOpen:r,onClose:t,onSave:o}){const[a,i]=d.useState("color"),[l,u]=d.useState("#ffffff"),[g,c]=d.useState(null),[m,b]=d.useState("none"),[O,I]=d.useState(50),[P,M]=d.useState(50),[L,Q]=d.useState(50),[W,G]=d.useState(""),[$,K]=d.useState(!1),H=e.processedFile?URL.createObjectURL(e.processedFile):"";d.useEffect(()=>{e.processedFile&&h()},[a,l,g,m,O,P,L]);const x=()=>{switch(m){case"blur":return O;case"brightness":return P;case"contrast":return L;default:return 50}},A=p=>{switch(m){case"blur":I(p);break;
13case"brightness":M(p);break;case"contrast":Q(p);break}},h=async()=>{if(!e.processedFile)return;const p=document.createElement("canvas"),D=p.getContext("2d");if(!D)return;const T=new Image;if(T.src=H,await new Promise(j=>T.onload=j),p.width=T.width,p.height=T.height,a==="color")D.fillStyle=l,D.fillRect(0,0,p.width,p.height);else if(a==="image"&&g){const j=new Image;j.src=URL.createObjectURL(g),await new Promise(N=>j.onload=N),D.drawImage(j,0,0,p.width,p.height)}if(D.drawImage(T,0,0),m!=="none"){const j=D.getImageData(0,0,p.width,p.height),N=j.data;switch(m){case"blur":const V=document.createElement("canvas"),J=V.getContext("2d");if(!J)break;V.width=p.width,V.height=p.height,J.drawImage(p,0,0),D.clearRect(0,0,p.width,p.height),D.filter=`blur(${O/10}px)`,D.drawImage(V,0,0),D.filter="none";break;case"brightness":for(let S=0;S<N.length;S+=4)N[S]=Math.min(255,N[S]*(P/50)),N[S+1]=Math.min(255,N[S+1]*(P/50)),N[S+2]=Math.min(255,N[S+2]*(P/50));D.putImageData(j,0,0);break;case"contrast":const k=259*(L+255)/(255*(259-L));for(let S=0;S<N.length;S+=4)N[S]=k*(N[S]-128)+128,N[S+1]=k*(N[S+1]-128)+128,N[S+2]=k*(N[S+2]-128)+128;D.putImageData(j,0,0);break}}const F=p.toDataURL("image/png");G(F)},w=()=>{o(W),t()};return r?n.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:n.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-4",children:[n.jsx("h2",{className:"text-xl font-semibold text-gray-800",children:"Ø±ÛØ³ÙÙ
تÛÚ¾Ø±ÙØ±ÙÛØ´"}),n.jsx("button",{onClick:t,className:"text-gray-500 hover:text-gray-700",title:"ØªØ§ÙØ§Ø´",children:"â"})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"font-medium text-gray-700 mb-2",children:"Ø¦Ø§Ø±ÙØ§ ÙÛØ±ÛÙÛØ´"}),n.jsx("div",{className:"flex gap-2 mb-4",children:Mt.map(p=>n.jsx("button",{onClick:()=>i(p.id),className:`px-3 py-1 rounded ${a===p.id?"bg-blue-500 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,children:p.label},p.id))}),a==="color"&&n.jsxs("div",{children:[n.jsx("div",{className:"flex gap-2 mb-2",children:Tt.map(p=>n.jsx("button",{onClick:()=>u(p),className:"w-8 h-8 rounded-full border border-gray-300",style:{backgroundColor:p},title:"رÛÚ ØªØ§ÙÙØ§Ø´"},p))}),n.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[n.jsx("button",{onClick:()=>K(!$),className:"px-3 py-1.5 bg-white border border-gray-200 rounded-md hover:bg-gray-50 transition-colors text-sm text-gray-700",children:"Ø¦ÛØ²Ù بÛÙÚ¯ÙÙÛØ´"}),$&&n.jsx("input",{type:"color",value:l,onChange:p=>u(p.target.value),className:"w-8 h-8 border border-gray-400 rounded-md hover:bg-blue-200"})]})]}),a==="image"&&n.jsxs("div",{children:[n.jsx("input",{type:"file",accept:"image/*",onChange:p=>c(p.target.files?.[0]||null),className:"w-full",title:"Ø±ÛØ³ÙÙ
تاÙÙØ§Ø´"}),n.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"Ø±ÛØ³ÙÙ
تاÙÙØ§Ú"})]})]}),n.jsxs("div",{children:[n.jsx("h3",{className:"font-medium text-gray-700 mb-2",children:"ئÛÙÛÙ
ÙÛØ±"}),n.jsx("div",{className:"flex gap-2 mb-4",children:Lt.map(p=>n.jsx("button",{onClick:()=>b(p.id),className:`px-3 py-1 rounded ${m===p.id?"bg-blue-500 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,children:p.label},p.id))}),m!=="none"&&n.jsxs("div",{children:[n.jsx("input",{type:"range",min:"0",max:"100",value:x(),onChange:p=>A(Number(p.target.value)),className:"w-full"}),n.jsxs("div",{className:"flex justify-between text-sm text-gray-500",children:[n.jsx("span",{children:"0"}),n.jsx("span",{children:x()}),n.jsx("span",{children:"100"})]})]})]})]}),n.jsxs("div",{children:[n.jsx("h3",{className:"font-medium text-gray-700 mb-2",children:"Ø¦Ø§ÙØ¯ÙÙ ÙÛØ±ÛØ´"}),n.jsx("div",{className:"border rounded-lg overflow-hidden",children:n.jsx("img",{src:W||H,alt:"Ø¦Ø§ÙØ¯ÙÙ ÙÛØ±ÛØ´",className:"w-full object-contain"})})]})]}),n.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[n.jsx("button",{onClick:t,className:"px-4 py-2 text-gray-700 bg-gray-100 rounded hover:bg-gray-200",children:"ÛØ§Ø² ÙÛÚÙØ´"}),n.jsx("button",{onClick:w,className:"px-4 py-2 text-white bg-blue-500 rounded hover:bg-blue-600",children:"ساÙÙØ§Ø´"})]})]})}):null}function Ut({images:e,onDelete:r}){return n.jsxs("div",{children:[n.jsxs("h2",{className:"hidden text-gray-800 text-xl font-semibold mb-4",children:["Ø±ÛØ³ÙÙ
ÙÛØ±: ",e.length]}),n.jsx("div",{className:"gap-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:e.map(t=>t.file.type.includes("video")?n.jsx(Bt,{video:t},t.id):n.jsx($t,{image:t,onDelete:r},t.id))})]})}function Bt({video:e}){const r=URL.createObjectURL(e.file);return n.jsx("div",{className:"bg-white rounded-lg shadow-md p-3",children:n.jsx("video",{className:"rounded-lg aspect-square object-cover",loop:!0,muted:!0,autoPlay:!0,src:r})})}function $t({image:e,onDelete:r}
13){const[t,o]=d.useState(!1),[a,i]=d.useState(""),l=URL.createObjectURL(e.file),u=e.processedFile?URL.createObjectURL(e.processedFile):"",g=!e.processedFile,c=b=>{i(b)};return n.jsxs("div",{className:"bg-white rounded-lg shadow-md overflow-hidden",children:[n.jsx("div",{className:"relative",children:g?n.jsxs("div",{className:"relative",children:[n.jsx("img",{className:"w-full aspect-square object-cover opacity-50 transition-opacity duration-200",src:l,alt:`Ø±ÛØ³ÙÙ
Ø¨ÙØ± ØªÛØ±ÛÙ¾ ÙÙÙÙÙÙÛØ§ØªÙØ¯Û ${e.id}`}),n.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:n.jsxs("div",{className:"bg-black bg-opacity-50 px-4 py-2 rounded-lg",children:[n.jsx("div",{className:"inline-block animate-spin rounded-full h-4 w-4 border-t-2 border-b-2 border-white mr-2"}),n.jsx("span",{className:"text-white font-medium",children:"Ø¨ÙØ± ØªÛØ±ÛÙ¾ ÙÙÙÙÙÙÛØ§ØªÙدÛ..."})]})})]}):n.jsx("div",{className:"w-full aspect-square",style:{background:'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURb+/v////5nD/3QAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAUSURBVBjTYwABQSCglEENMxgYGAAynwRB8BEAgQAAAABJRU5ErkJggg==")',backgroundRepeat:"repeat"},children:n.jsx("img",{className:"w-full h-full object-cover transition-opacity duration-200",src:a||u,alt:`Ø¨ÙØ± ØªÛØ±ÛÙ¾ ÙÙÙÙÙØºØ§Ù Ø±ÛØ³ÙÙ
${e.id}`})})}),!g&&n.jsx("div",{className:"p-4 border-t border-gray-100",children:n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("button",{onClick:()=>o(!0),className:"flex items-center justify-center w-full gap-2 px-4 py-2 bg-blue-50 border border-blue-200 rounded-md hover:bg-blue-100 transition-colors",title:"تÛÚ¾Ø±ÙØ±ÙÛØ´",children:[n.jsx("svg",{className:"w-5 h-5 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})}),n.jsx("span",{className:"text-base text-blue-700",children:"تÛÚ¾Ø±ÙØ±ÙÛØ´"})]}),n.jsxs("a",{href:a||u,download:`processed-${e.id}.png`,className:"flex items-center justify-center w-full gap-2 px-4 py-2 bg-green-50 border border-green-200 rounded-md hover:bg-green-100 transition-colors",title:"ÚÛØ´ÛØ±ÛØ´",children:[n.jsx("svg",{className:"w-5 h-5 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),n.jsx("span",{className:"text-base text-green-700",children:"ÚÛØ´ÛØ±ÛØ´"})]}),n.jsxs("button",{onClick:()=>r(e.id),className:"flex items-center justify-center w-full gap-2 px-4 py-2 bg-red-50 border border-red-200 rounded-md hover:bg-red-100 transition-colors",title:"ئÛÚÛØ±ÛØ´",children:[n.jsx("svg",{className:"w-5 h-5 text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),n.jsx("span",{className:"text-base text-red-700",children:"ئÛÚÛØ±ÛØ´"})]})]})}),n.jsx(zt,{image:e,isOpen:t,onClose:()=>o(!1),onSave:c})]})}const ae="Xenova/modnet",U="briaai/RMBG-1.4",Wt=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,E={model:null,processor:null,isWebGPUSupported:!1,currentModelId:U,isIOS:Wt()};async function Gt(){const e=navigator.gpu;if(!e)return!1;try{return await e.requestAdapter()?(B.allowLocalModels=!1,B.backends?.onnx?.wasm&&(B.backends.onnx.wasm.proxy=!1),await new Promise(t=>setTimeout(t,100)),E.model=await Se.from_pretrained(ae,{device:"webgpu",config:{model_type:"modnet",architectures:["MODNet"]}}),E.processor=await Ne.from_pretrained(ae),E.isWebGPUSupported=!0,!0):!1}catch(r){return console.error("WebGPU initialization failed:",r),!1}}async function Re(e){try{if(E.isIOS)return console.log("iOS detected, using RMBG-1.4 model"),B.allowLocalModels=!1,B.backends?.onnx?.wasm&&(B.backends.onnx.wasm.proxy=!0),E.model=await Se.from_pretrained(U,{config:{model_type:"custom"}}),E.processor=await Ne.from_pretrained(U,{config:{do_normalize:!0,do_pad:!1,do_rescale:!0,do_resize:!0,image_mean:[.5,.5,.5],feature_extractor_type:"ImageFeatureExtractor",image_std:[1,1,1],resample:2,rescale_factor:.00392156862745098,size:{width:1024,height:1024}}}),E.currentModelId=U,!0;const r=e||U;if(r===ae&&await Gt())return E.currentModelId=ae,!0;
13if(B.allowLocalModels=!1,B.backends?.onnx?.wasm&&(B.backends.onnx.wasm.proxy=!0),E.model=await Se.from_pretrained(U,{progress_callback:t=>{console.log(`Loading model: ${Math.round(t*100)}%`)}}),E.processor=await Ne.from_pretrained(U,{revision:"main",config:{do_normalize:!0,do_pad:!0,do_rescale:!0,do_resize:!0,image_mean:[.5,.5,.5],feature_extractor_type:"ImageFeatureExtractor",image_std:[.5,.5,.5],resample:2,rescale_factor:.00392156862745098,size:{width:1024,height:1024}}}),E.currentModelId=U,!E.model||!E.processor)throw new Error("Failed to initialize model or processor");return E.currentModelId=r,!0}catch(r){if(console.error("Error initializing model:",r),e===ae)return console.log("Falling back to cross-browser model..."),Re(U);throw new Error(r instanceof Error?r.message:"Failed to initialize background removal model")}}function sr(){return{currentModelId:E.currentModelId,isWebGPUSupported:!!navigator.gpu,isIOS:E.isIOS}}async function Kt(e){if(!E.model||!E.processor)throw new Error("Model not initialized. Call initializeModel() first.");const r=await Ve.fromURL(URL.createObjectURL(e));try{const{pixel_values:t}=await E.processor(r),{output:o}=await E.model({input:t}),a=(await Ve.fromTensor(o[0].mul(255).to("uint8")).resize(r.width,r.height)).data,i=document.createElement("canvas");i.width=r.width,i.height=r.height;const l=i.getContext("2d");if(!l)throw new Error("Could not get 2d context");l.drawImage(r.toCanvas(),0,0);const u=l.getImageData(0,0,r.width,r.height);for(let b=0;b<a.length;++b)u.data[4*b+3]=a[b];l.putImageData(u,0,0);const g=await new Promise((b,O)=>i.toBlob(I=>I?b(I):O(new Error("Failed to create blob")),"image/png")),[c]=e.name.split(".");return new File([g],`${c}-bg-blasted.png`,{type:"image/png"})}catch(t){throw console.error("Error processing image:",t),new Error("Failed to process image")}}async function Ht(e){console.log("Processing images...");const r=[];for(const t of e)try{const o=await Kt(t);r.push(o),console.log("Successfully processed image",t.name)}catch(o){console.error("Error processing image",t.name,o)}return console.log("Processing images done"),r}function Vt(){return n.jsx("footer",{className:"bg-white border-t border-gray-200",children:n.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:n.jsxs("div",{className:"flex flex-col items-center justify-center",children:[n.jsxs("div",{className:"mb-6 text-center",children:[n.jsx("h2",{className:"text-2xl font-bold text-gray-800",children:"تÛÚ¯Ø³ÙØ²"}),n.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"Ø¦Ø§Ø±ÙØ§ تÛÚ¯ÙÙ ÚÙÙÙØ±ÙÛÛØªÙØ´ ÙÙØ±Ø§ÙÙ"})]}),n.jsxs("div",{className:"flex flex-wrap justify-center gap-6 mb-6",children:[n.jsx("a",{href:"https://uyghurai.vercel.app",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 transition-colors",children:"AI ئÛÙØºÛر"}),n.jsx("span",{className:"text-gray-300",children:"|"}),n.jsx("a",{href:"https://uyghursearch.vercel.app",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 transition-colors",children:"ئÛÙØºÛر Ø¦ÙØ²Ø¯ÛØ´"})]}),n.jsxs("div",{className:"flex gap-4 mb-6",children:[n.jsx("a",{href:"https://instagram.com/uyghurai",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-pink-500 transition-colors",children:n.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{fillRule:"evenodd",d:"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058
131.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z",clipRule:"evenodd"})})}),n.jsx("a",{href:"https://youtube.com/@UyghurAI",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-red-500 transition-colors",children:n.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"})})})]}),n.jsxs("div",{className:"text-center text-gray-500 text-sm",children:[n.jsxs("p",{children:["© ",new Date().getFullYear()," تÛÚ¯Ø³ÙØ². بارÙÙÙ Ú¾ÙÙÛÙÙØ§Ø± ÙÙØ
13ºØ¯ÙÙÙØ¯Û"]}),n.jsx("p",{className:"mt-1",children:"Uyghur AI ØªÛØ±ÙÙ¾ÙØ¯ÙÙ ÙØ§Ø³Ø§ÙدÙ"})]})]})})})}const qt=["/sample-images/image1.jpeg","/sample-images/image2.jpeg","/sample-images/image3.jpeg","/sample-images/image4.jpeg"],Yt=()=>{const e=window.navigator.userAgent,r=!!e.match(/iPad/i)||!!e.match(/iPhone/i),t=!!e.match(/WebKit/i);return r&&t&&!e.match(/CriOS/i)&&!e.match(/OPiOS/i)&&!e.match(/FxiOS/i)&&"ontouchend"in document};function Qt(){const[e,r]=d.useState(!0),[t,o]=d.useState(null),[a,i]=d.useState(!1),[l,u]=d.useState(!1),[g,c]=d.useState("briaai/RMBG-1.4"),[m,b]=d.useState(!1),[O,I]=d.useState([]);d.useEffect(()=>{if(Yt()){window.location.href="https://tegsiz.vercel.app/";return}const{isIOS:x}=sr();u(x),r(!1)},[]);const P=async x=>{const A=x.target.value;b(!0),o(null);try{if(!await Re(A))throw new Error("Ù ÙØ¯ÛÙÙÙ Ø¯ÛØ³ÙÛÙ¾ÙÛØ´ØªÛØ±ÛØ´ Ù ÛØºÙÛÙ¾ بÙÙØ¯Ù");c(A)}catch(h){h instanceof Error&&h.message.includes("Falling back")?c("briaai/RMBG-1.4"):o({message:h instanceof Error?h.message:"Ù ÙØ¯Û٠ئاÙÙ Ø§Ø´ØªÛØ±ÛØ´ Ù ÛØºÙÛÙ¾ بÙÙØ¯Ù"})}finally{b(!1)}},M=d.useCallback(async x=>{const A=x.map((h,w)=>({id:Date.now()+w,file:h,processedFile:void 0}));if(I(h=>[...h,...A]),O.length===0){r(!0),o(null);try{if(!await Re())throw new Error("Ø¦Ø§Ø±ÙØ§ ÙÛØ±ÛÙÛØ´ ÚÙÙÙØ±ÙÛÛØªÙØ´ Ù ÙØ¯ÛÙÙÙÙ Ø¯ÛØ³ÙÛÙ¾ÙÛØ´ØªÛØ±ÛØ´ Ù ÛØºÙÛÙ¾ بÙÙØ¯Ù");const{isWebGPUSupported:w}=sr();i(w)}catch(h){o({message:h instanceof Error?h.message:"ÙØ§Ù ÛÙÛ٠خاتاÙÙÙ ÙÛØ² Ø¨ÛØ±Ø¯Ù"}),I([]),r(!1);return}r(!1)}for(const h of A)try{const w=await Ht([h.file]);w&&w.length>0&&I(p=>p.map(D=>D.id===h.id?{...D,processedFile:w[0]}:D))}catch(w){console.error("Ø±ÛØ³ÙÙ Ø¨ÙØ± ØªÛØ±ÛÙ¾ ÙÙÙÙØ´ØªØ§ خاتاÙÙÙ:",w)}},[O.length]),L=async x=>{const A=x.clipboardData.items,h=[];for(const w of A)if(w.type.startsWith("image")){const p=w.getAsFile();p&&h.push(p)}h.length>0&&M(h)},Q=async x=>{try{const h=await(await fetch(x)).blob(),w=new File([h],"sample-image.jpg",{type:"image/jpeg"});M([w])}catch(A){console.error("ÙÛÙ ÛÙÛ Ø±ÛØ³ÙÙ ÙÛÙÙÛØ´ØªÛ خاتاÙÙÙ ÙÛØ² Ø¨ÛØ±Ø¯Ù:",A)}},{getRootProps:W,getInputProps:G,isDragActive:$,isDragAccept:K,isDragReject:H}=Dr({onDrop:M,accept:{"image/*":[".jpeg",".jpg",".png",".mp4"]}});return n.jsxs("div",{className:"min-h-screen bg-gray-50 font-kufam",onPaste:L,children:[n.jsx("nav",{className:"bg-white shadow-sm",children:n.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h1",{className:"text-2xl font-bold text-gray-800",children:"تÛÚ¯ÙÙ ÙÙÙ ÙÙÙÙØ´ Ø¨ÛØªÙ"}),!l&&n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("span",{className:"text-gray-600",children:"Ù ÙØ¯ÛÙ:"}),n.jsxs("select",{value:g,onChange:P,className:"bg-white border border-gray-300 rounded-md px-3 py-1 text-sm text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",disabled:!a,children:[n.jsx("option",{value:"briaai/RMBG-1.4"}),a&&n.jsx("option",{value:"Xenova/modnet"})]})]})]}),l&&n.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"iOS ئÛÚÛÙ Ø¦ÙØ´ÙÙØªÙÙÙÛØ§ØªÙØ§Ù Ø¦Ø§Ø±ÙØ§ ÙÛØ±ÛÙÛØ´ ÚÙÙÙØ±ÙÛÛØªÙØ´"})]})}),n.jsx("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",dir:"rtl",children:n.jsxs("div",{className:`grid ${O.length===0?"grid-cols-2 gap-8":"grid-cols-1"}`,children:[O.length===0&&n.jsxs("div",{className:"flex flex-col justify-center items-start",children:[n.jsx("img",{src:"hero.png",alt:"Ú¾ÛÙØ±Ø§Ù ÙØ§Ùغا٠ئادÛÙ ",className:"mb-6 w-full object-cover h-96"}),n.jsx("h2",{className:"text-3xl font-bold text-gray-800 mb-4",children:"Ø±ÛØ³Ù٠تÛÚ¯ ÙÛØ±ÛÙÛØ´ÙÙÙ ÚÙÙÙØ±ÙÛÛØªÙØ´"}),n.jsx("p",{className:"text-lg text-gray-600 mb-4",children:"ÙÛØ² Ù¾ÙØ±Ø³ÛÙØª Ú¾ÛÙØ³Ùز ÛÛ Ø¦Ø§Ù¾ØªÙ٠اتÙÙ ØªÙØ² Ú¾ÛÙ ÙÙÙÙØ¯Û"}),n.jsx("p",{className:"text-gray-500",children:"Ø±ÛØ³ÙÙ ÙÚÙØ²ÙÙ ÙÛÙÙÛÚ. سÛÙØ¦ÙÙ Ø¦ÙØ¯Ø±Ø§Ù Ø±ÛØ³ÙÙ ÙÚÙØ²Ù٠تÛÚ¯ÙÙÙ ÙÛØ±ÛÙÛØ´ÙÙÙ ÙÙØ³ÙÙ¾ ئÛÙÙÛÛØªÙدÛ. "})]}),n.jsxs("div",{className:O.length===0?"":"w-full",children:[n.jsxs("div",{...W(),className:`p-8 mb-8 border-2 border-dashed rounded-lg text-center cursor-pointer transition-colors duration-300 ease-in-out bg-white 14 ${K?"border-green-500 bg-green-50":""} 15 ${H?"border-red-500 bg-red-50":""} 16 ${$?"border-blue-500 bg-blue-50":"border-gray-300 hover:border-blue-500 hover:bg-blue-50"}
17 ${e||m?"cursor-not-allowed":""} 18 `,children:[n.jsx("input",{...G(),className:"hidden",disabled:e||m}),n.jsx("div",{className:"flex flex-col items-center gap-2",children:e||m?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"inline-block animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-blue-600 mb-2"}),n.jsx("p",{className:"text-lg text-gray-600",children:m?"Ù ÙØ¯Û٠ئاÙÙ Ø§Ø´ØªÛØ±ÛÛØ§ØªÙدÛ...":"Ø¦Ø§Ø±ÙØ§ ÙÛØ±ÛÙÛØ´ ÚÙÙÙØ±ÙÛÛØªÙØ´ Ù ÙØ¯ÛÙÙ ÙÛÙÙÙÙÙÛØ§ØªÙدÛ..."})]}):t?n.jsxs(n.Fragment,{children:[n.jsx("svg",{className:"w-12 h-12 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),n.jsx("p",{className:"text-lg text-red-600 font-medium mb-2",children:t.message}),g==="Xenova/modnet"&&n.jsx("button",{onClick:x=>{x.stopPropagation(),P({target:{value:"briaai/RMBG-1.4"}})},className:"px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors",children:"ÙÛÙ¾ ØªÙØ± ÙÛØ±Ú¯ÛÚ ÙÛØ´Ø±ÙÚ¯Û Ø¦Ø§ÙÙ Ø§Ø´ØªÛØ±ÛØ´"})]}):n.jsx(n.Fragment,{children:n.jsxs("div",{className:"flex flex-col items-center space-y-4 p-6 border-2 border-dashed border-purple-500 rounded-xl bg-gradient-to-r from-purple-50 to-blue-50 shadow-lg hover:shadow-xl transition-shadow",children:[n.jsxs("div",{className:"relative",children:[n.jsx("svg",{className:"w-16 h-16 text-purple-500 animate-bounce",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),n.jsx("div",{className:"absolute -bottom-2 left-1/2 transform -translate-x-1/2 w-4 h-4 bg-purple-300 rounded-full blur-md opacity-50"})]}),n.jsx("p",{className:"text-lg text-gray-700 font-medium animate-pulse",children:$?"Ø±ÛØ³ÙÙ ÙÛØ±ÙÙ Ø¨Û ÙÛØ±Ú¯Û ØªØ§Ø´ÙØ§Ú...":"Ø±ÛØ³ÙÙ ÙÛØ±ÙÙ Ø³ÛØ±ÛÙ¾ Ø¨Û ÙÛØ±Ú¯Û ØªØ§Ø´ÙØ§Ú"}),n.jsxs("p",{className:"text-sm text-gray-600",children:["ÙØ§ÙÙ ",n.jsx("span",{className:"text-purple-600 font-semibold underline cursor-pointer",children:"ÚÛÙÙÙ¾ Ú¾ÛØ¬Ø¬Ûت تاÙÙØ§Ú"})]})]})})})]}),O.length===0&&n.jsxs("div",{className:"bg-white rounded-lg p-6 shadow-sm",dir:"rtl",children:[n.jsx("h3",{className:"text-xl text-gray-700 font-semibold mb-4",children:"Ø±ÛØ³ÙÙ ÙÙÙÙ ÛØ بÛÙØ§Ø±Ù٠سÙÙØ§Ù¾ بÛÙÙÚ:"}),n.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:qt.map((x,A)=>n.jsx("button",{onClick:()=>Q(x),className:"relative aspect-square overflow-hidden rounded-lg hover:opacity-90 transition-opacity focus:outline-none focus:ring-2 focus:ring-blue-500",children:n.jsx("img",{src:x,alt:`Sample ${A+1}`,className:"w-full h-full object-cover"})},A))}),n.jsx("p",{className:"text-sm text-gray-500 mt-4",children:"بارÙÙÙ Ø±ÛØ³ÙÙ ÙÛØ± Ø¦ÛØ³ÙÛÙÙÚÙØ²Ø¯Û ÙÛØ±ÙÙÙ Ø¨ÙØ± ØªÛØ±ÛÙ¾ ÙÙÙÙÙÙØ¯Û ÛÛ Ú¾ÛÚÙØ§Ùدا٠٠ÛÙØ§Ø²ÙÙ ÛØªÙرغا ÙÛÙÙÛÙÙ ÛÙØ¯Û."})]}),n.jsx(Ut,{images:O,onDelete:x=>I(A=>A.filter(h=>h.id!==x))})]})]})}),n.jsx(Vt,{})]})}console.log("main.jsx");ur(document.getElementById("root")).render(n.jsx(d.StrictMode,{children:n.jsx(Qt,{})})); 19//# sourceMappingURL=index-c-bTSTcn.js.map
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.