function showResponse(result) {
//sets the payment type
window.payment_options = document.getElementById('payment_div').innerHTML;
document.getElementById('payment_div').innerHTML = result;
document.getElementById('back_to_payment_options').style.display = 'block';
window.last_payment_amount = document.getElementById('amount').value;
//check ok + do action
if(result.indexOf('RES:OK:wechat')>-1) {
tmp = result.split('RES:OK:wechat[:]');
tmp = tmp[1].split('[:]');
AjaxCall('?atf-payment&p=43t3tfvsdfewrf&type=create_payment_request&provider=wechat&local_id='+window.uniqueid+'&item_name='+tmp[0]+'&item_id='+tmp[1]+'&item_amount='+tmp[2]+'&item_currency='+tmp[3],false,'qrCodeHandling');
setInterval(function() { checkUpdate(purchase_desc,purchase_id,currency); }, 1000);
}
if(result.indexOf('RES:OK:card')>-1) {
tmp = result.split('RES:OK:card[:]');
tmp = tmp[1].split('[:]');
}
if(result.indexOf('RES:OK:paypal')>-1) {
//start pinging atf every 2 seconds for an update
window.paid = false;
setInterval(function() { AjaxCall('?atf-payment&p=43t3tfvsdfewrf&type=check_payment&uniqueid='+window.uniqueid,false,'paymentResponse'); }, 2000);
}
if(result.indexOf('RES:OK:alipay')>-1) {
//start pinging atf every 2 seconds for an update
window.paid = false;
setInterval(function() { AjaxCall('?atf-payment&p=43t3tfvsdfewrf&type=check_payment&uniqueid='+window.uniqueid,false,'paymentResponse'); }, 2000);
}
}
function checkUpdate() {
if(window.last_payment_amount!=document.getElementById('amount').value) {
clearInterval(window.check_payment_handle);
AjaxCall('?new_payment_request&type='+window.last_payment_type+'&price='+document.getElementById('amount').value+'&desc='+document.getElementById('purchase_desc').value+'¤cy='+document.getElementById('currency').value+'&id='+document.getElementById(purchase_id).value,false,'showResponse');
}
}
function cardPaymentHandling(result) {
//it worked or it didnt
if(result.indexOf('<[RES[OK')>-1) {
paymentSuccessful();
} else {
document.getElementById('status_image').src = 'https://cdn.atfgroup.com.cn/l4CK7K7N5YpGfJwKnyRXLOQLGgA9Eq7R.png';
document.getElementById('status_image').width = '110';
document.getElementById('status_image').height = '100%';
document.getElementById('payment_status').innerHTML = 'Sorry, your payment was not accepted. try again ';
}
}
function paymentSuccessful() {
document.getElementById('status_image').src = 'https://cdn.atfgroup.com.cn/FtaTgKhXMlAlecKoiKky3J6TzYQ0i7Ct.png';
document.getElementById('status_image').width = '115';
document.getElementById('status_image').height = '115';
document.getElementById('payment_status').innerHTML = 'Payment successful!';
document.getElementById('back_to_payment_options').style.display = 'none';
window.paid = true;
clearInterval();
}
function reloadPaymentOptions() {
if(window.payment_options!='') {
document.getElementById('payment_div').innerHTML = window.payment_options;
//reload stripe scripts
showCardPayment();
}
}
function checkPaymentSuccess(payment_id) {
//ping paymentid back, is it paid yet? payment_id
AjaxCall('?atf-payment&p=43t3tfvsdfewrf&type=check_payment&payment_id='+payment_id,false,'paymentResponse');
}
function paymentResponse(payload) {
if(payload.indexOf('<[RES[PAID')>-1) {
if(!window.paid) {
paymentSuccessful();
}
}
}
function qrCodeHandling(payload) {
if(payload.indexOf('<[RES[SUCCESS[[')>-1) {
tmp = payload.split('SUCCESS[[');
tmp = tmp[1].split(']]]');
payload = JSON.parse(tmp[0]);
document.getElementById('status_image').src = payload['qr_code'];
//ping every 2 seconds for an update for payment
window.paid = false;
window.check_payment_handle = setInterval(function() { checkPaymentSuccess(payload.payment_id); }, 4000);
}
}
function showCardPayment() {
window.paymentHandler = StripeCheckout.configure({
key: 'pk_live_c6Pocns6JlCg5svExofTLjbP',
image: 'https://stripe.com/img/documentation/checkout/marketplace.png',
locale: 'auto',
token: function(token) {
//show charging card message and send token to core
document.getElementById('payment_status').innerHTML = 'Charging your card... please wait';
AjaxCall('?type=charge_card&uniqueid='+window.uniqueid+'&token='+token.id,false,'cardPaymentHandling');
}
});
document.getElementById('cardPayment').addEventListener('click', function(e) {
window.last_payment_type='card';
// Open Checkout with further options:
window.paymentHandler.open({
name: document.getElementById('purchase_desc').value,
description: document.getElementById('purchase_desc').value,
currency: document.getElementById('currency').value,
amount: parseFloat(document.getElementById('amount').value+"00")
});
// send update to us
AjaxCall('?new_payment_request&type=card&price='+document.getElementById('amount').value+'&desc='+document.getElementById('purchase_desc').value+'¤cy='+document.getElementById('currency').value+'&id='+document.getElementById('purchase_id').value,false,'showResponse');
e.preventDefault();
});
// Close Checkout on page navigation:
window.addEventListener('popstate', function() {
window.paymentHandler.close();
});
}
function loadScript(url, callback){
var script = document.createElement("script");
script.type = "text/javascript";
if (script.readyState){ //IE
script.onreadystatechange = function(){
if (script.readyState == "loaded" ||
script.readyState == "complete"){
script.onreadystatechange = null;
callback();
}
};
} else { //Others
script.onload = function(){
callback();
};
}
script.src = url;
document.getElementsByTagName("head")[0].appendChild(script);
}
window.job_title = '';
window.account_id = 0;
window.stored_html = '';
function showLogin() {
window.login_div = createWindow("Login", '
Login Haven\'t registered yet? register.
');
//detect enter key press
detectKeyPress('lbpass','doLogin');
//login leadbox animate start
/**var current = null;
document.getElementById('lbemail').addEventListener('focus', function(e) {
if (current) current.pause();
current = anime({
targets: '.check1',
strokeDashoffset: {
value: 0,
duration: 700,
easing: 'easeOutQuart'
},
strokeDasharray: {
value: '240 1386',
duration: 700,
easing: 'easeOutQuart'
}
});
});
document.getElementById('lbpass').addEventListener('focus', function(e) {
if (current) current.pause();
current = anime({
targets: '.check1',
strokeDashoffset: {
value: -336,
duration: 700,
easing: 'easeOutQuart'
},
strokeDasharray: {
value: '240 1386',
duration: 700,
easing: 'easeOutQuart'
}
});
}); **/
//login leadbox animate end
};
function doLogin() {
window.username = document.getElementById('lbemail').value;
password = document.getElementById('lbpass').value;
if(window.username.length>3&&password.length>3) {
//show waiting
window.stored_html = document.getElementById('login_div').innerHTML;
if(document.getElementById('login_button')){
//if login_button, just change that
document.getElementById('login_button').value = "Logging in...";
document.getElementById('login_button').disabled = true;
} else {
document.getElementById('login_div').innerHTML = ' Checking credentials...';
}
AjaxCall("?atf_do_login&username="+btoa(encodeURIComponent(window.username))+"&password="+btoa(encodeURIComponent(password)),false,"loginReply");
} else {
if(document.getElementById('lbpass').value==''&&/^\d+$/.test(document.getElementById('lbemail').value)&&document.getElementById('lbemail').value.length>6) {
sendCode();
} else {
message = 'Please enter your phone number / username and password.';
if(document.getElementById('lbpass').placeholder=='密码'||window.lang=='cn') {
window.lang = 'cn';
message = '请输入您的电话号码和密码。';
}
document.getElementById('code_error').innerHTML = message;
}
}
};
function loginReply(data) {
if(data.indexOf('[RES[OK')>-1) {
//show success
//document.getElementById('biscuitsDialog').style.textAlign = 'center';
//document.getElementById('biscuitsDialog').style.padding = '8px';
if(document.getElementById('login_success')){
document.getElementById('login_success').innerHTML = "Login successful!
";
document.getElementById('login_success').style.textAlign = 'center';
} else {
document.getElementById('login_div').innerHTML = "Login successful!
";
document.getElementById('login_div').style.textAlign = 'center';
}
window.loggedin = true;
//get the account_id
tmp = data.split('[OK:');
tmp = tmp[1].split(']]');
window.account_id = tmp[0];
if(window.job_id>0) {
sendAccountDetailsToClient(window.job_id,window.employer_id,window.job_title);
}
//wait 1 seconds and reload
setTimeout(function(){
window.location.reload(1);
}, 1000);
} else {
document.getElementById('login_div').innerHTML = window.stored_html;
document.getElementById('lbemail').value = window.username;
window.stored_html = '';
document.getElementById('code_error').innerHTML = "Sorry your username or password is incorrect.";
}
};
function sendAccountDetailsToClient(job_id,employer_id,account_id,job_title) {
//show applying
closeRegister();
var div = document.createElement('div');
div.setAttribute('id','biscuitsDialog');
div.style.position = 'fixed';
div.style.zIndex = '20';
div.style.background = '#fff';
div.style.color = 'black';
div.style.boxShadow = '2px 3px 2px #dde2ea';
div.style.textAlign = 'center';
div.style.padding = '8px';
div.style.paddingBottom = '25px';
document.body.appendChild(div);
document.getElementById('biscuitsDialog').innerHTML = " Sending your application to the employer...";
try {
centerDialog('biscuitsDialog');
} catch(err) {}
account_details = "";
if(typeof account_id != null&&account_id>0) {
account_details = "&account_id="+account_id;
}
if(typeof job_title != null&&job_title!='') {
account_details += "&title="+btoa(job_title);
}
if(typeof window.subject_prefix != null&&window.subject_prefix!='') {
account_details += "&subject_prefix="+btoa(window.subject_prefix);
}
AjaxCall("?atf_send_application&job_id="+job_id+"&employer_id="+employer_id+account_details,false,"applicationReply");
};
function applicationReply(reply) {
if(reply.indexOf('ERROR:notloggedin')>-1) {
showLogin();
} else if(reply.indexOf('RES[nocv]')>-1) {
showFinalStep();
} else if(reply.indexOf('RES[alreadyapplied]')>-1) {
document.getElementById('biscuitsDialog').innerHTML = " You\'ve already applied for this job. Please wait for a reply from the employer shortly.";
} else if(reply.indexOf('RES[OK')>-1) {
document.getElementById('biscuitsDialog').innerHTML = " Application sent successfully!";
} else {
document.getElementById('biscuitsDialog').innerHTML = " Sorry, we couldnt process your application right now, please try again.";
}
if(reply.indexOf('ERROR:notloggedin')==-1) {
window.loggedin = true;
}
try {
centerDialog('biscuitsDialog');
} catch(err) {
console.log("Dialog Error check")
}
};
function isLoggedIn() {
if(!window.loggedin) {
return window.loggedin;
} else {
return true;
}
};
function closeRegister() {
if(document.getElementById('biscuitsDialog')) {
var elem = document.getElementById("biscuitsDialog");
elem.parentElement.removeChild(elem);
}
};
function doFinalizeAccount() {
//handle file
var fileSelect = document.getElementById('cv');
var files = fileSelect.files;
var formData = new FormData();
var validated = true;
var validationErrors = '';
// Loop through each of the selected files.
var filesAttachedCount = 0;
for (var i = 0; i < files.length; i++) {
var file = files[i];
// Check the file type.
if (file.name.indexOf('.doc')==-1&&file.name.indexOf('.docx')==-1&&file.name.indexOf('.pdf')==-1&&file.name.indexOf('*.txt')==-1&&file.name.indexOf('.odt')==-1) {
validationErrors += 'Sorry, could not add file: '+file.name+' because it is not a .doc, .docx, .pdf, .odt or .txt file';
continue;
}
// Add the file to the request.
formData.append('cvs[]', file, file.name);
filesAttachedCount++;
}
//sort out qualification and nationality
nationality = document.getElementById('lbnationality').value;
if(document.getElementById('lbnationality').value=='other') {
nationality = document.getElementById('lbnationalitycustom').value;
}
qualification = document.getElementById('lbqualification').value;
if(document.getElementById('lbqualification').value=='other') {
qualification = document.getElementById('lbqualificationcustom').value;
}
//validation
if(!(qualification.length>1)) {
validated = false;
validationErrors += 'You must select a qualification ';
} else if(!(nationality.length>3)) {
validated = false;
validationErrors += 'You must select your nationality ';
} else if(!(filesAttachedCount>0)) {
validated = false;
validationErrors += 'You must choose your C.V. or resume ';
}
if(validated) {
// add nationality and qualification
formData.append('nationality', nationality);
formData.append('qualification', qualification);
formData.append('id', window.account_id);
//send data
AjaxPostCall('?upload_cv_nationality_qualification',formData,'doAccountFinalStep');
} else {
document.getElementById('code_error').innerHTML = "Sorry, please check the following and click done again: "+validationErrors;
}
};
function doAccountFinalStep(res) {
if (res.indexOf('RES[OK')>-1) {
//handle final action
if(window.job_id>0) {
sendAccountDetailsToClient(window.job_id,window.employer_id,window.account_id);
} else {
//show success message
document.getElementById('biscuitsDialog').style.textAlign = 'center';
document.getElementById('biscuitsDialog').style.padding = '8px';
document.getElementById('biscuitsDialog').innerHTML = " Registration success!";
}
} else {
document.getElementById('code_error').innerHTML = 'Sorry, that didn\'t work, please try again.';
}
};
function doNationality() {
if(document.getElementById('lbnationality').value=='other') {
document.getElementById('lbnationality').style.display = 'none';
document.getElementById('lbnationalitycustom').style.display = 'block';
}
};
function doQualification() {
if(document.getElementById('lbqualification').value=='other') {
document.getElementById('lbqualification').style.display = 'none';
document.getElementById('lbqualificationcustom').style.display = 'block';
}
};
function showFinalStep() {
//go to next step
div_html = "Your nationality: - select - Australian Canadian Irish New Zealander South African United States of America United Kingdom Other Highest qualification: - select - High School (Or High School Equivalent) Bachelor Degree Master Degree Doctorate (PHD) Diploma Related Certificate Other Upload C.V. or Resume ";
try {
document.getElementById('registration_fields').innerHTML = div_html;
} catch(err) {
document.getElementById('biscuitsDialog').innerHTML = 'Please complete your details to continue:
'+div_html;
document.getElementById('biscuitsDialog').style.width = '200px';
document.getElementById('biscuitsDialog').style.textAlign = 'left';
}
detectKeyPress('cv','doFinalizeAccount');
};
function _accountSettings(title, contentHtmlorLink) {
//open a popup and point it at core
createWindow(title, contentHtmlorLink);
};
function codeReply(res) {
if (res.indexOf('RES[ERROR:wait 60 seconds')>-1) {
if(document.getElementById('code_error')) {
document.getElementById('code_error').innerHTML = 'Code was sent, Please wait 60 seconds before sending another code';
} else {
alert('Code was sent, Please wait 60 seconds before sending another code');
}
}
};
function sendCode() {
phone = document.getElementById('lbemail').value;
if(phone.startsWith("+")) { phone = phone.replace('+',"00"); }
if(/^\d+$/.test(phone)&&phone.length>6) {
document.getElementById('lbpass').setAttribute('type','text'); //type=text needed for tulkan, add support on other sites, need to detect type=input
placeholder = 'Enter the code sent to your phone';
sent_message = 'Code Sent!';
if(document.getElementById('lbpass').placeholder=='密码'||window.lang=='cn') {
placeholder = '输入发送到您手机的代码';
sent_message = '验证码已发送至您的手机,请查收!';
window.lang = 'cn';
}
document.getElementById('lbpass').setAttribute('placeholder',placeholder);
document.getElementById('code_error').innerHTML = ""+sent_message+" ";
AjaxCall("?new_code_request&contact="+btoa(encodeURIComponent(phone))+(window.lang?"&lang="+window.lang:""),false,"codeReply");
} else {
message = "Please enter a numeric value for the Phone number, at least 6 digits long";
if(document.getElementById('lbpass').placeholder=='密码'||window.lang=='cn') {
message = "请输入电话号码的数值,至少6位数字";
}
if(document.getElementById('code_error')) {
document.getElementById('code_error').innerHTML = message;
} else {
alert(message);
}
}
};
function showConversation(html) {
$('#previous_conversations').hide();
document.getElementById('result').innerHTML = JSON.parse(atob(html));
}
function previousConversations(res) {
killWindows();
windowShow('previous_conversations');
document.getElementById('previous_conversations_content').innerHTML = res;
}
function handleCode() {
document.getElementById('login_div_password_div').style.display = 'block';
document.getElementById('login_div_new_password_div').style.display = 'block';
document.getElementById('lbpass').type = 'text';
document.getElementById('login_button').value = (window.lang=='en'?"Register":"注册");
document.getElementById('login_div1').setAttribute('onsubmit','checkCode();event.preventDefault();');
sendCode();
}
function checkCode() {
error = '';
if(document.getElementById('new_lbpass').value.length<5) {
error += 'Password must be longer than 4 characters ';
}
if(document.getElementById('new_lbpass_2').value!=document.getElementById('new_lbpass').value) {
error += 'Password and Confirm Password must be the same ';
}
if(document.getElementById('lbpass').value.length!=4) {
error += "Code must be 4 characters long, please check";
}
if(error=='') {
//login
AjaxCall("/?atf_do_login&username="+btoa(document.getElementById('lbemail').value)+"&password="+btoa(document.getElementById('lbpass').value),false,'setPassword');
document.getElementById('login_button').value = (window.lang=='en'?"Saving...":"请稍等。。。");
} else {
document.getElementById('code_error').innerHTML = error;
}
}
function setPassword() {
AjaxCall("?atf_resetpassword="+document.getElementById('lbemail').value+"&code="+document.getElementById('new_lbpass').value,false,"passwordSetFinish");
}
function passwordSetFinish() {
window.location.href = '/';
}
function registerReply(res) {
//+"&new_password="+btoa(encodeURIComponent(document.getElementById('new_lbpass').value)
if(res.indexOf('[OK:')>-1) {
tmp = res.split('[OK:');
tmp = tmp[1].split(']]');
AjaxCall("?atf_resetpassword="+document.getElementById('lbemail').value+"&reset_code="+tmp[0]+"&new_password="+document.getElementById('lbpass').value,false,"registerReply");
} else {
document.getElementById('code_error').innerHTML = (window.lang=='en'?"Sorry, an error occured, please try again":"抱歉,发生错误,请重试");
}
}
function showRegister() {
windowShow('login_div');
document.getElementById('login_div_title').innerHTML = (window.lang=='en'?"Register":"注册账户");
document.getElementById('code_text').innerHTML = (window.lang=='en'?"Enter the code sent to your phone":"输入发送到您手机的验证码");
document.getElementById('lbpass').placeholder = (window.lang=='en'?"Enter code":"输入验证码");
windowHide("login_div_password_div");
document.getElementById('register_text').style.display = 'none';
document.getElementById('login_button').value = (window.lang=='en'?"Send Code":"发送验证码");
document.getElementById('login_div1').setAttribute('onsubmit', 'handleCode();event.preventDefault();');
}
function windowShow(id){
document.getElementById(id).style.display='flex';
}
function windowHide(id){
document.getElementById(id).style.display='none';
}
function ajaxRequest(){
var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"]; //activeX versions to check for in IE
if(window.ActiveXObject) { //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
for (var i=0; i maybe use this later, for now pass directly to returnFunction if setActive
if (typeof window[returnFunction] == 'function') {
window[returnFunction](this.response);
}
};
// Send the Data.
xhr.send(formData);
}
function AjaxCall(url,returnId,returnFunction,append) {
var mygetrequest=new ajaxRequest();
mygetrequest.onreadystatechange=function(){
if (mygetrequest.readyState==4){
if (mygetrequest.status==200 || window.location.href.indexOf("http")==-1){
if(typeof returnId != 'undefined'&returnId!=false) {
if(typeof append != 'undefined'&append!=false) {
document.getElementById(returnId).innerHTML=document.getElementById(returnId).innerHTML+mygetrequest.responseText;
} else {
document.getElementById(returnId).innerHTML=mygetrequest.responseText;
}
}
if (typeof window[returnFunction] == 'function') {
window[returnFunction](mygetrequest.responseText);
}
}
}
};
mygetrequest.open("GET", url, true);
mygetrequest.send(null);
}
function CreateDreamModal({ onClose, theme, dreamDescription, setDreamDescription, dreamError, setDreamError }) {
const dreamTextareaRef = useRef(null);
const handleGenerateDream = () => {
if (dreamDescription.length < 10) {
setDreamError('Please enter at least 10 characters to describe your dream guy/girl.');
} else {
setDreamError('');
onClose();
setTimeout(() => {
alert('Another Perfect Fantasy created! Check back soon.');
}, 2000);
}
};
return React.createElement(
'div',
{
className: 'fixed inset-0 bg-black bg-opacity-80 backdrop-blur-sm flex items-center justify-center z-50',
onClick: onClose
},
React.createElement(
'div',
{
className: 'bg-gradient-to-br from-purple-800 to-orange-500 p-6 rounded-lg max-w-md w-full border-2 border-yellow-400 shadow-[0_0_20px_rgba(255,215,0,0.5)]',
onClick: e => e.stopPropagation()
},
React.createElement(
'h2',
{ className: 'text-2xl font-bebas text-yellow-300' },
'Describe Your Dream Fantasy'
),
React.createElement('textarea', {
ref: dreamTextareaRef,
className: 'w-full mt-4 p-2 rounded text-black',
rows: 4,
value: dreamDescription,
onChange: e => setDreamDescription(e.target.value),
placeholder: 'Describe your perfect fantasy, what does your perfect man/woman look like...'
}),
dreamError && React.createElement('p', { className: 'text-red-300 mt-2' }, dreamError),
React.createElement(
'div',
{ className: 'mt-4 flex justify-end space-x-2' },
React.createElement(
'button',
{
onClick: onClose,
className: 'px-4 py-2 bg-gray-500 hover:bg-gray-600 rounded text-white'
},
'Cancel'
),
React.createElement(
'button',
{
onClick: handleGenerateDream,
className: `px-4 py-2 ${theme.button} rounded text-white`
},
'Generate'
)
)
)
);
}
/**
* support functions
**/
// AJAX Response Handler
function handleAjaxResponse(response) {
if (response.includes('<[RES[OK')) {
if (response.includes('OK:{')) {
const match = response.match(/OK:(\d+)/);
const id = match && match[1] ? parseInt(match[1]) : null;
if (id) {
return id; // Return ID for new model
}
}
return true; // Success for edits/uploads
} else {
const match = response.match(/FAIL:(.+)\]\]>/);
const errorMsg = match && match[1] ? match[1] : 'Unknown error occurred.';
return errorMsg; // Return error message
}
}
// Fallback UI for missing router
function FallbackUI() {
return React.createElement(
'div',
{ className: 'min-h-screen bg-gradient-to-br from-pink-500 to-purple-900 flex flex-col items-center justify-center text-center p-4' },
React.createElement('h1', { className: 'text-4xl font-[\'Bebas_Neue\'] text-yellow-300' }, 'Routing Error'),
React.createElement('p', { className: 'text-xl mt-4' }, 'Failed to load routing components. Please check your internet connection or try again later.'),
React.createElement('p', { className: 'text-sm mt-2' }, 'Check the console for detailed errors.')
);
}
// Test Component
function TestComponent() {
console.log('TestComponent rendering');
return React.createElement(
'div',
{ className: 'min-h-screen bg-gradient-to-br from-pink-500 to-purple-900 flex flex-col items-center justify-center text-center p-4' },
React.createElement('h1', { className: 'text-4xl font-[\'Bebas_Neue\'] text-yellow-300' }, 'Test Render'),
React.createElement('p', { className: 'text-xl mt-4' }, 'React is rendering correctly, but routing may be failing.')
);
}
//functions to run after page load
window.onload = () => {
// Check dependencies
console.log('Checking dependencies...');
if (!window.React) console.error('React not found. Ensure the CDN is loaded: https://cdnjs.cloudflare.com/ajax/libs/react/18.2.0/umd/react.production.min.js');
if (!window.ReactDOM) console.error('ReactDOM not found. Ensure the CDN is loaded: https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.2.0/umd/react-dom.production.min.js');
if (!window.ReactRouterDOM || !window.ReactRouterDOM.BrowserRouter || !window.ReactRouterDOM.Routes || !window.ReactRouterDOM.Route || !window.ReactRouterDOM.Link || !window.ReactRouterDOM.useParams || !window.ReactRouterDOM.useNavigate || !window.ReactRouterDOM.useLocation) {
console.error('ReactRouterDOM components not found. Ensure the CDN is loaded: https://unpkg.com/react-router-dom@6.26.2/dist/umd/react-router-dom.production.min.js');
} else {
console.log('ReactRouterDOM components loaded:', {
BrowserRouter: !!window.ReactRouterDOM.BrowserRouter,
Routes: !!window.ReactRouterDOM.Routes,
Route: !!window.ReactRouterDOM.Route,
Link: !!window.ReactRouterDOM.Link,
useParams: !!window.ReactRouterDOM.useParams,
useNavigate: !!window.ReactRouterDOM.useNavigate,
useLocation: !!window.ReactRouterDOM.useLocation
});
}
const sitemapContent = `<\?xml version="1.0" encoding="UTF-8"?>
https://mypf.cc/
2025-08-04
daily
1.0
${models.map(model => `
https://mypf.cc/model/${model.slug}
2025-08-04
weekly
0.8
`).join('')}
`;
document.getElementById('sitemap').textContent = sitemapContent;
};
// Payment Modal
function PaymentModal({ model, onClose, theme, message }) {
const [cardNumber, setCardNumber] = useState('');
const [expiry, setExpiry] = useState('');
const [cvv, setCvv] = useState('');
const [error, setError] = useState('');
const handlePayment = () => {
if (!cardNumber || cardNumber.length < 16 || !/^\d+$/.test(cardNumber)) {
setError('Please enter a valid 16-digit card number.');
} else if (!expiry || !/^\d{2}\/\d{2}$/.test(expiry)) {
setError('Please enter a valid expiry date (MM/YY).');
} else if (!cvv || cvv.length < 3 || !/^\d+$/.test(cvv)) {
setError('Please enter a valid CVV (3-4 digits).');
} else {
setError('');
alert(`Payment of $${model.subscriptionPrice} successful! You have 30 days of access to ${model.name}'s premium content.`);
onClose(true);
}
};
return React.createElement(
'div',
{ className: 'fixed inset-0 modal flex items-center justify-center z-50', onClick: () => onClose(false) },
React.createElement(
'div',
{ className: 'modal-content p-6 rounded-lg max-w-md w-full', onClick: e => e.stopPropagation() },
React.createElement('h2', { className: 'text-2xl font-[\'Bebas_Neue\'] text-yellow-300' }, `Subscribe to ${model.name}`),
React.createElement('p', { className: 'text-lg mt-2' }, message || `Pay $${model.subscriptionPrice} for 30 days of premium access`),
React.createElement('input', {
type: 'text',
className: 'w-full mt-4 p-2 rounded text-black',
value: cardNumber,
onChange: e => setCardNumber(e.target.value),
placeholder: 'Card Number (16 digits)',
maxLength: '16'
}),
React.createElement(
'div',
{ className: 'flex space-x-2 mt-2' },
React.createElement('input', {
type: 'text',
className: 'w-1/2 p-2 rounded text-black',
value: expiry,
onChange: e => setExpiry(e.target.value),
placeholder: 'MM/YY',
maxLength: '5'
}),
React.createElement('input', {
type: 'text',
className: 'w-1/2 p-2 rounded text-black',
value: cvv,
onChange: e => setCvv(e.target.value),
placeholder: 'CVV',
maxLength: '4'
})
),
error && React.createElement('p', { className: 'text-red-300 mt-2' }, error),
React.createElement(
'div',
{ className: 'mt-4 flex justify-end space-x-2' },
React.createElement(
'button',
{
onClick: () => onClose(false),
className: 'px-4 py-2 bg-gray-500 hover:bg-gray-600 rounded text-white'
},
'Cancel'
),
React.createElement(
'button',
{
onClick: handlePayment,
className: `px-4 py-2 ${theme.button} rounded text-white`
},
'Pay Now'
)
)
)
);
}
function ModelChat({ model, theme, isSubscribed, setIsSubscribed, setShowPaymentModal }) {
const [messages, setMessages] = React.useState([]);
const [chatInput, setChatInput] = React.useState('');
const [isTyping, setIsTyping] = React.useState(false);
const chatContainerRef = React.useRef(null);
React.useEffect(() => {
if (!model) return;
console.log(`Fetching chat history for ${model.name}`);
setTimeout(() => {
const mockHistory = {
messages: [
{ message: `Hi! I'm ${model.name}!`, from: 'model' },
{ message: 'Hey, nice to meet you!', from: 'user' }
]
};
setMessages(mockHistory.messages);
if (chatContainerRef.current) {
chatContainerRef.current.scrollTop = chatContainerRef.current.scrollHeight;
}
}, 1000);
}, [model]);
React.useEffect(() => {
if (!isTyping || !model) return;
const interval = setInterval(async () => {
console.log(`Polling /?chat_replies for ${model.name}`);
setTimeout(() => {
const mockReply = {
model_name: model.name,
message: `This is ${model.name} responding to you!`
};
if (mockReply.model_name === model.name) {
setMessages(prev => [...prev, { message: mockReply.message, from: 'model' }]);
setIsTyping(false);
if (chatContainerRef.current) {
chatContainerRef.current.scrollTop = chatContainerRef.current.scrollHeight;
}
}
}, 1000);
}, 2000);
return () => clearInterval(interval);
}, [isTyping, model]);
const handleSendMessage = () => {
if (!chatInput.trim()) return;
const userMessageCount = messages.filter(m => m.from === 'user').length;
if (!isSubscribed && userMessageCount >= 5) {
setShowPaymentModal(true);
return;
}
console.log(`Posting to /?send_chat: message=${chatInput}&model=${model.name}`);
setTimeout(() => {
setMessages(prev => [...prev, { message: chatInput, from: 'user' }]);
setIsTyping(true);
setChatInput('');
if (chatContainerRef.current) {
chatContainerRef.current.scrollTop = chatContainerRef.current.scrollHeight;
}
}, 500);
};
const handleKeyPress = (e) => {
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault();
handleSendMessage();
}
};
return React.createElement(
'div',
{ className: 'mt-6 w-full max-w-2xl' },
React.createElement('h2', { className: 'text-2xl font-bebas text-yellow-300' }, `Chat with ${model.name}`),
React.createElement(
'div',
{ className: 'chat-container bg-white bg-opacity-10 rounded-lg p-4 mt-2', ref: chatContainerRef },
messages.length === 0
? React.createElement('p', { className: 'text-sm' }, `Start chatting with ${model.name}!`)
: messages.map((msg, index) =>
React.createElement(
'div',
{
key: index,
className: `mb-2 ${msg.from === 'user' ? 'text-right text-blue-300' : 'text-left text-yellow-300'}`
},
React.createElement(
'span',
{
className: `inline-block p-2 rounded-lg ${
msg.from === 'user' ? 'bg-blue-600 bg-opacity-30' : 'bg-yellow-600 bg-opacity-30'
}`
},
React.createElement('strong', null, msg.from === 'user' ? 'You' : model.name),
': ',
msg.message
)
)
),
isTyping &&
React.createElement(
'div',
{ className: 'text-left text-yellow-300' },
React.createElement(
'span',
{ className: 'inline-block p-2 rounded-lg bg-yellow-600 bg-opacity-30' },
`${model.name}: Typing...`
)
)
),
React.createElement(
'div',
{ className: 'mt-2 flex space-x-2' },
React.createElement('input', {
type: 'text',
className: 'w-full p-2 rounded text-black',
value: chatInput,
onChange: e => setChatInput(e.target.value),
onKeyPress: handleKeyPress,
placeholder: isSubscribed || messages.filter(m => m.from === 'user').length < 5
? `Message ${model.name}...`
: 'Subscribe to chat more',
disabled: !isSubscribed && messages.filter(m => m.from === 'user').length >= 5
}),
React.createElement(
'button',
{
onClick: handleSendMessage,
className: `px-4 py-2 ${theme.button} rounded text-white ${
!isSubscribed && messages.filter(m => m.from === 'user').length >= 5 ? 'opacity-50 cursor-not-allowed' : ''
}`,
disabled: !isSubscribed && messages.filter(m => m.from === 'user').length >= 5
},
'Send'
)
),
!isSubscribed &&
messages.filter(function(m) { return m.from === 'user'; }).length >= 5 &&
React.createElement('p',
{ className: 'text-red-300 mt-2' },
'Subscribe to send more messages!')
);
}
function RegisterModal({ onClose, theme }) {
const [name, setName] = React.useState('');
const [username, setUsername] = React.useState('');
const [password, setPassword] = React.useState('');
const [passwordConfirm, setPasswordConfirm] = React.useState('');
const [error, setError] = React.useState('');
const handleRegister = () => {
if (!name || !username || !password || !passwordConfirm) {
setError('Please fill in all fields.');
return;
}
if (name.length < 4) {
setError('Name must be at least 4 characters.');
return;
}
if (password.length < 7 || !/[a-zA-Z]/.test(password) || !/[0-9]/.test(password)) {
setError('Password must be at least 7 characters with letters and numbers.');
return;
}
if (password !== passwordConfirm) {
setError('Passwords do not match.');
return;
}
const formData = new FormData();
formData.append('pw', password);
formData.append('pw2', passwordConfirm);
formData.append('email', username);
formData.append('name', name);
window.handleRegisterResponse = (response) => {
if (response === '<[RES[OK]]>') {
setError('');
setTimeout(() => window.location.reload(), 3000);
} else if (response.startsWith('<[RES[ERROR:')) {
const errorMessage = response.match(/ERROR:(.+?)\]\]>/)[1];
setError(errorMessage);
} else {
setError('Registration failed. Please try again.');
}
};
try {
AjaxPostCall('?register', formData, 'handleRegisterResponse');
} catch (err) {
setError('Registration failed. Please try again.');
}
};
const handleBackdropMouseDown = (e) => {
if (e.target === e.currentTarget) {
onClose();
}
};
return React.createElement(
'div',
{
className: 'fixed inset-0 bg-black bg-opacity-80 backdrop-blur-sm flex items-center justify-center z-50',
onMouseDown: handleBackdropMouseDown
},
React.createElement(
'div',
{
className: 'bg-gradient-to-br from-purple-800 to-orange-500 p-6 rounded-lg max-w-md w-full border-2 border-yellow-400 shadow-[0_0_20px_rgba(255,215,0,0.5)]',
onClick: e => e.stopPropagation()
},
React.createElement('h2', { className: 'text-2xl font-bebas text-yellow-300 text-center' }, 'Register'),
React.createElement('input', {
type: 'text',
className: 'w-full mt-4 p-2 rounded text-black',
value: name,
onChange: e => setName(e.target.value),
placeholder: 'Name',
onClick: e => e.stopPropagation()
}),
React.createElement('input', {
type: 'text',
className: 'w-full mt-2 p-2 rounded text-black',
value: username,
onChange: e => setUsername(e.target.value),
placeholder: 'Username/Email/Phone',
onClick: e => e.stopPropagation()
}),
React.createElement('input', {
type: 'password',
className: 'w-full mt-2 p-2 rounded text-black',
value: password,
onChange: e => setPassword(e.target.value),
placeholder: 'Password',
onClick: e => e.stopPropagation()
}),
React.createElement('input', {
type: 'password',
className: 'w-full mt-2 p-2 rounded text-black',
value: passwordConfirm,
onChange: e => setPasswordConfirm(e.target.value),
placeholder: 'Confirm Password',
onClick: e => e.stopPropagation()
}),
error && React.createElement('p', { className: 'text-red-300 mt-2 text-center' }, error),
React.createElement(
'div',
{ className: 'mt-4 flex justify-end space-x-2' },
React.createElement(
'button',
{
onClick: onClose,
className: 'px-4 py-2 bg-gray-500 hover:bg-gray-600 rounded text-white'
},
'Cancel'
),
React.createElement(
'button',
{
onClick: handleRegister,
className: 'px-4 py-2 bg-purple-600 hover:bg-purple-700 rounded text-white font-bold'
},
'Register'
)
)
)
);
}
function LoginModal({ onClose, onSuccess, onRegister, theme }) {
const [username, setUsername] = React.useState('');
const [password, setPassword] = React.useState('');
const [error, setError] = React.useState('');
const [codeSent, setCodeSent] = React.useState(false);
const [showSuccess, setShowSuccess] = React.useState(false);
const [isLoading, setIsLoading] = React.useState(false);
const [countdown, setCountdown] = React.useState(0);
const [inReset, setInReset] = React.useState(false);
const [newPassword, setNewPassword] = React.useState('');
const [confirmNewPassword, setConfirmNewPassword] = React.useState('');
const [showForgot, setShowForgot] = React.useState(false);
const [platform, setPlatform] = React.useState('');
const [infoMessage, setInfoMessage] = React.useState('');
const isEnglish = typeof window.lang === 'undefined' || window.lang === 'en';
React.useEffect(() => {
const originalLoginReply = window.loginReply;
window.loginReply = (response) => {
if (window.handleLoginResponse) {
window.handleLoginResponse(response);
} else if (originalLoginReply) {
originalLoginReply(response);
}
};
return () => {
window.loginReply = originalLoginReply;
};
}, []);
React.useEffect(() => {
let interval = null;
if (codeSent && countdown > 0) {
interval = setInterval(() => {
setCountdown(prev => {
if (prev <= 1) {
setCodeSent(false);
setPlatform('');
setInfoMessage('');
return 0;
}
return prev - 1;
});
}, 1000);
}
return () => {
if (interval) clearInterval(interval);
};
}, [codeSent, countdown]);
const sendCode = (e) => {
e.stopPropagation();
if (!username) {
setError('Please enter a username.');
setShowForgot(false);
document.getElementById('lbemail').style.border = '2px solid red';
return;
}
document.getElementById('lbemail').style.border = '';
setError('');
setShowForgot(false);
setInfoMessage('');
setCodeSent(true);
setCountdown(60);
setPassword('');
const encodedUsername = btoa(username);
window.handleCodeResponse = (response) => {
if (response.startsWith('<[RES[pending:')) {
const match = response.match(/pending:([^]]+)/);
if (match) {
const plat = match[1];
setPlatform(plat);
setInfoMessage(isEnglish ? `Code sent to you on: ${plat}` : `代码发送到您的 ${plat}`);
}
// success, countdown proceeds
} else if (response.includes('<[RES[OK]]>')) {
setPlatform('');
setInfoMessage(isEnglish ? 'Code sent.' : '代码已发送。');
// success, countdown proceeds
} else if (response === '<[RES[ERROR:Already sent within 60 seconds]]>') {
setError('Already sent within 60 seconds. Please wait.');
// keep codeSent and countdown
} else {
setCodeSent(false);
setCountdown(0);
setPlatform('');
setInfoMessage('');
setError('Failed to send code. Please try again.');
}
};
try {
AjaxCall(`/?new_code_request&contact=${encodedUsername}`, undefined, 'handleCodeResponse', false);
} catch (err) {
setCodeSent(false);
setCountdown(0);
setPlatform('');
setInfoMessage('');
setError('Failed to send code. Please try again.');
}
};
const handleResetPassword = (e) => {
e.stopPropagation();
if (!username) {
setError('Please enter a username.');
setShowForgot(false);
document.getElementById('lbemail').style.border = '2px solid red';
return;
}
document.getElementById('lbemail').style.border = '';
setError('');
setShowForgot(false);
setInReset(true);
setCodeSent(true);
setCountdown(60);
setPassword('');
setNewPassword('');
setConfirmNewPassword('');
const encodedUsername = btoa(username);
window.handleResetRequestResponse = (response) => {
if (response.includes('<[RES[OK]]>')) {
setInfoMessage(isEnglish ? 'Reset code sent.' : '重置代码已发送。');
// success
} else {
setInReset(false);
setCodeSent(false);
setCountdown(0);
setInfoMessage('');
setError('Failed to send reset code. Please try again.');
}
};
try {
AjaxCall(`?atf_resetpassword=${encodedUsername}`, undefined, 'handleResetRequestResponse', false);
} catch (err) {
setInReset(false);
setCodeSent(false);
setCountdown(0);
setInfoMessage('');
setError('Failed to send reset code. Please try again.');
}
};
const handleLoginResponse = (response) => {
setIsLoading(false);
if (response.startsWith('<[RES[OK:')) {
setShowSuccess(true);
setTimeout(() => {
window.location.reload();
}, 2000);
} else if (response.includes('<[RES[FAIL]]>')) {
setError('Login incorrect.');
setShowForgot(true);
} else if (response.startsWith('<[RES[ERROR:')) {
const errorMessage = response.match(/ERROR:(.+?)\]\]>/)?.[1];
setError(errorMessage || 'Login failed. Please try again.');
} else {
setError('Login failed. Please try again.');
}
};
const handleSubmit = async (e) => {
e.preventDefault();
setError('');
setShowForgot(false);
if (inReset) {
if (!newPassword || !confirmNewPassword) {
setError('Please fill new password fields.');
setShowForgot(false);
setIsLoading(false);
return;
}
if (newPassword.length < 6 || !/[a-zA-Z]/.test(newPassword) || !/[0-9]/.test(newPassword)) {
setError('New password must be at least 6 characters with at least one letter and one number.');
setShowForgot(false);
setIsLoading(false);
return;
}
if (newPassword !== confirmNewPassword) {
setError('New passwords do not match.');
setShowForgot(false);
setIsLoading(false);
return;
}
setIsLoading(true);
const encodedUsername = btoa(username);
const url = `?atf_resetpassword=${encodedUsername}&reset_code=${password}&new_password=${newPassword}`;
window.handleResetSubmitResponse = (response) => {
setIsLoading(false);
if (response.includes('[RES[OK')) {
setShowSuccess(true);
setError('');
setInfoMessage('');
setTimeout(() => {
setShowSuccess(false);
if (onSuccess) onSuccess();
onClose();
}, 3000);
} else {
const errorMessage = response.match(/ERROR:(.+?)\]\]>/)?.[1] || 'Reset failed. Please try again.';
setError(errorMessage);
setShowForgot(false);
}
};
try {
AjaxCall(url, undefined, 'handleResetSubmitResponse', false);
} catch (err) {
setError('Reset failed. Please try again.');
setShowForgot(false);
setIsLoading(false);
}
return;
}
setIsLoading(true);
document.getElementById('lbemail').style.border = '';
window.handleLoginResponse = handleLoginResponse;
if (typeof window.doLogin === 'function') {
const result = await window.doLogin();
if (result === '<[RES[FAIL]]>') {
setError('Login incorrect.');
setShowForgot(true);
setIsLoading(false);
return;
}
}
const checkLoginSuccess = () => {
const cookies = document.cookie.split(';');
const loginCookie = cookies.find(cookie =>
cookie.trim().startsWith('atf_account_loggedin_hash=')
);
const loggedIn = !!loginCookie && loginCookie.split('=')[1].trim() !== '' && loginCookie.split('=')[1].trim() !== 'undefined';
setIsLoading(false);
if (loggedIn && onSuccess) {
setShowSuccess(true);
setTimeout(() => {
setShowSuccess(false);
onSuccess();
onClose();
}, 3000);
} else {
setError('Login incorrect.');
setShowForgot(true);
}
};
setTimeout(checkLoginSuccess, 1000);
};
const errorContent = showForgot && error === 'Login incorrect' ?
React.createElement(
'span',
{},
'Login incorrect, Forgot your password? ',
React.createElement(
'button',
{
type: 'button',
onClick: (e) => { e.stopPropagation(); sendCode(e); setError(''); setShowForgot(false); },
className: 'underline text-blue-300 hover:text-blue-100'
},
'try with code'
),
' or ',
React.createElement(
'button',
{
type: 'button',
onClick: (e) => { e.stopPropagation(); handleResetPassword(e); setError(''); setShowForgot(false); },
className: 'underline text-blue-300 hover:text-blue-100'
},
'reset password.'
)
) : error;
const messageContent = error ? errorContent : infoMessage;
const messageClass = `font-bold text-center mb-4 ${error ? 'text-red-300' : 'text-green-300'}`;
const codeLabel = platform ?
(isEnglish ? `Code sent to you on: ${platform} enter the code to login. code:` : `代码发送到您的 ${platform}。输入代码登录。代码:`) :
(isEnglish ? 'Enter Code sent to you' : '输入发送给您的代码');
const codeTextContent = codeSent ?
React.createElement(
'span',
{},
codeLabel,
countdown > 0 ? ` (resend in ${countdown} secs)` : ''
) :
React.createElement(
'span',
{},
isEnglish ? 'Password or ' : '输入密码或',
React.createElement(
'button',
{
type: 'button',
onClick: (e) => { e.stopPropagation(); handleResetPassword(e); },
className: 'text-blue-300 hover:text-blue-100 underline ml-1',
disabled: codeSent
},
isEnglish ? 'Reset password' : '重置密码'
),
isEnglish ? ' or ' : ' 或 ',
React.createElement(
'button',
{
type: 'button',
onClick: (e) => { e.stopPropagation(); sendCode(e); },
className: `text-blue-300 hover:text-blue-100 underline ml-1 ${codeSent ? 'opacity-50 cursor-not-allowed' : ''}`,
disabled: codeSent
},
isEnglish ? 'Send a code to login' : '发送代码以登录'
)
);
const passwordPlaceholder = (codeSent || inReset) ? (isEnglish ? 'Enter Code' : '输入代码') : (isEnglish ? 'Password' : '密码');
const submitContent = isLoading ?
React.createElement(
'div',
{
className: 'w-full mt-4 flex justify-center py-2'
},
React.createElement(
'div',
{
className: 'loader-spinner'
}
)
) :
React.createElement(
'button',
{
type: 'submit',
id: 'login_button',
className: 'w-full mt-4 px-4 py-2 bg-yellow-300 hover:bg-yellow-400 rounded text-black font-bold'
},
inReset ? (isEnglish ? 'Reset password' : '重置密码') : (isEnglish ? 'Login' : '登录')
);
const messageElement = (error || infoMessage) && React.createElement('div', {
id: 'code_error',
className: messageClass
}, messageContent);
const handleBackdropMouseDown = (e) => {
if (e.target === e.currentTarget) {
onClose();
}
};
const handleCloseClick = (e) => {
e.stopPropagation();
onClose();
};
const handleRegisterClick = (e) => {
e.stopPropagation();
onRegister();
onClose();
};
return React.createElement(
'div',
{
id: 'login_div',
className: 'fixed inset-0 bg-black bg-opacity-80 backdrop-blur-sm flex items-center justify-center z-50',
onMouseDown: handleBackdropMouseDown
},
showSuccess ?
React.createElement(
'div',
{
className: 'flex items-center justify-center',
onMouseDown: handleBackdropMouseDown
},
React.createElement('svg', {
className: 'w-16 h-16 text-yellow-300',
fill: 'none',
stroke: 'currentColor',
viewBox: '0 0 24 24',
xmlns: 'http://www.w3.org/2000/svg'
}, React.createElement('path', {
strokeLinecap: 'round',
strokeLinejoin: 'round',
strokeWidth: 2,
d: 'M5 13l4 4L19 7'
}))
) :
React.createElement(
'section',
{
role: 'dialog',
tabIndex: -1,
className: 'bg-gradient-to-br from-purple-800 to-orange-500 p-6 rounded-lg max-w-md w-full border-2 border-yellow-400 shadow-[0_0_20px_rgba(255,215,0,0.5)]',
onClick: e => e.stopPropagation()
},
React.createElement(
'div',
null,
React.createElement(
'header',
{ className: 'flex justify-between items-center mb-4' },
React.createElement(
'div',
{ id: 'login_div_title', className: 'text-2xl font-bebas text-yellow-300' },
isEnglish ? 'Login' : '登录'
),
React.createElement(
'button',
{
onClick: handleCloseClick,
className: 'text-yellow-300 hover:text-yellow-100 text-xl font-bold'
},
'X'
)
),
React.createElement(
'div',
{ className: 'bpk-modal__content' },
React.createElement(
'div',
{ id: 'login_success', className: 'flex justify-center' },
messageElement
),
React.createElement(
'form',
{
id: 'login_div1',
className: 'login-form login-form-employer',
onSubmit: handleSubmit,
onClick: e => e.stopPropagation()
},
React.createElement(
'div',
{ className: 'form-group mb-4 flex flex-col' },
React.createElement(
'span',
{ className: 'block text-yellow-300 mb-2 text-left' },
isEnglish ? 'Phone or Email' : '手机或电子邮件'
),
React.createElement('input', {
type: 'text',
className: 'w-full p-2 rounded text-black',
name: 'username',
id: 'lbemail',
placeholder: isEnglish ? 'Phone or Email' : '手机或电子邮件',
value: username,
onChange: e => setUsername(e.target.value),
onClick: e => e.stopPropagation()
})
),
React.createElement(
'div',
{
id: 'login_div_password_div',
className: 'form-group mb-4 flex flex-col'
},
React.createElement(
'span',
{
id: 'code_text',
className: 'block text-yellow-300 mb-2 text-left'
},
codeTextContent
),
React.createElement('input', {
type: 'password',
className: 'w-full p-2 rounded text-black',
name: 'pw',
id: 'lbpass',
placeholder: passwordPlaceholder,
value: password,
onChange: e => setPassword(e.target.value),
onClick: e => e.stopPropagation()
})
),
React.createElement(
'div',
{
id: 'login_div_new_password_div',
className: 'form-group mb-4',
style: { display: inReset ? 'block' : 'none' }
},
React.createElement(
'span',
{ className: 'block text-yellow-300 mb-2 text-left' },
isEnglish ? 'New Password' : '新密码'
),
React.createElement('input', {
type: 'password',
className: 'w-full p-2 rounded text-black mb-2',
name: 'newpw',
id: 'new_lbpass',
placeholder: isEnglish ? 'New Password' : '新密码',
value: newPassword,
onChange: e => setNewPassword(e.target.value),
onClick: e => e.stopPropagation()
}),
React.createElement(
'span',
{ className: 'block text-yellow-300 mb-2 text-left' },
isEnglish ? 'Confirm New Password' : '确认新密码'
),
React.createElement('input', {
type: 'password',
className: 'w-full p-2 rounded text-black',
name: 'newpw_2',
id: 'new_lbpass_2',
placeholder: isEnglish ? 'Confirm New Password' : '确认新密码',
value: confirmNewPassword,
onChange: e => setConfirmNewPassword(e.target.value),
onClick: e => e.stopPropagation()
})
),
React.createElement(
'div',
{ className: 'center none loader hidden' },
React.createElement('img', { src: '', alt: 'loader' })
),
React.createElement('p', { className: 'text-red-300 hidden' }),
React.createElement(
'div',
{ className: 'form-group checkbox mt-4' },
React.createElement('input', {
name: 'lang',
value: 'en',
type: 'hidden'
}),
React.createElement('input', {
type: 'hidden',
name: 'usernames',
id: 'username1',
value: ''
}),
submitContent
)
)
),
React.createElement(
'div',
{ className: 'mt-4 flex justify-end space-x-2' },
React.createElement(
'button',
{
type: 'button',
onClick: handleRegisterClick,
className: 'w-1/2 px-4 py-2 bg-purple-600 hover:bg-purple-700 rounded text-white font-bold'
},
isEnglish ? 'Register' : '注册'
),
React.createElement(
'button',
{
type: 'button',
onClick: handleCloseClick,
className: 'w-1/2 px-4 py-2 bg-gray-500 hover:bg-gray-600 rounded text-white'
},
isEnglish ? 'Cancel' : '取消'
)
)
)
)
);
}
function ModelProfile() {
const { slug } = window.ReactRouterDOM.useParams();
const navigate = window.ReactRouterDOM.useNavigate();
const model = models.find(m => m.slug === slug);
const theme = {
bg: 'bg-gradient-to-br from-pink-500 to-purple-900',
button: 'bg-gradient-to-r from-pink-500 to-purple-900 hover:from-pink-600 hover:to-purple-950'
};
console.log('ModelProfile rendering, slug:', slug, 'model:', model);
return React.createElement(
'div',
{ className: `min-h-screen ${theme.bg} flex flex-col items-center text-center p-4` },
React.createElement(ModelContent, { model, theme, isModal: false, navigate })
);
}
function ModelModal({ model, onClose, theme, setNotification }) {
const navigate = window.ReactRouterDOM.useNavigate();
return React.createElement(
'div',
{
className: 'fixed inset-0 bg-black bg-opacity-80 backdrop-blur-sm flex items-center justify-center z-50',
onClick: onClose
},
React.createElement(
'div',
{
className: 'bg-gradient-to-br from-purple-800 to-orange-500 p-6 rounded-lg max-w-2xl w-full border-2 border-yellow-400 shadow-[0_0_20px_rgba(255,215,0,0.5)]',
onClick: e => e.stopPropagation()
},
React.createElement(ModelContent, {
model,
theme,
isModal: true,
onClose,
setNotification,
navigate
})
)
);
}
function ModelEditModal({ model, onClose, theme, setNotification }) {
const navigate = window.ReactRouterDOM.useNavigate();
const [editModel, setEditModel] = React.useState(
model ? {
name: model.name || '',
slug: model.slug || '',
bio: model.bio || '',
image: model.image || '',
subscriptionPrice: model.subscriptionPrice || 9.99,
videos: Array.isArray(model.videos) ? model.videos : [],
content: {
videos: Array.isArray(model.content?.videos) ? model.content.videos : [],
photos: Array.isArray(model.content?.photos) ? model.content.photos : []
},
id: model.id || null
} : {
name: '',
slug: '',
bio: '',
image: '',
subscriptionPrice: 9.99,
videos: [],
content: { videos: [], photos: [] },
id: null
}
);
const [editingField, setEditingField] = React.useState(null);
const [error, setError] = React.useState('');
const nameInputRef = React.useRef(null);
const bioInputRef = React.useRef(null);
const imageInputRef = React.useRef(null);
const freeVideoInputRef = React.useRef(null);
const premiumVideoInputRef = React.useRef(null);
const premiumPhotoInputRef = React.useRef(null);
const handleAjaxResponse = (response) => {
const result = window.handleAjaxResponse(response);
if (result === true) {
setNotification('Field updated successfully!');
} else if (typeof result === 'number') {
setEditModel(prev => ({ ...prev, id: result }));
setNotification('Model created successfully! Continue editing other fields.');
} else {
setError(result);
}
}
const saveField = (field, value) => {
if (!editModel.id && field !== 'name') {
setError('Please set the name first.');
return;
}
const url = editModel.id
? `?edit=${editModel.id}&field=${field}&value=${encodeURIComponent(value)}`
: `?new&field=name&value=${encodeURIComponent(value)}`;
AjaxCall(url, false, 'handleAjaxResponse');
setEditModel(prev => ({ ...prev, [field]: value }));
if (field === 'name') {
setEditModel(prev => ({ ...prev, slug: value.toLowerCase().replace(/\s+/g, '-') }));
}
setEditingField(null);
};
const handleFileUpload = (type, position = null, file) => {
if (!editModel.id) {
setError('Please set the name first.');
return;
}
const formData = new FormData();
formData.append('file', file);
const positionParam = position !== null ? `&position=${position}` : '';
const url = `?upload&id=${editModel.id}&type=${type}${positionParam}`;
AjaxPostCall(url, formData, 'handleAjaxResponse');
setEditModel(prev => {
if (type === 'free') {
const videos = position !== null ? [...prev.videos] : [...prev.videos, URL.createObjectURL(file)];
if (position !== null) videos[position] = URL.createObjectURL(file);
return { ...prev, videos };
} else if (type === 'paid') {
const content = { ...prev.content };
const videos = position !== null ? [...content.videos] : [...content.videos, URL.createObjectURL(file)];
if (position !== null) videos[position] = URL.createObjectURL(file);
return { ...prev, content: { ...content, videos } };
} else {
const content = { ...prev.content };
const photos = position !== null ? [...content.photos] : [...content.photos, URL.createObjectURL(file)];
if (position !== null) photos[position] = URL.createObjectURL(file);
return { ...prev, content: { ...content, photos } };
}
});
};
const deleteFile = (type, position) => {
if (!editModel.id) {
setError('Please set the name first.');
return;
}
const url = `?upload&id=${editModel.id}&type=${type}&position=${position}`;
AjaxPostCall(url, new FormData(), 'handleAjaxResponse');
setEditModel(prev => {
if (type === 'free') {
const videos = [...prev.videos];
videos.splice(position, 1);
return { ...prev, videos };
} else if (type === 'paid') {
const content = { ...prev.content };
const videos = [...content.videos];
videos.splice(position, 1);
return { ...prev, content: { ...content, videos } };
} else {
const content = { ...prev.content };
const photos = [...content.photos];
photos.splice(position, 1);
return { ...prev, content: { ...content, photos } };
}
});
};
// Ensure arrays are always valid for mapping
const safeVideos = Array.isArray(editModel.videos) ? editModel.videos : [];
const safePremiumVideos = Array.isArray(editModel.content?.videos) ? editModel.content.videos : [];
const safePremiumPhotos = Array.isArray(editModel.content?.photos) ? editModel.content.photos : [];
return React.createElement(
'div',
{
className: 'fixed inset-0 bg-black bg-opacity-80 backdrop-blur-sm flex items-center justify-center z-50',
onClick: onClose
},
React.createElement(
'div',
{
className: 'bg-gradient-to-br from-purple-800 to-orange-500 p-6 rounded-lg max-w-2xl w-full border-2 border-yellow-400 shadow-[0_0_20px_rgba(255,215,0,0.5)] max-h-[90vh] overflow-y-auto',
onClick: e => e.stopPropagation()
},
React.createElement(
'div',
{ className: 'flex flex-col items-center text-center p-4' },
editingField === 'name'
? React.createElement('input', {
ref: nameInputRef,
className: 'text-5xl font-bebas text-yellow-300 text-center w-full',
value: editModel.name,
onChange: e => setEditModel(prev => ({ ...prev, name: e.target.value })),
onBlur: () => saveField('name', editModel.name),
autoFocus: true
})
: React.createElement(
'h1',
{ className: 'text-5xl font-bebas text-yellow-300 cursor-pointer', onClick: () => setEditingField('name') },
editModel.name || 'Click to set name'
),
editingField === 'image'
? React.createElement('input', {
ref: imageInputRef,
type: 'file',
accept: 'image/*',
className: 'mt-4',
onChange: e => {
if (e.target.files[0]) {
handleFileUpload('image', null, e.target.files[0]);
setEditingField(null);
}
}
})
: React.createElement('img', {
src: editModel.image || 'https://via.placeholder.com/192x256',
alt: editModel.name || 'Model Image',
className: 'w-48 h-64 object-cover rounded-lg mt-4 cursor-pointer',
onClick: () => setEditingField('image')
}),
editingField === 'bio'
? React.createElement('textarea', {
ref: bioInputRef,
className: 'text-xl mt-4 w-full p-2 rounded text-black',
value: editModel.bio,
onChange: e => setEditModel(prev => ({ ...prev, bio: e.target.value })),
onBlur: () => saveField('bio', editModel.bio),
rows: 4,
autoFocus: true
})
: React.createElement(
'p',
{ className: 'text-xl mt-4 cursor-pointer', onClick: () => setEditingField('bio') },
editModel.bio || 'Click to set bio'
),
editingField === 'subscriptionPrice'
? React.createElement('input', {
type: 'number',
step: '0.01',
min: '0',
className: 'text-lg mt-2 p-2 rounded text-black text-center w-32',
value: editModel.subscriptionPrice,
onChange: e => setEditModel(prev => ({ ...prev, subscriptionPrice: parseFloat(e.target.value) || 0 })),
onBlur: () => saveField('subscriptionPrice', editModel.subscriptionPrice),
autoFocus: true
})
: React.createElement(
'p',
{ className: 'text-lg mt-2 cursor-pointer', onClick: () => setEditingField('subscriptionPrice') },
`Subscription: ${editModel.subscriptionPrice}/month`
),
React.createElement(
'div',
{ className: 'mt-6 w-full max-w-2xl' },
React.createElement('h2', { className: 'text-2xl font-bebas text-yellow-300' }, 'Free Videos'),
React.createElement(
'div',
{ className: 'mt-4 grid grid-cols-1 sm:grid-cols-2 gap-4' },
safeVideos.map((video, index) =>
React.createElement(
'div',
{ key: index, className: 'bg-white bg-opacity-10 rounded-lg p-2 relative' },
React.createElement('img', {
src: video,
alt: `Video ${index + 1}`,
className: 'w-full h-32 object-cover rounded-lg cursor-pointer',
onClick: () => setEditingField(`freeVideo-${index}`)
}),
editingField === `freeVideo-${index}` &&
React.createElement('input', {
ref: freeVideoInputRef,
type: 'file',
accept: 'video/*',
className: 'mt-2',
onChange: e => {
if (e.target.files[0]) {
handleFileUpload('free', index, e.target.files[0]);
setEditingField(null);
}
}
}),
React.createElement(
'button',
{
className: 'absolute top-2 right-2 bg-red-500 hover:bg-red-600 text-white rounded-full w-6 h-6 flex items-center justify-center',
onClick: () => deleteFile('free', index)
},
'X'
)
)
),
React.createElement(
'button',
{
className: `mt-4 px-4 py-2 ${theme.button} rounded text-white`,
onClick: () => setEditingField('addFreeVideo')
},
'Add Free Video'
),
editingField === 'addFreeVideo' &&
React.createElement('input', {
ref: freeVideoInputRef,
type: 'file',
accept: 'video/*',
className: 'mt-2',
onChange: e => {
if (e.target.files[0]) {
handleFileUpload('free', null, e.target.files[0]);
setEditingField(null);
}
}
})
),
React.createElement('h2', { className: 'text-2xl font-bebas text-yellow-300 mt-6' }, 'Premium Videos'),
React.createElement(
'div',
{ className: 'mt-4 grid grid-cols-1 sm:grid-cols-2 gap-4' },
safePremiumVideos.map((video, index) =>
React.createElement(
'div',
{ key: index, className: 'bg-white bg-opacity-10 rounded-lg p-2 relative' },
React.createElement('img', {
src: video,
alt: `Premium Video ${index + 1}`,
className: 'w-full h-32 object-cover rounded-lg cursor-pointer',
onClick: () => setEditingField(`premiumVideo-${index}`)
}),
editingField === `premiumVideo-${index}` &&
React.createElement('input', {
ref: premiumVideoInputRef,
type: 'file',
accept: 'video/*',
className: 'mt-2',
onChange: e => {
if (e.target.files[0]) {
handleFileUpload('paid', index, e.target.files[0]);
setEditingField(null);
}
}
}),
React.createElement(
'button',
{
className: 'absolute top-2 right-2 bg-red-500 hover:bg-red-600 text-white rounded-full w-6 h-6 flex items-center justify-center',
onClick: () => deleteFile('paid', index)
},
'X'
)
)
),
React.createElement(
'button',
{
className: `mt-4 px-4 py-2 ${theme.button} rounded text-white`,
onClick: () => setEditingField('addPremiumVideo')
},
'Add Premium Video'
),
editingField === 'addPremiumVideo' &&
React.createElement('input', {
ref: premiumVideoInputRef,
type: 'file',
accept: 'video/*',
className: 'mt-2',
onChange: e => {
if (e.target.files[0]) {
handleFileUpload('paid', null, e.target.files[0]);
setEditingField(null);
}
}
})
),
React.createElement('h2', { className: 'text-2xl font-bebas text-yellow-300 mt-6' }, 'Premium Photos'),
React.createElement(
'div',
{ className: 'mt-4 grid grid-cols-1 sm:grid-cols-2 gap-4' },
safePremiumPhotos.map((photo, index) =>
React.createElement(
'div',
{ key: index, className: 'bg-white bg-opacity-10 rounded-lg p-2 relative' },
React.createElement('img', {
src: photo,
alt: `Premium Photo ${index + 1}`,
className: 'w-full h-32 object-cover rounded-lg cursor-pointer',
onClick: () => setEditingField(`premiumPhoto-${index}`)
}),
editingField === `premiumPhoto-${index}` &&
React.createElement('input', {
ref: premiumPhotoInputRef,
type: 'file',
accept: 'image/*',
className: 'mt-2',
onChange: e => {
if (e.target.files[0]) {
handleFileUpload('photo', index, e.target.files[0]);
setEditingField(null);
}
}
}),
React.createElement(
'button',
{
className: 'absolute top-2 right-2 bg-red-500 hover:bg-red-600 text-white rounded-full w-6 h-6 flex items-center justify-center',
onClick: () => deleteFile('photo', index)
},
'X'
)
)
),
React.createElement(
'button',
{
className: `mt-4 px-4 py-2 ${theme.button} rounded text-white`,
onClick: () => setEditingField('addPremiumPhoto')
},
'Add Premium Photo'
),
editingField === 'addPremiumPhoto' &&
React.createElement('input', {
ref: premiumPhotoInputRef,
type: 'file',
accept: 'image/*',
className: 'mt-2',
onChange: e => {
if (e.target.files[0]) {
handleFileUpload('photo', null, e.target.files[0]);
setEditingField(null);
}
}
})
)
),
error && React.createElement('p', { className: 'text-red-300 mt-2' }, error),
React.createElement(
'div',
{ className: 'mt-4 flex justify-end space-x-2' },
React.createElement(
'button',
{
onClick: onClose,
className: 'px-4 py-2 bg-gray-500 hover:bg-gray-600 rounded text-white'
},
'Close'
)
)
)
)
);
}
function ModelContent({ model, theme, isModal = false, onClose, setNotification, navigate }) {
const [isSubscribed, setIsSubscribed] = React.useState(false);
const [showPaymentModal, setShowPaymentModal] = React.useState(false);
if (!model) {
return React.createElement(
'div',
{ className: 'flex flex-col items-center justify-center text-center p-4' },
React.createElement('h1', { className: 'text-4xl font-bebas text-yellow-300' }, 'Model Not Found'),
React.createElement('p', { className: 'text-xl mt-4' }, 'No model found.'),
isModal
? React.createElement(
'button',
{
onClick: onClose,
className: `mt-4 px-4 py-2 ${theme.button} rounded text-white`
},
'Close'
)
: React.createElement(
window.ReactRouterDOM.Link,
{ to: '/', className: 'mt-4 text-blue-300 hover:underline' },
'Back to Home'
)
);
}
return React.createElement(
'div',
{ className: 'flex flex-col items-center text-center p-4' },
React.createElement('h1', { className: 'text-5xl font-bebas text-yellow-300' }, model.name),
React.createElement('img', {
src: model.image,
alt: model.name,
className: 'w-48 h-64 object-cover rounded-lg mt-4'
}),
React.createElement('p', { className: 'text-xl mt-4' }, model.bio),
React.createElement('p', { className: 'text-lg mt-2' }, `Subscription: $${model.subscriptionPrice}/month`),
React.createElement(
'div',
{ className: 'mt-6 w-full max-w-2xl' },
React.createElement('h2', { className: 'text-2xl font-bebas text-yellow-300' }, 'Free Videos'),
React.createElement(
'div',
{ className: 'mt-4 grid grid-cols-1 sm:grid-cols-2 gap-4' },
model.videos.map((video, index) =>
React.createElement(
'div',
{ key: index, className: 'bg-white bg-opacity-10 rounded-lg p-2' },
React.createElement('img', {
src: video,
alt: `Video ${index + 1}`,
className: 'w-full h-32 object-cover rounded-lg'
}),
React.createElement('p', { className: 'text-sm mt-2' }, `Video ${index + 1}`)
)
)
)
),
React.createElement(
'div',
{ className: 'mt-6 flex space-x-4' },
React.createElement(
'button',
{
onClick: () => setShowPaymentModal(true),
className: `px-4 py-2 ${theme.button} rounded text-white`
},
'Subscribe'
),
React.createElement(
'button',
{
onClick: () => alert(`Starting chat with ${model.name}!`),
className: `px-4 py-2 ${theme.button} rounded text-white`
},
'Chat'
)
),
React.createElement(ModelChat, {
model,
theme,
isSubscribed,
setIsSubscribed,
setShowPaymentModal
}),
isModal
? React.createElement(
'button',
{
onClick: onClose,
className: `mt-4 px-4 py-2 ${theme.button} rounded text-white`
},
'Close'
)
: React.createElement(
window.ReactRouterDOM.Link,
{ to: '/', className: 'mt-4 text-blue-300 hover:underline' },
'Back to Home'
),
showPaymentModal &&
React.createElement(PaymentModal, {
model,
onClose: (subscribed) => {
setShowPaymentModal(false);
if (subscribed) setIsSubscribed(true);
},
theme,
message: `Subscribe to chat more with ${model.name} for $${model.subscriptionPrice} for 30 days`
})
);
}
/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
(function(){'use strict';(function(c,x){"object"===typeof exports&&"undefined"!==typeof module?x(exports):"function"===typeof define&&define.amd?define(["exports"],x):(c=c||self,x(c.React={}))})(this,function(c){function x(a){if(null===a||"object"!==typeof a)return null;a=V&&a[V]||a["@@iterator"];return"function"===typeof a?a:null}function w(a,b,e){this.props=a;this.context=b;this.refs=W;this.updater=e||X}function Y(){}function K(a,b,e){this.props=a;this.context=b;this.refs=W;this.updater=e||X}function Z(a,b,
e){var m,d={},c=null,h=null;if(null!=b)for(m in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(c=""+b.key),b)aa.call(b,m)&&!ba.hasOwnProperty(m)&&(d[m]=b[m]);var l=arguments.length-2;if(1===l)d.children=e;else if(1>>1,d=a[c];if(0>>1;cD(l,e))fD(g,l)?(a[c]=g,a[f]=e,c=f):(a[c]=l,a[h]=e,c=h);else if(fD(g,e))a[c]=g,a[f]=e,c=f;else break a}}return b}
function D(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}function P(a){for(var b=p(r);null!==b;){if(null===b.callback)E(r);else if(b.startTime<=a)E(r),b.sortIndex=b.expirationTime,O(q,b);else break;b=p(r)}}function Q(a){z=!1;P(a);if(!u)if(null!==p(q))u=!0,R(S);else{var b=p(r);null!==b&&T(Q,b.startTime-a)}}function S(a,b){u=!1;z&&(z=!1,ea(A),A=-1);F=!0;var c=k;try{P(b);for(n=p(q);null!==n&&(!(n.expirationTime>b)||a&&!fa());){var m=n.callback;if("function"===typeof m){n.callback=null;
k=n.priorityLevel;var d=m(n.expirationTime<=b);b=v();"function"===typeof d?n.callback=d:n===p(q)&&E(q);P(b)}else E(q);n=p(q)}if(null!==n)var g=!0;else{var h=p(r);null!==h&&T(Q,h.startTime-b);g=!1}return g}finally{n=null,k=c,F=!1}}function fa(){return v()-hae?(a.sortIndex=c,O(r,a),null===p(q)&&a===p(r)&&(z?(ea(A),A=-1):z=!0,T(Q,c-e))):(a.sortIndex=d,O(q,a),u||F||(u=!0,R(S)));return a},unstable_cancelCallback:function(a){a.callback=null},unstable_wrapCallback:function(a){var b=k;return function(){var c=k;k=b;try{return a.apply(this,arguments)}finally{k=c}}},unstable_getCurrentPriorityLevel:function(){return k},unstable_shouldYield:fa,
unstable_requestPaint:function(){},unstable_continueExecution:function(){u||F||(u=!0,R(S))},unstable_pauseExecution:function(){},unstable_getFirstCallbackNode:function(){return p(q)},get unstable_now(){return v},unstable_forceFrameRate:function(a){0>a||125b}return!1}function Y(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}function $d(a,b,c,d){var e=R.hasOwnProperty(b)?R[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k="\n"+e[g].replace(" at new "," at ");a.displayName&&k.includes("")&&(k=k.replace("",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{ce=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:"")?bc(a):
""}function gj(a){switch(a.tag){case 5:return bc(a.type);case 16:return bc("Lazy");case 13:return bc("Suspense");case 19:return bc("SuspenseList");case 0:case 2:case 15:return a=be(a.type,!1),a;case 11:return a=be(a.type.render,!1),a;case 1:return a=be(a.type,!0),a;default:return""}}function de(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case Bb:return"Fragment";case Cb:return"Portal";case ee:return"Profiler";case fe:return"StrictMode";
case ge:return"Suspense";case he:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case gg:return(a.displayName||"Context")+".Consumer";case hg:return(a._context.displayName||"Context")+".Provider";case ie:var b=a.render;a=a.displayName;a||(a=b.displayName||b.name||"",a=""!==a?"ForwardRef("+a+")":"ForwardRef");return a;case je:return b=a.displayName||null,null!==b?b:de(a.type)||"Memo";case Ta:b=a._payload;a=a._init;try{return de(a(b))}catch(c){}}return null}function hj(a){var b=a.type;
switch(a.tag){case 24:return"Cache";case 9:return(b.displayName||"Context")+".Consumer";case 10:return(b._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=b.render,a=a.displayName||a.name||"",b.displayName||(""!==a?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return b;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(b);case 8:return b===fe?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";
case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof b)return b.displayName||b.name||null;if("string"===typeof b)return b}return null}function Ua(a){switch(typeof a){case "boolean":case "number":case "string":case "undefined":return a;case "object":return a;default:return""}}function ig(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"===
b)}function ij(a){var b=ig(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker=
null;delete a[b]}}}}function Pc(a){a._valueTracker||(a._valueTracker=ij(a))}function jg(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=ig(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Qc(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function ke(a,b){var c=b.checked;return E({},b,{defaultChecked:void 0,defaultValue:void 0,
value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function kg(a,b){var c=null==b.defaultValue?"":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Ua(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}function lg(a,b){b=b.checked;null!=b&&$d(a,"checked",b,!1)}function le(a,b){lg(a,b);var c=Ua(b.value),d=b.type;if(null!=c)if("number"===d){if(0===c&&""===a.value||a.value!=
c)a.value=""+c}else a.value!==""+c&&(a.value=""+c);else if("submit"===d||"reset"===d){a.removeAttribute("value");return}b.hasOwnProperty("value")?me(a,b.type,c):b.hasOwnProperty("defaultValue")&&me(a,b.type,Ua(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}function mg(a,b,c){if(b.hasOwnProperty("value")||b.hasOwnProperty("defaultValue")){var d=b.type;if(!("submit"!==d&&"reset"!==d||void 0!==b.value&&null!==b.value))return;b=""+a._wrapperState.initialValue;
c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;""!==c&&(a.name="");a.defaultChecked=!!a._wrapperState.initialChecked;""!==c&&(a.name=c)}function me(a,b,c){if("number"!==b||Qc(a.ownerDocument)!==a)null==c?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+c&&(a.defaultValue=""+c)}function Db(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e>>=0;return 0===a?32:31-(rj(a)/sj|0)|0}function hc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&
4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Vc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=hc(h):(f&=g,0!==f&&(d=hc(f)))}else g=c&~e,0!==g?d=hc(g):0!==f&&(d=hc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&
(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);
return b}function ic(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-ta(b);a[b]=c}function vj(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=$g(c)}}function bh(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?bh(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}function ch(){for(var a=window,b=Qc();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;
b=Qc(a.document)}return b}function Ie(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)}function Uj(a){var b=ch(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&bh(c.ownerDocument.documentElement,c)){if(null!==d&&Ie(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);
else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=ah(c,f);var g=ah(c,d);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),
a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"===typeof c.focus&&c.focus();for(c=0;cMb||(a.current=Se[Mb],Se[Mb]=null,Mb--)}
function y(a,b,c){Mb++;Se[Mb]=a.current;a.current=b}function Nb(a,b){var c=a.type.contextTypes;if(!c)return cb;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function ea(a){a=a.childContextTypes;return null!==a&&void 0!==a}function th(a,b,c){if(J.current!==cb)throw Error(n(168));
y(J,b);y(S,c)}function uh(a,b,c){var d=a.stateNode;b=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(n(108,hj(a)||"Unknown",e));return E({},c,d)}function ld(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||cb;qb=J.current;y(J,a);y(S,S.current);return!0}function vh(a,b,c){var d=a.stateNode;if(!d)throw Error(n(169));c?(a=uh(a,b,qb),d.__reactInternalMemoizedMergedChildContext=a,w(S),w(J),y(J,a)):w(S);
y(S,c)}function wh(a){null===La?La=[a]:La.push(a)}function kk(a){md=!0;wh(a)}function db(){if(!Te&&null!==La){Te=!0;var a=0,b=z;try{var c=La;for(z=1;a>=g;e-=g;Ma=1<<32-ta(b)+e|c<q?(v=l,l=null):v=l.sibling;var A=r(e,l,h[q],k);if(null===A){null===l&&(l=v);break}a&&l&&null===A.alternate&&b(e,l);g=f(A,g,q);null===m?n=A:m.sibling=A;m=A;l=v}if(q===h.length)return c(e,l),D&&rb(e,q),n;if(null===l){for(;qv?(A=q,q=null):A=q.sibling;var x=r(e,q,t.value,k);if(null===x){null===q&&(q=A);break}a&&q&&null===x.alternate&&b(e,q);g=f(x,g,v);null===l?m=x:l.sibling=x;l=x;q=A}if(t.done)return c(e,q),D&&rb(e,v),m;
if(null===q){for(;!t.done;v++,t=h.next())t=u(e,t.value,k),null!==t&&(g=f(t,g,v),null===l?m=t:l.sibling=t,l=t);D&&rb(e,v);return m}for(q=d(e,q);!t.done;v++,t=h.next())t=p(q,e,v,t.value,k),null!==t&&(a&&null!==t.alternate&&q.delete(null===t.key?v:t.key),g=f(t,g,v),null===l?m=t:l.sibling=t,l=t);a&&q.forEach(function(a){return b(e,a)});D&&rb(e,v);return m}function w(a,d,f,h){"object"===typeof f&&null!==f&&f.type===Bb&&null===f.key&&(f=f.props.children);if("object"===typeof f&&null!==f){switch(f.$$typeof){case xd:a:{for(var k=
f.key,m=d;null!==m;){if(m.key===k){k=f.type;if(k===Bb){if(7===m.tag){c(a,m.sibling);d=e(m,f.props.children);d.return=a;a=d;break a}}else if(m.elementType===k||"object"===typeof k&&null!==k&&k.$$typeof===Ta&&Kh(k)===m.type){c(a,m.sibling);d=e(m,f.props);d.ref=vc(a,m,f);d.return=a;a=d;break a}c(a,m);break}else b(a,m);m=m.sibling}f.type===Bb?(d=ub(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=wd(f.type,f.key,f.props,null,a.mode,h),h.ref=vc(a,d,f),h.return=a,a=h)}return g(a);case Cb:a:{for(m=f.key;null!==
d;){if(d.key===m)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=hf(f,a.mode,h);d.return=a;a=d}return g(a);case Ta:return m=f._init,w(a,d,m(f._payload),h)}if(cc(f))return x(a,d,f,h);if(ac(f))return F(a,d,f,h);vd(a,f)}return"string"===typeof f&&""!==f||"number"===typeof f?(f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):
(c(a,d),d=gf(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return w}function vb(a){if(a===wc)throw Error(n(174));return a}function jf(a,b){y(xc,b);y(yc,a);y(Ea,wc);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:oe(null,"");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=oe(b,a)}w(Ea);y(Ea,b)}function Tb(a){w(Ea);w(yc);w(xc)}function Mh(a){vb(xc.current);var b=vb(Ea.current);var c=oe(b,a.type);b!==c&&(y(yc,a),y(Ea,c))}function kf(a){yc.current===a&&
(w(Ea),w(yc))}function yd(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||"$?"===c.data||"$!"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}function lf(){for(var a=0;ac?c:4;a(!0);var d=uf.transition;uf.transition={};try{a(!1),b()}finally{z=c,uf.transition=d}}function di(){return sa().memoizedState}function rk(a,b,
c){var d=hb(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(ei(a))fi(b,c);else if(c=Ch(a,b,c,d),null!==c){var e=Z();ya(c,a,d,e);gi(c,b,d)}}function pk(a,b,c){var d=hb(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(ei(a))fi(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(ua(h,g)){var k=b.interleaved;null===k?(e.next=e,cf(b)):
(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(m){}finally{}c=Ch(a,b,e,d);null!==c&&(e=Z(),ya(c,a,d,e),gi(c,b,d))}}function ei(a){var b=a.alternate;return a===C||null!==b&&b===C}function fi(a,b){zc=Bd=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function gi(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;xe(a,c)}}function Ub(a,b){try{var c="",d=b;do c+=gj(d),d=d.return;while(d);var e=c}catch(f){e="\nError generating stack: "+f.message+
"\n"+f.stack}return{value:a,source:b,stack:e,digest:null}}function vf(a,b,c){return{value:a,source:null,stack:null!=c?c:null,digest:null!=b?b:null}}function wf(a,b){try{console.error(b.value)}catch(c){setTimeout(function(){throw c;})}}function hi(a,b,c){c=Pa(-1,c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Ed||(Ed=!0,xf=d);wf(a,b)};return c}function ii(a,b,c){c=Pa(-1,c);c.tag=3;var d=a.type.getDerivedStateFromError;if("function"===typeof d){var e=b.value;c.payload=function(){return d(e)};
c.callback=function(){wf(a,b)}}var f=a.stateNode;null!==f&&"function"===typeof f.componentDidCatch&&(c.callback=function(){wf(a,b);"function"!==typeof d&&(null===ib?ib=new Set([this]):ib.add(this));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:""})});return c}function ji(a,b,c){var d=a.pingCache;if(null===d){d=a.pingCache=new sk;var e=new Set;d.set(b,e)}else e=d.get(b),void 0===e&&(e=new Set,d.set(b,e));e.has(c)||(e.add(c),a=tk.bind(null,a,b,c),b.then(a,a))}function ki(a){do{var b;
if(b=13===a.tag)b=a.memoizedState,b=null!==b?null!==b.dehydrated?!0:!1:!0;if(b)return a;a=a.return}while(null!==a);return null}function li(a,b,c,d,e){if(0===(a.mode&1))return a===b?a.flags|=65536:(a.flags|=128,c.flags|=131072,c.flags&=-52805,1===c.tag&&(null===c.alternate?c.tag=17:(b=Pa(-1,1),b.tag=2,eb(c,b,1))),c.lanes|=1),a;a.flags|=65536;a.lanes=e;return a}function aa(a,b,c,d){b.child=null===a?mi(b,null,c,d):Vb(b,a.child,c,d)}function ni(a,b,c,d,e){c=c.render;var f=b.ref;Sb(b,e);d=of(a,b,c,d,f,
e);c=pf();if(null!==a&&!ha)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Qa(a,b,e);D&&c&&Ue(b);b.flags|=1;aa(a,b,d,e);return b.child}function oi(a,b,c,d,e){if(null===a){var f=c.type;if("function"===typeof f&&!yf(f)&&void 0===f.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=f,pi(a,b,f,d,e);a=wd(c.type,null,d,b,b.mode,e);a.ref=b.ref;a.return=b;return b.child=a}f=a.child;if(0===(a.lanes&e)){var g=f.memoizedProps;c=c.compare;c=null!==c?c:qc;if(c(g,d)&&a.ref===
b.ref)return Qa(a,b,e)}b.flags|=1;a=gb(f,d);a.ref=b.ref;a.return=b;return b.child=a}function pi(a,b,c,d,e){if(null!==a){var f=a.memoizedProps;if(qc(f,d)&&a.ref===b.ref)if(ha=!1,b.pendingProps=d=f,0!==(a.lanes&e))0!==(a.flags&131072)&&(ha=!0);else return b.lanes=a.lanes,Qa(a,b,e)}return zf(a,b,c,d,e)}function qi(a,b,c){var d=b.pendingProps,e=d.children,f=null!==a?a.memoizedState:null;if("hidden"===d.mode)if(0===(b.mode&1))b.memoizedState={baseLanes:0,cachePool:null,transitions:null},y(Ga,ba),ba|=c;
else{if(0===(c&1073741824))return a=null!==f?f.baseLanes|c:c,b.lanes=b.childLanes=1073741824,b.memoizedState={baseLanes:a,cachePool:null,transitions:null},b.updateQueue=null,y(Ga,ba),ba|=a,null;b.memoizedState={baseLanes:0,cachePool:null,transitions:null};d=null!==f?f.baseLanes:c;y(Ga,ba);ba|=d}else null!==f?(d=f.baseLanes|c,b.memoizedState=null):d=c,y(Ga,ba),ba|=d;aa(a,b,e,c);return b.child}function ri(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.flags|=512,b.flags|=2097152}function zf(a,
b,c,d,e){var f=ea(c)?qb:J.current;f=Nb(b,f);Sb(b,e);c=of(a,b,c,d,f,e);d=pf();if(null!==a&&!ha)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Qa(a,b,e);D&&d&&Ue(b);b.flags|=1;aa(a,b,c,e);return b.child}function si(a,b,c,d,e){if(ea(c)){var f=!0;ld(b)}else f=!1;Sb(b,e);if(null===b.stateNode)Fd(a,b),Hh(b,c,d),ff(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,m=c.contextType;"object"===typeof m&&null!==m?m=qa(m):(m=ea(c)?qb:J.current,m=Nb(b,
m));var l=c.getDerivedStateFromProps,n="function"===typeof l||"function"===typeof g.getSnapshotBeforeUpdate;n||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==d||k!==m)&&Ih(b,g,d,m);fb=!1;var r=b.memoizedState;g.state=r;td(b,d,g,e);k=b.memoizedState;h!==d||r!==k||S.current||fb?("function"===typeof l&&(ef(b,c,l,d),k=b.memoizedState),(h=fb||Gh(b,c,h,d,r,k,m))?(n||"function"!==typeof g.UNSAFE_componentWillMount&&"function"!==typeof g.componentWillMount||
("function"===typeof g.componentWillMount&&g.componentWillMount(),"function"===typeof g.UNSAFE_componentWillMount&&g.UNSAFE_componentWillMount()),"function"===typeof g.componentDidMount&&(b.flags|=4194308)):("function"===typeof g.componentDidMount&&(b.flags|=4194308),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=m,d=h):("function"===typeof g.componentDidMount&&(b.flags|=4194308),d=!1)}else{g=b.stateNode;Dh(a,b);h=b.memoizedProps;m=b.type===b.elementType?h:xa(b.type,h);g.props=
m;n=b.pendingProps;r=g.context;k=c.contextType;"object"===typeof k&&null!==k?k=qa(k):(k=ea(c)?qb:J.current,k=Nb(b,k));var p=c.getDerivedStateFromProps;(l="function"===typeof p||"function"===typeof g.getSnapshotBeforeUpdate)||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==n||r!==k)&&Ih(b,g,d,k);fb=!1;r=b.memoizedState;g.state=r;td(b,d,g,e);var x=b.memoizedState;h!==n||r!==x||S.current||fb?("function"===typeof p&&(ef(b,c,p,d),x=b.memoizedState),
(m=fb||Gh(b,c,m,d,r,x,k)||!1)?(l||"function"!==typeof g.UNSAFE_componentWillUpdate&&"function"!==typeof g.componentWillUpdate||("function"===typeof g.componentWillUpdate&&g.componentWillUpdate(d,x,k),"function"===typeof g.UNSAFE_componentWillUpdate&&g.UNSAFE_componentWillUpdate(d,x,k)),"function"===typeof g.componentDidUpdate&&(b.flags|=4),"function"===typeof g.getSnapshotBeforeUpdate&&(b.flags|=1024)):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=
4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),b.memoizedProps=d,b.memoizedState=x),g.props=d,g.state=x,g.context=k,d=m):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),d=!1)}return Af(a,b,c,d,f,e)}function Af(a,b,c,d,e,f){ri(a,b);var g=0!==(b.flags&128);if(!d&&!g)return e&&vh(b,c,!1),
Qa(a,b,f);d=b.stateNode;uk.current=b;var h=g&&"function"!==typeof c.getDerivedStateFromError?null:d.render();b.flags|=1;null!==a&&g?(b.child=Vb(b,a.child,null,f),b.child=Vb(b,null,h,f)):aa(a,b,h,f);b.memoizedState=d.state;e&&vh(b,c,!0);return b.child}function ti(a){var b=a.stateNode;b.pendingContext?th(a,b.pendingContext,b.pendingContext!==b.context):b.context&&th(a,b.context,!1);jf(a,b.containerInfo)}function ui(a,b,c,d,e){Qb();Ye(e);b.flags|=256;aa(a,b,c,d);return b.child}function Bf(a){return{baseLanes:a,
cachePool:null,transitions:null}}function vi(a,b,c){var d=b.pendingProps,e=G.current,f=!1,g=0!==(b.flags&128),h;(h=g)||(h=null!==a&&null===a.memoizedState?!1:0!==(e&2));if(h)f=!0,b.flags&=-129;else if(null===a||null!==a.memoizedState)e|=1;y(G,e&1);if(null===a){Xe(b);a=b.memoizedState;if(null!==a&&(a=a.dehydrated,null!==a))return 0===(b.mode&1)?b.lanes=1:"$!"===a.data?b.lanes=8:b.lanes=1073741824,null;g=d.children;a=d.fallback;return f?(d=b.mode,f=b.child,g={mode:"hidden",children:g},0===(d&1)&&null!==
f?(f.childLanes=0,f.pendingProps=g):f=Gd(g,d,0,null),a=ub(a,d,c,null),f.return=b,a.return=b,f.sibling=a,b.child=f,b.child.memoizedState=Bf(c),b.memoizedState=Cf,a):Df(b,g)}e=a.memoizedState;if(null!==e&&(h=e.dehydrated,null!==h))return vk(a,b,g,d,h,e,c);if(f){f=d.fallback;g=b.mode;e=a.child;h=e.sibling;var k={mode:"hidden",children:d.children};0===(g&1)&&b.child!==e?(d=b.child,d.childLanes=0,d.pendingProps=k,b.deletions=null):(d=gb(e,k),d.subtreeFlags=e.subtreeFlags&14680064);null!==h?f=gb(h,f):(f=
ub(f,g,c,null),f.flags|=2);f.return=b;d.return=b;d.sibling=f;b.child=d;d=f;f=b.child;g=a.child.memoizedState;g=null===g?Bf(c):{baseLanes:g.baseLanes|c,cachePool:null,transitions:g.transitions};f.memoizedState=g;f.childLanes=a.childLanes&~c;b.memoizedState=Cf;return d}f=a.child;a=f.sibling;d=gb(f,{mode:"visible",children:d.children});0===(b.mode&1)&&(d.lanes=c);d.return=b;d.sibling=null;null!==a&&(c=b.deletions,null===c?(b.deletions=[a],b.flags|=16):c.push(a));b.child=d;b.memoizedState=null;return d}
function Df(a,b,c){b=Gd({mode:"visible",children:b},a.mode,0,null);b.return=a;return a.child=b}function Hd(a,b,c,d){null!==d&&Ye(d);Vb(b,a.child,null,c);a=Df(b,b.pendingProps.children);a.flags|=2;b.memoizedState=null;return a}function vk(a,b,c,d,e,f,g){if(c){if(b.flags&256)return b.flags&=-257,d=vf(Error(n(422))),Hd(a,b,g,d);if(null!==b.memoizedState)return b.child=a.child,b.flags|=128,null;f=d.fallback;e=b.mode;d=Gd({mode:"visible",children:d.children},e,0,null);f=ub(f,e,g,null);f.flags|=2;d.return=
b;f.return=b;d.sibling=f;b.child=d;0!==(b.mode&1)&&Vb(b,a.child,null,g);b.child.memoizedState=Bf(g);b.memoizedState=Cf;return f}if(0===(b.mode&1))return Hd(a,b,g,null);if("$!"===e.data){d=e.nextSibling&&e.nextSibling.dataset;if(d)var h=d.dgst;d=h;f=Error(n(419));d=vf(f,d,void 0);return Hd(a,b,g,d)}h=0!==(g&a.childLanes);if(ha||h){d=O;if(null!==d){switch(g&-g){case 4:e=2;break;case 16:e=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:e=
32;break;case 536870912:e=268435456;break;default:e=0}e=0!==(e&(d.suspendedLanes|g))?0:e;0!==e&&e!==f.retryLane&&(f.retryLane=e,Oa(a,e),ya(d,a,e,-1))}Ef();d=vf(Error(n(421)));return Hd(a,b,g,d)}if("$?"===e.data)return b.flags|=128,b.child=a.child,b=wk.bind(null,a),e._reactRetry=b,null;a=f.treeContext;fa=Ka(e.nextSibling);la=b;D=!0;wa=null;null!==a&&(na[oa++]=Ma,na[oa++]=Na,na[oa++]=sb,Ma=a.id,Na=a.overflow,sb=b);b=Df(b,d.children);b.flags|=4096;return b}function wi(a,b,c){a.lanes|=b;var d=a.alternate;
null!==d&&(d.lanes|=b);bf(a.return,b,c)}function Ff(a,b,c,d,e){var f=a.memoizedState;null===f?a.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:e}:(f.isBackwards=b,f.rendering=null,f.renderingStartTime=0,f.last=d,f.tail=c,f.tailMode=e)}function xi(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;aa(a,b,d.children,c);d=G.current;if(0!==(d&2))d=d&1|2,b.flags|=128;else{if(null!==a&&0!==(a.flags&128))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&&
wi(a,c,b);else if(19===a.tag)wi(a,c,b);else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return}a.sibling.return=a.return;a=a.sibling}d&=1}y(G,d);if(0===(b.mode&1))b.memoizedState=null;else switch(e){case "forwards":c=b.child;for(e=null;null!==c;)a=c.alternate,null!==a&&null===yd(a)&&(e=c),c=c.sibling;c=e;null===c?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null);Ff(b,!1,e,c,f);break;case "backwards":c=
null;e=b.child;for(b.child=null;null!==e;){a=e.alternate;if(null!==a&&null===yd(a)){b.child=e;break}a=e.sibling;e.sibling=c;c=e;e=a}Ff(b,!0,c,null,f);break;case "together":Ff(b,!1,null,null,void 0);break;default:b.memoizedState=null}return b.child}function Fd(a,b){0===(b.mode&1)&&null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2)}function Qa(a,b,c){null!==a&&(b.dependencies=a.dependencies);ra|=b.lanes;if(0===(c&b.childLanes))return null;if(null!==a&&b.child!==a.child)throw Error(n(153));if(null!==
b.child){a=b.child;c=gb(a,a.pendingProps);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=gb(a,a.pendingProps),c.return=b;c.sibling=null}return b.child}function xk(a,b,c){switch(b.tag){case 3:ti(b);Qb();break;case 5:Mh(b);break;case 1:ea(b.type)&&ld(b);break;case 4:jf(b,b.stateNode.containerInfo);break;case 10:var d=b.type._context,e=b.memoizedProps.value;y(rd,d._currentValue);d._currentValue=e;break;case 13:d=b.memoizedState;if(null!==d){if(null!==d.dehydrated)return y(G,G.current&
1),b.flags|=128,null;if(0!==(c&b.child.childLanes))return vi(a,b,c);y(G,G.current&1);a=Qa(a,b,c);return null!==a?a.sibling:null}y(G,G.current&1);break;case 19:d=0!==(c&b.childLanes);if(0!==(a.flags&128)){if(d)return xi(a,b,c);b.flags|=128}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null,e.lastEffect=null);y(G,G.current);if(d)break;else return null;case 22:case 23:return b.lanes=0,qi(a,b,c)}return Qa(a,b,c)}function Dc(a,b){if(!D)switch(a.tailMode){case "hidden":b=a.tail;for(var c=null;null!==
b;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case "collapsed":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&&(d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null}}function W(a){var b=null!==a.alternate&&a.alternate.child===a.child,c=0,d=0;if(b)for(var e=a.child;null!==e;)c|=e.lanes|e.childLanes,d|=e.subtreeFlags&14680064,d|=e.flags&14680064,e.return=a,e=e.sibling;else for(e=a.child;null!==e;)c|=e.lanes|e.childLanes,
d|=e.subtreeFlags,d|=e.flags,e.return=a,e=e.sibling;a.subtreeFlags|=d;a.childLanes=c;return b}function yk(a,b,c){var d=b.pendingProps;Ve(b);switch(b.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return W(b),null;case 1:return ea(b.type)&&(w(S),w(J)),W(b),null;case 3:d=b.stateNode;Tb();w(S);w(J);lf();d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null);if(null===a||null===a.child)pd(b)?b.flags|=4:null===a||a.memoizedState.isDehydrated&&0===(b.flags&
256)||(b.flags|=1024,null!==wa&&(Gf(wa),wa=null));yi(a,b);W(b);return null;case 5:kf(b);var e=vb(xc.current);c=b.type;if(null!==a&&null!=b.stateNode)zk(a,b,c,d,e),a.ref!==b.ref&&(b.flags|=512,b.flags|=2097152);else{if(!d){if(null===b.stateNode)throw Error(n(166));W(b);return null}a=vb(Ea.current);if(pd(b)){d=b.stateNode;c=b.type;var f=b.memoizedProps;d[Da]=b;d[uc]=f;a=0!==(b.mode&1);switch(c){case "dialog":B("cancel",d);B("close",d);break;case "iframe":case "object":case "embed":B("load",d);break;
case "video":case "audio":for(e=0;e\x3c/script>",a=a.removeChild(a.firstChild)):"string"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),"select"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Da]=b;a[uc]=d;Ak(a,b,!1,!1);b.stateNode=a;a:{g=qe(c,d);switch(c){case "dialog":B("cancel",a);B("close",a);e=d;break;case "iframe":case "object":case "embed":B("load",a);e=d;break;
case "video":case "audio":for(e=0;eHf&&(b.flags|=128,d=!0,Dc(f,!1),b.lanes=4194304)}else{if(!d)if(a=yd(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Dc(f,!0),null===f.tail&&"hidden"===f.tailMode&&!g.alternate&&!D)return W(b),null}else 2*P()-f.renderingStartTime>Hf&&1073741824!==c&&(b.flags|=
128,d=!0,Dc(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=b,f.tail=b.sibling,f.renderingStartTime=P(),b.sibling=null,c=G.current,y(G,d?c&1|2:c&1),b;W(b);return null;case 22:case 23:return ba=Ga.current,w(Ga),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(ba&1073741824)&&(W(b),b.subtreeFlags&6&&(b.flags|=8192)):W(b),null;case 24:return null;
case 25:return null}throw Error(n(156,b.tag));}function Ck(a,b,c){Ve(b);switch(b.tag){case 1:return ea(b.type)&&(w(S),w(J)),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return Tb(),w(S),w(J),lf(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return kf(b),null;case 13:w(G);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(n(340));Qb()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return w(G),null;case 4:return Tb(),
null;case 10:return af(b.type._context),null;case 22:case 23:return ba=Ga.current,w(Ga),null;case 24:return null;default:return null}}function Wb(a,b){var c=a.ref;if(null!==c)if("function"===typeof c)try{c(null)}catch(d){H(a,b,d)}else c.current=null}function If(a,b,c){try{c()}catch(d){H(a,b,d)}}function Dk(a,b){Jf=Zc;a=ch();if(Ie(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();
if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(M){c=null;break a}var g=0,h=-1,k=-1,m=0,t=0,u=a,r=null;b:for(;;){for(var p;;){u!==c||0!==e&&3!==u.nodeType||(h=g+e);u!==f||0!==d&&3!==u.nodeType||(k=g+d);3===u.nodeType&&(g+=u.nodeValue.length);if(null===(p=u.firstChild))break;r=u;u=p}for(;;){if(u===a)break b;r===c&&++m===e&&(h=g);r===f&&++t===d&&(k=g);if(null!==(p=u.nextSibling))break;u=r;r=u.parentNode}u=p}c=-1===h||-1===k?null:
{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Kf={focusedElem:a,selectionRange:c};Zc=!1;for(l=b;null!==l;)if(b=l,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,l=a;else for(;null!==l;){b=l;try{var x=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;case 1:if(null!==x){var w=x.memoizedProps,z=x.memoizedState,A=b.stateNode,v=A.getSnapshotBeforeUpdate(b.elementType===b.type?w:xa(b.type,w),z);A.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var q=
b.stateNode.containerInfo;1===q.nodeType?q.textContent="":9===q.nodeType&&q.documentElement&&q.removeChild(q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163));}}catch(M){H(b,b.return,M)}a=b.sibling;if(null!==a){a.return=b.return;l=a;break}l=b.return}x=Ai;Ai=!1;return x}function Gc(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&If(b,c,f)}e=e.next}while(e!==d)}}
function Id(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Lf(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}"function"===typeof b?b(a):b.current=a}}function Bi(a){var b=a.alternate;null!==b&&(a.alternate=null,Bi(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Da],delete b[uc],delete b[Me],delete b[Ek],
delete b[Fk]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Ci(a){return 5===a.tag||3===a.tag||4===a.tag}function Di(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Ci(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&
2))return a.stateNode}}function Mf(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=kd));else if(4!==d&&(a=a.child,null!==a))for(Mf(a,b,c),a=a.sibling;null!==a;)Mf(a,b,c),a=a.sibling}function Nf(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);
else if(4!==d&&(a=a.child,null!==a))for(Nf(a,b,c),a=a.sibling;null!==a;)Nf(a,b,c),a=a.sibling}function jb(a,b,c){for(c=c.child;null!==c;)Ei(a,b,c),c=c.sibling}function Ei(a,b,c){if(Ca&&"function"===typeof Ca.onCommitFiberUnmount)try{Ca.onCommitFiberUnmount(Uc,c)}catch(h){}switch(c.tag){case 5:X||Wb(c,b);case 6:var d=T,e=za;T=null;jb(a,b,c);T=d;za=e;null!==T&&(za?(a=T,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):T.removeChild(c.stateNode));break;case 18:null!==T&&(za?
(a=T,c=c.stateNode,8===a.nodeType?Re(a.parentNode,c):1===a.nodeType&&Re(a,c),nc(a)):Re(T,c.stateNode));break;case 4:d=T;e=za;T=c.stateNode.containerInfo;za=!0;jb(a,b,c);T=d;za=e;break;case 0:case 11:case 14:case 15:if(!X&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?If(c,b,g):0!==(f&4)&&If(c,b,g));e=e.next}while(e!==d)}jb(a,b,c);break;case 1:if(!X&&(Wb(c,b),d=c.stateNode,"function"===typeof d.componentWillUnmount))try{d.props=
c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){H(c,b,h)}jb(a,b,c);break;case 21:jb(a,b,c);break;case 22:c.mode&1?(X=(d=X)||null!==c.memoizedState,jb(a,b,c),X=d):jb(a,b,c);break;default:jb(a,b,c)}}function Fi(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Gk);b.forEach(function(b){var d=Hk.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}function Aa(a,b,c){c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=P()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*Nk(d/1960))-d;if(10a?16:a;if(null===lb)var d=!1;else{a=lb;lb=null;Qd=0;if(0!==(p&6))throw Error(n(331));var e=p;p|=4;for(l=a.current;null!==l;){var f=l,g=f.child;if(0!==(l.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kP()-Of?xb(a,0):Sf|=c);ia(a,b)}function Ui(a,b){0===b&&(0===(a.mode&1)?b=1:(b=Rd,Rd<<=1,0===(Rd&130023424)&&(Rd=4194304)));var c=Z();a=Oa(a,b);null!==a&&(ic(a,b,c),ia(a,c))}function wk(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Ui(a,c)}function Hk(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);
break;case 19:d=a.stateNode;break;default:throw Error(n(314));}null!==d&&d.delete(b);Ui(a,c)}function Ni(a,b){return xh(a,b)}function Uk(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function yf(a){a=
a.prototype;return!(!a||!a.isReactComponent)}function Vk(a){if("function"===typeof a)return yf(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===ie)return 11;if(a===je)return 14}return 2}function gb(a,b){var c=a.alternate;null===c?(c=pa(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=
a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}function wd(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)yf(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case Bb:return ub(c.children,e,f,b);case fe:g=8;e|=8;break;case ee:return a=pa(12,c,b,e|2),a.elementType=ee,a.lanes=f,a;case ge:return a=
pa(13,c,b,e),a.elementType=ge,a.lanes=f,a;case he:return a=pa(19,c,b,e),a.elementType=he,a.lanes=f,a;case Vi:return Gd(c,e,f,b);default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case hg:g=10;break a;case gg:g=9;break a;case ie:g=11;break a;case je:g=14;break a;case Ta:g=16;d=null;break a}throw Error(n(130,null==a?a:typeof a,""));}b=pa(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function ub(a,b,c,d){a=pa(7,a,d,b);a.lanes=c;return a}function Gd(a,b,c,d){a=pa(22,a,d,b);a.elementType=
Vi;a.lanes=c;a.stateNode={isHidden:!1};return a}function gf(a,b,c){a=pa(6,a,null,b);a.lanes=c;return a}function hf(a,b,c){b=pa(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}function Wk(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=
0;this.eventTimes=we(0);this.expirationTimes=we(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=we(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=null}function Vf(a,b,c,d,e,f,g,h,k,m){a=new Wk(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=pa(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,
pendingSuspenseBoundaries:null};df(f);return a}function Xk(a,b,c){var d=3"+b.valueOf().toString()+"";for(b=Xd.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}}),Fc=function(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b},dc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,
borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,
strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},al=["Webkit","ms","Moz","O"];Object.keys(dc).forEach(function(a){al.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);dc[b]=dc[a]})});var jj=E({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),ze=null,se=null,Eb=null,Fb=null,xg=function(a,b){return a(b)},yg=function(){},te=!1,Oe=!1;if(Ia)try{var Lc={};Object.defineProperty(Lc,
"passive",{get:function(){Oe=!0}});window.addEventListener("test",Lc,Lc);window.removeEventListener("test",Lc,Lc)}catch(a){Oe=!1}var lj=function(a,b,c,d,e,f,g,h,k){var m=Array.prototype.slice.call(arguments,3);try{b.apply(c,m)}catch(t){this.onError(t)}},gc=!1,Sc=null,Tc=!1,ue=null,mj={onError:function(a){gc=!0;Sc=a}},Ba=mb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler,Jg=Ba.unstable_scheduleCallback,Kg=Ba.unstable_NormalPriority,xh=Jg,Li=Ba.unstable_cancelCallback,Qk=Ba.unstable_shouldYield,
Tk=Ba.unstable_requestPaint,P=Ba.unstable_now,Ej=Ba.unstable_getCurrentPriorityLevel,De=Ba.unstable_ImmediatePriority,Mg=Ba.unstable_UserBlockingPriority,ad=Kg,Fj=Ba.unstable_LowPriority,Ng=Ba.unstable_IdlePriority,Uc=null,Ca=null,ta=Math.clz32?Math.clz32:qj,rj=Math.log,sj=Math.LN2,Wc=64,Rd=4194304,z=0,Ae=!1,Yc=[],Va=null,Wa=null,Xa=null,jc=new Map,kc=new Map,Ya=[],Cj="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" "),
Gb=Sa.ReactCurrentBatchConfig,Zc=!0,$c=null,Za=null,Ee=null,bd=null,Yb={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},He=ka(Yb),Mc=E({},Yb,{view:0,detail:0}),bk=ka(Mc),ag,bg,Nc,Yd=E({},Mc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fe,button:0,buttons:0,relatedTarget:function(a){return void 0===a.relatedTarget?a.fromElement===a.srcElement?a.toElement:a.fromElement:
a.relatedTarget},movementX:function(a){if("movementX"in a)return a.movementX;a!==Nc&&(Nc&&"mousemove"===a.type?(ag=a.screenX-Nc.screenX,bg=a.screenY-Nc.screenY):bg=ag=0,Nc=a);return ag},movementY:function(a){return"movementY"in a?a.movementY:bg}}),ih=ka(Yd),bl=E({},Yd,{dataTransfer:0}),Xj=ka(bl),cl=E({},Mc,{relatedTarget:0}),Pe=ka(cl),dl=E({},Yb,{animationName:0,elapsedTime:0,pseudoElement:0}),Zj=ka(dl),el=E({},Yb,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),
dk=ka(el),fl=E({},Yb,{data:0}),qh=ka(fl),gk=qh,gl={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hl={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",
112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Hj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"},il=E({},Mc,{key:function(a){if(a.key){var b=gl[a.key]||a.key;if("Unidentified"!==b)return b}return"keypress"===a.type?(a=cd(a),13===a?"Enter":String.fromCharCode(a)):"keydown"===a.type||"keyup"===a.type?hl[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,
metaKey:0,repeat:0,locale:0,getModifierState:Fe,charCode:function(a){return"keypress"===a.type?cd(a):0},keyCode:function(a){return"keydown"===a.type||"keyup"===a.type?a.keyCode:0},which:function(a){return"keypress"===a.type?cd(a):"keydown"===a.type||"keyup"===a.type?a.keyCode:0}}),Wj=ka(il),jl=E({},Yd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nh=ka(jl),kl=E({},Mc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,
ctrlKey:0,shiftKey:0,getModifierState:Fe}),Yj=ka(kl),ll=E({},Yb,{propertyName:0,elapsedTime:0,pseudoElement:0}),ak=ka(ll),ml=E({},Yd,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),ck=ka(ml),Ij=[9,13,27,32],Ge=Ia&&"CompositionEvent"in window,Oc=null;Ia&&"documentMode"in document&&(Oc=document.documentMode);var fk=Ia&&"TextEvent"in
window&&!Oc,Ug=Ia&&(!Ge||Oc&&8=Oc),Tg=String.fromCharCode(32),Sg=!1,Hb=!1,Lj={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},oc=null,pc=null,ph=!1;Ia&&(ph=Mj("input")&&(!document.documentMode||9=document.documentMode,Jb=null,Ke=null,rc=null,Je=!1,Kb={animationend:gd("Animation","AnimationEnd"),
animationiteration:gd("Animation","AnimationIteration"),animationstart:gd("Animation","AnimationStart"),transitionend:gd("Transition","TransitionEnd")},Le={},eh={};Ia&&(eh=document.createElement("div").style,"AnimationEvent"in window||(delete Kb.animationend.animation,delete Kb.animationiteration.animation,delete Kb.animationstart.animation),"TransitionEvent"in window||delete Kb.transitionend.transition);var jh=hd("animationend"),kh=hd("animationiteration"),lh=hd("animationstart"),mh=hd("transitionend"),
fh=new Map,$i="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");
(function(){for(var a=0;a<$i.length;a++){var b=$i[a],c=b.toLowerCase();b=b[0].toUpperCase()+b.slice(1);$a(c,"on"+b)}$a(jh,"onAnimationEnd");$a(kh,"onAnimationIteration");$a(lh,"onAnimationStart");$a("dblclick","onDoubleClick");$a("focusin","onFocus");$a("focusout","onBlur");$a(mh,"onTransitionEnd")})();Ab("onMouseEnter",["mouseout","mouseover"]);Ab("onMouseLeave",["mouseout","mouseover"]);Ab("onPointerEnter",["pointerout","pointerover"]);Ab("onPointerLeave",["pointerout","pointerover"]);nb("onChange",
"change click focusin focusout input keydown keyup selectionchange".split(" "));nb("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));nb("onBeforeInput",["compositionend","keypress","textInput","paste"]);nb("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));nb("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));nb("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));
var Ec="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Vj=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ec)),id="_reactListening"+Math.random().toString(36).slice(2),hk=/\r\n?/g,ik=/\u0000|\uFFFD/g,Jf=null,Kf=null,Rf="function"===typeof setTimeout?setTimeout:void 0,Ok="function"===typeof clearTimeout?
clearTimeout:void 0,aj="function"===typeof Promise?Promise:void 0,Kk="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof aj?function(a){return aj.resolve(null).then(a).catch(jk)}:Rf,Zb=Math.random().toString(36).slice(2),Da="__reactFiber$"+Zb,uc="__reactProps$"+Zb,Ja="__reactContainer$"+Zb,Me="__reactEvents$"+Zb,Ek="__reactListeners$"+Zb,Fk="__reactHandles$"+Zb,Se=[],Mb=-1,cb={},J=bb(cb),S=bb(!1),qb=cb,La=null,md=!1,Te=!1,Ob=[],Pb=0,od=null,nd=0,na=[],oa=0,sb=null,Ma=1,Na="",la=
null,fa=null,D=!1,wa=null,Jk=Sa.ReactCurrentBatchConfig,rd=bb(null),qd=null,Rb=null,$e=null,tb=null,lk=Oa,fb=!1,Jh=(new mb.Component).refs,ud={isMounted:function(a){return(a=a._reactInternals)?ob(a)===a:!1},enqueueSetState:function(a,b,c){a=a._reactInternals;var d=Z(),e=hb(a),f=Pa(d,e);f.payload=b;void 0!==c&&null!==c&&(f.callback=c);b=eb(a,f,e);null!==b&&(ya(b,a,e,d),sd(b,a,e))},enqueueReplaceState:function(a,b,c){a=a._reactInternals;var d=Z(),e=hb(a),f=Pa(d,e);f.tag=1;f.payload=b;void 0!==c&&null!==
c&&(f.callback=c);b=eb(a,f,e);null!==b&&(ya(b,a,e,d),sd(b,a,e))},enqueueForceUpdate:function(a,b){a=a._reactInternals;var c=Z(),d=hb(a),e=Pa(c,d);e.tag=2;void 0!==b&&null!==b&&(e.callback=b);b=eb(a,e,d);null!==b&&(ya(b,a,d,c),sd(b,a,d))}},Vb=Lh(!0),mi=Lh(!1),wc={},Ea=bb(wc),yc=bb(wc),xc=bb(wc),G=bb(0),mf=[],zd=Sa.ReactCurrentDispatcher,uf=Sa.ReactCurrentBatchConfig,wb=0,C=null,K=null,N=null,Bd=!1,zc=!1,Ac=0,nl=0,Ad={readContext:qa,useCallback:V,useContext:V,useEffect:V,useImperativeHandle:V,useInsertionEffect:V,
useLayoutEffect:V,useMemo:V,useReducer:V,useRef:V,useState:V,useDebugValue:V,useDeferredValue:V,useTransition:V,useMutableSource:V,useSyncExternalStore:V,useId:V,unstable_isNewReconciler:!1},mk={readContext:qa,useCallback:function(a,b){Fa().memoizedState=[a,void 0===b?null:b];return a},useContext:qa,useEffect:Wh,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Cd(4194308,4,Zh.bind(null,b,a),c)},useLayoutEffect:function(a,b){return Cd(4194308,4,a,b)},useInsertionEffect:function(a,
b){return Cd(4,2,a,b)},useMemo:function(a,b){var c=Fa();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=Fa();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=rk.bind(null,C,a);return[d.memoizedState,a]},useRef:function(a){var b=Fa();a={current:a};return b.memoizedState=a},useState:Uh,useDebugValue:tf,useDeferredValue:function(a){return Fa().memoizedState=
a},useTransition:function(){var a=Uh(!1),b=a[0];a=qk.bind(null,a[1]);Fa().memoizedState=a;return[b,a]},useMutableSource:function(a,b,c){},useSyncExternalStore:function(a,b,c){var d=C,e=Fa();if(D){if(void 0===c)throw Error(n(407));c=c()}else{c=b();if(null===O)throw Error(n(349));0!==(wb&30)||Rh(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;Wh(Ph.bind(null,d,f,a),[a]);d.flags|=2048;Cc(9,Qh.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=Fa(),b=O.identifierPrefix;
if(D){var c=Na;var d=Ma;c=(d&~(1<<32-ta(d)-1)).toString(32)+c;b=":"+b+"R"+c;c=Ac++;0=0&&(n.hash=t.substr(e),t=t.substr(0,e));var r=t.indexOf("?");r>=0&&(n.search=t.substr(r),t=t.substr(0,r)),t&&(n.pathname=t)}return n}t.createBrowserHistory=function(e){void 0===e&&(e={});var a=e.window,s=void 0===a?document.defaultView:a,h=s.history;function p(){var t=s.location,n=t.pathname,e=t.search,r=t.hash,o=h.state||{};return[o.idx,{pathname:n,search:e,hash:r,state:o.usr||null,key:o.key||"default"}]}var v=null;s.addEventListener(o,(function(){if(v)A.call(v),v=null;else{var n=t.Action.Pop,e=p(),r=e[0],o=e[1];if(A.length){if(null!=r){var a=y-r;a&&(v={action:n,location:o,retry:function(){H(-1*a)}},H(a))}}else E(n)}}));var d=t.Action.Pop,g=p(),y=g[0],m=g[1],b=c(),A=c();function P(t){return"string"==typeof t?t:l(t)}function k(t,e){return void 0===e&&(e=null),n({pathname:m.pathname,hash:"",search:""},"string"==typeof t?f(t):t,{state:e,key:u()})}function x(t,n){return[{usr:t.state,key:t.key,idx:n},P(t)]}function w(t,n,e){return!A.length||(A.call({action:t,location:n,retry:e}),!1)}function E(t){d=t;var n=p();y=n[0],m=n[1],b.call({action:d,location:m})}function H(t){h.go(t)}return null==y&&(y=0,h.replaceState(n({},h.state,{idx:y}),"")),{get action(){return d},get location(){return m},createHref:P,push:function n(e,r){var o=t.Action.Push,a=k(e,r);if(w(o,a,(function(){n(e,r)}))){var i=x(a,y+1),c=i[0],u=i[1];try{h.pushState(c,"",u)}catch(t){s.location.assign(u)}E(o)}},replace:function n(e,r){var o=t.Action.Replace,a=k(e,r);if(w(o,a,(function(){n(e,r)}))){var i=x(a,y),c=i[0],u=i[1];h.replaceState(c,"",u),E(o)}},go:H,back:function(){H(-1)},forward:function(){H(1)},listen:function(t){return b.push(t)},block:function(t){var n=A.push(t);return 1===A.length&&s.addEventListener(r,i),function(){n(),A.length||s.removeEventListener(r,i)}}}},t.createHashHistory=function(e){void 0===e&&(e={});var a=e.window,s=void 0===a?document.defaultView:a,h=s.history;function p(){var t=f(s.location.hash.substr(1)),n=t.pathname,e=void 0===n?"/":n,r=t.search,o=void 0===r?"":r,a=t.hash,i=void 0===a?"":a,c=h.state||{};return[c.idx,{pathname:e,search:o,hash:i,state:c.usr||null,key:c.key||"default"}]}var v=null;function d(){if(v)P.call(v),v=null;else{var n=t.Action.Pop,e=p(),r=e[0],o=e[1];if(P.length){if(null!=r){var a=m-r;a&&(v={action:n,location:o,retry:function(){L(-1*a)}},L(a))}}else H(n)}}s.addEventListener(o,d),s.addEventListener("hashchange",(function(){l(p()[1])!==l(b)&&d()}));var g=t.Action.Pop,y=p(),m=y[0],b=y[1],A=c(),P=c();function k(t){return function(){var t=document.querySelector("base"),n="";if(t&&t.getAttribute("href")){var e=s.location.href,r=e.indexOf("#");n=-1===r?e:e.slice(0,r)}return n}()+"#"+("string"==typeof t?t:l(t))}function x(t,e){return void 0===e&&(e=null),n({pathname:b.pathname,hash:"",search:""},"string"==typeof t?f(t):t,{state:e,key:u()})}function w(t,n){return[{usr:t.state,key:t.key,idx:n},k(t)]}function E(t,n,e){return!P.length||(P.call({action:t,location:n,retry:e}),!1)}function H(t){g=t;var n=p();m=n[0],b=n[1],A.call({action:g,location:b})}function L(t){h.go(t)}return null==m&&(m=0,h.replaceState(n({},h.state,{idx:m}),"")),{get action(){return g},get location(){return b},createHref:k,push:function n(e,r){var o=t.Action.Push,a=x(e,r);if(E(o,a,(function(){n(e,r)}))){var i=w(a,m+1),c=i[0],u=i[1];try{h.pushState(c,"",u)}catch(t){s.location.assign(u)}H(o)}},replace:function n(e,r){var o=t.Action.Replace,a=x(e,r);if(E(o,a,(function(){n(e,r)}))){var i=w(a,m),c=i[0],u=i[1];h.replaceState(c,"",u),H(o)}},go:L,back:function(){L(-1)},forward:function(){L(1)},listen:function(t){return A.push(t)},block:function(t){var n=P.push(t);return 1===P.length&&s.addEventListener(r,i),function(){n(),P.length||s.removeEventListener(r,i)}}}},t.createMemoryHistory=function(e){void 0===e&&(e={});var r=e,o=r.initialEntries,i=void 0===o?["/"]:o,s=r.initialIndex,h=i.map((function(t){return n({pathname:"/",search:"",hash:"",state:null,key:u()},"string"==typeof t?f(t):t)})),p=a(null==s?h.length-1:s,0,h.length-1),v=t.Action.Pop,d=h[p],g=c(),y=c();function m(t,e){return void 0===e&&(e=null),n({pathname:d.pathname,search:"",hash:""},"string"==typeof t?f(t):t,{state:e,key:u()})}function b(t,n,e){return!y.length||(y.call({action:t,location:n,retry:e}),!1)}function A(t,n){v=t,d=n,g.call({action:v,location:d})}function P(n){var e=a(p+n,0,h.length-1),r=t.Action.Pop,o=h[e];b(r,o,(function(){P(n)}))&&(p=e,A(r,o))}return{get index(){return p},get action(){return v},get location(){return d},createHref:function(t){return"string"==typeof t?t:l(t)},push:function n(e,r){var o=t.Action.Push,a=m(e,r);b(o,a,(function(){n(e,r)}))&&(p+=1,h.splice(p,h.length,a),A(o,a))},replace:function n(e,r){var o=t.Action.Replace,a=m(e,r);b(o,a,(function(){n(e,r)}))&&(h[p]=a,A(o,a))},go:P,back:function(){P(-1)},forward:function(){P(1)},listen:function(t){return g.push(t)},block:function(t){return y.push(t)}}},t.createPath=l,t.parsePath=f,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=history.production.min.js.map
/**
* @remix-run/router v1.14.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).RemixRouter={})}(this,(function(e){"use strict";function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(r),e=e.substr(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substr(a),e=e.substr(0,a)),e&&(t.pathname=e)}return t}function d(e,n,c,d){void 0===d&&(d={});let{window:u=document.defaultView,v5Compat:h=!1}=d,f=u.history,p=r.Pop,m=null,y=v();function v(){return(f.state||{idx:null}).idx}function g(){p=r.Pop;let e=v(),t=null==e?null:e-y;y=e,m&&m({action:p,location:w.location,delta:t})}function b(e){let t="null"!==u.location.origin?u.location.origin:u.location.href,r="string"==typeof e?e:l(e);return o(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==y&&(y=0,f.replaceState(t({},f.state,{idx:y}),""));let w={get action(){return p},get location(){return e(u,f)},listen(e){if(m)throw new Error("A history only accepts one active listener");return u.addEventListener(a,g),m=e,()=>{u.removeEventListener(a,g),m=null}},createHref:e=>n(u,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){p=r.Push;let a=s(w.location,e,t);c&&c(a,e),y=v()+1;let o=i(a,y),n=w.createHref(a);try{f.pushState(o,"",n)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;u.location.assign(n)}h&&m&&m({action:p,location:w.location,delta:1})},replace:function(e,t){p=r.Replace;let a=s(w.location,e,t);c&&c(a,e),y=v();let o=i(a,y),n=w.createHref(a);f.replaceState(o,"",n),h&&m&&m({action:p,location:w.location,delta:0})},go:e=>f.go(e)};return w}let u=function(e){return e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error",e}({});const h=new Set(["lazy","caseSensitive","path","id","index","children"]);function f(e,r,a,n){return void 0===a&&(a=[]),void 0===n&&(n={}),e.map(((e,i)=>{let s=[...a,i],l="string"==typeof e.id?e.id:s.join("-");if(o(!0!==e.index||!e.children,"Cannot specify children on an index route"),o(!n[l],'Found a route id collision on id "'+l+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let a=t({},e,r(e),{id:l});return n[l]=a,a}{let a=t({},e,r(e),{id:l,children:void 0});return n[l]=a,e.children&&(a.children=f(e.children,r,s,n)),a}}))}function p(e,t,r){void 0===r&&(r="/");let a=E(("string"==typeof t?c(t):t).pathname||"/",r);if(null==a)return null;let o=y(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let n=null;for(let e=0;null==n&&e{let s={relativePath:void 0===i?e.path||"":i,caseSensitive:!0===e.caseSensitive,childrenIndex:n,route:e};s.relativePath.startsWith("/")&&(o(s.relativePath.startsWith(a),'Absolute route path "'+s.relativePath+'" nested under path "'+a+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),s.relativePath=s.relativePath.slice(a.length));let l=j([a,s.relativePath]),c=r.concat(s);e.children&&e.children.length>0&&(o(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),y(e.children,t,c,l)),(null!=e.path||e.index)&&t.push({path:l,score:w(l,e.index),routesMeta:c})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of v(e.path))n(e,t,r);else n(e,t)})),t}function v(e){let t=e.split("/");if(0===t.length)return[];let[r,...a]=t,o=r.endsWith("?"),n=r.replace(/\?$/,"");if(0===a.length)return o?[n,""]:[n];let i=v(a.join("/")),s=[];return s.push(...i.map((e=>""===e?n:[n,e].join("/")))),o&&s.push(...i),s.map((t=>e.startsWith("/")&&""===t?"/":t))}const g=/^:[\w-]+$/,b=e=>"*"===e;function w(e,t){let r=e.split("/"),a=r.length;return r.some(b)&&(a+=-2),t&&(a+=2),r.filter((e=>!b(e))).reduce(((e,t)=>e+(g.test(t)?3:""===t?1:10)),a)}function D(e,t){let{routesMeta:r}=e,a={},o="/",n=[];for(let e=0;e(a.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(a.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");return[new RegExp(o,t?void 0:"i"),a]}(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let i=o[0],s=i.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:a.reduce(((e,t,r)=>{let{paramName:a,isOptional:o}=t;if("*"===a){let e=l[r]||"";s=i.slice(0,i.length-e.length).replace(/(.)\/+$/,"$1")}const c=l[r];return e[a]=o&&!c?void 0:function(e,t){try{return decodeURIComponent(e)}catch(r){return n(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+r+")."),e}}(c||"",a),e}),{}),pathname:i,pathnameBase:s,pattern:e}}function R(e){try{return decodeURI(e)}catch(t){return n(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function E(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&"/"!==a?null:e.slice(r)||"/"}function P(e,t){void 0===t&&(t="/");let{pathname:r,search:a="",hash:o=""}="string"==typeof e?c(e):e,n=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:n,search:_(a),hash:T(o)}}function x(e,t,r,a){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(a)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function L(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function A(e,t){let r=L(e);return t?r.map(((t,r)=>r===e.length-1?t.pathname:t.pathnameBase)):r.map((e=>e.pathnameBase))}function M(e,r,a,n){let i;void 0===n&&(n=!1),"string"==typeof e?i=c(e):(i=t({},e),o(!i.pathname||!i.pathname.includes("?"),x("?","pathname","search",i)),o(!i.pathname||!i.pathname.includes("#"),x("#","pathname","hash",i)),o(!i.search||!i.search.includes("#"),x("#","search","hash",i)));let s,l=""===e||""===i.pathname,d=l?"/":i.pathname;if(null==d)s=a;else{let e=r.length-1;if(!n&&d.startsWith("..")){let t=d.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}s=e>=0?r[e]:"/"}let u=P(i,s),h=d&&"/"!==d&&d.endsWith("/"),f=(l||"."===d)&&a.endsWith("/");return u.pathname.endsWith("/")||!h&&!f||(u.pathname+="/"),u}const j=e=>e.join("/").replace(/\/\/+/g,"/"),k=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),_=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",T=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";class C extends Error{}class U{constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],o(e&&"object"==typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise(((e,t)=>r=t)),this.controller=new AbortController;let a=()=>r(new C("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",a),this.controller.signal.addEventListener("abort",a),this.data=Object.entries(e).reduce(((e,t)=>{let[r,a]=t;return Object.assign(e,{[r]:this.trackPromise(r,a)})}),{}),this.done&&this.unlistenAbortSignal(),this.init=t}trackPromise(e,t){if(!(t instanceof Promise))return t;this.deferredKeys.push(e),this.pendingKeysSet.add(e);let r=Promise.race([t,this.abortPromise]).then((t=>this.onSettle(r,e,void 0,t)),(t=>this.onSettle(r,e,t)));return r.catch((()=>{})),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(e,t,r,a){if(this.controller.signal.aborted&&r instanceof C)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>r}),Promise.reject(r);if(this.pendingKeysSet.delete(t),this.done&&this.unlistenAbortSignal(),void 0===r&&void 0===a){let r=new Error('Deferred data for key "'+t+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)}return void 0===a?(Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)):(Object.defineProperty(e,"_data",{get:()=>a}),this.emit(!1,t),a)}emit(e,t){this.subscribers.forEach((r=>r(e,t)))}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach(((e,t)=>this.pendingKeysSet.delete(t))),this.emit(!0)}async resolveData(e){let t=!1;if(!this.done){let r=()=>this.cancel();e.addEventListener("abort",r),t=await new Promise((t=>{this.subscribe((a=>{e.removeEventListener("abort",r),(a||this.done)&&t(a)}))}))}return t}get done(){return 0===this.pendingKeysSet.size}get unwrappedData(){return o(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(((e,t)=>{let[r,a]=t;return Object.assign(e,{[r]:O(a)})}),{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function O(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const H=function(e,r){void 0===r&&(r=302);let a=r;"number"==typeof a?a={status:a}:void 0===a.status&&(a.status=302);let o=new Headers(a.headers);return o.set("Location",e),new Response(null,t({},a,{headers:o}))};class I{constructor(e,t,r,a){void 0===a&&(a=!1),this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function z(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const q=["post","put","patch","delete"],B=new Set(q),N=["get",...q],F=new Set(N),W=new Set([301,302,303,307,308]),$=new Set([307,308]),K={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},J={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Y={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},V=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,X=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),G="remix-router-transitions";const Q=Symbol("deferred");function Z(e,t,r,a,o,n,i,s){let c,d;if(i){c=[];for(let e of t)if(c.push(e),e.route.id===i){d=e;break}}else c=t,d=t[t.length-1];let u=M(o||".",A(c,n),E(e.pathname,r)||e.pathname,"path"===s);return null==o&&(u.search=e.search,u.hash=e.hash),null!=o&&""!==o&&"."!==o||!d||!d.route.index||Le(u.search)||(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),a&&"/"!==r&&(u.pathname="/"===u.pathname?r:j([r,u.pathname])),l(u)}function ee(e,t,r,a){if(!a||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(a))return{path:r};if(a.formMethod&&!Re(a.formMethod))return{path:r,error:me(405,{method:a.formMethod})};let n,i,s=()=>({path:r,error:me(400,{type:"invalid-body"})}),d=a.formMethod||"get",u=e?d.toUpperCase():d.toLowerCase(),h=ve(r);if(void 0!==a.body){if("text/plain"===a.formEncType){if(!Ee(u))return s();let e="string"==typeof a.body?a.body:a.body instanceof FormData||a.body instanceof URLSearchParams?Array.from(a.body.entries()).reduce(((e,t)=>{let[r,a]=t;return""+e+r+"="+a+"\n"}),""):String(a.body);return{path:r,submission:{formMethod:u,formAction:h,formEncType:a.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===a.formEncType){if(!Ee(u))return s();try{let e="string"==typeof a.body?JSON.parse(a.body):a.body;return{path:r,submission:{formMethod:u,formAction:h,formEncType:a.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return s()}}}if(o("function"==typeof FormData,"FormData is not available in this environment"),a.formData)n=le(a.formData),i=a.formData;else if(a.body instanceof FormData)n=le(a.body),i=a.body;else if(a.body instanceof URLSearchParams)n=a.body,i=ce(n);else if(null==a.body)n=new URLSearchParams,i=new FormData;else try{n=new URLSearchParams(a.body),i=ce(n)}catch(e){return s()}let f={formMethod:u,formAction:h,formEncType:a&&a.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(Ee(f.formMethod))return{path:r,submission:f};let p=c(r);return t&&p.search&&Le(p.search)&&n.append("index",""),p.search="?"+n,{path:l(p),submission:f}}function te(e,t){let r=e;if(t){let a=e.findIndex((e=>e.route.id===t));a>=0&&(r=e.slice(0,a))}return r}function re(e,r,a,o,n,i,s,l,c,d,u,h,f,m,y,v){let g=v?Object.values(v)[0]:y?Object.values(y)[0]:void 0,b=e.createURL(r.location),w=e.createURL(n),D=v?Object.keys(v)[0]:void 0,S=te(a,D).filter(((e,a)=>{let{route:n}=e;if(n.lazy)return!0;if(null==n.loader)return!1;if(i)return!!n.loader.hydrate||void 0===r.loaderData[n.id]&&(!r.errors||void 0===r.errors[n.id]);if(function(e,t,r){let a=!t||r.route.id!==t.route.id,o=void 0===e[r.route.id];return a||o}(r.loaderData,r.matches[a],e)||l.some((t=>t===e.route.id)))return!0;let c=r.matches[a],d=e;return oe(e,t({currentUrl:b,currentParams:c.params,nextUrl:w,nextParams:d.params},o,{actionResult:g,defaultShouldRevalidate:s||b.pathname+b.search===w.pathname+w.search||b.search!==w.search||ae(c,d)}))})),R=[];return u.forEach(((e,n)=>{if(i||!a.some((t=>t.route.id===e.routeId))||d.has(n))return;let l=p(f,e.path,m);if(!l)return void R.push({key:n,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let u=r.fetchers.get(n),y=Ae(l,e.path),v=!1;v=!h.has(n)&&(!!c.includes(n)||(u&&"idle"!==u.state&&void 0===u.data?s:oe(y,t({currentUrl:b,currentParams:r.matches[r.matches.length-1].params,nextUrl:w,nextParams:a[a.length-1].params},o,{actionResult:g,defaultShouldRevalidate:s})))),v&&R.push({key:n,routeId:e.routeId,path:e.path,matches:l,match:y,controller:new AbortController})})),[S,R]}function ae(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function oe(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function ne(e,r,a){if(!e.lazy)return;let i=await e.lazy();if(!e.lazy)return;let s=a[e.id];o(s,"No route found in manifest");let l={};for(let e in i){let t=void 0!==s[e]&&"hasErrorBoundary"!==e;n(!t,'Route "'+s.id+'" has a static property "'+e+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+e+'" will be ignored.'),t||h.has(e)||(l[e]=i[e])}Object.assign(s,l),Object.assign(s,t({},r(s),{lazy:void 0}))}async function ie(e,t,r,a,n,i,s,l,c){let d,h,f;void 0===c&&(c={});let p=e=>{let a,o=new Promise(((e,t)=>a=t));return f=()=>a(),t.signal.addEventListener("abort",f),Promise.race([e({request:t,params:r.params,context:c.requestContext}),o])};try{let a=r.route[e];if(r.route.lazy)if(a){let e,t=await Promise.all([p(a).catch((t=>{e=t})),ne(r.route,i,n)]);if(e)throw e;h=t[0]}else{if(await ne(r.route,i,n),a=r.route[e],!a){if("action"===e){let e=new URL(t.url),a=e.pathname+e.search;throw me(405,{method:t.method,pathname:a,routeId:r.route.id})}return{type:u.data,data:void 0}}h=await p(a)}else{if(!a){let e=new URL(t.url);throw me(404,{pathname:e.pathname+e.search})}h=await p(a)}o(void 0!==h,"You defined "+("action"===e?"an action":"a loader")+' for route "'+r.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(e){d=u.error,h=e}finally{f&&t.signal.removeEventListener("abort",f)}if(Se(h)){let e,n=h.status;if(W.has(n)){let e=h.headers.get("Location");if(o(e,"Redirects returned/thrown from loaders/actions must have a Location header"),V.test(e)){if(!c.isStaticRequest){let r=new URL(t.url),a=e.startsWith("//")?new URL(r.protocol+e):new URL(e),o=null!=E(a.pathname,s);a.origin===r.origin&&o&&(e=a.pathname+a.search+a.hash)}}else e=Z(new URL(t.url),a.slice(0,a.indexOf(r)+1),s,!0,e,l);if(c.isStaticRequest)throw h.headers.set("Location",e),h;return{type:u.redirect,status:n,location:e,revalidate:null!==h.headers.get("X-Remix-Revalidate"),reloadDocument:null!==h.headers.get("X-Remix-Reload-Document")}}if(c.isRouteRequest){throw{type:d===u.error?u.error:u.data,response:h}}try{let t=h.headers.get("Content-Type");e=t&&/\bapplication\/json\b/.test(t)?null==h.body?null:await h.json():await h.text()}catch(e){return{type:u.error,error:e}}return d===u.error?{type:d,error:new I(n,h.statusText,e),headers:h.headers}:{type:u.data,data:e,statusCode:h.status,headers:h.headers}}return d===u.error?{type:d,error:h}:De(h)?{type:u.deferred,deferredData:h,statusCode:null==(m=h.init)?void 0:m.status,headers:(null==(y=h.init)?void 0:y.headers)&&new Headers(h.init.headers)}:{type:u.data,data:h};var m,y}function se(e,t,r,a){let o=e.createURL(ve(t)).toString(),n={signal:r};if(a&&Ee(a.formMethod)){let{formMethod:e,formEncType:t}=a;n.method=e.toUpperCase(),"application/json"===t?(n.headers=new Headers({"Content-Type":t}),n.body=JSON.stringify(a.json)):"text/plain"===t?n.body=a.text:"application/x-www-form-urlencoded"===t&&a.formData?n.body=le(a.formData):n.body=a.formData}return new Request(o,n)}function le(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,"string"==typeof a?a:a.name);return t}function ce(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function de(e,t,r,a,n){let i,s={},l=null,c=!1,d={};return r.forEach(((r,u)=>{let h=t[u].route.id;if(o(!we(r),"Cannot handle redirect results in processLoaderData"),be(r)){let t=fe(e,h),o=r.error;a&&(o=Object.values(a)[0],a=void 0),l=l||{},null==l[t.route.id]&&(l[t.route.id]=o),s[h]=void 0,c||(c=!0,i=z(r.error)?r.error.status:500),r.headers&&(d[h]=r.headers)}else ge(r)?(n.set(h,r.deferredData),s[h]=r.deferredData.data):s[h]=r.data,null==r.statusCode||200===r.statusCode||c||(i=r.statusCode),r.headers&&(d[h]=r.headers)})),a&&(l=a,s[Object.keys(a)[0]]=void 0),{loaderData:s,errors:l,statusCode:i||200,loaderHeaders:d}}function ue(e,r,a,n,i,s,l,c){let{loaderData:d,errors:u}=de(r,a,n,i,c);for(let r=0;re.route.id===t))+1):[...e]).reverse().find((e=>!0===e.route.hasErrorBoundary))||e[0]}function pe(e){let t=1===e.length?e[0]:e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function me(e,t){let{pathname:r,routeId:a,method:o,type:n}=void 0===t?{}:t,i="Unknown Server Error",s="Unknown @remix-run/router error";return 400===e?(i="Bad Request",o&&r&&a?s="You made a "+o+' request to "'+r+'" but did not provide a `loader` for route "'+a+'", so there is no way to handle the request.':"defer-action"===n?s="defer() is not supported in actions":"invalid-body"===n&&(s="Unable to encode submission body")):403===e?(i="Forbidden",s='Route "'+a+'" does not match URL "'+r+'"'):404===e?(i="Not Found",s='No route matches URL "'+r+'"'):405===e&&(i="Method Not Allowed",o&&r&&a?s="You made a "+o.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+a+'", so there is no way to handle the request.':o&&(s='Invalid request method "'+o.toUpperCase()+'"')),new I(e||500,i,new Error(s),!0)}function ye(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(we(r))return{result:r,idx:t}}}function ve(e){return l(t({},"string"==typeof e?c(e):e,{hash:""}))}function ge(e){return e.type===u.deferred}function be(e){return e.type===u.error}function we(e){return(e&&e.type)===u.redirect}function De(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}function Se(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function Re(e){return F.has(e.toLowerCase())}function Ee(e){return B.has(e.toLowerCase())}async function Pe(e,t,r,a,n,i){for(let s=0;se.route.id===c.route.id)),u=null!=d&&!ae(d,c)&&void 0!==(i&&i[c.route.id]);if(ge(l)&&(n||u)){let e=a[s];o(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await xe(l,e,n).then((e=>{e&&(r[s]=e||r[s])}))}}}async function xe(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:u.data,data:e.deferredData.unwrappedData}}catch(e){return{type:u.error,error:e}}return{type:u.data,data:e.deferredData.data}}}function Le(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Ae(e,t){let r="string"==typeof t?c(t).search:t.search;if(e[e.length-1].route.index&&Le(r||""))return e[e.length-1];let a=L(e);return a[a.length-1]}function Me(e){let{formMethod:t,formAction:r,formEncType:a,text:o,formData:n,json:i}=e;if(t&&r&&a)return null!=o?{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:void 0,text:o}:null!=n?{formMethod:t,formAction:r,formEncType:a,formData:n,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:i,text:void 0}:void 0}function je(e,t){if(t){return{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}return{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function ke(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function _e(e,t){if(e){return{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}}return{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Te(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}e.AbortedDeferredError=C,e.Action=r,e.IDLE_BLOCKER=Y,e.IDLE_FETCHER=J,e.IDLE_NAVIGATION=K,e.UNSAFE_DEFERRED_SYMBOL=Q,e.UNSAFE_DeferredData=U,e.UNSAFE_ErrorResponseImpl=I,e.UNSAFE_convertRouteMatchToUiMatch=m,e.UNSAFE_convertRoutesToDataRoutes=f,e.UNSAFE_getResolveToMatches=A,e.UNSAFE_invariant=o,e.UNSAFE_warning=n,e.createBrowserHistory=function(e){return void 0===e&&(e={}),d((function(e,t){let{pathname:r,search:a,hash:o}=e.location;return s("",{pathname:r,search:a,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:l(t)}),null,e)},e.createHashHistory=function(e){return void 0===e&&(e={}),d((function(e,t){let{pathname:r="/",search:a="",hash:o=""}=c(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),s("",{pathname:r,search:a,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let r=e.document.querySelector("base"),a="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");a=-1===r?t:t.slice(0,r)}return a+"#"+("string"==typeof t?t:l(t))}),(function(e,t){n("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)},e.createMemoryHistory=function(e){void 0===e&&(e={});let t,{initialEntries:a=["/"],initialIndex:o,v5Compat:i=!1}=e;t=a.map(((e,t)=>m(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let d=f(null==o?t.length-1:o),u=r.Pop,h=null;function f(e){return Math.min(Math.max(e,0),t.length-1)}function p(){return t[d]}function m(e,r,a){void 0===r&&(r=null);let o=s(t?p().pathname:"/",e,r,a);return n("/"===o.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),o}function y(e){return"string"==typeof e?e:l(e)}return{get index(){return d},get action(){return u},get location(){return p()},createHref:y,createURL:e=>new URL(y(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?c(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,a){u=r.Push;let o=m(e,a);d+=1,t.splice(d,t.length,o),i&&h&&h({action:u,location:o,delta:1})},replace(e,a){u=r.Replace;let o=m(e,a);t[d]=o,i&&h&&h({action:u,location:o,delta:0})},go(e){u=r.Pop;let a=f(d+e),o=t[a];d=a,h&&h({action:u,location:o,delta:e})},listen:e=>(h=e,()=>{h=null})}},e.createPath=l,e.createRouter=function(e){const a=e.window?e.window:"undefined"!=typeof window?window:void 0,i=void 0!==a&&void 0!==a.document&&void 0!==a.document.createElement,l=!i;let c;if(o(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)c=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;c=e=>({hasErrorBoundary:t(e)})}else c=X;let d,h,y={},v=f(e.routes,c,void 0,y),g=e.basename||"/",b=t({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),w=null,D=new Set,S=null,R=null,P=null,x=null!=e.hydrationData,L=p(v,e.history.location,g),A=null;if(null==L){let t=me(404,{pathname:e.history.location.pathname}),{matches:r,route:a}=pe(v);L=r,A={[a.id]:t}}let M,j=L.some((e=>e.route.lazy)),k=L.some((e=>e.route.loader));if(j)h=!1;else if(k)if(b.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null;h=L.every((e=>e.route.loader&&!0!==e.route.loader.hydrate&&(t&&void 0!==t[e.route.id]||r&&void 0!==r[e.route.id])))}else h=null!=e.hydrationData;else h=!0;let _,T={historyAction:e.history.action,location:e.history.location,matches:L,initialized:h,navigation:K,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||A,fetchers:new Map,blockers:new Map},C=r.Pop,U=!1,O=!1,H=new Map,I=null,z=!1,q=!1,B=[],N=[],F=new Map,W=0,Q=-1,te=new Map,ae=new Set,oe=new Map,ne=new Map,le=new Set,ce=new Map,de=new Map,ve=!1;function De(e,r){void 0===r&&(r={}),T=t({},T,e);let a=[],o=[];b.v7_fetcherPersist&&T.fetchers.forEach(((e,t)=>{"idle"===e.state&&(le.has(t)?o.push(t):a.push(t))})),[...D].forEach((e=>e(T,{deletedFetchers:o,unstable_viewTransitionOpts:r.viewTransitionOpts,unstable_flushSync:!0===r.flushSync}))),b.v7_fetcherPersist&&(a.forEach((e=>T.fetchers.delete(e))),o.forEach((e=>ze(e))))}function Se(a,o,n){var i,s;let l,{flushSync:c}=void 0===n?{}:n,u=null!=T.actionData&&null!=T.navigation.formMethod&&Ee(T.navigation.formMethod)&&"loading"===T.navigation.state&&!0!==(null==(i=a.state)?void 0:i._isRedirect);l=o.actionData?Object.keys(o.actionData).length>0?o.actionData:null:u?T.actionData:null;let h=o.loaderData?he(T.loaderData,o.loaderData,o.matches||[],o.errors):T.loaderData,f=T.blockers;f.size>0&&(f=new Map(f),f.forEach(((e,t)=>f.set(t,Y))));let p,m=!0===U||null!=T.navigation.formMethod&&Ee(T.navigation.formMethod)&&!0!==(null==(s=a.state)?void 0:s._isRedirect);if(d&&(v=d,d=void 0),z||C===r.Pop||(C===r.Push?e.history.push(a,a.state):C===r.Replace&&e.history.replace(a,a.state)),C===r.Pop){let e=H.get(T.location.pathname);e&&e.has(a.pathname)?p={currentLocation:T.location,nextLocation:a}:H.has(a.pathname)&&(p={currentLocation:a,nextLocation:T.location})}else if(O){let e=H.get(T.location.pathname);e?e.add(a.pathname):(e=new Set([a.pathname]),H.set(T.location.pathname,e)),p={currentLocation:T.location,nextLocation:a}}De(t({},o,{actionData:l,loaderData:h,historyAction:C,location:a,initialized:!0,navigation:K,revalidation:"idle",restoreScrollPosition:Ve(a,o.matches||T.matches),preventScrollReset:m,blockers:f}),{viewTransitionOpts:p,flushSync:!0===c}),C=r.Pop,U=!1,O=!1,z=!1,q=!1,B=[],N=[]}async function Re(a,o,n){_&&_.abort(),_=null,C=a,z=!0===(n&&n.startUninterruptedRevalidation),function(e,t){if(S&&P){let r=Ye(e,t);S[r]=P()}}(T.location,T.matches),U=!0===(n&&n.preventScrollReset),O=!0===(n&&n.enableViewTransition);let i=d||v,s=n&&n.overrideNavigation,l=p(i,o,g),h=!0===(n&&n.flushSync);if(!l){let e=me(404,{pathname:o.pathname}),{matches:t,route:r}=pe(i);return Je(),void Se(o,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:h})}if(T.initialized&&!q&&function(e,t){if(e.pathname!==t.pathname||e.search!==t.search)return!1;if(""===e.hash)return""!==t.hash;if(e.hash===t.hash)return!0;if(""!==t.hash)return!0;return!1}(T.location,o)&&!(n&&n.submission&&Ee(n.submission.formMethod)))return void Se(o,{matches:l},{flushSync:h});_=new AbortController;let f,m,w=se(e.history,o,_.signal,n&&n.submission);if(n&&n.pendingError)m={[fe(l).route.id]:n.pendingError};else if(n&&n.submission&&Ee(n.submission.formMethod)){let e=await async function(e,t,a,o,n){void 0===n&&(n={});let i;Ue(),De({navigation:ke(t,a)},{flushSync:!0===n.flushSync});let s=Ae(o,t);if(s.route.action||s.route.lazy){if(i=await ie("action",e,s,o,y,c,g,b.v7_relativeSplatPath),e.signal.aborted)return{shortCircuited:!0}}else i={type:u.error,error:me(405,{method:e.method,pathname:t.pathname,routeId:s.route.id})};if(we(i)){let e;return e=n&&null!=n.replace?n.replace:i.location===T.location.pathname+T.location.search,await Le(T,i,{submission:a,replace:e}),{shortCircuited:!0}}if(be(i)){let e=fe(o,s.route.id);return!0!==(n&&n.replace)&&(C=r.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:i.error}}}if(ge(i))throw me(400,{type:"defer-action"});return{pendingActionData:{[s.route.id]:i.data}}}(w,o,n.submission,l,{replace:n.replace,flushSync:h});if(e.shortCircuited)return;f=e.pendingActionData,m=e.pendingActionError,s=je(o,n.submission),h=!1,w=new Request(w.url,{signal:w.signal})}let{shortCircuited:D,loaderData:R,errors:E}=await async function(r,a,o,n,i,s,l,c,u,h,f){let p=n||je(a,i),m=i||s||Me(p),y=d||v,[w,D]=re(e.history,T,o,m,a,b.v7_partialHydration&&!0===c,q,B,N,le,oe,ae,y,g,h,f);if(Je((e=>!(o&&o.some((t=>t.route.id===e)))||w&&w.some((t=>t.route.id===e)))),Q=++W,0===w.length&&0===D.length){let e=Ne();return Se(a,t({matches:o,loaderData:{},errors:f||null},h?{actionData:h}:{},e?{fetchers:new Map(T.fetchers)}:{}),{flushSync:u}),{shortCircuited:!0}}if(!(z||b.v7_partialHydration&&c)){D.forEach((e=>{let t=T.fetchers.get(e.key),r=_e(void 0,t?t.data:void 0);T.fetchers.set(e.key,r)}));let e=h||T.actionData;De(t({navigation:p},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},D.length>0?{fetchers:new Map(T.fetchers)}:{}),{flushSync:u})}D.forEach((e=>{F.has(e.key)&&qe(e.key),e.controller&&F.set(e.key,e.controller)}));let S=()=>D.forEach((e=>qe(e.key)));_&&_.signal.addEventListener("abort",S);let{results:R,loaderResults:E,fetcherResults:P}=await Ce(T.matches,o,w,D,r);if(r.signal.aborted)return{shortCircuited:!0};_&&_.signal.removeEventListener("abort",S);D.forEach((e=>F.delete(e.key)));let x=ye(R);if(x){if(x.idx>=w.length){let e=D[x.idx-w.length].key;ae.add(e)}return await Le(T,x.result,{replace:l}),{shortCircuited:!0}}let{loaderData:L,errors:A}=ue(T,o,w,E,f,D,P,ce);ce.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&ce.delete(t)}))}));let M=Ne(),j=Fe(Q),k=M||j||D.length>0;return t({loaderData:L,errors:A},k?{fetchers:new Map(T.fetchers)}:{})}(w,o,l,s,n&&n.submission,n&&n.fetcherSubmission,n&&n.replace,n&&!0===n.initialHydration,h,f,m);D||(_=null,Se(o,t({matches:l},f?{actionData:f}:{},{loaderData:R,errors:E})))}async function Le(n,l,c){let{submission:d,fetcherSubmission:u,replace:h}=void 0===c?{}:c;l.revalidate&&(q=!0);let f=s(n.location,l.location,{_isRedirect:!0});if(o(f,"Expected a location on the redirect navigation"),i){let t=!1;if(l.reloadDocument)t=!0;else if(V.test(l.location)){const r=e.history.createURL(l.location);t=r.origin!==a.location.origin||null==E(r.pathname,g)}if(t)return void(h?a.location.replace(l.location):a.location.assign(l.location))}_=null;let p=!0===h?r.Replace:r.Push,{formMethod:m,formAction:y,formEncType:v}=n.navigation;!d&&!u&&m&&y&&v&&(d=Me(n.navigation));let b=d||u;if($.has(l.status)&&b&&Ee(b.formMethod))await Re(p,f,{submission:t({},b,{formAction:l.location}),preventScrollReset:U});else{let e=je(f,d);await Re(p,f,{overrideNavigation:e,fetcherSubmission:u,preventScrollReset:U})}}async function Ce(t,r,a,o,n){let i=await Promise.all([...a.map((e=>ie("loader",n,e,r,y,c,g,b.v7_relativeSplatPath))),...o.map((t=>{if(t.matches&&t.match&&t.controller)return ie("loader",se(e.history,t.path,t.controller.signal),t.match,t.matches,y,c,g,b.v7_relativeSplatPath);return{type:u.error,error:me(404,{pathname:t.path})}}))]),s=i.slice(0,a.length),l=i.slice(a.length);return await Promise.all([Pe(t,a,s,s.map((()=>n.signal)),!1,T.loaderData),Pe(t,o.map((e=>e.match)),l,o.map((e=>e.controller?e.controller.signal:null)),!0)]),{results:i,loaderResults:s,fetcherResults:l}}function Ue(){q=!0,B.push(...Je()),oe.forEach(((e,t)=>{F.has(t)&&(N.push(t),qe(t))}))}function Oe(e,t,r){void 0===r&&(r={}),T.fetchers.set(e,t),De({fetchers:new Map(T.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function He(e,t,r,a){void 0===a&&(a={});let o=fe(T.matches,t);ze(e),De({errors:{[o.route.id]:r},fetchers:new Map(T.fetchers)},{flushSync:!0===(a&&a.flushSync)})}function Ie(e){return b.v7_fetcherPersist&&(ne.set(e,(ne.get(e)||0)+1),le.has(e)&&le.delete(e)),T.fetchers.get(e)||J}function ze(e){let t=T.fetchers.get(e);!F.has(e)||t&&"loading"===t.state&&te.has(e)||qe(e),oe.delete(e),te.delete(e),ae.delete(e),le.delete(e),T.fetchers.delete(e)}function qe(e){let t=F.get(e);o(t,"Expected fetch controller: "+e),t.abort(),F.delete(e)}function Be(e){for(let t of e){let e=Te(Ie(t).data);T.fetchers.set(t,e)}}function Ne(){let e=[],t=!1;for(let r of ae){let a=T.fetchers.get(r);o(a,"Expected fetcher: "+r),"loading"===a.state&&(ae.delete(r),e.push(r),t=!0)}return Be(e),t}function Fe(e){let t=[];for(let[r,a]of te)if(a0}function We(e){T.blockers.delete(e),de.delete(e)}function $e(e,t){let r=T.blockers.get(e)||Y;o("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,"Invalid blocker state transition: "+r.state+" -> "+t.state);let a=new Map(T.blockers);a.set(e,t),De({blockers:a})}function Ke(e){let{currentLocation:t,nextLocation:r,historyAction:a}=e;if(0===de.size)return;de.size>1&&n(!1,"A router only supports one blocker at a time");let o=Array.from(de.entries()),[i,s]=o[o.length-1],l=T.blockers.get(i);return l&&"proceeding"===l.state?void 0:s({currentLocation:t,nextLocation:r,historyAction:a})?i:void 0}function Je(e){let t=[];return ce.forEach(((r,a)=>{e&&!e(a)||(r.cancel(),t.push(a),ce.delete(a))})),t}function Ye(e,t){if(R){return R(e,t.map((e=>m(e,T.loaderData))))||e.key}return e.key}function Ve(e,t){if(S){let r=Ye(e,t),a=S[r];if("number"==typeof a)return a}return null}return M={get basename(){return g},get future(){return b},get state(){return T},get routes(){return v},get window(){return a},initialize:function(){if(w=e.history.listen((t=>{let{action:r,location:a,delta:o}=t;if(ve)return void(ve=!1);n(0===de.size||null!=o,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=Ke({currentLocation:T.location,nextLocation:a,historyAction:r});return i&&null!=o?(ve=!0,e.history.go(-1*o),void $e(i,{state:"blocked",location:a,proceed(){$e(i,{state:"proceeding",proceed:void 0,reset:void 0,location:a}),e.history.go(o)},reset(){let e=new Map(T.blockers);e.set(i,Y),De({blockers:e})}})):Re(r,a)})),i){!function(e,t){try{let r=e.sessionStorage.getItem(G);if(r){let e=JSON.parse(r);for(let[r,a]of Object.entries(e||{}))a&&Array.isArray(a)&&t.set(r,new Set(a||[]))}}catch(e){}}(a,H);let e=()=>function(e,t){if(t.size>0){let r={};for(let[e,a]of t)r[e]=[...a];try{e.sessionStorage.setItem(G,JSON.stringify(r))}catch(e){n(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}}(a,H);a.addEventListener("pagehide",e),I=()=>a.removeEventListener("pagehide",e)}return T.initialized||Re(r.Pop,T.location,{initialHydration:!0}),M},subscribe:function(e){return D.add(e),()=>D.delete(e)},enableScrollRestoration:function(e,t,r){if(S=e,P=t,R=r||null,!x&&T.navigation===K){x=!0;let e=Ve(T.location,T.matches);null!=e&&De({restoreScrollPosition:e})}return()=>{S=null,P=null,R=null}},navigate:async function a(o,n){if("number"==typeof o)return void e.history.go(o);let i=Z(T.location,T.matches,g,b.v7_prependBasename,o,b.v7_relativeSplatPath,null==n?void 0:n.fromRouteId,null==n?void 0:n.relative),{path:l,submission:c,error:d}=ee(b.v7_normalizeFormMethod,!1,i,n),u=T.location,h=s(T.location,l,n&&n.state);h=t({},h,e.history.encodeLocation(h));let f=n&&null!=n.replace?n.replace:void 0,p=r.Push;!0===f?p=r.Replace:!1===f||null!=c&&Ee(c.formMethod)&&c.formAction===T.location.pathname+T.location.search&&(p=r.Replace);let m=n&&"preventScrollReset"in n?!0===n.preventScrollReset:void 0,y=!0===(n&&n.unstable_flushSync),v=Ke({currentLocation:u,nextLocation:h,historyAction:p});if(!v)return await Re(p,h,{submission:c,pendingError:d,preventScrollReset:m,replace:n&&n.replace,enableViewTransition:n&&n.unstable_viewTransition,flushSync:y});$e(v,{state:"blocked",location:h,proceed(){$e(v,{state:"proceeding",proceed:void 0,reset:void 0,location:h}),a(o,n)},reset(){let e=new Map(T.blockers);e.set(v,Y),De({blockers:e})}})},fetch:function(t,r,a,n){if(l)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");F.has(t)&&qe(t);let i=!0===(n&&n.unstable_flushSync),s=d||v,u=Z(T.location,T.matches,g,b.v7_prependBasename,a,b.v7_relativeSplatPath,r,null==n?void 0:n.relative),h=p(s,u,g);if(!h)return void He(t,r,me(404,{pathname:u}),{flushSync:i});let{path:f,submission:m,error:w}=ee(b.v7_normalizeFormMethod,!0,u,n);if(w)return void He(t,r,w,{flushSync:i});let D=Ae(h,f);U=!0===(n&&n.preventScrollReset),m&&Ee(m.formMethod)?async function(t,r,a,n,i,s,l){if(Ue(),oe.delete(t),!n.route.action&&!n.route.lazy){let e=me(405,{method:l.formMethod,pathname:a,routeId:r});return void He(t,r,e,{flushSync:s})}let u=T.fetchers.get(t);Oe(t,function(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}(l,u),{flushSync:s});let h=new AbortController,f=se(e.history,a,h.signal,l);F.set(t,h);let m=W,w=await ie("action",f,n,i,y,c,g,b.v7_relativeSplatPath);if(f.signal.aborted)return void(F.get(t)===h&&F.delete(t));if(b.v7_fetcherPersist&&le.has(t)){if(we(w)||be(w))return void Oe(t,Te(void 0))}else{if(we(w))return F.delete(t),Q>m?void Oe(t,Te(void 0)):(ae.add(t),Oe(t,_e(l)),Le(T,w,{fetcherSubmission:l}));if(be(w))return void He(t,r,w.error)}if(ge(w))throw me(400,{type:"defer-action"});let D=T.navigation.location||T.location,S=se(e.history,D,h.signal),R=d||v,E="idle"!==T.navigation.state?p(R,T.navigation.location,g):T.matches;o(E,"Didn't find any matches after fetcher action");let P=++W;te.set(t,P);let x=_e(l,w.data);T.fetchers.set(t,x);let[L,A]=re(e.history,T,E,l,D,!1,q,B,N,le,oe,ae,R,g,{[n.route.id]:w.data},void 0);A.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,r=T.fetchers.get(t),a=_e(void 0,r?r.data:void 0);T.fetchers.set(t,a),F.has(t)&&qe(t),e.controller&&F.set(t,e.controller)})),De({fetchers:new Map(T.fetchers)});let M=()=>A.forEach((e=>qe(e.key)));h.signal.addEventListener("abort",M);let{results:j,loaderResults:k,fetcherResults:U}=await Ce(T.matches,E,L,A,S);if(h.signal.aborted)return;h.signal.removeEventListener("abort",M),te.delete(t),F.delete(t),A.forEach((e=>F.delete(e.key)));let O=ye(j);if(O){if(O.idx>=L.length){let e=A[O.idx-L.length].key;ae.add(e)}return Le(T,O.result)}let{loaderData:H,errors:I}=ue(T,T.matches,L,k,void 0,A,U,ce);if(T.fetchers.has(t)){let e=Te(w.data);T.fetchers.set(t,e)}Fe(P),"loading"===T.navigation.state&&P>Q?(o(C,"Expected pending action"),_&&_.abort(),Se(T.navigation.location,{matches:E,loaderData:H,errors:I,fetchers:new Map(T.fetchers)})):(De({errors:I,loaderData:he(T.loaderData,H,E,I),fetchers:new Map(T.fetchers)}),q=!1)}(t,r,f,D,h,i,m):(oe.set(t,{routeId:r,path:f}),async function(t,r,a,n,i,s,l){let d=T.fetchers.get(t);Oe(t,_e(l,d?d.data:void 0),{flushSync:s});let u=new AbortController,h=se(e.history,a,u.signal);F.set(t,u);let f=W,p=await ie("loader",h,n,i,y,c,g,b.v7_relativeSplatPath);ge(p)&&(p=await xe(p,h.signal,!0)||p);F.get(t)===u&&F.delete(t);if(h.signal.aborted)return;if(le.has(t))return void Oe(t,Te(void 0));if(we(p))return Q>f?void Oe(t,Te(void 0)):(ae.add(t),void await Le(T,p));if(be(p))return void He(t,r,p.error);o(!ge(p),"Unhandled fetcher deferred data"),Oe(t,Te(p.data))}(t,r,f,D,h,i,m))},revalidate:function(){Ue(),De({revalidation:"loading"}),"submitting"!==T.navigation.state&&("idle"!==T.navigation.state?Re(C||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation}):Re(T.historyAction,T.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ie,deleteFetcher:function(e){if(b.v7_fetcherPersist){let t=(ne.get(e)||0)-1;t<=0?(ne.delete(e),le.add(e)):ne.set(e,t)}else ze(e);De({fetchers:new Map(T.fetchers)})},dispose:function(){w&&w(),I&&I(),D.clear(),_&&_.abort(),T.fetchers.forEach(((e,t)=>ze(t))),T.blockers.forEach(((e,t)=>We(t)))},getBlocker:function(e,t){let r=T.blockers.get(e)||Y;return de.get(e)!==t&&de.set(e,t),r},deleteBlocker:We,_internalFetchControllers:F,_internalActiveDeferreds:ce,_internalSetRoutes:function(e){y={},d=f(e,c,void 0,y)}},M},e.createStaticHandler=function(e,r){o(e.length>0,"You must provide a non-empty routes array to createStaticHandler");let a,n={},i=(r?r.basename:null)||"/";if(null!=r&&r.mapRouteProperties)a=r.mapRouteProperties;else if(null!=r&&r.detectErrorBoundary){let e=r.detectErrorBoundary;a=t=>({hasErrorBoundary:e(t)})}else a=X;let c=t({v7_relativeSplatPath:!1},r?r.future:null),d=f(e,a,void 0,n);async function h(e,r,s,l,d){o(e.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(Ee(e.method.toLowerCase())){let o=await async function(e,r,o,s,l){let d;if(o.route.action||o.route.lazy){if(d=await ie("action",e,o,r,n,a,i,c.v7_relativeSplatPath,{isStaticRequest:!0,isRouteRequest:l,requestContext:s}),e.signal.aborted){throw new Error((l?"queryRoute":"query")+"() call aborted: "+e.method+" "+e.url)}}else{let t=me(405,{method:e.method,pathname:new URL(e.url).pathname,routeId:o.route.id});if(l)throw t;d={type:u.error,error:t}}if(we(d))throw new Response(null,{status:d.status,headers:{Location:d.location}});if(ge(d)){let e=me(400,{type:"defer-action"});if(l)throw e;d={type:u.error,error:e}}if(l){if(be(d))throw d.error;return{matches:[o],loaderData:{},actionData:{[o.route.id]:d.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}if(be(d)){let a=fe(r,o.route.id);return t({},await m(e,r,s,void 0,{[a.route.id]:d.error}),{statusCode:z(d.error)?d.error.status:500,actionData:null,actionHeaders:t({},d.headers?{[o.route.id]:d.headers}:{})})}let h=new Request(e.url,{headers:e.headers,redirect:e.redirect,signal:e.signal});return t({},await m(h,r,s),d.statusCode?{statusCode:d.statusCode}:{},{actionData:{[o.route.id]:d.data},actionHeaders:t({},d.headers?{[o.route.id]:d.headers}:{})})}(e,s,d||Ae(s,r),l,null!=d);return o}let o=await m(e,s,l,d);return Se(o)?o:t({},o,{actionData:null,actionHeaders:{}})}catch(e){if((h=e)&&Se(h.response)&&(h.type===u.data||h.type===u.error)){if(e.type===u.error)throw e.response;return e.response}if(function(e){if(!Se(e))return!1;let t=e.status,r=e.headers.get("Location");return t>=300&&t<=399&&null!=r}(e))return e;throw e}var h}async function m(e,r,o,s,l){let d=null!=s;if(d&&(null==s||!s.route.loader)&&(null==s||!s.route.lazy))throw me(400,{method:e.method,pathname:new URL(e.url).pathname,routeId:null==s?void 0:s.route.id});let u=(s?[s]:te(r,Object.keys(l||{})[0])).filter((e=>e.route.loader||e.route.lazy));if(0===u.length)return{matches:r,loaderData:r.reduce(((e,t)=>Object.assign(e,{[t.route.id]:null})),{}),errors:l||null,statusCode:200,loaderHeaders:{},activeDeferreds:null};let h=await Promise.all([...u.map((t=>ie("loader",e,t,r,n,a,i,c.v7_relativeSplatPath,{isStaticRequest:!0,isRouteRequest:d,requestContext:o})))]);if(e.signal.aborted){throw new Error((d?"queryRoute":"query")+"() call aborted: "+e.method+" "+e.url)}let f=new Map,p=de(r,u,h,l,f),m=new Set(u.map((e=>e.route.id)));return r.forEach((e=>{m.has(e.route.id)||(p.loaderData[e.route.id]=null)})),t({},p,{matches:r,activeDeferreds:f.size>0?Object.fromEntries(f.entries()):null})}return{dataRoutes:d,query:async function(e,r){let{requestContext:a}=void 0===r?{}:r,o=new URL(e.url),n=e.method,c=s("",l(o),null,"default"),u=p(d,c,i);if(!Re(n)&&"HEAD"!==n){let e=me(405,{method:n}),{matches:t,route:r}=pe(d);return{basename:i,location:c,matches:t,loaderData:{},actionData:null,errors:{[r.id]:e},statusCode:e.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}if(!u){let e=me(404,{pathname:c.pathname}),{matches:t,route:r}=pe(d);return{basename:i,location:c,matches:t,loaderData:{},actionData:null,errors:{[r.id]:e},statusCode:e.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let f=await h(e,c,u,a);return Se(f)?f:t({location:c,basename:i},f)},queryRoute:async function(e,t){let{routeId:r,requestContext:a}=void 0===t?{}:t,o=new URL(e.url),n=e.method,c=s("",l(o),null,"default"),u=p(d,c,i);if(!Re(n)&&"HEAD"!==n&&"OPTIONS"!==n)throw me(405,{method:n});if(!u)throw me(404,{pathname:c.pathname});let f=r?u.find((e=>e.route.id===r)):Ae(u,c);if(r&&!f)throw me(403,{pathname:c.pathname,routeId:r});if(!f)throw me(404,{pathname:c.pathname});let m=await h(e,c,u,a,f);if(Se(m))return m;let y=m.errors?Object.values(m.errors)[0]:void 0;if(void 0!==y)throw y;if(m.actionData)return Object.values(m.actionData)[0];if(m.loaderData){var v;let e=Object.values(m.loaderData)[0];return null!=(v=m.activeDeferreds)&&v[f.route.id]&&(e[Q]=m.activeDeferreds[f.route.id]),e}}}},e.defer=function(e,t){return void 0===t&&(t={}),new U(e,"number"==typeof t?{status:t}:t)},e.generatePath=function(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(n(!1,'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),r=r.replace(/\*$/,"/*"));const a=r.startsWith("/")?"/":"",i=e=>null==e?"":"string"==typeof e?e:String(e);return a+r.split(/\/+/).map(((e,r,a)=>{if(r===a.length-1&&"*"===e){return i(t["*"])}const n=e.match(/^:([\w-]+)(\??)$/);if(n){const[,e,r]=n;let a=t[e];return o("?"===r||null!=a,'Missing ":'+e+'" param'),i(a)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")},e.getStaticContextFromError=function(e,r,a){return t({},r,{statusCode:500,errors:{[r._deepestRenderedBoundaryId||e[0].id]:a}})},e.getToPathname=function(e){return""===e||""===e.pathname?"/":"string"==typeof e?c(e).pathname:e.pathname},e.isDeferredData=De,e.isRouteErrorResponse=z,e.joinPaths=j,e.json=function(e,r){void 0===r&&(r={});let a="number"==typeof r?{status:r}:r,o=new Headers(a.headers);return o.has("Content-Type")||o.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),t({},a,{headers:o}))},e.matchPath=S,e.matchRoutes=p,e.normalizePathname=k,e.parsePath=c,e.redirect=H,e.redirectDocument=(e,t)=>{let r=H(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r},e.resolvePath=P,e.resolveTo=M,e.stripBasename=E,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=router.umd.min.js.map
/**
* React Router v6.26.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@remix-run/router")):"function"==typeof define&&define.amd?define(["exports","react","@remix-run/router"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactRouter={},e.React,e.RemixRouter)}(this,(function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var a=n(t);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t{r.current=!0})),a.useCallback((function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,o({fromRouteId:t},a)))}),[e,t])}():function(){f()||r.UNSAFE_invariant(!1);let e=a.useContext(i),{basename:t,future:n,navigator:o}=a.useContext(s),{matches:u}=a.useContext(d),{pathname:l}=v(),c=JSON.stringify(r.UNSAFE_getResolveToMatches(u,n.v7_relativeSplatPath)),p=a.useRef(!1);return m((()=>{p.current=!0})),a.useCallback((function(n,a){if(void 0===a&&(a={}),!p.current)return;if("number"==typeof n)return void o.go(n);let i=r.resolveTo(n,JSON.parse(c),l,"path"===a.relative);null==e&&"/"!==t&&(i.pathname="/"===i.pathname?t:r.joinPaths([t,i.pathname])),(a.replace?o.replace:o.push)(i,a.state,a)}),[t,o,c,l,e])}()}const g=a.createContext(null);function E(e){let t=a.useContext(d).outlet;return t?a.createElement(g.Provider,{value:e},t):t}function y(e,t){let{relative:n}=void 0===t?{}:t,{future:o}=a.useContext(s),{matches:i}=a.useContext(d),{pathname:u}=v(),l=JSON.stringify(r.UNSAFE_getResolveToMatches(i,o.v7_relativeSplatPath));return a.useMemo((()=>r.resolveTo(e,JSON.parse(l),u,"path"===n)),[e,l,u,n])}function b(e,t){return R(e,t)}function R(e,t,n,i){f()||r.UNSAFE_invariant(!1);let{navigator:u}=a.useContext(s),{matches:l}=a.useContext(d),p=l[l.length-1],m=p?p.params:{};!p||p.pathname;let h=p?p.pathnameBase:"/";p&&p.route;let g,E=v();if(t){var y;let e="string"==typeof t?r.parsePath(t):t;"/"===h||(null==(y=e.pathname)?void 0:y.startsWith(h))||r.UNSAFE_invariant(!1),g=e}else g=E;let b=g.pathname||"/",R=b;if("/"!==h){let e=h.replace(/^\//,"").split("/");R="/"+b.replace(/^\//,"").split("/").slice(e.length).join("/")}let P=r.matchRoutes(e,{pathname:R}),x=S(P&&P.map((e=>Object.assign({},e,{params:Object.assign({},m,e.params),pathname:r.joinPaths([h,u.encodeLocation?u.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?h:r.joinPaths([h,u.encodeLocation?u.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),l,n,i);return t&&x?a.createElement(c.Provider,{value:{location:o({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:r.Action.Pop}},x):x}function P(){let e=F(),t=r.isRouteErrorResponse(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),n?a.createElement("pre",{style:o},n):null,null)}const x=a.createElement(P,null);class C extends a.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?a.createElement(d.Provider,{value:this.props.routeContext},a.createElement(p.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function _(e){let{routeContext:t,match:r,children:n}=e,o=a.useContext(i);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),a.createElement(d.Provider,{value:t},n)}function S(e,t,n,o){var i;if(void 0===t&&(t=[]),void 0===n&&(n=null),void 0===o&&(o=null),null==e){var u;if(!n)return null;if(n.errors)e=n.matches;else{if(!(null!=(u=o)&&u.v7_partialHydration&&0===t.length&&!n.initialized&&n.matches.length>0))return null;e=n.matches}}let l=e,s=null==(i=n)?void 0:i.errors;if(null!=s){let e=l.findIndex((e=>e.route.id&&void 0!==(null==s?void 0:s[e.route.id])));e>=0||r.UNSAFE_invariant(!1),l=l.slice(0,Math.min(l.length,e+1))}let c=!1,d=-1;if(n&&o&&o.v7_partialHydration)for(let e=0;e=0?l.slice(0,d+1):[l[0]];break}}}return l.reduceRight(((e,r,o)=>{let i,u=!1,p=null,f=null;var v;n&&(i=s&&r.route.id?s[r.route.id]:void 0,p=r.route.errorElement||x,c&&(d<0&&0===o?(v="route-fallback",!1||B[v]||(B[v]=!0),u=!0,f=null):d===o&&(u=!0,f=r.route.hydrateFallbackElement||null)));let m=t.concat(l.slice(0,o+1)),h=()=>{let t;return t=i?p:u?f:r.route.Component?a.createElement(r.route.Component,null):r.route.element?r.route.element:e,a.createElement(_,{match:r,routeContext:{outlet:e,matches:m,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?a.createElement(C,{location:n.location,revalidation:n.revalidation,component:p,error:i,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):h()}),null)}var U=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(U||{}),N=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(N||{});function O(e){let t=a.useContext(i);return t||r.UNSAFE_invariant(!1),t}function A(e){let t=a.useContext(u);return t||r.UNSAFE_invariant(!1),t}function j(e){let t=function(e){let t=a.useContext(d);return t||r.UNSAFE_invariant(!1),t}(),n=t.matches[t.matches.length-1];return n.route.id||r.UNSAFE_invariant(!1),n.route.id}function F(){var e;let t=a.useContext(p),r=A(N.UseRouteError),n=j(N.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[n]}function D(){let e=a.useContext(l);return null==e?void 0:e._data}let k=0;const B={};const L=a.startTransition;function M(e){let{routes:t,future:r,state:n}=e;return R(t,void 0,n,r)}function T(e){r.UNSAFE_invariant(!1)}function I(e){let{basename:t="/",children:n=null,location:i,navigationType:u=r.Action.Pop,navigator:l,static:d=!1,future:p}=e;f()&&r.UNSAFE_invariant(!1);let v=t.replace(/^\/*/,"/"),m=a.useMemo((()=>({basename:v,navigator:l,static:d,future:o({v7_relativeSplatPath:!1},p)})),[v,p,l,d]);"string"==typeof i&&(i=r.parsePath(i));let{pathname:h="/",search:g="",hash:E="",state:y=null,key:b="default"}=i,R=a.useMemo((()=>{let e=r.stripBasename(h,v);return null==e?null:{location:{pathname:e,search:g,hash:E,state:y,key:b},navigationType:u}}),[v,h,g,E,y,b,u]);return null==R?null:a.createElement(s.Provider,{value:m},a.createElement(c.Provider,{children:n,value:R}))}var H=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(H||{});const w=new Promise((()=>{}));class z extends a.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(" caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:n}=this.props,o=null,i=H.pending;if(n instanceof Promise)if(this.state.error){i=H.error;let e=this.state.error;o=Promise.reject().catch((()=>{})),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_error",{get:()=>e})}else n._tracked?(o=n,i="_error"in o?H.error:"_data"in o?H.success:H.pending):(i=H.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),o=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else i=H.success,o=Promise.resolve(),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_data",{get:()=>n});if(i===H.error&&o._error instanceof r.AbortedDeferredError)throw w;if(i===H.error&&!t)throw o._error;if(i===H.error)return a.createElement(l.Provider,{value:o,children:t});if(i===H.success)return a.createElement(l.Provider,{value:o,children:e});throw o}}function J(e){let{children:t}=e,r=D(),n="function"==typeof t?t(r):t;return a.createElement(a.Fragment,null,n)}function q(e,t){void 0===t&&(t=[]);let n=[];return a.Children.forEach(e,((e,o)=>{if(!a.isValidElement(e))return;let i=[...t,o];if(e.type===a.Fragment)return void n.push.apply(n,q(e.props.children,i));e.type!==T&&r.UNSAFE_invariant(!1),e.props.index&&e.props.children&&r.UNSAFE_invariant(!1);let u={id:e.props.id||i.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(u.children=q(e.props.children,i)),n.push(u)})),n}function V(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:a.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:a.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}Object.defineProperty(e,"AbortedDeferredError",{enumerable:!0,get:function(){return r.AbortedDeferredError}}),Object.defineProperty(e,"NavigationType",{enumerable:!0,get:function(){return r.Action}}),Object.defineProperty(e,"createPath",{enumerable:!0,get:function(){return r.createPath}}),Object.defineProperty(e,"defer",{enumerable:!0,get:function(){return r.defer}}),Object.defineProperty(e,"generatePath",{enumerable:!0,get:function(){return r.generatePath}}),Object.defineProperty(e,"isRouteErrorResponse",{enumerable:!0,get:function(){return r.isRouteErrorResponse}}),Object.defineProperty(e,"json",{enumerable:!0,get:function(){return r.json}}),Object.defineProperty(e,"matchPath",{enumerable:!0,get:function(){return r.matchPath}}),Object.defineProperty(e,"matchRoutes",{enumerable:!0,get:function(){return r.matchRoutes}}),Object.defineProperty(e,"parsePath",{enumerable:!0,get:function(){return r.parsePath}}),Object.defineProperty(e,"redirect",{enumerable:!0,get:function(){return r.redirect}}),Object.defineProperty(e,"redirectDocument",{enumerable:!0,get:function(){return r.redirectDocument}}),Object.defineProperty(e,"replace",{enumerable:!0,get:function(){return r.replace}}),Object.defineProperty(e,"resolvePath",{enumerable:!0,get:function(){return r.resolvePath}}),e.Await=function(e){let{children:t,errorElement:r,resolve:n}=e;return a.createElement(z,{resolve:n,errorElement:r},a.createElement(J,null,t))},e.MemoryRouter=function(e){let{basename:t,children:n,initialEntries:o,initialIndex:i,future:u}=e,l=a.useRef();null==l.current&&(l.current=r.createMemoryHistory({initialEntries:o,initialIndex:i,v5Compat:!0}));let s=l.current,[c,d]=a.useState({action:s.action,location:s.location}),{v7_startTransition:p}=u||{},f=a.useCallback((e=>{p&&L?L((()=>d(e))):d(e)}),[d,p]);return a.useLayoutEffect((()=>s.listen(f)),[s,f]),a.createElement(I,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:s,future:u})},e.Navigate=function(e){let{to:t,replace:n,state:o,relative:i}=e;f()||r.UNSAFE_invariant(!1);let{future:u,static:l}=a.useContext(s),{matches:c}=a.useContext(d),{pathname:p}=v(),m=h(),g=r.resolveTo(t,r.UNSAFE_getResolveToMatches(c,u.v7_relativeSplatPath),p,"path"===i),E=JSON.stringify(g);return a.useEffect((()=>m(JSON.parse(E),{replace:n,state:o,relative:i})),[m,E,i,n,o]),null},e.Outlet=function(e){return E(e.context)},e.Route=T,e.Router=I,e.RouterProvider=function(e){let{fallbackElement:t,router:r,future:n}=e,[o,l]=a.useState(r.state),{v7_startTransition:s}=n||{},c=a.useCallback((e=>{s&&L?L((()=>l(e))):l(e)}),[l,s]);a.useLayoutEffect((()=>r.subscribe(c)),[r,c]),a.useEffect((()=>{}),[]);let d=a.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),p=r.basename||"/",f=a.useMemo((()=>({router:r,navigator:d,static:!1,basename:p})),[r,d,p]);return a.createElement(a.Fragment,null,a.createElement(i.Provider,{value:f},a.createElement(u.Provider,{value:o},a.createElement(I,{basename:p,location:o.location,navigationType:o.historyAction,navigator:d,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},o.initialized||r.future.v7_partialHydration?a.createElement(M,{routes:r.routes,future:r.future,state:o}):t))),null)},e.Routes=function(e){let{children:t,location:r}=e;return b(q(t),r)},e.UNSAFE_DataRouterContext=i,e.UNSAFE_DataRouterStateContext=u,e.UNSAFE_LocationContext=c,e.UNSAFE_NavigationContext=s,e.UNSAFE_RouteContext=d,e.UNSAFE_mapRouteProperties=V,e.UNSAFE_useRouteId=function(){return j(N.UseRouteId)},e.UNSAFE_useRoutesImpl=R,e.createMemoryRouter=function(e,t){return r.createRouter({basename:null==t?void 0:t.basename,future:o({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:r.createMemoryHistory({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:V,unstable_dataStrategy:null==t?void 0:t.unstable_dataStrategy,unstable_patchRoutesOnNavigation:null==t?void 0:t.unstable_patchRoutesOnNavigation}).initialize()},e.createRoutesFromChildren=q,e.createRoutesFromElements=q,e.renderMatches=function(e){return S(e)},e.useActionData=function(){let e=A(N.UseActionData),t=j(N.UseLoaderData);return e.actionData?e.actionData[t]:void 0},e.useAsyncError=function(){let e=a.useContext(l);return null==e?void 0:e._error},e.useAsyncValue=D,e.useBlocker=function(e){let{router:t,basename:n}=O(U.UseBlocker),i=A(N.UseBlocker),[u,l]=a.useState(""),s=a.useCallback((t=>{if("function"!=typeof e)return!!e;if("/"===n)return e(t);let{currentLocation:a,nextLocation:i,historyAction:u}=t;return e({currentLocation:o({},a,{pathname:r.stripBasename(a.pathname,n)||a.pathname}),nextLocation:o({},i,{pathname:r.stripBasename(i.pathname,n)||i.pathname}),historyAction:u})}),[n,e]);return a.useEffect((()=>{let e=String(++k);return l(e),()=>t.deleteBlocker(e)}),[t]),a.useEffect((()=>{""!==u&&t.getBlocker(u,s)}),[t,u,s]),u&&i.blockers.has(u)?i.blockers.get(u):r.IDLE_BLOCKER},e.useHref=function(e,t){let{relative:n}=void 0===t?{}:t;f()||r.UNSAFE_invariant(!1);let{basename:o,navigator:i}=a.useContext(s),{hash:u,pathname:l,search:c}=y(e,{relative:n}),d=l;return"/"!==o&&(d="/"===l?o:r.joinPaths([o,l])),i.createHref({pathname:d,search:c,hash:u})},e.useInRouterContext=f,e.useLoaderData=function(){let e=A(N.UseLoaderData),t=j(N.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")},e.useLocation=v,e.useMatch=function(e){f()||r.UNSAFE_invariant(!1);let{pathname:t}=v();return a.useMemo((()=>r.matchPath(e,r.UNSAFE_decodePath(t))),[t,e])},e.useMatches=function(){let{matches:e,loaderData:t}=A(N.UseMatches);return a.useMemo((()=>e.map((e=>r.UNSAFE_convertRouteMatchToUiMatch(e,t)))),[e,t])},e.useNavigate=h,e.useNavigation=function(){return A(N.UseNavigation).navigation},e.useNavigationType=function(){return a.useContext(c).navigationType},e.useOutlet=E,e.useOutletContext=function(){return a.useContext(g)},e.useParams=function(){let{matches:e}=a.useContext(d),t=e[e.length-1];return t?t.params:{}},e.useResolvedPath=y,e.useRevalidator=function(){let e=O(U.UseRevalidator),t=A(N.UseRevalidator);return a.useMemo((()=>({revalidate:e.router.revalidate,state:t.revalidation})),[e.router.revalidate,t.revalidation])},e.useRouteError=F,e.useRouteLoaderData=function(e){return A(N.UseRouteLoaderData).loaderData[e]},e.useRoutes=b,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=react-router.production.min.js.map
/**
* React Router DOM v6.26.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom"),require("react-router"),require("@remix-run/router")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","react-router","@remix-run/router"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactRouterDOM={},e.React,e.ReactDOM,e.ReactRouter,e.RemixRouter)}(this,(function(e,t,n,r,o){"use strict";function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var i=a(t),u=a(n);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}const l="get",f="application/x-www-form-urlencoded";function d(e){return null!=e&&"string"==typeof e.tagName}function m(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map((e=>[n,e])):[[n,r]])}),[]))}let p=null;const b=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function v(e){return null==e||b.has(e)?e:null}function h(e,t){let n,r,a,i,u;if(d(s=e)&&"form"===s.tagName.toLowerCase()){let u=e.getAttribute("action");r=u?o.stripBasename(u,t):null,n=e.getAttribute("method")||l,a=v(e.getAttribute("enctype"))||f,i=new FormData(e)}else if(function(e){return d(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return d(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let u=e.form;if(null==u)throw new Error('Cannot submit a or without a