diff --git a/app.py b/app.py index 61a491ba1253a5e4a01debaca72c7d15a15f36c0..a06a1dd76374f51f23395c1412759a3bccac5ff9 100644 --- a/app.py +++ b/app.py @@ -1,7 +1,7 @@ import os import sys import json -from flask import Flask +from flask import Flask, render_template, render_template_string from flask_cors import CORS from flask_socketio import SocketIO from datetime import datetime, date @@ -35,7 +35,11 @@ def humanize_datetime(dt_str): return dt_str # Return original string if parsing fails def create_app(): - app = Flask(__name__) + app = Flask( + __name__, + template_folder='templates', + ) + CORS(app) socketio.init_app(app, cors_allowed_origins="*") @@ -51,6 +55,7 @@ def create_app(): app.config['PROCESSED_FOLDER'] = 'processed' app.config['OUTPUT_FOLDER'] = 'output' app.config['TEMP_FOLDER'] = 'tmp' + app.config['TEMPLATES_PREACT'] = os.path.join(app.root_path, 'templates_preact') # Ensure instance folders exist for folder in [app.config['UPLOAD_FOLDER'], app.config['PROCESSED_FOLDER'], app.config['OUTPUT_FOLDER'], app.config['TEMP_FOLDER']]: @@ -76,6 +81,8 @@ def create_app(): from camera_routes import camera_bp from drive_routes import drive_bp from qtab_routes import qtab_bp + from knowledge_graph_routes import knowledge_bp + from graph_routes import graph_bp app.register_blueprint(main_bp) app.register_blueprint(json_bp) @@ -89,6 +96,8 @@ def create_app(): app.register_blueprint(camera_bp) app.register_blueprint(drive_bp) app.register_blueprint(qtab_bp) + app.register_blueprint(knowledge_bp) + app.register_blueprint(graph_bp) # Initialize socketio handlers for camera routes (after app creation to avoid circular import) from camera_routes import init_socketio_handlers diff --git a/docs/KNOWLEDGE_GRAPH.md b/docs/KNOWLEDGE_GRAPH.md new file mode 100644 index 0000000000000000000000000000000000000000..dda143d4b7fe23c1fff78960561223a12317fb09 --- /dev/null +++ b/docs/KNOWLEDGE_GRAPH.md @@ -0,0 +1,246 @@ +# Knowledge Graph - Link PDF Pages to Questions + +## Overview + +The Knowledge Graph feature allows you to visually link PDF pages to specific questions using an interactive node-based editor. Linked pages become accessible as revision notes. + +## Features + +- **Visual Node Editor** - Drag-and-drop interface using React Flow +- **Link PDF Pages** - Connect any PDF page to any question +- **Revision Notes Integration** - Linked pages appear as revision notes +- **Auto-Save** - Links are saved to the existing database structure +- **Bidirectional Access** - Access linked pages from questions and vice versa + +## How to Use + +### 1. Open Graph Editor + +From the Question Entry page (`/question_entry_v2/`): + +1. Scroll to the "Generate PDF" section +2. Click the **"Link PDF Pages to Questions"** button +3. The graph editor opens in a new page + +### 2. Understanding the Interface + +``` +┌─────────────────────────────────────────────────────────────┐ +│ [← Back] [Clear] [Save & Link] │ +├──────────┬──────────────────────────────────────────────────┤ +│ │ │ +│ PDF │ GRAPH CANVAS │ +│ Pages │ │ +│ Panel │ [Question Nodes] ←─── [Page Nodes] │ +│ │ │ +│ [Page1] │ │ +│ [Page2] │ │ +│ [Page3] │ │ +│ │ │ +└──────────┴──────────────────────────────────────────────────┘ +``` + +### 3. Create Links + +1. **Drag a PDF page** from the left sidebar onto the canvas +2. **Drag from the page node** to a question node to create a link +3. **Repeat** for all pages you want to link +4. Click **"Save & Link"** to save + +### 4. Access Linked Pages + +After saving: + +- Linked pages appear as revision notes for the connected questions +- Access them via the revision notes modal in Question Entry +- Pages are stored in the existing `images.note_json` and `images.note_filename` fields + +## Node Types + +### Question Node (Blue) +``` +┌─────────────────────┐ +│ ❓ Q12 │ +│ 📗 Physics │ +│ 📁 Mechanics │ +│ ✅ Has Notes │ +└─────────────────────┘ +``` +- Shows question number, subject, chapter +- Green border indicates existing notes +- Connection point on the right + +### Page Node (Purple) +``` +┌─────────────────────┐ +│ 📄 Page 5 │ +│ ┌─────────────────┐ │ +│ │ Page Image │ │ +│ └─────────────────┘ │ +└─────────────────────┘ +``` +- Shows PDF page thumbnail +- Connection point on the left +- Drag from sidebar to create + +## Data Structure + +### Saved Link Format + +```json +{ + "type": "linked_page", + "source_page_id": 123, + "source_page_number": 5, + "source_filename": "upload_abc123.jpg", + "linked_at": "2026-03-17T10:30:00", + "original_note": null +} +``` + +### Database Schema + +Links are stored in the existing `images` table: + +| Column | Description | +|--------|-------------| +| `note_json` | JSON containing link data | +| `note_filename` | Reference to the linked page image | +| `session_id` | Session this belongs to | + +## API Endpoints + +### GET `/session//graph` +Open the graph editor for a session. + +### POST `/session/graph/save` +Save graph links. + +**Request:** +```json +{ + "session_id": "abc123", + "links": [ + { + "page_id": 5, + "question_image_id": 10, + "page_number": 5 + } + ] +} +``` + +**Response:** +```json +{ + "success": true, + "message": "Linked 1 pages to questions", + "links_count": 1 +} +``` + +### GET `/session/graph/load/` +Load existing graph links. + +### POST `/session/graph/delete/` +Delete all graph links for a session. + +## Workflow Example + +### Scenario: Link difficult questions to reference pages + +1. **Upload PDF** with questions and solutions +2. **Enter Question Entry** page +3. **Click "Link PDF Pages to Questions"** +4. **Drag solution page** (e.g., page 10) to Question 5 +5. **Drag another page** (e.g., page 15) to Question 8 +6. **Save & Link** +7. **Return to Question Entry** +8. **Click revision notes icon** on Question 5 +9. **See linked solution page** as a revision note! + +## Benefits + +✅ **Visual Organization** - See all connections at a glance +✅ **Quick Reference** - Link solutions, formulas, diagrams +✅ **Study Aid** - Create custom revision materials +✅ **Flexible** - Link any page to any question +✅ **Persistent** - Saved to database, survives page reloads + +## Tips & Tricks + +### Best Practices + +1. **Link solution pages** to their corresponding questions +2. **Create formula sheets** by linking reference pages +3. **Group related questions** by linking them to the same reference +4. **Add diagrams** from appendix pages to relevant questions + +### Keyboard Shortcuts + +- `Delete/Backspace` - Delete selected node or edge +- `Ctrl+C/V` - Copy/paste nodes (coming soon) +- `Mouse Wheel` - Zoom in/out +- `Right-click + Drag` - Pan canvas + +### Performance Tips + +- Keep graphs under 100 nodes for best performance +- Use the MiniMap to navigate large graphs +- Clear unused nodes before saving + +## Troubleshooting + +### Page not showing in sidebar +- Ensure PDF was uploaded and processed +- Check that images exist in the database +- Refresh the page + +### Can't create connection +- Make sure you're dragging FROM page TO question +- Release mouse over the question node +- Check browser console for errors + +### Links not saving +- Ensure you clicked "Save & Link" +- Check network tab for failed requests +- Verify session ownership + +## Technical Details + +### Built With + +- **React Flow** - Node-based graph editor +- **Preact** - Lightweight React alternative +- **Flask** - Python backend +- **SQLite** - Database storage + +### File Structure + +``` +Report-Generator/ +├── templates/ +│ ├── graph_editor.html # React Flow editor +│ └── question_entry_v2.html # Entry point +├── graph_routes.py # Backend routes +└── docs/ + └── KNOWLEDGE_GRAPH.md # This file +``` + +## Future Enhancements + +- [ ] Export graph as image/PDF +- [ ] Import/export graph data +- [ ] Multi-session graphs +- [ ] Collaborative editing +- [ ] Auto-suggest links based on content +- [ ] Graph templates +- [ ] Search and filter nodes + +## Support + +For issues or questions: +1. Check browser console for errors +2. Verify database integrity +3. Review this documentation +4. Report bugs with screenshots diff --git a/docs/REVISION_NOTES_PREACT.md b/docs/REVISION_NOTES_PREACT.md new file mode 100644 index 0000000000000000000000000000000000000000..e83a0179df86d4d5a18be50fbf09c4b012526fe0 --- /dev/null +++ b/docs/REVISION_NOTES_PREACT.md @@ -0,0 +1,211 @@ +# Revision Notes Preact Overhaul + +## Overview + +Complete rewrite of the revision notes/annotation system using Preact (no build setup) with modern features and improved UX. + +## New Features + +### 1. **Image Upload & Reference Panel** +- Drag & drop image upload +- Multiple reference images support +- Image grid with selection +- Upload from file browser + +### 2. **Enhanced Toolbar** +- Modern glassmorphism design +- Tool selection: Pen, Marker, Eraser +- Color picker with 6 colors +- Adjustable brush size (1-30) +- Undo functionality +- Clear all with confirmation + +### 3. **History Panel** +- Visual history states +- Click to restore any previous state +- Up to 30 states stored + +### 4. **Improved Drawing** +- Unified pointer events (mouse, touch, pen) +- Smooth stroke rendering +- Pressure-sensitive stylus support (where available) +- Optimized canvas performance + +### 5. **Responsive Design** +- Full-screen modal +- Mobile-friendly touch controls +- Adaptive layout + +## File Structure + +``` +templates/ +├── _revision_notes_preact.html # New Preact-based notes modal +└── question_entry_v2.html # Updated to use new notes + +image_routes.py # Added upload endpoint +``` + +## Routes + +### Existing (Unchanged) +- `/save_note_json` - Save annotations +- `/get_note_json/` - Load annotations +- `/delete_note` - Delete note +- `/toggle_note_in_pdf` - Include/exclude from PDF + +### New +- `/upload_note_reference` - Upload reference images + +## Usage + +### Opening the Notes Editor + +```javascript +openNotesModal(imageId, refImageUrl, sessionId, csrfToken); +``` + +### Example Button + +```html + +``` + +## Component Architecture + +### Main Components + +1. **`NotesEditor`** - Main canvas and toolbar +2. **`ToolButton`** - Reusable tool button +3. **`ColorPicker`** - Color selection +4. **`ReferencePanel`** - Image upload & references +5. **`HistoryPanel`** - Undo history + +### State Management + +Uses Preact hooks (`useState`, `useEffect`, `useCallback`) for reactive state. + +## Technical Details + +### Canvas Optimization + +```javascript +// Will-read-frequently for better performance +const ctx = canvas.getContext('2d', { willReadFrequently: false }); + +// Smooth rendering +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; +ctx.imageSmoothingEnabled = true; +``` + +### Pointer Events + +Unified handling for all input types: + +```javascript +canvas.onpointerdown = handlePointerDown; +canvas.onpointermove = handlePointerMove; +canvas.onpointerup = handlePointerUp; +``` + +### Tool Modes + +| Tool | Behavior | Opacity | +|------|----------|---------| +| Pen | Solid line | 100% | +| Marker | Thick line | 35% | +| Eraser | Large eraser | 100% | + +## Migration from Old System + +### Old Code +```html +{% include '_revision_notes.html' %} + +``` + +### New Code +```html +{% include '_revision_notes_preact.html' %} + +``` + +## Performance Improvements + +1. **Faster rendering** - Preact virtual DOM +2. **Optimized canvas** - Reduced redraws +3. **Lazy loading** - Images loaded on demand +4. **Efficient history** - Max 30 states, auto-cleanup + +## Browser Support + +- Chrome/Edge (recommended) +- Firefox +- Safari +- Mobile browsers (touch-optimized) + +## Future Enhancements + +- [ ] Text annotations +- [ ] Shape tools (rectangle, circle, arrow) +- [ ] Freehand highlighter +- [ ] Export annotations as PDF +- [ ] Collaborative editing +- [ ] Voice notes +- [ ] OCR from reference images + +## Testing + +Test the following scenarios: + +1. **Basic Drawing** + - Pen tool with different colors + - Marker transparency + - Eraser functionality + +2. **Image Upload** + - Drag & drop + - File browser + - Multiple images + +3. **History** + - Undo multiple times + - Restore old states + +4. **Save/Load** + - Save annotations + - Reload page + - Verify persistence + +5. **Mobile** + - Touch drawing + - Responsive layout + - Reference panel + +## Troubleshooting + +### Canvas not drawing +- Check browser console for errors +- Verify Preact loaded from CDN +- Ensure container has dimensions + +### Images not uploading +- Check file size limits +- Verify TEMP_FOLDER permissions +- Check CSRF token + +### History not working +- Ensure saveState() called after each stroke +- Check history array length + +## Credits + +Built with: +- [Preact](https://preactjs.com/) - Fast 3KB React alternative +- [HTM](https://github.com/developit/htm) - Hyperscript Tagged Markup +- Bootstrap Icons - Icon library diff --git a/graph_routes.py b/graph_routes.py new file mode 100644 index 0000000000000000000000000000000000000000..93044a206bac20ee945e9f287fe974ea7731cead --- /dev/null +++ b/graph_routes.py @@ -0,0 +1,351 @@ +""" +Graph Editor Routes +Links PDF pages to questions as revision notes +""" + +from flask import Blueprint, render_template, request, jsonify, current_app, url_for, redirect +from flask_login import login_required, current_user +from utils import get_db_connection, parse_note_payload, dump_note_payload +import os +import json +import fitz +from datetime import datetime +from werkzeug.utils import secure_filename + +graph_bp = Blueprint('graph_bp', __name__) + +ALLOWED_EXTENSIONS = {'pdf'} + +def allowed_file(filename): + return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS + + +@graph_bp.route('/session//graph') +@login_required +def graph_editor(session_id): + """Open graph editor for linking PDF pages to questions.""" + conn = get_db_connection() + + session = conn.execute( + "SELECT * FROM sessions WHERE id = ? AND user_id = ?", + (session_id, current_user.id) + ).fetchone() + + if not session: + conn.close() + return redirect('/dashboard') + + # Get question IMAGES (the cropped question images) + images = conn.execute(""" + SELECT + i.id as image_id, + i.image_index, + i.filename, + i.processed_filename, + i.note_json, + q.id as question_id, + q.question_number, + q.subject, + q.chapter + FROM images i + LEFT JOIN questions q ON i.id = q.image_id + WHERE i.session_id = ? AND i.image_type = 'cropped' + ORDER BY i.image_index + """, (session_id,)).fetchall() + + # Get PDF pages (solutions PDF pages stored with image_type='pdf_page') + pdf_pages = conn.execute(""" + SELECT + id as image_id, + image_index as page_number, + filename, + processed_filename + FROM images + WHERE session_id = ? AND image_type = 'pdf_page' + ORDER BY image_index + """, (session_id,)).fetchall() + + # Format PDF pages + pages_data = [] + for page in pdf_pages: + page_dict = dict(page) + # Use processed_filename if available, else original + if page_dict.get('processed_filename'): + image_url = url_for('image_bp.serve_processed_image', filename=page_dict['processed_filename']) + elif page_dict.get('filename'): + image_url = url_for('main.serve_image', folder='uploads', filename=page_dict['filename']) + else: + image_url = f'/placeholder_page/{session_id}/{page_dict["page_number"]+1}' + + pages_data.append({ + 'image_id': page_dict['image_id'], + 'page_number': page_dict['page_number'] + 1, + 'image_url': image_url, + 'filename': page_dict['filename'] + }) + + # Format question IMAGES with thumbnails + images_data = [] + existing_links = [] + for img in images: + img_dict = dict(img) + # Use processed_filename for thumbnail (the cropped question image) + thumb_url = None + if img_dict.get('processed_filename'): + thumb_url = url_for('image_bp.serve_processed_image', filename=img_dict['processed_filename']) + elif img_dict.get('filename'): + thumb_url = url_for('main.serve_image', folder='uploads', filename=img_dict['filename']) + + note_payload = parse_note_payload(img_dict.get('note_json')) + linked_pages = note_payload.get('linked_pdf_pages', []) + + images_data.append({ + 'image_id': img_dict['image_id'], + 'question_number': img_dict.get('question_number'), + 'subject': img_dict.get('subject'), + 'chapter': img_dict.get('chapter'), + 'thumb_url': thumb_url, + 'question_id': img_dict.get('question_id'), + 'linked_page_ids': [page.get('source_page_id') for page in linked_pages if page.get('source_page_id')] + }) + + for linked_page in linked_pages: + if linked_page.get('source_page_id'): + existing_links.append({ + 'question_image_id': img_dict['image_id'], + 'page_id': linked_page.get('source_page_id'), + 'page_number': linked_page.get('source_page_number') + }) + + conn.close() + + return render_template('graph_editor.html', + session_id=session_id, + questions=images_data, # These are question IMAGES + pdf_pages=pages_data, + existing_links=existing_links) + + +@graph_bp.route('/session/graph/upload_pdf', methods=['POST']) +@login_required +def upload_pdf(): + """Upload a solutions PDF and convert pages to images.""" + try: + if 'pdf' not in request.files: + return jsonify({'error': 'No PDF file provided'}), 400 + + file = request.files['pdf'] + session_id = request.form.get('session_id') + + if not session_id or file.filename == '': + return jsonify({'error': 'Missing file or session_id'}), 400 + + if not allowed_file(file.filename): + return jsonify({'error': 'Only PDF files allowed'}), 400 + + conn = get_db_connection() + session = conn.execute("SELECT user_id FROM sessions WHERE id = ?", (session_id,)).fetchone() + + if not session or session['user_id'] != current_user.id: + conn.close() + return jsonify({'error': 'Unauthorized'}), 403 + + existing_pages = conn.execute(""" + SELECT id, filename, processed_filename + FROM images + WHERE session_id = ? AND image_type = 'pdf_page' + """, (session_id,)).fetchall() + + for page in existing_pages: + for stored_name, folder in ( + (page['processed_filename'], current_app.config['PROCESSED_FOLDER']), + (page['filename'], current_app.config['UPLOAD_FOLDER']) + ): + if stored_name: + stored_path = os.path.join(folder, stored_name) + if os.path.exists(stored_path): + try: + os.remove(stored_path) + except OSError: + current_app.logger.warning(f"Could not delete old graph asset: {stored_path}") + + conn.execute("DELETE FROM images WHERE session_id = ? AND image_type = 'pdf_page'", (session_id,)) + + # Save uploaded PDF + pdf_filename = f"solutions_{session_id}_{secure_filename(file.filename)}" + pdf_path = os.path.join(current_app.config['UPLOAD_FOLDER'], pdf_filename) + file.save(pdf_path) + + doc = fitz.open(pdf_path) + page_count = len(doc) + if page_count == 0: + doc.close() + conn.close() + return jsonify({'error': 'Uploaded PDF has no pages'}), 400 + + dpi = getattr(current_user, 'dpi', 150) or 150 + rendered_pages = [] + + try: + for i, page in enumerate(doc): + pix = page.get_pixmap(dpi=dpi) + img_filename = f"solutions_{session_id}_page_{i + 1}.png" + img_path = os.path.join(current_app.config['PROCESSED_FOLDER'], img_filename) + pix.save(img_path) + rendered_pages.append(img_path) + + conn.execute(''' + INSERT INTO images (session_id, image_index, filename, processed_filename, image_type, original_name) + VALUES (?, ?, ?, ?, 'pdf_page', ?) + ''', (session_id, i, pdf_filename, img_filename, f'Solution Page {i + 1}')) + except Exception: + for rendered_path in rendered_pages: + if os.path.exists(rendered_path): + try: + os.remove(rendered_path) + except OSError: + current_app.logger.warning(f"Could not clean up rendered graph page: {rendered_path}") + raise + finally: + doc.close() + + conn.commit() + conn.close() + + # Redirect back to graph editor (will now have pages) + return jsonify({ + 'success': True, + 'pdf_filename': pdf_filename, + 'redirect': f'/session/{session_id}/graph' + }) + + except Exception as e: + current_app.logger.error(f"Error uploading PDF: {e}") + return jsonify({'error': str(e)}), 500 + + +@graph_bp.route('/session/graph/save', methods=['POST']) +@login_required +def save_graph(): + """Save links between PDF pages and questions.""" + try: + data = request.json + session_id = data.get('session_id') + links = data.get('links', []) + + if not session_id: + return jsonify({'error': 'Session ID required'}), 400 + + conn = get_db_connection() + session = conn.execute("SELECT user_id FROM sessions WHERE id = ?", (session_id,)).fetchone() + + if not session or session['user_id'] != current_user.id: + conn.close() + return jsonify({'error': 'Unauthorized'}), 403 + + grouped_links = {} + for link in links: + page_image_id = link.get('page_id') + question_image_id = link.get('question_image_id') + page_number = link.get('page_number') + + if not page_image_id or not question_image_id: + continue + + page_info = conn.execute(""" + SELECT filename, processed_filename + FROM images + WHERE id = ? AND session_id = ? + """, (page_image_id, session_id)).fetchone() + + if not page_info: + continue + + grouped_links.setdefault(question_image_id, []) + grouped_links[question_image_id].append({ + 'source_page_id': page_image_id, + 'source_page_number': page_number, + 'source_filename': page_info['filename'], + 'note_filename': page_info['processed_filename'], + 'linked_at': datetime.now().isoformat() + }) + + for question_image_id, linked_pages in grouped_links.items(): + existing = conn.execute(""" + SELECT note_json, note_filename + FROM images + WHERE id = ? AND session_id = ? + """, (question_image_id, session_id)).fetchone() + + existing_payload = parse_note_payload(existing['note_json'] if existing else None) + existing_by_page = { + page['source_page_id']: page + for page in existing_payload['linked_pdf_pages'] + if page.get('source_page_id') + } + + for page in linked_pages: + existing_by_page[page['source_page_id']] = page + + merged_pages = sorted( + existing_by_page.values(), + key=lambda page: (page.get('source_page_number') or 0, page.get('source_page_id') or 0) + ) + primary_note_filename = merged_pages[0].get('note_filename') if merged_pages else (existing['note_filename'] if existing else None) + existing_linked_filenames = { + page.get('note_filename') + for page in existing_payload['linked_pdf_pages'] + if page.get('note_filename') + } + should_update_note_filename = ( + not existing + or not existing['note_filename'] + or existing['note_filename'] in existing_linked_filenames + ) + + conn.execute(""" + UPDATE images + SET note_json = ?, + note_filename = ? + WHERE id = ? + """, ( + dump_note_payload( + existing['note_json'] if existing else None, + linked_pdf_pages=merged_pages, + annotation_json=existing_payload.get('annotation_json', {}) + ), + primary_note_filename if should_update_note_filename else existing['note_filename'], + question_image_id + )) + + conn.commit() + conn.close() + + return jsonify({ + 'success': True, + 'message': f'Linked {len(links)} pages to questions', + 'links_count': len(links) + }) + + except Exception as e: + current_app.logger.error(f"Error saving graph: {e}") + return jsonify({'error': str(e)}), 500 + + +@graph_bp.route('/placeholder_page//') +@login_required +def placeholder_page(session_id, page_num): + """Return a placeholder image for PDF pages.""" + from flask import send_file + from PIL import Image, ImageDraw + import io + + img = Image.new('RGB', (400, 500), color='#1e2130') + draw = ImageDraw.Draw(img) + draw.text((200, 250), f"Page {page_num}", fill='#64748b', anchor='mm') + + buffer = io.BytesIO() + img.save(buffer, format='PNG') + buffer.seek(0) + + return send_file(buffer, mimetype='image/png') diff --git a/image_routes.py b/image_routes.py index 28691c561514e6ed8bf51dffe67003d215290c34..ec7175f4f608adec235bf7e9a1f5783419367029 100644 --- a/image_routes.py +++ b/image_routes.py @@ -1,8 +1,9 @@ -from flask import Blueprint, send_from_directory, current_app, request, jsonify +from flask import Blueprint, send_from_directory, current_app, request, jsonify, url_for from flask_login import login_required, current_user -from utils import get_db_connection +from utils import get_db_connection, parse_note_payload, dump_note_payload import os import base64 +import json from datetime import datetime image_bp = Blueprint('image_bp', __name__) @@ -28,24 +29,64 @@ def serve_neetprep_tmp_image(filename): current_app.logger.info(f"Serving /neetprep/tmp image: {filename}") return send_from_directory(current_app.config['TEMP_FOLDER'], filename) +@image_bp.route('/upload_note_reference', methods=['POST']) +@login_required +def upload_note_reference(): + """Upload reference images for revision notes.""" + try: + if 'image' not in request.files: + return jsonify({'error': 'No image file provided'}), 400 + + file = request.files['image'] + session_id = request.form.get('session_id') + image_id = request.form.get('image_id') + + if not session_id or not image_id: + return jsonify({'error': 'Missing session_id or image_id'}), 400 + + # Validate ownership + conn = get_db_connection() + session = conn.execute("SELECT user_id FROM sessions WHERE id = ?", (session_id,)).fetchone() + + if not session or session['user_id'] != current_user.id: + conn.close() + return jsonify({'error': 'Unauthorized'}), 403 + + # Save uploaded image + filename = f"ref_{session_id}_{image_id}_{int(datetime.now().timestamp())}_{file.filename}" + save_path = os.path.join(current_app.config['TEMP_FOLDER'], filename) + file.save(save_path) + + conn.close() + + return jsonify({ + 'success': True, + 'filename': filename, + 'url': url_for('image_bp.serve_tmp_image', filename=filename) + }) + + except Exception as e: + current_app.logger.error(f"Error uploading reference image: {e}") + return jsonify({'error': str(e)}), 500 + @image_bp.route('/save_note_image', methods=['POST']) @login_required def save_note_image(): try: if 'image' not in request.files: return jsonify({'error': 'No image file provided'}), 400 - + file = request.files['image'] image_id = request.form.get('image_id') session_id = request.form.get('session_id') - + if not image_id or not session_id: return jsonify({'error': 'Missing image_id or session_id'}), 400 # Validate ownership conn = get_db_connection() img = conn.execute("SELECT i.id, s.user_id FROM images i JOIN sessions s ON i.session_id = s.id WHERE i.id = ?", (image_id,)).fetchone() - + if not img or img['user_id'] != current_user.id: conn.close() return jsonify({'error': 'Unauthorized or image not found'}), 403 @@ -112,7 +153,7 @@ def delete_note(): conn = get_db_connection() img = conn.execute(""" - SELECT i.id, i.note_filename, s.user_id FROM images i + SELECT i.id, i.note_filename, i.note_json, s.user_id FROM images i JOIN sessions s ON i.session_id = s.id WHERE i.id = ? """, (image_id,)).fetchone() @@ -121,7 +162,13 @@ def delete_note(): return jsonify({'error': 'Unauthorized'}), 403 # Delete the file if it exists - if img['note_filename']: + linked_note_filenames = { + page.get('note_filename') + for page in parse_note_payload(img['note_json']).get('linked_pdf_pages', []) + if page.get('note_filename') + } + + if img['note_filename'] and img['note_filename'] not in linked_note_filenames: note_path = os.path.join(current_app.config['PROCESSED_FOLDER'], img['note_filename']) if os.path.exists(note_path): os.remove(note_path) @@ -162,8 +209,31 @@ def save_note_json(): conn.close() return jsonify({'error': 'Unauthorized'}), 403 - # Save JSON to database - conn.execute("UPDATE images SET note_json = ? WHERE id = ?", (json_data, image_id)) + existing_row = conn.execute("SELECT note_json FROM images WHERE id = ?", (image_id,)).fetchone() + existing_payload = parse_note_payload(existing_row['note_json'] if existing_row else None) + + annotation_json = {} + if isinstance(json_data, str): + try: + parsed_json_data = json.loads(json_data) + if isinstance(parsed_json_data, dict): + annotation_json = parsed_json_data + except (TypeError, ValueError): + annotation_json = {} + elif isinstance(json_data, dict): + annotation_json = json_data + + conn.execute( + "UPDATE images SET note_json = ? WHERE id = ?", + ( + dump_note_payload( + existing_row['note_json'] if existing_row else None, + linked_pdf_pages=existing_payload.get('linked_pdf_pages', []), + annotation_json=annotation_json + ), + image_id + ) + ) # Save rasterized PNG if provided (needed for PDF generation and quiz display) if image_data and image_data.startswith('data:image/'): @@ -191,11 +261,11 @@ def save_note_json(): @image_bp.route('/get_note_json/') @login_required def get_note_json(image_id): - """Get revision notes as JSON.""" + """Get revision notes as JSON and image URL.""" try: conn = get_db_connection() img = conn.execute(""" - SELECT i.note_json, s.user_id FROM images i + SELECT i.note_json, i.note_filename, s.user_id FROM images i JOIN sessions s ON i.session_id = s.id WHERE i.id = ? """, (image_id,)).fetchone() @@ -205,11 +275,22 @@ def get_note_json(image_id): conn.close() - if img['note_json']: - return jsonify({'success': True, 'json_data': img['note_json']}) + image_data = None + if img['note_filename']: + image_data = url_for('image_bp.serve_processed_image', filename=img['note_filename']) + + parsed_payload = parse_note_payload(img['note_json']) + + if img['note_json'] or image_data: + return jsonify({ + 'success': True, + 'json_data': json.dumps(parsed_payload.get('annotation_json', {})), + 'image_data': image_data, + 'linked_pages': parsed_payload.get('linked_pdf_pages', []) + }) else: return jsonify({'success': False, 'error': 'No note found'}), 404 except Exception as e: current_app.logger.error(f"Error getting note JSON: {e}") - return jsonify({'error': str(e)}), 500 \ No newline at end of file + return jsonify({'error': str(e)}), 500 diff --git a/knowledge_graph_routes.py b/knowledge_graph_routes.py new file mode 100644 index 0000000000000000000000000000000000000000..5e1447962915952242265b16820ae6852ed3800c --- /dev/null +++ b/knowledge_graph_routes.py @@ -0,0 +1,372 @@ +""" +Knowledge Graph Routes +Node-based revision notes system using React Flow +""" + +from flask import Blueprint, render_template, request, jsonify, current_app, url_for +from flask_login import login_required, current_user +from utils import get_db_connection +import os +import json +import base64 +from datetime import datetime +from werkzeug.utils import secure_filename + +knowledge_bp = Blueprint('knowledge_bp', __name__) + +# Allowed PDF extensions +ALLOWED_EXTENSIONS = {'pdf'} + +def allowed_file(filename): + return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS + + +@knowledge_bp.route('/knowledge_graph') +@login_required +def knowledge_graph_index(): + """Main knowledge graph page.""" + return render_template('knowledge_graph.html') + + +@knowledge_bp.route('/knowledge_graph/upload_pdf', methods=['POST']) +@login_required +def upload_pdf(): + """ + Upload PDF and create session with page images. + Returns session_id and page information for creating nodes. + """ + try: + if 'pdf' not in request.files: + return jsonify({'error': 'No PDF file provided'}), 400 + + file = request.files['pdf'] + if file.filename == '': + return jsonify({'error': 'No file selected'}), 400 + + if not allowed_file(file.filename): + return jsonify({'error': 'Only PDF files are allowed'}), 400 + + # Create session for this knowledge graph + conn = get_db_connection() + session_id = f"kg_{current_user.id}_{int(datetime.now().timestamp())}" + + # Save session metadata + conn.execute(""" + INSERT INTO sessions (id, user_id, original_filename, session_type, created_at) + VALUES (?, ?, ?, 'knowledge_graph', ?) + """, (session_id, current_user.id, secure_filename(file.filename), datetime.now())) + + # Save PDF file + pdf_filename = f"{session_id}_{secure_filename(file.filename)}" + pdf_path = os.path.join(current_app.config['UPLOAD_FOLDER'], pdf_filename) + file.save(pdf_path) + + conn.commit() + + # TODO: Process PDF to extract pages + # For now, we'll create placeholder page nodes + # In production, use PyMuPDF or pdf2image to convert PDF pages to images + + pages = [] + # Placeholder: Create 5 dummy pages + # Replace this with actual PDF processing + for i in range(1, 6): + pages.append({ + 'page_number': i, + 'image_url': f'/placeholder_page/{session_id}/{i}' # Placeholder route + }) + + conn.close() + + return jsonify({ + 'success': True, + 'session_id': session_id, + 'pdf_filename': pdf_filename, + 'pages': pages + }) + + except Exception as e: + current_app.logger.error(f"Error uploading PDF: {e}") + return jsonify({'error': str(e)}), 500 + + +@knowledge_bp.route('/knowledge_graph/save', methods=['POST']) +@login_required +def save_graph(): + """ + Save the node graph (nodes and edges) to database. + """ + try: + data = request.json + session_id = data.get('session_id') + nodes = data.get('nodes', []) + edges = data.get('edges', []) + + if not session_id: + return jsonify({'error': 'Session ID required'}), 400 + + # Validate ownership + conn = get_db_connection() + session = conn.execute( + "SELECT user_id FROM sessions WHERE id = ? AND session_type = 'knowledge_graph'", + (session_id,) + ).fetchone() + + if not session or session['user_id'] != current_user.id: + conn.close() + return jsonify({'error': 'Unauthorized'}), 403 + + # Save graph data as JSON + graph_data = { + 'nodes': nodes, + 'edges': edges, + 'saved_at': datetime.now().isoformat() + } + + conn.execute(""" + INSERT OR REPLACE INTO knowledge_graphs (session_id, graph_data, updated_at) + VALUES (?, ?, ?) + """, (session_id, json.dumps(graph_data), datetime.now())) + + conn.commit() + conn.close() + + return jsonify({ + 'success': True, + 'message': 'Graph saved successfully' + }) + + except Exception as e: + current_app.logger.error(f"Error saving graph: {e}") + return jsonify({'error': str(e)}), 500 + + +@knowledge_bp.route('/knowledge_graph/load/') +@login_required +def load_graph(session_id): + """ + Load a saved node graph. + """ + try: + conn = get_db_connection() + + # Validate ownership + session = conn.execute( + "SELECT user_id FROM sessions WHERE id = ? AND session_type = 'knowledge_graph'", + (session_id,) + ).fetchone() + + if not session or session['user_id'] != current_user.id: + conn.close() + return jsonify({'error': 'Unauthorized'}), 403 + + # Load graph data + graph = conn.execute( + "SELECT graph_data FROM knowledge_graphs WHERE session_id = ?", + (session_id,) + ).fetchone() + + conn.close() + + if not graph or not graph['graph_data']: + return jsonify({ + 'success': True, + 'nodes': [], + 'edges': [] + }) + + graph_data = json.loads(graph['graph_data']) + + return jsonify({ + 'success': True, + 'nodes': graph_data.get('nodes', []), + 'edges': graph_data.get('edges', []), + 'saved_at': graph_data.get('saved_at') + }) + + except Exception as e: + current_app.logger.error(f"Error loading graph: {e}") + return jsonify({'error': str(e)}), 500 + + +@knowledge_bp.route('/knowledge_graph/list') +@login_required +def list_graphs(): + """ + List all knowledge graphs for the current user. + """ + try: + conn = get_db_connection() + + graphs = conn.execute(""" + SELECT s.id, s.original_filename, s.created_at, kg.updated_at + FROM sessions s + LEFT JOIN knowledge_graphs kg ON s.id = kg.session_id + WHERE s.user_id = ? AND s.session_type = 'knowledge_graph' + ORDER BY s.created_at DESC + """, (current_user.id,)).fetchall() + + conn.close() + + return jsonify({ + 'success': True, + 'graphs': [dict(g) for g in graphs] + }) + + except Exception as e: + current_app.logger.error(f"Error listing graphs: {e}") + return jsonify({'error': str(e)}), 500 + + +@knowledge_bp.route('/knowledge_graph/delete/', methods=['POST']) +@login_required +def delete_graph(session_id): + """ + Delete a knowledge graph. + """ + try: + conn = get_db_connection() + + # Validate ownership + session = conn.execute( + "SELECT user_id FROM sessions WHERE id = ? AND session_type = 'knowledge_graph'", + (session_id,) + ).fetchone() + + if not session or session['user_id'] != current_user.id: + conn.close() + return jsonify({'error': 'Unauthorized'}), 403 + + # Delete graph data and session + conn.execute("DELETE FROM knowledge_graphs WHERE session_id = ?", (session_id,)) + conn.execute("DELETE FROM sessions WHERE id = ?", (session_id,)) + + conn.commit() + conn.close() + + return jsonify({ + 'success': True, + 'message': 'Graph deleted successfully' + }) + + except Exception as e: + current_app.logger.error(f"Error deleting graph: {e}") + return jsonify({'error': str(e)}), 500 + + +@knowledge_bp.route('/placeholder_page//') +@login_required +def placeholder_page(session_id, page_num): + """ + Placeholder route for page images. + Returns a simple placeholder image. + """ + from flask import send_file + from PIL import Image, ImageDraw, ImageFont + import io + + # Create a placeholder image + img = Image.new('RGB', (400, 500), color='#2b3035') + draw = ImageDraw.Draw(img) + + # Draw text + text = f"Page {page_num}" + draw.text((200, 250), text, fill='#ffffff', anchor='mm') + + # Save to buffer + buffer = io.BytesIO() + img.save(buffer, format='PNG') + buffer.seek(0) + + return send_file(buffer, mimetype='image/png') + + +@knowledge_bp.route('/knowledge_graph/add_question', methods=['POST']) +@login_required +def add_question(): + """ + Add a question node from existing session data. + """ + try: + data = request.json + session_id = data.get('session_id') + question_data = data.get('question', {}) + + # Validate and fetch question from database + conn = get_db_connection() + question = conn.execute(""" + SELECT q.*, i.filename as image_filename + FROM questions q + LEFT JOIN images i ON q.image_id = i.id + WHERE q.session_id = ? AND q.id = ? + """, (session_id, question_data.get('id'))).fetchone() + + if not question: + conn.close() + return jsonify({'error': 'Question not found'}), 404 + + conn.close() + + # Return question data formatted for node creation + return jsonify({ + 'success': True, + 'node': { + 'id': f"question-{question['id']}", + 'type': 'question', + 'data': { + 'number': question.get('question_number', '?'), + 'subject': question.get('subject', ''), + 'chapter': question.get('chapter', ''), + 'question_id': question['id'] + } + } + }) + + except Exception as e: + current_app.logger.error(f"Error adding question: {e}") + return jsonify({'error': str(e)}), 500 + + +@knowledge_bp.route('/knowledge_graph/add_note', methods=['POST']) +@login_required +def add_note(): + """ + Add a note node from existing revision notes. + """ + try: + data = request.json + image_id = data.get('image_id') + + conn = get_db_connection() + + # Fetch note from database + image = conn.execute(""" + SELECT note_json, note_filename + FROM images + WHERE id = ? AND note_json IS NOT NULL + """, (image_id,)).fetchone() + + if not image: + conn.close() + return jsonify({'error': 'Note not found'}), 404 + + conn.close() + + note_content = image['note_json'] or '{}' + + return jsonify({ + 'success': True, + 'node': { + 'id': f"note-{image_id}", + 'type': 'note', + 'data': { + 'content': note_content, + 'image_id': image_id, + 'note_image': image['note_filename'] + } + } + }) + + except Exception as e: + current_app.logger.error(f"Error adding note: {e}") + return jsonify({'error': str(e)}), 500 diff --git a/migrations/add_knowledge_graphs.py b/migrations/add_knowledge_graphs.py new file mode 100644 index 0000000000000000000000000000000000000000..c4a7b93f54cc40f01487726bed0a6bc3fdcfec6d --- /dev/null +++ b/migrations/add_knowledge_graphs.py @@ -0,0 +1,38 @@ +""" +Migration: Add knowledge_graphs table +Run: python3 < this file +""" + +import sqlite3 +import os + +DB_PATH = 'database.db' + +def migrate(): + conn = sqlite3.connect(DB_PATH) + cursor = conn.cursor() + + # Create knowledge_graphs table + cursor.execute(""" + CREATE TABLE IF NOT EXISTS knowledge_graphs ( + session_id TEXT PRIMARY KEY, + graph_data TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (session_id) REFERENCES sessions(id) ON DELETE CASCADE + ) + """) + + # Add session_type index for faster lookups + cursor.execute(""" + CREATE INDEX IF NOT EXISTS idx_sessions_type + ON sessions(session_type) + """) + + conn.commit() + conn.close() + + print("✓ Migration completed: knowledge_graphs table created") + +if __name__ == '__main__': + migrate() diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..d450840055a169b04a5fd2780eea22595689b2b3 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,17 @@ +{ + "name": "Report-Generator", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/preact": { + "version": "10.29.0", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.29.0.tgz", + "integrity": "sha512-wSAGyk2bYR1c7t3SZ3jHcM6xy0lcBcDel6lODcs9ME6Th++Dx2KU+6D3HD8wMMKGA8Wpw7OMd3/4RGzYRpzwRg==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + } + } +} diff --git a/node_modules/preact/LICENSE b/node_modules/preact/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..da5389a93cbaa3ffcde17e2c76df6cb850912477 --- /dev/null +++ b/node_modules/preact/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-present Jason Miller + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/preact/README.md b/node_modules/preact/README.md new file mode 100644 index 0000000000000000000000000000000000000000..65e9e0ddc8300f70cdabc818c55a601c6b15104d --- /dev/null +++ b/node_modules/preact/README.md @@ -0,0 +1,185 @@ +

+ + +![Preact](https://raw.githubusercontent.com/preactjs/preact/8b0bcc927995c188eca83cba30fbc83491cc0b2f/logo.svg?sanitize=true 'Preact') + + +

+

Fast 3kB alternative to React with the same modern API.

+ +**All the power of Virtual DOM components, without the overhead:** + +- Familiar React API & patterns: ES6 Class, hooks, and Functional Components +- Extensive React compatibility via a simple [preact/compat] alias +- Everything you need: JSX, VDOM, [DevTools], HMR, SSR. +- Highly optimized diff algorithm and seamless hydration from Server Side Rendering +- Supports all modern browsers and IE11 +- Transparent asynchronous rendering with a pluggable scheduler + +### 💁 More information at the [Preact Website ➞](https://preactjs.com) + + + + + + + +
+ +[![npm](https://img.shields.io/npm/v/preact.svg)](https://www.npmjs.com/package/preact) +[![Preact Slack Community](https://img.shields.io/badge/Slack%20Community-preact.slack.com-blue)](https://chat.preactjs.com) +[![OpenCollective Backers](https://opencollective.com/preact/backers/badge.svg)](#backers) +[![OpenCollective Sponsors](https://opencollective.com/preact/sponsors/badge.svg)](#sponsors) + +[![coveralls](https://img.shields.io/coveralls/preactjs/preact/main.svg)](https://coveralls.io/github/preactjs/preact) +[![gzip size](https://img.badgesize.io/https://unpkg.com/preact/dist/preact.min.js?compression=gzip&label=gzip)](https://unpkg.com/preact/dist/preact.min.js) +[![brotli size](https://img.badgesize.io/https://unpkg.com/preact/dist/preact.min.js?compression=brotli&label=brotli)](https://unpkg.com/preact/dist/preact.min.js) + +
+ +You can find some awesome libraries in the [awesome-preact list](https://github.com/preactjs/awesome-preact) :sunglasses: + +--- + +## Getting Started + +> 💁 _**Note:** You [don't need ES2015 to use Preact](https://github.com/developit/preact-in-es3)... but give it a try!_ + +#### Tutorial: Building UI with Preact + +With Preact, you create user interfaces by assembling trees of components and elements. Components are functions or classes that return a description of what their tree should output. These descriptions are typically written in [JSX](https://facebook.github.io/jsx/) (shown underneath), or [HTM](https://github.com/developit/htm) which leverages standard JavaScript Tagged Templates. Both syntaxes can express trees of elements with "props" (similar to HTML attributes) and children. + +To get started using Preact, first look at the render() function. This function accepts a tree description and creates the structure described. Next, it appends this structure to a parent DOM element provided as the second argument. Future calls to render() will reuse the existing tree and update it in-place in the DOM. Internally, render() will calculate the difference from previous outputted structures in an attempt to perform as few DOM operations as possible. + +```js +import { h, render } from 'preact'; +// Tells babel to use h for JSX. It's better to configure this globally. +// See https://babeljs.io/docs/en/babel-plugin-transform-react-jsx#usage +// In tsconfig you can specify this with the jsxFactory +/** @jsx h */ + +// create our tree and append it to document.body: +render( +
+

Hello

+
, + document.body +); + +// update the tree in-place: +render( +
+

Hello World!

+
, + document.body +); +// ^ this second invocation of render(...) will use a single DOM call to update the text of the

+``` + +Hooray! render() has taken our structure and output a User Interface! This approach demonstrates a simple case, but would be difficult to use as an application grows in complexity. Each change would be forced to calculate the difference between the current and updated structure for the entire application. Components can help here – by dividing the User Interface into nested Components each can calculate their difference from their mounted point. Here's an example: + +```js +import { render, h } from 'preact'; +import { useState } from 'preact/hooks'; + +/** @jsx h */ + +const App = () => { + const [input, setInput] = useState(''); + + return ( +
+

Do you agree to the statement: "Preact is awesome"?

+ setInput(e.target.value)} /> +
+ ); +}; + +render(, document.body); +``` + +--- + +## Sponsors + +Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor](https://opencollective.com/preact#sponsor)] + + + + + + + + + + + + + + + + + + +             + + + + + + + + + + + + + + + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/preact#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +--- + +## License + +MIT + +[![Preact](https://i.imgur.com/YqCHvEW.gif)](https://preactjs.com) + +[preact/compat]: https://github.com/preactjs/preact/tree/main/compat +[hyperscript]: https://github.com/dominictarr/hyperscript +[DevTools]: https://github.com/preactjs/preact-devtools diff --git a/node_modules/preact/compat/client.d.ts b/node_modules/preact/compat/client.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e1beab907115d3c6a1b6f657da8aaa177d647718 --- /dev/null +++ b/node_modules/preact/compat/client.d.ts @@ -0,0 +1,13 @@ +// Intentionally not using a relative path to take advantage of +// the TS version resolution mechanism +import * as preact from 'preact'; + +export function createRoot(container: preact.ContainerNode): { + render(children: preact.ComponentChild): void; + unmount(): void; +}; + +export function hydrateRoot( + container: preact.ContainerNode, + children: preact.ComponentChild +): ReturnType; diff --git a/node_modules/preact/compat/client.js b/node_modules/preact/compat/client.js new file mode 100644 index 0000000000000000000000000000000000000000..bc48c21bf27728e2095947f82b3475b9c8aea0b7 --- /dev/null +++ b/node_modules/preact/compat/client.js @@ -0,0 +1,21 @@ +const { render, hydrate, unmountComponentAtNode } = require('preact/compat'); + +function createRoot(container) { + return { + // eslint-disable-next-line + render: function (children) { + render(children, container); + }, + // eslint-disable-next-line + unmount: function () { + unmountComponentAtNode(container); + } + }; +} + +exports.createRoot = createRoot; + +exports.hydrateRoot = function (container, children) { + hydrate(children, container); + return createRoot(container); +}; diff --git a/node_modules/preact/compat/client.mjs b/node_modules/preact/compat/client.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f9d1814e18af4b50ea3f2a60ca176d3af8513c8e --- /dev/null +++ b/node_modules/preact/compat/client.mjs @@ -0,0 +1,24 @@ +import { render, hydrate, unmountComponentAtNode } from 'preact/compat'; + +export function createRoot(container) { + return { + // eslint-disable-next-line + render: function (children) { + render(children, container); + }, + // eslint-disable-next-line + unmount: function () { + unmountComponentAtNode(container); + } + }; +} + +export function hydrateRoot(container, children) { + hydrate(children, container); + return createRoot(container); +} + +export default { + createRoot, + hydrateRoot +}; diff --git a/node_modules/preact/compat/dist/compat.js b/node_modules/preact/compat/dist/compat.js new file mode 100644 index 0000000000000000000000000000000000000000..fcbf4bf312c8c43257bdca19e8c388e613d243d0 --- /dev/null +++ b/node_modules/preact/compat/dist/compat.js @@ -0,0 +1,2 @@ +var n=require("preact"),t=require("preact/hooks");function e(n,t){for(var e in t)n[e]=t[e];return n}function r(n,t){for(var e in n)if("__source"!==e&&!(e in t))return!0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return!0;return!1}function u(n,e){var r=e(),u=t.useState({t:{__:r,u:e}}),i=u[0].t,c=u[1];return t.useLayoutEffect(function(){i.__=r,i.u=e,o(i)&&c({t:i})},[n,r,e]),t.useEffect(function(){return o(i)&&c({t:i}),n(function(){o(i)&&c({t:i})})},[n]),r}function o(n){try{return!((t=n.__)===(e=n.u())&&(0!==t||1/t==1/e)||t!=t&&e!=e)}catch(n){return!0}var t,e}function i(n){n()}function c(n){return n}function l(){return[!1,i]}var f=t.useLayoutEffect;function a(n,t){this.props=n,this.context=t}function s(t,e){function u(n){var t=this.props.ref;return t!=n.ref&&t&&("function"==typeof t?t(null):t.current=null),e?!e(this.props,n)||t!=n.ref:r(this.props,n)}function o(e){return this.shouldComponentUpdate=u,n.createElement(t,e)}return o.displayName="Memo("+(t.displayName||t.name)+")",o.__f=o.prototype.isReactComponent=!0,o.type=t,o}(a.prototype=new n.Component).isPureReactComponent=!0,a.prototype.shouldComponentUpdate=function(n,t){return r(this.props,n)||r(this.state,t)};var p=n.options.__b;n.options.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),p&&p(n)};var v="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function h(n){function t(t){var r=e({},t);return delete r.ref,n(r,t.ref||null)}return t.$$typeof=v,t.render=n,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var d=function(t,e){return null==t?null:n.toChildArray(n.toChildArray(t).map(e))},m={map:d,forEach:d,count:function(t){return t?n.toChildArray(t).length:0},only:function(t){var e=n.toChildArray(t);if(1!==e.length)throw"Children.only";return e[0]},toArray:n.toChildArray},x=n.options.__e;n.options.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);x(n,t,e,r)};var b=n.options.unmount;function y(n,t,r){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c()}),n.__c.__H=null),null!=(n=e({},n)).__c&&(n.__c.__P===r&&(n.__c.__P=t),n.__c.__e=!0,n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return y(n,t,r)})),n}function _(n,t,e){return n&&e&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return _(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.appendChild(n.__e),n.__c.__e=!0,n.__c.__P=e)),n}function g(){this.__u=0,this.o=null,this.__b=null}function S(n){var t=n.__&&n.__.__c;return t&&t.__a&&t.__a(n)}function E(t){var e,r,u,o=null;function i(i){if(e||(e=t()).then(function(n){n&&(o=n.default||n),u=!0},function(n){r=n,u=!0}),r)throw r;if(!u)throw e;return o?n.createElement(o,i):null}return i.displayName="Lazy",i.__f=!0,i}function C(){this.i=null,this.l=null}n.options.unmount=function(n){var t=n.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&n.__u&&(n.type=null),b&&b(n)},(g.prototype=new n.Component).__c=function(n,t){var e=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(e);var u=S(r.__v),o=!1,i=function(){o||r.__z||(o=!0,e.__R=null,u?u(l):l())};e.__R=i;var c=e.__P;e.__P=null;var l=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=_(n,n.__c.__P,n.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=c,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i)},g.prototype.componentWillUnmount=function(){this.o=[]},g.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),u=this.__v.__k[0].__c;this.__v.__k[0]=y(this.__b,r,u.__O=u.__P)}this.__b=null}var o=e.__a&&n.createElement(n.Fragment,null,t.fallback);return o&&(o.__u&=-33),[n.createElement(n.Fragment,null,e.__a?null:t.children),o]};var O=function(n,t,e){if(++e[1]===e[0]&&n.l.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.l.size))for(e=n.i;e;){for(;e.length>3;)e.pop()();if(e[1]>>1,1),e.p.removeChild(n)}}}n.render(n.createElement(R,{context:e.context},t.__v),e.v)}function j(t,e){var r=n.createElement(w,{__v:t,p:e});return r.containerInfo=e,r}(C.prototype=new n.Component).__a=function(n){var t=this,e=S(t.__v),r=t.l.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),O(t,n,r)):u()};e?e(o):o()}},C.prototype.render=function(t){this.i=null,this.l=new Map;var e=n.toChildArray(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var r=e.length;r--;)this.l.set(e[r],this.i=[1,0,this.i]);return t.children},C.prototype.componentDidUpdate=C.prototype.componentDidMount=function(){var n=this;this.l.forEach(function(t,e){O(n,e,t)})};var I="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,k=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,M=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,N=/[A-Z0-9]/g,T="undefined"!=typeof document,A=function(n){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(n)};function D(t,e,r){return null==e.__k&&(e.textContent=""),n.render(t,e),"function"==typeof r&&r(),t?t.__c:null}function L(t,e,r){return n.hydrate(t,e),"function"==typeof r&&r(),t?t.__c:null}n.Component.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(n.Component.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})});var U=n.options.event;n.options.event=function(n){return U&&(n=U(n)),n.persist=function(){},n.isPropagationStopped=function(){return this.cancelBubble},n.isDefaultPrevented=function(){return this.defaultPrevented},n.nativeEvent=n};var F,V={configurable:!0,get:function(){return this.class}},W=n.options.vnode;n.options.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,r=t.type,u={},o=-1==r.indexOf("-");for(var i in e){var c=e[i];if(!("value"===i&&"defaultValue"in e&&null==c||T&&"children"===i&&"noscript"===r||"class"===i||"className"===i)){var l=i.toLowerCase();"defaultValue"===i&&"value"in e&&null==e.value?i="value":"download"===i&&!0===c?c="":"translate"===l&&"no"===c?c=!1:"o"===l[0]&&"n"===l[1]?"ondoubleclick"===l?i="ondblclick":"onchange"!==l||"input"!==r&&"textarea"!==r||A(e.type)?"onfocus"===l?i="onfocusin":"onblur"===l?i="onfocusout":M.test(i)&&(i=l):l=i="oninput":o&&k.test(i)?i=i.replace(N,"-$&").toLowerCase():null===c&&(c=void 0),"oninput"===l&&u[i=l]&&(i="oninputCapture"),u[i]=c}}"select"==r&&(u.multiple&&Array.isArray(u.value)&&(u.value=n.toChildArray(e.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value)})),null!=u.defaultValue&&(u.value=n.toChildArray(e.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value}))),e.class&&!e.className?(u.class=e.class,Object.defineProperty(u,"className",V)):e.className&&(u.class=u.className=e.className),t.props=u}(t),t.$$typeof=I,W&&W(t)};var P=n.options.__r;n.options.__r=function(n){P&&P(n),F=n.__c};var z=n.options.diffed;n.options.diffed=function(n){z&&z(n);var t=n.props,e=n.__e;null!=e&&"textarea"===n.type&&"value"in t&&t.value!==e.value&&(e.value=null==t.value?"":t.value),F=null};var B={ReactCurrentDispatcher:{current:{readContext:function(n){return F.__n[n.__c].props.value},useCallback:t.useCallback,useContext:t.useContext,useDebugValue:t.useDebugValue,useDeferredValue:c,useEffect:t.useEffect,useId:t.useId,useImperativeHandle:t.useImperativeHandle,useInsertionEffect:f,useLayoutEffect:t.useLayoutEffect,useMemo:t.useMemo,useReducer:t.useReducer,useRef:t.useRef,useState:t.useState,useSyncExternalStore:u,useTransition:l}}};function H(t){return n.createElement.bind(null,t)}function q(n){return!!n&&n.$$typeof===I}function Z(t){return q(t)&&t.type===n.Fragment}function Y(n){return!!n&&"string"==typeof n.displayName&&0==n.displayName.indexOf("Memo(")}function $(t){return q(t)?n.cloneElement.apply(null,arguments):t}function G(t){return!!t.__k&&(n.render(null,t),!0)}function J(n){return n&&(n.base||1===n.nodeType&&n)||null}var K=function(n,t){return n(t)},Q=function(t,e){var r=n.options.debounceRendering;n.options.debounceRendering=function(n){return n()};var u=t(e);return n.options.debounceRendering=r,u},X=q,nn={useState:t.useState,useId:t.useId,useReducer:t.useReducer,useEffect:t.useEffect,useLayoutEffect:t.useLayoutEffect,useInsertionEffect:f,useTransition:l,useDeferredValue:c,useSyncExternalStore:u,startTransition:i,useRef:t.useRef,useImperativeHandle:t.useImperativeHandle,useMemo:t.useMemo,useCallback:t.useCallback,useContext:t.useContext,useDebugValue:t.useDebugValue,version:"18.3.1",Children:m,render:D,hydrate:L,unmountComponentAtNode:G,createPortal:j,createElement:n.createElement,createContext:n.createContext,createFactory:H,cloneElement:$,createRef:n.createRef,Fragment:n.Fragment,isValidElement:q,isElement:X,isFragment:Z,isMemo:Y,findDOMNode:J,Component:n.Component,PureComponent:a,memo:s,forwardRef:h,flushSync:Q,unstable_batchedUpdates:K,StrictMode:n.Fragment,Suspense:g,SuspenseList:C,lazy:E,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:B};Object.defineProperty(exports,"Component",{enumerable:!0,get:function(){return n.Component}}),Object.defineProperty(exports,"Fragment",{enumerable:!0,get:function(){return n.Fragment}}),Object.defineProperty(exports,"StrictMode",{enumerable:!0,get:function(){return n.Fragment}}),Object.defineProperty(exports,"createContext",{enumerable:!0,get:function(){return n.createContext}}),Object.defineProperty(exports,"createElement",{enumerable:!0,get:function(){return n.createElement}}),Object.defineProperty(exports,"createRef",{enumerable:!0,get:function(){return n.createRef}}),exports.Children=m,exports.PureComponent=a,exports.Suspense=g,exports.SuspenseList=C,exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=B,exports.cloneElement=$,exports.createFactory=H,exports.createPortal=j,exports.default=nn,exports.findDOMNode=J,exports.flushSync=Q,exports.forwardRef=h,exports.hydrate=L,exports.isElement=X,exports.isFragment=Z,exports.isMemo=Y,exports.isValidElement=q,exports.lazy=E,exports.memo=s,exports.render=D,exports.startTransition=i,exports.unmountComponentAtNode=G,exports.unstable_batchedUpdates=K,exports.useDeferredValue=c,exports.useInsertionEffect=f,exports.useSyncExternalStore=u,exports.useTransition=l,exports.version="18.3.1",Object.keys(t).forEach(function(n){"default"===n||exports.hasOwnProperty(n)||Object.defineProperty(exports,n,{enumerable:!0,get:function(){return t[n]}})}); +//# sourceMappingURL=compat.js.map diff --git a/node_modules/preact/compat/dist/compat.js.map b/node_modules/preact/compat/dist/compat.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e367e3c9cf6f99a31be0082d10865c51458a6b27 --- /dev/null +++ b/node_modules/preact/compat/dist/compat.js.map @@ -0,0 +1 @@ +{"version":3,"file":"compat.js","sources":["../src/util.js","../src/hooks.js","../src/PureComponent.js","../src/memo.js","../src/forwardRef.js","../src/Children.js","../src/suspense.js","../src/suspense-list.js","../../src/constants.js","../src/portals.js","../src/render.js","../src/index.js"],"sourcesContent":["/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Check if two objects have a different shape\n * @param {object} a\n * @param {object} b\n * @returns {boolean}\n */\nexport function shallowDiffers(a, b) {\n\tfor (let i in a) if (i !== '__source' && !(i in b)) return true;\n\tfor (let i in b) if (i !== '__source' && a[i] !== b[i]) return true;\n\treturn false;\n}\n\n/**\n * Check if two values are the same value\n * @param {*} x\n * @param {*} y\n * @returns {boolean}\n */\nexport function is(x, y) {\n\treturn (x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\n","import { useState, useLayoutEffect, useEffect } from 'preact/hooks';\nimport { is } from './util';\n\n/**\n * This is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84\n * on a high level this cuts out the warnings, ... and attempts a smaller implementation\n * @typedef {{ _value: any; _getSnapshot: () => any }} Store\n */\nexport function useSyncExternalStore(subscribe, getSnapshot) {\n\tconst value = getSnapshot();\n\n\t/**\n\t * @typedef {{ _instance: Store }} StoreRef\n\t * @type {[StoreRef, (store: StoreRef) => void]}\n\t */\n\tconst [{ _instance }, forceUpdate] = useState({\n\t\t_instance: { _value: value, _getSnapshot: getSnapshot }\n\t});\n\n\tuseLayoutEffect(() => {\n\t\t_instance._value = value;\n\t\t_instance._getSnapshot = getSnapshot;\n\n\t\tif (didSnapshotChange(_instance)) {\n\t\t\tforceUpdate({ _instance });\n\t\t}\n\t}, [subscribe, value, getSnapshot]);\n\n\tuseEffect(() => {\n\t\tif (didSnapshotChange(_instance)) {\n\t\t\tforceUpdate({ _instance });\n\t\t}\n\n\t\treturn subscribe(() => {\n\t\t\tif (didSnapshotChange(_instance)) {\n\t\t\t\tforceUpdate({ _instance });\n\t\t\t}\n\t\t});\n\t}, [subscribe]);\n\n\treturn value;\n}\n\n/** @type {(inst: Store) => boolean} */\nfunction didSnapshotChange(inst) {\n\ttry {\n\t\treturn !is(inst._value, inst._getSnapshot());\n\t} catch (error) {\n\t\treturn true;\n\t}\n}\n\nexport function startTransition(cb) {\n\tcb();\n}\n\nexport function useDeferredValue(val) {\n\treturn val;\n}\n\nexport function useTransition() {\n\treturn [false, startTransition];\n}\n\n// TODO: in theory this should be done after a VNode is diffed as we want to insert\n// styles/... before it attaches\nexport const useInsertionEffect = useLayoutEffect;\n","import { Component } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Component class with a predefined `shouldComponentUpdate` implementation\n */\nexport function PureComponent(p, c) {\n\tthis.props = p;\n\tthis.context = c;\n}\nPureComponent.prototype = new Component();\n// Some third-party libraries check if this property is present\nPureComponent.prototype.isPureReactComponent = true;\nPureComponent.prototype.shouldComponentUpdate = function (props, state) {\n\treturn shallowDiffers(this.props, props) || shallowDiffers(this.state, state);\n};\n","import { createElement } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Memoize a component, so that it only updates when the props actually have\n * changed. This was previously known as `React.pure`.\n * @param {import('./internal').FunctionComponent} c functional component\n * @param {(prev: object, next: object) => boolean} [comparer] Custom equality function\n * @returns {import('./internal').FunctionComponent}\n */\nexport function memo(c, comparer) {\n\tfunction shouldUpdate(nextProps) {\n\t\tlet ref = this.props.ref;\n\t\tif (ref != nextProps.ref && ref) {\n\t\t\ttypeof ref == 'function' ? ref(null) : (ref.current = null);\n\t\t}\n\n\t\treturn comparer\n\t\t\t? !comparer(this.props, nextProps) || ref != nextProps.ref\n\t\t\t: shallowDiffers(this.props, nextProps);\n\t}\n\n\tfunction Memoed(props) {\n\t\tthis.shouldComponentUpdate = shouldUpdate;\n\t\treturn createElement(c, props);\n\t}\n\tMemoed.displayName = 'Memo(' + (c.displayName || c.name) + ')';\n\tMemoed._forwarded = Memoed.prototype.isReactComponent = true;\n\tMemoed.type = c;\n\treturn Memoed;\n}\n","import { options } from 'preact';\nimport { assign } from './util';\n\nlet oldDiffHook = options._diff;\noptions._diff = vnode => {\n\tif (vnode.type && vnode.type._forwarded && vnode.ref) {\n\t\tvnode.props.ref = vnode.ref;\n\t\tvnode.ref = null;\n\t}\n\tif (oldDiffHook) oldDiffHook(vnode);\n};\n\nexport const REACT_FORWARD_SYMBOL =\n\t(typeof Symbol != 'undefined' &&\n\t\tSymbol.for &&\n\t\tSymbol.for('react.forward_ref')) ||\n\t0xf47;\n\n/**\n * Pass ref down to a child. This is mainly used in libraries with HOCs that\n * wrap components. Using `forwardRef` there is an easy way to get a reference\n * of the wrapped component instead of one of the wrapper itself.\n * @param {import('./index').ForwardFn} fn\n * @returns {import('./internal').FunctionComponent}\n */\nexport function forwardRef(fn) {\n\tfunction Forwarded(props) {\n\t\tlet clone = assign({}, props);\n\t\tdelete clone.ref;\n\t\treturn fn(clone, props.ref || null);\n\t}\n\n\t// mobx-react checks for this being present\n\tForwarded.$$typeof = REACT_FORWARD_SYMBOL;\n\t// mobx-react heavily relies on implementation details.\n\t// It expects an object here with a `render` property,\n\t// and prototype.render will fail. Without this\n\t// mobx-react throws.\n\tForwarded.render = fn;\n\n\tForwarded.prototype.isReactComponent = Forwarded._forwarded = true;\n\tForwarded.displayName = 'ForwardRef(' + (fn.displayName || fn.name) + ')';\n\treturn Forwarded;\n}\n","import { toChildArray } from 'preact';\n\nconst mapFn = (children, fn) => {\n\tif (children == null) return null;\n\treturn toChildArray(toChildArray(children).map(fn));\n};\n\n// This API is completely unnecessary for Preact, so it's basically passthrough.\nexport const Children = {\n\tmap: mapFn,\n\tforEach: mapFn,\n\tcount(children) {\n\t\treturn children ? toChildArray(children).length : 0;\n\t},\n\tonly(children) {\n\t\tconst normalized = toChildArray(children);\n\t\tif (normalized.length !== 1) throw 'Children.only';\n\t\treturn normalized[0];\n\t},\n\ttoArray: toChildArray\n};\n","import { Component, createElement, options, Fragment } from 'preact';\nimport { MODE_HYDRATE } from '../../src/constants';\nimport { assign } from './util';\n\nconst oldCatchError = options._catchError;\noptions._catchError = function (error, newVNode, oldVNode, errorInfo) {\n\tif (error.then) {\n\t\t/** @type {import('./internal').Component} */\n\t\tlet component;\n\t\tlet vnode = newVNode;\n\n\t\tfor (; (vnode = vnode._parent); ) {\n\t\t\tif ((component = vnode._component) && component._childDidSuspend) {\n\t\t\t\tif (newVNode._dom == null) {\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t}\n\t\t\t\t// Don't call oldCatchError if we found a Suspense\n\t\t\t\treturn component._childDidSuspend(error, newVNode);\n\t\t\t}\n\t\t}\n\t}\n\toldCatchError(error, newVNode, oldVNode, errorInfo);\n};\n\nconst oldUnmount = options.unmount;\noptions.unmount = function (vnode) {\n\t/** @type {import('./internal').Component} */\n\tconst component = vnode._component;\n\tif (component) component._unmounted = true;\n\tif (component && component._onResolve) {\n\t\tcomponent._onResolve();\n\t}\n\n\t// if the component is still hydrating\n\t// most likely it is because the component is suspended\n\t// we set the vnode.type as `null` so that it is not a typeof function\n\t// so the unmount will remove the vnode._dom\n\tif (component && vnode._flags & MODE_HYDRATE) {\n\t\tvnode.type = null;\n\t}\n\n\tif (oldUnmount) oldUnmount(vnode);\n};\n\nfunction detachedClone(vnode, detachedParent, parentDom) {\n\tif (vnode) {\n\t\tif (vnode._component && vnode._component.__hooks) {\n\t\t\tvnode._component.__hooks._list.forEach(effect => {\n\t\t\t\tif (typeof effect._cleanup == 'function') effect._cleanup();\n\t\t\t});\n\n\t\t\tvnode._component.__hooks = null;\n\t\t}\n\n\t\tvnode = assign({}, vnode);\n\t\tif (vnode._component != null) {\n\t\t\tif (vnode._component._parentDom === parentDom) {\n\t\t\t\tvnode._component._parentDom = detachedParent;\n\t\t\t}\n\n\t\t\tvnode._component._force = true;\n\n\t\t\tvnode._component = null;\n\t\t}\n\n\t\tvnode._children =\n\t\t\tvnode._children &&\n\t\t\tvnode._children.map(child =>\n\t\t\t\tdetachedClone(child, detachedParent, parentDom)\n\t\t\t);\n\t}\n\n\treturn vnode;\n}\n\nfunction removeOriginal(vnode, detachedParent, originalParent) {\n\tif (vnode && originalParent) {\n\t\tvnode._original = null;\n\t\tvnode._children =\n\t\t\tvnode._children &&\n\t\t\tvnode._children.map(child =>\n\t\t\t\tremoveOriginal(child, detachedParent, originalParent)\n\t\t\t);\n\n\t\tif (vnode._component) {\n\t\t\tif (vnode._component._parentDom === detachedParent) {\n\t\t\t\tif (vnode._dom) {\n\t\t\t\t\toriginalParent.appendChild(vnode._dom);\n\t\t\t\t}\n\t\t\t\tvnode._component._force = true;\n\t\t\t\tvnode._component._parentDom = originalParent;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn vnode;\n}\n\n// having custom inheritance instead of a class here saves a lot of bytes\nexport function Suspense() {\n\t// we do not call super here to golf some bytes...\n\tthis._pendingSuspensionCount = 0;\n\tthis._suspenders = null;\n\tthis._detachOnNextRender = null;\n}\n\n// Things we do here to save some bytes but are not proper JS inheritance:\n// - call `new Component()` as the prototype\n// - do not set `Suspense.prototype.constructor` to `Suspense`\nSuspense.prototype = new Component();\n\n/**\n * @this {import('./internal').SuspenseComponent}\n * @param {Promise} promise The thrown promise\n * @param {import('./internal').VNode} suspendingVNode The suspending component\n */\nSuspense.prototype._childDidSuspend = function (promise, suspendingVNode) {\n\tconst suspendingComponent = suspendingVNode._component;\n\n\t/** @type {import('./internal').SuspenseComponent} */\n\tconst c = this;\n\n\tif (c._suspenders == null) {\n\t\tc._suspenders = [];\n\t}\n\tc._suspenders.push(suspendingComponent);\n\n\tconst resolve = suspended(c._vnode);\n\n\tlet resolved = false;\n\tconst onResolved = () => {\n\t\tif (resolved || c._unmounted) return;\n\n\t\tresolved = true;\n\t\tsuspendingComponent._onResolve = null;\n\n\t\tif (resolve) {\n\t\t\tresolve(onSuspensionComplete);\n\t\t} else {\n\t\t\tonSuspensionComplete();\n\t\t}\n\t};\n\n\tsuspendingComponent._onResolve = onResolved;\n\n\t// Store and null _parentDom to prevent setState/forceUpdate from\n\t// scheduling renders while suspended. Render would be a no-op anyway\n\t// since renderComponent checks _parentDom, but this avoids queue churn.\n\tconst originalParentDom = suspendingComponent._parentDom;\n\tsuspendingComponent._parentDom = null;\n\n\tconst onSuspensionComplete = () => {\n\t\tif (!--c._pendingSuspensionCount) {\n\t\t\t// If the suspension was during hydration we don't need to restore the\n\t\t\t// suspended children into the _children array\n\t\t\tif (c.state._suspended) {\n\t\t\t\tconst suspendedVNode = c.state._suspended;\n\t\t\t\tc._vnode._children[0] = removeOriginal(\n\t\t\t\t\tsuspendedVNode,\n\t\t\t\t\tsuspendedVNode._component._parentDom,\n\t\t\t\t\tsuspendedVNode._component._originalParentDom\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tc.setState({ _suspended: (c._detachOnNextRender = null) });\n\n\t\t\tlet suspended;\n\t\t\twhile ((suspended = c._suspenders.pop())) {\n\t\t\t\t// Restore _parentDom before forceUpdate so render can proceed\n\t\t\t\tsuspended._parentDom = originalParentDom;\n\t\t\t\tsuspended.forceUpdate();\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * We do not set `suspended: true` during hydration because we want the actual markup\n\t * to remain on screen and hydrate it when the suspense actually gets resolved.\n\t * While in non-hydration cases the usual fallback -> component flow would occour.\n\t */\n\tif (\n\t\t!c._pendingSuspensionCount++ &&\n\t\t!(suspendingVNode._flags & MODE_HYDRATE)\n\t) {\n\t\tc.setState({ _suspended: (c._detachOnNextRender = c._vnode._children[0]) });\n\t}\n\tpromise.then(onResolved, onResolved);\n};\n\nSuspense.prototype.componentWillUnmount = function () {\n\tthis._suspenders = [];\n};\n\n/**\n * @this {import('./internal').SuspenseComponent}\n * @param {import('./internal').SuspenseComponent[\"props\"]} props\n * @param {import('./internal').SuspenseState} state\n */\nSuspense.prototype.render = function (props, state) {\n\tif (this._detachOnNextRender) {\n\t\t// When the Suspense's _vnode was created by a call to createVNode\n\t\t// (i.e. due to a setState further up in the tree)\n\t\t// it's _children prop is null, in this case we \"forget\" about the parked vnodes to detach\n\t\tif (this._vnode._children) {\n\t\t\tconst detachedParent = document.createElement('div');\n\t\t\tconst detachedComponent = this._vnode._children[0]._component;\n\t\t\tthis._vnode._children[0] = detachedClone(\n\t\t\t\tthis._detachOnNextRender,\n\t\t\t\tdetachedParent,\n\t\t\t\t(detachedComponent._originalParentDom = detachedComponent._parentDom)\n\t\t\t);\n\t\t}\n\n\t\tthis._detachOnNextRender = null;\n\t}\n\n\t// Wrap fallback tree in a VNode that prevents itself from being marked as aborting mid-hydration:\n\t/** @type {import('./internal').VNode} */\n\tconst fallback =\n\t\tstate._suspended && createElement(Fragment, null, props.fallback);\n\tif (fallback) fallback._flags &= ~MODE_HYDRATE;\n\n\treturn [\n\t\tcreateElement(Fragment, null, state._suspended ? null : props.children),\n\t\tfallback\n\t];\n};\n\n/**\n * Checks and calls the parent component's _suspended method, passing in the\n * suspended vnode. This is a way for a parent (e.g. SuspenseList) to get notified\n * that one of its children/descendants suspended.\n *\n * The parent MAY return a callback. The callback will get called when the\n * suspension resolves, notifying the parent of the fact.\n * Moreover, the callback gets function `unsuspend` as a parameter. The resolved\n * child descendant will not actually get unsuspended until `unsuspend` gets called.\n * This is a way for the parent to delay unsuspending.\n *\n * If the parent does not return a callback then the resolved vnode\n * gets unsuspended immediately when it resolves.\n *\n * @param {import('./internal').VNode} vnode\n * @returns {((unsuspend: () => void) => void)?}\n */\nexport function suspended(vnode) {\n\tlet component = vnode._parent && vnode._parent._component;\n\treturn component && component._suspended && component._suspended(vnode);\n}\n\nexport function lazy(loader) {\n\tlet prom;\n\tlet component = null;\n\tlet error;\n\tlet resolved;\n\n\tfunction Lazy(props) {\n\t\tif (!prom) {\n\t\t\tprom = loader();\n\t\t\tprom.then(\n\t\t\t\texports => {\n\t\t\t\t\tif (exports) {\n\t\t\t\t\t\tcomponent = exports.default || exports;\n\t\t\t\t\t}\n\t\t\t\t\tresolved = true;\n\t\t\t\t},\n\t\t\t\te => {\n\t\t\t\t\terror = e;\n\t\t\t\t\tresolved = true;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!resolved) {\n\t\t\tthrow prom;\n\t\t}\n\n\t\treturn component ? createElement(component, props) : null;\n\t}\n\n\tLazy.displayName = 'Lazy';\n\tLazy._forwarded = true;\n\treturn Lazy;\n}\n","import { Component, toChildArray } from 'preact';\nimport { suspended } from './suspense.js';\n\n// Indexes to linked list nodes (nodes are stored as arrays to save bytes).\nconst SUSPENDED_COUNT = 0;\nconst RESOLVED_COUNT = 1;\nconst NEXT_NODE = 2;\n\n// Having custom inheritance instead of a class here saves a lot of bytes.\nexport function SuspenseList() {\n\tthis._next = null;\n\tthis._map = null;\n}\n\n// Mark one of child's earlier suspensions as resolved.\n// Some pending callbacks may become callable due to this\n// (e.g. the last suspended descendant gets resolved when\n// revealOrder === 'together'). Process those callbacks as well.\nconst resolve = (list, child, node) => {\n\tif (++node[RESOLVED_COUNT] === node[SUSPENDED_COUNT]) {\n\t\t// The number a child (or any of its descendants) has been suspended\n\t\t// matches the number of times it's been resolved. Therefore we\n\t\t// mark the child as completely resolved by deleting it from ._map.\n\t\t// This is used to figure out when *all* children have been completely\n\t\t// resolved when revealOrder is 'together'.\n\t\tlist._map.delete(child);\n\t}\n\n\t// If revealOrder is falsy then we can do an early exit, as the\n\t// callbacks won't get queued in the node anyway.\n\t// If revealOrder is 'together' then also do an early exit\n\t// if all suspended descendants have not yet been resolved.\n\tif (\n\t\t!list.props.revealOrder ||\n\t\t(list.props.revealOrder[0] === 't' && list._map.size)\n\t) {\n\t\treturn;\n\t}\n\n\t// Walk the currently suspended children in order, calling their\n\t// stored callbacks on the way. Stop if we encounter a child that\n\t// has not been completely resolved yet.\n\tnode = list._next;\n\twhile (node) {\n\t\twhile (node.length > 3) {\n\t\t\tnode.pop()();\n\t\t}\n\t\tif (node[RESOLVED_COUNT] < node[SUSPENDED_COUNT]) {\n\t\t\tbreak;\n\t\t}\n\t\tlist._next = node = node[NEXT_NODE];\n\t}\n};\n\n// Things we do here to save some bytes but are not proper JS inheritance:\n// - call `new Component()` as the prototype\n// - do not set `Suspense.prototype.constructor` to `Suspense`\nSuspenseList.prototype = new Component();\n\nSuspenseList.prototype._suspended = function (child) {\n\tconst list = this;\n\tconst delegated = suspended(list._vnode);\n\n\tlet node = list._map.get(child);\n\tnode[SUSPENDED_COUNT]++;\n\n\treturn unsuspend => {\n\t\tconst wrappedUnsuspend = () => {\n\t\t\tif (!list.props.revealOrder) {\n\t\t\t\t// Special case the undefined (falsy) revealOrder, as there\n\t\t\t\t// is no need to coordinate a specific order or unsuspends.\n\t\t\t\tunsuspend();\n\t\t\t} else {\n\t\t\t\tnode.push(unsuspend);\n\t\t\t\tresolve(list, child, node);\n\t\t\t}\n\t\t};\n\t\tif (delegated) {\n\t\t\tdelegated(wrappedUnsuspend);\n\t\t} else {\n\t\t\twrappedUnsuspend();\n\t\t}\n\t};\n};\n\nSuspenseList.prototype.render = function (props) {\n\tthis._next = null;\n\tthis._map = new Map();\n\n\tconst children = toChildArray(props.children);\n\tif (props.revealOrder && props.revealOrder[0] === 'b') {\n\t\t// If order === 'backwards' (or, well, anything starting with a 'b')\n\t\t// then flip the child list around so that the last child will be\n\t\t// the first in the linked list.\n\t\tchildren.reverse();\n\t}\n\t// Build the linked list. Iterate through the children in reverse order\n\t// so that `_next` points to the first linked list node to be resolved.\n\tfor (let i = children.length; i--; ) {\n\t\t// Create a new linked list node as an array of form:\n\t\t// \t[suspended_count, resolved_count, next_node]\n\t\t// where suspended_count and resolved_count are numeric counters for\n\t\t// keeping track how many times a node has been suspended and resolved.\n\t\t//\n\t\t// Note that suspended_count starts from 1 instead of 0, so we can block\n\t\t// processing callbacks until componentDidMount has been called. In a sense\n\t\t// node is suspended at least until componentDidMount gets called!\n\t\t//\n\t\t// Pending callbacks are added to the end of the node:\n\t\t// \t[suspended_count, resolved_count, next_node, callback_0, callback_1, ...]\n\t\tthis._map.set(children[i], (this._next = [1, 0, this._next]));\n\t}\n\treturn props.children;\n};\n\nSuspenseList.prototype.componentDidUpdate =\n\tSuspenseList.prototype.componentDidMount = function () {\n\t\t// Iterate through all children after mounting for two reasons:\n\t\t// 1. As each node[SUSPENDED_COUNT] starts from 1, this iteration increases\n\t\t// each node[RELEASED_COUNT] by 1, therefore balancing the counters.\n\t\t// The nodes can now be completely consumed from the linked list.\n\t\t// 2. Handle nodes that might have gotten resolved between render and\n\t\t// componentDidMount.\n\t\tthis._map.forEach((node, child) => {\n\t\t\tresolve(this, child, node);\n\t\t});\n\t};\n","/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { createElement, render } from 'preact';\n\n/**\n * @param {import('../../src/index').RenderableProps<{ context: any }>} props\n */\nfunction ContextProvider(props) {\n\tthis.getChildContext = () => props.context;\n\treturn props.children;\n}\n\n/**\n * Portal component\n * @this {import('./internal').Component}\n * @param {object | null | undefined} props\n *\n * TODO: use createRoot() instead of fake root\n */\nfunction Portal(props) {\n\tconst _this = this;\n\tlet container = props._container;\n\n\t_this.componentWillUnmount = function () {\n\t\trender(null, _this._temp);\n\t\t_this._temp = null;\n\t\t_this._container = null;\n\t};\n\n\t// When we change container we should clear our old container and\n\t// indicate a new mount.\n\tif (_this._container && _this._container !== container) {\n\t\t_this.componentWillUnmount();\n\t}\n\n\tif (!_this._temp) {\n\t\t// Ensure the element has a mask for useId invocations\n\t\tlet root = _this._vnode;\n\t\twhile (root !== null && !root._mask && root._parent !== null) {\n\t\t\troot = root._parent;\n\t\t}\n\n\t\t_this._container = container;\n\n\t\t// Create a fake DOM parent node that manages a subset of `container`'s children:\n\t\t_this._temp = {\n\t\t\tnodeType: 1,\n\t\t\tparentNode: container,\n\t\t\tchildNodes: [],\n\t\t\t_children: { _mask: root._mask },\n\t\t\tcontains: () => true,\n\t\t\tnamespaceURI: container.namespaceURI,\n\t\t\tinsertBefore(child, before) {\n\t\t\t\tthis.childNodes.push(child);\n\t\t\t\t_this._container.insertBefore(child, before);\n\t\t\t},\n\t\t\tremoveChild(child) {\n\t\t\t\tthis.childNodes.splice(this.childNodes.indexOf(child) >>> 1, 1);\n\t\t\t\t_this._container.removeChild(child);\n\t\t\t}\n\t\t};\n\t}\n\n\t// Render our wrapping element into temp.\n\trender(\n\t\tcreateElement(ContextProvider, { context: _this.context }, props._vnode),\n\t\t_this._temp\n\t);\n}\n\n/**\n * Create a `Portal` to continue rendering the vnode tree at a different DOM node\n * @param {import('./internal').VNode} vnode The vnode to render\n * @param {import('./internal').PreactElement} container The DOM node to continue rendering in to.\n */\nexport function createPortal(vnode, container) {\n\tconst el = createElement(Portal, { _vnode: vnode, _container: container });\n\tel.containerInfo = container;\n\treturn el;\n}\n","import {\n\trender as preactRender,\n\thydrate as preactHydrate,\n\toptions,\n\ttoChildArray,\n\tComponent\n} from 'preact';\nimport {\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tuseEffect,\n\tuseId,\n\tuseImperativeHandle,\n\tuseLayoutEffect,\n\tuseMemo,\n\tuseReducer,\n\tuseRef,\n\tuseState\n} from 'preact/hooks';\nimport {\n\tuseDeferredValue,\n\tuseInsertionEffect,\n\tuseSyncExternalStore,\n\tuseTransition\n} from './index';\n\nexport const REACT_ELEMENT_TYPE =\n\t(typeof Symbol != 'undefined' && Symbol.for && Symbol.for('react.element')) ||\n\t0xeac7;\n\nconst CAMEL_PROPS =\n\t/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;\nconst ON_ANI = /^on(Ani|Tra|Tou|BeforeInp|Compo)/;\nconst CAMEL_REPLACE = /[A-Z0-9]/g;\nconst IS_DOM = typeof document !== 'undefined';\n\n// Input types for which onchange should not be converted to oninput.\n// type=\"file|checkbox|radio\", plus \"range\" in IE11.\n// (IE11 doesn't support Symbol, which we use here to turn `rad` into `ra` which matches \"range\")\nconst onChangeInputType = type =>\n\t(typeof Symbol != 'undefined' && typeof Symbol() == 'symbol'\n\t\t? /fil|che|rad/\n\t\t: /fil|che|ra/\n\t).test(type);\n\n// Some libraries like `react-virtualized` explicitly check for this.\nComponent.prototype.isReactComponent = true;\n\n// `UNSAFE_*` lifecycle hooks\n// Preact only ever invokes the unprefixed methods.\n// Here we provide a base \"fallback\" implementation that calls any defined UNSAFE_ prefixed method.\n// - If a component defines its own `componentDidMount()` (including via defineProperty), use that.\n// - If a component defines `UNSAFE_componentDidMount()`, `componentDidMount` is the alias getter/setter.\n// - If anything assigns to an `UNSAFE_*` property, the assignment is forwarded to the unprefixed property.\n// See https://github.com/preactjs/preact/issues/1941\n[\n\t'componentWillMount',\n\t'componentWillReceiveProps',\n\t'componentWillUpdate'\n].forEach(key => {\n\tObject.defineProperty(Component.prototype, key, {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn this['UNSAFE_' + key];\n\t\t},\n\t\tset(v) {\n\t\t\tObject.defineProperty(this, key, {\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: v\n\t\t\t});\n\t\t}\n\t});\n});\n\n/**\n * Proxy render() since React returns a Component reference.\n * @param {import('./internal').VNode} vnode VNode tree to render\n * @param {import('./internal').PreactElement} parent DOM node to render vnode tree into\n * @param {() => void} [callback] Optional callback that will be called after rendering\n * @returns {import('./internal').Component | null} The root component reference or null\n */\nexport function render(vnode, parent, callback) {\n\t// React destroys any existing DOM nodes, see #1727\n\t// ...but only on the first render, see #1828\n\tif (parent._children == null) {\n\t\tparent.textContent = '';\n\t}\n\n\tpreactRender(vnode, parent);\n\tif (typeof callback == 'function') callback();\n\n\treturn vnode ? vnode._component : null;\n}\n\nexport function hydrate(vnode, parent, callback) {\n\tpreactHydrate(vnode, parent);\n\tif (typeof callback == 'function') callback();\n\n\treturn vnode ? vnode._component : null;\n}\n\nlet oldEventHook = options.event;\noptions.event = e => {\n\tif (oldEventHook) e = oldEventHook(e);\n\n\te.persist = () => {};\n\te.isPropagationStopped = function isPropagationStopped() {\n\t\treturn this.cancelBubble;\n\t};\n\te.isDefaultPrevented = function isDefaultPrevented() {\n\t\treturn this.defaultPrevented;\n\t};\n\treturn (e.nativeEvent = e);\n};\n\nconst classNameDescriptorNonEnumberable = {\n\tconfigurable: true,\n\tget() {\n\t\treturn this.class;\n\t}\n};\n\nfunction handleDomVNode(vnode) {\n\tlet props = vnode.props,\n\t\ttype = vnode.type,\n\t\tnormalizedProps = {},\n\t\tisNonDashedType = type.indexOf('-') == -1;\n\n\tfor (let i in props) {\n\t\tlet value = props[i];\n\n\t\tif (\n\t\t\t(i === 'value' && 'defaultValue' in props && value == null) ||\n\t\t\t// Emulate React's behavior of not rendering the contents of noscript tags on the client.\n\t\t\t(IS_DOM && i === 'children' && type === 'noscript') ||\n\t\t\ti === 'class' ||\n\t\t\ti === 'className'\n\t\t) {\n\t\t\t// Skip applying value if it is null/undefined and we already set\n\t\t\t// a default value\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet lowerCased = i.toLowerCase();\n\t\tif (i === 'defaultValue' && 'value' in props && props.value == null) {\n\t\t\t// `defaultValue` is treated as a fallback `value` when a value prop is present but null/undefined.\n\t\t\t// `defaultValue` for Elements with no value prop is the same as the DOM defaultValue property.\n\t\t\ti = 'value';\n\t\t} else if (i === 'download' && value === true) {\n\t\t\t// Calling `setAttribute` with a truthy value will lead to it being\n\t\t\t// passed as a stringified value, e.g. `download=\"true\"`. React\n\t\t\t// converts it to an empty string instead, otherwise the attribute\n\t\t\t// value will be used as the file name and the file will be called\n\t\t\t// \"true\" upon downloading it.\n\t\t\tvalue = '';\n\t\t} else if (lowerCased === 'translate' && value === 'no') {\n\t\t\tvalue = false;\n\t\t} else if (lowerCased[0] === 'o' && lowerCased[1] === 'n') {\n\t\t\tif (lowerCased === 'ondoubleclick') {\n\t\t\t\ti = 'ondblclick';\n\t\t\t} else if (\n\t\t\t\tlowerCased === 'onchange' &&\n\t\t\t\t(type === 'input' || type === 'textarea') &&\n\t\t\t\t!onChangeInputType(props.type)\n\t\t\t) {\n\t\t\t\tlowerCased = i = 'oninput';\n\t\t\t} else if (lowerCased === 'onfocus') {\n\t\t\t\ti = 'onfocusin';\n\t\t\t} else if (lowerCased === 'onblur') {\n\t\t\t\ti = 'onfocusout';\n\t\t\t} else if (ON_ANI.test(i)) {\n\t\t\t\ti = lowerCased;\n\t\t\t}\n\t\t} else if (isNonDashedType && CAMEL_PROPS.test(i)) {\n\t\t\ti = i.replace(CAMEL_REPLACE, '-$&').toLowerCase();\n\t\t} else if (value === null) {\n\t\t\tvalue = undefined;\n\t\t}\n\n\t\t// Add support for onInput and onChange, see #3561\n\t\t// if we have an oninput prop already change it to oninputCapture\n\t\tif (lowerCased === 'oninput') {\n\t\t\ti = lowerCased;\n\t\t\tif (normalizedProps[i]) {\n\t\t\t\ti = 'oninputCapture';\n\t\t\t}\n\t\t}\n\n\t\tnormalizedProps[i] = value;\n\t}\n\n\tif (type == 'select') {\n\t\t// Add support for array select values: \n\t\tif (normalizedProps.multiple && Array.isArray(normalizedProps.value)) {\n\t\t\t// forEach() always returns undefined, which we abuse here to unset the value prop.\n\t\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\t\tchild.props.selected =\n\t\t\t\t\tnormalizedProps.value.indexOf(child.props.value) != -1;\n\t\t\t});\n\t\t}\n\n\t\t// Adding support for defaultValue in select tag\n\t\tif (normalizedProps.defaultValue != null) {\n\t\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\t\tif (normalizedProps.multiple) {\n\t\t\t\t\tchild.props.selected =\n\t\t\t\t\t\tnormalizedProps.defaultValue.indexOf(child.props.value) != -1;\n\t\t\t\t} else {\n\t\t\t\t\tchild.props.selected =\n\t\t\t\t\t\tnormalizedProps.defaultValue == child.props.value;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tif (props.class && !props.className) {\n\t\tnormalizedProps.class = props.class;\n\t\tObject.defineProperty(\n\t\t\tnormalizedProps,\n\t\t\t'className',\n\t\t\tclassNameDescriptorNonEnumberable\n\t\t);\n\t} else if (props.className) {\n\t\tnormalizedProps.class = normalizedProps.className = props.className;\n\t}\n\n\tvnode.props = normalizedProps;\n}\n\nlet oldVNodeHook = options.vnode;\noptions.vnode = vnode => {\n\t// only normalize props on Element nodes\n\tif (typeof vnode.type === 'string') {\n\t\thandleDomVNode(vnode);\n\t}\n\n\tvnode.$$typeof = REACT_ELEMENT_TYPE;\n\n\tif (oldVNodeHook) oldVNodeHook(vnode);\n};\n\n// Only needed for react-relay\nlet currentComponent;\nconst oldBeforeRender = options._render;\noptions._render = function (vnode) {\n\tif (oldBeforeRender) {\n\t\toldBeforeRender(vnode);\n\t}\n\tcurrentComponent = vnode._component;\n};\n\nconst oldDiffed = options.diffed;\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.diffed = function (vnode) {\n\tif (oldDiffed) {\n\t\toldDiffed(vnode);\n\t}\n\n\tconst props = vnode.props;\n\tconst dom = vnode._dom;\n\n\tif (\n\t\tdom != null &&\n\t\tvnode.type === 'textarea' &&\n\t\t'value' in props &&\n\t\tprops.value !== dom.value\n\t) {\n\t\tdom.value = props.value == null ? '' : props.value;\n\t}\n\n\tcurrentComponent = null;\n};\n\n// This is a very very private internal function for React it\n// is used to sort-of do runtime dependency injection.\nexport const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {\n\tReactCurrentDispatcher: {\n\t\tcurrent: {\n\t\t\treadContext(context) {\n\t\t\t\treturn currentComponent._globalContext[context._id].props.value;\n\t\t\t},\n\t\t\tuseCallback,\n\t\t\tuseContext,\n\t\t\tuseDebugValue,\n\t\t\tuseDeferredValue,\n\t\t\tuseEffect,\n\t\t\tuseId,\n\t\t\tuseImperativeHandle,\n\t\t\tuseInsertionEffect,\n\t\t\tuseLayoutEffect,\n\t\t\tuseMemo,\n\t\t\t// useMutableSource, // experimental-only and replaced by uSES, likely not worth supporting\n\t\t\tuseReducer,\n\t\t\tuseRef,\n\t\t\tuseState,\n\t\t\tuseSyncExternalStore,\n\t\t\tuseTransition\n\t\t}\n\t}\n};\n","import {\n\tcreateElement,\n\trender as preactRender,\n\tcloneElement as preactCloneElement,\n\tcreateRef,\n\tComponent,\n\tcreateContext,\n\tFragment,\n\toptions\n} from 'preact';\nimport {\n\tuseState,\n\tuseId,\n\tuseReducer,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue\n} from 'preact/hooks';\nimport {\n\tuseInsertionEffect,\n\tstartTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tuseTransition\n} from './hooks';\nimport { PureComponent } from './PureComponent';\nimport { memo } from './memo';\nimport { forwardRef } from './forwardRef';\nimport { Children } from './Children';\nimport { Suspense, lazy } from './suspense';\nimport { SuspenseList } from './suspense-list';\nimport { createPortal } from './portals';\nimport {\n\thydrate,\n\trender,\n\tREACT_ELEMENT_TYPE,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n} from './render';\n\nconst version = '18.3.1'; // trick libraries to think we are react\n\n/**\n * Legacy version of createElement.\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor\n */\nfunction createFactory(type) {\n\treturn createElement.bind(null, type);\n}\n\n/**\n * Check if the passed element is a valid (p)react node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isValidElement(element) {\n\treturn !!element && element.$$typeof === REACT_ELEMENT_TYPE;\n}\n\n/**\n * Check if the passed element is a Fragment node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isFragment(element) {\n\treturn isValidElement(element) && element.type === Fragment;\n}\n\n/**\n * Check if the passed element is a Memo node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isMemo(element) {\n\treturn (\n\t\t!!element &&\n\t\ttypeof element.displayName == 'string' &&\n\t\telement.displayName.indexOf('Memo(') == 0\n\t);\n}\n\n/**\n * Wrap `cloneElement` to abort if the passed element is not a valid element and apply\n * all vnode normalizations.\n * @param {import('./internal').VNode} element The vnode to clone\n * @param {object} props Props to add when cloning\n * @param {Array} rest Optional component children\n */\nfunction cloneElement(element) {\n\tif (!isValidElement(element)) return element;\n\treturn preactCloneElement.apply(null, arguments);\n}\n\n/**\n * Remove a component tree from the DOM, including state and event handlers.\n * @param {import('./internal').PreactElement} container\n * @returns {boolean}\n */\nfunction unmountComponentAtNode(container) {\n\tif (container._children) {\n\t\tpreactRender(null, container);\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Get the matching DOM node for a component\n * @param {import('./internal').Component} component\n * @returns {import('./internal').PreactElement | null}\n */\nfunction findDOMNode(component) {\n\treturn (\n\t\t(component &&\n\t\t\t(component.base || (component.nodeType === 1 && component))) ||\n\t\tnull\n\t);\n}\n\n/**\n * Deprecated way to control batched rendering inside the reconciler, but we\n * already schedule in batches inside our rendering code\n * @template Arg\n * @param {(arg: Arg) => void} callback function that triggers the updated\n * @param {Arg} [arg] Optional argument that can be passed to the callback\n */\n// eslint-disable-next-line camelcase\nconst unstable_batchedUpdates = (callback, arg) => callback(arg);\n\n/**\n * In React, `flushSync` flushes the entire tree and forces a rerender.\n * @template Arg\n * @template Result\n * @param {(arg: Arg) => Result} callback function that runs before the flush\n * @param {Arg} [arg] Optional argument that can be passed to the callback\n * @returns\n */\nconst flushSync = (callback, arg) => {\n\tconst prevDebounce = options.debounceRendering;\n\toptions.debounceRendering = cb => cb();\n\tconst res = callback(arg);\n\toptions.debounceRendering = prevDebounce;\n\treturn res;\n};\n\n// compat to react-is\nexport const isElement = isValidElement;\n\nexport * from 'preact/hooks';\nexport {\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\tisFragment,\n\tisMemo,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tflushSync,\n\tuseInsertionEffect,\n\tstartTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tuseTransition,\n\t// eslint-disable-next-line camelcase\n\tunstable_batchedUpdates,\n\tFragment as StrictMode,\n\tSuspense,\n\tSuspenseList,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n\n// React copies the named exports to the default one.\nexport default {\n\tuseState,\n\tuseId,\n\tuseReducer,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseInsertionEffect,\n\tuseTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tstartTransition,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\tisElement,\n\tisFragment,\n\tisMemo,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tflushSync,\n\tunstable_batchedUpdates,\n\tStrictMode: Fragment,\n\tSuspense,\n\tSuspenseList,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n"],"names":["assign","obj","props","i","shallowDiffers","a","b","useSyncExternalStore","subscribe","getSnapshot","value","_useState","useState","_instance","__","_getSnapshot","forceUpdate","useLayoutEffect","didSnapshotChange","useEffect","inst","x","y","error","startTransition","cb","useDeferredValue","val","useTransition","useInsertionEffect","PureComponent","p","c","this","context","memo","comparer","shouldUpdate","nextProps","ref","current","Memoed","shouldComponentUpdate","createElement","displayName","name","__f","prototype","isReactComponent","type","Component","isPureReactComponent","state","oldDiffHook","options","__b","vnode","REACT_FORWARD_SYMBOL","Symbol","for","forwardRef","fn","Forwarded","clone","$$typeof","render","mapFn","children","toChildArray","map","Children","forEach","count","length","only","normalized","toArray","oldCatchError","__e","newVNode","oldVNode","errorInfo","then","component","__c","__k","oldUnmount","unmount","detachedClone","detachedParent","parentDom","__H","effect","__P","child","removeOriginal","originalParent","__v","appendChild","Suspense","__u","_suspenders","suspended","__a","lazy","loader","prom","resolved","Lazy","exports","default","e","SuspenseList","_next","_map","__z","__R","promise","suspendingVNode","suspendingComponent","push","resolve","onResolved","onSuspensionComplete","originalParentDom","suspendedVNode","__O","setState","pop","componentWillUnmount","document","detachedComponent","fallback","Fragment","list","node","delete","revealOrder","size","ContextProvider","getChildContext","Portal","_this","container","_container","_temp","root","__m","nodeType","parentNode","childNodes","contains","namespaceURI","insertBefore","before","removeChild","splice","indexOf","createPortal","el","containerInfo","delegated","get","unsuspend","wrappedUnsuspend","Map","reverse","set","componentDidUpdate","componentDidMount","REACT_ELEMENT_TYPE","CAMEL_PROPS","ON_ANI","CAMEL_REPLACE","IS_DOM","onChangeInputType","test","parent","callback","textContent","preactRender","hydrate","preactHydrate","key","Object","defineProperty","configurable","v","writable","oldEventHook","event","persist","isPropagationStopped","cancelBubble","isDefaultPrevented","defaultPrevented","nativeEvent","currentComponent","classNameDescriptorNonEnumberable","class","oldVNodeHook","normalizedProps","isNonDashedType","lowerCased","toLowerCase","replace","undefined","multiple","Array","isArray","selected","defaultValue","className","handleDomVNode","oldBeforeRender","__r","oldDiffed","diffed","dom","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentDispatcher","readContext","__n","useCallback","useContext","useDebugValue","useId","useImperativeHandle","useMemo","useReducer","useRef","version","createFactory","bind","isValidElement","element","isFragment","isMemo","cloneElement","preactCloneElement","apply","arguments","unmountComponentAtNode","findDOMNode","base","unstable_batchedUpdates","arg","flushSync","prevDebounce","debounceRendering","res","isElement","createContext","createRef","StrictMode"],"mappings":"2fAOgB,SAAAA,EAAOC,EAAKC,GAC3B,IAAK,IAAIC,KAAKD,EA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M,OAAAA,EACAH,oBAAAA,EACAC,QAAAA,EACAL,YAAAA,EACAC,WAAAA,EACAC,cAAAA,EACAM,QAnKe,SAoKfjK,SAAAA,EACAL,OAAAA,GACAoH,QAAAA,GACA6D,uBAAAA,GACApF,aAAAA,EACAnH,cAAAA,EACAiN,cAAAA,EACApB,cAAAA,GACAM,aAAAA,GACAe,UAAAA,EACAxH,SAAAA,EACAqG,eAAAA,GACAiB,UAAAA,GACAf,WAAAA,GACAC,OAAAA,GACAM,YAAAA,GACAjM,UAAAA,EACApB,cAAAA,EACAK,KAAAA,EACAyB,WAAAA,EACA2L,UAAAA,GACAF,wBAAAA,GACAS,WAAYzH,EACZlC,SAAAA,EACAa,aAAAA,EACAR,KAAAA,EACAmH,mDAAAA"} \ No newline at end of file diff --git a/node_modules/preact/compat/dist/compat.umd.js b/node_modules/preact/compat/dist/compat.umd.js new file mode 100644 index 0000000000000000000000000000000000000000..24a9f4c0b815ca111ed72cae17a3881e91f3b618 --- /dev/null +++ b/node_modules/preact/compat/dist/compat.umd.js @@ -0,0 +1,2 @@ +!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("preact"),require("preact/hooks")):"function"==typeof define&&define.amd?define(["exports","preact","preact/hooks"],t):t((n||self).preactCompat={},n.preact,n.preactHooks)}(this,function(n,t,e){function r(n,t){for(var e in t)n[e]=t[e];return n}function u(n,t){for(var e in n)if("__source"!==e&&!(e in t))return!0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return!0;return!1}function o(n,t){var r=t(),u=e.useState({t:{__:r,u:t}}),o=u[0].t,c=u[1];return e.useLayoutEffect(function(){o.__=r,o.u=t,i(o)&&c({t:o})},[n,r,t]),e.useEffect(function(){return i(o)&&c({t:o}),n(function(){i(o)&&c({t:o})})},[n]),r}function i(n){try{return!((t=n.__)===(e=n.u())&&(0!==t||1/t==1/e)||t!=t&&e!=e)}catch(n){return!0}var t,e}function c(n){n()}function f(n){return n}function l(){return[!1,c]}var a=e.useLayoutEffect;function s(n,t){this.props=n,this.context=t}function h(n,e){function r(n){var t=this.props.ref;return t!=n.ref&&t&&("function"==typeof t?t(null):t.current=null),e?!e(this.props,n)||t!=n.ref:u(this.props,n)}function o(e){return this.shouldComponentUpdate=r,t.createElement(n,e)}return o.displayName="Memo("+(n.displayName||n.name)+")",o.__f=o.prototype.isReactComponent=!0,o.type=n,o}(s.prototype=new t.Component).isPureReactComponent=!0,s.prototype.shouldComponentUpdate=function(n,t){return u(this.props,n)||u(this.state,t)};var d=t.options.__b;t.options.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),d&&d(n)};var v="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function p(n){function t(t){var e=r({},t);return delete e.ref,n(e,t.ref||null)}return t.$$typeof=v,t.render=n,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var m=function(n,e){return null==n?null:t.toChildArray(t.toChildArray(n).map(e))},b={map:m,forEach:m,count:function(n){return n?t.toChildArray(n).length:0},only:function(n){var e=t.toChildArray(n);if(1!==e.length)throw"Children.only";return e[0]},toArray:t.toChildArray},y=t.options.__e;t.options.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);y(n,t,e,r)};var _=t.options.unmount;function g(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c()}),n.__c.__H=null),null!=(n=r({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c.__e=!0,n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return g(n,t,e)})),n}function S(n,t,e){return n&&e&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return S(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.appendChild(n.__e),n.__c.__e=!0,n.__c.__P=e)),n}function E(){this.__u=0,this.o=null,this.__b=null}function C(n){var t=n.__&&n.__.__c;return t&&t.__a&&t.__a(n)}function O(n){var e,r,u,o=null;function i(i){if(e||(e=n()).then(function(n){n&&(o=n.default||n),u=!0},function(n){r=n,u=!0}),r)throw r;if(!u)throw e;return o?t.createElement(o,i):null}return i.displayName="Lazy",i.__f=!0,i}function R(){this.i=null,this.l=null}t.options.unmount=function(n){var t=n.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&n.__u&&(n.type=null),_&&_(n)},(E.prototype=new t.Component).__c=function(n,t){var e=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(e);var u=C(r.__v),o=!1,i=function(){o||r.__z||(o=!0,e.__R=null,u?u(f):f())};e.__R=i;var c=e.__P;e.__P=null;var f=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=S(n,n.__c.__P,n.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=c,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i)},E.prototype.componentWillUnmount=function(){this.o=[]},E.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),u=this.__v.__k[0].__c;this.__v.__k[0]=g(this.__b,r,u.__O=u.__P)}this.__b=null}var o=e.__a&&t.createElement(t.Fragment,null,n.fallback);return o&&(o.__u&=-33),[t.createElement(t.Fragment,null,e.__a?null:n.children),o]};var x=function(n,t,e){if(++e[1]===e[0]&&n.l.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.l.size))for(e=n.i;e;){for(;e.length>3;)e.pop()();if(e[1]>>1,1),e.h.removeChild(n)}}}t.render(t.createElement(w,{context:e.context},n.__v),e.v)}function k(n,e){var r=t.createElement(j,{__v:n,h:e});return r.containerInfo=e,r}(R.prototype=new t.Component).__a=function(n){var t=this,e=C(t.__v),r=t.l.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),x(t,n,r)):u()};e?e(o):o()}},R.prototype.render=function(n){this.i=null,this.l=new Map;var e=t.toChildArray(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&e.reverse();for(var r=e.length;r--;)this.l.set(e[r],this.i=[1,0,this.i]);return n.children},R.prototype.componentDidUpdate=R.prototype.componentDidMount=function(){var n=this;this.l.forEach(function(t,e){x(n,e,t)})};var I="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,T=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,M=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,N=/[A-Z0-9]/g,A="undefined"!=typeof document,D=function(n){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(n)};function L(n,e,r){return null==e.__k&&(e.textContent=""),t.render(n,e),"function"==typeof r&&r(),n?n.__c:null}function U(n,e,r){return t.hydrate(n,e),"function"==typeof r&&r(),n?n.__c:null}t.Component.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(t.Component.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t})}})});var F=t.options.event;t.options.event=function(n){return F&&(n=F(n)),n.persist=function(){},n.isPropagationStopped=function(){return this.cancelBubble},n.isDefaultPrevented=function(){return this.defaultPrevented},n.nativeEvent=n};var V,W={configurable:!0,get:function(){return this.class}},P=t.options.vnode;t.options.vnode=function(n){"string"==typeof n.type&&function(n){var e=n.props,r=n.type,u={},o=-1==r.indexOf("-");for(var i in e){var c=e[i];if(!("value"===i&&"defaultValue"in e&&null==c||A&&"children"===i&&"noscript"===r||"class"===i||"className"===i)){var f=i.toLowerCase();"defaultValue"===i&&"value"in e&&null==e.value?i="value":"download"===i&&!0===c?c="":"translate"===f&&"no"===c?c=!1:"o"===f[0]&&"n"===f[1]?"ondoubleclick"===f?i="ondblclick":"onchange"!==f||"input"!==r&&"textarea"!==r||D(e.type)?"onfocus"===f?i="onfocusin":"onblur"===f?i="onfocusout":M.test(i)&&(i=f):f=i="oninput":o&&T.test(i)?i=i.replace(N,"-$&").toLowerCase():null===c&&(c=void 0),"oninput"===f&&u[i=f]&&(i="oninputCapture"),u[i]=c}}"select"==r&&(u.multiple&&Array.isArray(u.value)&&(u.value=t.toChildArray(e.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value)})),null!=u.defaultValue&&(u.value=t.toChildArray(e.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value}))),e.class&&!e.className?(u.class=e.class,Object.defineProperty(u,"className",W)):e.className&&(u.class=u.className=e.className),n.props=u}(n),n.$$typeof=I,P&&P(n)};var z=t.options.__r;t.options.__r=function(n){z&&z(n),V=n.__c};var B=t.options.diffed;t.options.diffed=function(n){B&&B(n);var t=n.props,e=n.__e;null!=e&&"textarea"===n.type&&"value"in t&&t.value!==e.value&&(e.value=null==t.value?"":t.value),V=null};var H={ReactCurrentDispatcher:{current:{readContext:function(n){return V.__n[n.__c].props.value},useCallback:e.useCallback,useContext:e.useContext,useDebugValue:e.useDebugValue,useDeferredValue:f,useEffect:e.useEffect,useId:e.useId,useImperativeHandle:e.useImperativeHandle,useInsertionEffect:a,useLayoutEffect:e.useLayoutEffect,useMemo:e.useMemo,useReducer:e.useReducer,useRef:e.useRef,useState:e.useState,useSyncExternalStore:o,useTransition:l}}},q="18.3.1";function Z(n){return t.createElement.bind(null,n)}function Y(n){return!!n&&n.$$typeof===I}function $(n){return Y(n)&&n.type===t.Fragment}function G(n){return!!n&&"string"==typeof n.displayName&&0==n.displayName.indexOf("Memo(")}function J(n){return Y(n)?t.cloneElement.apply(null,arguments):n}function K(n){return!!n.__k&&(t.render(null,n),!0)}function Q(n){return n&&(n.base||1===n.nodeType&&n)||null}var X=function(n,t){return n(t)},nn=function(n,e){var r=t.options.debounceRendering;t.options.debounceRendering=function(n){return n()};var u=n(e);return t.options.debounceRendering=r,u},tn=Y,en={useState:e.useState,useId:e.useId,useReducer:e.useReducer,useEffect:e.useEffect,useLayoutEffect:e.useLayoutEffect,useInsertionEffect:a,useTransition:l,useDeferredValue:f,useSyncExternalStore:o,startTransition:c,useRef:e.useRef,useImperativeHandle:e.useImperativeHandle,useMemo:e.useMemo,useCallback:e.useCallback,useContext:e.useContext,useDebugValue:e.useDebugValue,version:q,Children:b,render:L,hydrate:U,unmountComponentAtNode:K,createPortal:k,createElement:t.createElement,createContext:t.createContext,createFactory:Z,cloneElement:J,createRef:t.createRef,Fragment:t.Fragment,isValidElement:Y,isElement:tn,isFragment:$,isMemo:G,findDOMNode:Q,Component:t.Component,PureComponent:s,memo:h,forwardRef:p,flushSync:nn,unstable_batchedUpdates:X,StrictMode:t.Fragment,Suspense:E,SuspenseList:R,lazy:O,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:H};Object.defineProperty(n,"Component",{enumerable:!0,get:function(){return t.Component}}),Object.defineProperty(n,"Fragment",{enumerable:!0,get:function(){return t.Fragment}}),Object.defineProperty(n,"StrictMode",{enumerable:!0,get:function(){return t.Fragment}}),Object.defineProperty(n,"createContext",{enumerable:!0,get:function(){return t.createContext}}),Object.defineProperty(n,"createElement",{enumerable:!0,get:function(){return t.createElement}}),Object.defineProperty(n,"createRef",{enumerable:!0,get:function(){return t.createRef}}),n.Children=b,n.PureComponent=s,n.Suspense=E,n.SuspenseList=R,n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H,n.cloneElement=J,n.createFactory=Z,n.createPortal=k,n.default=en,n.findDOMNode=Q,n.flushSync=nn,n.forwardRef=p,n.hydrate=U,n.isElement=tn,n.isFragment=$,n.isMemo=G,n.isValidElement=Y,n.lazy=O,n.memo=h,n.render=L,n.startTransition=c,n.unmountComponentAtNode=K,n.unstable_batchedUpdates=X,n.useDeferredValue=f,n.useInsertionEffect=a,n.useSyncExternalStore=o,n.useTransition=l,n.version=q,Object.keys(e).forEach(function(t){"default"===t||n.hasOwnProperty(t)||Object.defineProperty(n,t,{enumerable:!0,get:function(){return e[t]}})})}); +//# sourceMappingURL=compat.umd.js.map diff --git a/node_modules/preact/compat/dist/compat.umd.js.map b/node_modules/preact/compat/dist/compat.umd.js.map new file mode 100644 index 0000000000000000000000000000000000000000..85815b8c20b8e64cf1013fa78628a1387c7c4476 --- /dev/null +++ b/node_modules/preact/compat/dist/compat.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"compat.umd.js","sources":["../src/util.js","../src/hooks.js","../src/PureComponent.js","../src/memo.js","../src/forwardRef.js","../src/Children.js","../src/suspense.js","../src/suspense-list.js","../../src/constants.js","../src/portals.js","../src/render.js","../src/index.js"],"sourcesContent":["/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Check if two objects have a different shape\n * @param {object} a\n * @param {object} b\n * @returns {boolean}\n */\nexport function shallowDiffers(a, b) {\n\tfor (let i in a) if (i !== '__source' && !(i in b)) return true;\n\tfor (let i in b) if (i !== '__source' && a[i] !== b[i]) return true;\n\treturn false;\n}\n\n/**\n * Check if two values are the same value\n * @param {*} x\n * @param {*} y\n * @returns {boolean}\n */\nexport function is(x, y) {\n\treturn (x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\n","import { useState, useLayoutEffect, useEffect } from 'preact/hooks';\nimport { is } from './util';\n\n/**\n * This is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84\n * on a high level this cuts out the warnings, ... and attempts a smaller implementation\n * @typedef {{ _value: any; _getSnapshot: () => any }} Store\n */\nexport function useSyncExternalStore(subscribe, getSnapshot) {\n\tconst value = getSnapshot();\n\n\t/**\n\t * @typedef {{ _instance: Store }} StoreRef\n\t * @type {[StoreRef, (store: StoreRef) => void]}\n\t */\n\tconst [{ _instance }, forceUpdate] = useState({\n\t\t_instance: { _value: value, _getSnapshot: getSnapshot }\n\t});\n\n\tuseLayoutEffect(() => {\n\t\t_instance._value = value;\n\t\t_instance._getSnapshot = getSnapshot;\n\n\t\tif (didSnapshotChange(_instance)) {\n\t\t\tforceUpdate({ _instance });\n\t\t}\n\t}, [subscribe, value, getSnapshot]);\n\n\tuseEffect(() => {\n\t\tif (didSnapshotChange(_instance)) {\n\t\t\tforceUpdate({ _instance });\n\t\t}\n\n\t\treturn subscribe(() => {\n\t\t\tif (didSnapshotChange(_instance)) {\n\t\t\t\tforceUpdate({ _instance });\n\t\t\t}\n\t\t});\n\t}, [subscribe]);\n\n\treturn value;\n}\n\n/** @type {(inst: Store) => boolean} */\nfunction didSnapshotChange(inst) {\n\ttry {\n\t\treturn !is(inst._value, inst._getSnapshot());\n\t} catch (error) {\n\t\treturn true;\n\t}\n}\n\nexport function startTransition(cb) {\n\tcb();\n}\n\nexport function useDeferredValue(val) {\n\treturn val;\n}\n\nexport function useTransition() {\n\treturn [false, startTransition];\n}\n\n// TODO: in theory this should be done after a VNode is diffed as we want to insert\n// styles/... before it attaches\nexport const useInsertionEffect = useLayoutEffect;\n","import { Component } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Component class with a predefined `shouldComponentUpdate` implementation\n */\nexport function PureComponent(p, c) {\n\tthis.props = p;\n\tthis.context = c;\n}\nPureComponent.prototype = new Component();\n// Some third-party libraries check if this property is present\nPureComponent.prototype.isPureReactComponent = true;\nPureComponent.prototype.shouldComponentUpdate = function (props, state) {\n\treturn shallowDiffers(this.props, props) || shallowDiffers(this.state, state);\n};\n","import { createElement } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Memoize a component, so that it only updates when the props actually have\n * changed. This was previously known as `React.pure`.\n * @param {import('./internal').FunctionComponent} c functional component\n * @param {(prev: object, next: object) => boolean} [comparer] Custom equality function\n * @returns {import('./internal').FunctionComponent}\n */\nexport function memo(c, comparer) {\n\tfunction shouldUpdate(nextProps) {\n\t\tlet ref = this.props.ref;\n\t\tif (ref != nextProps.ref && ref) {\n\t\t\ttypeof ref == 'function' ? ref(null) : (ref.current = null);\n\t\t}\n\n\t\treturn comparer\n\t\t\t? !comparer(this.props, nextProps) || ref != nextProps.ref\n\t\t\t: shallowDiffers(this.props, nextProps);\n\t}\n\n\tfunction Memoed(props) {\n\t\tthis.shouldComponentUpdate = shouldUpdate;\n\t\treturn createElement(c, props);\n\t}\n\tMemoed.displayName = 'Memo(' + (c.displayName || c.name) + ')';\n\tMemoed._forwarded = Memoed.prototype.isReactComponent = true;\n\tMemoed.type = c;\n\treturn Memoed;\n}\n","import { options } from 'preact';\nimport { assign } from './util';\n\nlet oldDiffHook = options._diff;\noptions._diff = vnode => {\n\tif (vnode.type && vnode.type._forwarded && vnode.ref) {\n\t\tvnode.props.ref = vnode.ref;\n\t\tvnode.ref = null;\n\t}\n\tif (oldDiffHook) oldDiffHook(vnode);\n};\n\nexport const REACT_FORWARD_SYMBOL =\n\t(typeof Symbol != 'undefined' &&\n\t\tSymbol.for &&\n\t\tSymbol.for('react.forward_ref')) ||\n\t0xf47;\n\n/**\n * Pass ref down to a child. This is mainly used in libraries with HOCs that\n * wrap components. Using `forwardRef` there is an easy way to get a reference\n * of the wrapped component instead of one of the wrapper itself.\n * @param {import('./index').ForwardFn} fn\n * @returns {import('./internal').FunctionComponent}\n */\nexport function forwardRef(fn) {\n\tfunction Forwarded(props) {\n\t\tlet clone = assign({}, props);\n\t\tdelete clone.ref;\n\t\treturn fn(clone, props.ref || null);\n\t}\n\n\t// mobx-react checks for this being present\n\tForwarded.$$typeof = REACT_FORWARD_SYMBOL;\n\t// mobx-react heavily relies on implementation details.\n\t// It expects an object here with a `render` property,\n\t// and prototype.render will fail. Without this\n\t// mobx-react throws.\n\tForwarded.render = fn;\n\n\tForwarded.prototype.isReactComponent = Forwarded._forwarded = true;\n\tForwarded.displayName = 'ForwardRef(' + (fn.displayName || fn.name) + ')';\n\treturn Forwarded;\n}\n","import { toChildArray } from 'preact';\n\nconst mapFn = (children, fn) => {\n\tif (children == null) return null;\n\treturn toChildArray(toChildArray(children).map(fn));\n};\n\n// This API is completely unnecessary for Preact, so it's basically passthrough.\nexport const Children = {\n\tmap: mapFn,\n\tforEach: mapFn,\n\tcount(children) {\n\t\treturn children ? toChildArray(children).length : 0;\n\t},\n\tonly(children) {\n\t\tconst normalized = toChildArray(children);\n\t\tif (normalized.length !== 1) throw 'Children.only';\n\t\treturn normalized[0];\n\t},\n\ttoArray: toChildArray\n};\n","import { Component, createElement, options, Fragment } from 'preact';\nimport { MODE_HYDRATE } from '../../src/constants';\nimport { assign } from './util';\n\nconst oldCatchError = options._catchError;\noptions._catchError = function (error, newVNode, oldVNode, errorInfo) {\n\tif (error.then) {\n\t\t/** @type {import('./internal').Component} */\n\t\tlet component;\n\t\tlet vnode = newVNode;\n\n\t\tfor (; (vnode = vnode._parent); ) {\n\t\t\tif ((component = vnode._component) && component._childDidSuspend) {\n\t\t\t\tif (newVNode._dom == null) {\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t}\n\t\t\t\t// Don't call oldCatchError if we found a Suspense\n\t\t\t\treturn component._childDidSuspend(error, newVNode);\n\t\t\t}\n\t\t}\n\t}\n\toldCatchError(error, newVNode, oldVNode, errorInfo);\n};\n\nconst oldUnmount = options.unmount;\noptions.unmount = function (vnode) {\n\t/** @type {import('./internal').Component} */\n\tconst component = vnode._component;\n\tif (component) component._unmounted = true;\n\tif (component && component._onResolve) {\n\t\tcomponent._onResolve();\n\t}\n\n\t// if the component is still hydrating\n\t// most likely it is because the component is suspended\n\t// we set the vnode.type as `null` so that it is not a typeof function\n\t// so the unmount will remove the vnode._dom\n\tif (component && vnode._flags & MODE_HYDRATE) {\n\t\tvnode.type = null;\n\t}\n\n\tif (oldUnmount) oldUnmount(vnode);\n};\n\nfunction detachedClone(vnode, detachedParent, parentDom) {\n\tif (vnode) {\n\t\tif (vnode._component && vnode._component.__hooks) {\n\t\t\tvnode._component.__hooks._list.forEach(effect => {\n\t\t\t\tif (typeof effect._cleanup == 'function') effect._cleanup();\n\t\t\t});\n\n\t\t\tvnode._component.__hooks = null;\n\t\t}\n\n\t\tvnode = assign({}, vnode);\n\t\tif (vnode._component != null) {\n\t\t\tif (vnode._component._parentDom === parentDom) {\n\t\t\t\tvnode._component._parentDom = detachedParent;\n\t\t\t}\n\n\t\t\tvnode._component._force = true;\n\n\t\t\tvnode._component = null;\n\t\t}\n\n\t\tvnode._children =\n\t\t\tvnode._children &&\n\t\t\tvnode._children.map(child =>\n\t\t\t\tdetachedClone(child, detachedParent, parentDom)\n\t\t\t);\n\t}\n\n\treturn vnode;\n}\n\nfunction removeOriginal(vnode, detachedParent, originalParent) {\n\tif (vnode && originalParent) {\n\t\tvnode._original = null;\n\t\tvnode._children =\n\t\t\tvnode._children &&\n\t\t\tvnode._children.map(child =>\n\t\t\t\tremoveOriginal(child, detachedParent, originalParent)\n\t\t\t);\n\n\t\tif (vnode._component) {\n\t\t\tif (vnode._component._parentDom === detachedParent) {\n\t\t\t\tif (vnode._dom) {\n\t\t\t\t\toriginalParent.appendChild(vnode._dom);\n\t\t\t\t}\n\t\t\t\tvnode._component._force = true;\n\t\t\t\tvnode._component._parentDom = originalParent;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn vnode;\n}\n\n// having custom inheritance instead of a class here saves a lot of bytes\nexport function Suspense() {\n\t// we do not call super here to golf some bytes...\n\tthis._pendingSuspensionCount = 0;\n\tthis._suspenders = null;\n\tthis._detachOnNextRender = null;\n}\n\n// Things we do here to save some bytes but are not proper JS inheritance:\n// - call `new Component()` as the prototype\n// - do not set `Suspense.prototype.constructor` to `Suspense`\nSuspense.prototype = new Component();\n\n/**\n * @this {import('./internal').SuspenseComponent}\n * @param {Promise} promise The thrown promise\n * @param {import('./internal').VNode} suspendingVNode The suspending component\n */\nSuspense.prototype._childDidSuspend = function (promise, suspendingVNode) {\n\tconst suspendingComponent = suspendingVNode._component;\n\n\t/** @type {import('./internal').SuspenseComponent} */\n\tconst c = this;\n\n\tif (c._suspenders == null) {\n\t\tc._suspenders = [];\n\t}\n\tc._suspenders.push(suspendingComponent);\n\n\tconst resolve = suspended(c._vnode);\n\n\tlet resolved = false;\n\tconst onResolved = () => {\n\t\tif (resolved || c._unmounted) return;\n\n\t\tresolved = true;\n\t\tsuspendingComponent._onResolve = null;\n\n\t\tif (resolve) {\n\t\t\tresolve(onSuspensionComplete);\n\t\t} else {\n\t\t\tonSuspensionComplete();\n\t\t}\n\t};\n\n\tsuspendingComponent._onResolve = onResolved;\n\n\t// Store and null _parentDom to prevent setState/forceUpdate from\n\t// scheduling renders while suspended. Render would be a no-op anyway\n\t// since renderComponent checks _parentDom, but this avoids queue churn.\n\tconst originalParentDom = suspendingComponent._parentDom;\n\tsuspendingComponent._parentDom = null;\n\n\tconst onSuspensionComplete = () => {\n\t\tif (!--c._pendingSuspensionCount) {\n\t\t\t// If the suspension was during hydration we don't need to restore the\n\t\t\t// suspended children into the _children array\n\t\t\tif (c.state._suspended) {\n\t\t\t\tconst suspendedVNode = c.state._suspended;\n\t\t\t\tc._vnode._children[0] = removeOriginal(\n\t\t\t\t\tsuspendedVNode,\n\t\t\t\t\tsuspendedVNode._component._parentDom,\n\t\t\t\t\tsuspendedVNode._component._originalParentDom\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tc.setState({ _suspended: (c._detachOnNextRender = null) });\n\n\t\t\tlet suspended;\n\t\t\twhile ((suspended = c._suspenders.pop())) {\n\t\t\t\t// Restore _parentDom before forceUpdate so render can proceed\n\t\t\t\tsuspended._parentDom = originalParentDom;\n\t\t\t\tsuspended.forceUpdate();\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * We do not set `suspended: true` during hydration because we want the actual markup\n\t * to remain on screen and hydrate it when the suspense actually gets resolved.\n\t * While in non-hydration cases the usual fallback -> component flow would occour.\n\t */\n\tif (\n\t\t!c._pendingSuspensionCount++ &&\n\t\t!(suspendingVNode._flags & MODE_HYDRATE)\n\t) {\n\t\tc.setState({ _suspended: (c._detachOnNextRender = c._vnode._children[0]) });\n\t}\n\tpromise.then(onResolved, onResolved);\n};\n\nSuspense.prototype.componentWillUnmount = function () {\n\tthis._suspenders = [];\n};\n\n/**\n * @this {import('./internal').SuspenseComponent}\n * @param {import('./internal').SuspenseComponent[\"props\"]} props\n * @param {import('./internal').SuspenseState} state\n */\nSuspense.prototype.render = function (props, state) {\n\tif (this._detachOnNextRender) {\n\t\t// When the Suspense's _vnode was created by a call to createVNode\n\t\t// (i.e. due to a setState further up in the tree)\n\t\t// it's _children prop is null, in this case we \"forget\" about the parked vnodes to detach\n\t\tif (this._vnode._children) {\n\t\t\tconst detachedParent = document.createElement('div');\n\t\t\tconst detachedComponent = this._vnode._children[0]._component;\n\t\t\tthis._vnode._children[0] = detachedClone(\n\t\t\t\tthis._detachOnNextRender,\n\t\t\t\tdetachedParent,\n\t\t\t\t(detachedComponent._originalParentDom = detachedComponent._parentDom)\n\t\t\t);\n\t\t}\n\n\t\tthis._detachOnNextRender = null;\n\t}\n\n\t// Wrap fallback tree in a VNode that prevents itself from being marked as aborting mid-hydration:\n\t/** @type {import('./internal').VNode} */\n\tconst fallback =\n\t\tstate._suspended && createElement(Fragment, null, props.fallback);\n\tif (fallback) fallback._flags &= ~MODE_HYDRATE;\n\n\treturn [\n\t\tcreateElement(Fragment, null, state._suspended ? null : props.children),\n\t\tfallback\n\t];\n};\n\n/**\n * Checks and calls the parent component's _suspended method, passing in the\n * suspended vnode. This is a way for a parent (e.g. SuspenseList) to get notified\n * that one of its children/descendants suspended.\n *\n * The parent MAY return a callback. The callback will get called when the\n * suspension resolves, notifying the parent of the fact.\n * Moreover, the callback gets function `unsuspend` as a parameter. The resolved\n * child descendant will not actually get unsuspended until `unsuspend` gets called.\n * This is a way for the parent to delay unsuspending.\n *\n * If the parent does not return a callback then the resolved vnode\n * gets unsuspended immediately when it resolves.\n *\n * @param {import('./internal').VNode} vnode\n * @returns {((unsuspend: () => void) => void)?}\n */\nexport function suspended(vnode) {\n\tlet component = vnode._parent && vnode._parent._component;\n\treturn component && component._suspended && component._suspended(vnode);\n}\n\nexport function lazy(loader) {\n\tlet prom;\n\tlet component = null;\n\tlet error;\n\tlet resolved;\n\n\tfunction Lazy(props) {\n\t\tif (!prom) {\n\t\t\tprom = loader();\n\t\t\tprom.then(\n\t\t\t\texports => {\n\t\t\t\t\tif (exports) {\n\t\t\t\t\t\tcomponent = exports.default || exports;\n\t\t\t\t\t}\n\t\t\t\t\tresolved = true;\n\t\t\t\t},\n\t\t\t\te => {\n\t\t\t\t\terror = e;\n\t\t\t\t\tresolved = true;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!resolved) {\n\t\t\tthrow prom;\n\t\t}\n\n\t\treturn component ? createElement(component, props) : null;\n\t}\n\n\tLazy.displayName = 'Lazy';\n\tLazy._forwarded = true;\n\treturn Lazy;\n}\n","import { Component, toChildArray } from 'preact';\nimport { suspended } from './suspense.js';\n\n// Indexes to linked list nodes (nodes are stored as arrays to save bytes).\nconst SUSPENDED_COUNT = 0;\nconst RESOLVED_COUNT = 1;\nconst NEXT_NODE = 2;\n\n// Having custom inheritance instead of a class here saves a lot of bytes.\nexport function SuspenseList() {\n\tthis._next = null;\n\tthis._map = null;\n}\n\n// Mark one of child's earlier suspensions as resolved.\n// Some pending callbacks may become callable due to this\n// (e.g. the last suspended descendant gets resolved when\n// revealOrder === 'together'). Process those callbacks as well.\nconst resolve = (list, child, node) => {\n\tif (++node[RESOLVED_COUNT] === node[SUSPENDED_COUNT]) {\n\t\t// The number a child (or any of its descendants) has been suspended\n\t\t// matches the number of times it's been resolved. Therefore we\n\t\t// mark the child as completely resolved by deleting it from ._map.\n\t\t// This is used to figure out when *all* children have been completely\n\t\t// resolved when revealOrder is 'together'.\n\t\tlist._map.delete(child);\n\t}\n\n\t// If revealOrder is falsy then we can do an early exit, as the\n\t// callbacks won't get queued in the node anyway.\n\t// If revealOrder is 'together' then also do an early exit\n\t// if all suspended descendants have not yet been resolved.\n\tif (\n\t\t!list.props.revealOrder ||\n\t\t(list.props.revealOrder[0] === 't' && list._map.size)\n\t) {\n\t\treturn;\n\t}\n\n\t// Walk the currently suspended children in order, calling their\n\t// stored callbacks on the way. Stop if we encounter a child that\n\t// has not been completely resolved yet.\n\tnode = list._next;\n\twhile (node) {\n\t\twhile (node.length > 3) {\n\t\t\tnode.pop()();\n\t\t}\n\t\tif (node[RESOLVED_COUNT] < node[SUSPENDED_COUNT]) {\n\t\t\tbreak;\n\t\t}\n\t\tlist._next = node = node[NEXT_NODE];\n\t}\n};\n\n// Things we do here to save some bytes but are not proper JS inheritance:\n// - call `new Component()` as the prototype\n// - do not set `Suspense.prototype.constructor` to `Suspense`\nSuspenseList.prototype = new Component();\n\nSuspenseList.prototype._suspended = function (child) {\n\tconst list = this;\n\tconst delegated = suspended(list._vnode);\n\n\tlet node = list._map.get(child);\n\tnode[SUSPENDED_COUNT]++;\n\n\treturn unsuspend => {\n\t\tconst wrappedUnsuspend = () => {\n\t\t\tif (!list.props.revealOrder) {\n\t\t\t\t// Special case the undefined (falsy) revealOrder, as there\n\t\t\t\t// is no need to coordinate a specific order or unsuspends.\n\t\t\t\tunsuspend();\n\t\t\t} else {\n\t\t\t\tnode.push(unsuspend);\n\t\t\t\tresolve(list, child, node);\n\t\t\t}\n\t\t};\n\t\tif (delegated) {\n\t\t\tdelegated(wrappedUnsuspend);\n\t\t} else {\n\t\t\twrappedUnsuspend();\n\t\t}\n\t};\n};\n\nSuspenseList.prototype.render = function (props) {\n\tthis._next = null;\n\tthis._map = new Map();\n\n\tconst children = toChildArray(props.children);\n\tif (props.revealOrder && props.revealOrder[0] === 'b') {\n\t\t// If order === 'backwards' (or, well, anything starting with a 'b')\n\t\t// then flip the child list around so that the last child will be\n\t\t// the first in the linked list.\n\t\tchildren.reverse();\n\t}\n\t// Build the linked list. Iterate through the children in reverse order\n\t// so that `_next` points to the first linked list node to be resolved.\n\tfor (let i = children.length; i--; ) {\n\t\t// Create a new linked list node as an array of form:\n\t\t// \t[suspended_count, resolved_count, next_node]\n\t\t// where suspended_count and resolved_count are numeric counters for\n\t\t// keeping track how many times a node has been suspended and resolved.\n\t\t//\n\t\t// Note that suspended_count starts from 1 instead of 0, so we can block\n\t\t// processing callbacks until componentDidMount has been called. In a sense\n\t\t// node is suspended at least until componentDidMount gets called!\n\t\t//\n\t\t// Pending callbacks are added to the end of the node:\n\t\t// \t[suspended_count, resolved_count, next_node, callback_0, callback_1, ...]\n\t\tthis._map.set(children[i], (this._next = [1, 0, this._next]));\n\t}\n\treturn props.children;\n};\n\nSuspenseList.prototype.componentDidUpdate =\n\tSuspenseList.prototype.componentDidMount = function () {\n\t\t// Iterate through all children after mounting for two reasons:\n\t\t// 1. As each node[SUSPENDED_COUNT] starts from 1, this iteration increases\n\t\t// each node[RELEASED_COUNT] by 1, therefore balancing the counters.\n\t\t// The nodes can now be completely consumed from the linked list.\n\t\t// 2. Handle nodes that might have gotten resolved between render and\n\t\t// componentDidMount.\n\t\tthis._map.forEach((node, child) => {\n\t\t\tresolve(this, child, node);\n\t\t});\n\t};\n","/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { createElement, render } from 'preact';\n\n/**\n * @param {import('../../src/index').RenderableProps<{ context: any }>} props\n */\nfunction ContextProvider(props) {\n\tthis.getChildContext = () => props.context;\n\treturn props.children;\n}\n\n/**\n * Portal component\n * @this {import('./internal').Component}\n * @param {object | null | undefined} props\n *\n * TODO: use createRoot() instead of fake root\n */\nfunction Portal(props) {\n\tconst _this = this;\n\tlet container = props._container;\n\n\t_this.componentWillUnmount = function () {\n\t\trender(null, _this._temp);\n\t\t_this._temp = null;\n\t\t_this._container = null;\n\t};\n\n\t// When we change container we should clear our old container and\n\t// indicate a new mount.\n\tif (_this._container && _this._container !== container) {\n\t\t_this.componentWillUnmount();\n\t}\n\n\tif (!_this._temp) {\n\t\t// Ensure the element has a mask for useId invocations\n\t\tlet root = _this._vnode;\n\t\twhile (root !== null && !root._mask && root._parent !== null) {\n\t\t\troot = root._parent;\n\t\t}\n\n\t\t_this._container = container;\n\n\t\t// Create a fake DOM parent node that manages a subset of `container`'s children:\n\t\t_this._temp = {\n\t\t\tnodeType: 1,\n\t\t\tparentNode: container,\n\t\t\tchildNodes: [],\n\t\t\t_children: { _mask: root._mask },\n\t\t\tcontains: () => true,\n\t\t\tnamespaceURI: container.namespaceURI,\n\t\t\tinsertBefore(child, before) {\n\t\t\t\tthis.childNodes.push(child);\n\t\t\t\t_this._container.insertBefore(child, before);\n\t\t\t},\n\t\t\tremoveChild(child) {\n\t\t\t\tthis.childNodes.splice(this.childNodes.indexOf(child) >>> 1, 1);\n\t\t\t\t_this._container.removeChild(child);\n\t\t\t}\n\t\t};\n\t}\n\n\t// Render our wrapping element into temp.\n\trender(\n\t\tcreateElement(ContextProvider, { context: _this.context }, props._vnode),\n\t\t_this._temp\n\t);\n}\n\n/**\n * Create a `Portal` to continue rendering the vnode tree at a different DOM node\n * @param {import('./internal').VNode} vnode The vnode to render\n * @param {import('./internal').PreactElement} container The DOM node to continue rendering in to.\n */\nexport function createPortal(vnode, container) {\n\tconst el = createElement(Portal, { _vnode: vnode, _container: container });\n\tel.containerInfo = container;\n\treturn el;\n}\n","import {\n\trender as preactRender,\n\thydrate as preactHydrate,\n\toptions,\n\ttoChildArray,\n\tComponent\n} from 'preact';\nimport {\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tuseEffect,\n\tuseId,\n\tuseImperativeHandle,\n\tuseLayoutEffect,\n\tuseMemo,\n\tuseReducer,\n\tuseRef,\n\tuseState\n} from 'preact/hooks';\nimport {\n\tuseDeferredValue,\n\tuseInsertionEffect,\n\tuseSyncExternalStore,\n\tuseTransition\n} from './index';\n\nexport const REACT_ELEMENT_TYPE =\n\t(typeof Symbol != 'undefined' && Symbol.for && Symbol.for('react.element')) ||\n\t0xeac7;\n\nconst CAMEL_PROPS =\n\t/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;\nconst ON_ANI = /^on(Ani|Tra|Tou|BeforeInp|Compo)/;\nconst CAMEL_REPLACE = /[A-Z0-9]/g;\nconst IS_DOM = typeof document !== 'undefined';\n\n// Input types for which onchange should not be converted to oninput.\n// type=\"file|checkbox|radio\", plus \"range\" in IE11.\n// (IE11 doesn't support Symbol, which we use here to turn `rad` into `ra` which matches \"range\")\nconst onChangeInputType = type =>\n\t(typeof Symbol != 'undefined' && typeof Symbol() == 'symbol'\n\t\t? /fil|che|rad/\n\t\t: /fil|che|ra/\n\t).test(type);\n\n// Some libraries like `react-virtualized` explicitly check for this.\nComponent.prototype.isReactComponent = true;\n\n// `UNSAFE_*` lifecycle hooks\n// Preact only ever invokes the unprefixed methods.\n// Here we provide a base \"fallback\" implementation that calls any defined UNSAFE_ prefixed method.\n// - If a component defines its own `componentDidMount()` (including via defineProperty), use that.\n// - If a component defines `UNSAFE_componentDidMount()`, `componentDidMount` is the alias getter/setter.\n// - If anything assigns to an `UNSAFE_*` property, the assignment is forwarded to the unprefixed property.\n// See https://github.com/preactjs/preact/issues/1941\n[\n\t'componentWillMount',\n\t'componentWillReceiveProps',\n\t'componentWillUpdate'\n].forEach(key => {\n\tObject.defineProperty(Component.prototype, key, {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn this['UNSAFE_' + key];\n\t\t},\n\t\tset(v) {\n\t\t\tObject.defineProperty(this, key, {\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: v\n\t\t\t});\n\t\t}\n\t});\n});\n\n/**\n * Proxy render() since React returns a Component reference.\n * @param {import('./internal').VNode} vnode VNode tree to render\n * @param {import('./internal').PreactElement} parent DOM node to render vnode tree into\n * @param {() => void} [callback] Optional callback that will be called after rendering\n * @returns {import('./internal').Component | null} The root component reference or null\n */\nexport function render(vnode, parent, callback) {\n\t// React destroys any existing DOM nodes, see #1727\n\t// ...but only on the first render, see #1828\n\tif (parent._children == null) {\n\t\tparent.textContent = '';\n\t}\n\n\tpreactRender(vnode, parent);\n\tif (typeof callback == 'function') callback();\n\n\treturn vnode ? vnode._component : null;\n}\n\nexport function hydrate(vnode, parent, callback) {\n\tpreactHydrate(vnode, parent);\n\tif (typeof callback == 'function') callback();\n\n\treturn vnode ? vnode._component : null;\n}\n\nlet oldEventHook = options.event;\noptions.event = e => {\n\tif (oldEventHook) e = oldEventHook(e);\n\n\te.persist = () => {};\n\te.isPropagationStopped = function isPropagationStopped() {\n\t\treturn this.cancelBubble;\n\t};\n\te.isDefaultPrevented = function isDefaultPrevented() {\n\t\treturn this.defaultPrevented;\n\t};\n\treturn (e.nativeEvent = e);\n};\n\nconst classNameDescriptorNonEnumberable = {\n\tconfigurable: true,\n\tget() {\n\t\treturn this.class;\n\t}\n};\n\nfunction handleDomVNode(vnode) {\n\tlet props = vnode.props,\n\t\ttype = vnode.type,\n\t\tnormalizedProps = {},\n\t\tisNonDashedType = type.indexOf('-') == -1;\n\n\tfor (let i in props) {\n\t\tlet value = props[i];\n\n\t\tif (\n\t\t\t(i === 'value' && 'defaultValue' in props && value == null) ||\n\t\t\t// Emulate React's behavior of not rendering the contents of noscript tags on the client.\n\t\t\t(IS_DOM && i === 'children' && type === 'noscript') ||\n\t\t\ti === 'class' ||\n\t\t\ti === 'className'\n\t\t) {\n\t\t\t// Skip applying value if it is null/undefined and we already set\n\t\t\t// a default value\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet lowerCased = i.toLowerCase();\n\t\tif (i === 'defaultValue' && 'value' in props && props.value == null) {\n\t\t\t// `defaultValue` is treated as a fallback `value` when a value prop is present but null/undefined.\n\t\t\t// `defaultValue` for Elements with no value prop is the same as the DOM defaultValue property.\n\t\t\ti = 'value';\n\t\t} else if (i === 'download' && value === true) {\n\t\t\t// Calling `setAttribute` with a truthy value will lead to it being\n\t\t\t// passed as a stringified value, e.g. `download=\"true\"`. React\n\t\t\t// converts it to an empty string instead, otherwise the attribute\n\t\t\t// value will be used as the file name and the file will be called\n\t\t\t// \"true\" upon downloading it.\n\t\t\tvalue = '';\n\t\t} else if (lowerCased === 'translate' && value === 'no') {\n\t\t\tvalue = false;\n\t\t} else if (lowerCased[0] === 'o' && lowerCased[1] === 'n') {\n\t\t\tif (lowerCased === 'ondoubleclick') {\n\t\t\t\ti = 'ondblclick';\n\t\t\t} else if (\n\t\t\t\tlowerCased === 'onchange' &&\n\t\t\t\t(type === 'input' || type === 'textarea') &&\n\t\t\t\t!onChangeInputType(props.type)\n\t\t\t) {\n\t\t\t\tlowerCased = i = 'oninput';\n\t\t\t} else if (lowerCased === 'onfocus') {\n\t\t\t\ti = 'onfocusin';\n\t\t\t} else if (lowerCased === 'onblur') {\n\t\t\t\ti = 'onfocusout';\n\t\t\t} else if (ON_ANI.test(i)) {\n\t\t\t\ti = lowerCased;\n\t\t\t}\n\t\t} else if (isNonDashedType && CAMEL_PROPS.test(i)) {\n\t\t\ti = i.replace(CAMEL_REPLACE, '-$&').toLowerCase();\n\t\t} else if (value === null) {\n\t\t\tvalue = undefined;\n\t\t}\n\n\t\t// Add support for onInput and onChange, see #3561\n\t\t// if we have an oninput prop already change it to oninputCapture\n\t\tif (lowerCased === 'oninput') {\n\t\t\ti = lowerCased;\n\t\t\tif (normalizedProps[i]) {\n\t\t\t\ti = 'oninputCapture';\n\t\t\t}\n\t\t}\n\n\t\tnormalizedProps[i] = value;\n\t}\n\n\tif (type == 'select') {\n\t\t// Add support for array select values: + if (normalizedProps.multiple && Array.isArray(normalizedProps.value)) { + // forEach() always returns undefined, which we abuse here to unset the value prop. + normalizedProps.value = toChildArray(props.children).forEach(child => { + child.props.selected = + normalizedProps.value.indexOf(child.props.value) != -1; + }); + } + + // Adding support for defaultValue in select tag + if (normalizedProps.defaultValue != null) { + normalizedProps.value = toChildArray(props.children).forEach(child => { + if (normalizedProps.multiple) { + child.props.selected = + normalizedProps.defaultValue.indexOf(child.props.value) != -1; + } else { + child.props.selected = + normalizedProps.defaultValue == child.props.value; + } + }); + } + } + + if (props.class && !props.className) { + normalizedProps.class = props.class; + Object.defineProperty( + normalizedProps, + 'className', + classNameDescriptorNonEnumberable + ); + } else if (props.className) { + normalizedProps.class = normalizedProps.className = props.className; + } + + vnode.props = normalizedProps; +} + +let oldVNodeHook = options.vnode; +options.vnode = vnode => { + // only normalize props on Element nodes + if (typeof vnode.type === 'string') { + handleDomVNode(vnode); + } + + vnode.$$typeof = REACT_ELEMENT_TYPE; + + if (oldVNodeHook) oldVNodeHook(vnode); +}; + +// Only needed for react-relay +let currentComponent; +const oldBeforeRender = options._render; +options._render = function (vnode) { + if (oldBeforeRender) { + oldBeforeRender(vnode); + } + currentComponent = vnode._component; +}; + +const oldDiffed = options.diffed; +/** @type {(vnode: import('./internal').VNode) => void} */ +options.diffed = function (vnode) { + if (oldDiffed) { + oldDiffed(vnode); + } + + const props = vnode.props; + const dom = vnode._dom; + + if ( + dom != null && + vnode.type === 'textarea' && + 'value' in props && + props.value !== dom.value + ) { + dom.value = props.value == null ? '' : props.value; + } + + currentComponent = null; +}; + +// This is a very very private internal function for React it +// is used to sort-of do runtime dependency injection. +export const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { + ReactCurrentDispatcher: { + current: { + readContext(context) { + return currentComponent._globalContext[context._id].props.value; + }, + useCallback, + useContext, + useDebugValue, + useDeferredValue, + useEffect, + useId, + useImperativeHandle, + useInsertionEffect, + useLayoutEffect, + useMemo, + // useMutableSource, // experimental-only and replaced by uSES, likely not worth supporting + useReducer, + useRef, + useState, + useSyncExternalStore, + useTransition + } + } +}; diff --git a/node_modules/preact/compat/src/suspense-list.d.ts b/node_modules/preact/compat/src/suspense-list.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0a3be0adc90d5ac312ea7bc688827e2a04408854 --- /dev/null +++ b/node_modules/preact/compat/src/suspense-list.d.ts @@ -0,0 +1,16 @@ +// Intentionally not using a relative path to take advantage of +// the TS version resolution mechanism +import { Component, ComponentChild, ComponentChildren } from 'preact'; + +// +// SuspenseList +// ----------------------------------- + +export interface SuspenseListProps { + children?: ComponentChildren; + revealOrder?: 'forwards' | 'backwards' | 'together'; +} + +export class SuspenseList extends Component { + render(): ComponentChild; +} diff --git a/node_modules/preact/compat/src/suspense-list.js b/node_modules/preact/compat/src/suspense-list.js new file mode 100644 index 0000000000000000000000000000000000000000..5e5d750a08952872a0a60101bd02b6914214352d --- /dev/null +++ b/node_modules/preact/compat/src/suspense-list.js @@ -0,0 +1,127 @@ +import { Component, toChildArray } from 'preact'; +import { suspended } from './suspense.js'; + +// Indexes to linked list nodes (nodes are stored as arrays to save bytes). +const SUSPENDED_COUNT = 0; +const RESOLVED_COUNT = 1; +const NEXT_NODE = 2; + +// Having custom inheritance instead of a class here saves a lot of bytes. +export function SuspenseList() { + this._next = null; + this._map = null; +} + +// Mark one of child's earlier suspensions as resolved. +// Some pending callbacks may become callable due to this +// (e.g. the last suspended descendant gets resolved when +// revealOrder === 'together'). Process those callbacks as well. +const resolve = (list, child, node) => { + if (++node[RESOLVED_COUNT] === node[SUSPENDED_COUNT]) { + // The number a child (or any of its descendants) has been suspended + // matches the number of times it's been resolved. Therefore we + // mark the child as completely resolved by deleting it from ._map. + // This is used to figure out when *all* children have been completely + // resolved when revealOrder is 'together'. + list._map.delete(child); + } + + // If revealOrder is falsy then we can do an early exit, as the + // callbacks won't get queued in the node anyway. + // If revealOrder is 'together' then also do an early exit + // if all suspended descendants have not yet been resolved. + if ( + !list.props.revealOrder || + (list.props.revealOrder[0] === 't' && list._map.size) + ) { + return; + } + + // Walk the currently suspended children in order, calling their + // stored callbacks on the way. Stop if we encounter a child that + // has not been completely resolved yet. + node = list._next; + while (node) { + while (node.length > 3) { + node.pop()(); + } + if (node[RESOLVED_COUNT] < node[SUSPENDED_COUNT]) { + break; + } + list._next = node = node[NEXT_NODE]; + } +}; + +// Things we do here to save some bytes but are not proper JS inheritance: +// - call `new Component()` as the prototype +// - do not set `Suspense.prototype.constructor` to `Suspense` +SuspenseList.prototype = new Component(); + +SuspenseList.prototype._suspended = function (child) { + const list = this; + const delegated = suspended(list._vnode); + + let node = list._map.get(child); + node[SUSPENDED_COUNT]++; + + return unsuspend => { + const wrappedUnsuspend = () => { + if (!list.props.revealOrder) { + // Special case the undefined (falsy) revealOrder, as there + // is no need to coordinate a specific order or unsuspends. + unsuspend(); + } else { + node.push(unsuspend); + resolve(list, child, node); + } + }; + if (delegated) { + delegated(wrappedUnsuspend); + } else { + wrappedUnsuspend(); + } + }; +}; + +SuspenseList.prototype.render = function (props) { + this._next = null; + this._map = new Map(); + + const children = toChildArray(props.children); + if (props.revealOrder && props.revealOrder[0] === 'b') { + // If order === 'backwards' (or, well, anything starting with a 'b') + // then flip the child list around so that the last child will be + // the first in the linked list. + children.reverse(); + } + // Build the linked list. Iterate through the children in reverse order + // so that `_next` points to the first linked list node to be resolved. + for (let i = children.length; i--; ) { + // Create a new linked list node as an array of form: + // [suspended_count, resolved_count, next_node] + // where suspended_count and resolved_count are numeric counters for + // keeping track how many times a node has been suspended and resolved. + // + // Note that suspended_count starts from 1 instead of 0, so we can block + // processing callbacks until componentDidMount has been called. In a sense + // node is suspended at least until componentDidMount gets called! + // + // Pending callbacks are added to the end of the node: + // [suspended_count, resolved_count, next_node, callback_0, callback_1, ...] + this._map.set(children[i], (this._next = [1, 0, this._next])); + } + return props.children; +}; + +SuspenseList.prototype.componentDidUpdate = + SuspenseList.prototype.componentDidMount = function () { + // Iterate through all children after mounting for two reasons: + // 1. As each node[SUSPENDED_COUNT] starts from 1, this iteration increases + // each node[RELEASED_COUNT] by 1, therefore balancing the counters. + // The nodes can now be completely consumed from the linked list. + // 2. Handle nodes that might have gotten resolved between render and + // componentDidMount. + this._map.forEach((node, child) => { + resolve(this, child, node); + }); + }; diff --git a/node_modules/preact/compat/src/suspense.d.ts b/node_modules/preact/compat/src/suspense.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..65c2a9372a22a756a24f620300318ea1b41505af --- /dev/null +++ b/node_modules/preact/compat/src/suspense.d.ts @@ -0,0 +1,19 @@ +// Intentionally not using a relative path to take advantage of +// the TS version resolution mechanism +import { Component, ComponentChild, ComponentChildren } from 'preact'; + +// +// Suspense/lazy +// ----------------------------------- +export function lazy( + loader: () => Promise<{ default: T } | T> +): T extends { default: infer U } ? U : T; + +export interface SuspenseProps { + children?: ComponentChildren; + fallback: ComponentChildren; +} + +export class Suspense extends Component { + render(): ComponentChild; +} diff --git a/node_modules/preact/compat/src/suspense.js b/node_modules/preact/compat/src/suspense.js new file mode 100644 index 0000000000000000000000000000000000000000..9fe32721c60b6eefbd199e234d3fb39d28769714 --- /dev/null +++ b/node_modules/preact/compat/src/suspense.js @@ -0,0 +1,289 @@ +import { Component, createElement, options, Fragment } from 'preact'; +import { MODE_HYDRATE } from '../../src/constants'; +import { assign } from './util'; + +const oldCatchError = options._catchError; +options._catchError = function (error, newVNode, oldVNode, errorInfo) { + if (error.then) { + /** @type {import('./internal').Component} */ + let component; + let vnode = newVNode; + + for (; (vnode = vnode._parent); ) { + if ((component = vnode._component) && component._childDidSuspend) { + if (newVNode._dom == null) { + newVNode._dom = oldVNode._dom; + newVNode._children = oldVNode._children; + } + // Don't call oldCatchError if we found a Suspense + return component._childDidSuspend(error, newVNode); + } + } + } + oldCatchError(error, newVNode, oldVNode, errorInfo); +}; + +const oldUnmount = options.unmount; +options.unmount = function (vnode) { + /** @type {import('./internal').Component} */ + const component = vnode._component; + if (component) component._unmounted = true; + if (component && component._onResolve) { + component._onResolve(); + } + + // if the component is still hydrating + // most likely it is because the component is suspended + // we set the vnode.type as `null` so that it is not a typeof function + // so the unmount will remove the vnode._dom + if (component && vnode._flags & MODE_HYDRATE) { + vnode.type = null; + } + + if (oldUnmount) oldUnmount(vnode); +}; + +function detachedClone(vnode, detachedParent, parentDom) { + if (vnode) { + if (vnode._component && vnode._component.__hooks) { + vnode._component.__hooks._list.forEach(effect => { + if (typeof effect._cleanup == 'function') effect._cleanup(); + }); + + vnode._component.__hooks = null; + } + + vnode = assign({}, vnode); + if (vnode._component != null) { + if (vnode._component._parentDom === parentDom) { + vnode._component._parentDom = detachedParent; + } + + vnode._component._force = true; + + vnode._component = null; + } + + vnode._children = + vnode._children && + vnode._children.map(child => + detachedClone(child, detachedParent, parentDom) + ); + } + + return vnode; +} + +function removeOriginal(vnode, detachedParent, originalParent) { + if (vnode && originalParent) { + vnode._original = null; + vnode._children = + vnode._children && + vnode._children.map(child => + removeOriginal(child, detachedParent, originalParent) + ); + + if (vnode._component) { + if (vnode._component._parentDom === detachedParent) { + if (vnode._dom) { + originalParent.appendChild(vnode._dom); + } + vnode._component._force = true; + vnode._component._parentDom = originalParent; + } + } + } + + return vnode; +} + +// having custom inheritance instead of a class here saves a lot of bytes +export function Suspense() { + // we do not call super here to golf some bytes... + this._pendingSuspensionCount = 0; + this._suspenders = null; + this._detachOnNextRender = null; +} + +// Things we do here to save some bytes but are not proper JS inheritance: +// - call `new Component()` as the prototype +// - do not set `Suspense.prototype.constructor` to `Suspense` +Suspense.prototype = new Component(); + +/** + * @this {import('./internal').SuspenseComponent} + * @param {Promise} promise The thrown promise + * @param {import('./internal').VNode} suspendingVNode The suspending component + */ +Suspense.prototype._childDidSuspend = function (promise, suspendingVNode) { + const suspendingComponent = suspendingVNode._component; + + /** @type {import('./internal').SuspenseComponent} */ + const c = this; + + if (c._suspenders == null) { + c._suspenders = []; + } + c._suspenders.push(suspendingComponent); + + const resolve = suspended(c._vnode); + + let resolved = false; + const onResolved = () => { + if (resolved || c._unmounted) return; + + resolved = true; + suspendingComponent._onResolve = null; + + if (resolve) { + resolve(onSuspensionComplete); + } else { + onSuspensionComplete(); + } + }; + + suspendingComponent._onResolve = onResolved; + + // Store and null _parentDom to prevent setState/forceUpdate from + // scheduling renders while suspended. Render would be a no-op anyway + // since renderComponent checks _parentDom, but this avoids queue churn. + const originalParentDom = suspendingComponent._parentDom; + suspendingComponent._parentDom = null; + + const onSuspensionComplete = () => { + if (!--c._pendingSuspensionCount) { + // If the suspension was during hydration we don't need to restore the + // suspended children into the _children array + if (c.state._suspended) { + const suspendedVNode = c.state._suspended; + c._vnode._children[0] = removeOriginal( + suspendedVNode, + suspendedVNode._component._parentDom, + suspendedVNode._component._originalParentDom + ); + } + + c.setState({ _suspended: (c._detachOnNextRender = null) }); + + let suspended; + while ((suspended = c._suspenders.pop())) { + // Restore _parentDom before forceUpdate so render can proceed + suspended._parentDom = originalParentDom; + suspended.forceUpdate(); + } + } + }; + + /** + * We do not set `suspended: true` during hydration because we want the actual markup + * to remain on screen and hydrate it when the suspense actually gets resolved. + * While in non-hydration cases the usual fallback -> component flow would occour. + */ + if ( + !c._pendingSuspensionCount++ && + !(suspendingVNode._flags & MODE_HYDRATE) + ) { + c.setState({ _suspended: (c._detachOnNextRender = c._vnode._children[0]) }); + } + promise.then(onResolved, onResolved); +}; + +Suspense.prototype.componentWillUnmount = function () { + this._suspenders = []; +}; + +/** + * @this {import('./internal').SuspenseComponent} + * @param {import('./internal').SuspenseComponent["props"]} props + * @param {import('./internal').SuspenseState} state + */ +Suspense.prototype.render = function (props, state) { + if (this._detachOnNextRender) { + // When the Suspense's _vnode was created by a call to createVNode + // (i.e. due to a setState further up in the tree) + // it's _children prop is null, in this case we "forget" about the parked vnodes to detach + if (this._vnode._children) { + const detachedParent = document.createElement('div'); + const detachedComponent = this._vnode._children[0]._component; + this._vnode._children[0] = detachedClone( + this._detachOnNextRender, + detachedParent, + (detachedComponent._originalParentDom = detachedComponent._parentDom) + ); + } + + this._detachOnNextRender = null; + } + + // Wrap fallback tree in a VNode that prevents itself from being marked as aborting mid-hydration: + /** @type {import('./internal').VNode} */ + const fallback = + state._suspended && createElement(Fragment, null, props.fallback); + if (fallback) fallback._flags &= ~MODE_HYDRATE; + + return [ + createElement(Fragment, null, state._suspended ? null : props.children), + fallback + ]; +}; + +/** + * Checks and calls the parent component's _suspended method, passing in the + * suspended vnode. This is a way for a parent (e.g. SuspenseList) to get notified + * that one of its children/descendants suspended. + * + * The parent MAY return a callback. The callback will get called when the + * suspension resolves, notifying the parent of the fact. + * Moreover, the callback gets function `unsuspend` as a parameter. The resolved + * child descendant will not actually get unsuspended until `unsuspend` gets called. + * This is a way for the parent to delay unsuspending. + * + * If the parent does not return a callback then the resolved vnode + * gets unsuspended immediately when it resolves. + * + * @param {import('./internal').VNode} vnode + * @returns {((unsuspend: () => void) => void)?} + */ +export function suspended(vnode) { + let component = vnode._parent && vnode._parent._component; + return component && component._suspended && component._suspended(vnode); +} + +export function lazy(loader) { + let prom; + let component = null; + let error; + let resolved; + + function Lazy(props) { + if (!prom) { + prom = loader(); + prom.then( + exports => { + if (exports) { + component = exports.default || exports; + } + resolved = true; + }, + e => { + error = e; + resolved = true; + } + ); + } + + if (error) { + throw error; + } + + if (!resolved) { + throw prom; + } + + return component ? createElement(component, props) : null; + } + + Lazy.displayName = 'Lazy'; + Lazy._forwarded = true; + return Lazy; +} diff --git a/node_modules/preact/compat/src/util.js b/node_modules/preact/compat/src/util.js new file mode 100644 index 0000000000000000000000000000000000000000..8ec376942b2ea23a924b3780af39fa0e3982eb16 --- /dev/null +++ b/node_modules/preact/compat/src/util.js @@ -0,0 +1,33 @@ +/** + * Assign properties from `props` to `obj` + * @template O, P The obj and props types + * @param {O} obj The object to copy properties to + * @param {P} props The object to copy properties from + * @returns {O & P} + */ +export function assign(obj, props) { + for (let i in props) obj[i] = props[i]; + return /** @type {O & P} */ (obj); +} + +/** + * Check if two objects have a different shape + * @param {object} a + * @param {object} b + * @returns {boolean} + */ +export function shallowDiffers(a, b) { + for (let i in a) if (i !== '__source' && !(i in b)) return true; + for (let i in b) if (i !== '__source' && a[i] !== b[i]) return true; + return false; +} + +/** + * Check if two values are the same value + * @param {*} x + * @param {*} y + * @returns {boolean} + */ +export function is(x, y) { + return (x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y); +} diff --git a/node_modules/preact/compat/test-utils.js b/node_modules/preact/compat/test-utils.js new file mode 100644 index 0000000000000000000000000000000000000000..2dac062212445fad4174246d28843e42212b22f5 --- /dev/null +++ b/node_modules/preact/compat/test-utils.js @@ -0,0 +1 @@ +module.exports = require('preact/test-utils'); diff --git a/node_modules/preact/compat/test-utils.mjs b/node_modules/preact/compat/test-utils.mjs new file mode 100644 index 0000000000000000000000000000000000000000..16b6d0b2938dd71c03658a89d57603560ea387ee --- /dev/null +++ b/node_modules/preact/compat/test-utils.mjs @@ -0,0 +1 @@ +export * from 'preact/test-utils'; diff --git a/node_modules/preact/debug/dist/debug.js b/node_modules/preact/debug/dist/debug.js new file mode 100644 index 0000000000000000000000000000000000000000..125c3c4b0aa4ad089705d04e3b9c7f3db7b0e208 --- /dev/null +++ b/node_modules/preact/debug/dist/debug.js @@ -0,0 +1,2 @@ +var n=require("preact");require("preact/devtools");var e={};function t(e){return e.type===n.Fragment?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var o=[],r=[];function a(){return o.length>0?o[o.length-1]:null}var i=!0;function s(e){return"function"==typeof e.type&&e.type!=n.Fragment}function c(n){for(var e=[n],o=n;null!=o.__o;)e.push(o.__o),o=o.__o;return e.reduce(function(n,e){n+=" in "+t(e);var o=e.__source;return o?n+=" (at "+o.fileName+":"+o.lineNumber+")":i&&console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons."),i=!1,n+"\n"},"")}var l="function"==typeof WeakMap;function u(n){var e=[];return n.__k?(n.__k.forEach(function(n){n&&"function"==typeof n.type?e.push.apply(e,u(n)):n&&"string"==typeof n.type&&e.push(n.type)}),e):e}function f(n){return n?"function"==typeof n.type?null==n.__?null!=n.__e&&null!=n.__e.parentNode?n.__e.parentNode.localName:"":f(n.__):n.type:""}var d=n.Component.prototype.setState;function p(n){return"table"===n||"tfoot"===n||"tbody"===n||"thead"===n||"td"===n||"tr"===n||"th"===n}n.Component.prototype.setState=function(n,e){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+c(a())),d.call(this,n,e)};var h=/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/,v=n.Component.prototype.forceUpdate;function y(n){var e=n.props,o=t(n),r="";for(var a in e)if(e.hasOwnProperty(a)&&"children"!==a){var i=e[a];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),r+=" "+a+"="+JSON.stringify(i)}var s=e.children;return"<"+o+r+(s&&s.length?">..":" />")}n.Component.prototype.forceUpdate=function(n){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+c(a())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+c(this.__v)),v.call(this,n)},n.options.__m=function(n,e){var t=n.type,o=e.map(function(n){return n&&n.localName}).filter(Boolean);console.error('Expected a DOM node of type "'+t+'" but found "'+o.join(", ")+"\" as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n"+c(n))},function(){!function(){var e=n.options.__b,t=n.options.diffed,a=n.options.__,i=n.options.vnode,c=n.options.__r;n.options.diffed=function(n){s(n)&&r.pop(),o.pop(),t&&t(n)},n.options.__b=function(n){s(n)&&o.push(n),e&&e(n)},n.options.__=function(n,e){r=[],a&&a(n,e)},n.options.vnode=function(n){n.__o=r.length>0?r[r.length-1]:null,i&&i(n)},n.options.__r=function(n){s(n)&&r.push(n),c&&c(n)}}();var a=!1,i=n.options.__b,d=n.options.diffed,v=n.options.vnode,m=n.options.__r,b=n.options.__e,w=n.options.__,g=n.options.__h,E=l?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,k=[];n.options.__e=function(n,e,o,r){if(e&&e.__c&&"function"==typeof n.then){var a=n;n=new Error("Missing Suspense. The throwing component was: "+t(e));for(var i=e;i;i=i.__)if(i.__c&&i.__c.__c){n=a;break}if(n instanceof Error)throw n}try{(r=r||{}).componentStack=c(e),b(n,e,o,r),"function"!=typeof n.then&&setTimeout(function(){throw n})}catch(n){throw n}},n.options.__=function(n,e){if(!e)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var o;switch(e.nodeType){case 1:case 11:case 9:o=!0;break;default:o=!1}if(!o){var r=t(n);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+e+" instead: render(<"+r+" />, "+e+");")}w&&w(n,e)},n.options.__b=function(n){var o=n.type;if(a=!0,void 0===o)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+y(n)+"\n\n"+c(n));if(null!=o&&"object"==typeof o){if(void 0!==o.__k&&void 0!==o.__e)throw new Error("Invalid type passed to createElement(): "+o+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+t(n)+" = "+y(o)+";\n let vnode = ;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+c(n));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(o)?"array":o))}if(void 0!==n.ref&&"function"!=typeof n.ref&&"object"!=typeof n.ref&&!("$$typeof"in n))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof n.ref+"] instead\n"+y(n)+"\n\n"+c(n));if("string"==typeof n.type)for(var r in n.props)if("o"===r[0]&&"n"===r[1]&&"function"!=typeof n.props[r]&&null!=n.props[r])throw new Error("Component's \""+r+'" property should be a function, but got ['+typeof n.props[r]+"] instead\n"+y(n)+"\n\n"+c(n));if("function"==typeof n.type&&n.type.propTypes){if("Lazy"===n.type.displayName&&E&&!E.lazyPropTypes.has(n.type)){var s="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var l=n.type();E.lazyPropTypes.set(n.type,!0),console.warn(s+"Component wrapped in lazy() is "+t(l))}catch(n){console.warn(s+"We will log the wrapped component's name once it is loaded.")}}var u=n.props;n.type.__f&&delete(u=function(n,e){for(var t in e)n[t]=e[t];return n}({},u)).ref,function(n,t,o,r,a){Object.keys(n).forEach(function(o){var i;try{i=n[o](t,o,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(n){i=n}i&&!(i.message in e)&&(e[i.message]=!0,console.error("Failed prop type: "+i.message+(a&&"\n"+a()||"")))})}(n.type.propTypes,u,0,t(n),function(){return c(n)})}i&&i(n)};var T,_=0;n.options.__r=function(n){m&&m(n),a=!0;var e=n.__c;if(e===T?_++:_=1,_>=25)throw new Error("Too many re-renders. This is limited to prevent an infinite loop which may lock up your browser. The component causing this is: "+t(n));T=e},n.options.__h=function(n,e,t){if(!n||!a)throw new Error("Hook can only be invoked from render methods.");g&&g(n,e,t)};var O=function(n,e){return{get:function(){var t="get"+n+e;k&&k.indexOf(t)<0&&(k.push(t),console.warn("getting vnode."+n+" is deprecated, "+e))},set:function(){var t="set"+n+e;k&&k.indexOf(t)<0&&(k.push(t),console.warn("setting vnode."+n+" is not allowed, "+e))}}},I={nodeName:O("nodeName","use vnode.type"),attributes:O("attributes","use vnode.props"),children:O("children","use vnode.props.children")},x=Object.create({},I);n.options.vnode=function(n){var e=n.props;if(null!==n.type&&null!=e&&("__source"in e||"__self"in e)){var t=n.props={};for(var o in e){var r=e[o];"__source"===o?n.__source=r:"__self"===o?n.__self=r:t[o]=r}}n.__proto__=x,v&&v(n)},n.options.diffed=function(n){var e,o=n.type,r=n.__;if(n.__k&&n.__k.forEach(function(e){if("object"==typeof e&&e&&void 0===e.type){var t=Object.keys(e).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+t+"}.\n\n"+c(n))}}),n.__c===T&&(_=0),"string"==typeof o&&(p(o)||"p"===o||"a"===o||"button"===o)){var i=f(r);if(""!==i&&p(o))"table"===o&&"td"!==i&&p(i)?console.error("Improper nesting of table. Your should not have a table-node parent."+y(n)+"\n\n"+c(n)):"thead"!==o&&"tfoot"!==o&&"tbody"!==o||"table"===i?"tr"===o&&"thead"!==i&&"tfoot"!==i&&"tbody"!==i?console.error("Improper nesting of table. Your should have a parent."+y(n)+"\n\n"+c(n)):"td"===o&&"tr"!==i?console.error("Improper nesting of table. Your parent."+y(n)+"\n\n"+c(n)):"th"===o&&"tr"!==i&&console.error("Improper nesting of table. Your ."+y(n)+"\n\n"+c(n)):console.error("Improper nesting of table. Your should have a
should have a
should have a
parent."+y(n)+"\n\n"+c(n));else if("p"===o){var s=u(n).filter(function(n){return h.test(n)});s.length&&console.error("Improper nesting of paragraph. Your

should not have "+s.join(", ")+" as child-elements."+y(n)+"\n\n"+c(n))}else"a"!==o&&"button"!==o||-1!==u(n).indexOf(o)&&console.error("Improper nesting of interactive content. Your <"+o+"> should not have other "+("a"===o?"anchor":"button")+" tags as child-elements."+y(n)+"\n\n"+c(n))}if(a=!1,d&&d(n),null!=n.__k)for(var l=[],v=0;v {\n\t\tlet error;\n\t\ttry {\n\t\t\terror = typeSpecs[typeSpecName](\n\t\t\t\tvalues,\n\t\t\t\ttypeSpecName,\n\t\t\t\tcomponentName,\n\t\t\t\tlocation,\n\t\t\t\tnull,\n\t\t\t\tReactPropTypesSecret\n\t\t\t);\n\t\t} catch (e) {\n\t\t\terror = e;\n\t\t}\n\t\tif (error && !(error.message in loggedTypeFailures)) {\n\t\t\tloggedTypeFailures[error.message] = true;\n\t\t\tconsole.error(\n\t\t\t\t`Failed ${location} type: ${error.message}${\n\t\t\t\t\t(getStack && `\\n${getStack()}`) || ''\n\t\t\t\t}`\n\t\t\t);\n\t\t}\n\t});\n}\n","import { options, Fragment } from 'preact';\n\n/**\n * Get human readable name of the component/dom node\n * @param {import('./internal').VNode} vnode\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function getDisplayName(vnode) {\n\tif (vnode.type === Fragment) {\n\t\treturn 'Fragment';\n\t} else if (typeof vnode.type == 'function') {\n\t\treturn vnode.type.displayName || vnode.type.name;\n\t} else if (typeof vnode.type == 'string') {\n\t\treturn vnode.type;\n\t}\n\n\treturn '#text';\n}\n\n/**\n * Used to keep track of the currently rendered `vnode` and print it\n * in debug messages.\n */\nlet renderStack = [];\n\n/**\n * Keep track of the current owners. An owner describes a component\n * which was responsible to render a specific `vnode`. This exclude\n * children that are passed via `props.children`, because they belong\n * to the parent owner.\n *\n * ```jsx\n * const Foo = props =>

{props.children}
// div's owner is Foo\n * const Bar = props => {\n * return (\n * // Foo's owner is Bar, span's owner is Bar\n * )\n * }\n * ```\n *\n * Note: A `vnode` may be hoisted to the root scope due to compiler\n * optimiztions. In these cases the `_owner` will be different.\n */\nlet ownerStack = [];\n\n/**\n * Get the currently rendered `vnode`\n * @returns {import('./internal').VNode | null}\n */\nexport function getCurrentVNode() {\n\treturn renderStack.length > 0 ? renderStack[renderStack.length - 1] : null;\n}\n\n/**\n * If the user doesn't have `@babel/plugin-transform-react-jsx-source`\n * somewhere in his tool chain we can't print the filename and source\n * location of a component. In that case we just omit that, but we'll\n * print a helpful message to the console, notifying the user of it.\n */\nlet showJsxSourcePluginWarning = true;\n\n/**\n * Check if a `vnode` is a possible owner.\n * @param {import('./internal').VNode} vnode\n */\nfunction isPossibleOwner(vnode) {\n\treturn typeof vnode.type == 'function' && vnode.type != Fragment;\n}\n\n/**\n * Return the component stack that was captured up to this point.\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function getOwnerStack(vnode) {\n\tconst stack = [vnode];\n\tlet next = vnode;\n\twhile (next._owner != null) {\n\t\tstack.push(next._owner);\n\t\tnext = next._owner;\n\t}\n\n\treturn stack.reduce((acc, owner) => {\n\t\tacc += ` in ${getDisplayName(owner)}`;\n\n\t\tconst source = owner.__source;\n\t\tif (source) {\n\t\t\tacc += ` (at ${source.fileName}:${source.lineNumber})`;\n\t\t} else if (showJsxSourcePluginWarning) {\n\t\t\tconsole.warn(\n\t\t\t\t'Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.'\n\t\t\t);\n\t\t}\n\t\tshowJsxSourcePluginWarning = false;\n\n\t\treturn (acc += '\\n');\n\t}, '');\n}\n\n/**\n * Setup code to capture the component trace while rendering. Note that\n * we cannot simply traverse `vnode._parent` upwards, because we have some\n * debug messages for `this.setState` where the `vnode` is `undefined`.\n */\nexport function setupComponentStack() {\n\tlet oldDiff = options._diff;\n\tlet oldDiffed = options.diffed;\n\tlet oldRoot = options._root;\n\tlet oldVNode = options.vnode;\n\tlet oldRender = options._render;\n\n\toptions.diffed = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\townerStack.pop();\n\t\t}\n\t\trenderStack.pop();\n\t\tif (oldDiffed) oldDiffed(vnode);\n\t};\n\n\toptions._diff = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\trenderStack.push(vnode);\n\t\t}\n\t\tif (oldDiff) oldDiff(vnode);\n\t};\n\n\toptions._root = (vnode, parent) => {\n\t\townerStack = [];\n\t\tif (oldRoot) oldRoot(vnode, parent);\n\t};\n\n\toptions.vnode = vnode => {\n\t\tvnode._owner =\n\t\t\townerStack.length > 0 ? ownerStack[ownerStack.length - 1] : null;\n\t\tif (oldVNode) oldVNode(vnode);\n\t};\n\n\toptions._render = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\townerStack.push(vnode);\n\t\t}\n\n\t\tif (oldRender) oldRender(vnode);\n\t};\n}\n","import { checkPropTypes } from './check-props';\nimport { options, Component } from 'preact';\nimport {\n\tELEMENT_NODE,\n\tDOCUMENT_NODE,\n\tDOCUMENT_FRAGMENT_NODE\n} from './constants';\nimport {\n\tgetOwnerStack,\n\tsetupComponentStack,\n\tgetCurrentVNode,\n\tgetDisplayName\n} from './component-stack';\nimport { assign, isNaN } from './util';\n\nconst isWeakMapSupported = typeof WeakMap == 'function';\n\n/**\n * @param {import('./internal').VNode} vnode\n * @returns {Array}\n */\nfunction getDomChildren(vnode) {\n\tlet domChildren = [];\n\n\tif (!vnode._children) return domChildren;\n\n\tvnode._children.forEach(child => {\n\t\tif (child && typeof child.type === 'function') {\n\t\t\tdomChildren.push.apply(domChildren, getDomChildren(child));\n\t\t} else if (child && typeof child.type === 'string') {\n\t\t\tdomChildren.push(child.type);\n\t\t}\n\t});\n\n\treturn domChildren;\n}\n\n/**\n * @param {import('./internal').VNode} parent\n * @returns {string}\n */\nfunction getClosestDomNodeParentName(parent) {\n\tif (!parent) return '';\n\tif (typeof parent.type == 'function') {\n\t\tif (parent._parent == null) {\n\t\t\tif (parent._dom != null && parent._dom.parentNode != null) {\n\t\t\t\treturn parent._dom.parentNode.localName;\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\t\treturn getClosestDomNodeParentName(parent._parent);\n\t}\n\treturn /** @type {string} */ (parent.type);\n}\n\nexport function initDebug() {\n\tsetupComponentStack();\n\n\tlet hooksAllowed = false;\n\n\t/* eslint-disable no-console */\n\tlet oldBeforeDiff = options._diff;\n\tlet oldDiffed = options.diffed;\n\tlet oldVnode = options.vnode;\n\tlet oldRender = options._render;\n\tlet oldCatchError = options._catchError;\n\tlet oldRoot = options._root;\n\tlet oldHook = options._hook;\n\tconst warnedComponents = !isWeakMapSupported\n\t\t? null\n\t\t: {\n\t\t\t\tuseEffect: new WeakMap(),\n\t\t\t\tuseLayoutEffect: new WeakMap(),\n\t\t\t\tlazyPropTypes: new WeakMap()\n\t\t\t};\n\tconst deprecations = [];\n\n\toptions._catchError = (error, vnode, oldVNode, errorInfo) => {\n\t\tlet component = vnode && vnode._component;\n\t\tif (component && typeof error.then == 'function') {\n\t\t\tconst promise = error;\n\t\t\terror = new Error(\n\t\t\t\t`Missing Suspense. The throwing component was: ${getDisplayName(vnode)}`\n\t\t\t);\n\n\t\t\tlet parent = vnode;\n\t\t\tfor (; parent; parent = parent._parent) {\n\t\t\t\tif (parent._component && parent._component._childDidSuspend) {\n\t\t\t\t\terror = promise;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// We haven't recovered and we know at this point that there is no\n\t\t\t// Suspense component higher up in the tree\n\t\t\tif (error instanceof Error) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\terrorInfo = errorInfo || {};\n\t\t\terrorInfo.componentStack = getOwnerStack(vnode);\n\t\t\toldCatchError(error, vnode, oldVNode, errorInfo);\n\n\t\t\t// when an error was handled by an ErrorBoundary we will nonetheless emit an error\n\t\t\t// event on the window object. This is to make up for react compatibility in dev mode\n\t\t\t// and thus make the Next.js dev overlay work.\n\t\t\tif (typeof error.then != 'function') {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tthrow e;\n\t\t}\n\t};\n\n\toptions._root = (vnode, parentNode) => {\n\t\tif (!parentNode) {\n\t\t\tthrow new Error(\n\t\t\t\t'Undefined parent passed to render(), this is the second argument.\\n' +\n\t\t\t\t\t'Check if the element is available in the DOM/has the correct id.'\n\t\t\t);\n\t\t}\n\n\t\tlet isValid;\n\t\tswitch (parentNode.nodeType) {\n\t\t\tcase ELEMENT_NODE:\n\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\tcase DOCUMENT_NODE:\n\t\t\t\tisValid = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tisValid = false;\n\t\t}\n\n\t\tif (!isValid) {\n\t\t\tlet componentName = getDisplayName(vnode);\n\t\t\tthrow new Error(\n\t\t\t\t`Expected a valid HTML node as a second argument to render.\tReceived ${parentNode} instead: render(<${componentName} />, ${parentNode});`\n\t\t\t);\n\t\t}\n\n\t\tif (oldRoot) oldRoot(vnode, parentNode);\n\t};\n\n\toptions._diff = vnode => {\n\t\tlet { type } = vnode;\n\n\t\thooksAllowed = true;\n\n\t\tif (type === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t'Undefined component passed to createElement()\\n\\n' +\n\t\t\t\t\t'You likely forgot to export your component or might have mixed up default and named imports' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t} else if (type != null && typeof type == 'object') {\n\t\t\tif (type._children !== undefined && type._dom !== undefined) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Invalid type passed to createElement(): ${type}\\n\\n` +\n\t\t\t\t\t\t'Did you accidentally pass a JSX literal as JSX twice?\\n\\n' +\n\t\t\t\t\t\t` let My${getDisplayName(vnode)} = ${serializeVNode(type)};\\n` +\n\t\t\t\t\t\t` let vnode = ;\\n\\n` +\n\t\t\t\t\t\t'This usually happens when you export a JSX literal and not the component.' +\n\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthrow new Error(\n\t\t\t\t'Invalid type passed to createElement(): ' +\n\t\t\t\t\t(Array.isArray(type) ? 'array' : type)\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tvnode.ref !== undefined &&\n\t\t\ttypeof vnode.ref != 'function' &&\n\t\t\ttypeof vnode.ref != 'object' &&\n\t\t\t!('$$typeof' in vnode) // allow string refs when preact-compat is installed\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t`Component's \"ref\" property should be a function, or an object created ` +\n\t\t\t\t\t`by createRef(), but got [${typeof vnode.ref}] instead\\n` +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t}\n\n\t\tif (typeof vnode.type == 'string') {\n\t\t\tfor (const key in vnode.props) {\n\t\t\t\tif (\n\t\t\t\t\tkey[0] === 'o' &&\n\t\t\t\t\tkey[1] === 'n' &&\n\t\t\t\t\ttypeof vnode.props[key] != 'function' &&\n\t\t\t\t\tvnode.props[key] != null\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Component's \"${key}\" property should be a function, ` +\n\t\t\t\t\t\t\t`but got [${typeof vnode.props[key]}] instead\\n` +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check prop-types if available\n\t\tif (typeof vnode.type == 'function' && vnode.type.propTypes) {\n\t\t\tif (\n\t\t\t\tvnode.type.displayName === 'Lazy' &&\n\t\t\t\twarnedComponents &&\n\t\t\t\t!warnedComponents.lazyPropTypes.has(vnode.type)\n\t\t\t) {\n\t\t\t\tconst m =\n\t\t\t\t\t'PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ';\n\t\t\t\ttry {\n\t\t\t\t\tconst lazyVNode = vnode.type();\n\t\t\t\t\twarnedComponents.lazyPropTypes.set(vnode.type, true);\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\tm + `Component wrapped in lazy() is ${getDisplayName(lazyVNode)}`\n\t\t\t\t\t);\n\t\t\t\t} catch (promise) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\tm + \"We will log the wrapped component's name once it is loaded.\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet values = vnode.props;\n\t\t\tif (vnode.type._forwarded) {\n\t\t\t\tvalues = assign({}, values);\n\t\t\t\tdelete values.ref;\n\t\t\t}\n\n\t\t\tcheckPropTypes(\n\t\t\t\tvnode.type.propTypes,\n\t\t\t\tvalues,\n\t\t\t\t'prop',\n\t\t\t\tgetDisplayName(vnode),\n\t\t\t\t() => getOwnerStack(vnode)\n\t\t\t);\n\t\t}\n\n\t\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n\t};\n\n\tlet renderCount = 0;\n\tlet currentComponent;\n\toptions._render = vnode => {\n\t\tif (oldRender) {\n\t\t\toldRender(vnode);\n\t\t}\n\t\thooksAllowed = true;\n\n\t\tconst nextComponent = vnode._component;\n\t\tif (nextComponent === currentComponent) {\n\t\t\trenderCount++;\n\t\t} else {\n\t\t\trenderCount = 1;\n\t\t}\n\n\t\tif (renderCount >= 25) {\n\t\t\tthrow new Error(\n\t\t\t\t`Too many re-renders. This is limited to prevent an infinite loop ` +\n\t\t\t\t\t`which may lock up your browser. The component causing this is: ${getDisplayName(\n\t\t\t\t\t\tvnode\n\t\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\n\t\tcurrentComponent = nextComponent;\n\t};\n\n\toptions._hook = (comp, index, type) => {\n\t\tif (!comp || !hooksAllowed) {\n\t\t\tthrow new Error('Hook can only be invoked from render methods.');\n\t\t}\n\n\t\tif (oldHook) oldHook(comp, index, type);\n\t};\n\n\t// Ideally we'd want to print a warning once per component, but we\n\t// don't have access to the vnode that triggered it here. As a\n\t// compromise and to avoid flooding the console with warnings we\n\t// print each deprecation warning only once.\n\tconst warn = (property, message) => ({\n\t\tget() {\n\t\t\tconst key = 'get' + property + message;\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\n\t\t\t\tdeprecations.push(key);\n\t\t\t\tconsole.warn(`getting vnode.${property} is deprecated, ${message}`);\n\t\t\t}\n\t\t},\n\t\tset() {\n\t\t\tconst key = 'set' + property + message;\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\n\t\t\t\tdeprecations.push(key);\n\t\t\t\tconsole.warn(`setting vnode.${property} is not allowed, ${message}`);\n\t\t\t}\n\t\t}\n\t});\n\n\tconst deprecatedAttributes = {\n\t\tnodeName: warn('nodeName', 'use vnode.type'),\n\t\tattributes: warn('attributes', 'use vnode.props'),\n\t\tchildren: warn('children', 'use vnode.props.children')\n\t};\n\n\tconst deprecatedProto = Object.create({}, deprecatedAttributes);\n\n\toptions.vnode = vnode => {\n\t\tconst props = vnode.props;\n\t\tif (\n\t\t\tvnode.type !== null &&\n\t\t\tprops != null &&\n\t\t\t('__source' in props || '__self' in props)\n\t\t) {\n\t\t\tconst newProps = (vnode.props = {});\n\t\t\tfor (let i in props) {\n\t\t\t\tconst v = props[i];\n\t\t\t\tif (i === '__source') vnode.__source = v;\n\t\t\t\telse if (i === '__self') vnode.__self = v;\n\t\t\t\telse newProps[i] = v;\n\t\t\t}\n\t\t}\n\n\t\t// eslint-disable-next-line\n\t\tvnode.__proto__ = deprecatedProto;\n\t\tif (oldVnode) oldVnode(vnode);\n\t};\n\n\toptions.diffed = vnode => {\n\t\tconst { type, _parent: parent } = vnode;\n\t\t// Check if the user passed plain objects as children. Note that we cannot\n\t\t// move this check into `options.vnode` because components can receive\n\t\t// children in any shape they want (e.g.\n\t\t// `{{ foo: 123, bar: \"abc\" }}`).\n\t\t// Putting this check in `options.diffed` ensures that\n\t\t// `vnode._children` is set and that we only validate the children\n\t\t// that were actually rendered.\n\t\tif (vnode._children) {\n\t\t\tvnode._children.forEach(child => {\n\t\t\t\tif (typeof child === 'object' && child && child.type === undefined) {\n\t\t\t\t\tconst keys = Object.keys(child).join(',');\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Objects are not valid as a child. Encountered an object with the keys {${keys}}.` +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif (vnode._component === currentComponent) {\n\t\t\trenderCount = 0;\n\t\t}\n\n\t\tif (\n\t\t\ttypeof type === 'string' &&\n\t\t\t(isTableElement(type) ||\n\t\t\t\ttype === 'p' ||\n\t\t\t\ttype === 'a' ||\n\t\t\t\ttype === 'button')\n\t\t) {\n\t\t\t// Avoid false positives when Preact only partially rendered the\n\t\t\t// HTML tree. Whilst we attempt to include the outer DOM in our\n\t\t\t// validation, this wouldn't work on the server for\n\t\t\t// `preact-render-to-string`. There we'd otherwise flood the terminal\n\t\t\t// with false positives, which we'd like to avoid.\n\t\t\tlet domParentName = getClosestDomNodeParentName(parent);\n\t\t\tif (domParentName !== '' && isTableElement(type)) {\n\t\t\t\tif (\n\t\t\t\t\ttype === 'table' &&\n\t\t\t\t\t// Tables can be nested inside each other if it's inside a cell.\n\t\t\t\t\t// See https://developer.mozilla.org/en-US/docs/Learn/HTML/Tables/Advanced#nesting_tables\n\t\t\t\t\tdomParentName !== 'td' &&\n\t\t\t\t\tisTableElement(domParentName)\n\t\t\t\t) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your
should not have a table-node parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (\n\t\t\t\t\t(type === 'thead' || type === 'tfoot' || type === 'tbody') &&\n\t\t\t\t\tdomParentName !== 'table'\n\t\t\t\t) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your should have a
parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (\n\t\t\t\t\ttype === 'tr' &&\n\t\t\t\t\tdomParentName !== 'thead' &&\n\t\t\t\t\tdomParentName !== 'tfoot' &&\n\t\t\t\t\tdomParentName !== 'tbody'\n\t\t\t\t) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your should have a parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (type === 'td' && domParentName !== 'tr') {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (type === 'th' && domParentName !== 'tr') {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your .' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if (type === 'p') {\n\t\t\t\tlet illegalDomChildrenTypes = getDomChildren(vnode).filter(childType =>\n\t\t\t\t\tILLEGAL_PARAGRAPH_CHILD_ELEMENTS.test(childType)\n\t\t\t\t);\n\t\t\t\tif (illegalDomChildrenTypes.length) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of paragraph. Your

should not have ' +\n\t\t\t\t\t\t\tillegalDomChildrenTypes.join(', ') +\n\t\t\t\t\t\t\t' as child-elements.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if (type === 'a' || type === 'button') {\n\t\t\t\tif (getDomChildren(vnode).indexOf(type) !== -1) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`Improper nesting of interactive content. Your <${type}>` +\n\t\t\t\t\t\t\t` should not have other ${type === 'a' ? 'anchor' : 'button'}` +\n\t\t\t\t\t\t\t' tags as child-elements.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\thooksAllowed = false;\n\n\t\tif (oldDiffed) oldDiffed(vnode);\n\n\t\tif (vnode._children != null) {\n\t\t\tconst keys = [];\n\t\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\t\tconst child = vnode._children[i];\n\t\t\t\tif (!child || child.key == null) continue;\n\n\t\t\t\tconst key = child.key;\n\t\t\t\tif (keys.indexOf(key) !== -1) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Following component has two or more children with the ' +\n\t\t\t\t\t\t\t`same key attribute: \"${key}\". This may cause glitches and misbehavior ` +\n\t\t\t\t\t\t\t'in rendering process. Component: \\n\\n' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\n\t\t\t\t\t// Break early to not spam the console\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tkeys.push(key);\n\t\t\t}\n\t\t}\n\n\t\tif (vnode._component != null && vnode._component.__hooks != null) {\n\t\t\t// Validate that none of the hooks in this component contain arguments that are NaN.\n\t\t\t// This is a common mistake that can be hard to debug, so we want to catch it early.\n\t\t\tconst hooks = vnode._component.__hooks._list;\n\t\t\tif (hooks) {\n\t\t\t\tfor (let i = 0; i < hooks.length; i += 1) {\n\t\t\t\t\tconst hook = hooks[i];\n\t\t\t\t\tif (hook._args) {\n\t\t\t\t\t\tfor (let j = 0; j < hook._args.length; j++) {\n\t\t\t\t\t\t\tconst arg = hook._args[j];\n\t\t\t\t\t\t\tif (isNaN(arg)) {\n\t\t\t\t\t\t\t\tconst componentName = getDisplayName(vnode);\n\t\t\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t\t\t`Invalid argument passed to hook. Hooks should not be called with NaN in the dependency array. Hook index ${i} in component ${componentName} was called with NaN.`\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\nconst setState = Component.prototype.setState;\nComponent.prototype.setState = function (update, callback) {\n\tif (this._vnode == null) {\n\t\t// `this._vnode` will be `null` during componentWillMount. But it\n\t\t// is perfectly valid to call `setState` during cWM. So we\n\t\t// need an additional check to verify that we are dealing with a\n\t\t// call inside constructor.\n\t\tif (this.state == null) {\n\t\t\tconsole.warn(\n\t\t\t\t`Calling \"this.setState\" inside the constructor of a component is a ` +\n\t\t\t\t\t`no-op and might be a bug in your application. Instead, set ` +\n\t\t\t\t\t`\"this.state = {}\" directly.\\n\\n${getOwnerStack(getCurrentVNode())}`\n\t\t\t);\n\t\t}\n\t}\n\n\treturn setState.call(this, update, callback);\n};\n\nfunction isTableElement(type) {\n\treturn (\n\t\ttype === 'table' ||\n\t\ttype === 'tfoot' ||\n\t\ttype === 'tbody' ||\n\t\ttype === 'thead' ||\n\t\ttype === 'td' ||\n\t\ttype === 'tr' ||\n\t\ttype === 'th'\n\t);\n}\n\nconst ILLEGAL_PARAGRAPH_CHILD_ELEMENTS =\n\t/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/;\n\nconst forceUpdate = Component.prototype.forceUpdate;\nComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode == null) {\n\t\tconsole.warn(\n\t\t\t`Calling \"this.forceUpdate\" inside the constructor of a component is a ` +\n\t\t\t\t`no-op and might be a bug in your application.\\n\\n${getOwnerStack(\n\t\t\t\t\tgetCurrentVNode()\n\t\t\t\t)}`\n\t\t);\n\t} else if (this._parentDom == null) {\n\t\tconsole.warn(\n\t\t\t`Can't call \"this.forceUpdate\" on an unmounted component. This is a no-op, ` +\n\t\t\t\t`but it indicates a memory leak in your application. To fix, cancel all ` +\n\t\t\t\t`subscriptions and asynchronous tasks in the componentWillUnmount method.` +\n\t\t\t\t`\\n\\n${getOwnerStack(this._vnode)}`\n\t\t);\n\t}\n\treturn forceUpdate.call(this, callback);\n};\n\n/**\n * Serialize a vnode tree to a string\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function serializeVNode(vnode) {\n\tlet { props } = vnode;\n\tlet name = getDisplayName(vnode);\n\n\tlet attrs = '';\n\tfor (let prop in props) {\n\t\tif (props.hasOwnProperty(prop) && prop !== 'children') {\n\t\t\tlet value = props[prop];\n\n\t\t\t// If it is an object but doesn't have toString(), use Object.toString\n\t\t\tif (typeof value == 'function') {\n\t\t\t\tvalue = `function ${value.displayName || value.name}() {}`;\n\t\t\t}\n\n\t\t\tvalue =\n\t\t\t\tObject(value) === value && !value.toString\n\t\t\t\t\t? Object.prototype.toString.call(value)\n\t\t\t\t\t: value + '';\n\n\t\t\tattrs += ` ${prop}=${JSON.stringify(value)}`;\n\t\t}\n\t}\n\n\tlet children = props.children;\n\treturn `<${name}${attrs}${\n\t\tchildren && children.length ? '>..' : ' />'\n\t}`;\n}\n\noptions._hydrationMismatch = (newVNode, excessDomChildren) => {\n\tconst { type } = newVNode;\n\tconst availableTypes = excessDomChildren\n\t\t.map(child => child && child.localName)\n\t\t.filter(Boolean);\n\tconsole.error(\n\t\t`Expected a DOM node of type \"${type}\" but found \"${availableTypes.join(', ')}\" as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\\n\\n${getOwnerStack(newVNode)}`\n\t);\n};\n","export const ELEMENT_NODE = 1;\nexport const DOCUMENT_NODE = 9;\nexport const DOCUMENT_FRAGMENT_NODE = 11;\n","/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\nexport function isNaN(value) {\n\treturn value !== value;\n}\n","import { initDebug } from './debug';\nimport 'preact/devtools';\n\ninitDebug();\n\nexport { resetPropWarnings } from './check-props';\n\nexport {\n\tgetCurrentVNode,\n\tgetDisplayName,\n\tgetOwnerStack\n} from './component-stack';\n"],"names":["loggedTypeFailures","getDisplayName","vnode","type","Fragment","displayName","name","renderStack","ownerStack","getCurrentVNode","length","showJsxSourcePluginWarning","isPossibleOwner","getOwnerStack","stack","next","__o","push","reduce","acc","owner","source","__source","fileName","lineNumber","console","warn","isWeakMapSupported","WeakMap","getDomChildren","domChildren","__k","forEach","child","apply","getClosestDomNodeParentName","parent","__","__e","parentNode","localName","setState","Component","prototype","isTableElement","update","callback","this","__v","state","call","ILLEGAL_PARAGRAPH_CHILD_ELEMENTS","forceUpdate","serializeVNode","props","attrs","prop","hasOwnProperty","value","Object","toString","JSON","stringify","children","__P","options","__m","newVNode","excessDomChildren","availableTypes","map","filter","Boolean","error","join","oldDiff","__b","oldDiffed","diffed","oldRoot","oldVNode","oldRender","__r","pop","setupComponentStack","hooksAllowed","oldBeforeDiff","oldVnode","oldCatchError","oldHook","__h","warnedComponents","useEffect","useLayoutEffect","lazyPropTypes","deprecations","errorInfo","__c","then","promise","Error","componentStack","setTimeout","e","isValid","nodeType","componentName","undefined","Array","isArray","ref","key","propTypes","has","m","lazyVNode","set","values","__f","obj","i","assign","typeSpecs","location","getStack","keys","typeSpecName","message","checkPropTypes","currentComponent","renderCount","nextComponent","comp","index","property","get","indexOf","deprecatedAttributes","nodeName","attributes","deprecatedProto","create","newProps","v","__self","__proto__","domParentName","illegalDomChildrenTypes","childType","test","__H","hooks","hook","j","initDebug"],"mappings":"mDAAA,IAEIA,EAAqB,CAAA,ECMlB,SAASC,EAAeC,GAC9B,OAAIA,EAAMC,OAASC,EAAAA,SACX,WACwB,mBAAdF,EAAMC,KAChBD,EAAMC,KAAKE,aAAeH,EAAMC,KAAKG,KACb,iBAAdJ,EAAMC,KAChBD,EAAMC,KAGP,OACR,CAMA,IAAII,EAAc,GAoBdC,EAAa,YAMDC,IACf,OAAOF,EAAYG,OAAS,EAAIH,EAAYA,EAAYG,OAAS,GAAK,IACvE,CAQA,IAAIC,GAA6B,EAMjC,SAASC,EAAgBV,GACxB,MAA4B,mBAAdA,EAAMC,MAAsBD,EAAMC,MAAQC,EAAAA,QACzD,CAOO,SAASS,EAAcX,GAG7B,IAFA,IAAMY,EAAQ,CAACZ,GACXa,EAAOb,EACW,MAAfa,EAAIC,KACVF,EAAMG,KAAKF,EAAIC,KACfD,EAAOA,EAAIC,IAGZ,OAAOF,EAAMI,OAAO,SAACC,EAAKC,GACzBD,GAAelB,QAAAA,EAAemB,GAE9B,IAAMC,EAASD,EAAME,SAUrB,OATID,EACHF,GAAeE,QAAAA,EAAOE,SAAYF,IAAAA,EAAOG,WAC1C,IAAWb,GACVc,QAAQC,KACP,kLAGFf,GAA6B,EAErBQ,EAAO,IAChB,EAAG,GACJ,CCnFA,IAAMQ,EAAuC,mBAAXC,QAMlC,SAASC,EAAe3B,GACvB,IAAI4B,EAAc,GAElB,OAAK5B,EAAK6B,KAEV7B,EAAK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EAAItH,EAAK6B,IAAWrB,OAAQ8G,IAAK,CAChD,IAAMvF,EAAQ/B,EAAK6B,IAAWyF,GAC9B,GAAKvF,GAAsB,MAAbA,EAAM8E,IAApB,CAEA,IAAMA,EAAM9E,EAAM8E,IAClB,IAA2B,IAAvBc,EAAKW,QAAQzB,GAAa,CAC7BtF,QAAQgD,MACP,8EACyBsC,EADzB,mFAGC1D,EAAenD,GACRW,OAAAA,EAAcX,IAIvB,KACD,CAEA2H,EAAK5G,KAAK8F,GACX,CAGD,GAAwB,MAApB7G,EAAK+F,KAAmD,MAA5B/F,EAAK+F,IAAAqD,IAA6B,CAGjE,IAAMC,EAAQrJ,EAAK+F,IAAAqD,IAAAjH,GACnB,GAAIkH,EACH,IAAK,IAAI/B,EAAI,EAAGA,EAAI+B,EAAM7I,OAAQ8G,GAAK,EAAG,CACzC,IAAMgC,EAAOD,EAAM/B,GACnB,GAAIgC,EAAIF,IACP,IAAK,IAAIG,EAAI,EAAGA,EAAID,EAAIF,IAAO5I,OAAQ+I,IAEtC,IEtde/F,EFqdH8F,EAAIF,IAAOG,KEpdZ/F,EFqdK,CACf,IAAMgD,EAAgBzG,EAAeC,GACrCuB,QAAQC,KAAI,4GACiG8F,EAAC,iBAAiBd,EAC/H,wBACD,CAGH,CAEF,CACD,CACD,CG3eAgD,wGLIO,WACN1J,EAAqB,CAAA,CACtB"} \ No newline at end of file diff --git a/node_modules/preact/debug/dist/debug.mjs b/node_modules/preact/debug/dist/debug.mjs new file mode 100644 index 0000000000000000000000000000000000000000..8c3c2dfe8a75f55a6270b1a92905eb0e65354d29 --- /dev/null +++ b/node_modules/preact/debug/dist/debug.mjs @@ -0,0 +1,2 @@ +import{Fragment as n,options as e,Component as o}from"preact";import"preact/devtools";var t={};function r(){t={}}function a(e){return e.type===n?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var i=[],s=[];function c(){return i.length>0?i[i.length-1]:null}var l=!0;function u(e){return"function"==typeof e.type&&e.type!=n}function f(n){for(var e=[n],o=n;null!=o.__o;)e.push(o.__o),o=o.__o;return e.reduce(function(n,e){n+=" in "+a(e);var o=e.__source;return o?n+=" (at "+o.fileName+":"+o.lineNumber+")":l&&console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons."),l=!1,n+"\n"},"")}var d="function"==typeof WeakMap;function p(n){var e=[];return n.__k?(n.__k.forEach(function(n){n&&"function"==typeof n.type?e.push.apply(e,p(n)):n&&"string"==typeof n.type&&e.push(n.type)}),e):e}function h(n){return n?"function"==typeof n.type?null==n.__?null!=n.__e&&null!=n.__e.parentNode?n.__e.parentNode.localName:"":h(n.__):n.type:""}var v=o.prototype.setState;function y(n){return"table"===n||"tfoot"===n||"tbody"===n||"thead"===n||"td"===n||"tr"===n||"th"===n}o.prototype.setState=function(n,e){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+f(c())),v.call(this,n,e)};var m=/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/,b=o.prototype.forceUpdate;function w(n){var e=n.props,o=a(n),t="";for(var r in e)if(e.hasOwnProperty(r)&&"children"!==r){var i=e[r];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),t+=" "+r+"="+JSON.stringify(i)}var s=e.children;return"<"+o+t+(s&&s.length?">..":" />")}o.prototype.forceUpdate=function(n){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+f(c())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+f(this.__v)),b.call(this,n)},e.__m=function(n,e){var o=n.type,t=e.map(function(n){return n&&n.localName}).filter(Boolean);console.error('Expected a DOM node of type "'+o+'" but found "'+t.join(", ")+"\" as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n"+f(n))},function(){!function(){var n=e.__b,o=e.diffed,t=e.__,r=e.vnode,a=e.__r;e.diffed=function(n){u(n)&&s.pop(),i.pop(),o&&o(n)},e.__b=function(e){u(e)&&i.push(e),n&&n(e)},e.__=function(n,e){s=[],t&&t(n,e)},e.vnode=function(n){n.__o=s.length>0?s[s.length-1]:null,r&&r(n)},e.__r=function(n){u(n)&&s.push(n),a&&a(n)}}();var n=!1,o=e.__b,r=e.diffed,c=e.vnode,l=e.__r,v=e.__e,b=e.__,g=e.__h,E=d?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,k=[];e.__e=function(n,e,o,t){if(e&&e.__c&&"function"==typeof n.then){var r=n;n=new Error("Missing Suspense. The throwing component was: "+a(e));for(var i=e;i;i=i.__)if(i.__c&&i.__c.__c){n=r;break}if(n instanceof Error)throw n}try{(t=t||{}).componentStack=f(e),v(n,e,o,t),"function"!=typeof n.then&&setTimeout(function(){throw n})}catch(n){throw n}},e.__=function(n,e){if(!e)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var o;switch(e.nodeType){case 1:case 11:case 9:o=!0;break;default:o=!1}if(!o){var t=a(n);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+e+" instead: render(<"+t+" />, "+e+");")}b&&b(n,e)},e.__b=function(e){var r=e.type;if(n=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+w(e)+"\n\n"+f(e));if(null!=r&&"object"==typeof r){if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+a(e)+" = "+w(r)+";\n let vnode = ;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+f(e));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if(void 0!==e.ref&&"function"!=typeof e.ref&&"object"!=typeof e.ref&&!("$$typeof"in e))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof e.ref+"] instead\n"+w(e)+"\n\n"+f(e));if("string"==typeof e.type)for(var i in e.props)if("o"===i[0]&&"n"===i[1]&&"function"!=typeof e.props[i]&&null!=e.props[i])throw new Error("Component's \""+i+'" property should be a function, but got ['+typeof e.props[i]+"] instead\n"+w(e)+"\n\n"+f(e));if("function"==typeof e.type&&e.type.propTypes){if("Lazy"===e.type.displayName&&E&&!E.lazyPropTypes.has(e.type)){var s="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var c=e.type();E.lazyPropTypes.set(e.type,!0),console.warn(s+"Component wrapped in lazy() is "+a(c))}catch(n){console.warn(s+"We will log the wrapped component's name once it is loaded.")}}var l=e.props;e.type.__f&&delete(l=function(n,e){for(var o in e)n[o]=e[o];return n}({},l)).ref,function(n,e,o,r,a){Object.keys(n).forEach(function(o){var i;try{i=n[o](e,o,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(n){i=n}i&&!(i.message in t)&&(t[i.message]=!0,console.error("Failed prop type: "+i.message+(a&&"\n"+a()||"")))})}(e.type.propTypes,l,0,a(e),function(){return f(e)})}o&&o(e)};var T,_=0;e.__r=function(e){l&&l(e),n=!0;var o=e.__c;if(o===T?_++:_=1,_>=25)throw new Error("Too many re-renders. This is limited to prevent an infinite loop which may lock up your browser. The component causing this is: "+a(e));T=o},e.__h=function(e,o,t){if(!e||!n)throw new Error("Hook can only be invoked from render methods.");g&&g(e,o,t)};var O=function(n,e){return{get:function(){var o="get"+n+e;k&&k.indexOf(o)<0&&(k.push(o),console.warn("getting vnode."+n+" is deprecated, "+e))},set:function(){var o="set"+n+e;k&&k.indexOf(o)<0&&(k.push(o),console.warn("setting vnode."+n+" is not allowed, "+e))}}},I={nodeName:O("nodeName","use vnode.type"),attributes:O("attributes","use vnode.props"),children:O("children","use vnode.props.children")},M=Object.create({},I);e.vnode=function(n){var e=n.props;if(null!==n.type&&null!=e&&("__source"in e||"__self"in e)){var o=n.props={};for(var t in e){var r=e[t];"__source"===t?n.__source=r:"__self"===t?n.__self=r:o[t]=r}}n.__proto__=M,c&&c(n)},e.diffed=function(e){var o,t=e.type,i=e.__;if(e.__k&&e.__k.forEach(function(n){if("object"==typeof n&&n&&void 0===n.type){var o=Object.keys(n).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+o+"}.\n\n"+f(e))}}),e.__c===T&&(_=0),"string"==typeof t&&(y(t)||"p"===t||"a"===t||"button"===t)){var s=h(i);if(""!==s&&y(t))"table"===t&&"td"!==s&&y(s)?console.error("Improper nesting of table. Your

should have a
should have a
should not have a table-node parent."+w(e)+"\n\n"+f(e)):"thead"!==t&&"tfoot"!==t&&"tbody"!==t||"table"===s?"tr"===t&&"thead"!==s&&"tfoot"!==s&&"tbody"!==s?console.error("Improper nesting of table. Your should have a parent."+w(e)+"\n\n"+f(e)):"td"===t&&"tr"!==s?console.error("Improper nesting of table. Your parent."+w(e)+"\n\n"+f(e)):"th"===t&&"tr"!==s&&console.error("Improper nesting of table. Your ."+w(e)+"\n\n"+f(e)):console.error("Improper nesting of table. Your should have a
should have a
should have a
parent."+w(e)+"\n\n"+f(e));else if("p"===t){var c=p(e).filter(function(n){return m.test(n)});c.length&&console.error("Improper nesting of paragraph. Your

should not have "+c.join(", ")+" as child-elements."+w(e)+"\n\n"+f(e))}else"a"!==t&&"button"!==t||-1!==p(e).indexOf(t)&&console.error("Improper nesting of interactive content. Your <"+t+"> should not have other "+("a"===t?"anchor":"button")+" tags as child-elements."+w(e)+"\n\n"+f(e))}if(n=!1,r&&r(e),null!=e.__k)for(var l=[],u=0;u0?i[i.length-1]:null}var l=!0;function u(e){return"function"==typeof e.type&&e.type!=n}function f(n){for(var e=[n],o=n;null!=o.__o;)e.push(o.__o),o=o.__o;return e.reduce(function(n,e){n+=" in "+a(e);var o=e.__source;return o?n+=" (at "+o.fileName+":"+o.lineNumber+")":l&&console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons."),l=!1,n+"\n"},"")}var d="function"==typeof WeakMap;function p(n){var e=[];return n.__k?(n.__k.forEach(function(n){n&&"function"==typeof n.type?e.push.apply(e,p(n)):n&&"string"==typeof n.type&&e.push(n.type)}),e):e}function h(n){return n?"function"==typeof n.type?null==n.__?null!=n.__e&&null!=n.__e.parentNode?n.__e.parentNode.localName:"":h(n.__):n.type:""}var v=o.prototype.setState;function y(n){return"table"===n||"tfoot"===n||"tbody"===n||"thead"===n||"td"===n||"tr"===n||"th"===n}o.prototype.setState=function(n,e){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+f(c())),v.call(this,n,e)};var m=/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/,b=o.prototype.forceUpdate;function w(n){var e=n.props,o=a(n),t="";for(var r in e)if(e.hasOwnProperty(r)&&"children"!==r){var i=e[r];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),t+=" "+r+"="+JSON.stringify(i)}var s=e.children;return"<"+o+t+(s&&s.length?">..":" />")}o.prototype.forceUpdate=function(n){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+f(c())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+f(this.__v)),b.call(this,n)},e.__m=function(n,e){var o=n.type,t=e.map(function(n){return n&&n.localName}).filter(Boolean);console.error('Expected a DOM node of type "'+o+'" but found "'+t.join(", ")+"\" as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n"+f(n))},function(){!function(){var n=e.__b,o=e.diffed,t=e.__,r=e.vnode,a=e.__r;e.diffed=function(n){u(n)&&s.pop(),i.pop(),o&&o(n)},e.__b=function(e){u(e)&&i.push(e),n&&n(e)},e.__=function(n,e){s=[],t&&t(n,e)},e.vnode=function(n){n.__o=s.length>0?s[s.length-1]:null,r&&r(n)},e.__r=function(n){u(n)&&s.push(n),a&&a(n)}}();var n=!1,o=e.__b,r=e.diffed,c=e.vnode,l=e.__r,v=e.__e,b=e.__,g=e.__h,E=d?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,k=[];e.__e=function(n,e,o,t){if(e&&e.__c&&"function"==typeof n.then){var r=n;n=new Error("Missing Suspense. The throwing component was: "+a(e));for(var i=e;i;i=i.__)if(i.__c&&i.__c.__c){n=r;break}if(n instanceof Error)throw n}try{(t=t||{}).componentStack=f(e),v(n,e,o,t),"function"!=typeof n.then&&setTimeout(function(){throw n})}catch(n){throw n}},e.__=function(n,e){if(!e)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var o;switch(e.nodeType){case 1:case 11:case 9:o=!0;break;default:o=!1}if(!o){var t=a(n);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+e+" instead: render(<"+t+" />, "+e+");")}b&&b(n,e)},e.__b=function(e){var r=e.type;if(n=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+w(e)+"\n\n"+f(e));if(null!=r&&"object"==typeof r){if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+a(e)+" = "+w(r)+";\n let vnode = ;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+f(e));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if(void 0!==e.ref&&"function"!=typeof e.ref&&"object"!=typeof e.ref&&!("$$typeof"in e))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof e.ref+"] instead\n"+w(e)+"\n\n"+f(e));if("string"==typeof e.type)for(var i in e.props)if("o"===i[0]&&"n"===i[1]&&"function"!=typeof e.props[i]&&null!=e.props[i])throw new Error("Component's \""+i+'" property should be a function, but got ['+typeof e.props[i]+"] instead\n"+w(e)+"\n\n"+f(e));if("function"==typeof e.type&&e.type.propTypes){if("Lazy"===e.type.displayName&&E&&!E.lazyPropTypes.has(e.type)){var s="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var c=e.type();E.lazyPropTypes.set(e.type,!0),console.warn(s+"Component wrapped in lazy() is "+a(c))}catch(n){console.warn(s+"We will log the wrapped component's name once it is loaded.")}}var l=e.props;e.type.__f&&delete(l=function(n,e){for(var o in e)n[o]=e[o];return n}({},l)).ref,function(n,e,o,r,a){Object.keys(n).forEach(function(o){var i;try{i=n[o](e,o,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(n){i=n}i&&!(i.message in t)&&(t[i.message]=!0,console.error("Failed prop type: "+i.message+(a&&"\n"+a()||"")))})}(e.type.propTypes,l,0,a(e),function(){return f(e)})}o&&o(e)};var T,_=0;e.__r=function(e){l&&l(e),n=!0;var o=e.__c;if(o===T?_++:_=1,_>=25)throw new Error("Too many re-renders. This is limited to prevent an infinite loop which may lock up your browser. The component causing this is: "+a(e));T=o},e.__h=function(e,o,t){if(!e||!n)throw new Error("Hook can only be invoked from render methods.");g&&g(e,o,t)};var O=function(n,e){return{get:function(){var o="get"+n+e;k&&k.indexOf(o)<0&&(k.push(o),console.warn("getting vnode."+n+" is deprecated, "+e))},set:function(){var o="set"+n+e;k&&k.indexOf(o)<0&&(k.push(o),console.warn("setting vnode."+n+" is not allowed, "+e))}}},I={nodeName:O("nodeName","use vnode.type"),attributes:O("attributes","use vnode.props"),children:O("children","use vnode.props.children")},M=Object.create({},I);e.vnode=function(n){var e=n.props;if(null!==n.type&&null!=e&&("__source"in e||"__self"in e)){var o=n.props={};for(var t in e){var r=e[t];"__source"===t?n.__source=r:"__self"===t?n.__self=r:o[t]=r}}n.__proto__=M,c&&c(n)},e.diffed=function(e){var o,t=e.type,i=e.__;if(e.__k&&e.__k.forEach(function(n){if("object"==typeof n&&n&&void 0===n.type){var o=Object.keys(n).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+o+"}.\n\n"+f(e))}}),e.__c===T&&(_=0),"string"==typeof t&&(y(t)||"p"===t||"a"===t||"button"===t)){var s=h(i);if(""!==s&&y(t))"table"===t&&"td"!==s&&y(s)?console.error("Improper nesting of table. Your

should not have a table-node parent."+w(e)+"\n\n"+f(e)):"thead"!==t&&"tfoot"!==t&&"tbody"!==t||"table"===s?"tr"===t&&"thead"!==s&&"tfoot"!==s&&"tbody"!==s?console.error("Improper nesting of table. Your should have a parent."+w(e)+"\n\n"+f(e)):"td"===t&&"tr"!==s?console.error("Improper nesting of table. Your parent."+w(e)+"\n\n"+f(e)):"th"===t&&"tr"!==s&&console.error("Improper nesting of table. Your ."+w(e)+"\n\n"+f(e)):console.error("Improper nesting of table. Your should have a
should have a
should have a
parent."+w(e)+"\n\n"+f(e));else if("p"===t){var c=p(e).filter(function(n){return m.test(n)});c.length&&console.error("Improper nesting of paragraph. Your

should not have "+c.join(", ")+" as child-elements."+w(e)+"\n\n"+f(e))}else"a"!==t&&"button"!==t||-1!==p(e).indexOf(t)&&console.error("Improper nesting of interactive content. Your <"+t+"> should not have other "+("a"===t?"anchor":"button")+" tags as child-elements."+w(e)+"\n\n"+f(e))}if(n=!1,r&&r(e),null!=e.__k)for(var l=[],u=0;u {\n\t\tlet error;\n\t\ttry {\n\t\t\terror = typeSpecs[typeSpecName](\n\t\t\t\tvalues,\n\t\t\t\ttypeSpecName,\n\t\t\t\tcomponentName,\n\t\t\t\tlocation,\n\t\t\t\tnull,\n\t\t\t\tReactPropTypesSecret\n\t\t\t);\n\t\t} catch (e) {\n\t\t\terror = e;\n\t\t}\n\t\tif (error && !(error.message in loggedTypeFailures)) {\n\t\t\tloggedTypeFailures[error.message] = true;\n\t\t\tconsole.error(\n\t\t\t\t`Failed ${location} type: ${error.message}${\n\t\t\t\t\t(getStack && `\\n${getStack()}`) || ''\n\t\t\t\t}`\n\t\t\t);\n\t\t}\n\t});\n}\n","import { options, Fragment } from 'preact';\n\n/**\n * Get human readable name of the component/dom node\n * @param {import('./internal').VNode} vnode\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function getDisplayName(vnode) {\n\tif (vnode.type === Fragment) {\n\t\treturn 'Fragment';\n\t} else if (typeof vnode.type == 'function') {\n\t\treturn vnode.type.displayName || vnode.type.name;\n\t} else if (typeof vnode.type == 'string') {\n\t\treturn vnode.type;\n\t}\n\n\treturn '#text';\n}\n\n/**\n * Used to keep track of the currently rendered `vnode` and print it\n * in debug messages.\n */\nlet renderStack = [];\n\n/**\n * Keep track of the current owners. An owner describes a component\n * which was responsible to render a specific `vnode`. This exclude\n * children that are passed via `props.children`, because they belong\n * to the parent owner.\n *\n * ```jsx\n * const Foo = props =>

{props.children}
// div's owner is Foo\n * const Bar = props => {\n * return (\n * // Foo's owner is Bar, span's owner is Bar\n * )\n * }\n * ```\n *\n * Note: A `vnode` may be hoisted to the root scope due to compiler\n * optimiztions. In these cases the `_owner` will be different.\n */\nlet ownerStack = [];\n\n/**\n * Get the currently rendered `vnode`\n * @returns {import('./internal').VNode | null}\n */\nexport function getCurrentVNode() {\n\treturn renderStack.length > 0 ? renderStack[renderStack.length - 1] : null;\n}\n\n/**\n * If the user doesn't have `@babel/plugin-transform-react-jsx-source`\n * somewhere in his tool chain we can't print the filename and source\n * location of a component. In that case we just omit that, but we'll\n * print a helpful message to the console, notifying the user of it.\n */\nlet showJsxSourcePluginWarning = true;\n\n/**\n * Check if a `vnode` is a possible owner.\n * @param {import('./internal').VNode} vnode\n */\nfunction isPossibleOwner(vnode) {\n\treturn typeof vnode.type == 'function' && vnode.type != Fragment;\n}\n\n/**\n * Return the component stack that was captured up to this point.\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function getOwnerStack(vnode) {\n\tconst stack = [vnode];\n\tlet next = vnode;\n\twhile (next._owner != null) {\n\t\tstack.push(next._owner);\n\t\tnext = next._owner;\n\t}\n\n\treturn stack.reduce((acc, owner) => {\n\t\tacc += ` in ${getDisplayName(owner)}`;\n\n\t\tconst source = owner.__source;\n\t\tif (source) {\n\t\t\tacc += ` (at ${source.fileName}:${source.lineNumber})`;\n\t\t} else if (showJsxSourcePluginWarning) {\n\t\t\tconsole.warn(\n\t\t\t\t'Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.'\n\t\t\t);\n\t\t}\n\t\tshowJsxSourcePluginWarning = false;\n\n\t\treturn (acc += '\\n');\n\t}, '');\n}\n\n/**\n * Setup code to capture the component trace while rendering. Note that\n * we cannot simply traverse `vnode._parent` upwards, because we have some\n * debug messages for `this.setState` where the `vnode` is `undefined`.\n */\nexport function setupComponentStack() {\n\tlet oldDiff = options._diff;\n\tlet oldDiffed = options.diffed;\n\tlet oldRoot = options._root;\n\tlet oldVNode = options.vnode;\n\tlet oldRender = options._render;\n\n\toptions.diffed = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\townerStack.pop();\n\t\t}\n\t\trenderStack.pop();\n\t\tif (oldDiffed) oldDiffed(vnode);\n\t};\n\n\toptions._diff = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\trenderStack.push(vnode);\n\t\t}\n\t\tif (oldDiff) oldDiff(vnode);\n\t};\n\n\toptions._root = (vnode, parent) => {\n\t\townerStack = [];\n\t\tif (oldRoot) oldRoot(vnode, parent);\n\t};\n\n\toptions.vnode = vnode => {\n\t\tvnode._owner =\n\t\t\townerStack.length > 0 ? ownerStack[ownerStack.length - 1] : null;\n\t\tif (oldVNode) oldVNode(vnode);\n\t};\n\n\toptions._render = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\townerStack.push(vnode);\n\t\t}\n\n\t\tif (oldRender) oldRender(vnode);\n\t};\n}\n","import { checkPropTypes } from './check-props';\nimport { options, Component } from 'preact';\nimport {\n\tELEMENT_NODE,\n\tDOCUMENT_NODE,\n\tDOCUMENT_FRAGMENT_NODE\n} from './constants';\nimport {\n\tgetOwnerStack,\n\tsetupComponentStack,\n\tgetCurrentVNode,\n\tgetDisplayName\n} from './component-stack';\nimport { assign, isNaN } from './util';\n\nconst isWeakMapSupported = typeof WeakMap == 'function';\n\n/**\n * @param {import('./internal').VNode} vnode\n * @returns {Array}\n */\nfunction getDomChildren(vnode) {\n\tlet domChildren = [];\n\n\tif (!vnode._children) return domChildren;\n\n\tvnode._children.forEach(child => {\n\t\tif (child && typeof child.type === 'function') {\n\t\t\tdomChildren.push.apply(domChildren, getDomChildren(child));\n\t\t} else if (child && typeof child.type === 'string') {\n\t\t\tdomChildren.push(child.type);\n\t\t}\n\t});\n\n\treturn domChildren;\n}\n\n/**\n * @param {import('./internal').VNode} parent\n * @returns {string}\n */\nfunction getClosestDomNodeParentName(parent) {\n\tif (!parent) return '';\n\tif (typeof parent.type == 'function') {\n\t\tif (parent._parent == null) {\n\t\t\tif (parent._dom != null && parent._dom.parentNode != null) {\n\t\t\t\treturn parent._dom.parentNode.localName;\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\t\treturn getClosestDomNodeParentName(parent._parent);\n\t}\n\treturn /** @type {string} */ (parent.type);\n}\n\nexport function initDebug() {\n\tsetupComponentStack();\n\n\tlet hooksAllowed = false;\n\n\t/* eslint-disable no-console */\n\tlet oldBeforeDiff = options._diff;\n\tlet oldDiffed = options.diffed;\n\tlet oldVnode = options.vnode;\n\tlet oldRender = options._render;\n\tlet oldCatchError = options._catchError;\n\tlet oldRoot = options._root;\n\tlet oldHook = options._hook;\n\tconst warnedComponents = !isWeakMapSupported\n\t\t? null\n\t\t: {\n\t\t\t\tuseEffect: new WeakMap(),\n\t\t\t\tuseLayoutEffect: new WeakMap(),\n\t\t\t\tlazyPropTypes: new WeakMap()\n\t\t\t};\n\tconst deprecations = [];\n\n\toptions._catchError = (error, vnode, oldVNode, errorInfo) => {\n\t\tlet component = vnode && vnode._component;\n\t\tif (component && typeof error.then == 'function') {\n\t\t\tconst promise = error;\n\t\t\terror = new Error(\n\t\t\t\t`Missing Suspense. The throwing component was: ${getDisplayName(vnode)}`\n\t\t\t);\n\n\t\t\tlet parent = vnode;\n\t\t\tfor (; parent; parent = parent._parent) {\n\t\t\t\tif (parent._component && parent._component._childDidSuspend) {\n\t\t\t\t\terror = promise;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// We haven't recovered and we know at this point that there is no\n\t\t\t// Suspense component higher up in the tree\n\t\t\tif (error instanceof Error) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\terrorInfo = errorInfo || {};\n\t\t\terrorInfo.componentStack = getOwnerStack(vnode);\n\t\t\toldCatchError(error, vnode, oldVNode, errorInfo);\n\n\t\t\t// when an error was handled by an ErrorBoundary we will nonetheless emit an error\n\t\t\t// event on the window object. This is to make up for react compatibility in dev mode\n\t\t\t// and thus make the Next.js dev overlay work.\n\t\t\tif (typeof error.then != 'function') {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tthrow e;\n\t\t}\n\t};\n\n\toptions._root = (vnode, parentNode) => {\n\t\tif (!parentNode) {\n\t\t\tthrow new Error(\n\t\t\t\t'Undefined parent passed to render(), this is the second argument.\\n' +\n\t\t\t\t\t'Check if the element is available in the DOM/has the correct id.'\n\t\t\t);\n\t\t}\n\n\t\tlet isValid;\n\t\tswitch (parentNode.nodeType) {\n\t\t\tcase ELEMENT_NODE:\n\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\tcase DOCUMENT_NODE:\n\t\t\t\tisValid = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tisValid = false;\n\t\t}\n\n\t\tif (!isValid) {\n\t\t\tlet componentName = getDisplayName(vnode);\n\t\t\tthrow new Error(\n\t\t\t\t`Expected a valid HTML node as a second argument to render.\tReceived ${parentNode} instead: render(<${componentName} />, ${parentNode});`\n\t\t\t);\n\t\t}\n\n\t\tif (oldRoot) oldRoot(vnode, parentNode);\n\t};\n\n\toptions._diff = vnode => {\n\t\tlet { type } = vnode;\n\n\t\thooksAllowed = true;\n\n\t\tif (type === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t'Undefined component passed to createElement()\\n\\n' +\n\t\t\t\t\t'You likely forgot to export your component or might have mixed up default and named imports' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t} else if (type != null && typeof type == 'object') {\n\t\t\tif (type._children !== undefined && type._dom !== undefined) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Invalid type passed to createElement(): ${type}\\n\\n` +\n\t\t\t\t\t\t'Did you accidentally pass a JSX literal as JSX twice?\\n\\n' +\n\t\t\t\t\t\t` let My${getDisplayName(vnode)} = ${serializeVNode(type)};\\n` +\n\t\t\t\t\t\t` let vnode = ;\\n\\n` +\n\t\t\t\t\t\t'This usually happens when you export a JSX literal and not the component.' +\n\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthrow new Error(\n\t\t\t\t'Invalid type passed to createElement(): ' +\n\t\t\t\t\t(Array.isArray(type) ? 'array' : type)\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tvnode.ref !== undefined &&\n\t\t\ttypeof vnode.ref != 'function' &&\n\t\t\ttypeof vnode.ref != 'object' &&\n\t\t\t!('$$typeof' in vnode) // allow string refs when preact-compat is installed\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t`Component's \"ref\" property should be a function, or an object created ` +\n\t\t\t\t\t`by createRef(), but got [${typeof vnode.ref}] instead\\n` +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t}\n\n\t\tif (typeof vnode.type == 'string') {\n\t\t\tfor (const key in vnode.props) {\n\t\t\t\tif (\n\t\t\t\t\tkey[0] === 'o' &&\n\t\t\t\t\tkey[1] === 'n' &&\n\t\t\t\t\ttypeof vnode.props[key] != 'function' &&\n\t\t\t\t\tvnode.props[key] != null\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Component's \"${key}\" property should be a function, ` +\n\t\t\t\t\t\t\t`but got [${typeof vnode.props[key]}] instead\\n` +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check prop-types if available\n\t\tif (typeof vnode.type == 'function' && vnode.type.propTypes) {\n\t\t\tif (\n\t\t\t\tvnode.type.displayName === 'Lazy' &&\n\t\t\t\twarnedComponents &&\n\t\t\t\t!warnedComponents.lazyPropTypes.has(vnode.type)\n\t\t\t) {\n\t\t\t\tconst m =\n\t\t\t\t\t'PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ';\n\t\t\t\ttry {\n\t\t\t\t\tconst lazyVNode = vnode.type();\n\t\t\t\t\twarnedComponents.lazyPropTypes.set(vnode.type, true);\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\tm + `Component wrapped in lazy() is ${getDisplayName(lazyVNode)}`\n\t\t\t\t\t);\n\t\t\t\t} catch (promise) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\tm + \"We will log the wrapped component's name once it is loaded.\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet values = vnode.props;\n\t\t\tif (vnode.type._forwarded) {\n\t\t\t\tvalues = assign({}, values);\n\t\t\t\tdelete values.ref;\n\t\t\t}\n\n\t\t\tcheckPropTypes(\n\t\t\t\tvnode.type.propTypes,\n\t\t\t\tvalues,\n\t\t\t\t'prop',\n\t\t\t\tgetDisplayName(vnode),\n\t\t\t\t() => getOwnerStack(vnode)\n\t\t\t);\n\t\t}\n\n\t\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n\t};\n\n\tlet renderCount = 0;\n\tlet currentComponent;\n\toptions._render = vnode => {\n\t\tif (oldRender) {\n\t\t\toldRender(vnode);\n\t\t}\n\t\thooksAllowed = true;\n\n\t\tconst nextComponent = vnode._component;\n\t\tif (nextComponent === currentComponent) {\n\t\t\trenderCount++;\n\t\t} else {\n\t\t\trenderCount = 1;\n\t\t}\n\n\t\tif (renderCount >= 25) {\n\t\t\tthrow new Error(\n\t\t\t\t`Too many re-renders. This is limited to prevent an infinite loop ` +\n\t\t\t\t\t`which may lock up your browser. The component causing this is: ${getDisplayName(\n\t\t\t\t\t\tvnode\n\t\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\n\t\tcurrentComponent = nextComponent;\n\t};\n\n\toptions._hook = (comp, index, type) => {\n\t\tif (!comp || !hooksAllowed) {\n\t\t\tthrow new Error('Hook can only be invoked from render methods.');\n\t\t}\n\n\t\tif (oldHook) oldHook(comp, index, type);\n\t};\n\n\t// Ideally we'd want to print a warning once per component, but we\n\t// don't have access to the vnode that triggered it here. As a\n\t// compromise and to avoid flooding the console with warnings we\n\t// print each deprecation warning only once.\n\tconst warn = (property, message) => ({\n\t\tget() {\n\t\t\tconst key = 'get' + property + message;\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\n\t\t\t\tdeprecations.push(key);\n\t\t\t\tconsole.warn(`getting vnode.${property} is deprecated, ${message}`);\n\t\t\t}\n\t\t},\n\t\tset() {\n\t\t\tconst key = 'set' + property + message;\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\n\t\t\t\tdeprecations.push(key);\n\t\t\t\tconsole.warn(`setting vnode.${property} is not allowed, ${message}`);\n\t\t\t}\n\t\t}\n\t});\n\n\tconst deprecatedAttributes = {\n\t\tnodeName: warn('nodeName', 'use vnode.type'),\n\t\tattributes: warn('attributes', 'use vnode.props'),\n\t\tchildren: warn('children', 'use vnode.props.children')\n\t};\n\n\tconst deprecatedProto = Object.create({}, deprecatedAttributes);\n\n\toptions.vnode = vnode => {\n\t\tconst props = vnode.props;\n\t\tif (\n\t\t\tvnode.type !== null &&\n\t\t\tprops != null &&\n\t\t\t('__source' in props || '__self' in props)\n\t\t) {\n\t\t\tconst newProps = (vnode.props = {});\n\t\t\tfor (let i in props) {\n\t\t\t\tconst v = props[i];\n\t\t\t\tif (i === '__source') vnode.__source = v;\n\t\t\t\telse if (i === '__self') vnode.__self = v;\n\t\t\t\telse newProps[i] = v;\n\t\t\t}\n\t\t}\n\n\t\t// eslint-disable-next-line\n\t\tvnode.__proto__ = deprecatedProto;\n\t\tif (oldVnode) oldVnode(vnode);\n\t};\n\n\toptions.diffed = vnode => {\n\t\tconst { type, _parent: parent } = vnode;\n\t\t// Check if the user passed plain objects as children. Note that we cannot\n\t\t// move this check into `options.vnode` because components can receive\n\t\t// children in any shape they want (e.g.\n\t\t// `{{ foo: 123, bar: \"abc\" }}`).\n\t\t// Putting this check in `options.diffed` ensures that\n\t\t// `vnode._children` is set and that we only validate the children\n\t\t// that were actually rendered.\n\t\tif (vnode._children) {\n\t\t\tvnode._children.forEach(child => {\n\t\t\t\tif (typeof child === 'object' && child && child.type === undefined) {\n\t\t\t\t\tconst keys = Object.keys(child).join(',');\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Objects are not valid as a child. Encountered an object with the keys {${keys}}.` +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif (vnode._component === currentComponent) {\n\t\t\trenderCount = 0;\n\t\t}\n\n\t\tif (\n\t\t\ttypeof type === 'string' &&\n\t\t\t(isTableElement(type) ||\n\t\t\t\ttype === 'p' ||\n\t\t\t\ttype === 'a' ||\n\t\t\t\ttype === 'button')\n\t\t) {\n\t\t\t// Avoid false positives when Preact only partially rendered the\n\t\t\t// HTML tree. Whilst we attempt to include the outer DOM in our\n\t\t\t// validation, this wouldn't work on the server for\n\t\t\t// `preact-render-to-string`. There we'd otherwise flood the terminal\n\t\t\t// with false positives, which we'd like to avoid.\n\t\t\tlet domParentName = getClosestDomNodeParentName(parent);\n\t\t\tif (domParentName !== '' && isTableElement(type)) {\n\t\t\t\tif (\n\t\t\t\t\ttype === 'table' &&\n\t\t\t\t\t// Tables can be nested inside each other if it's inside a cell.\n\t\t\t\t\t// See https://developer.mozilla.org/en-US/docs/Learn/HTML/Tables/Advanced#nesting_tables\n\t\t\t\t\tdomParentName !== 'td' &&\n\t\t\t\t\tisTableElement(domParentName)\n\t\t\t\t) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your
should not have a table-node parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (\n\t\t\t\t\t(type === 'thead' || type === 'tfoot' || type === 'tbody') &&\n\t\t\t\t\tdomParentName !== 'table'\n\t\t\t\t) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your should have a
parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (\n\t\t\t\t\ttype === 'tr' &&\n\t\t\t\t\tdomParentName !== 'thead' &&\n\t\t\t\t\tdomParentName !== 'tfoot' &&\n\t\t\t\t\tdomParentName !== 'tbody'\n\t\t\t\t) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your should have a parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (type === 'td' && domParentName !== 'tr') {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (type === 'th' && domParentName !== 'tr') {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your .' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if (type === 'p') {\n\t\t\t\tlet illegalDomChildrenTypes = getDomChildren(vnode).filter(childType =>\n\t\t\t\t\tILLEGAL_PARAGRAPH_CHILD_ELEMENTS.test(childType)\n\t\t\t\t);\n\t\t\t\tif (illegalDomChildrenTypes.length) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of paragraph. Your

should not have ' +\n\t\t\t\t\t\t\tillegalDomChildrenTypes.join(', ') +\n\t\t\t\t\t\t\t' as child-elements.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if (type === 'a' || type === 'button') {\n\t\t\t\tif (getDomChildren(vnode).indexOf(type) !== -1) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`Improper nesting of interactive content. Your <${type}>` +\n\t\t\t\t\t\t\t` should not have other ${type === 'a' ? 'anchor' : 'button'}` +\n\t\t\t\t\t\t\t' tags as child-elements.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\thooksAllowed = false;\n\n\t\tif (oldDiffed) oldDiffed(vnode);\n\n\t\tif (vnode._children != null) {\n\t\t\tconst keys = [];\n\t\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\t\tconst child = vnode._children[i];\n\t\t\t\tif (!child || child.key == null) continue;\n\n\t\t\t\tconst key = child.key;\n\t\t\t\tif (keys.indexOf(key) !== -1) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Following component has two or more children with the ' +\n\t\t\t\t\t\t\t`same key attribute: \"${key}\". This may cause glitches and misbehavior ` +\n\t\t\t\t\t\t\t'in rendering process. Component: \\n\\n' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\n\t\t\t\t\t// Break early to not spam the console\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tkeys.push(key);\n\t\t\t}\n\t\t}\n\n\t\tif (vnode._component != null && vnode._component.__hooks != null) {\n\t\t\t// Validate that none of the hooks in this component contain arguments that are NaN.\n\t\t\t// This is a common mistake that can be hard to debug, so we want to catch it early.\n\t\t\tconst hooks = vnode._component.__hooks._list;\n\t\t\tif (hooks) {\n\t\t\t\tfor (let i = 0; i < hooks.length; i += 1) {\n\t\t\t\t\tconst hook = hooks[i];\n\t\t\t\t\tif (hook._args) {\n\t\t\t\t\t\tfor (let j = 0; j < hook._args.length; j++) {\n\t\t\t\t\t\t\tconst arg = hook._args[j];\n\t\t\t\t\t\t\tif (isNaN(arg)) {\n\t\t\t\t\t\t\t\tconst componentName = getDisplayName(vnode);\n\t\t\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t\t\t`Invalid argument passed to hook. Hooks should not be called with NaN in the dependency array. Hook index ${i} in component ${componentName} was called with NaN.`\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\nconst setState = Component.prototype.setState;\nComponent.prototype.setState = function (update, callback) {\n\tif (this._vnode == null) {\n\t\t// `this._vnode` will be `null` during componentWillMount. But it\n\t\t// is perfectly valid to call `setState` during cWM. So we\n\t\t// need an additional check to verify that we are dealing with a\n\t\t// call inside constructor.\n\t\tif (this.state == null) {\n\t\t\tconsole.warn(\n\t\t\t\t`Calling \"this.setState\" inside the constructor of a component is a ` +\n\t\t\t\t\t`no-op and might be a bug in your application. Instead, set ` +\n\t\t\t\t\t`\"this.state = {}\" directly.\\n\\n${getOwnerStack(getCurrentVNode())}`\n\t\t\t);\n\t\t}\n\t}\n\n\treturn setState.call(this, update, callback);\n};\n\nfunction isTableElement(type) {\n\treturn (\n\t\ttype === 'table' ||\n\t\ttype === 'tfoot' ||\n\t\ttype === 'tbody' ||\n\t\ttype === 'thead' ||\n\t\ttype === 'td' ||\n\t\ttype === 'tr' ||\n\t\ttype === 'th'\n\t);\n}\n\nconst ILLEGAL_PARAGRAPH_CHILD_ELEMENTS =\n\t/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/;\n\nconst forceUpdate = Component.prototype.forceUpdate;\nComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode == null) {\n\t\tconsole.warn(\n\t\t\t`Calling \"this.forceUpdate\" inside the constructor of a component is a ` +\n\t\t\t\t`no-op and might be a bug in your application.\\n\\n${getOwnerStack(\n\t\t\t\t\tgetCurrentVNode()\n\t\t\t\t)}`\n\t\t);\n\t} else if (this._parentDom == null) {\n\t\tconsole.warn(\n\t\t\t`Can't call \"this.forceUpdate\" on an unmounted component. This is a no-op, ` +\n\t\t\t\t`but it indicates a memory leak in your application. To fix, cancel all ` +\n\t\t\t\t`subscriptions and asynchronous tasks in the componentWillUnmount method.` +\n\t\t\t\t`\\n\\n${getOwnerStack(this._vnode)}`\n\t\t);\n\t}\n\treturn forceUpdate.call(this, callback);\n};\n\n/**\n * Serialize a vnode tree to a string\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function serializeVNode(vnode) {\n\tlet { props } = vnode;\n\tlet name = getDisplayName(vnode);\n\n\tlet attrs = '';\n\tfor (let prop in props) {\n\t\tif (props.hasOwnProperty(prop) && prop !== 'children') {\n\t\t\tlet value = props[prop];\n\n\t\t\t// If it is an object but doesn't have toString(), use Object.toString\n\t\t\tif (typeof value == 'function') {\n\t\t\t\tvalue = `function ${value.displayName || value.name}() {}`;\n\t\t\t}\n\n\t\t\tvalue =\n\t\t\t\tObject(value) === value && !value.toString\n\t\t\t\t\t? Object.prototype.toString.call(value)\n\t\t\t\t\t: value + '';\n\n\t\t\tattrs += ` ${prop}=${JSON.stringify(value)}`;\n\t\t}\n\t}\n\n\tlet children = props.children;\n\treturn `<${name}${attrs}${\n\t\tchildren && children.length ? '>..' : ' />'\n\t}`;\n}\n\noptions._hydrationMismatch = (newVNode, excessDomChildren) => {\n\tconst { type } = newVNode;\n\tconst availableTypes = excessDomChildren\n\t\t.map(child => child && child.localName)\n\t\t.filter(Boolean);\n\tconsole.error(\n\t\t`Expected a DOM node of type \"${type}\" but found \"${availableTypes.join(', ')}\" as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\\n\\n${getOwnerStack(newVNode)}`\n\t);\n};\n","export const ELEMENT_NODE = 1;\nexport const DOCUMENT_NODE = 9;\nexport const DOCUMENT_FRAGMENT_NODE = 11;\n","/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\nexport function isNaN(value) {\n\treturn value !== value;\n}\n","import { initDebug } from './debug';\nimport 'preact/devtools';\n\ninitDebug();\n\nexport { resetPropWarnings } from './check-props';\n\nexport {\n\tgetCurrentVNode,\n\tgetDisplayName,\n\tgetOwnerStack\n} from './component-stack';\n"],"names":["loggedTypeFailures","resetPropWarnings","getDisplayName","vnode","type","Fragment","displayName","name","renderStack","ownerStack","getCurrentVNode","length","showJsxSourcePluginWarning","isPossibleOwner","getOwnerStack","stack","next","__o","push","reduce","acc","owner","source","__source","fileName","lineNumber","console","warn","isWeakMapSupported","WeakMap","getDomChildren","domChildren","__k","forEach","child","apply","getClosestDomNodeParentName","parent","__","__e","parentNode","localName","setState","Component","prototype","isTableElement","update","callback","this","__v","state","call","ILLEGAL_PARAGRAPH_CHILD_ELEMENTS","forceUpdate","serializeVNode","props","attrs","prop","hasOwnProperty","value","Object","toString","JSON","stringify","children","__P","options","__m","newVNode","excessDomChildren","availableTypes","map","filter","Boolean","error","join","oldDiff","__b","oldDiffed","diffed","oldRoot","oldVNode","oldRender","__r","pop","setupComponentStack","hooksAllowed","oldBeforeDiff","oldVnode","oldCatchError","oldHook","__h","warnedComponents","useEffect","useLayoutEffect","lazyPropTypes","deprecations","errorInfo","__c","then","promise","Error","componentStack","setTimeout","e","isValid","nodeType","componentName","undefined","Array","isArray","ref","key","propTypes","has","m","lazyVNode","set","values","__f","obj","i","assign","typeSpecs","location","getStack","keys","typeSpecName","message","checkPropTypes","currentComponent","renderCount","nextComponent","comp","index","property","get","indexOf","deprecatedAttributes","nodeName","attributes","deprecatedProto","create","newProps","v","__self","__proto__","domParentName","illegalDomChildrenTypes","childType","test","__H","hooks","hook","j","initDebug"],"mappings":"sFAAA,IAEIA,EAAqB,CAAA,EAKlB,SAASC,IACfD,EAAqB,CAAA,CACtB,CCDO,SAASE,EAAeC,GAC9B,OAAIA,EAAMC,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AAID,EAAIF,IAAO5I,OAAQ+I,IAEtC,IEtde/F,EFqdH8F,EAAIF,IAAOG,KEpdZ/F,EFqdK,CACf,IAAMgD,EAAgBzG,EAAeC,GACrCuB,QAAQC,KAAI,4GACiG8F,EAAC,iBAAiBd,EAC/H,wBACD,CAGH,CAEF,CACD,CACD,CG3eAgD"} \ No newline at end of file diff --git a/node_modules/preact/debug/dist/debug.umd.js b/node_modules/preact/debug/dist/debug.umd.js new file mode 100644 index 0000000000000000000000000000000000000000..363bef3e5d284a823700fc5a20dd467748cc0f79 --- /dev/null +++ b/node_modules/preact/debug/dist/debug.umd.js @@ -0,0 +1,2 @@ +!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("preact"),require("preact/devtools")):"function"==typeof define&&define.amd?define(["exports","preact","preact/devtools"],e):e((n||self).preactDebug={},n.preact)}(this,function(n,e){var o={};function t(n){return n.type===e.Fragment?"Fragment":"function"==typeof n.type?n.type.displayName||n.type.name:"string"==typeof n.type?n.type:"#text"}var r=[],a=[];function i(){return r.length>0?r[r.length-1]:null}var s=!0;function c(n){return"function"==typeof n.type&&n.type!=e.Fragment}function l(n){for(var e=[n],o=n;null!=o.__o;)e.push(o.__o),o=o.__o;return e.reduce(function(n,e){n+=" in "+t(e);var o=e.__source;return o?n+=" (at "+o.fileName+":"+o.lineNumber+")":s&&console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons."),s=!1,n+"\n"},"")}var u="function"==typeof WeakMap;function f(n){var e=[];return n.__k?(n.__k.forEach(function(n){n&&"function"==typeof n.type?e.push.apply(e,f(n)):n&&"string"==typeof n.type&&e.push(n.type)}),e):e}function d(n){return n?"function"==typeof n.type?null==n.__?null!=n.__e&&null!=n.__e.parentNode?n.__e.parentNode.localName:"":d(n.__):n.type:""}var p=e.Component.prototype.setState;function h(n){return"table"===n||"tfoot"===n||"tbody"===n||"thead"===n||"td"===n||"tr"===n||"th"===n}e.Component.prototype.setState=function(n,e){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+l(i())),p.call(this,n,e)};var v=/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/,y=e.Component.prototype.forceUpdate;function m(n){var e=n.props,o=t(n),r="";for(var a in e)if(e.hasOwnProperty(a)&&"children"!==a){var i=e[a];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),r+=" "+a+"="+JSON.stringify(i)}var s=e.children;return"<"+o+r+(s&&s.length?">..":" />")}e.Component.prototype.forceUpdate=function(n){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+l(i())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+l(this.__v)),y.call(this,n)},e.options.__m=function(n,e){var o=n.type,t=e.map(function(n){return n&&n.localName}).filter(Boolean);console.error('Expected a DOM node of type "'+o+'" but found "'+t.join(", ")+"\" as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n"+l(n))},function(){!function(){var n=e.options.__b,o=e.options.diffed,t=e.options.__,i=e.options.vnode,s=e.options.__r;e.options.diffed=function(n){c(n)&&a.pop(),r.pop(),o&&o(n)},e.options.__b=function(e){c(e)&&r.push(e),n&&n(e)},e.options.__=function(n,e){a=[],t&&t(n,e)},e.options.vnode=function(n){n.__o=a.length>0?a[a.length-1]:null,i&&i(n)},e.options.__r=function(n){c(n)&&a.push(n),s&&s(n)}}();var n=!1,i=e.options.__b,s=e.options.diffed,p=e.options.vnode,y=e.options.__r,b=e.options.__e,g=e.options.__,w=e.options.__h,E=u?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,k=[];e.options.__e=function(n,e,o,r){if(e&&e.__c&&"function"==typeof n.then){var a=n;n=new Error("Missing Suspense. The throwing component was: "+t(e));for(var i=e;i;i=i.__)if(i.__c&&i.__c.__c){n=a;break}if(n instanceof Error)throw n}try{(r=r||{}).componentStack=l(e),b(n,e,o,r),"function"!=typeof n.then&&setTimeout(function(){throw n})}catch(n){throw n}},e.options.__=function(n,e){if(!e)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var o;switch(e.nodeType){case 1:case 11:case 9:o=!0;break;default:o=!1}if(!o){var r=t(n);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+e+" instead: render(<"+r+" />, "+e+");")}g&&g(n,e)},e.options.__b=function(e){var r=e.type;if(n=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+m(e)+"\n\n"+l(e));if(null!=r&&"object"==typeof r){if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+t(e)+" = "+m(r)+";\n let vnode = ;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+l(e));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if(void 0!==e.ref&&"function"!=typeof e.ref&&"object"!=typeof e.ref&&!("$$typeof"in e))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof e.ref+"] instead\n"+m(e)+"\n\n"+l(e));if("string"==typeof e.type)for(var a in e.props)if("o"===a[0]&&"n"===a[1]&&"function"!=typeof e.props[a]&&null!=e.props[a])throw new Error("Component's \""+a+'" property should be a function, but got ['+typeof e.props[a]+"] instead\n"+m(e)+"\n\n"+l(e));if("function"==typeof e.type&&e.type.propTypes){if("Lazy"===e.type.displayName&&E&&!E.lazyPropTypes.has(e.type)){var s="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var c=e.type();E.lazyPropTypes.set(e.type,!0),console.warn(s+"Component wrapped in lazy() is "+t(c))}catch(n){console.warn(s+"We will log the wrapped component's name once it is loaded.")}}var u=e.props;e.type.__f&&delete(u=function(n,e){for(var o in e)n[o]=e[o];return n}({},u)).ref,function(n,e,t,r,a){Object.keys(n).forEach(function(t){var i;try{i=n[t](e,t,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(n){i=n}i&&!(i.message in o)&&(o[i.message]=!0,console.error("Failed prop type: "+i.message+(a&&"\n"+a()||"")))})}(e.type.propTypes,u,0,t(e),function(){return l(e)})}i&&i(e)};var T,_=0;e.options.__r=function(e){y&&y(e),n=!0;var o=e.__c;if(o===T?_++:_=1,_>=25)throw new Error("Too many re-renders. This is limited to prevent an infinite loop which may lock up your browser. The component causing this is: "+t(e));T=o},e.options.__h=function(e,o,t){if(!e||!n)throw new Error("Hook can only be invoked from render methods.");w&&w(e,o,t)};var O=function(n,e){return{get:function(){var o="get"+n+e;k&&k.indexOf(o)<0&&(k.push(o),console.warn("getting vnode."+n+" is deprecated, "+e))},set:function(){var o="set"+n+e;k&&k.indexOf(o)<0&&(k.push(o),console.warn("setting vnode."+n+" is not allowed, "+e))}}},I={nodeName:O("nodeName","use vnode.type"),attributes:O("attributes","use vnode.props"),children:O("children","use vnode.props.children")},j=Object.create({},I);e.options.vnode=function(n){var e=n.props;if(null!==n.type&&null!=e&&("__source"in e||"__self"in e)){var o=n.props={};for(var t in e){var r=e[t];"__source"===t?n.__source=r:"__self"===t?n.__self=r:o[t]=r}}n.__proto__=j,p&&p(n)},e.options.diffed=function(e){var o,r=e.type,a=e.__;if(e.__k&&e.__k.forEach(function(n){if("object"==typeof n&&n&&void 0===n.type){var o=Object.keys(n).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+o+"}.\n\n"+l(e))}}),e.__c===T&&(_=0),"string"==typeof r&&(h(r)||"p"===r||"a"===r||"button"===r)){var i=d(a);if(""!==i&&h(r))"table"===r&&"td"!==i&&h(i)?console.error("Improper nesting of table. Your

should have a
should have a
should not have a table-node parent."+m(e)+"\n\n"+l(e)):"thead"!==r&&"tfoot"!==r&&"tbody"!==r||"table"===i?"tr"===r&&"thead"!==i&&"tfoot"!==i&&"tbody"!==i?console.error("Improper nesting of table. Your should have a parent."+m(e)+"\n\n"+l(e)):"td"===r&&"tr"!==i?console.error("Improper nesting of table. Your parent."+m(e)+"\n\n"+l(e)):"th"===r&&"tr"!==i&&console.error("Improper nesting of table. Your ."+m(e)+"\n\n"+l(e)):console.error("Improper nesting of table. Your should have a
should have a
should have a
parent."+m(e)+"\n\n"+l(e));else if("p"===r){var c=f(e).filter(function(n){return v.test(n)});c.length&&console.error("Improper nesting of paragraph. Your

should not have "+c.join(", ")+" as child-elements."+m(e)+"\n\n"+l(e))}else"a"!==r&&"button"!==r||-1!==f(e).indexOf(r)&&console.error("Improper nesting of interactive content. Your <"+r+"> should not have other "+("a"===r?"anchor":"button")+" tags as child-elements."+m(e)+"\n\n"+l(e))}if(n=!1,s&&s(e),null!=e.__k)for(var u=[],p=0;p {\n\t\tlet error;\n\t\ttry {\n\t\t\terror = typeSpecs[typeSpecName](\n\t\t\t\tvalues,\n\t\t\t\ttypeSpecName,\n\t\t\t\tcomponentName,\n\t\t\t\tlocation,\n\t\t\t\tnull,\n\t\t\t\tReactPropTypesSecret\n\t\t\t);\n\t\t} catch (e) {\n\t\t\terror = e;\n\t\t}\n\t\tif (error && !(error.message in loggedTypeFailures)) {\n\t\t\tloggedTypeFailures[error.message] = true;\n\t\t\tconsole.error(\n\t\t\t\t`Failed ${location} type: ${error.message}${\n\t\t\t\t\t(getStack && `\\n${getStack()}`) || ''\n\t\t\t\t}`\n\t\t\t);\n\t\t}\n\t});\n}\n","import { options, Fragment } from 'preact';\n\n/**\n * Get human readable name of the component/dom node\n * @param {import('./internal').VNode} vnode\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function getDisplayName(vnode) {\n\tif (vnode.type === Fragment) {\n\t\treturn 'Fragment';\n\t} else if (typeof vnode.type == 'function') {\n\t\treturn vnode.type.displayName || vnode.type.name;\n\t} else if (typeof vnode.type == 'string') {\n\t\treturn vnode.type;\n\t}\n\n\treturn '#text';\n}\n\n/**\n * Used to keep track of the currently rendered `vnode` and print it\n * in debug messages.\n */\nlet renderStack = [];\n\n/**\n * Keep track of the current owners. An owner describes a component\n * which was responsible to render a specific `vnode`. This exclude\n * children that are passed via `props.children`, because they belong\n * to the parent owner.\n *\n * ```jsx\n * const Foo = props =>

{props.children}
// div's owner is Foo\n * const Bar = props => {\n * return (\n * // Foo's owner is Bar, span's owner is Bar\n * )\n * }\n * ```\n *\n * Note: A `vnode` may be hoisted to the root scope due to compiler\n * optimiztions. In these cases the `_owner` will be different.\n */\nlet ownerStack = [];\n\n/**\n * Get the currently rendered `vnode`\n * @returns {import('./internal').VNode | null}\n */\nexport function getCurrentVNode() {\n\treturn renderStack.length > 0 ? renderStack[renderStack.length - 1] : null;\n}\n\n/**\n * If the user doesn't have `@babel/plugin-transform-react-jsx-source`\n * somewhere in his tool chain we can't print the filename and source\n * location of a component. In that case we just omit that, but we'll\n * print a helpful message to the console, notifying the user of it.\n */\nlet showJsxSourcePluginWarning = true;\n\n/**\n * Check if a `vnode` is a possible owner.\n * @param {import('./internal').VNode} vnode\n */\nfunction isPossibleOwner(vnode) {\n\treturn typeof vnode.type == 'function' && vnode.type != Fragment;\n}\n\n/**\n * Return the component stack that was captured up to this point.\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function getOwnerStack(vnode) {\n\tconst stack = [vnode];\n\tlet next = vnode;\n\twhile (next._owner != null) {\n\t\tstack.push(next._owner);\n\t\tnext = next._owner;\n\t}\n\n\treturn stack.reduce((acc, owner) => {\n\t\tacc += ` in ${getDisplayName(owner)}`;\n\n\t\tconst source = owner.__source;\n\t\tif (source) {\n\t\t\tacc += ` (at ${source.fileName}:${source.lineNumber})`;\n\t\t} else if (showJsxSourcePluginWarning) {\n\t\t\tconsole.warn(\n\t\t\t\t'Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.'\n\t\t\t);\n\t\t}\n\t\tshowJsxSourcePluginWarning = false;\n\n\t\treturn (acc += '\\n');\n\t}, '');\n}\n\n/**\n * Setup code to capture the component trace while rendering. Note that\n * we cannot simply traverse `vnode._parent` upwards, because we have some\n * debug messages for `this.setState` where the `vnode` is `undefined`.\n */\nexport function setupComponentStack() {\n\tlet oldDiff = options._diff;\n\tlet oldDiffed = options.diffed;\n\tlet oldRoot = options._root;\n\tlet oldVNode = options.vnode;\n\tlet oldRender = options._render;\n\n\toptions.diffed = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\townerStack.pop();\n\t\t}\n\t\trenderStack.pop();\n\t\tif (oldDiffed) oldDiffed(vnode);\n\t};\n\n\toptions._diff = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\trenderStack.push(vnode);\n\t\t}\n\t\tif (oldDiff) oldDiff(vnode);\n\t};\n\n\toptions._root = (vnode, parent) => {\n\t\townerStack = [];\n\t\tif (oldRoot) oldRoot(vnode, parent);\n\t};\n\n\toptions.vnode = vnode => {\n\t\tvnode._owner =\n\t\t\townerStack.length > 0 ? ownerStack[ownerStack.length - 1] : null;\n\t\tif (oldVNode) oldVNode(vnode);\n\t};\n\n\toptions._render = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\townerStack.push(vnode);\n\t\t}\n\n\t\tif (oldRender) oldRender(vnode);\n\t};\n}\n","import { checkPropTypes } from './check-props';\nimport { options, Component } from 'preact';\nimport {\n\tELEMENT_NODE,\n\tDOCUMENT_NODE,\n\tDOCUMENT_FRAGMENT_NODE\n} from './constants';\nimport {\n\tgetOwnerStack,\n\tsetupComponentStack,\n\tgetCurrentVNode,\n\tgetDisplayName\n} from './component-stack';\nimport { assign, isNaN } from './util';\n\nconst isWeakMapSupported = typeof WeakMap == 'function';\n\n/**\n * @param {import('./internal').VNode} vnode\n * @returns {Array}\n */\nfunction getDomChildren(vnode) {\n\tlet domChildren = [];\n\n\tif (!vnode._children) return domChildren;\n\n\tvnode._children.forEach(child => {\n\t\tif (child && typeof child.type === 'function') {\n\t\t\tdomChildren.push.apply(domChildren, getDomChildren(child));\n\t\t} else if (child && typeof child.type === 'string') {\n\t\t\tdomChildren.push(child.type);\n\t\t}\n\t});\n\n\treturn domChildren;\n}\n\n/**\n * @param {import('./internal').VNode} parent\n * @returns {string}\n */\nfunction getClosestDomNodeParentName(parent) {\n\tif (!parent) return '';\n\tif (typeof parent.type == 'function') {\n\t\tif (parent._parent == null) {\n\t\t\tif (parent._dom != null && parent._dom.parentNode != null) {\n\t\t\t\treturn parent._dom.parentNode.localName;\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\t\treturn getClosestDomNodeParentName(parent._parent);\n\t}\n\treturn /** @type {string} */ (parent.type);\n}\n\nexport function initDebug() {\n\tsetupComponentStack();\n\n\tlet hooksAllowed = false;\n\n\t/* eslint-disable no-console */\n\tlet oldBeforeDiff = options._diff;\n\tlet oldDiffed = options.diffed;\n\tlet oldVnode = options.vnode;\n\tlet oldRender = options._render;\n\tlet oldCatchError = options._catchError;\n\tlet oldRoot = options._root;\n\tlet oldHook = options._hook;\n\tconst warnedComponents = !isWeakMapSupported\n\t\t? null\n\t\t: {\n\t\t\t\tuseEffect: new WeakMap(),\n\t\t\t\tuseLayoutEffect: new WeakMap(),\n\t\t\t\tlazyPropTypes: new WeakMap()\n\t\t\t};\n\tconst deprecations = [];\n\n\toptions._catchError = (error, vnode, oldVNode, errorInfo) => {\n\t\tlet component = vnode && vnode._component;\n\t\tif (component && typeof error.then == 'function') {\n\t\t\tconst promise = error;\n\t\t\terror = new Error(\n\t\t\t\t`Missing Suspense. The throwing component was: ${getDisplayName(vnode)}`\n\t\t\t);\n\n\t\t\tlet parent = vnode;\n\t\t\tfor (; parent; parent = parent._parent) {\n\t\t\t\tif (parent._component && parent._component._childDidSuspend) {\n\t\t\t\t\terror = promise;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// We haven't recovered and we know at this point that there is no\n\t\t\t// Suspense component higher up in the tree\n\t\t\tif (error instanceof Error) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\terrorInfo = errorInfo || {};\n\t\t\terrorInfo.componentStack = getOwnerStack(vnode);\n\t\t\toldCatchError(error, vnode, oldVNode, errorInfo);\n\n\t\t\t// when an error was handled by an ErrorBoundary we will nonetheless emit an error\n\t\t\t// event on the window object. This is to make up for react compatibility in dev mode\n\t\t\t// and thus make the Next.js dev overlay work.\n\t\t\tif (typeof error.then != 'function') {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tthrow e;\n\t\t}\n\t};\n\n\toptions._root = (vnode, parentNode) => {\n\t\tif (!parentNode) {\n\t\t\tthrow new Error(\n\t\t\t\t'Undefined parent passed to render(), this is the second argument.\\n' +\n\t\t\t\t\t'Check if the element is available in the DOM/has the correct id.'\n\t\t\t);\n\t\t}\n\n\t\tlet isValid;\n\t\tswitch (parentNode.nodeType) {\n\t\t\tcase ELEMENT_NODE:\n\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\tcase DOCUMENT_NODE:\n\t\t\t\tisValid = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tisValid = false;\n\t\t}\n\n\t\tif (!isValid) {\n\t\t\tlet componentName = getDisplayName(vnode);\n\t\t\tthrow new Error(\n\t\t\t\t`Expected a valid HTML node as a second argument to render.\tReceived ${parentNode} instead: render(<${componentName} />, ${parentNode});`\n\t\t\t);\n\t\t}\n\n\t\tif (oldRoot) oldRoot(vnode, parentNode);\n\t};\n\n\toptions._diff = vnode => {\n\t\tlet { type } = vnode;\n\n\t\thooksAllowed = true;\n\n\t\tif (type === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t'Undefined component passed to createElement()\\n\\n' +\n\t\t\t\t\t'You likely forgot to export your component or might have mixed up default and named imports' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t} else if (type != null && typeof type == 'object') {\n\t\t\tif (type._children !== undefined && type._dom !== undefined) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Invalid type passed to createElement(): ${type}\\n\\n` +\n\t\t\t\t\t\t'Did you accidentally pass a JSX literal as JSX twice?\\n\\n' +\n\t\t\t\t\t\t` let My${getDisplayName(vnode)} = ${serializeVNode(type)};\\n` +\n\t\t\t\t\t\t` let vnode = ;\\n\\n` +\n\t\t\t\t\t\t'This usually happens when you export a JSX literal and not the component.' +\n\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthrow new Error(\n\t\t\t\t'Invalid type passed to createElement(): ' +\n\t\t\t\t\t(Array.isArray(type) ? 'array' : type)\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tvnode.ref !== undefined &&\n\t\t\ttypeof vnode.ref != 'function' &&\n\t\t\ttypeof vnode.ref != 'object' &&\n\t\t\t!('$$typeof' in vnode) // allow string refs when preact-compat is installed\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t`Component's \"ref\" property should be a function, or an object created ` +\n\t\t\t\t\t`by createRef(), but got [${typeof vnode.ref}] instead\\n` +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t}\n\n\t\tif (typeof vnode.type == 'string') {\n\t\t\tfor (const key in vnode.props) {\n\t\t\t\tif (\n\t\t\t\t\tkey[0] === 'o' &&\n\t\t\t\t\tkey[1] === 'n' &&\n\t\t\t\t\ttypeof vnode.props[key] != 'function' &&\n\t\t\t\t\tvnode.props[key] != null\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Component's \"${key}\" property should be a function, ` +\n\t\t\t\t\t\t\t`but got [${typeof vnode.props[key]}] instead\\n` +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check prop-types if available\n\t\tif (typeof vnode.type == 'function' && vnode.type.propTypes) {\n\t\t\tif (\n\t\t\t\tvnode.type.displayName === 'Lazy' &&\n\t\t\t\twarnedComponents &&\n\t\t\t\t!warnedComponents.lazyPropTypes.has(vnode.type)\n\t\t\t) {\n\t\t\t\tconst m =\n\t\t\t\t\t'PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ';\n\t\t\t\ttry {\n\t\t\t\t\tconst lazyVNode = vnode.type();\n\t\t\t\t\twarnedComponents.lazyPropTypes.set(vnode.type, true);\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\tm + `Component wrapped in lazy() is ${getDisplayName(lazyVNode)}`\n\t\t\t\t\t);\n\t\t\t\t} catch (promise) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\tm + \"We will log the wrapped component's name once it is loaded.\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet values = vnode.props;\n\t\t\tif (vnode.type._forwarded) {\n\t\t\t\tvalues = assign({}, values);\n\t\t\t\tdelete values.ref;\n\t\t\t}\n\n\t\t\tcheckPropTypes(\n\t\t\t\tvnode.type.propTypes,\n\t\t\t\tvalues,\n\t\t\t\t'prop',\n\t\t\t\tgetDisplayName(vnode),\n\t\t\t\t() => getOwnerStack(vnode)\n\t\t\t);\n\t\t}\n\n\t\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n\t};\n\n\tlet renderCount = 0;\n\tlet currentComponent;\n\toptions._render = vnode => {\n\t\tif (oldRender) {\n\t\t\toldRender(vnode);\n\t\t}\n\t\thooksAllowed = true;\n\n\t\tconst nextComponent = vnode._component;\n\t\tif (nextComponent === currentComponent) {\n\t\t\trenderCount++;\n\t\t} else {\n\t\t\trenderCount = 1;\n\t\t}\n\n\t\tif (renderCount >= 25) {\n\t\t\tthrow new Error(\n\t\t\t\t`Too many re-renders. This is limited to prevent an infinite loop ` +\n\t\t\t\t\t`which may lock up your browser. The component causing this is: ${getDisplayName(\n\t\t\t\t\t\tvnode\n\t\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\n\t\tcurrentComponent = nextComponent;\n\t};\n\n\toptions._hook = (comp, index, type) => {\n\t\tif (!comp || !hooksAllowed) {\n\t\t\tthrow new Error('Hook can only be invoked from render methods.');\n\t\t}\n\n\t\tif (oldHook) oldHook(comp, index, type);\n\t};\n\n\t// Ideally we'd want to print a warning once per component, but we\n\t// don't have access to the vnode that triggered it here. As a\n\t// compromise and to avoid flooding the console with warnings we\n\t// print each deprecation warning only once.\n\tconst warn = (property, message) => ({\n\t\tget() {\n\t\t\tconst key = 'get' + property + message;\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\n\t\t\t\tdeprecations.push(key);\n\t\t\t\tconsole.warn(`getting vnode.${property} is deprecated, ${message}`);\n\t\t\t}\n\t\t},\n\t\tset() {\n\t\t\tconst key = 'set' + property + message;\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\n\t\t\t\tdeprecations.push(key);\n\t\t\t\tconsole.warn(`setting vnode.${property} is not allowed, ${message}`);\n\t\t\t}\n\t\t}\n\t});\n\n\tconst deprecatedAttributes = {\n\t\tnodeName: warn('nodeName', 'use vnode.type'),\n\t\tattributes: warn('attributes', 'use vnode.props'),\n\t\tchildren: warn('children', 'use vnode.props.children')\n\t};\n\n\tconst deprecatedProto = Object.create({}, deprecatedAttributes);\n\n\toptions.vnode = vnode => {\n\t\tconst props = vnode.props;\n\t\tif (\n\t\t\tvnode.type !== null &&\n\t\t\tprops != null &&\n\t\t\t('__source' in props || '__self' in props)\n\t\t) {\n\t\t\tconst newProps = (vnode.props = {});\n\t\t\tfor (let i in props) {\n\t\t\t\tconst v = props[i];\n\t\t\t\tif (i === '__source') vnode.__source = v;\n\t\t\t\telse if (i === '__self') vnode.__self = v;\n\t\t\t\telse newProps[i] = v;\n\t\t\t}\n\t\t}\n\n\t\t// eslint-disable-next-line\n\t\tvnode.__proto__ = deprecatedProto;\n\t\tif (oldVnode) oldVnode(vnode);\n\t};\n\n\toptions.diffed = vnode => {\n\t\tconst { type, _parent: parent } = vnode;\n\t\t// Check if the user passed plain objects as children. Note that we cannot\n\t\t// move this check into `options.vnode` because components can receive\n\t\t// children in any shape they want (e.g.\n\t\t// `{{ foo: 123, bar: \"abc\" }}`).\n\t\t// Putting this check in `options.diffed` ensures that\n\t\t// `vnode._children` is set and that we only validate the children\n\t\t// that were actually rendered.\n\t\tif (vnode._children) {\n\t\t\tvnode._children.forEach(child => {\n\t\t\t\tif (typeof child === 'object' && child && child.type === undefined) {\n\t\t\t\t\tconst keys = Object.keys(child).join(',');\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Objects are not valid as a child. Encountered an object with the keys {${keys}}.` +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif (vnode._component === currentComponent) {\n\t\t\trenderCount = 0;\n\t\t}\n\n\t\tif (\n\t\t\ttypeof type === 'string' &&\n\t\t\t(isTableElement(type) ||\n\t\t\t\ttype === 'p' ||\n\t\t\t\ttype === 'a' ||\n\t\t\t\ttype === 'button')\n\t\t) {\n\t\t\t// Avoid false positives when Preact only partially rendered the\n\t\t\t// HTML tree. Whilst we attempt to include the outer DOM in our\n\t\t\t// validation, this wouldn't work on the server for\n\t\t\t// `preact-render-to-string`. There we'd otherwise flood the terminal\n\t\t\t// with false positives, which we'd like to avoid.\n\t\t\tlet domParentName = getClosestDomNodeParentName(parent);\n\t\t\tif (domParentName !== '' && isTableElement(type)) {\n\t\t\t\tif (\n\t\t\t\t\ttype === 'table' &&\n\t\t\t\t\t// Tables can be nested inside each other if it's inside a cell.\n\t\t\t\t\t// See https://developer.mozilla.org/en-US/docs/Learn/HTML/Tables/Advanced#nesting_tables\n\t\t\t\t\tdomParentName !== 'td' &&\n\t\t\t\t\tisTableElement(domParentName)\n\t\t\t\t) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your
should not have a table-node parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (\n\t\t\t\t\t(type === 'thead' || type === 'tfoot' || type === 'tbody') &&\n\t\t\t\t\tdomParentName !== 'table'\n\t\t\t\t) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your should have a
parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (\n\t\t\t\t\ttype === 'tr' &&\n\t\t\t\t\tdomParentName !== 'thead' &&\n\t\t\t\t\tdomParentName !== 'tfoot' &&\n\t\t\t\t\tdomParentName !== 'tbody'\n\t\t\t\t) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your should have a parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (type === 'td' && domParentName !== 'tr') {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (type === 'th' && domParentName !== 'tr') {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your .' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if (type === 'p') {\n\t\t\t\tlet illegalDomChildrenTypes = getDomChildren(vnode).filter(childType =>\n\t\t\t\t\tILLEGAL_PARAGRAPH_CHILD_ELEMENTS.test(childType)\n\t\t\t\t);\n\t\t\t\tif (illegalDomChildrenTypes.length) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of paragraph. Your

should not have ' +\n\t\t\t\t\t\t\tillegalDomChildrenTypes.join(', ') +\n\t\t\t\t\t\t\t' as child-elements.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if (type === 'a' || type === 'button') {\n\t\t\t\tif (getDomChildren(vnode).indexOf(type) !== -1) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`Improper nesting of interactive content. Your <${type}>` +\n\t\t\t\t\t\t\t` should not have other ${type === 'a' ? 'anchor' : 'button'}` +\n\t\t\t\t\t\t\t' tags as child-elements.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\thooksAllowed = false;\n\n\t\tif (oldDiffed) oldDiffed(vnode);\n\n\t\tif (vnode._children != null) {\n\t\t\tconst keys = [];\n\t\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\t\tconst child = vnode._children[i];\n\t\t\t\tif (!child || child.key == null) continue;\n\n\t\t\t\tconst key = child.key;\n\t\t\t\tif (keys.indexOf(key) !== -1) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Following component has two or more children with the ' +\n\t\t\t\t\t\t\t`same key attribute: \"${key}\". This may cause glitches and misbehavior ` +\n\t\t\t\t\t\t\t'in rendering process. Component: \\n\\n' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\n\t\t\t\t\t// Break early to not spam the console\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tkeys.push(key);\n\t\t\t}\n\t\t}\n\n\t\tif (vnode._component != null && vnode._component.__hooks != null) {\n\t\t\t// Validate that none of the hooks in this component contain arguments that are NaN.\n\t\t\t// This is a common mistake that can be hard to debug, so we want to catch it early.\n\t\t\tconst hooks = vnode._component.__hooks._list;\n\t\t\tif (hooks) {\n\t\t\t\tfor (let i = 0; i < hooks.length; i += 1) {\n\t\t\t\t\tconst hook = hooks[i];\n\t\t\t\t\tif (hook._args) {\n\t\t\t\t\t\tfor (let j = 0; j < hook._args.length; j++) {\n\t\t\t\t\t\t\tconst arg = hook._args[j];\n\t\t\t\t\t\t\tif (isNaN(arg)) {\n\t\t\t\t\t\t\t\tconst componentName = getDisplayName(vnode);\n\t\t\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t\t\t`Invalid argument passed to hook. Hooks should not be called with NaN in the dependency array. Hook index ${i} in component ${componentName} was called with NaN.`\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\nconst setState = Component.prototype.setState;\nComponent.prototype.setState = function (update, callback) {\n\tif (this._vnode == null) {\n\t\t// `this._vnode` will be `null` during componentWillMount. But it\n\t\t// is perfectly valid to call `setState` during cWM. So we\n\t\t// need an additional check to verify that we are dealing with a\n\t\t// call inside constructor.\n\t\tif (this.state == null) {\n\t\t\tconsole.warn(\n\t\t\t\t`Calling \"this.setState\" inside the constructor of a component is a ` +\n\t\t\t\t\t`no-op and might be a bug in your application. Instead, set ` +\n\t\t\t\t\t`\"this.state = {}\" directly.\\n\\n${getOwnerStack(getCurrentVNode())}`\n\t\t\t);\n\t\t}\n\t}\n\n\treturn setState.call(this, update, callback);\n};\n\nfunction isTableElement(type) {\n\treturn (\n\t\ttype === 'table' ||\n\t\ttype === 'tfoot' ||\n\t\ttype === 'tbody' ||\n\t\ttype === 'thead' ||\n\t\ttype === 'td' ||\n\t\ttype === 'tr' ||\n\t\ttype === 'th'\n\t);\n}\n\nconst ILLEGAL_PARAGRAPH_CHILD_ELEMENTS =\n\t/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/;\n\nconst forceUpdate = Component.prototype.forceUpdate;\nComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode == null) {\n\t\tconsole.warn(\n\t\t\t`Calling \"this.forceUpdate\" inside the constructor of a component is a ` +\n\t\t\t\t`no-op and might be a bug in your application.\\n\\n${getOwnerStack(\n\t\t\t\t\tgetCurrentVNode()\n\t\t\t\t)}`\n\t\t);\n\t} else if (this._parentDom == null) {\n\t\tconsole.warn(\n\t\t\t`Can't call \"this.forceUpdate\" on an unmounted component. This is a no-op, ` +\n\t\t\t\t`but it indicates a memory leak in your application. To fix, cancel all ` +\n\t\t\t\t`subscriptions and asynchronous tasks in the componentWillUnmount method.` +\n\t\t\t\t`\\n\\n${getOwnerStack(this._vnode)}`\n\t\t);\n\t}\n\treturn forceUpdate.call(this, callback);\n};\n\n/**\n * Serialize a vnode tree to a string\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function serializeVNode(vnode) {\n\tlet { props } = vnode;\n\tlet name = getDisplayName(vnode);\n\n\tlet attrs = '';\n\tfor (let prop in props) {\n\t\tif (props.hasOwnProperty(prop) && prop !== 'children') {\n\t\t\tlet value = props[prop];\n\n\t\t\t// If it is an object but doesn't have toString(), use Object.toString\n\t\t\tif (typeof value == 'function') {\n\t\t\t\tvalue = `function ${value.displayName || value.name}() {}`;\n\t\t\t}\n\n\t\t\tvalue =\n\t\t\t\tObject(value) === value && !value.toString\n\t\t\t\t\t? Object.prototype.toString.call(value)\n\t\t\t\t\t: value + '';\n\n\t\t\tattrs += ` ${prop}=${JSON.stringify(value)}`;\n\t\t}\n\t}\n\n\tlet children = props.children;\n\treturn `<${name}${attrs}${\n\t\tchildren && children.length ? '>..' : ' />'\n\t}`;\n}\n\noptions._hydrationMismatch = (newVNode, excessDomChildren) => {\n\tconst { type } = newVNode;\n\tconst availableTypes = excessDomChildren\n\t\t.map(child => child && child.localName)\n\t\t.filter(Boolean);\n\tconsole.error(\n\t\t`Expected a DOM node of type \"${type}\" but found \"${availableTypes.join(', ')}\" as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\\n\\n${getOwnerStack(newVNode)}`\n\t);\n};\n","export const ELEMENT_NODE = 1;\nexport const DOCUMENT_NODE = 9;\nexport const DOCUMENT_FRAGMENT_NODE = 11;\n","/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\nexport function isNaN(value) {\n\treturn value !== value;\n}\n","import { initDebug } from './debug';\nimport 'preact/devtools';\n\ninitDebug();\n\nexport { resetPropWarnings } from './check-props';\n\nexport {\n\tgetCurrentVNode,\n\tgetDisplayName,\n\tgetOwnerStack\n} from './component-stack';\n"],"names":["loggedTypeFailures","getDisplayName","vnode","type","Fragment","displayName","name","renderStack","ownerStack","getCurrentVNode","length","showJsxSourcePluginWarning","isPossibleOwner","getOwnerStack","stack","next","__o","push","reduce","acc","owner","source","__source","fileName","lineNumber","console","warn","isWeakMapSupported","WeakMap","getDomChildren","domChildren","__k","forEach","child","apply","getClosestDomNodeParentName","parent","__","__e","parentNode","localName","setState","Component","prototype","isTableElement","update","callback","this","__v","state","call","ILLEGAL_PARAGRAPH_CHILD_ELEMENTS","forceUpdate","serializeVNode","props","attrs","prop","hasOwnProperty","value","Object","toString","JSON","stringify","children","__P","options","__m","newVNode","excessDomChildren","availableTypes","map","filter","Boolean","error","join","oldDiff","__b","oldDiffed","diffed","oldRoot","oldVNode","oldRender","__r","pop","setupComponentStack","hooksAllowed","oldBeforeDiff","oldVnode","oldCatchError","oldHook","__h","warnedComponents","useEffect","useLayoutEffect","lazyPropTypes","deprecations","errorInfo","__c","then","promise","Error","componentStack","setTimeout","e","isValid","nodeType","componentName","undefined","Array","isArray","ref","key","propTypes","has","m","lazyVNode","set","values","__f","obj","i","assign","typeSpecs","location","getStack","keys","typeSpecName","message","checkPropTypes","currentComponent","renderCount","nextComponent","comp","index","property","get","indexOf","deprecatedAttributes","nodeName","attributes","deprecatedProto","create","newProps","v","__self","__proto__","domParentName","illegalDomChildrenTypes","childType","test","__H","hooks","hook","j","initDebug"],"mappings":"wTAAA,IAEIA,EAAqB,CAAA,ECMlB,SAASC,EAAeC,GAC9B,OAAIA,EAAMC,OAASC,EAAAA,SACX,WACwB,mBAAdF,EAAMC,KAChBD,EAAMC,KAAKE,aAAeH,EAAMC,KAAKG,KACb,iBAAdJ,EAAMC,KAChBD,EAAMC,KAGP,OACR,CAMA,IAAII,EAAc,GAoBdC,EAAa,YAMDC,IACf,OAAOF,EAAYG,OAAS,EAAIH,EAAYA,EAAYG,OAAS,GAAK,IACvE,CAQA,IAAIC,GAA6B,EAMjC,SAASC,EAAgBV,GACxB,MAA4B,mBAAdA,EAAMC,MAAsBD,EAAMC,MAAQC,EAAAA,QACzD,CAOO,SAASS,EAAcX,GAG7B,IAFA,IAAMY,EAAQ,CAACZ,GACXa,EAAOb,EACW,MAAfa,EAAIC,KACVF,EAAMG,KAAKF,EAAIC,KACfD,EAAOA,EAAIC,IAGZ,OAAOF,EAAMI,OAAO,SAACC,EAAKC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AA,EAAcX,GAGzB,KAAoB,MAATC,GAAyB,WAATA,IACmB,IAAzC0B,EAAe3B,GAAOsI,QAAQrI,IACjCsB,QAAQgD,MACP,kDAAkDtE,EAAlD,4BACoC,MAATA,EAAe,SAAW,UACpD,2BACAkD,EAAenD,GAAM,OACdW,EAAcX,GAI1B,CAMA,GAJAmF,GAAe,EAEXR,GAAWA,EAAU3E,GAEF,MAAnBA,EAAK6B,IAER,IADA,IAAM8F,EAAO,GACJL,EAAI,EAAGA,EAAItH,EAAK6B,IAAWrB,OAAQ8G,IAAK,CAChD,IAAMvF,EAAQ/B,EAAK6B,IAAWyF,GAC9B,GAAKvF,GAAsB,MAAbA,EAAM8E,IAApB,CAEA,IAAMA,EAAM9E,EAAM8E,IAClB,IAA2B,IAAvBc,EAAKW,QAAQzB,GAAa,CAC7BtF,QAAQgD,MACP,8EACyBsC,EADzB,mFAGC1D,EAAenD,GACRW,OAAAA,EAAcX,IAIvB,KACD,CAEA2H,EAAK5G,KAAK8F,GACX,CAGD,GAAwB,MAApB7G,EAAK+F,KAAmD,MAA5B/F,EAAK+F,IAAAqD,IAA6B,CAGjE,IAAMC,EAAQrJ,EAAK+F,IAAAqD,IAAAjH,GACnB,GAAIkH,EACH,IAAK,IAAI/B,EAAI,EAAGA,EAAI+B,EAAM7I,OAAQ8G,GAAK,EAAG,CACzC,IAAMgC,EAAOD,EAAM/B,GACnB,GAAIgC,EAAIF,IACP,IAAK,IAAIG,EAAI,EAAGA,EAAID,EAAIF,IAAO5I,OAAQ+I,IAEtC,IEtde/F,EFqdH8F,EAAIF,IAAOG,KEpdZ/F,EFqdK,CACf,IAAMgD,EAAgBzG,EAAeC,GACrCuB,QAAQC,KAAI,4GACiG8F,EAAC,iBAAiBd,EAC/H,wBACD,CAGH,CAEF,CACD,CACD,CG3eAgD,gFLIO,WACN1J,EAAqB,CAAA,CACtB"} \ No newline at end of file diff --git a/node_modules/preact/debug/package.json b/node_modules/preact/debug/package.json new file mode 100644 index 0000000000000000000000000000000000000000..836b4b49f71dc28354e8a1f6c6a5f0f71115ebbf --- /dev/null +++ b/node_modules/preact/debug/package.json @@ -0,0 +1,27 @@ +{ + "name": "preact-debug", + "amdName": "preactDebug", + "version": "1.0.0", + "private": true, + "description": "Preact extensions for development", + "main": "dist/debug.js", + "module": "dist/debug.module.js", + "umd:main": "dist/debug.umd.js", + "source": "src/index.js", + "license": "MIT", + "mangle": { + "regex": "^(?!_renderer)^_" + }, + "peerDependencies": { + "preact": "^10.0.0" + }, + "exports": { + ".": { + "types": "./src/index.d.ts", + "browser": "./dist/debug.module.js", + "umd": "./dist/debug.umd.js", + "import": "./dist/debug.mjs", + "require": "./dist/debug.js" + } + } +} diff --git a/node_modules/preact/debug/src/check-props.js b/node_modules/preact/debug/src/check-props.js new file mode 100644 index 0000000000000000000000000000000000000000..41ff74737040c1c8df9dd5b6ae0e2f6a13989b46 --- /dev/null +++ b/node_modules/preact/debug/src/check-props.js @@ -0,0 +1,54 @@ +const ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +let loggedTypeFailures = {}; + +/** + * Reset the history of which prop type warnings have been logged. + */ +export function resetPropWarnings() { + loggedTypeFailures = {}; +} + +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * Adapted from https://github.com/facebook/prop-types/blob/master/checkPropTypes.js + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + */ +export function checkPropTypes( + typeSpecs, + values, + location, + componentName, + getStack +) { + Object.keys(typeSpecs).forEach(typeSpecName => { + let error; + try { + error = typeSpecs[typeSpecName]( + values, + typeSpecName, + componentName, + location, + null, + ReactPropTypesSecret + ); + } catch (e) { + error = e; + } + if (error && !(error.message in loggedTypeFailures)) { + loggedTypeFailures[error.message] = true; + console.error( + `Failed ${location} type: ${error.message}${ + (getStack && `\n${getStack()}`) || '' + }` + ); + } + }); +} diff --git a/node_modules/preact/debug/src/component-stack.js b/node_modules/preact/debug/src/component-stack.js new file mode 100644 index 0000000000000000000000000000000000000000..52a1801273154688739cc4a2071740a233a8054e --- /dev/null +++ b/node_modules/preact/debug/src/component-stack.js @@ -0,0 +1,146 @@ +import { options, Fragment } from 'preact'; + +/** + * Get human readable name of the component/dom node + * @param {import('./internal').VNode} vnode + * @param {import('./internal').VNode} vnode + * @returns {string} + */ +export function getDisplayName(vnode) { + if (vnode.type === Fragment) { + return 'Fragment'; + } else if (typeof vnode.type == 'function') { + return vnode.type.displayName || vnode.type.name; + } else if (typeof vnode.type == 'string') { + return vnode.type; + } + + return '#text'; +} + +/** + * Used to keep track of the currently rendered `vnode` and print it + * in debug messages. + */ +let renderStack = []; + +/** + * Keep track of the current owners. An owner describes a component + * which was responsible to render a specific `vnode`. This exclude + * children that are passed via `props.children`, because they belong + * to the parent owner. + * + * ```jsx + * const Foo = props =>

{props.children}
// div's owner is Foo + * const Bar = props => { + * return ( + * // Foo's owner is Bar, span's owner is Bar + * ) + * } + * ``` + * + * Note: A `vnode` may be hoisted to the root scope due to compiler + * optimiztions. In these cases the `_owner` will be different. + */ +let ownerStack = []; + +/** + * Get the currently rendered `vnode` + * @returns {import('./internal').VNode | null} + */ +export function getCurrentVNode() { + return renderStack.length > 0 ? renderStack[renderStack.length - 1] : null; +} + +/** + * If the user doesn't have `@babel/plugin-transform-react-jsx-source` + * somewhere in his tool chain we can't print the filename and source + * location of a component. In that case we just omit that, but we'll + * print a helpful message to the console, notifying the user of it. + */ +let showJsxSourcePluginWarning = true; + +/** + * Check if a `vnode` is a possible owner. + * @param {import('./internal').VNode} vnode + */ +function isPossibleOwner(vnode) { + return typeof vnode.type == 'function' && vnode.type != Fragment; +} + +/** + * Return the component stack that was captured up to this point. + * @param {import('./internal').VNode} vnode + * @returns {string} + */ +export function getOwnerStack(vnode) { + const stack = [vnode]; + let next = vnode; + while (next._owner != null) { + stack.push(next._owner); + next = next._owner; + } + + return stack.reduce((acc, owner) => { + acc += ` in ${getDisplayName(owner)}`; + + const source = owner.__source; + if (source) { + acc += ` (at ${source.fileName}:${source.lineNumber})`; + } else if (showJsxSourcePluginWarning) { + console.warn( + 'Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.' + ); + } + showJsxSourcePluginWarning = false; + + return (acc += '\n'); + }, ''); +} + +/** + * Setup code to capture the component trace while rendering. Note that + * we cannot simply traverse `vnode._parent` upwards, because we have some + * debug messages for `this.setState` where the `vnode` is `undefined`. + */ +export function setupComponentStack() { + let oldDiff = options._diff; + let oldDiffed = options.diffed; + let oldRoot = options._root; + let oldVNode = options.vnode; + let oldRender = options._render; + + options.diffed = vnode => { + if (isPossibleOwner(vnode)) { + ownerStack.pop(); + } + renderStack.pop(); + if (oldDiffed) oldDiffed(vnode); + }; + + options._diff = vnode => { + if (isPossibleOwner(vnode)) { + renderStack.push(vnode); + } + if (oldDiff) oldDiff(vnode); + }; + + options._root = (vnode, parent) => { + ownerStack = []; + if (oldRoot) oldRoot(vnode, parent); + }; + + options.vnode = vnode => { + vnode._owner = + ownerStack.length > 0 ? ownerStack[ownerStack.length - 1] : null; + if (oldVNode) oldVNode(vnode); + }; + + options._render = vnode => { + if (isPossibleOwner(vnode)) { + ownerStack.push(vnode); + } + + if (oldRender) oldRender(vnode); + }; +} diff --git a/node_modules/preact/debug/src/constants.js b/node_modules/preact/debug/src/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..e15b547a197ecc4cfe5204612b6801ec9d5d666e --- /dev/null +++ b/node_modules/preact/debug/src/constants.js @@ -0,0 +1,3 @@ +export const ELEMENT_NODE = 1; +export const DOCUMENT_NODE = 9; +export const DOCUMENT_FRAGMENT_NODE = 11; diff --git a/node_modules/preact/debug/src/debug.js b/node_modules/preact/debug/src/debug.js new file mode 100644 index 0000000000000000000000000000000000000000..8da063130fcb107557b5f38dd91454a8122d6b6c --- /dev/null +++ b/node_modules/preact/debug/src/debug.js @@ -0,0 +1,593 @@ +import { checkPropTypes } from './check-props'; +import { options, Component } from 'preact'; +import { + ELEMENT_NODE, + DOCUMENT_NODE, + DOCUMENT_FRAGMENT_NODE +} from './constants'; +import { + getOwnerStack, + setupComponentStack, + getCurrentVNode, + getDisplayName +} from './component-stack'; +import { assign, isNaN } from './util'; + +const isWeakMapSupported = typeof WeakMap == 'function'; + +/** + * @param {import('./internal').VNode} vnode + * @returns {Array} + */ +function getDomChildren(vnode) { + let domChildren = []; + + if (!vnode._children) return domChildren; + + vnode._children.forEach(child => { + if (child && typeof child.type === 'function') { + domChildren.push.apply(domChildren, getDomChildren(child)); + } else if (child && typeof child.type === 'string') { + domChildren.push(child.type); + } + }); + + return domChildren; +} + +/** + * @param {import('./internal').VNode} parent + * @returns {string} + */ +function getClosestDomNodeParentName(parent) { + if (!parent) return ''; + if (typeof parent.type == 'function') { + if (parent._parent == null) { + if (parent._dom != null && parent._dom.parentNode != null) { + return parent._dom.parentNode.localName; + } + return ''; + } + return getClosestDomNodeParentName(parent._parent); + } + return /** @type {string} */ (parent.type); +} + +export function initDebug() { + setupComponentStack(); + + let hooksAllowed = false; + + /* eslint-disable no-console */ + let oldBeforeDiff = options._diff; + let oldDiffed = options.diffed; + let oldVnode = options.vnode; + let oldRender = options._render; + let oldCatchError = options._catchError; + let oldRoot = options._root; + let oldHook = options._hook; + const warnedComponents = !isWeakMapSupported + ? null + : { + useEffect: new WeakMap(), + useLayoutEffect: new WeakMap(), + lazyPropTypes: new WeakMap() + }; + const deprecations = []; + + options._catchError = (error, vnode, oldVNode, errorInfo) => { + let component = vnode && vnode._component; + if (component && typeof error.then == 'function') { + const promise = error; + error = new Error( + `Missing Suspense. The throwing component was: ${getDisplayName(vnode)}` + ); + + let parent = vnode; + for (; parent; parent = parent._parent) { + if (parent._component && parent._component._childDidSuspend) { + error = promise; + break; + } + } + + // We haven't recovered and we know at this point that there is no + // Suspense component higher up in the tree + if (error instanceof Error) { + throw error; + } + } + + try { + errorInfo = errorInfo || {}; + errorInfo.componentStack = getOwnerStack(vnode); + oldCatchError(error, vnode, oldVNode, errorInfo); + + // when an error was handled by an ErrorBoundary we will nonetheless emit an error + // event on the window object. This is to make up for react compatibility in dev mode + // and thus make the Next.js dev overlay work. + if (typeof error.then != 'function') { + setTimeout(() => { + throw error; + }); + } + } catch (e) { + throw e; + } + }; + + options._root = (vnode, parentNode) => { + if (!parentNode) { + throw new Error( + 'Undefined parent passed to render(), this is the second argument.\n' + + 'Check if the element is available in the DOM/has the correct id.' + ); + } + + let isValid; + switch (parentNode.nodeType) { + case ELEMENT_NODE: + case DOCUMENT_FRAGMENT_NODE: + case DOCUMENT_NODE: + isValid = true; + break; + default: + isValid = false; + } + + if (!isValid) { + let componentName = getDisplayName(vnode); + throw new Error( + `Expected a valid HTML node as a second argument to render. Received ${parentNode} instead: render(<${componentName} />, ${parentNode});` + ); + } + + if (oldRoot) oldRoot(vnode, parentNode); + }; + + options._diff = vnode => { + let { type } = vnode; + + hooksAllowed = true; + + if (type === undefined) { + throw new Error( + 'Undefined component passed to createElement()\n\n' + + 'You likely forgot to export your component or might have mixed up default and named imports' + + serializeVNode(vnode) + + `\n\n${getOwnerStack(vnode)}` + ); + } else if (type != null && typeof type == 'object') { + if (type._children !== undefined && type._dom !== undefined) { + throw new Error( + `Invalid type passed to createElement(): ${type}\n\n` + + 'Did you accidentally pass a JSX literal as JSX twice?\n\n' + + ` let My${getDisplayName(vnode)} = ${serializeVNode(type)};\n` + + ` let vnode = ;\n\n` + + 'This usually happens when you export a JSX literal and not the component.' + + `\n\n${getOwnerStack(vnode)}` + ); + } + + throw new Error( + 'Invalid type passed to createElement(): ' + + (Array.isArray(type) ? 'array' : type) + ); + } + + if ( + vnode.ref !== undefined && + typeof vnode.ref != 'function' && + typeof vnode.ref != 'object' && + !('$$typeof' in vnode) // allow string refs when preact-compat is installed + ) { + throw new Error( + `Component's "ref" property should be a function, or an object created ` + + `by createRef(), but got [${typeof vnode.ref}] instead\n` + + serializeVNode(vnode) + + `\n\n${getOwnerStack(vnode)}` + ); + } + + if (typeof vnode.type == 'string') { + for (const key in vnode.props) { + if ( + key[0] === 'o' && + key[1] === 'n' && + typeof vnode.props[key] != 'function' && + vnode.props[key] != null + ) { + throw new Error( + `Component's "${key}" property should be a function, ` + + `but got [${typeof vnode.props[key]}] instead\n` + + serializeVNode(vnode) + + `\n\n${getOwnerStack(vnode)}` + ); + } + } + } + + // Check prop-types if available + if (typeof vnode.type == 'function' && vnode.type.propTypes) { + if ( + vnode.type.displayName === 'Lazy' && + warnedComponents && + !warnedComponents.lazyPropTypes.has(vnode.type) + ) { + const m = + 'PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. '; + try { + const lazyVNode = vnode.type(); + warnedComponents.lazyPropTypes.set(vnode.type, true); + console.warn( + m + `Component wrapped in lazy() is ${getDisplayName(lazyVNode)}` + ); + } catch (promise) { + console.warn( + m + "We will log the wrapped component's name once it is loaded." + ); + } + } + + let values = vnode.props; + if (vnode.type._forwarded) { + values = assign({}, values); + delete values.ref; + } + + checkPropTypes( + vnode.type.propTypes, + values, + 'prop', + getDisplayName(vnode), + () => getOwnerStack(vnode) + ); + } + + if (oldBeforeDiff) oldBeforeDiff(vnode); + }; + + let renderCount = 0; + let currentComponent; + options._render = vnode => { + if (oldRender) { + oldRender(vnode); + } + hooksAllowed = true; + + const nextComponent = vnode._component; + if (nextComponent === currentComponent) { + renderCount++; + } else { + renderCount = 1; + } + + if (renderCount >= 25) { + throw new Error( + `Too many re-renders. This is limited to prevent an infinite loop ` + + `which may lock up your browser. The component causing this is: ${getDisplayName( + vnode + )}` + ); + } + + currentComponent = nextComponent; + }; + + options._hook = (comp, index, type) => { + if (!comp || !hooksAllowed) { + throw new Error('Hook can only be invoked from render methods.'); + } + + if (oldHook) oldHook(comp, index, type); + }; + + // Ideally we'd want to print a warning once per component, but we + // don't have access to the vnode that triggered it here. As a + // compromise and to avoid flooding the console with warnings we + // print each deprecation warning only once. + const warn = (property, message) => ({ + get() { + const key = 'get' + property + message; + if (deprecations && deprecations.indexOf(key) < 0) { + deprecations.push(key); + console.warn(`getting vnode.${property} is deprecated, ${message}`); + } + }, + set() { + const key = 'set' + property + message; + if (deprecations && deprecations.indexOf(key) < 0) { + deprecations.push(key); + console.warn(`setting vnode.${property} is not allowed, ${message}`); + } + } + }); + + const deprecatedAttributes = { + nodeName: warn('nodeName', 'use vnode.type'), + attributes: warn('attributes', 'use vnode.props'), + children: warn('children', 'use vnode.props.children') + }; + + const deprecatedProto = Object.create({}, deprecatedAttributes); + + options.vnode = vnode => { + const props = vnode.props; + if ( + vnode.type !== null && + props != null && + ('__source' in props || '__self' in props) + ) { + const newProps = (vnode.props = {}); + for (let i in props) { + const v = props[i]; + if (i === '__source') vnode.__source = v; + else if (i === '__self') vnode.__self = v; + else newProps[i] = v; + } + } + + // eslint-disable-next-line + vnode.__proto__ = deprecatedProto; + if (oldVnode) oldVnode(vnode); + }; + + options.diffed = vnode => { + const { type, _parent: parent } = vnode; + // Check if the user passed plain objects as children. Note that we cannot + // move this check into `options.vnode` because components can receive + // children in any shape they want (e.g. + // `{{ foo: 123, bar: "abc" }}`). + // Putting this check in `options.diffed` ensures that + // `vnode._children` is set and that we only validate the children + // that were actually rendered. + if (vnode._children) { + vnode._children.forEach(child => { + if (typeof child === 'object' && child && child.type === undefined) { + const keys = Object.keys(child).join(','); + throw new Error( + `Objects are not valid as a child. Encountered an object with the keys {${keys}}.` + + `\n\n${getOwnerStack(vnode)}` + ); + } + }); + } + + if (vnode._component === currentComponent) { + renderCount = 0; + } + + if ( + typeof type === 'string' && + (isTableElement(type) || + type === 'p' || + type === 'a' || + type === 'button') + ) { + // Avoid false positives when Preact only partially rendered the + // HTML tree. Whilst we attempt to include the outer DOM in our + // validation, this wouldn't work on the server for + // `preact-render-to-string`. There we'd otherwise flood the terminal + // with false positives, which we'd like to avoid. + let domParentName = getClosestDomNodeParentName(parent); + if (domParentName !== '' && isTableElement(type)) { + if ( + type === 'table' && + // Tables can be nested inside each other if it's inside a cell. + // See https://developer.mozilla.org/en-US/docs/Learn/HTML/Tables/Advanced#nesting_tables + domParentName !== 'td' && + isTableElement(domParentName) + ) { + console.error( + 'Improper nesting of table. Your
should have a
should have a
should not have a table-node parent.' + + serializeVNode(vnode) + + `\n\n${getOwnerStack(vnode)}` + ); + } else if ( + (type === 'thead' || type === 'tfoot' || type === 'tbody') && + domParentName !== 'table' + ) { + console.error( + 'Improper nesting of table. Your should have a
parent.' + + serializeVNode(vnode) + + `\n\n${getOwnerStack(vnode)}` + ); + } else if ( + type === 'tr' && + domParentName !== 'thead' && + domParentName !== 'tfoot' && + domParentName !== 'tbody' + ) { + console.error( + 'Improper nesting of table. Your should have a parent.' + + serializeVNode(vnode) + + `\n\n${getOwnerStack(vnode)}` + ); + } else if (type === 'td' && domParentName !== 'tr') { + console.error( + 'Improper nesting of table. Your parent.' + + serializeVNode(vnode) + + `\n\n${getOwnerStack(vnode)}` + ); + } else if (type === 'th' && domParentName !== 'tr') { + console.error( + 'Improper nesting of table. Your .' + + serializeVNode(vnode) + + `\n\n${getOwnerStack(vnode)}` + ); + } + } else if (type === 'p') { + let illegalDomChildrenTypes = getDomChildren(vnode).filter(childType => + ILLEGAL_PARAGRAPH_CHILD_ELEMENTS.test(childType) + ); + if (illegalDomChildrenTypes.length) { + console.error( + 'Improper nesting of paragraph. Your

should not have ' + + illegalDomChildrenTypes.join(', ') + + ' as child-elements.' + + serializeVNode(vnode) + + `\n\n${getOwnerStack(vnode)}` + ); + } + } else if (type === 'a' || type === 'button') { + if (getDomChildren(vnode).indexOf(type) !== -1) { + console.error( + `Improper nesting of interactive content. Your <${type}>` + + ` should not have other ${type === 'a' ? 'anchor' : 'button'}` + + ' tags as child-elements.' + + serializeVNode(vnode) + + `\n\n${getOwnerStack(vnode)}` + ); + } + } + } + + hooksAllowed = false; + + if (oldDiffed) oldDiffed(vnode); + + if (vnode._children != null) { + const keys = []; + for (let i = 0; i < vnode._children.length; i++) { + const child = vnode._children[i]; + if (!child || child.key == null) continue; + + const key = child.key; + if (keys.indexOf(key) !== -1) { + console.error( + 'Following component has two or more children with the ' + + `same key attribute: "${key}". This may cause glitches and misbehavior ` + + 'in rendering process. Component: \n\n' + + serializeVNode(vnode) + + `\n\n${getOwnerStack(vnode)}` + ); + + // Break early to not spam the console + break; + } + + keys.push(key); + } + } + + if (vnode._component != null && vnode._component.__hooks != null) { + // Validate that none of the hooks in this component contain arguments that are NaN. + // This is a common mistake that can be hard to debug, so we want to catch it early. + const hooks = vnode._component.__hooks._list; + if (hooks) { + for (let i = 0; i < hooks.length; i += 1) { + const hook = hooks[i]; + if (hook._args) { + for (let j = 0; j < hook._args.length; j++) { + const arg = hook._args[j]; + if (isNaN(arg)) { + const componentName = getDisplayName(vnode); + console.warn( + `Invalid argument passed to hook. Hooks should not be called with NaN in the dependency array. Hook index ${i} in component ${componentName} was called with NaN.` + ); + } + } + } + } + } + } + }; +} + +const setState = Component.prototype.setState; +Component.prototype.setState = function (update, callback) { + if (this._vnode == null) { + // `this._vnode` will be `null` during componentWillMount. But it + // is perfectly valid to call `setState` during cWM. So we + // need an additional check to verify that we are dealing with a + // call inside constructor. + if (this.state == null) { + console.warn( + `Calling "this.setState" inside the constructor of a component is a ` + + `no-op and might be a bug in your application. Instead, set ` + + `"this.state = {}" directly.\n\n${getOwnerStack(getCurrentVNode())}` + ); + } + } + + return setState.call(this, update, callback); +}; + +function isTableElement(type) { + return ( + type === 'table' || + type === 'tfoot' || + type === 'tbody' || + type === 'thead' || + type === 'td' || + type === 'tr' || + type === 'th' + ); +} + +const ILLEGAL_PARAGRAPH_CHILD_ELEMENTS = + /^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/; + +const forceUpdate = Component.prototype.forceUpdate; +Component.prototype.forceUpdate = function (callback) { + if (this._vnode == null) { + console.warn( + `Calling "this.forceUpdate" inside the constructor of a component is a ` + + `no-op and might be a bug in your application.\n\n${getOwnerStack( + getCurrentVNode() + )}` + ); + } else if (this._parentDom == null) { + console.warn( + `Can't call "this.forceUpdate" on an unmounted component. This is a no-op, ` + + `but it indicates a memory leak in your application. To fix, cancel all ` + + `subscriptions and asynchronous tasks in the componentWillUnmount method.` + + `\n\n${getOwnerStack(this._vnode)}` + ); + } + return forceUpdate.call(this, callback); +}; + +/** + * Serialize a vnode tree to a string + * @param {import('./internal').VNode} vnode + * @returns {string} + */ +export function serializeVNode(vnode) { + let { props } = vnode; + let name = getDisplayName(vnode); + + let attrs = ''; + for (let prop in props) { + if (props.hasOwnProperty(prop) && prop !== 'children') { + let value = props[prop]; + + // If it is an object but doesn't have toString(), use Object.toString + if (typeof value == 'function') { + value = `function ${value.displayName || value.name}() {}`; + } + + value = + Object(value) === value && !value.toString + ? Object.prototype.toString.call(value) + : value + ''; + + attrs += ` ${prop}=${JSON.stringify(value)}`; + } + } + + let children = props.children; + return `<${name}${attrs}${ + children && children.length ? '>..' : ' />' + }`; +} + +options._hydrationMismatch = (newVNode, excessDomChildren) => { + const { type } = newVNode; + const availableTypes = excessDomChildren + .map(child => child && child.localName) + .filter(Boolean); + console.error( + `Expected a DOM node of type "${type}" but found "${availableTypes.join(', ')}" as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n${getOwnerStack(newVNode)}` + ); +}; diff --git a/node_modules/preact/debug/src/index.d.ts b/node_modules/preact/debug/src/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5bb5d22261a8940ee71e9890b7268869c2a0eb1a --- /dev/null +++ b/node_modules/preact/debug/src/index.d.ts @@ -0,0 +1,23 @@ +import { VNode } from 'preact'; + +/** + * Get the currently rendered `vnode` + */ +export function getCurrentVNode(): VNode | null; + +/** + * Return the component stack that was captured up to this point. + */ +export function getOwnerStack(vnode: VNode): string; + +/** + * Setup code to capture the component trace while rendering. Note that + * we cannot simply traverse `vnode._parent` upwards, because we have some + * debug messages for `this.setState` where the `vnode` is `undefined`. + */ +export function setupComponentStack(): void; + +/** + * Reset the history of which prop type warnings have been logged. + */ +export function resetPropWarnings(): void; diff --git a/node_modules/preact/debug/src/index.js b/node_modules/preact/debug/src/index.js new file mode 100644 index 0000000000000000000000000000000000000000..adea553687b207e98a349dcd5538da962da59eb6 --- /dev/null +++ b/node_modules/preact/debug/src/index.js @@ -0,0 +1,12 @@ +import { initDebug } from './debug'; +import 'preact/devtools'; + +initDebug(); + +export { resetPropWarnings } from './check-props'; + +export { + getCurrentVNode, + getDisplayName, + getOwnerStack +} from './component-stack'; diff --git a/node_modules/preact/debug/src/internal.d.ts b/node_modules/preact/debug/src/internal.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..866943c94844183a53cc03ec56d27d36d8127087 --- /dev/null +++ b/node_modules/preact/debug/src/internal.d.ts @@ -0,0 +1,82 @@ +import { Component, PreactElement, VNode, Options } from '../../src/internal'; + +export { Component, PreactElement, VNode, Options }; + +export interface DevtoolsInjectOptions { + /** 1 = DEV, 0 = production */ + bundleType: 1 | 0; + /** The devtools enable different features for different versions of react */ + version: string; + /** Informative string, currently unused in the devtools */ + rendererPackageName: string; + /** Find the root dom node of a vnode */ + findHostInstanceByFiber(vnode: VNode): HTMLElement | null; + /** Find the closest vnode given a dom node */ + findFiberByHostInstance(instance: HTMLElement): VNode | null; +} + +export interface DevtoolsUpdater { + setState(objOrFn: any): void; + forceUpdate(): void; + setInState(path: Array, value: any): void; + setInProps(path: Array, value: any): void; + setInContext(): void; +} + +export type NodeType = 'Composite' | 'Native' | 'Wrapper' | 'Text'; + +export interface DevtoolData { + nodeType: NodeType; + // Component type + type: any; + name: string; + ref: any; + key: string | number; + updater: DevtoolsUpdater | null; + text: string | number | null; + state: any; + props: any; + children: VNode[] | string | number | null; + publicInstance: PreactElement | Text | Component; + memoizedInteractions: any[]; + + actualDuration: number; + actualStartTime: number; + treeBaseDuration: number; +} + +export type EventType = + | 'unmount' + | 'rootCommitted' + | 'root' + | 'mount' + | 'update' + | 'updateProfileTimes'; + +export interface DevtoolsEvent { + data?: DevtoolData; + internalInstance: VNode; + renderer: string; + type: EventType; +} + +export interface DevtoolsHook { + _renderers: Record; + _roots: Set; + on(ev: string, listener: () => void): void; + emit(ev: string, data?: object): void; + helpers: Record; + getFiberRoots(rendererId: string): Set; + inject(config: DevtoolsInjectOptions): string; + onCommitFiberRoot(rendererId: string, root: VNode): void; + onCommitFiberUnmount(rendererId: string, vnode: VNode): void; +} + +export interface DevtoolsWindow extends Window { + /** + * If the devtools extension is installed it will inject this object into + * the dom. This hook handles all communications between preact and the + * devtools panel. + */ + __REACT_DEVTOOLS_GLOBAL_HOOK__?: DevtoolsHook; +} diff --git a/node_modules/preact/debug/src/util.js b/node_modules/preact/debug/src/util.js new file mode 100644 index 0000000000000000000000000000000000000000..be4228b9b67f708dbe651fd1669c37ecb630a830 --- /dev/null +++ b/node_modules/preact/debug/src/util.js @@ -0,0 +1,15 @@ +/** + * Assign properties from `props` to `obj` + * @template O, P The obj and props types + * @param {O} obj The object to copy properties to + * @param {P} props The object to copy properties from + * @returns {O & P} + */ +export function assign(obj, props) { + for (let i in props) obj[i] = props[i]; + return /** @type {O & P} */ (obj); +} + +export function isNaN(value) { + return value !== value; +} diff --git a/node_modules/preact/devtools/dist/devtools.js b/node_modules/preact/devtools/dist/devtools.js new file mode 100644 index 0000000000000000000000000000000000000000..9b64ea1aca8e76eb2500c61f7329ebd443301836 --- /dev/null +++ b/node_modules/preact/devtools/dist/devtools.js @@ -0,0 +1,2 @@ +var e,n=require("preact");null!=(e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0)&&e.__PREACT_DEVTOOLS__&&e.__PREACT_DEVTOOLS__.attachPreact("10.29.0",n.options,{Fragment:n.Fragment,Component:n.Component}),exports.addHookName=function(e,o){return n.options.__a&&n.options.__a(o),e}; +//# sourceMappingURL=devtools.js.map diff --git a/node_modules/preact/devtools/dist/devtools.js.map b/node_modules/preact/devtools/dist/devtools.js.map new file mode 100644 index 0000000000000000000000000000000000000000..b8f2f5b5e23e94116c0a681faaedc3bec4d56c8d --- /dev/null +++ b/node_modules/preact/devtools/dist/devtools.js.map @@ -0,0 +1 @@ +{"version":3,"file":"devtools.js","sources":["../src/devtools.js","../src/index.js"],"sourcesContent":["import { Component, Fragment, options } from 'preact';\n\nexport function initDevTools() {\n\tconst globalVar =\n\t\ttypeof globalThis !== 'undefined'\n\t\t\t? globalThis\n\t\t\t: typeof window !== 'undefined'\n\t\t\t\t? window\n\t\t\t\t: undefined;\n\n\tif (\n\t\tglobalVar !== null &&\n\t\tglobalVar !== undefined &&\n\t\tglobalVar.__PREACT_DEVTOOLS__\n\t) {\n\t\tglobalVar.__PREACT_DEVTOOLS__.attachPreact('10.29.0', options, {\n\t\t\tFragment,\n\t\t\tComponent\n\t\t});\n\t}\n}\n","import { options } from 'preact';\nimport { initDevTools } from './devtools';\n\ninitDevTools();\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {(value: T, name: string) => T}\n */\nexport function addHookName(value, name) {\n\tif (options._addHookName) {\n\t\toptions._addHookName(name);\n\t}\n\treturn value;\n}\n"],"names":["globalVar","globalThis","window","undefined","__PREACT_DEVTOOLS__","attachPreact","options","Fragment","Component","value","name","__a"],"mappings":"IAGOA,sBAQLA,OARKA,EACiB,oBAAfC,WACJA,WACkB,oBAAXC,OACNA,YACAC,IAKJH,EAAUI,qBAEVJ,EAAUI,oBAAoBC,aAAa,UAAWC,EAAOA,QAAE,CAC9DC,SAAAA,EAAAA,SACAC,UAAAA,EAAAA,gCCRa,SAAYC,EAAOC,GAIlC,OAHIJ,EAAAA,QAAOK,KACVL,EAAAA,QAAOK,IAAcD,GAEfD,CACR"} \ No newline at end of file diff --git a/node_modules/preact/devtools/dist/devtools.mjs b/node_modules/preact/devtools/dist/devtools.mjs new file mode 100644 index 0000000000000000000000000000000000000000..22197eacef90a6b247e05179700035dcd3e7dfb3 --- /dev/null +++ b/node_modules/preact/devtools/dist/devtools.mjs @@ -0,0 +1,2 @@ +import{options as n,Fragment as o,Component as e}from"preact";var i;function t(o,e){return n.__a&&n.__a(e),o}null!=(i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0)&&i.__PREACT_DEVTOOLS__&&i.__PREACT_DEVTOOLS__.attachPreact("10.29.0",n,{Fragment:o,Component:e});export{t as addHookName}; +//# sourceMappingURL=devtools.module.js.map diff --git a/node_modules/preact/devtools/dist/devtools.module.js b/node_modules/preact/devtools/dist/devtools.module.js new file mode 100644 index 0000000000000000000000000000000000000000..22197eacef90a6b247e05179700035dcd3e7dfb3 --- /dev/null +++ b/node_modules/preact/devtools/dist/devtools.module.js @@ -0,0 +1,2 @@ +import{options as n,Fragment as o,Component as e}from"preact";var i;function t(o,e){return n.__a&&n.__a(e),o}null!=(i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0)&&i.__PREACT_DEVTOOLS__&&i.__PREACT_DEVTOOLS__.attachPreact("10.29.0",n,{Fragment:o,Component:e});export{t as addHookName}; +//# sourceMappingURL=devtools.module.js.map diff --git a/node_modules/preact/devtools/dist/devtools.module.js.map b/node_modules/preact/devtools/dist/devtools.module.js.map new file mode 100644 index 0000000000000000000000000000000000000000..7dc8d0c30f156bd23d704f99e73ffb09ab83dfb3 --- /dev/null +++ b/node_modules/preact/devtools/dist/devtools.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"devtools.module.js","sources":["../src/devtools.js","../src/index.js"],"sourcesContent":["import { Component, Fragment, options } from 'preact';\n\nexport function initDevTools() {\n\tconst globalVar =\n\t\ttypeof globalThis !== 'undefined'\n\t\t\t? globalThis\n\t\t\t: typeof window !== 'undefined'\n\t\t\t\t? window\n\t\t\t\t: undefined;\n\n\tif (\n\t\tglobalVar !== null &&\n\t\tglobalVar !== undefined &&\n\t\tglobalVar.__PREACT_DEVTOOLS__\n\t) {\n\t\tglobalVar.__PREACT_DEVTOOLS__.attachPreact('10.29.0', options, {\n\t\t\tFragment,\n\t\t\tComponent\n\t\t});\n\t}\n}\n","import { options } from 'preact';\nimport { initDevTools } from './devtools';\n\ninitDevTools();\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {(value: T, name: string) => T}\n */\nexport function addHookName(value, name) {\n\tif (options._addHookName) {\n\t\toptions._addHookName(name);\n\t}\n\treturn value;\n}\n"],"names":["globalVar","addHookName","value","name","options","__a","globalThis","window","undefined","__PREACT_DEVTOOLS__","attachPreact","Fragment","Component"],"mappings":"8DAEgB,IACTA,ECMS,SAAAC,EAAYC,EAAOC,GAIlC,OAHIC,EAAOC,KACVD,EAAOC,IAAcF,GAEfD,CACR,CDHEF,OARKA,EACiB,oBAAfM,WACJA,WACkB,oBAAXC,OACNA,YACAC,IAKJR,EAAUS,qBAEVT,EAAUS,oBAAoBC,aAAa,UAAWN,EAAS,CAC9DO,SAAAA,EACAC,UAAAA"} \ No newline at end of file diff --git a/node_modules/preact/devtools/dist/devtools.umd.js b/node_modules/preact/devtools/dist/devtools.umd.js new file mode 100644 index 0000000000000000000000000000000000000000..71e322bd4c48db88bd931402dc91739f751bbef5 --- /dev/null +++ b/node_modules/preact/devtools/dist/devtools.umd.js @@ -0,0 +1,2 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("preact")):"function"==typeof define&&define.amd?define(["exports","preact"],n):n((e||self).preactDevtools={},e.preact)}(this,function(e,n){var o;null!=(o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0)&&o.__PREACT_DEVTOOLS__&&o.__PREACT_DEVTOOLS__.attachPreact("10.29.0",n.options,{Fragment:n.Fragment,Component:n.Component}),e.addHookName=function(e,o){return n.options.__a&&n.options.__a(o),e}}); +//# sourceMappingURL=devtools.umd.js.map diff --git a/node_modules/preact/devtools/dist/devtools.umd.js.map b/node_modules/preact/devtools/dist/devtools.umd.js.map new file mode 100644 index 0000000000000000000000000000000000000000..a057e0dbabd02b565e71a4e753f443ff298cbffc --- /dev/null +++ b/node_modules/preact/devtools/dist/devtools.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"devtools.umd.js","sources":["../src/devtools.js","../src/index.js"],"sourcesContent":["import { Component, Fragment, options } from 'preact';\n\nexport function initDevTools() {\n\tconst globalVar =\n\t\ttypeof globalThis !== 'undefined'\n\t\t\t? globalThis\n\t\t\t: typeof window !== 'undefined'\n\t\t\t\t? window\n\t\t\t\t: undefined;\n\n\tif (\n\t\tglobalVar !== null &&\n\t\tglobalVar !== undefined &&\n\t\tglobalVar.__PREACT_DEVTOOLS__\n\t) {\n\t\tglobalVar.__PREACT_DEVTOOLS__.attachPreact('10.29.0', options, {\n\t\t\tFragment,\n\t\t\tComponent\n\t\t});\n\t}\n}\n","import { options } from 'preact';\nimport { initDevTools } from './devtools';\n\ninitDevTools();\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {(value: T, name: string) => T}\n */\nexport function addHookName(value, name) {\n\tif (options._addHookName) {\n\t\toptions._addHookName(name);\n\t}\n\treturn value;\n}\n"],"names":["globalVar","globalThis","window","undefined","__PREACT_DEVTOOLS__","attachPreact","options","Fragment","Component","value","name","__a"],"mappings":"8QAEgB,IACTA,EAQLA,OARKA,EACiB,oBAAfC,WACJA,WACkB,oBAAXC,OACNA,YACAC,IAKJH,EAAUI,qBAEVJ,EAAUI,oBAAoBC,aAAa,UAAWC,EAAOA,QAAE,CAC9DC,SAAAA,EAAAA,SACAC,UAAAA,EAAAA,0BCRa,SAAYC,EAAOC,GAIlC,OAHIJ,EAAAA,QAAOK,KACVL,EAAAA,QAAOK,IAAcD,GAEfD,CACR"} \ No newline at end of file diff --git a/node_modules/preact/devtools/package.json b/node_modules/preact/devtools/package.json new file mode 100644 index 0000000000000000000000000000000000000000..c12ac730f0b3197afc27df6033f13325d6789799 --- /dev/null +++ b/node_modules/preact/devtools/package.json @@ -0,0 +1,25 @@ +{ + "name": "preact-devtools", + "amdName": "preactDevtools", + "version": "1.0.0", + "private": true, + "description": "Preact bridge for Preact devtools", + "main": "dist/devtools.js", + "module": "dist/devtools.module.js", + "umd:main": "dist/devtools.umd.js", + "source": "src/index.js", + "license": "MIT", + "types": "src/index.d.ts", + "peerDependencies": { + "preact": "^10.0.0" + }, + "exports": { + ".": { + "types": "./src/index.d.ts", + "browser": "./dist/devtools.module.js", + "umd": "./dist/devtools.umd.js", + "import": "./dist/devtools.mjs", + "require": "./dist/devtools.js" + } + } +} diff --git a/node_modules/preact/devtools/src/devtools.js b/node_modules/preact/devtools/src/devtools.js new file mode 100644 index 0000000000000000000000000000000000000000..4ff1f68813e7c9917d721dd9883d6fa298d8780a --- /dev/null +++ b/node_modules/preact/devtools/src/devtools.js @@ -0,0 +1,21 @@ +import { Component, Fragment, options } from 'preact'; + +export function initDevTools() { + const globalVar = + typeof globalThis !== 'undefined' + ? globalThis + : typeof window !== 'undefined' + ? window + : undefined; + + if ( + globalVar !== null && + globalVar !== undefined && + globalVar.__PREACT_DEVTOOLS__ + ) { + globalVar.__PREACT_DEVTOOLS__.attachPreact('10.29.0', options, { + Fragment, + Component + }); + } +} diff --git a/node_modules/preact/devtools/src/index.d.ts b/node_modules/preact/devtools/src/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..230e5ab6ecab317a6b9d9fe1b055b0a653558111 --- /dev/null +++ b/node_modules/preact/devtools/src/index.d.ts @@ -0,0 +1,8 @@ +/** + * Customize the displayed name of a useState, useReducer or useRef hook + * in the devtools panel. + * + * @param value Wrapped native hook. + * @param name Custom name + */ +export function addHookName(value: T, name: string): T; diff --git a/node_modules/preact/devtools/src/index.js b/node_modules/preact/devtools/src/index.js new file mode 100644 index 0000000000000000000000000000000000000000..693429f56c1908fada8deec75520ef32d0f4ec57 --- /dev/null +++ b/node_modules/preact/devtools/src/index.js @@ -0,0 +1,15 @@ +import { options } from 'preact'; +import { initDevTools } from './devtools'; + +initDevTools(); + +/** + * Display a custom label for a custom hook for the devtools panel + * @type {(value: T, name: string) => T} + */ +export function addHookName(value, name) { + if (options._addHookName) { + options._addHookName(name); + } + return value; +} diff --git a/node_modules/preact/dist/preact.js b/node_modules/preact/dist/preact.js new file mode 100644 index 0000000000000000000000000000000000000000..5b0ec21190a7ebd9528db28fffff2f6f84531f42 --- /dev/null +++ b/node_modules/preact/dist/preact.js @@ -0,0 +1,2 @@ +var n,l,t,u,r,i,o,e,f,c,s,a,h,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function w(n,l){for(var t in l)n[t]=l[t];return n}function g(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function _(l,t,u){var r,i,o,e={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:e[o]=t[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):u),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===e[o]&&(e[o]=l.defaultProps[o]);return x(l,e,r,i,null)}function x(n,u,r,i,o){var e={type:n,props:u,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++t:o,__i:-1,__u:0};return null==o&&null!=l.vnode&&l.vnode(e),e}function m(n){return n.children}function b(n,l){this.props=n,this.context=l}function k(n,l){if(null==l)return n.__?k(n.__,n.__i+1):null;for(var t;ll&&r.sort(e),n=r.shift(),l=r.length,S(n)}finally{r.length=C.__r=0}}function I(n,l,t,u,r,i,o,e,f,c,s){var a,h,y,d,w,g,_,x=u&&u.__k||v,m=l.length;for(f=P(t,l,x,f,m),a=0;a0?o=n.__k[i]=x(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):n.__k[i]=o,f=i+h,o.__=n,o.__b=n.__b+1,e=null,-1!=(c=o.__i=H(o,t,f,a))&&(a--,(e=t[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(r>s?h--:rf?h--:h++,o.__u|=4))):n.__k[i]=null;if(a)for(i=0;i(s?1:0))for(r=t-1,i=t+1;r>=0||i=0?r--:i++])&&0==(2&c.__u)&&e==c.key&&f==c.type)return o;return-1}function L(n,l,t){"-"==l[0]?n.setProperty(l,null==t?"":t):n[l]=null==t?"":"number"!=typeof t||y.test(l)?t:t+"px"}function T(n,l,t,u,r){var i,o;n:if("style"==l)if("string"==typeof t)n.style.cssText=t;else{if("string"==typeof u&&(n.style.cssText=u=""),u)for(l in u)t&&l in t||L(n.style,l,"");if(t)for(l in t)u&&t[l]==u[l]||L(n.style,l,t[l])}else if("o"==l[0]&&"n"==l[1])i=l!=(l=l.replace(f,"$1")),o=l.toLowerCase(),l=o in n||"onFocusOut"==l||"onFocusIn"==l?o.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+i]=t,t?u?t.t=u.t:(t.t=c,n.addEventListener(l,i?a:s,i)):n.removeEventListener(l,i?a:s,i);else{if("http://www.w3.org/2000/svg"==r)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==t?"":t;break n}catch(n){}"function"==typeof t||(null==t||!1===t&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==t?"":t))}}function j(n){return function(t){if(this.l){var u=this.l[t.type+n];if(null==t.u)t.u=c++;else if(t.u0?n:d(n)?n.map(N):w({},n)}function V(t,u,r,i,o,e,f,c,s){var a,h,v,y,w,_,x,m=r.props||p,b=u.props,S=u.type;if("svg"==S?o="http://www.w3.org/2000/svg":"math"==S?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a2&&(f.children=arguments.length>3?n.call(arguments,2):u),x(l.type,f,r||l.key,i||l.ref,null)},exports.createContext=function(n){function l(n){var t,u;return this.getChildContext||(t=new Set,(u={})[l.__c]=this,this.getChildContext=function(){return u},this.componentWillUnmount=function(){t=null},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&t.forEach(function(n){n.__e=!0,$(n)})},this.sub=function(n){t.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){t&&t.delete(n),l&&l.call(n)}}),n.children}return l.__c="__cC"+h++,l.__=n,l.Provider=l.__l=(l.Consumer=function(n,l){return n.children(l)}).contextType=l,l},exports.createElement=_,exports.createRef=function(){return{current:null}},exports.h=_,exports.hydrate=function n(l,t){E(l,t,n)},exports.isValidElement=u,exports.options=l,exports.render=E,exports.toChildArray=function n(l,t){return t=t||[],null==l||"boolean"==typeof l||(d(l)?l.some(function(l){n(l,t)}):t.push(l)),t}; +//# sourceMappingURL=preact.js.map diff --git a/node_modules/preact/dist/preact.js.map b/node_modules/preact/dist/preact.js.map new file mode 100644 index 0000000000000000000000000000000000000000..54593531916ce7ae678af58cc94cef78445db79a --- /dev/null +++ b/node_modules/preact/dist/preact.js.map @@ -0,0 +1 @@ +{"version":3,"file":"preact.js","sources":["../src/constants.js","../src/util.js","../src/options.js","../src/create-element.js","../src/component.js","../src/diff/props.js","../src/create-context.js","../src/diff/children.js","../src/diff/index.js","../src/render.js","../src/diff/catch-error.js","../src/clone-element.js"],"sourcesContent":["/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { EMPTY_ARR } from './constants';\n\nexport const isArray = Array.isArray;\n\n/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\t// @ts-expect-error We change the type of `obj` to be `O & P`\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\n * @param {import('./index').ContainerNode} node The node to remove\n */\nexport function removeNode(node) {\n\tif (node && node.parentNode) node.parentNode.removeChild(node);\n}\n\nexport const slice = EMPTY_ARR.slice;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n","import { slice } from './util';\nimport options from './options';\nimport { NULL, UNDEFINED } from './constants';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor for this\n * virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array} [children] The children of the\n * virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != NULL) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === UNDEFINED) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, NULL);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\t/** @type {import('./internal').VNode} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: NULL,\n\t\t_parent: NULL,\n\t\t_depth: 0,\n\t\t_dom: NULL,\n\t\t_component: NULL,\n\t\tconstructor: UNDEFINED,\n\t\t_original: original == NULL ? ++vnodeId : original,\n\t\t_index: -1,\n\t\t_flags: 0\n\t};\n\n\t// Only invoke the vnode hook if this was *not* a direct copy:\n\tif (original == NULL && options.vnode != NULL) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: NULL };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != NULL && vnode.constructor === UNDEFINED;\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\nimport { MODE_HYDRATE, NULL } from './constants';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function BaseComponent(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {import('./internal').Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nBaseComponent.prototype.setState = function (update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != NULL && this._nextState != this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == NULL) return;\n\n\tif (this._vnode) {\n\t\tif (callback) {\n\t\t\tthis._stateCallbacks.push(callback);\n\t\t}\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {import('./internal').Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nBaseComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](https://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {ComponentChildren | void}\n */\nBaseComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == NULL) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._index + 1)\n\t\t\t: NULL;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != NULL && sibling._dom != NULL) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : NULL;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tif (component._parentDom && component._dirty) {\n\t\tlet oldVNode = component._vnode,\n\t\t\toldDom = oldVNode._dom,\n\t\t\tcommitQueue = [],\n\t\t\trefQueue = [],\n\t\t\tnewVNode = assign({}, oldVNode);\n\t\tnewVNode._original = oldVNode._original + 1;\n\t\tif (options.vnode) options.vnode(newVNode);\n\n\t\tdiff(\n\t\t\tcomponent._parentDom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tcomponent._parentDom.namespaceURI,\n\t\t\toldVNode._flags & MODE_HYDRATE ? [oldDom] : NULL,\n\t\t\tcommitQueue,\n\t\t\toldDom == NULL ? getDomSibling(oldVNode) : oldDom,\n\t\t\t!!(oldVNode._flags & MODE_HYDRATE),\n\t\t\trefQueue\n\t\t);\n\n\t\tnewVNode._original = oldVNode._original;\n\t\tnewVNode._parent._children[newVNode._index] = newVNode;\n\t\tcommitRoot(commitQueue, newVNode, refQueue);\n\t\toldVNode._dom = oldVNode._parent = null;\n\n\t\tif (newVNode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(newVNode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != NULL && vnode._component != NULL) {\n\t\tvnode._dom = vnode._component.base = NULL;\n\t\tvnode._children.some(child => {\n\t\t\tif (child != NULL && child._dom != NULL) {\n\t\t\t\treturn (vnode._dom = vnode._component.base = child._dom);\n\t\t\t}\n\t\t});\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce != options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/**\n * @param {import('./internal').Component} a\n * @param {import('./internal').Component} b\n */\nconst depthSort = (a, b) => a._vnode._depth - b._vnode._depth;\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\ttry {\n\t\tlet c,\n\t\t\tl = 1;\n\n\t\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t\t// process() calls from getting scheduled while `queue` is still being consumed.\n\t\twhile (rerenderQueue.length) {\n\t\t\t// Keep the rerender queue sorted by (depth, insertion order). The queue\n\t\t\t// will initially be sorted on the first iteration only if it has more than 1 item.\n\t\t\t//\n\t\t\t// New items can be added to the queue e.g. when rerendering a provider, so we want to\n\t\t\t// keep the order from top to bottom with those new items so we can handle them in a\n\t\t\t// single pass\n\t\t\tif (rerenderQueue.length > l) {\n\t\t\t\trerenderQueue.sort(depthSort);\n\t\t\t}\n\n\t\t\tc = rerenderQueue.shift();\n\t\t\tl = rerenderQueue.length;\n\n\t\t\trenderComponent(c);\n\t\t}\n\t} finally {\n\t\trerenderQueue.length = process._rerenderCount = 0;\n\t}\n}\n\nprocess._rerenderCount = 0;\n","import { IS_NON_DIMENSIONAL, NULL, SVG_NAMESPACE } from '../constants';\nimport options from '../options';\n\nfunction setStyle(style, key, value) {\n\tif (key[0] == '-') {\n\t\tstyle.setProperty(key, value == NULL ? '' : value);\n\t} else if (value == NULL) {\n\t\tstyle[key] = '';\n\t} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n\t\tstyle[key] = value;\n\t} else {\n\t\tstyle[key] = value + 'px';\n\t}\n}\n\nconst CAPTURE_REGEX = /(PointerCapture)$|Capture$/i;\n\n// A logical clock to solve issues like https://github.com/preactjs/preact/issues/3927.\n// When the DOM performs an event it leaves micro-ticks in between bubbling up which means that\n// an event can trigger on a newly reated DOM-node while the event bubbles up.\n//\n// Originally inspired by Vue\n// (https://github.com/vuejs/core/blob/caeb8a68811a1b0f79/packages/runtime-dom/src/modules/events.ts#L90-L101),\n// but modified to use a logical clock instead of Date.now() in case event handlers get attached\n// and events get dispatched during the same millisecond.\n//\n// The clock is incremented after each new event dispatch. This allows 1 000 000 new events\n// per second for over 280 years before the value reaches Number.MAX_SAFE_INTEGER (2**53 - 1).\nlet eventClock = 0;\n\n/**\n * Set a property value on a DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {string} namespace Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, namespace) {\n\tlet useCapture;\n\n\to: if (name == 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] != oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] == 'o' && name[1] == 'n') {\n\t\tuseCapture = name != (name = name.replace(CAPTURE_REGEX, '$1'));\n\t\tconst lowerCaseName = name.toLowerCase();\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (lowerCaseName in dom || name == 'onFocusOut' || name == 'onFocusIn')\n\t\t\tname = lowerCaseName.slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tvalue._attached = eventClock;\n\t\t\t\tdom.addEventListener(\n\t\t\t\t\tname,\n\t\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\t\tuseCapture\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tvalue._attached = oldValue._attached;\n\t\t\t}\n\t\t} else {\n\t\t\tdom.removeEventListener(\n\t\t\t\tname,\n\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\tuseCapture\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif (namespace == SVG_NAMESPACE) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname != 'width' &&\n\t\t\tname != 'height' &&\n\t\t\tname != 'href' &&\n\t\t\tname != 'list' &&\n\t\t\tname != 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname != 'tabIndex' &&\n\t\t\tname != 'download' &&\n\t\t\tname != 'rowSpan' &&\n\t\t\tname != 'colSpan' &&\n\t\t\tname != 'role' &&\n\t\t\tname != 'popover' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == NULL ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// aria- and data- attributes have no boolean representation.\n\t\t// A `false` value is different from the attribute not being\n\t\t// present, so we can't remove it. For non-boolean aria\n\t\t// attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost too many bytes. On top of\n\t\t// that other frameworks generally stringify `false`.\n\n\t\tif (typeof value == 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (value != NULL && (value !== false || name[4] == '-')) {\n\t\t\tdom.setAttribute(name, name == 'popover' && value == true ? '' : value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Create an event proxy function.\n * @param {boolean} useCapture Is the event handler for the capture phase.\n * @private\n */\nfunction createEventProxy(useCapture) {\n\t/**\n\t * Proxy an event to hooked event handlers\n\t * @param {import('../internal').PreactEvent} e The event object from the browser\n\t * @private\n\t */\n\treturn function (e) {\n\t\tif (this._listeners) {\n\t\t\tconst eventHandler = this._listeners[e.type + useCapture];\n\t\t\tif (e._dispatched == NULL) {\n\t\t\t\te._dispatched = eventClock++;\n\n\t\t\t\t// When `e._dispatched` is smaller than the time when the targeted event\n\t\t\t\t// handler was attached we know we have bubbled up to an element that was added\n\t\t\t\t// during patching the DOM.\n\t\t\t} else if (e._dispatched < eventHandler._attached) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn eventHandler(options.event ? options.event(e) : e);\n\t\t}\n\t};\n}\n\nconst eventProxy = createEventProxy(false);\nconst eventProxyCapture = createEventProxy(true);\n","import { enqueueRender } from './component';\nimport { NULL } from './constants';\n\nexport let i = 0;\n\nexport function createContext(defaultValue) {\n\tfunction Context(props) {\n\t\tif (!this.getChildContext) {\n\t\t\t/** @type {Set | null} */\n\t\t\tlet subs = new Set();\n\t\t\tlet ctx = {};\n\t\t\tctx[Context._id] = this;\n\n\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\tthis.componentWillUnmount = () => {\n\t\t\t\tsubs = NULL;\n\t\t\t};\n\n\t\t\tthis.shouldComponentUpdate = function (_props) {\n\t\t\t\t// @ts-expect-error even\n\t\t\t\tif (this.props.value != _props.value) {\n\t\t\t\t\tsubs.forEach(c => {\n\t\t\t\t\t\tc._force = true;\n\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.sub = c => {\n\t\t\t\tsubs.add(c);\n\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\tif (subs) {\n\t\t\t\t\t\tsubs.delete(c);\n\t\t\t\t\t}\n\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\treturn props.children;\n\t}\n\n\tContext._id = '__cC' + i++;\n\tContext._defaultValue = defaultValue;\n\n\t/** @type {import('./internal').FunctionComponent} */\n\tContext.Consumer = (props, contextValue) => {\n\t\treturn props.children(contextValue);\n\t};\n\n\t// we could also get rid of _contextRef entirely\n\tContext.Provider =\n\t\tContext._contextRef =\n\t\tContext.Consumer.contextType =\n\t\t\tContext;\n\n\treturn Context;\n}\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport {\n\tEMPTY_OBJ,\n\tEMPTY_ARR,\n\tINSERT_VNODE,\n\tMATCHED,\n\tUNDEFINED,\n\tNULL\n} from '../constants';\nimport { isArray } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * Diff the children of a virtual node\n * @param {PreactElement} parentDom The DOM element whose children are being\n * diffed\n * @param {ComponentChildren[]} renderResult\n * @param {VNode} newParentVNode The new virtual node whose children should be\n * diff'ed against oldParentVNode\n * @param {VNode} oldParentVNode The old virtual node whose children should be\n * diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\tlet i,\n\t\t/** @type {VNode} */\n\t\toldVNode,\n\t\t/** @type {VNode} */\n\t\tchildVNode,\n\t\t/** @type {PreactElement} */\n\t\tnewDom,\n\t\t/** @type {PreactElement} */\n\t\tfirstChildDom;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\t/** @type {VNode[]} */\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet newChildrenLength = renderResult.length;\n\n\toldDom = constructNewChildrenArray(\n\t\tnewParentVNode,\n\t\trenderResult,\n\t\toldChildren,\n\t\toldDom,\n\t\tnewChildrenLength\n\t);\n\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\tchildVNode = newParentVNode._children[i];\n\t\tif (childVNode == NULL) continue;\n\n\t\t// At this point, constructNewChildrenArray has assigned _index to be the\n\t\t// matchingIndex for this VNode's oldVNode (or -1 if there is no oldVNode).\n\t\toldVNode =\n\t\t\t(childVNode._index != -1 && oldChildren[childVNode._index]) || EMPTY_OBJ;\n\n\t\t// Update childVNode._index to its final index\n\t\tchildVNode._index = i;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tlet result = diff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\n\t\t// Adjust DOM nodes\n\t\tnewDom = childVNode._dom;\n\t\tif (childVNode.ref && oldVNode.ref != childVNode.ref) {\n\t\t\tif (oldVNode.ref) {\n\t\t\t\tapplyRef(oldVNode.ref, NULL, childVNode);\n\t\t\t}\n\t\t\trefQueue.push(\n\t\t\t\tchildVNode.ref,\n\t\t\t\tchildVNode._component || newDom,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t}\n\n\t\tif (firstChildDom == NULL && newDom != NULL) {\n\t\t\tfirstChildDom = newDom;\n\t\t}\n\n\t\tlet shouldPlace = !!(childVNode._flags & INSERT_VNODE);\n\t\tif (shouldPlace || oldVNode._children === childVNode._children) {\n\t\t\toldDom = insert(childVNode, oldDom, parentDom, shouldPlace);\n\t\t} else if (typeof childVNode.type == 'function' && result !== UNDEFINED) {\n\t\t\toldDom = result;\n\t\t} else if (newDom) {\n\t\t\toldDom = newDom.nextSibling;\n\t\t}\n\n\t\t// Unset diffing flags\n\t\tchildVNode._flags &= ~(INSERT_VNODE | MATCHED);\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} newParentVNode\n * @param {ComponentChildren[]} renderResult\n * @param {VNode[]} oldChildren\n */\nfunction constructNewChildrenArray(\n\tnewParentVNode,\n\trenderResult,\n\toldChildren,\n\toldDom,\n\tnewChildrenLength\n) {\n\t/** @type {number} */\n\tlet i;\n\t/** @type {VNode} */\n\tlet childVNode;\n\t/** @type {VNode} */\n\tlet oldVNode;\n\n\tlet oldChildrenLength = oldChildren.length,\n\t\tremainingOldChildren = oldChildrenLength;\n\n\tlet skew = 0;\n\n\tnewParentVNode._children = new Array(newChildrenLength);\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\t// @ts-expect-error We are reusing the childVNode variable to hold both the\n\t\t// pre and post normalized childVNode\n\t\tchildVNode = renderResult[i];\n\n\t\tif (\n\t\t\tchildVNode == NULL ||\n\t\t\ttypeof childVNode == 'boolean' ||\n\t\t\ttypeof childVNode == 'function'\n\t\t) {\n\t\t\tnewParentVNode._children[i] = NULL;\n\t\t\tcontinue;\n\t\t}\n\t\t// If this newVNode is being reused (e.g.

{reuse}{reuse}
) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (\n\t\t\ttypeof childVNode == 'string' ||\n\t\t\ttypeof childVNode == 'number' ||\n\t\t\t// eslint-disable-next-line valid-typeof\n\t\t\ttypeof childVNode == 'bigint' ||\n\t\t\tchildVNode.constructor == String\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tNULL,\n\t\t\t\tchildVNode,\n\t\t\t\tNULL,\n\t\t\t\tNULL,\n\t\t\t\tNULL\n\t\t\t);\n\t\t} else if (isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tNULL,\n\t\t\t\tNULL,\n\t\t\t\tNULL\n\t\t\t);\n\t\t} else if (childVNode.constructor === UNDEFINED && childVNode._depth > 0) {\n\t\t\t// VNode is already in use, clone it. This can happen in the following\n\t\t\t// scenario:\n\t\t\t// const reuse =
\n\t\t\t//
{reuse}{reuse}
\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tchildVNode.ref ? childVNode.ref : NULL,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tnewParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\tconst skewedIndex = i + skew;\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Temporarily store the matchingIndex on the _index property so we can pull\n\t\t// out the oldVNode in diffChildren. We'll override this to the VNode's\n\t\t// final index after using this property to get the oldVNode\n\t\tconst matchingIndex = (childVNode._index = findMatchingIndex(\n\t\t\tchildVNode,\n\t\t\toldChildren,\n\t\t\tskewedIndex,\n\t\t\tremainingOldChildren\n\t\t));\n\n\t\toldVNode = NULL;\n\t\tif (matchingIndex != -1) {\n\t\t\toldVNode = oldChildren[matchingIndex];\n\t\t\tremainingOldChildren--;\n\t\t\tif (oldVNode) {\n\t\t\t\toldVNode._flags |= MATCHED;\n\t\t\t}\n\t\t}\n\n\t\t// Here, we define isMounting for the purposes of the skew diffing\n\t\t// algorithm. Nodes that are unsuspending are considered mounting and we detect\n\t\t// this by checking if oldVNode._original == null\n\t\tconst isMounting = oldVNode == NULL || oldVNode._original == NULL;\n\n\t\tif (isMounting) {\n\t\t\tif (matchingIndex == -1) {\n\t\t\t\t// When the array of children is growing we need to decrease the skew\n\t\t\t\t// as we are adding a new element to the array.\n\t\t\t\t// Example:\n\t\t\t\t// [1, 2, 3] --> [0, 1, 2, 3]\n\t\t\t\t// oldChildren newChildren\n\t\t\t\t//\n\t\t\t\t// The new element is at index 0, so our skew is 0,\n\t\t\t\t// we need to decrease the skew as we are adding a new element.\n\t\t\t\t// The decrease will cause us to compare the element at position 1\n\t\t\t\t// with value 1 with the element at position 0 with value 0.\n\t\t\t\t//\n\t\t\t\t// A linear concept is applied when the array is shrinking,\n\t\t\t\t// if the length is unchanged we can assume that no skew\n\t\t\t\t// changes are needed.\n\t\t\t\tif (newChildrenLength > oldChildrenLength) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else if (newChildrenLength < oldChildrenLength) {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we are mounting a DOM VNode, mark it for insertion\n\t\t\tif (typeof childVNode.type != 'function') {\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t} else if (matchingIndex != skewedIndex) {\n\t\t\t// When we move elements around i.e. [0, 1, 2] --> [1, 0, 2]\n\t\t\t// --> we diff 1, we find it at position 1 while our skewed index is 0 and our skew is 0\n\t\t\t// we set the skew to 1 as we found an offset.\n\t\t\t// --> we diff 0, we find it at position 0 while our skewed index is at 2 and our skew is 1\n\t\t\t// this makes us increase the skew again.\n\t\t\t// --> we diff 2, we find it at position 2 while our skewed index is at 4 and our skew is 2\n\t\t\t//\n\t\t\t// this becomes an optimization question where currently we see a 1 element offset as an insertion\n\t\t\t// or deletion i.e. we optimize for [0, 1, 2] --> [9, 0, 1, 2]\n\t\t\t// while a more than 1 offset we see as a swap.\n\t\t\t// We could probably build heuristics for having an optimized course of action here as well, but\n\t\t\t// might go at the cost of some bytes.\n\t\t\t//\n\t\t\t// If we wanted to optimize for i.e. only swaps we'd just do the last two code-branches and have\n\t\t\t// only the first item be a re-scouting and all the others fall in their skewed counter-part.\n\t\t\t// We could also further optimize for swaps\n\t\t\tif (matchingIndex == skewedIndex - 1) {\n\t\t\t\tskew--;\n\t\t\t} else if (matchingIndex == skewedIndex + 1) {\n\t\t\t\tskew++;\n\t\t\t} else {\n\t\t\t\tif (matchingIndex > skewedIndex) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\n\t\t\t\t// Move this VNode's DOM if the original index (matchingIndex) doesn't\n\t\t\t\t// match the new skew index (i + new skew)\n\t\t\t\t// In the former two branches we know that it matches after skewing\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any. Loop forwards so that as we\n\t// unmount DOM from the beginning of the oldChildren, we can adjust oldDom to\n\t// point to the next child, which needs to be the first DOM node that won't be\n\t// unmounted.\n\tif (remainingOldChildren) {\n\t\tfor (i = 0; i < oldChildrenLength; i++) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode != NULL && (oldVNode._flags & MATCHED) == 0) {\n\t\t\t\tif (oldVNode._dom == oldDom) {\n\t\t\t\t\toldDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\n\t\t\t\tunmount(oldVNode, oldVNode);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} parentVNode\n * @param {PreactElement} oldDom\n * @param {PreactElement} parentDom\n * @param {boolean} shouldPlace\n * @returns {PreactElement}\n */\nfunction insert(parentVNode, oldDom, parentDom, shouldPlace) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\n\tif (typeof parentVNode.type == 'function') {\n\t\tlet children = parentVNode._children;\n\t\tfor (let i = 0; children && i < children.length; i++) {\n\t\t\tif (children[i]) {\n\t\t\t\t// If we enter this code path on sCU bailout, where we copy\n\t\t\t\t// oldVNode._children to newVNode._children, we need to update the old\n\t\t\t\t// children's _parent pointer to point to the newVNode (parentVNode\n\t\t\t\t// here).\n\t\t\t\tchildren[i]._parent = parentVNode;\n\t\t\t\toldDom = insert(children[i], oldDom, parentDom, shouldPlace);\n\t\t\t}\n\t\t}\n\n\t\treturn oldDom;\n\t} else if (parentVNode._dom != oldDom) {\n\t\tif (shouldPlace) {\n\t\t\tif (oldDom && parentVNode.type && !oldDom.parentNode) {\n\t\t\t\toldDom = getDomSibling(parentVNode);\n\t\t\t}\n\t\t\tparentDom.insertBefore(parentVNode._dom, oldDom || NULL);\n\t\t}\n\t\toldDom = parentVNode._dom;\n\t}\n\n\tdo {\n\t\toldDom = oldDom && oldDom.nextSibling;\n\t} while (oldDom != NULL && oldDom.nodeType == 8);\n\n\treturn oldDom;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {ComponentChildren} children The unflattened children of a virtual\n * node\n * @returns {VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == NULL || typeof children == 'boolean') {\n\t} else if (isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\n/**\n * @param {VNode} childVNode\n * @param {VNode[]} oldChildren\n * @param {number} skewedIndex\n * @param {number} remainingOldChildren\n * @returns {number}\n */\nfunction findMatchingIndex(\n\tchildVNode,\n\toldChildren,\n\tskewedIndex,\n\tremainingOldChildren\n) {\n\tconst key = childVNode.key;\n\tconst type = childVNode.type;\n\tlet oldVNode = oldChildren[skewedIndex];\n\tconst matched = oldVNode != NULL && (oldVNode._flags & MATCHED) == 0;\n\n\t// We only need to perform a search if there are more children\n\t// (remainingOldChildren) to search. However, if the oldVNode we just looked\n\t// at skewedIndex was not already used in this diff, then there must be at\n\t// least 1 other (so greater than 1) remainingOldChildren to attempt to match\n\t// against. So the following condition checks that ensuring\n\t// remainingOldChildren > 1 if the oldVNode is not already used/matched. Else\n\t// if the oldVNode was null or matched, then there could needs to be at least\n\t// 1 (aka `remainingOldChildren > 0`) children to find and compare against.\n\t//\n\t// If there is an unkeyed functional VNode, that isn't a built-in like our Fragment,\n\t// we should not search as we risk re-using state of an unrelated VNode. (reverted for now)\n\tlet shouldSearch =\n\t\t// (typeof type != 'function' || type === Fragment || key) &&\n\t\tremainingOldChildren > (matched ? 1 : 0);\n\n\tif (\n\t\t(oldVNode === NULL && key == null) ||\n\t\t(matched && key == oldVNode.key && type == oldVNode.type)\n\t) {\n\t\treturn skewedIndex;\n\t} else if (shouldSearch) {\n\t\tlet x = skewedIndex - 1;\n\t\tlet y = skewedIndex + 1;\n\t\twhile (x >= 0 || y < oldChildren.length) {\n\t\t\tconst childIndex = x >= 0 ? x-- : y++;\n\t\t\toldVNode = oldChildren[childIndex];\n\t\t\tif (\n\t\t\t\toldVNode != NULL &&\n\t\t\t\t(oldVNode._flags & MATCHED) == 0 &&\n\t\t\t\tkey == oldVNode.key &&\n\t\t\t\ttype == oldVNode.type\n\t\t\t) {\n\t\t\t\treturn childIndex;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn -1;\n}\n","import {\n\tEMPTY_ARR,\n\tEMPTY_OBJ,\n\tMATH_NAMESPACE,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tNULL,\n\tRESET_MODE,\n\tSVG_NAMESPACE,\n\tUNDEFINED,\n\tXHTML_NAMESPACE\n} from '../constants';\nimport { BaseComponent, getDomSibling } from '../component';\nimport { Fragment } from '../create-element';\nimport { diffChildren } from './children';\nimport { setProperty } from './props';\nimport { assign, isArray, removeNode, slice } from '../util';\nimport options from '../options';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * @template {any} T\n * @typedef {import('../internal').Ref} Ref\n */\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {PreactElement} parentDom The parent of the DOM element\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\t/** @type {any} */\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== UNDEFINED) return NULL;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._flags & MODE_SUSPENDED) {\n\t\tisHydrating = !!(oldVNode._flags & MODE_HYDRATE);\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\touter: if (typeof newType == 'function') {\n\t\ttry {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\t\t\tconst isClassComponent = newType.prototype && newType.prototype.render;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif (isClassComponent) {\n\t\t\t\t\t// @ts-expect-error The check above verifies that newType is suppose to be constructed\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-expect-error Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new BaseComponent(\n\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (isClassComponent && c._nextState == NULL) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\n\t\t\tif (isClassComponent && newType.getDerivedStateFromProps != NULL) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\t\t\tc._vnode = newVNode;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == NULL &&\n\t\t\t\t\tc.componentWillMount != NULL\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidMount != NULL) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == NULL &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != NULL\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tnewVNode._original == oldVNode._original ||\n\t\t\t\t\t(!c._force &&\n\t\t\t\t\t\tc.shouldComponentUpdate != NULL &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false)\n\t\t\t\t) {\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original != oldVNode._original) {\n\t\t\t\t\t\t// When we are dealing with a bail because of sCU we have to update\n\t\t\t\t\t\t// the props, state and dirty-state.\n\t\t\t\t\t\t// when we are dealing with strict-equality we don't as the child could still\n\t\t\t\t\t\t// be dirtied see #3883\n\t\t\t\t\t\tc.props = newProps;\n\t\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t\tc._dirty = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tnewVNode._children.some(vnode => {\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tEMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks);\n\t\t\t\t\tc._stateCallbacks = [];\n\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != NULL) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidUpdate != NULL) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc._parentDom = parentDom;\n\t\t\tc._force = false;\n\n\t\t\tlet renderHook = options._render,\n\t\t\t\tcount = 0;\n\t\t\tif (isClassComponent) {\n\t\t\t\tc.state = c._nextState;\n\t\t\t\tc._dirty = false;\n\n\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\tEMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks);\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t} else {\n\t\t\t\tdo {\n\t\t\t\t\tc._dirty = false;\n\t\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\t\t// Handle setState called in render, see #2553\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t} while (c._dirty && ++count < 25);\n\t\t\t}\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != NULL) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (isClassComponent && !isNew && c.getSnapshotBeforeUpdate != NULL) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet renderResult =\n\t\t\t\ttmp != NULL && tmp.type === Fragment && tmp.key == NULL\n\t\t\t\t\t? cloneNode(tmp.props.children)\n\t\t\t\t\t: tmp;\n\n\t\t\toldDom = diffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tisArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnamespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._flags &= RESET_MODE;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = NULL;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tnewVNode._original = NULL;\n\t\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\t\tif (isHydrating || excessDomChildren != NULL) {\n\t\t\t\tif (e.then) {\n\t\t\t\t\tnewVNode._flags |= isHydrating\n\t\t\t\t\t\t? MODE_HYDRATE | MODE_SUSPENDED\n\t\t\t\t\t\t: MODE_SUSPENDED;\n\n\t\t\t\t\twhile (oldDom && oldDom.nodeType == 8 && oldDom.nextSibling) {\n\t\t\t\t\t\toldDom = oldDom.nextSibling;\n\t\t\t\t\t}\n\n\t\t\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = NULL;\n\t\t\t\t\tnewVNode._dom = oldDom;\n\t\t\t\t} else {\n\t\t\t\t\tfor (let i = excessDomChildren.length; i--; ) {\n\t\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t\t}\n\t\t\t\t\tmarkAsForce(newVNode);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\tif (!e.then) markAsForce(newVNode);\n\t\t\t}\n\t\t\toptions._catchError(e, newVNode, oldVNode);\n\t\t}\n\t} else if (\n\t\texcessDomChildren == NULL &&\n\t\tnewVNode._original == oldVNode._original\n\t) {\n\t\tnewVNode._children = oldVNode._children;\n\t\tnewVNode._dom = oldVNode._dom;\n\t} else {\n\t\toldDom = newVNode._dom = diffElementNodes(\n\t\t\toldVNode._dom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\t}\n\n\tif ((tmp = options.diffed)) tmp(newVNode);\n\n\treturn newVNode._flags & MODE_SUSPENDED ? undefined : oldDom;\n}\n\nfunction markAsForce(vnode) {\n\tif (vnode) {\n\t\tif (vnode._component) vnode._component._force = true;\n\t\tif (vnode._children) vnode._children.some(markAsForce);\n\t}\n}\n\n/**\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {VNode} root\n */\nexport function commitRoot(commitQueue, root, refQueue) {\n\tfor (let i = 0; i < refQueue.length; i++) {\n\t\tapplyRef(refQueue[i], refQueue[++i], refQueue[++i]);\n\t}\n\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\t// @ts-expect-error Reuse the commitQueue variable here so the type changes\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\t// @ts-expect-error See above comment on commitQueue\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\nfunction cloneNode(node) {\n\tif (typeof node != 'object' || node == NULL || node._depth > 0) {\n\t\treturn node;\n\t}\n\n\tif (isArray(node)) {\n\t\treturn node.map(cloneNode);\n\t}\n\n\treturn assign({}, node);\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {PreactElement} dom The DOM element representing the virtual nodes\n * being diffed\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n * @returns {PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating,\n\trefQueue\n) {\n\tlet oldProps = oldVNode.props || EMPTY_OBJ;\n\tlet newProps = newVNode.props;\n\tlet nodeType = /** @type {string} */ (newVNode.type);\n\t/** @type {any} */\n\tlet i;\n\t/** @type {{ __html?: string }} */\n\tlet newHtml;\n\t/** @type {{ __html?: string }} */\n\tlet oldHtml;\n\t/** @type {ComponentChildren} */\n\tlet newChildren;\n\tlet value;\n\tlet inputValue;\n\tlet checked;\n\n\t// Tracks entering and exiting namespaces when descending through the tree.\n\tif (nodeType == 'svg') namespace = SVG_NAMESPACE;\n\telse if (nodeType == 'math') namespace = MATH_NAMESPACE;\n\telse if (!namespace) namespace = XHTML_NAMESPACE;\n\n\tif (excessDomChildren != NULL) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tvalue = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tvalue &&\n\t\t\t\t'setAttribute' in value == !!nodeType &&\n\t\t\t\t(nodeType ? value.localName == nodeType : value.nodeType == 3)\n\t\t\t) {\n\t\t\t\tdom = value;\n\t\t\t\texcessDomChildren[i] = NULL;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == NULL) {\n\t\tif (nodeType == NULL) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tdom = document.createElementNS(\n\t\t\tnamespace,\n\t\t\tnodeType,\n\t\t\tnewProps.is && newProps\n\t\t);\n\n\t\t// we are creating a new node, so we can assume this is a new subtree (in\n\t\t// case we are hydrating), this deopts the hydrate\n\t\tif (isHydrating) {\n\t\t\tif (options._hydrationMismatch)\n\t\t\t\toptions._hydrationMismatch(newVNode, excessDomChildren);\n\t\t\tisHydrating = false;\n\t\t}\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = NULL;\n\t}\n\n\tif (nodeType == NULL) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data != newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren = excessDomChildren && slice.call(dom.childNodes);\n\n\t\t// If we are in a situation where we are not hydrating but are using\n\t\t// existing DOM (e.g. replaceNode) we should read the existing DOM\n\t\t// attributes to diff them\n\t\tif (!isHydrating && excessDomChildren != NULL) {\n\t\t\toldProps = {};\n\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\tvalue = dom.attributes[i];\n\t\t\t\toldProps[value.name] = value.value;\n\t\t\t}\n\t\t}\n\n\t\tfor (i in oldProps) {\n\t\t\tvalue = oldProps[i];\n\t\t\tif (i == 'dangerouslySetInnerHTML') {\n\t\t\t\toldHtml = value;\n\t\t\t} else if (\n\t\t\t\ti != 'children' &&\n\t\t\t\t!(i in newProps) &&\n\t\t\t\t!(i == 'value' && 'defaultValue' in newProps) &&\n\t\t\t\t!(i == 'checked' && 'defaultChecked' in newProps)\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, NULL, value, namespace);\n\t\t\t}\n\t\t}\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tfor (i in newProps) {\n\t\t\tvalue = newProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t\tnewChildren = value;\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\tnewHtml = value;\n\t\t\t} else if (i == 'value') {\n\t\t\t\tinputValue = value;\n\t\t\t} else if (i == 'checked') {\n\t\t\t\tchecked = value;\n\t\t\t} else if (\n\t\t\t\t(!isHydrating || typeof value == 'function') &&\n\t\t\t\toldProps[i] !== value\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, value, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\tif (\n\t\t\t\t!isHydrating &&\n\t\t\t\t(!oldHtml ||\n\t\t\t\t\t(newHtml.__html != oldHtml.__html && newHtml.__html != dom.innerHTML))\n\t\t\t) {\n\t\t\t\tdom.innerHTML = newHtml.__html;\n\t\t\t}\n\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\tif (oldHtml) dom.innerHTML = '';\n\n\t\t\tdiffChildren(\n\t\t\t\t// @ts-expect-error\n\t\t\t\tnewVNode.type == 'template' ? dom.content : dom,\n\t\t\t\tisArray(newChildren) ? newChildren : [newChildren],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnodeType == 'foreignObject' ? XHTML_NAMESPACE : namespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\texcessDomChildren\n\t\t\t\t\t? excessDomChildren[0]\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\t// Remove children that are not part of any vnode.\n\t\t\tif (excessDomChildren != NULL) {\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// As above, don't diff props during hydration\n\t\tif (!isHydrating) {\n\t\t\ti = 'value';\n\t\t\tif (nodeType == 'progress' && inputValue == NULL) {\n\t\t\t\tdom.removeAttribute('value');\n\t\t\t} else if (\n\t\t\t\tinputValue != UNDEFINED &&\n\t\t\t\t// #2756 For the -element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(inputValue !== dom[i] ||\n\t\t\t\t\t(nodeType == 'progress' && !inputValue) ||\n\t\t\t\t\t// This is only for IE 11 to fix value not being updated.\n\t\t\t\t\t// To avoid a stale select value we need to set the option.value\n\t\t\t\t\t// again, which triggers IE11 to re-evaluate the select value\n\t\t\t\t\t(nodeType == 'option' && inputValue != oldProps[i]))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, inputValue, oldProps[i], namespace);\n\t\t\t}\n\n\t\t\ti = 'checked';\n\t\t\tif (checked != UNDEFINED && checked != dom[i]) {\n\t\t\t\tsetProperty(dom, i, checked, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {Ref & { _unmount?: unknown }} ref\n * @param {any} value\n * @param {VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') {\n\t\t\tlet hasRefUnmount = typeof ref._unmount == 'function';\n\t\t\tif (hasRefUnmount) {\n\t\t\t\t// @ts-ignore TS doesn't like moving narrowing checks into variables\n\t\t\t\tref._unmount();\n\t\t\t}\n\n\t\t\tif (!hasRefUnmount || value != NULL) {\n\t\t\t\t// Store the cleanup function on the function\n\t\t\t\t// instance object itself to avoid shape\n\t\t\t\t// transitioning vnode\n\t\t\t\tref._unmount = ref(value);\n\t\t\t}\n\t\t} else ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {VNode} vnode The virtual node to unmount\n * @param {VNode} parentVNode The parent of the VNode that initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current == vnode._dom) {\n\t\t\tapplyRef(r, NULL, parentVNode);\n\t\t}\n\t}\n\n\tif ((r = vnode._component) != NULL) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = NULL;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) {\n\t\t\t\tunmount(\n\t\t\t\t\tr[i],\n\t\t\t\t\tparentVNode,\n\t\t\t\t\tskipRemove || typeof vnode.type != 'function'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!skipRemove) {\n\t\tremoveNode(vnode._dom);\n\t}\n\n\tvnode._component = vnode._parent = vnode._dom = UNDEFINED;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n","import { EMPTY_OBJ, NULL } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { slice } from './util';\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to render into\n * @param {import('./internal').PreactElement | object} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\t// https://github.com/preactjs/preact/issues/3794\n\tif (parentDom == document) {\n\t\tparentDom = document.documentElement;\n\t}\n\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in\n\t// hydration mode or not by passing the `hydrate` function instead of a DOM\n\t// element..\n\tlet isHydrating = typeof replaceNode == 'function';\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? NULL\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\n\tvnode = ((!isHydrating && replaceNode) || parentDom)._children =\n\t\tcreateElement(Fragment, NULL, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [],\n\t\trefQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\tvnode,\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.namespaceURI,\n\t\t!isHydrating && replaceNode\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t\t? NULL\n\t\t\t\t: parentDom.firstChild\n\t\t\t\t\t? slice.call(parentDom.childNodes)\n\t\t\t\t\t: NULL,\n\t\tcommitQueue,\n\t\t!isHydrating && replaceNode\n\t\t\t? replaceNode\n\t\t\t: oldVNode\n\t\t\t\t? oldVNode._dom\n\t\t\t\t: parentDom.firstChild,\n\t\tisHydrating,\n\t\trefQueue\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode, refQueue);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, hydrate);\n}\n","import { NULL } from '../constants';\n\n/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').VNode} vnode The vnode that threw the error that was caught (except\n * for unmounting when this parameter is the highest parent that was being\n * unmounted)\n * @param {import('../internal').VNode} [oldVNode]\n * @param {import('../internal').ErrorInfo} [errorInfo]\n */\nexport function _catchError(error, vnode, oldVNode, errorInfo) {\n\t/** @type {import('../internal').Component} */\n\tlet component,\n\t\t/** @type {import('../internal').ComponentType} */\n\t\tctor,\n\t\t/** @type {boolean} */\n\t\thandled;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != NULL) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != NULL) {\n\t\t\t\t\tcomponent.componentDidCatch(error, errorInfo || {});\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n","import { assign, slice } from './util';\nimport { createVNode } from './create-element';\nimport { NULL, UNDEFINED } from './constants';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its\n * children.\n * @param {import('./internal').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array} rest Any additional arguments will be used\n * as replacement children.\n * @returns {import('./internal').VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\n\tlet defaultProps;\n\n\tif (vnode.type && vnode.type.defaultProps) {\n\t\tdefaultProps = vnode.type.defaultProps;\n\t}\n\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse if (props[i] === UNDEFINED && defaultProps != UNDEFINED) {\n\t\t\tnormalizedProps[i] = defaultProps[i];\n\t\t} else {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t}\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\tNULL\n\t);\n}\n","import * as preact from './index.js';\nif (typeof module < 'u') module.exports = preact;\nelse self.preact = preact;\n"],"names":["slice","options","vnodeId","isValidElement","rerenderQueue","prevDebounce","defer","depthSort","CAPTURE_REGEX","eventClock","eventProxy","eventProxyCapture","i","SVG_NAMESPACE","XHTML_NAMESPACE","NULL","UNDEFINED","undefined","EMPTY_OBJ","EMPTY_ARR","IS_NON_DIMENSIONAL","isArray","Array","assign","obj","props","removeNode","node","parentNode","removeChild","createElement","type","children","key","ref","normalizedProps","arguments","length","call","defaultProps","createVNode","original","vnode","__k","__","__b","__e","__c","constructor","__v","__i","__u","Fragment","BaseComponent","context","this","getDomSibling","childIndex","sibling","renderComponent","component","__P","__d","oldVNode","oldDom","commitQueue","refQueue","newVNode","diff","__n","namespaceURI","commitRoot","updateParentDomPointers","base","some","child","enqueueRender","c","push","process","__r","debounceRendering","l","sort","shift","diffChildren","parentDom","renderResult","newParentVNode","oldParentVNode","globalContext","namespace","excessDomChildren","isHydrating","childVNode","newDom","firstChildDom","result","shouldPlace","oldChildren","newChildrenLength","constructNewChildrenArray","applyRef","insert","nextSibling","skewedIndex","matchingIndex","oldChildrenLength","remainingOldChildren","skew","String","findMatchingIndex","unmount","parentVNode","insertBefore","nodeType","x","y","matched","shouldSearch","setStyle","style","value","setProperty","test","dom","name","oldValue","useCapture","lowerCaseName","o","cssText","replace","toLowerCase","_attached","addEventListener","removeEventListener","e","removeAttribute","setAttribute","createEventProxy","eventHandler","_dispatched","event","tmp","isNew","oldProps","oldState","snapshot","clearProcessingException","newProps","isClassComponent","provider","componentContext","renderHook","count","newType","outer","prototype","render","contextType","__E","doRender","sub","state","__h","_sb","__s","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","apply","componentWillUpdate","componentDidUpdate","getChildContext","getSnapshotBeforeUpdate","cloneNode","then","MODE_HYDRATE","indexOf","markAsForce","diffElementNodes","diffed","root","cb","map","newHtml","oldHtml","newChildren","inputValue","checked","localName","document","createTextNode","createElementNS","is","__m","data","childNodes","attributes","__html","innerHTML","content","hasRefUnmount","current","skipRemove","r","componentWillUnmount","replaceNode","documentElement","firstChild","error","errorInfo","ctor","handled","getDerivedStateFromError","setState","componentDidCatch","update","callback","s","forceUpdate","Promise","bind","resolve","setTimeout","a","b","hydrate","defaultValue","Context","subs","ctx","Set","_props","forEach","add","old","delete","Provider","__l","Consumer","contextValue","toChildArray","out","module","exports","preact","self"],"mappings":"gBA2BaA,EChBPC,ECPFC,EA2FSC,ECiFTC,EAWA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ACPT,EAAOU,KANRV,EAAQW,SAAW,SAAC1N,EAAO2N,GAC1B,OAAO3N,EAAMO,SAASoN,EACvB,GAKkBpF,YAChBwE,EAEKA,CACR,wBE+TgBa,EAAarN,EAAUsN,GAUtC,OATAA,EAAMA,GAAO,GACTtN,GAAYjB,GAA2B,kBAAZiB,IACpBX,EAAQW,GAClBA,EAAS0C,KAAK,SAAAC,GACb0K,EAAa1K,EAAO2K,EACrB,GAEAA,EAAIxK,KAAK9C,IAEHsN,CACR,oBKpYWC,OAAS,IAAKA,OAAOC,QAAUC,EACrCC,KAAKD,OAASA"} \ No newline at end of file diff --git a/node_modules/preact/dist/preact.min.module.js b/node_modules/preact/dist/preact.min.module.js new file mode 100644 index 0000000000000000000000000000000000000000..534b623ad9a1156b64fb57b89084a46973cfa088 --- /dev/null +++ b/node_modules/preact/dist/preact.min.module.js @@ -0,0 +1,2 @@ +var n,l,t,u,i,r,e,o,f,c,s,a,h,p,y={},v=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,w=Array.isArray;function m(n,l){for(var t in l)n[t]=l[t];return n}function _(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function g(l,t,u){var i,r,e,o={};for(e in t)"key"==e?i=t[e]:"ref"==e?r=t[e]:o[e]=t[e];if(arguments.length>2&&(o.children=arguments.length>3?n.call(arguments,2):u),"function"==typeof l&&null!=l.defaultProps)for(e in l.defaultProps)void 0===o[e]&&(o[e]=l.defaultProps[e]);return b(l,o,i,r,null)}function b(n,u,i,r,e){var o={type:n,props:u,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==e?++t:e,__i:-1,__u:0};return null==e&&null!=l.vnode&&l.vnode(o),o}function k(n){return n.children}function x(n,l){this.props=n,this.context=l}function C(n,l){if(null==l)return n.__?C(n.__,n.__i+1):null;for(var t;ll&&i.sort(o),n=i.shift(),l=i.length,S(n)}finally{i.length=A.__r=0}}function I(n,l,t,u,i,r,e,o,f,c,s){var a,h,p,d,w,m,_,g=u&&u.__k||v,b=l.length;for(f=P(t,l,g,f,b),a=0;a0?e=n.__k[r]=b(e.type,e.props,e.key,e.ref?e.ref:null,e.__v):n.__k[r]=e,f=r+h,e.__=n,e.__b=n.__b+1,o=null,-1!=(c=e.__i=F(e,t,f,a))&&(a--,(o=t[c])&&(o.__u|=2)),null==o||null==o.__v?(-1==c&&(i>s?h--:if?h--:h++,e.__u|=4))):n.__k[r]=null;if(a)for(r=0;r(s?1:0))for(i=t-1,r=t+1;i>=0||r=0?i--:r++])&&0==(2&c.__u)&&o==c.key&&f==c.type)return e;return-1}function H(n,l,t){"-"==l[0]?n.setProperty(l,null==t?"":t):n[l]=null==t?"":"number"!=typeof t||d.test(l)?t:t+"px"}function L(n,l,t,u,i){var r,e;n:if("style"==l)if("string"==typeof t)n.style.cssText=t;else{if("string"==typeof u&&(n.style.cssText=u=""),u)for(l in u)t&&l in t||H(n.style,l,"");if(t)for(l in t)u&&t[l]==u[l]||H(n.style,l,t[l])}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(f,"$1")),e=l.toLowerCase(),l=e in n||"onFocusOut"==l||"onFocusIn"==l?e.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=t,t?u?t.t=u.t:(t.t=c,n.addEventListener(l,r?a:s,r)):n.removeEventListener(l,r?a:s,r);else{if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==t?"":t;break n}catch(n){}"function"==typeof t||(null==t||!1===t&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==t?"":t))}}function T(n){return function(t){if(this.l){var u=this.l[t.type+n];if(null==t.u)t.u=c++;else if(t.u0?n:w(n)?n.map(z):m({},n)}function N(t,u,i,r,e,o,f,c,s){var a,h,p,v,d,m,g,b=i.props||y,k=u.props,x=u.type;if("svg"==x?e="http://www.w3.org/2000/svg":"math"==x?e="http://www.w3.org/1998/Math/MathML":e||(e="http://www.w3.org/1999/xhtml"),null!=o)for(a=0;a2&&(f.children=arguments.length>3?n.call(arguments,2):u),b(l.type,f,i||l.key,r||l.ref,null)},createContext:function(n){function l(n){var t,u;return this.getChildContext||(t=new Set,(u={})[l.__c]=this,this.getChildContext=function(){return u},this.componentWillUnmount=function(){t=null},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&t.forEach(function(n){n.__e=!0,$(n)})},this.sub=function(n){t.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){t&&t.delete(n),l&&l.call(n)}}),n.children}return l.__c="__cC"+h++,l.__=n,l.Provider=l.__l=(l.Consumer=function(n,l){return n.children(l)}).contextType=l,l},toChildArray:function n(l,t){return t=t||[],null==l||"boolean"==typeof l||(w(l)?l.some(function(l){n(l,t)}):t.push(l)),t},options:l},typeof module<"u"?module.exports=p:self.preact=p; +//# sourceMappingURL=preact.min.module.js.map diff --git a/node_modules/preact/dist/preact.min.module.js.map b/node_modules/preact/dist/preact.min.module.js.map new file mode 100644 index 0000000000000000000000000000000000000000..243163fef2d8a17cf18c98fb03ba4cf4b2d46760 --- /dev/null +++ b/node_modules/preact/dist/preact.min.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"preact.min.module.js","sources":["../src/constants.js","../src/util.js","../src/options.js","../src/create-element.js","../src/component.js","../src/diff/props.js","../src/create-context.js","../src/diff/children.js","../src/diff/index.js","../src/render.js","../src/diff/catch-error.js","../src/clone-element.js","../src/cjs.js"],"sourcesContent":["/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { EMPTY_ARR } from './constants';\n\nexport const isArray = Array.isArray;\n\n/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\t// @ts-expect-error We change the type of `obj` to be `O & P`\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\n * @param {import('./index').ContainerNode} node The node to remove\n */\nexport function removeNode(node) {\n\tif (node && node.parentNode) node.parentNode.removeChild(node);\n}\n\nexport const slice = EMPTY_ARR.slice;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n","import { slice } from './util';\nimport options from './options';\nimport { NULL, UNDEFINED } from './constants';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor for this\n * virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array} [children] The children of the\n * virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != NULL) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === UNDEFINED) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, NULL);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\t/** @type {import('./internal').VNode} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: NULL,\n\t\t_parent: NULL,\n\t\t_depth: 0,\n\t\t_dom: NULL,\n\t\t_component: NULL,\n\t\tconstructor: UNDEFINED,\n\t\t_original: original == NULL ? ++vnodeId : original,\n\t\t_index: -1,\n\t\t_flags: 0\n\t};\n\n\t// Only invoke the vnode hook if this was *not* a direct copy:\n\tif (original == NULL && options.vnode != NULL) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: NULL };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != NULL && vnode.constructor === UNDEFINED;\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\nimport { MODE_HYDRATE, NULL } from './constants';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function BaseComponent(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {import('./internal').Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nBaseComponent.prototype.setState = function (update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != NULL && this._nextState != this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == NULL) return;\n\n\tif (this._vnode) {\n\t\tif (callback) {\n\t\t\tthis._stateCallbacks.push(callback);\n\t\t}\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {import('./internal').Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nBaseComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](https://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {ComponentChildren | void}\n */\nBaseComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == NULL) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._index + 1)\n\t\t\t: NULL;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != NULL && sibling._dom != NULL) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : NULL;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tif (component._parentDom && component._dirty) {\n\t\tlet oldVNode = component._vnode,\n\t\t\toldDom = oldVNode._dom,\n\t\t\tcommitQueue = [],\n\t\t\trefQueue = [],\n\t\t\tnewVNode = assign({}, oldVNode);\n\t\tnewVNode._original = oldVNode._original + 1;\n\t\tif (options.vnode) options.vnode(newVNode);\n\n\t\tdiff(\n\t\t\tcomponent._parentDom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tcomponent._parentDom.namespaceURI,\n\t\t\toldVNode._flags & MODE_HYDRATE ? [oldDom] : NULL,\n\t\t\tcommitQueue,\n\t\t\toldDom == NULL ? getDomSibling(oldVNode) : oldDom,\n\t\t\t!!(oldVNode._flags & MODE_HYDRATE),\n\t\t\trefQueue\n\t\t);\n\n\t\tnewVNode._original = oldVNode._original;\n\t\tnewVNode._parent._children[newVNode._index] = newVNode;\n\t\tcommitRoot(commitQueue, newVNode, refQueue);\n\t\toldVNode._dom = oldVNode._parent = null;\n\n\t\tif (newVNode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(newVNode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != NULL && vnode._component != NULL) {\n\t\tvnode._dom = vnode._component.base = NULL;\n\t\tvnode._children.some(child => {\n\t\t\tif (child != NULL && child._dom != NULL) {\n\t\t\t\treturn (vnode._dom = vnode._component.base = child._dom);\n\t\t\t}\n\t\t});\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce != options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/**\n * @param {import('./internal').Component} a\n * @param {import('./internal').Component} b\n */\nconst depthSort = (a, b) => a._vnode._depth - b._vnode._depth;\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\ttry {\n\t\tlet c,\n\t\t\tl = 1;\n\n\t\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t\t// process() calls from getting scheduled while `queue` is still being consumed.\n\t\twhile (rerenderQueue.length) {\n\t\t\t// Keep the rerender queue sorted by (depth, insertion order). The queue\n\t\t\t// will initially be sorted on the first iteration only if it has more than 1 item.\n\t\t\t//\n\t\t\t// New items can be added to the queue e.g. when rerendering a provider, so we want to\n\t\t\t// keep the order from top to bottom with those new items so we can handle them in a\n\t\t\t// single pass\n\t\t\tif (rerenderQueue.length > l) {\n\t\t\t\trerenderQueue.sort(depthSort);\n\t\t\t}\n\n\t\t\tc = rerenderQueue.shift();\n\t\t\tl = rerenderQueue.length;\n\n\t\t\trenderComponent(c);\n\t\t}\n\t} finally {\n\t\trerenderQueue.length = process._rerenderCount = 0;\n\t}\n}\n\nprocess._rerenderCount = 0;\n","import { IS_NON_DIMENSIONAL, NULL, SVG_NAMESPACE } from '../constants';\nimport options from '../options';\n\nfunction setStyle(style, key, value) {\n\tif (key[0] == '-') {\n\t\tstyle.setProperty(key, value == NULL ? '' : value);\n\t} else if (value == NULL) {\n\t\tstyle[key] = '';\n\t} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n\t\tstyle[key] = value;\n\t} else {\n\t\tstyle[key] = value + 'px';\n\t}\n}\n\nconst CAPTURE_REGEX = /(PointerCapture)$|Capture$/i;\n\n// A logical clock to solve issues like https://github.com/preactjs/preact/issues/3927.\n// When the DOM performs an event it leaves micro-ticks in between bubbling up which means that\n// an event can trigger on a newly reated DOM-node while the event bubbles up.\n//\n// Originally inspired by Vue\n// (https://github.com/vuejs/core/blob/caeb8a68811a1b0f79/packages/runtime-dom/src/modules/events.ts#L90-L101),\n// but modified to use a logical clock instead of Date.now() in case event handlers get attached\n// and events get dispatched during the same millisecond.\n//\n// The clock is incremented after each new event dispatch. This allows 1 000 000 new events\n// per second for over 280 years before the value reaches Number.MAX_SAFE_INTEGER (2**53 - 1).\nlet eventClock = 0;\n\n/**\n * Set a property value on a DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {string} namespace Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, namespace) {\n\tlet useCapture;\n\n\to: if (name == 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] != oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] == 'o' && name[1] == 'n') {\n\t\tuseCapture = name != (name = name.replace(CAPTURE_REGEX, '$1'));\n\t\tconst lowerCaseName = name.toLowerCase();\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (lowerCaseName in dom || name == 'onFocusOut' || name == 'onFocusIn')\n\t\t\tname = lowerCaseName.slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tvalue._attached = eventClock;\n\t\t\t\tdom.addEventListener(\n\t\t\t\t\tname,\n\t\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\t\tuseCapture\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tvalue._attached = oldValue._attached;\n\t\t\t}\n\t\t} else {\n\t\t\tdom.removeEventListener(\n\t\t\t\tname,\n\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\tuseCapture\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif (namespace == SVG_NAMESPACE) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname != 'width' &&\n\t\t\tname != 'height' &&\n\t\t\tname != 'href' &&\n\t\t\tname != 'list' &&\n\t\t\tname != 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname != 'tabIndex' &&\n\t\t\tname != 'download' &&\n\t\t\tname != 'rowSpan' &&\n\t\t\tname != 'colSpan' &&\n\t\t\tname != 'role' &&\n\t\t\tname != 'popover' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == NULL ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// aria- and data- attributes have no boolean representation.\n\t\t// A `false` value is different from the attribute not being\n\t\t// present, so we can't remove it. For non-boolean aria\n\t\t// attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost too many bytes. On top of\n\t\t// that other frameworks generally stringify `false`.\n\n\t\tif (typeof value == 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (value != NULL && (value !== false || name[4] == '-')) {\n\t\t\tdom.setAttribute(name, name == 'popover' && value == true ? '' : value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Create an event proxy function.\n * @param {boolean} useCapture Is the event handler for the capture phase.\n * @private\n */\nfunction createEventProxy(useCapture) {\n\t/**\n\t * Proxy an event to hooked event handlers\n\t * @param {import('../internal').PreactEvent} e The event object from the browser\n\t * @private\n\t */\n\treturn function (e) {\n\t\tif (this._listeners) {\n\t\t\tconst eventHandler = this._listeners[e.type + useCapture];\n\t\t\tif (e._dispatched == NULL) {\n\t\t\t\te._dispatched = eventClock++;\n\n\t\t\t\t// When `e._dispatched` is smaller than the time when the targeted event\n\t\t\t\t// handler was attached we know we have bubbled up to an element that was added\n\t\t\t\t// during patching the DOM.\n\t\t\t} else if (e._dispatched < eventHandler._attached) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn eventHandler(options.event ? options.event(e) : e);\n\t\t}\n\t};\n}\n\nconst eventProxy = createEventProxy(false);\nconst eventProxyCapture = createEventProxy(true);\n","import { enqueueRender } from './component';\nimport { NULL } from './constants';\n\nexport let i = 0;\n\nexport function createContext(defaultValue) {\n\tfunction Context(props) {\n\t\tif (!this.getChildContext) {\n\t\t\t/** @type {Set | null} */\n\t\t\tlet subs = new Set();\n\t\t\tlet ctx = {};\n\t\t\tctx[Context._id] = this;\n\n\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\tthis.componentWillUnmount = () => {\n\t\t\t\tsubs = NULL;\n\t\t\t};\n\n\t\t\tthis.shouldComponentUpdate = function (_props) {\n\t\t\t\t// @ts-expect-error even\n\t\t\t\tif (this.props.value != _props.value) {\n\t\t\t\t\tsubs.forEach(c => {\n\t\t\t\t\t\tc._force = true;\n\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.sub = c => {\n\t\t\t\tsubs.add(c);\n\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\tif (subs) {\n\t\t\t\t\t\tsubs.delete(c);\n\t\t\t\t\t}\n\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\treturn props.children;\n\t}\n\n\tContext._id = '__cC' + i++;\n\tContext._defaultValue = defaultValue;\n\n\t/** @type {import('./internal').FunctionComponent} */\n\tContext.Consumer = (props, contextValue) => {\n\t\treturn props.children(contextValue);\n\t};\n\n\t// we could also get rid of _contextRef entirely\n\tContext.Provider =\n\t\tContext._contextRef =\n\t\tContext.Consumer.contextType =\n\t\t\tContext;\n\n\treturn Context;\n}\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport {\n\tEMPTY_OBJ,\n\tEMPTY_ARR,\n\tINSERT_VNODE,\n\tMATCHED,\n\tUNDEFINED,\n\tNULL\n} from '../constants';\nimport { isArray } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * Diff the children of a virtual node\n * @param {PreactElement} parentDom The DOM element whose children are being\n * diffed\n * @param {ComponentChildren[]} renderResult\n * @param {VNode} newParentVNode The new virtual node whose children should be\n * diff'ed against oldParentVNode\n * @param {VNode} oldParentVNode The old virtual node whose children should be\n * diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\tlet i,\n\t\t/** @type {VNode} */\n\t\toldVNode,\n\t\t/** @type {VNode} */\n\t\tchildVNode,\n\t\t/** @type {PreactElement} */\n\t\tnewDom,\n\t\t/** @type {PreactElement} */\n\t\tfirstChildDom;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\t/** @type {VNode[]} */\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet newChildrenLength = renderResult.length;\n\n\toldDom = constructNewChildrenArray(\n\t\tnewParentVNode,\n\t\trenderResult,\n\t\toldChildren,\n\t\toldDom,\n\t\tnewChildrenLength\n\t);\n\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\tchildVNode = newParentVNode._children[i];\n\t\tif (childVNode == NULL) continue;\n\n\t\t// At this point, constructNewChildrenArray has assigned _index to be the\n\t\t// matchingIndex for this VNode's oldVNode (or -1 if there is no oldVNode).\n\t\toldVNode =\n\t\t\t(childVNode._index != -1 && oldChildren[childVNode._index]) || EMPTY_OBJ;\n\n\t\t// Update childVNode._index to its final index\n\t\tchildVNode._index = i;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tlet result = diff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\n\t\t// Adjust DOM nodes\n\t\tnewDom = childVNode._dom;\n\t\tif (childVNode.ref && oldVNode.ref != childVNode.ref) {\n\t\t\tif (oldVNode.ref) {\n\t\t\t\tapplyRef(oldVNode.ref, NULL, childVNode);\n\t\t\t}\n\t\t\trefQueue.push(\n\t\t\t\tchildVNode.ref,\n\t\t\t\tchildVNode._component || newDom,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t}\n\n\t\tif (firstChildDom == NULL && newDom != NULL) {\n\t\t\tfirstChildDom = newDom;\n\t\t}\n\n\t\tlet shouldPlace = !!(childVNode._flags & INSERT_VNODE);\n\t\tif (shouldPlace || oldVNode._children === childVNode._children) {\n\t\t\toldDom = insert(childVNode, oldDom, parentDom, shouldPlace);\n\t\t} else if (typeof childVNode.type == 'function' && result !== UNDEFINED) {\n\t\t\toldDom = result;\n\t\t} else if (newDom) {\n\t\t\toldDom = newDom.nextSibling;\n\t\t}\n\n\t\t// Unset diffing flags\n\t\tchildVNode._flags &= ~(INSERT_VNODE | MATCHED);\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} newParentVNode\n * @param {ComponentChildren[]} renderResult\n * @param {VNode[]} oldChildren\n */\nfunction constructNewChildrenArray(\n\tnewParentVNode,\n\trenderResult,\n\toldChildren,\n\toldDom,\n\tnewChildrenLength\n) {\n\t/** @type {number} */\n\tlet i;\n\t/** @type {VNode} */\n\tlet childVNode;\n\t/** @type {VNode} */\n\tlet oldVNode;\n\n\tlet oldChildrenLength = oldChildren.length,\n\t\tremainingOldChildren = oldChildrenLength;\n\n\tlet skew = 0;\n\n\tnewParentVNode._children = new Array(newChildrenLength);\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\t// @ts-expect-error We are reusing the childVNode variable to hold both the\n\t\t// pre and post normalized childVNode\n\t\tchildVNode = renderResult[i];\n\n\t\tif (\n\t\t\tchildVNode == NULL ||\n\t\t\ttypeof childVNode == 'boolean' ||\n\t\t\ttypeof childVNode == 'function'\n\t\t) {\n\t\t\tnewParentVNode._children[i] = NULL;\n\t\t\tcontinue;\n\t\t}\n\t\t// If this newVNode is being reused (e.g.
{reuse}{reuse}
) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (\n\t\t\ttypeof childVNode == 'string' ||\n\t\t\ttypeof childVNode == 'number' ||\n\t\t\t// eslint-disable-next-line valid-typeof\n\t\t\ttypeof childVNode == 'bigint' ||\n\t\t\tchildVNode.constructor == String\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tNULL,\n\t\t\t\tchildVNode,\n\t\t\t\tNULL,\n\t\t\t\tNULL,\n\t\t\t\tNULL\n\t\t\t);\n\t\t} else if (isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tNULL,\n\t\t\t\tNULL,\n\t\t\t\tNULL\n\t\t\t);\n\t\t} else if (childVNode.constructor === UNDEFINED && childVNode._depth > 0) {\n\t\t\t// VNode is already in use, clone it. This can happen in the following\n\t\t\t// scenario:\n\t\t\t// const reuse =
\n\t\t\t//
{reuse}{reuse}
\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tchildVNode.ref ? childVNode.ref : NULL,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tnewParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\tconst skewedIndex = i + skew;\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Temporarily store the matchingIndex on the _index property so we can pull\n\t\t// out the oldVNode in diffChildren. We'll override this to the VNode's\n\t\t// final index after using this property to get the oldVNode\n\t\tconst matchingIndex = (childVNode._index = findMatchingIndex(\n\t\t\tchildVNode,\n\t\t\toldChildren,\n\t\t\tskewedIndex,\n\t\t\tremainingOldChildren\n\t\t));\n\n\t\toldVNode = NULL;\n\t\tif (matchingIndex != -1) {\n\t\t\toldVNode = oldChildren[matchingIndex];\n\t\t\tremainingOldChildren--;\n\t\t\tif (oldVNode) {\n\t\t\t\toldVNode._flags |= MATCHED;\n\t\t\t}\n\t\t}\n\n\t\t// Here, we define isMounting for the purposes of the skew diffing\n\t\t// algorithm. Nodes that are unsuspending are considered mounting and we detect\n\t\t// this by checking if oldVNode._original == null\n\t\tconst isMounting = oldVNode == NULL || oldVNode._original == NULL;\n\n\t\tif (isMounting) {\n\t\t\tif (matchingIndex == -1) {\n\t\t\t\t// When the array of children is growing we need to decrease the skew\n\t\t\t\t// as we are adding a new element to the array.\n\t\t\t\t// Example:\n\t\t\t\t// [1, 2, 3] --> [0, 1, 2, 3]\n\t\t\t\t// oldChildren newChildren\n\t\t\t\t//\n\t\t\t\t// The new element is at index 0, so our skew is 0,\n\t\t\t\t// we need to decrease the skew as we are adding a new element.\n\t\t\t\t// The decrease will cause us to compare the element at position 1\n\t\t\t\t// with value 1 with the element at position 0 with value 0.\n\t\t\t\t//\n\t\t\t\t// A linear concept is applied when the array is shrinking,\n\t\t\t\t// if the length is unchanged we can assume that no skew\n\t\t\t\t// changes are needed.\n\t\t\t\tif (newChildrenLength > oldChildrenLength) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else if (newChildrenLength < oldChildrenLength) {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we are mounting a DOM VNode, mark it for insertion\n\t\t\tif (typeof childVNode.type != 'function') {\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t} else if (matchingIndex != skewedIndex) {\n\t\t\t// When we move elements around i.e. [0, 1, 2] --> [1, 0, 2]\n\t\t\t// --> we diff 1, we find it at position 1 while our skewed index is 0 and our skew is 0\n\t\t\t// we set the skew to 1 as we found an offset.\n\t\t\t// --> we diff 0, we find it at position 0 while our skewed index is at 2 and our skew is 1\n\t\t\t// this makes us increase the skew again.\n\t\t\t// --> we diff 2, we find it at position 2 while our skewed index is at 4 and our skew is 2\n\t\t\t//\n\t\t\t// this becomes an optimization question where currently we see a 1 element offset as an insertion\n\t\t\t// or deletion i.e. we optimize for [0, 1, 2] --> [9, 0, 1, 2]\n\t\t\t// while a more than 1 offset we see as a swap.\n\t\t\t// We could probably build heuristics for having an optimized course of action here as well, but\n\t\t\t// might go at the cost of some bytes.\n\t\t\t//\n\t\t\t// If we wanted to optimize for i.e. only swaps we'd just do the last two code-branches and have\n\t\t\t// only the first item be a re-scouting and all the others fall in their skewed counter-part.\n\t\t\t// We could also further optimize for swaps\n\t\t\tif (matchingIndex == skewedIndex - 1) {\n\t\t\t\tskew--;\n\t\t\t} else if (matchingIndex == skewedIndex + 1) {\n\t\t\t\tskew++;\n\t\t\t} else {\n\t\t\t\tif (matchingIndex > skewedIndex) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\n\t\t\t\t// Move this VNode's DOM if the original index (matchingIndex) doesn't\n\t\t\t\t// match the new skew index (i + new skew)\n\t\t\t\t// In the former two branches we know that it matches after skewing\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any. Loop forwards so that as we\n\t// unmount DOM from the beginning of the oldChildren, we can adjust oldDom to\n\t// point to the next child, which needs to be the first DOM node that won't be\n\t// unmounted.\n\tif (remainingOldChildren) {\n\t\tfor (i = 0; i < oldChildrenLength; i++) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode != NULL && (oldVNode._flags & MATCHED) == 0) {\n\t\t\t\tif (oldVNode._dom == oldDom) {\n\t\t\t\t\toldDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\n\t\t\t\tunmount(oldVNode, oldVNode);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} parentVNode\n * @param {PreactElement} oldDom\n * @param {PreactElement} parentDom\n * @param {boolean} shouldPlace\n * @returns {PreactElement}\n */\nfunction insert(parentVNode, oldDom, parentDom, shouldPlace) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\n\tif (typeof parentVNode.type == 'function') {\n\t\tlet children = parentVNode._children;\n\t\tfor (let i = 0; children && i < children.length; i++) {\n\t\t\tif (children[i]) {\n\t\t\t\t// If we enter this code path on sCU bailout, where we copy\n\t\t\t\t// oldVNode._children to newVNode._children, we need to update the old\n\t\t\t\t// children's _parent pointer to point to the newVNode (parentVNode\n\t\t\t\t// here).\n\t\t\t\tchildren[i]._parent = parentVNode;\n\t\t\t\toldDom = insert(children[i], oldDom, parentDom, shouldPlace);\n\t\t\t}\n\t\t}\n\n\t\treturn oldDom;\n\t} else if (parentVNode._dom != oldDom) {\n\t\tif (shouldPlace) {\n\t\t\tif (oldDom && parentVNode.type && !oldDom.parentNode) {\n\t\t\t\toldDom = getDomSibling(parentVNode);\n\t\t\t}\n\t\t\tparentDom.insertBefore(parentVNode._dom, oldDom || NULL);\n\t\t}\n\t\toldDom = parentVNode._dom;\n\t}\n\n\tdo {\n\t\toldDom = oldDom && oldDom.nextSibling;\n\t} while (oldDom != NULL && oldDom.nodeType == 8);\n\n\treturn oldDom;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {ComponentChildren} children The unflattened children of a virtual\n * node\n * @returns {VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == NULL || typeof children == 'boolean') {\n\t} else if (isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\n/**\n * @param {VNode} childVNode\n * @param {VNode[]} oldChildren\n * @param {number} skewedIndex\n * @param {number} remainingOldChildren\n * @returns {number}\n */\nfunction findMatchingIndex(\n\tchildVNode,\n\toldChildren,\n\tskewedIndex,\n\tremainingOldChildren\n) {\n\tconst key = childVNode.key;\n\tconst type = childVNode.type;\n\tlet oldVNode = oldChildren[skewedIndex];\n\tconst matched = oldVNode != NULL && (oldVNode._flags & MATCHED) == 0;\n\n\t// We only need to perform a search if there are more children\n\t// (remainingOldChildren) to search. However, if the oldVNode we just looked\n\t// at skewedIndex was not already used in this diff, then there must be at\n\t// least 1 other (so greater than 1) remainingOldChildren to attempt to match\n\t// against. So the following condition checks that ensuring\n\t// remainingOldChildren > 1 if the oldVNode is not already used/matched. Else\n\t// if the oldVNode was null or matched, then there could needs to be at least\n\t// 1 (aka `remainingOldChildren > 0`) children to find and compare against.\n\t//\n\t// If there is an unkeyed functional VNode, that isn't a built-in like our Fragment,\n\t// we should not search as we risk re-using state of an unrelated VNode. (reverted for now)\n\tlet shouldSearch =\n\t\t// (typeof type != 'function' || type === Fragment || key) &&\n\t\tremainingOldChildren > (matched ? 1 : 0);\n\n\tif (\n\t\t(oldVNode === NULL && key == null) ||\n\t\t(matched && key == oldVNode.key && type == oldVNode.type)\n\t) {\n\t\treturn skewedIndex;\n\t} else if (shouldSearch) {\n\t\tlet x = skewedIndex - 1;\n\t\tlet y = skewedIndex + 1;\n\t\twhile (x >= 0 || y < oldChildren.length) {\n\t\t\tconst childIndex = x >= 0 ? x-- : y++;\n\t\t\toldVNode = oldChildren[childIndex];\n\t\t\tif (\n\t\t\t\toldVNode != NULL &&\n\t\t\t\t(oldVNode._flags & MATCHED) == 0 &&\n\t\t\t\tkey == oldVNode.key &&\n\t\t\t\ttype == oldVNode.type\n\t\t\t) {\n\t\t\t\treturn childIndex;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn -1;\n}\n","import {\n\tEMPTY_ARR,\n\tEMPTY_OBJ,\n\tMATH_NAMESPACE,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tNULL,\n\tRESET_MODE,\n\tSVG_NAMESPACE,\n\tUNDEFINED,\n\tXHTML_NAMESPACE\n} from '../constants';\nimport { BaseComponent, getDomSibling } from '../component';\nimport { Fragment } from '../create-element';\nimport { diffChildren } from './children';\nimport { setProperty } from './props';\nimport { assign, isArray, removeNode, slice } from '../util';\nimport options from '../options';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * @template {any} T\n * @typedef {import('../internal').Ref} Ref\n */\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {PreactElement} parentDom The parent of the DOM element\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\t/** @type {any} */\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== UNDEFINED) return NULL;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._flags & MODE_SUSPENDED) {\n\t\tisHydrating = !!(oldVNode._flags & MODE_HYDRATE);\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\touter: if (typeof newType == 'function') {\n\t\ttry {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\t\t\tconst isClassComponent = newType.prototype && newType.prototype.render;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif (isClassComponent) {\n\t\t\t\t\t// @ts-expect-error The check above verifies that newType is suppose to be constructed\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-expect-error Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new BaseComponent(\n\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (isClassComponent && c._nextState == NULL) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\n\t\t\tif (isClassComponent && newType.getDerivedStateFromProps != NULL) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\t\t\tc._vnode = newVNode;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == NULL &&\n\t\t\t\t\tc.componentWillMount != NULL\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidMount != NULL) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == NULL &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != NULL\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tnewVNode._original == oldVNode._original ||\n\t\t\t\t\t(!c._force &&\n\t\t\t\t\t\tc.shouldComponentUpdate != NULL &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false)\n\t\t\t\t) {\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original != oldVNode._original) {\n\t\t\t\t\t\t// When we are dealing with a bail because of sCU we have to update\n\t\t\t\t\t\t// the props, state and dirty-state.\n\t\t\t\t\t\t// when we are dealing with strict-equality we don't as the child could still\n\t\t\t\t\t\t// be dirtied see #3883\n\t\t\t\t\t\tc.props = newProps;\n\t\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t\tc._dirty = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tnewVNode._children.some(vnode => {\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tEMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks);\n\t\t\t\t\tc._stateCallbacks = [];\n\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != NULL) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidUpdate != NULL) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc._parentDom = parentDom;\n\t\t\tc._force = false;\n\n\t\t\tlet renderHook = options._render,\n\t\t\t\tcount = 0;\n\t\t\tif (isClassComponent) {\n\t\t\t\tc.state = c._nextState;\n\t\t\t\tc._dirty = false;\n\n\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\tEMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks);\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t} else {\n\t\t\t\tdo {\n\t\t\t\t\tc._dirty = false;\n\t\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\t\t// Handle setState called in render, see #2553\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t} while (c._dirty && ++count < 25);\n\t\t\t}\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != NULL) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (isClassComponent && !isNew && c.getSnapshotBeforeUpdate != NULL) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet renderResult =\n\t\t\t\ttmp != NULL && tmp.type === Fragment && tmp.key == NULL\n\t\t\t\t\t? cloneNode(tmp.props.children)\n\t\t\t\t\t: tmp;\n\n\t\t\toldDom = diffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tisArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnamespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._flags &= RESET_MODE;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = NULL;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tnewVNode._original = NULL;\n\t\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\t\tif (isHydrating || excessDomChildren != NULL) {\n\t\t\t\tif (e.then) {\n\t\t\t\t\tnewVNode._flags |= isHydrating\n\t\t\t\t\t\t? MODE_HYDRATE | MODE_SUSPENDED\n\t\t\t\t\t\t: MODE_SUSPENDED;\n\n\t\t\t\t\twhile (oldDom && oldDom.nodeType == 8 && oldDom.nextSibling) {\n\t\t\t\t\t\toldDom = oldDom.nextSibling;\n\t\t\t\t\t}\n\n\t\t\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = NULL;\n\t\t\t\t\tnewVNode._dom = oldDom;\n\t\t\t\t} else {\n\t\t\t\t\tfor (let i = excessDomChildren.length; i--; ) {\n\t\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t\t}\n\t\t\t\t\tmarkAsForce(newVNode);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\tif (!e.then) markAsForce(newVNode);\n\t\t\t}\n\t\t\toptions._catchError(e, newVNode, oldVNode);\n\t\t}\n\t} else if (\n\t\texcessDomChildren == NULL &&\n\t\tnewVNode._original == oldVNode._original\n\t) {\n\t\tnewVNode._children = oldVNode._children;\n\t\tnewVNode._dom = oldVNode._dom;\n\t} else {\n\t\toldDom = newVNode._dom = diffElementNodes(\n\t\t\toldVNode._dom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\t}\n\n\tif ((tmp = options.diffed)) tmp(newVNode);\n\n\treturn newVNode._flags & MODE_SUSPENDED ? undefined : oldDom;\n}\n\nfunction markAsForce(vnode) {\n\tif (vnode) {\n\t\tif (vnode._component) vnode._component._force = true;\n\t\tif (vnode._children) vnode._children.some(markAsForce);\n\t}\n}\n\n/**\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {VNode} root\n */\nexport function commitRoot(commitQueue, root, refQueue) {\n\tfor (let i = 0; i < refQueue.length; i++) {\n\t\tapplyRef(refQueue[i], refQueue[++i], refQueue[++i]);\n\t}\n\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\t// @ts-expect-error Reuse the commitQueue variable here so the type changes\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\t// @ts-expect-error See above comment on commitQueue\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\nfunction cloneNode(node) {\n\tif (typeof node != 'object' || node == NULL || node._depth > 0) {\n\t\treturn node;\n\t}\n\n\tif (isArray(node)) {\n\t\treturn node.map(cloneNode);\n\t}\n\n\treturn assign({}, node);\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {PreactElement} dom The DOM element representing the virtual nodes\n * being diffed\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n * @returns {PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating,\n\trefQueue\n) {\n\tlet oldProps = oldVNode.props || EMPTY_OBJ;\n\tlet newProps = newVNode.props;\n\tlet nodeType = /** @type {string} */ (newVNode.type);\n\t/** @type {any} */\n\tlet i;\n\t/** @type {{ __html?: string }} */\n\tlet newHtml;\n\t/** @type {{ __html?: string }} */\n\tlet oldHtml;\n\t/** @type {ComponentChildren} */\n\tlet newChildren;\n\tlet value;\n\tlet inputValue;\n\tlet checked;\n\n\t// Tracks entering and exiting namespaces when descending through the tree.\n\tif (nodeType == 'svg') namespace = SVG_NAMESPACE;\n\telse if (nodeType == 'math') namespace = MATH_NAMESPACE;\n\telse if (!namespace) namespace = XHTML_NAMESPACE;\n\n\tif (excessDomChildren != NULL) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tvalue = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tvalue &&\n\t\t\t\t'setAttribute' in value == !!nodeType &&\n\t\t\t\t(nodeType ? value.localName == nodeType : value.nodeType == 3)\n\t\t\t) {\n\t\t\t\tdom = value;\n\t\t\t\texcessDomChildren[i] = NULL;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == NULL) {\n\t\tif (nodeType == NULL) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tdom = document.createElementNS(\n\t\t\tnamespace,\n\t\t\tnodeType,\n\t\t\tnewProps.is && newProps\n\t\t);\n\n\t\t// we are creating a new node, so we can assume this is a new subtree (in\n\t\t// case we are hydrating), this deopts the hydrate\n\t\tif (isHydrating) {\n\t\t\tif (options._hydrationMismatch)\n\t\t\t\toptions._hydrationMismatch(newVNode, excessDomChildren);\n\t\t\tisHydrating = false;\n\t\t}\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = NULL;\n\t}\n\n\tif (nodeType == NULL) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data != newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren = excessDomChildren && slice.call(dom.childNodes);\n\n\t\t// If we are in a situation where we are not hydrating but are using\n\t\t// existing DOM (e.g. replaceNode) we should read the existing DOM\n\t\t// attributes to diff them\n\t\tif (!isHydrating && excessDomChildren != NULL) {\n\t\t\toldProps = {};\n\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\tvalue = dom.attributes[i];\n\t\t\t\toldProps[value.name] = value.value;\n\t\t\t}\n\t\t}\n\n\t\tfor (i in oldProps) {\n\t\t\tvalue = oldProps[i];\n\t\t\tif (i == 'dangerouslySetInnerHTML') {\n\t\t\t\toldHtml = value;\n\t\t\t} else if (\n\t\t\t\ti != 'children' &&\n\t\t\t\t!(i in newProps) &&\n\t\t\t\t!(i == 'value' && 'defaultValue' in newProps) &&\n\t\t\t\t!(i == 'checked' && 'defaultChecked' in newProps)\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, NULL, value, namespace);\n\t\t\t}\n\t\t}\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tfor (i in newProps) {\n\t\t\tvalue = newProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t\tnewChildren = value;\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\tnewHtml = value;\n\t\t\t} else if (i == 'value') {\n\t\t\t\tinputValue = value;\n\t\t\t} else if (i == 'checked') {\n\t\t\t\tchecked = value;\n\t\t\t} else if (\n\t\t\t\t(!isHydrating || typeof value == 'function') &&\n\t\t\t\toldProps[i] !== value\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, value, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\tif (\n\t\t\t\t!isHydrating &&\n\t\t\t\t(!oldHtml ||\n\t\t\t\t\t(newHtml.__html != oldHtml.__html && newHtml.__html != dom.innerHTML))\n\t\t\t) {\n\t\t\t\tdom.innerHTML = newHtml.__html;\n\t\t\t}\n\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\tif (oldHtml) dom.innerHTML = '';\n\n\t\t\tdiffChildren(\n\t\t\t\t// @ts-expect-error\n\t\t\t\tnewVNode.type == 'template' ? dom.content : dom,\n\t\t\t\tisArray(newChildren) ? newChildren : [newChildren],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnodeType == 'foreignObject' ? XHTML_NAMESPACE : namespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\texcessDomChildren\n\t\t\t\t\t? excessDomChildren[0]\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\t// Remove children that are not part of any vnode.\n\t\t\tif (excessDomChildren != NULL) {\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// As above, don't diff props during hydration\n\t\tif (!isHydrating) {\n\t\t\ti = 'value';\n\t\t\tif (nodeType == 'progress' && inputValue == NULL) {\n\t\t\t\tdom.removeAttribute('value');\n\t\t\t} else if (\n\t\t\t\tinputValue != UNDEFINED &&\n\t\t\t\t// #2756 For the -element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(inputValue !== dom[i] ||\n\t\t\t\t\t(nodeType == 'progress' && !inputValue) ||\n\t\t\t\t\t// This is only for IE 11 to fix value not being updated.\n\t\t\t\t\t// To avoid a stale select value we need to set the option.value\n\t\t\t\t\t// again, which triggers IE11 to re-evaluate the select value\n\t\t\t\t\t(nodeType == 'option' && inputValue != oldProps[i]))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, inputValue, oldProps[i], namespace);\n\t\t\t}\n\n\t\t\ti = 'checked';\n\t\t\tif (checked != UNDEFINED && checked != dom[i]) {\n\t\t\t\tsetProperty(dom, i, checked, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {Ref & { _unmount?: unknown }} ref\n * @param {any} value\n * @param {VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') {\n\t\t\tlet hasRefUnmount = typeof ref._unmount == 'function';\n\t\t\tif (hasRefUnmount) {\n\t\t\t\t// @ts-ignore TS doesn't like moving narrowing checks into variables\n\t\t\t\tref._unmount();\n\t\t\t}\n\n\t\t\tif (!hasRefUnmount || value != NULL) {\n\t\t\t\t// Store the cleanup function on the function\n\t\t\t\t// instance object itself to avoid shape\n\t\t\t\t// transitioning vnode\n\t\t\t\tref._unmount = ref(value);\n\t\t\t}\n\t\t} else ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {VNode} vnode The virtual node to unmount\n * @param {VNode} parentVNode The parent of the VNode that initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current == vnode._dom) {\n\t\t\tapplyRef(r, NULL, parentVNode);\n\t\t}\n\t}\n\n\tif ((r = vnode._component) != NULL) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = NULL;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) {\n\t\t\t\tunmount(\n\t\t\t\t\tr[i],\n\t\t\t\t\tparentVNode,\n\t\t\t\t\tskipRemove || typeof vnode.type != 'function'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!skipRemove) {\n\t\tremoveNode(vnode._dom);\n\t}\n\n\tvnode._component = vnode._parent = vnode._dom = UNDEFINED;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n","import { EMPTY_OBJ, NULL } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { slice } from './util';\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to render into\n * @param {import('./internal').PreactElement | object} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\t// https://github.com/preactjs/preact/issues/3794\n\tif (parentDom == document) {\n\t\tparentDom = document.documentElement;\n\t}\n\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in\n\t// hydration mode or not by passing the `hydrate` function instead of a DOM\n\t// element..\n\tlet isHydrating = typeof replaceNode == 'function';\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? NULL\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\n\tvnode = ((!isHydrating && replaceNode) || parentDom)._children =\n\t\tcreateElement(Fragment, NULL, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [],\n\t\trefQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\tvnode,\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.namespaceURI,\n\t\t!isHydrating && replaceNode\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t\t? NULL\n\t\t\t\t: parentDom.firstChild\n\t\t\t\t\t? slice.call(parentDom.childNodes)\n\t\t\t\t\t: NULL,\n\t\tcommitQueue,\n\t\t!isHydrating && replaceNode\n\t\t\t? replaceNode\n\t\t\t: oldVNode\n\t\t\t\t? oldVNode._dom\n\t\t\t\t: parentDom.firstChild,\n\t\tisHydrating,\n\t\trefQueue\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode, refQueue);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, hydrate);\n}\n","import { NULL } from '../constants';\n\n/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').VNode} vnode The vnode that threw the error that was caught (except\n * for unmounting when this parameter is the highest parent that was being\n * unmounted)\n * @param {import('../internal').VNode} [oldVNode]\n * @param {import('../internal').ErrorInfo} [errorInfo]\n */\nexport function _catchError(error, vnode, oldVNode, errorInfo) {\n\t/** @type {import('../internal').Component} */\n\tlet component,\n\t\t/** @type {import('../internal').ComponentType} */\n\t\tctor,\n\t\t/** @type {boolean} */\n\t\thandled;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != NULL) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != NULL) {\n\t\t\t\t\tcomponent.componentDidCatch(error, errorInfo || {});\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n","import { assign, slice } from './util';\nimport { createVNode } from './create-element';\nimport { NULL, UNDEFINED } from './constants';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its\n * children.\n * @param {import('./internal').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array} rest Any additional arguments will be used\n * as replacement children.\n * @returns {import('./internal').VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\n\tlet defaultProps;\n\n\tif (vnode.type && vnode.type.defaultProps) {\n\t\tdefaultProps = vnode.type.defaultProps;\n\t}\n\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse if (props[i] === UNDEFINED && defaultProps != UNDEFINED) {\n\t\t\tnormalizedProps[i] = defaultProps[i];\n\t\t} else {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t}\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\tNULL\n\t);\n}\n","import * as preact from './index.js';\nif (typeof module < 'u') module.exports = preact;\nelse self.preact = preact;\n"],"names":["slice","options","vnodeId","isValidElement","rerenderQueue","prevDebounce","defer","depthSort","CAPTURE_REGEX","eventClock","eventProxy","eventProxyCapture","i","SVG_NAMESPACE","XHTML_NAMESPACE","NULL","UNDEFINED","undefined","EMPTY_OBJ","EMPTY_ARR","IS_NON_DIMENSIONAL","isArray","Array","assign","obj","props","removeNode","node","parentNode","removeChild","createElement","type","children","key","ref","normalizedProps","arguments","length","call","defaultProps","createVNode","original","vnode","__k","__","__b","__e","__c","constructor","__v","__i","__u","Fragment","BaseComponent","context","this","getDomSibling","childIndex","sibling","renderComponent","component","__P","__d","oldVNode","oldDom","commitQueue","refQueue","newVNode","diff","__n","namespaceURI","commitRoot","updateParentDomPointers","base","some","child","enqueueRender","c","push","process","__r","debounceRendering","l","sort","shift","diffChildren","parentDom","renderResult","newParentVNode","oldParentVNode","globalContext","namespace","excessDomChildren","isHydrating","childVNode","newDom","firstChildDom","result","shouldPlace","oldChildren","newChildrenLength","constructNewChildrenArray","applyRef","insert","nextSibling","skewedIndex","matchingIndex","oldChildrenLength","remainingOldChildren","skew","String","findMatchingIndex","unmount","parentVNode","insertBefore","nodeType","x","y","matched","shouldSearch","setStyle","style","value","setProperty","test","dom","name","oldValue","useCapture","lowerCaseName","o","cssText","replace","toLowerCase","_attached","addEventListener","removeEventListener","e","removeAttribute","setAttribute","createEventProxy","eventHandler","_dispatched","event","tmp","isNew","oldProps","oldState","snapshot","clearProcessingException","newProps","isClassComponent","provider","componentContext","renderHook","count","newType","outer","prototype","render","contextType","__E","doRender","sub","state","__h","_sb","__s","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","apply","componentWillUpdate","componentDidUpdate","getChildContext","getSnapshotBeforeUpdate","cloneNode","then","MODE_HYDRATE","indexOf","markAsForce","diffElementNodes","diffed","root","cb","map","newHtml","oldHtml","newChildren","inputValue","checked","localName","document","createTextNode","createElementNS","is","__m","data","childNodes","attributes","__html","innerHTML","content","hasRefUnmount","current","skipRemove","r","componentWillUnmount","replaceNode","documentElement","firstChild","error","errorInfo","ctor","handled","getDerivedStateFromError","setState","componentDidCatch","update","callback","s","forceUpdate","Promise","bind","resolve","setTimeout","a","b","hydrate","defaultValue","Context","subs","ctx","Set","_props","forEach","add","old","delete","Provider","__l","Consumer","contextValue","toChildArray","out","module","exports","preact","self"],"mappings":"iFA2BaA,EChBPC,ECPFC,EA2FSC,ECiFTC,EAWAC,EAEEC,EA0BAC,ECxMAC,EAaFC,EA+IEC,EACAC,ECzKKC,ICSEC,EAAgB,6BAChBC,EAAkB,+BAGlBC,EAAO,KACPC,OAAYC,EACZC,EAAgC,CAAG,EACnCC,EAAY,GACZC,EACZ,oENnBYC,EAAUC,MAAMD,QAStB,SAASE,EAAOC,EAAKC,GAE3B,IAAK,IAAIb,KAAKa,EAAOD,EAAIZ,GAAKa,EAAMb,GACpC,OAA6BY,CAC9B,CAQgB,SAAAE,EAAWC,GACtBA,GAAQA,EAAKC,YAAYD,EAAKC,WAAWC,YAAYF,EAC1D,CEVgB,SAAAG,EAAcC,EAAMN,EAAOO,GAC1C,IACCC,EACAC,EACAtB,EAHGuB,EAAkB,CAAA,EAItB,IAAKvB,KAAKa,EACA,OAALb,EAAYqB,EAAMR,EAAMb,GACd,OAALA,EAAYsB,EAAMT,EAAMb,GAC5BuB,EAAgBvB,GAAKa,EAAMb,GAUjC,GAPIwB,UAAUC,OAAS,IACtBF,EAAgBH,SACfI,UAAUC,OAAS,EAAIrC,EAAMsC,KAAKF,UAAW,GAAKJ,GAKjC,mBAARD,GAAsBA,EAAKQ,cAAgBxB,EACrD,IAAKH,KAAKmB,EAAKQ,aACVJ,EAAgBvB,KAAOI,IAC1BmB,EAAgBvB,GAAKmB,EAAKQ,aAAa3B,IAK1C,OAAO4B,EAAYT,EAAMI,EAAiBF,EAAKC,EAAKnB,EACrD,CAcgB,SAAAyB,EAAYT,EAAMN,EAAOQ,EAAKC,EA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ACX8B,EAAcC,EACf,EAEF,EAEAtB,KAAK4G,IAAM,SAAAtF,GACV4J,EAAKK,IAAIjK,GACT,IAAIkK,EAAMlK,EAAEoI,qBACZpI,EAAEoI,qBAAuB,WACpBwB,GACHA,EAAKO,OAAOnK,GAETkK,GAAKA,EAAIzM,KAAKuC,EACnB,CACD,GAGMpD,EAAMO,QACd,CAgBA,OAdAwM,EAAOzL,IAAO,OAASnC,IACvB4N,EAAO5L,GAAiB2L,EAQxBC,EAAQS,SACPT,EAAOU,KANRV,EAAQW,SAAW,SAAC1N,EAAO2N,GAC1B,OAAO3N,EAAMO,SAASoN,EACvB,GAKkBpF,YAChBwE,EAEKA,CACR,wBE+TgBa,EAAarN,EAAUsN,GAUtC,OATAA,EAAMA,GAAO,GACTtN,GAAYjB,GAA2B,kBAAZiB,IACpBX,EAAQW,GAClBA,EAAS0C,KAAK,SAAAC,GACb0K,EAAa1K,EAAO2K,EACrB,GAEAA,EAAIxK,KAAK9C,IAEHsN,CACR,oBKpYWC,OAAS,IAAKA,OAAOC,QAAUC,EACrCC,KAAKD,OAASA"} \ No newline at end of file diff --git a/node_modules/preact/dist/preact.mjs b/node_modules/preact/dist/preact.mjs new file mode 100644 index 0000000000000000000000000000000000000000..78a962c1876d8f86395d945e9826ddfb518c12dc --- /dev/null +++ b/node_modules/preact/dist/preact.mjs @@ -0,0 +1,2 @@ +var n,l,u,t,i,r,o,e,f,c,s,a,h,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function w(n,l){for(var u in l)n[u]=l[u];return n}function g(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function _(l,u,t){var i,r,o,e={};for(o in u)"key"==o?i=u[o]:"ref"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===e[o]&&(e[o]=l.defaultProps[o]);return m(l,e,i,r,null)}function m(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u:o,__i:-1,__u:0};return null==o&&null!=l.vnode&&l.vnode(e),e}function b(){return{current:null}}function k(n){return n.children}function x(n,l){this.props=n,this.context=l}function S(n,l){if(null==l)return n.__?S(n.__,n.__i+1):null;for(var u;ll&&i.sort(e),n=i.shift(),l=i.length,C(n)}finally{i.length=I.__r=0}}function P(n,l,u,t,i,r,o,e,f,c,s){var a,h,y,d,w,g,_,m=t&&t.__k||v,b=l.length;for(f=A(u,l,m,f,b),a=0;a0?o=n.__k[r]=m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):n.__k[r]=o,f=r+h,o.__=n,o.__b=n.__b+1,e=null,-1!=(c=o.__i=T(o,u,f,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>s?h--:if?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r(s?1:0))for(i=u-1,r=u+1;i>=0||r=0?i--:r++])&&0==(2&c.__u)&&e==c.key&&f==c.type)return o;return-1}function j(n,l,u){"-"==l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||y.test(l)?u:u+"px"}function F(n,l,u,t,i){var r,o;n:if("style"==l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||j(n.style,l,"");if(u)for(l in u)t&&u[l]==t[l]||j(n.style,l,u[l])}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(f,"$1")),o=l.toLowerCase(),l=o in n||"onFocusOut"==l||"onFocusIn"==l?o.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?t?u.u=t.u:(u.u=c,n.addEventListener(l,r?a:s,r)):n.removeEventListener(l,r?a:s,r);else{if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u))}}function O(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=c++;else if(u.t0?n:d(n)?n.map(q):w({},n)}function B(u,t,i,r,o,e,f,c,s){var a,h,v,y,w,_,m,b=i.props||p,k=t.props,x=t.type;if("svg"==x?o="http://www.w3.org/2000/svg":"math"==x?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a2&&(f.children=arguments.length>3?n.call(arguments,2):t),m(l.type,f,i||l.key,r||l.ref,null)}function R(n){function l(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l.__c]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&u.forEach(function(n){n.__e=!0,$(n)})},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n)}}),n.children}return l.__c="__cC"+h++,l.__=n,l.Provider=l.__l=(l.Consumer=function(n,l){return n.children(l)}).contextType=l,l}n=v.slice,l={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&void 0===n.constructor},x.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=w({},this.state),"function"==typeof n&&(n=n(w({},u),this.props)),n&&w(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),$(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),$(this))},x.prototype.render=k,i=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},I.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=O(!1),a=O(!0),h=0;export{x as Component,k as Fragment,Q as cloneElement,R as createContext,_ as createElement,b as createRef,_ as h,K as hydrate,t as isValidElement,l as options,J as render,L as toChildArray}; +//# sourceMappingURL=preact.module.js.map diff --git a/node_modules/preact/dist/preact.module.js b/node_modules/preact/dist/preact.module.js new file mode 100644 index 0000000000000000000000000000000000000000..78a962c1876d8f86395d945e9826ddfb518c12dc --- /dev/null +++ b/node_modules/preact/dist/preact.module.js @@ -0,0 +1,2 @@ +var n,l,u,t,i,r,o,e,f,c,s,a,h,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function w(n,l){for(var u in l)n[u]=l[u];return n}function g(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function _(l,u,t){var i,r,o,e={};for(o in u)"key"==o?i=u[o]:"ref"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===e[o]&&(e[o]=l.defaultProps[o]);return m(l,e,i,r,null)}function m(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u:o,__i:-1,__u:0};return null==o&&null!=l.vnode&&l.vnode(e),e}function b(){return{current:null}}function k(n){return n.children}function x(n,l){this.props=n,this.context=l}function S(n,l){if(null==l)return n.__?S(n.__,n.__i+1):null;for(var u;ll&&i.sort(e),n=i.shift(),l=i.length,C(n)}finally{i.length=I.__r=0}}function P(n,l,u,t,i,r,o,e,f,c,s){var a,h,y,d,w,g,_,m=t&&t.__k||v,b=l.length;for(f=A(u,l,m,f,b),a=0;a0?o=n.__k[r]=m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):n.__k[r]=o,f=r+h,o.__=n,o.__b=n.__b+1,e=null,-1!=(c=o.__i=T(o,u,f,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>s?h--:if?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r(s?1:0))for(i=u-1,r=u+1;i>=0||r=0?i--:r++])&&0==(2&c.__u)&&e==c.key&&f==c.type)return o;return-1}function j(n,l,u){"-"==l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||y.test(l)?u:u+"px"}function F(n,l,u,t,i){var r,o;n:if("style"==l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||j(n.style,l,"");if(u)for(l in u)t&&u[l]==t[l]||j(n.style,l,u[l])}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(f,"$1")),o=l.toLowerCase(),l=o in n||"onFocusOut"==l||"onFocusIn"==l?o.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?t?u.u=t.u:(u.u=c,n.addEventListener(l,r?a:s,r)):n.removeEventListener(l,r?a:s,r);else{if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u))}}function O(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=c++;else if(u.t0?n:d(n)?n.map(q):w({},n)}function B(u,t,i,r,o,e,f,c,s){var a,h,v,y,w,_,m,b=i.props||p,k=t.props,x=t.type;if("svg"==x?o="http://www.w3.org/2000/svg":"math"==x?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a2&&(f.children=arguments.length>3?n.call(arguments,2):t),m(l.type,f,i||l.key,r||l.ref,null)}function R(n){function l(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l.__c]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&u.forEach(function(n){n.__e=!0,$(n)})},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n)}}),n.children}return l.__c="__cC"+h++,l.__=n,l.Provider=l.__l=(l.Consumer=function(n,l){return n.children(l)}).contextType=l,l}n=v.slice,l={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&void 0===n.constructor},x.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=w({},this.state),"function"==typeof n&&(n=n(w({},u),this.props)),n&&w(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),$(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),$(this))},x.prototype.render=k,i=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},I.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=O(!1),a=O(!0),h=0;export{x as Component,k as Fragment,Q as cloneElement,R as createContext,_ as createElement,b as createRef,_ as h,K as hydrate,t as isValidElement,l as options,J as render,L as toChildArray}; +//# sourceMappingURL=preact.module.js.map diff --git a/node_modules/preact/dist/preact.module.js.map b/node_modules/preact/dist/preact.module.js.map new file mode 100644 index 0000000000000000000000000000000000000000..9bb85041892b9cf476928b5e0aeb9dcd6d4c68ee --- /dev/null +++ b/node_modules/preact/dist/preact.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"preact.module.js","sources":["../src/constants.js","../src/util.js","../src/options.js","../src/create-element.js","../src/component.js","../src/diff/props.js","../src/create-context.js","../src/diff/children.js","../src/diff/index.js","../src/render.js","../src/clone-element.js","../src/diff/catch-error.js"],"sourcesContent":["/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { EMPTY_ARR } from './constants';\n\nexport const isArray = Array.isArray;\n\n/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\t// @ts-expect-error We change the type of `obj` to be `O & P`\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\n * @param {import('./index').ContainerNode} node The node to remove\n */\nexport function removeNode(node) {\n\tif (node && node.parentNode) node.parentNode.removeChild(node);\n}\n\nexport const slice = EMPTY_ARR.slice;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n","import { slice } from './util';\nimport options from './options';\nimport { NULL, UNDEFINED } from './constants';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor for this\n * virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array} [children] The children of the\n * virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != NULL) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === UNDEFINED) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, NULL);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\t/** @type {import('./internal').VNode} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: NULL,\n\t\t_parent: NULL,\n\t\t_depth: 0,\n\t\t_dom: NULL,\n\t\t_component: NULL,\n\t\tconstructor: UNDEFINED,\n\t\t_original: original == NULL ? ++vnodeId : original,\n\t\t_index: -1,\n\t\t_flags: 0\n\t};\n\n\t// Only invoke the vnode hook if this was *not* a direct copy:\n\tif (original == NULL && options.vnode != NULL) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: NULL };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != NULL && vnode.constructor === UNDEFINED;\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\nimport { MODE_HYDRATE, NULL } from './constants';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function BaseComponent(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {import('./internal').Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nBaseComponent.prototype.setState = function (update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != NULL && this._nextState != this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == NULL) return;\n\n\tif (this._vnode) {\n\t\tif (callback) {\n\t\t\tthis._stateCallbacks.push(callback);\n\t\t}\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {import('./internal').Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nBaseComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](https://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {ComponentChildren | void}\n */\nBaseComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == NULL) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._index + 1)\n\t\t\t: NULL;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != NULL && sibling._dom != NULL) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : NULL;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tif (component._parentDom && component._dirty) {\n\t\tlet oldVNode = component._vnode,\n\t\t\toldDom = oldVNode._dom,\n\t\t\tcommitQueue = [],\n\t\t\trefQueue = [],\n\t\t\tnewVNode = assign({}, oldVNode);\n\t\tnewVNode._original = oldVNode._original + 1;\n\t\tif (options.vnode) options.vnode(newVNode);\n\n\t\tdiff(\n\t\t\tcomponent._parentDom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tcomponent._parentDom.namespaceURI,\n\t\t\toldVNode._flags & MODE_HYDRATE ? [oldDom] : NULL,\n\t\t\tcommitQueue,\n\t\t\toldDom == NULL ? getDomSibling(oldVNode) : oldDom,\n\t\t\t!!(oldVNode._flags & MODE_HYDRATE),\n\t\t\trefQueue\n\t\t);\n\n\t\tnewVNode._original = oldVNode._original;\n\t\tnewVNode._parent._children[newVNode._index] = newVNode;\n\t\tcommitRoot(commitQueue, newVNode, refQueue);\n\t\toldVNode._dom = oldVNode._parent = null;\n\n\t\tif (newVNode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(newVNode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != NULL && vnode._component != NULL) {\n\t\tvnode._dom = vnode._component.base = NULL;\n\t\tvnode._children.some(child => {\n\t\t\tif (child != NULL && child._dom != NULL) {\n\t\t\t\treturn (vnode._dom = vnode._component.base = child._dom);\n\t\t\t}\n\t\t});\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce != options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/**\n * @param {import('./internal').Component} a\n * @param {import('./internal').Component} b\n */\nconst depthSort = (a, b) => a._vnode._depth - b._vnode._depth;\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\ttry {\n\t\tlet c,\n\t\t\tl = 1;\n\n\t\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t\t// process() calls from getting scheduled while `queue` is still being consumed.\n\t\twhile (rerenderQueue.length) {\n\t\t\t// Keep the rerender queue sorted by (depth, insertion order). The queue\n\t\t\t// will initially be sorted on the first iteration only if it has more than 1 item.\n\t\t\t//\n\t\t\t// New items can be added to the queue e.g. when rerendering a provider, so we want to\n\t\t\t// keep the order from top to bottom with those new items so we can handle them in a\n\t\t\t// single pass\n\t\t\tif (rerenderQueue.length > l) {\n\t\t\t\trerenderQueue.sort(depthSort);\n\t\t\t}\n\n\t\t\tc = rerenderQueue.shift();\n\t\t\tl = rerenderQueue.length;\n\n\t\t\trenderComponent(c);\n\t\t}\n\t} finally {\n\t\trerenderQueue.length = process._rerenderCount = 0;\n\t}\n}\n\nprocess._rerenderCount = 0;\n","import { IS_NON_DIMENSIONAL, NULL, SVG_NAMESPACE } from '../constants';\nimport options from '../options';\n\nfunction setStyle(style, key, value) {\n\tif (key[0] == '-') {\n\t\tstyle.setProperty(key, value == NULL ? '' : value);\n\t} else if (value == NULL) {\n\t\tstyle[key] = '';\n\t} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n\t\tstyle[key] = value;\n\t} else {\n\t\tstyle[key] = value + 'px';\n\t}\n}\n\nconst CAPTURE_REGEX = /(PointerCapture)$|Capture$/i;\n\n// A logical clock to solve issues like https://github.com/preactjs/preact/issues/3927.\n// When the DOM performs an event it leaves micro-ticks in between bubbling up which means that\n// an event can trigger on a newly reated DOM-node while the event bubbles up.\n//\n// Originally inspired by Vue\n// (https://github.com/vuejs/core/blob/caeb8a68811a1b0f79/packages/runtime-dom/src/modules/events.ts#L90-L101),\n// but modified to use a logical clock instead of Date.now() in case event handlers get attached\n// and events get dispatched during the same millisecond.\n//\n// The clock is incremented after each new event dispatch. This allows 1 000 000 new events\n// per second for over 280 years before the value reaches Number.MAX_SAFE_INTEGER (2**53 - 1).\nlet eventClock = 0;\n\n/**\n * Set a property value on a DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {string} namespace Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, namespace) {\n\tlet useCapture;\n\n\to: if (name == 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] != oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] == 'o' && name[1] == 'n') {\n\t\tuseCapture = name != (name = name.replace(CAPTURE_REGEX, '$1'));\n\t\tconst lowerCaseName = name.toLowerCase();\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (lowerCaseName in dom || name == 'onFocusOut' || name == 'onFocusIn')\n\t\t\tname = lowerCaseName.slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tvalue._attached = eventClock;\n\t\t\t\tdom.addEventListener(\n\t\t\t\t\tname,\n\t\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\t\tuseCapture\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tvalue._attached = oldValue._attached;\n\t\t\t}\n\t\t} else {\n\t\t\tdom.removeEventListener(\n\t\t\t\tname,\n\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\tuseCapture\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif (namespace == SVG_NAMESPACE) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname != 'width' &&\n\t\t\tname != 'height' &&\n\t\t\tname != 'href' &&\n\t\t\tname != 'list' &&\n\t\t\tname != 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname != 'tabIndex' &&\n\t\t\tname != 'download' &&\n\t\t\tname != 'rowSpan' &&\n\t\t\tname != 'colSpan' &&\n\t\t\tname != 'role' &&\n\t\t\tname != 'popover' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == NULL ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// aria- and data- attributes have no boolean representation.\n\t\t// A `false` value is different from the attribute not being\n\t\t// present, so we can't remove it. For non-boolean aria\n\t\t// attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost too many bytes. On top of\n\t\t// that other frameworks generally stringify `false`.\n\n\t\tif (typeof value == 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (value != NULL && (value !== false || name[4] == '-')) {\n\t\t\tdom.setAttribute(name, name == 'popover' && value == true ? '' : value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Create an event proxy function.\n * @param {boolean} useCapture Is the event handler for the capture phase.\n * @private\n */\nfunction createEventProxy(useCapture) {\n\t/**\n\t * Proxy an event to hooked event handlers\n\t * @param {import('../internal').PreactEvent} e The event object from the browser\n\t * @private\n\t */\n\treturn function (e) {\n\t\tif (this._listeners) {\n\t\t\tconst eventHandler = this._listeners[e.type + useCapture];\n\t\t\tif (e._dispatched == NULL) {\n\t\t\t\te._dispatched = eventClock++;\n\n\t\t\t\t// When `e._dispatched` is smaller than the time when the targeted event\n\t\t\t\t// handler was attached we know we have bubbled up to an element that was added\n\t\t\t\t// during patching the DOM.\n\t\t\t} else if (e._dispatched < eventHandler._attached) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn eventHandler(options.event ? options.event(e) : e);\n\t\t}\n\t};\n}\n\nconst eventProxy = createEventProxy(false);\nconst eventProxyCapture = createEventProxy(true);\n","import { enqueueRender } from './component';\nimport { NULL } from './constants';\n\nexport let i = 0;\n\nexport function createContext(defaultValue) {\n\tfunction Context(props) {\n\t\tif (!this.getChildContext) {\n\t\t\t/** @type {Set | null} */\n\t\t\tlet subs = new Set();\n\t\t\tlet ctx = {};\n\t\t\tctx[Context._id] = this;\n\n\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\tthis.componentWillUnmount = () => {\n\t\t\t\tsubs = NULL;\n\t\t\t};\n\n\t\t\tthis.shouldComponentUpdate = function (_props) {\n\t\t\t\t// @ts-expect-error even\n\t\t\t\tif (this.props.value != _props.value) {\n\t\t\t\t\tsubs.forEach(c => {\n\t\t\t\t\t\tc._force = true;\n\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.sub = c => {\n\t\t\t\tsubs.add(c);\n\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\tif (subs) {\n\t\t\t\t\t\tsubs.delete(c);\n\t\t\t\t\t}\n\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\treturn props.children;\n\t}\n\n\tContext._id = '__cC' + i++;\n\tContext._defaultValue = defaultValue;\n\n\t/** @type {import('./internal').FunctionComponent} */\n\tContext.Consumer = (props, contextValue) => {\n\t\treturn props.children(contextValue);\n\t};\n\n\t// we could also get rid of _contextRef entirely\n\tContext.Provider =\n\t\tContext._contextRef =\n\t\tContext.Consumer.contextType =\n\t\t\tContext;\n\n\treturn Context;\n}\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport {\n\tEMPTY_OBJ,\n\tEMPTY_ARR,\n\tINSERT_VNODE,\n\tMATCHED,\n\tUNDEFINED,\n\tNULL\n} from '../constants';\nimport { isArray } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * Diff the children of a virtual node\n * @param {PreactElement} parentDom The DOM element whose children are being\n * diffed\n * @param {ComponentChildren[]} renderResult\n * @param {VNode} newParentVNode The new virtual node whose children should be\n * diff'ed against oldParentVNode\n * @param {VNode} oldParentVNode The old virtual node whose children should be\n * diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\tlet i,\n\t\t/** @type {VNode} */\n\t\toldVNode,\n\t\t/** @type {VNode} */\n\t\tchildVNode,\n\t\t/** @type {PreactElement} */\n\t\tnewDom,\n\t\t/** @type {PreactElement} */\n\t\tfirstChildDom;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\t/** @type {VNode[]} */\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet newChildrenLength = renderResult.length;\n\n\toldDom = constructNewChildrenArray(\n\t\tnewParentVNode,\n\t\trenderResult,\n\t\toldChildren,\n\t\toldDom,\n\t\tnewChildrenLength\n\t);\n\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\tchildVNode = newParentVNode._children[i];\n\t\tif (childVNode == NULL) continue;\n\n\t\t// At this point, constructNewChildrenArray has assigned _index to be the\n\t\t// matchingIndex for this VNode's oldVNode (or -1 if there is no oldVNode).\n\t\toldVNode =\n\t\t\t(childVNode._index != -1 && oldChildren[childVNode._index]) || EMPTY_OBJ;\n\n\t\t// Update childVNode._index to its final index\n\t\tchildVNode._index = i;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tlet result = diff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\n\t\t// Adjust DOM nodes\n\t\tnewDom = childVNode._dom;\n\t\tif (childVNode.ref && oldVNode.ref != childVNode.ref) {\n\t\t\tif (oldVNode.ref) {\n\t\t\t\tapplyRef(oldVNode.ref, NULL, childVNode);\n\t\t\t}\n\t\t\trefQueue.push(\n\t\t\t\tchildVNode.ref,\n\t\t\t\tchildVNode._component || newDom,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t}\n\n\t\tif (firstChildDom == NULL && newDom != NULL) {\n\t\t\tfirstChildDom = newDom;\n\t\t}\n\n\t\tlet shouldPlace = !!(childVNode._flags & INSERT_VNODE);\n\t\tif (shouldPlace || oldVNode._children === childVNode._children) {\n\t\t\toldDom = insert(childVNode, oldDom, parentDom, shouldPlace);\n\t\t} else if (typeof childVNode.type == 'function' && result !== UNDEFINED) {\n\t\t\toldDom = result;\n\t\t} else if (newDom) {\n\t\t\toldDom = newDom.nextSibling;\n\t\t}\n\n\t\t// Unset diffing flags\n\t\tchildVNode._flags &= ~(INSERT_VNODE | MATCHED);\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} newParentVNode\n * @param {ComponentChildren[]} renderResult\n * @param {VNode[]} oldChildren\n */\nfunction constructNewChildrenArray(\n\tnewParentVNode,\n\trenderResult,\n\toldChildren,\n\toldDom,\n\tnewChildrenLength\n) {\n\t/** @type {number} */\n\tlet i;\n\t/** @type {VNode} */\n\tlet childVNode;\n\t/** @type {VNode} */\n\tlet oldVNode;\n\n\tlet oldChildrenLength = oldChildren.length,\n\t\tremainingOldChildren = oldChildrenLength;\n\n\tlet skew = 0;\n\n\tnewParentVNode._children = new Array(newChildrenLength);\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\t// @ts-expect-error We are reusing the childVNode variable to hold both the\n\t\t// pre and post normalized childVNode\n\t\tchildVNode = renderResult[i];\n\n\t\tif (\n\t\t\tchildVNode == NULL ||\n\t\t\ttypeof childVNode == 'boolean' ||\n\t\t\ttypeof childVNode == 'function'\n\t\t) {\n\t\t\tnewParentVNode._children[i] = NULL;\n\t\t\tcontinue;\n\t\t}\n\t\t// If this newVNode is being reused (e.g.
{reuse}{reuse}
) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (\n\t\t\ttypeof childVNode == 'string' ||\n\t\t\ttypeof childVNode == 'number' ||\n\t\t\t// eslint-disable-next-line valid-typeof\n\t\t\ttypeof childVNode == 'bigint' ||\n\t\t\tchildVNode.constructor == String\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tNULL,\n\t\t\t\tchildVNode,\n\t\t\t\tNULL,\n\t\t\t\tNULL,\n\t\t\t\tNULL\n\t\t\t);\n\t\t} else if (isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tNULL,\n\t\t\t\tNULL,\n\t\t\t\tNULL\n\t\t\t);\n\t\t} else if (childVNode.constructor === UNDEFINED && childVNode._depth > 0) {\n\t\t\t// VNode is already in use, clone it. This can happen in the following\n\t\t\t// scenario:\n\t\t\t// const reuse =
\n\t\t\t//
{reuse}{reuse}
\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tchildVNode.ref ? childVNode.ref : NULL,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tnewParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\tconst skewedIndex = i + skew;\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Temporarily store the matchingIndex on the _index property so we can pull\n\t\t// out the oldVNode in diffChildren. We'll override this to the VNode's\n\t\t// final index after using this property to get the oldVNode\n\t\tconst matchingIndex = (childVNode._index = findMatchingIndex(\n\t\t\tchildVNode,\n\t\t\toldChildren,\n\t\t\tskewedIndex,\n\t\t\tremainingOldChildren\n\t\t));\n\n\t\toldVNode = NULL;\n\t\tif (matchingIndex != -1) {\n\t\t\toldVNode = oldChildren[matchingIndex];\n\t\t\tremainingOldChildren--;\n\t\t\tif (oldVNode) {\n\t\t\t\toldVNode._flags |= MATCHED;\n\t\t\t}\n\t\t}\n\n\t\t// Here, we define isMounting for the purposes of the skew diffing\n\t\t// algorithm. Nodes that are unsuspending are considered mounting and we detect\n\t\t// this by checking if oldVNode._original == null\n\t\tconst isMounting = oldVNode == NULL || oldVNode._original == NULL;\n\n\t\tif (isMounting) {\n\t\t\tif (matchingIndex == -1) {\n\t\t\t\t// When the array of children is growing we need to decrease the skew\n\t\t\t\t// as we are adding a new element to the array.\n\t\t\t\t// Example:\n\t\t\t\t// [1, 2, 3] --> [0, 1, 2, 3]\n\t\t\t\t// oldChildren newChildren\n\t\t\t\t//\n\t\t\t\t// The new element is at index 0, so our skew is 0,\n\t\t\t\t// we need to decrease the skew as we are adding a new element.\n\t\t\t\t// The decrease will cause us to compare the element at position 1\n\t\t\t\t// with value 1 with the element at position 0 with value 0.\n\t\t\t\t//\n\t\t\t\t// A linear concept is applied when the array is shrinking,\n\t\t\t\t// if the length is unchanged we can assume that no skew\n\t\t\t\t// changes are needed.\n\t\t\t\tif (newChildrenLength > oldChildrenLength) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else if (newChildrenLength < oldChildrenLength) {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we are mounting a DOM VNode, mark it for insertion\n\t\t\tif (typeof childVNode.type != 'function') {\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t} else if (matchingIndex != skewedIndex) {\n\t\t\t// When we move elements around i.e. [0, 1, 2] --> [1, 0, 2]\n\t\t\t// --> we diff 1, we find it at position 1 while our skewed index is 0 and our skew is 0\n\t\t\t// we set the skew to 1 as we found an offset.\n\t\t\t// --> we diff 0, we find it at position 0 while our skewed index is at 2 and our skew is 1\n\t\t\t// this makes us increase the skew again.\n\t\t\t// --> we diff 2, we find it at position 2 while our skewed index is at 4 and our skew is 2\n\t\t\t//\n\t\t\t// this becomes an optimization question where currently we see a 1 element offset as an insertion\n\t\t\t// or deletion i.e. we optimize for [0, 1, 2] --> [9, 0, 1, 2]\n\t\t\t// while a more than 1 offset we see as a swap.\n\t\t\t// We could probably build heuristics for having an optimized course of action here as well, but\n\t\t\t// might go at the cost of some bytes.\n\t\t\t//\n\t\t\t// If we wanted to optimize for i.e. only swaps we'd just do the last two code-branches and have\n\t\t\t// only the first item be a re-scouting and all the others fall in their skewed counter-part.\n\t\t\t// We could also further optimize for swaps\n\t\t\tif (matchingIndex == skewedIndex - 1) {\n\t\t\t\tskew--;\n\t\t\t} else if (matchingIndex == skewedIndex + 1) {\n\t\t\t\tskew++;\n\t\t\t} else {\n\t\t\t\tif (matchingIndex > skewedIndex) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\n\t\t\t\t// Move this VNode's DOM if the original index (matchingIndex) doesn't\n\t\t\t\t// match the new skew index (i + new skew)\n\t\t\t\t// In the former two branches we know that it matches after skewing\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any. Loop forwards so that as we\n\t// unmount DOM from the beginning of the oldChildren, we can adjust oldDom to\n\t// point to the next child, which needs to be the first DOM node that won't be\n\t// unmounted.\n\tif (remainingOldChildren) {\n\t\tfor (i = 0; i < oldChildrenLength; i++) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode != NULL && (oldVNode._flags & MATCHED) == 0) {\n\t\t\t\tif (oldVNode._dom == oldDom) {\n\t\t\t\t\toldDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\n\t\t\t\tunmount(oldVNode, oldVNode);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} parentVNode\n * @param {PreactElement} oldDom\n * @param {PreactElement} parentDom\n * @param {boolean} shouldPlace\n * @returns {PreactElement}\n */\nfunction insert(parentVNode, oldDom, parentDom, shouldPlace) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\n\tif (typeof parentVNode.type == 'function') {\n\t\tlet children = parentVNode._children;\n\t\tfor (let i = 0; children && i < children.length; i++) {\n\t\t\tif (children[i]) {\n\t\t\t\t// If we enter this code path on sCU bailout, where we copy\n\t\t\t\t// oldVNode._children to newVNode._children, we need to update the old\n\t\t\t\t// children's _parent pointer to point to the newVNode (parentVNode\n\t\t\t\t// here).\n\t\t\t\tchildren[i]._parent = parentVNode;\n\t\t\t\toldDom = insert(children[i], oldDom, parentDom, shouldPlace);\n\t\t\t}\n\t\t}\n\n\t\treturn oldDom;\n\t} else if (parentVNode._dom != oldDom) {\n\t\tif (shouldPlace) {\n\t\t\tif (oldDom && parentVNode.type && !oldDom.parentNode) {\n\t\t\t\toldDom = getDomSibling(parentVNode);\n\t\t\t}\n\t\t\tparentDom.insertBefore(parentVNode._dom, oldDom || NULL);\n\t\t}\n\t\toldDom = parentVNode._dom;\n\t}\n\n\tdo {\n\t\toldDom = oldDom && oldDom.nextSibling;\n\t} while (oldDom != NULL && oldDom.nodeType == 8);\n\n\treturn oldDom;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {ComponentChildren} children The unflattened children of a virtual\n * node\n * @returns {VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == NULL || typeof children == 'boolean') {\n\t} else if (isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\n/**\n * @param {VNode} childVNode\n * @param {VNode[]} oldChildren\n * @param {number} skewedIndex\n * @param {number} remainingOldChildren\n * @returns {number}\n */\nfunction findMatchingIndex(\n\tchildVNode,\n\toldChildren,\n\tskewedIndex,\n\tremainingOldChildren\n) {\n\tconst key = childVNode.key;\n\tconst type = childVNode.type;\n\tlet oldVNode = oldChildren[skewedIndex];\n\tconst matched = oldVNode != NULL && (oldVNode._flags & MATCHED) == 0;\n\n\t// We only need to perform a search if there are more children\n\t// (remainingOldChildren) to search. However, if the oldVNode we just looked\n\t// at skewedIndex was not already used in this diff, then there must be at\n\t// least 1 other (so greater than 1) remainingOldChildren to attempt to match\n\t// against. So the following condition checks that ensuring\n\t// remainingOldChildren > 1 if the oldVNode is not already used/matched. Else\n\t// if the oldVNode was null or matched, then there could needs to be at least\n\t// 1 (aka `remainingOldChildren > 0`) children to find and compare against.\n\t//\n\t// If there is an unkeyed functional VNode, that isn't a built-in like our Fragment,\n\t// we should not search as we risk re-using state of an unrelated VNode. (reverted for now)\n\tlet shouldSearch =\n\t\t// (typeof type != 'function' || type === Fragment || key) &&\n\t\tremainingOldChildren > (matched ? 1 : 0);\n\n\tif (\n\t\t(oldVNode === NULL && key == null) ||\n\t\t(matched && key == oldVNode.key && type == oldVNode.type)\n\t) {\n\t\treturn skewedIndex;\n\t} else if (shouldSearch) {\n\t\tlet x = skewedIndex - 1;\n\t\tlet y = skewedIndex + 1;\n\t\twhile (x >= 0 || y < oldChildren.length) {\n\t\t\tconst childIndex = x >= 0 ? x-- : y++;\n\t\t\toldVNode = oldChildren[childIndex];\n\t\t\tif (\n\t\t\t\toldVNode != NULL &&\n\t\t\t\t(oldVNode._flags & MATCHED) == 0 &&\n\t\t\t\tkey == oldVNode.key &&\n\t\t\t\ttype == oldVNode.type\n\t\t\t) {\n\t\t\t\treturn childIndex;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn -1;\n}\n","import {\n\tEMPTY_ARR,\n\tEMPTY_OBJ,\n\tMATH_NAMESPACE,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tNULL,\n\tRESET_MODE,\n\tSVG_NAMESPACE,\n\tUNDEFINED,\n\tXHTML_NAMESPACE\n} from '../constants';\nimport { BaseComponent, getDomSibling } from '../component';\nimport { Fragment } from '../create-element';\nimport { diffChildren } from './children';\nimport { setProperty } from './props';\nimport { assign, isArray, removeNode, slice } from '../util';\nimport options from '../options';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * @template {any} T\n * @typedef {import('../internal').Ref} Ref\n */\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {PreactElement} parentDom The parent of the DOM element\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\t/** @type {any} */\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== UNDEFINED) return NULL;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._flags & MODE_SUSPENDED) {\n\t\tisHydrating = !!(oldVNode._flags & MODE_HYDRATE);\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\touter: if (typeof newType == 'function') {\n\t\ttry {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\t\t\tconst isClassComponent = newType.prototype && newType.prototype.render;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif (isClassComponent) {\n\t\t\t\t\t// @ts-expect-error The check above verifies that newType is suppose to be constructed\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-expect-error Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new BaseComponent(\n\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (isClassComponent && c._nextState == NULL) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\n\t\t\tif (isClassComponent && newType.getDerivedStateFromProps != NULL) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\t\t\tc._vnode = newVNode;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == NULL &&\n\t\t\t\t\tc.componentWillMount != NULL\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidMount != NULL) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == NULL &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != NULL\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tnewVNode._original == oldVNode._original ||\n\t\t\t\t\t(!c._force &&\n\t\t\t\t\t\tc.shouldComponentUpdate != NULL &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false)\n\t\t\t\t) {\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original != oldVNode._original) {\n\t\t\t\t\t\t// When we are dealing with a bail because of sCU we have to update\n\t\t\t\t\t\t// the props, state and dirty-state.\n\t\t\t\t\t\t// when we are dealing with strict-equality we don't as the child could still\n\t\t\t\t\t\t// be dirtied see #3883\n\t\t\t\t\t\tc.props = newProps;\n\t\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t\tc._dirty = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tnewVNode._children.some(vnode => {\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tEMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks);\n\t\t\t\t\tc._stateCallbacks = [];\n\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != NULL) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidUpdate != NULL) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc._parentDom = parentDom;\n\t\t\tc._force = false;\n\n\t\t\tlet renderHook = options._render,\n\t\t\t\tcount = 0;\n\t\t\tif (isClassComponent) {\n\t\t\t\tc.state = c._nextState;\n\t\t\t\tc._dirty = false;\n\n\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\tEMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks);\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t} else {\n\t\t\t\tdo {\n\t\t\t\t\tc._dirty = false;\n\t\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\t\t// Handle setState called in render, see #2553\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t} while (c._dirty && ++count < 25);\n\t\t\t}\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != NULL) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (isClassComponent && !isNew && c.getSnapshotBeforeUpdate != NULL) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet renderResult =\n\t\t\t\ttmp != NULL && tmp.type === Fragment && tmp.key == NULL\n\t\t\t\t\t? cloneNode(tmp.props.children)\n\t\t\t\t\t: tmp;\n\n\t\t\toldDom = diffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tisArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnamespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._flags &= RESET_MODE;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = NULL;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tnewVNode._original = NULL;\n\t\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\t\tif (isHydrating || excessDomChildren != NULL) {\n\t\t\t\tif (e.then) {\n\t\t\t\t\tnewVNode._flags |= isHydrating\n\t\t\t\t\t\t? MODE_HYDRATE | MODE_SUSPENDED\n\t\t\t\t\t\t: MODE_SUSPENDED;\n\n\t\t\t\t\twhile (oldDom && oldDom.nodeType == 8 && oldDom.nextSibling) {\n\t\t\t\t\t\toldDom = oldDom.nextSibling;\n\t\t\t\t\t}\n\n\t\t\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = NULL;\n\t\t\t\t\tnewVNode._dom = oldDom;\n\t\t\t\t} else {\n\t\t\t\t\tfor (let i = excessDomChildren.length; i--; ) {\n\t\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t\t}\n\t\t\t\t\tmarkAsForce(newVNode);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\tif (!e.then) markAsForce(newVNode);\n\t\t\t}\n\t\t\toptions._catchError(e, newVNode, oldVNode);\n\t\t}\n\t} else if (\n\t\texcessDomChildren == NULL &&\n\t\tnewVNode._original == oldVNode._original\n\t) {\n\t\tnewVNode._children = oldVNode._children;\n\t\tnewVNode._dom = oldVNode._dom;\n\t} else {\n\t\toldDom = newVNode._dom = diffElementNodes(\n\t\t\toldVNode._dom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\t}\n\n\tif ((tmp = options.diffed)) tmp(newVNode);\n\n\treturn newVNode._flags & MODE_SUSPENDED ? undefined : oldDom;\n}\n\nfunction markAsForce(vnode) {\n\tif (vnode) {\n\t\tif (vnode._component) vnode._component._force = true;\n\t\tif (vnode._children) vnode._children.some(markAsForce);\n\t}\n}\n\n/**\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {VNode} root\n */\nexport function commitRoot(commitQueue, root, refQueue) {\n\tfor (let i = 0; i < refQueue.length; i++) {\n\t\tapplyRef(refQueue[i], refQueue[++i], refQueue[++i]);\n\t}\n\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\t// @ts-expect-error Reuse the commitQueue variable here so the type changes\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\t// @ts-expect-error See above comment on commitQueue\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\nfunction cloneNode(node) {\n\tif (typeof node != 'object' || node == NULL || node._depth > 0) {\n\t\treturn node;\n\t}\n\n\tif (isArray(node)) {\n\t\treturn node.map(cloneNode);\n\t}\n\n\treturn assign({}, node);\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {PreactElement} dom The DOM element representing the virtual nodes\n * being diffed\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n * @returns {PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating,\n\trefQueue\n) {\n\tlet oldProps = oldVNode.props || EMPTY_OBJ;\n\tlet newProps = newVNode.props;\n\tlet nodeType = /** @type {string} */ (newVNode.type);\n\t/** @type {any} */\n\tlet i;\n\t/** @type {{ __html?: string }} */\n\tlet newHtml;\n\t/** @type {{ __html?: string }} */\n\tlet oldHtml;\n\t/** @type {ComponentChildren} */\n\tlet newChildren;\n\tlet value;\n\tlet inputValue;\n\tlet checked;\n\n\t// Tracks entering and exiting namespaces when descending through the tree.\n\tif (nodeType == 'svg') namespace = SVG_NAMESPACE;\n\telse if (nodeType == 'math') namespace = MATH_NAMESPACE;\n\telse if (!namespace) namespace = XHTML_NAMESPACE;\n\n\tif (excessDomChildren != NULL) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tvalue = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tvalue &&\n\t\t\t\t'setAttribute' in value == !!nodeType &&\n\t\t\t\t(nodeType ? value.localName == nodeType : value.nodeType == 3)\n\t\t\t) {\n\t\t\t\tdom = value;\n\t\t\t\texcessDomChildren[i] = NULL;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == NULL) {\n\t\tif (nodeType == NULL) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tdom = document.createElementNS(\n\t\t\tnamespace,\n\t\t\tnodeType,\n\t\t\tnewProps.is && newProps\n\t\t);\n\n\t\t// we are creating a new node, so we can assume this is a new subtree (in\n\t\t// case we are hydrating), this deopts the hydrate\n\t\tif (isHydrating) {\n\t\t\tif (options._hydrationMismatch)\n\t\t\t\toptions._hydrationMismatch(newVNode, excessDomChildren);\n\t\t\tisHydrating = false;\n\t\t}\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = NULL;\n\t}\n\n\tif (nodeType == NULL) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data != newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren = excessDomChildren && slice.call(dom.childNodes);\n\n\t\t// If we are in a situation where we are not hydrating but are using\n\t\t// existing DOM (e.g. replaceNode) we should read the existing DOM\n\t\t// attributes to diff them\n\t\tif (!isHydrating && excessDomChildren != NULL) {\n\t\t\toldProps = {};\n\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\tvalue = dom.attributes[i];\n\t\t\t\toldProps[value.name] = value.value;\n\t\t\t}\n\t\t}\n\n\t\tfor (i in oldProps) {\n\t\t\tvalue = oldProps[i];\n\t\t\tif (i == 'dangerouslySetInnerHTML') {\n\t\t\t\toldHtml = value;\n\t\t\t} else if (\n\t\t\t\ti != 'children' &&\n\t\t\t\t!(i in newProps) &&\n\t\t\t\t!(i == 'value' && 'defaultValue' in newProps) &&\n\t\t\t\t!(i == 'checked' && 'defaultChecked' in newProps)\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, NULL, value, namespace);\n\t\t\t}\n\t\t}\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tfor (i in newProps) {\n\t\t\tvalue = newProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t\tnewChildren = value;\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\tnewHtml = value;\n\t\t\t} else if (i == 'value') {\n\t\t\t\tinputValue = value;\n\t\t\t} else if (i == 'checked') {\n\t\t\t\tchecked = value;\n\t\t\t} else if (\n\t\t\t\t(!isHydrating || typeof value == 'function') &&\n\t\t\t\toldProps[i] !== value\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, value, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\tif (\n\t\t\t\t!isHydrating &&\n\t\t\t\t(!oldHtml ||\n\t\t\t\t\t(newHtml.__html != oldHtml.__html && newHtml.__html != dom.innerHTML))\n\t\t\t) {\n\t\t\t\tdom.innerHTML = newHtml.__html;\n\t\t\t}\n\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\tif (oldHtml) dom.innerHTML = '';\n\n\t\t\tdiffChildren(\n\t\t\t\t// @ts-expect-error\n\t\t\t\tnewVNode.type == 'template' ? dom.content : dom,\n\t\t\t\tisArray(newChildren) ? newChildren : [newChildren],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnodeType == 'foreignObject' ? XHTML_NAMESPACE : namespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\texcessDomChildren\n\t\t\t\t\t? excessDomChildren[0]\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\t// Remove children that are not part of any vnode.\n\t\t\tif (excessDomChildren != NULL) {\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// As above, don't diff props during hydration\n\t\tif (!isHydrating) {\n\t\t\ti = 'value';\n\t\t\tif (nodeType == 'progress' && inputValue == NULL) {\n\t\t\t\tdom.removeAttribute('value');\n\t\t\t} else if (\n\t\t\t\tinputValue != UNDEFINED &&\n\t\t\t\t// #2756 For the -element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(inputValue !== dom[i] ||\n\t\t\t\t\t(nodeType == 'progress' && !inputValue) ||\n\t\t\t\t\t// This is only for IE 11 to fix value not being updated.\n\t\t\t\t\t// To avoid a stale select value we need to set the option.value\n\t\t\t\t\t// again, which triggers IE11 to re-evaluate the select value\n\t\t\t\t\t(nodeType == 'option' && inputValue != oldProps[i]))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, inputValue, oldProps[i], namespace);\n\t\t\t}\n\n\t\t\ti = 'checked';\n\t\t\tif (checked != UNDEFINED && checked != dom[i]) {\n\t\t\t\tsetProperty(dom, i, checked, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {Ref & { _unmount?: unknown }} ref\n * @param {any} value\n * @param {VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') {\n\t\t\tlet hasRefUnmount = typeof ref._unmount == 'function';\n\t\t\tif (hasRefUnmount) {\n\t\t\t\t// @ts-ignore TS doesn't like moving narrowing checks into variables\n\t\t\t\tref._unmount();\n\t\t\t}\n\n\t\t\tif (!hasRefUnmount || value != NULL) {\n\t\t\t\t// Store the cleanup function on the function\n\t\t\t\t// instance object itself to avoid shape\n\t\t\t\t// transitioning vnode\n\t\t\t\tref._unmount = ref(value);\n\t\t\t}\n\t\t} else ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {VNode} vnode The virtual node to unmount\n * @param {VNode} parentVNode The parent of the VNode that initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current == vnode._dom) {\n\t\t\tapplyRef(r, NULL, parentVNode);\n\t\t}\n\t}\n\n\tif ((r = vnode._component) != NULL) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = NULL;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) {\n\t\t\t\tunmount(\n\t\t\t\t\tr[i],\n\t\t\t\t\tparentVNode,\n\t\t\t\t\tskipRemove || typeof vnode.type != 'function'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!skipRemove) {\n\t\tremoveNode(vnode._dom);\n\t}\n\n\tvnode._component = vnode._parent = vnode._dom = UNDEFINED;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n","import { EMPTY_OBJ, NULL } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { slice } from './util';\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to render into\n * @param {import('./internal').PreactElement | object} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\t// https://github.com/preactjs/preact/issues/3794\n\tif (parentDom == document) {\n\t\tparentDom = document.documentElement;\n\t}\n\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in\n\t// hydration mode or not by passing the `hydrate` function instead of a DOM\n\t// element..\n\tlet isHydrating = typeof replaceNode == 'function';\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? NULL\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\n\tvnode = ((!isHydrating && replaceNode) || parentDom)._children =\n\t\tcreateElement(Fragment, NULL, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [],\n\t\trefQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\tvnode,\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.namespaceURI,\n\t\t!isHydrating && replaceNode\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t\t? NULL\n\t\t\t\t: parentDom.firstChild\n\t\t\t\t\t? slice.call(parentDom.childNodes)\n\t\t\t\t\t: NULL,\n\t\tcommitQueue,\n\t\t!isHydrating && replaceNode\n\t\t\t? replaceNode\n\t\t\t: oldVNode\n\t\t\t\t? oldVNode._dom\n\t\t\t\t: parentDom.firstChild,\n\t\tisHydrating,\n\t\trefQueue\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode, refQueue);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, hydrate);\n}\n","import { NULL } from '../constants';\n\n/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').VNode} vnode The vnode that threw the error that was caught (except\n * for unmounting when this parameter is the highest parent that was being\n * unmounted)\n * @param {import('../internal').VNode} [oldVNode]\n * @param {import('../internal').ErrorInfo} [errorInfo]\n */\nexport function _catchError(error, vnode, oldVNode, errorInfo) {\n\t/** @type {import('../internal').Component} */\n\tlet component,\n\t\t/** @type {import('../internal').ComponentType} */\n\t\tctor,\n\t\t/** @type {boolean} */\n\t\thandled;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != NULL) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != NULL) {\n\t\t\t\t\tcomponent.componentDidCatch(error, errorInfo || {});\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n","import { assign, slice } from './util';\nimport { createVNode } from './create-element';\nimport { NULL, UNDEFINED } from './constants';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its\n * children.\n * @param {import('./internal').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array} rest Any additional arguments will be used\n * as replacement children.\n * @returns {import('./internal').VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\n\tlet defaultProps;\n\n\tif (vnode.type && vnode.type.defaultProps) {\n\t\tdefaultProps = vnode.type.defaultProps;\n\t}\n\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse if (props[i] === UNDEFINED && defaultProps != UNDEFINED) {\n\t\t\tnormalizedProps[i] = defaultProps[i];\n\t\t} else {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t}\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\tNULL\n\t);\n}\n"],"names":["slice","options","vnodeId","isValidElement","rerenderQueue","prevDebounce","defer","depthSort","CAPTURE_REGEX","eventClock","eventProxy","eventProxyCapture","i","SVG_NAMESPACE","XHTML_NAMESPACE","NULL","UNDEFINED","undefined","EMPTY_OBJ","EMPTY_ARR","IS_NON_DIMENSIONAL","isArray","Array","assign","obj","props","removeNode","node","parentNode","removeChild","createElement","type","children","key","ref","normalizedProps","arguments","length","call","defaultProps","createVNode","original","vnode","__k","__","__b","__e","__c","constructor","__v","__i","__u","Fragment","BaseComponent","context","this","getDomSibling","childIndex","sibling","renderComponent","component","__P","__d","oldVNode","oldDom","commitQueue","refQueue","newVNode","diff","__n","namespaceURI","commitRoot","updateParentDomPointers","base","some","child","enqueueRender","c","push","process","__r","debounceRendering","l","sort","shift","diffChildren","parentDom","renderResult","newParentVNode","oldParentVNode","globalContext","namespace","excessDomChildren","isHydrating","childVNode","newDom","firstChildDom","result","shouldPlace","oldChildren","newChildrenLength","constructNewChildrenArray","applyRef","insert","nextSibling","skewedIndex","matchingIndex","oldChildrenLength","remainingOldChildren","skew","String","findMatchingIndex","unmount","parentVNode","insertBefore","nodeType","x","y","matched","shouldSearch","setStyle","style","value","setProperty","test","dom","name","oldValue","useCapture","lowerCaseName","o","cssText","replace","toLowerCase","_attached","addEventListener","removeEventListener","e","removeAttribute","setAttribute","createEventProxy","eventHandler","_dispatched","event","tmp","isNew","oldProps","oldState","snapshot","clearProcessingException","newProps","isClassComponent","provider","componentContext","renderHook","count","newType","outer","prototype","render","contextType","__E","doRender","sub","state","__h","_sb","__s","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","apply","componentWillUpdate","componentDidUpdate","getChildContext","getSnapshotBeforeUpdate","cloneNode","then","MODE_HYDRATE","indexOf","markAsForce","diffElementNodes","diffed","root","cb","map","newHtml","oldHtml","newChildren","inputValue","checked","localName","document","createTextNode","createElementNS","is","__m","data","childNodes","attributes","__html","innerHTML","content","hasRefUnmount","current","skipRemove","r","componentWillUnmount","replaceNode","documentElement","firstChild","error","errorInfo","ctor","handled","getDerivedStateFromError","setState","componentDidCatch","update","callback","s","forceUpdate","Promise","bind","resolve","setTimeout","a","b","defaultValue","Context","subs","ctx","Set","_props","forEach","add","old","delete","Provider","__l","Consumer","contextValue","hydrate","toChildArray","out"],"mappings":"oOA2BaA,EChBPC,ECPFC,EA2FSC,ECiFTC,EAWAC,EAEEC,EA0BAC,ECxMAC,EAaFC,EA+IEC,EACAC,ECzKKC,ECSEC,EAAgB,6BAChBC,EAAkB,+BAGlBC,EAAO,KACPC,OAAYC,EACZC,EAAgC,CAAG,EACnCC,EAAY,GACZC,EACZ,oENnBYC,EAAUC,MAAMD,QAStB,SAASE,EAAOC,EAAKC,GAE3B,IAAK,IAAIb,KAAKa,EAAOD,EAAIZ,GAAKa,EAAMb,GACpC,OAA6BY,CAC9B,CAQgB,SAAAE,EAAWC,GACtBA,GAAQA,EAAKC,YAAYD,EAAKC,WAAWC,YAAYF,EAC1D,CEVgB,SAAAG,EAAcC,EAAMN,EAAOO,GAC1C,IACCC,EACAC,EACAtB,EAHGuB,EAAk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B,SAAcuN,GAC7B,SAASC,EAAQ9M,GAAjB,IAGM+M,EACAC,EA+BL,OAlCKlL,KAAKyH,kBAELwD,EAAO,IAAIE,KACXD,EAAM,CAAE,GACRF,EAAOxL,KAAQQ,KAEnBA,KAAKyH,gBAAkB,WAAM,OAAAyD,CAAG,EAEhClL,KAAK0J,qBAAuB,WAC3BuB,EAAOzN,CACR,EAEAwC,KAAKqH,sBAAwB,SAAU+D,GAElCpL,KAAK9B,MAAMiG,OAASiH,EAAOjH,OAC9B8G,EAAKI,QAAQ,SAAA/J,GACZA,EAAC/B,KAAU,EACX8B,EAAcC,EACf,EAEF,EAEAtB,KAAK4G,IAAM,SAAAtF,GACV2J,EAAKK,IAAIhK,GACT,IAAIiK,EAAMjK,EAAEoI,qBACZpI,EAAEoI,qBAAuB,WACpBuB,GACHA,EAAKO,OAAOlK,GAETiK,GAAKA,EAAIxM,KAAKuC,EACnB,CACD,GAGMpD,EAAMO,QACd,CAgBA,OAdAuM,EAAOxL,IAAO,OAASnC,IACvB2N,EAAO3L,GAAiB0L,EAQxBC,EAAQS,SACPT,EAAOU,KANRV,EAAQW,SAAW,SAACzN,EAAO0N,GAC1B,OAAO1N,EAAMO,SAASmN,EACvB,GAKkBnF,YAChBuE,EAEKA,CACR,2CHwBC,MAAO,CAAEzB,QAAS/L,EACnB,kBOTO,SAASqO,EAAQ1M,EAAO4C,GAC9ByE,EAAOrH,EAAO4C,EAAW8J,EAC1B,oEF6SgBC,EAAarN,EAAUsN,GAUtC,OATAA,EAAMA,GAAO,GACTtN,GAAYjB,GAA2B,kBAAZiB,IACpBX,EAAQW,GAClBA,EAAS0C,KAAK,SAAAC,GACb0K,EAAa1K,EAAO2K,EACrB,GAEAA,EAAIxK,KAAK9C,IAEHsN,CACR"} \ No newline at end of file diff --git a/node_modules/preact/hooks/dist/hooks.js b/node_modules/preact/hooks/dist/hooks.js new file mode 100644 index 0000000000000000000000000000000000000000..92b922ee63d8a7727d0726bcb297b8ce9c41c050 --- /dev/null +++ b/node_modules/preact/hooks/dist/hooks.js @@ -0,0 +1,2 @@ +var n,t,r,u,o=require("preact"),i=0,f=[],c=o.options,e=c.__b,a=c.__r,v=c.diffed,s=c.__c,l=c.unmount,p=c.__;function x(n,r){c.__h&&c.__h(t,n,i||r),i=0;var u=t.__H||(t.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function m(n){return i=1,d(b,n)}function d(r,u,o){var i=x(n++,2);if(i.t=r,!i.__c&&(i.__=[o?o(u):b(void 0,u),function(n){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,n);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=t,!t.__f)){var f=function(n,t,r){if(!i.__c.__H)return!0;var u=i.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var o=i.__c.props!==n;return u.some(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(o=!0)}}),c&&c.call(this,n,t,r)||o};t.__f=!0;var c=t.shouldComponentUpdate,e=t.componentWillUpdate;t.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},t.shouldComponentUpdate=f}return i.__N||i.__}function h(r,u){var o=x(n++,4);!c.__s&&P(o.__H,u)&&(o.__=r,o.u=u,t.__h.push(o))}function y(t,r){var u=x(n++,7);return P(u.__H,r)&&(u.__=t(),u.__H=r,u.__h=t),u.__}function _(){for(var n;n=f.shift();){var t=n.__H;if(n.__P&&t)try{t.__h.some(F),t.__h.some(T),t.__h=[]}catch(r){t.__h=[],c.__e(r,n.__v)}}}c.__b=function(n){t=null,e&&e(n)},c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),p&&p(n,t)},c.__r=function(u){a&&a(u),n=0;var o=(t=u.__c).__H;o&&(r===t?(o.__h=[],t.__h=[],o.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(o.__h.some(F),o.__h.some(T),o.__h=[],n=0)),r=t},c.diffed=function(n){v&&v(n);var o=n.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f.push(o)&&u===c.requestAnimationFrame||((u=c.requestAnimationFrame)||A)(_)),o.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),r=t=null},c.__c=function(n,t){t.some(function(n){try{n.__h.some(F),n.__h=n.__h.filter(function(n){return!n.__||T(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],c.__e(r,n.__v)}}),s&&s(n,t)},c.unmount=function(n){l&&l(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.some(function(n){try{F(n)}catch(n){t=n}}),r.__H=void 0,t&&c.__e(t,r.__v))};var q="function"==typeof requestAnimationFrame;function A(n){var t,r=function(){clearTimeout(u),q&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,35);q&&(t=requestAnimationFrame(r))}function F(n){var r=t,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),t=r}function T(n){var r=t;n.__c=n.__(),t=r}function P(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function b(n,t){return"function"==typeof t?t(n):t}exports.useCallback=function(n,t){return i=8,y(function(){return n},t)},exports.useContext=function(r){var u=t.context[r.__c],o=x(n++,9);return o.c=r,u?(null==o.__&&(o.__=!0,u.sub(t)),u.props.value):r.__},exports.useDebugValue=function(n,t){c.useDebugValue&&c.useDebugValue(t?t(n):n)},exports.useEffect=function(r,u){var o=x(n++,3);!c.__s&&P(o.__H,u)&&(o.__=r,o.u=u,t.__H.__h.push(o))},exports.useErrorBoundary=function(r){var u=x(n++,10),o=m();return u.__=r,t.componentDidCatch||(t.componentDidCatch=function(n,t){u.__&&u.__(n,t),o[1](n)}),[o[0],function(){o[1](void 0)}]},exports.useId=function(){var r=x(n++,11);if(!r.__){for(var u=t.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var o=u.__m||(u.__m=[0,0]);r.__="P"+o[0]+"-"+o[1]++}return r.__},exports.useImperativeHandle=function(n,t,r){i=6,h(function(){if("function"==typeof n){var r=n(t());return function(){n(null),r&&"function"==typeof r&&r()}}if(n)return n.current=t(),function(){return n.current=null}},null==r?r:r.concat(n))},exports.useLayoutEffect=h,exports.useMemo=y,exports.useReducer=d,exports.useRef=function(n){return i=5,y(function(){return{current:n}},[])},exports.useState=m; +//# sourceMappingURL=hooks.js.map diff --git a/node_modules/preact/hooks/dist/hooks.js.map b/node_modules/preact/hooks/dist/hooks.js.map new file mode 100644 index 0000000000000000000000000000000000000000..bec9b370444f3083f2cb5265b07594e40c045ee1 --- /dev/null +++ b/node_modules/preact/hooks/dist/hooks.js.map @@ -0,0 +1 @@ +{"version":3,"file":"hooks.js","sources":["../src/index.js"],"sourcesContent":["import { options as _options } from 'preact';\n\n/** @type {number} */\nlet currentIndex;\n\n/** @type {import('./internal').Component} */\nlet currentComponent;\n\n/** @type {import('./internal').Component} */\nlet previousComponent;\n\n/** @type {number} */\nlet currentHook = 0;\n\n/** @type {Array} */\nlet afterPaintEffects = [];\n\n// Cast to use internal Options type\nconst options = /** @type {import('./internal').Options} */ (_options);\n\nlet oldBeforeDiff = options._diff;\nlet oldBeforeRender = options._render;\nlet oldAfterDiff = options.diffed;\nlet oldCommit = options._commit;\nlet oldBeforeUnmount = options.unmount;\nlet oldRoot = options._root;\n\n// We take the minimum timeout for requestAnimationFrame to ensure that\n// the callback is invoked after the next frame. 35ms is based on a 30hz\n// refresh rate, which is the minimum rate for a smooth user experience.\nconst RAF_TIMEOUT = 35;\nlet prevRaf;\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._diff = vnode => {\n\tcurrentComponent = null;\n\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n};\n\noptions._root = (vnode, parentDom) => {\n\tif (vnode && parentDom._children && parentDom._children._mask) {\n\t\tvnode._mask = parentDom._children._mask;\n\t}\n\n\tif (oldRoot) oldRoot(vnode, parentDom);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._render = vnode => {\n\tif (oldBeforeRender) oldBeforeRender(vnode);\n\n\tcurrentComponent = vnode._component;\n\tcurrentIndex = 0;\n\n\tconst hooks = currentComponent.__hooks;\n\tif (hooks) {\n\t\tif (previousComponent === currentComponent) {\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentComponent._renderCallbacks = [];\n\t\t\thooks._list.some(hookItem => {\n\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t}\n\t\t\t\thookItem._pendingArgs = hookItem._nextValue = undefined;\n\t\t\t});\n\t\t} else {\n\t\t\thooks._pendingEffects.some(invokeCleanup);\n\t\t\thooks._pendingEffects.some(invokeEffect);\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentIndex = 0;\n\t\t}\n\t}\n\tpreviousComponent = currentComponent;\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.diffed = vnode => {\n\tif (oldAfterDiff) oldAfterDiff(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tif (c.__hooks._pendingEffects.length) afterPaint(afterPaintEffects.push(c));\n\t\tc.__hooks._list.some(hookItem => {\n\t\t\tif (hookItem._pendingArgs) {\n\t\t\t\thookItem._args = hookItem._pendingArgs;\n\t\t\t}\n\t\t\thookItem._pendingArgs = undefined;\n\t\t});\n\t}\n\tpreviousComponent = currentComponent = null;\n};\n\n// TODO: Improve typing of commitQueue parameter\n/** @type {(vnode: import('./internal').VNode, commitQueue: any) => void} */\noptions._commit = (vnode, commitQueue) => {\n\tcommitQueue.some(component => {\n\t\ttry {\n\t\t\tcomponent._renderCallbacks.some(invokeCleanup);\n\t\t\tcomponent._renderCallbacks = component._renderCallbacks.filter(cb =>\n\t\t\t\tcb._value ? invokeEffect(cb) : true\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tcommitQueue.some(c => {\n\t\t\t\tif (c._renderCallbacks) c._renderCallbacks = [];\n\t\t\t});\n\t\t\tcommitQueue = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t});\n\n\tif (oldCommit) oldCommit(vnode, commitQueue);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.unmount = vnode => {\n\tif (oldBeforeUnmount) oldBeforeUnmount(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tlet hasErrored;\n\t\tc.__hooks._list.some(s => {\n\t\t\ttry {\n\t\t\t\tinvokeCleanup(s);\n\t\t\t} catch (e) {\n\t\t\t\thasErrored = e;\n\t\t\t}\n\t\t});\n\t\tc.__hooks = undefined;\n\t\tif (hasErrored) options._catchError(hasErrored, c._vnode);\n\t}\n};\n\n/**\n * Get a hook's state from the currentComponent\n * @param {number} index The index of the hook to get\n * @param {number} type The index of the hook to get\n * @returns {any}\n */\nfunction getHookState(index, type) {\n\tif (options._hook) {\n\t\toptions._hook(currentComponent, index, currentHook || type);\n\t}\n\tcurrentHook = 0;\n\n\t// Largely inspired by:\n\t// * https://github.com/michael-klein/funcy.js/blob/f6be73468e6ec46b0ff5aa3cc4c9baf72a29025a/src/hooks/core_hooks.mjs\n\t// * https://github.com/michael-klein/funcy.js/blob/650beaa58c43c33a74820a3c98b3c7079cf2e333/src/renderer.mjs\n\t// Other implementations to look at:\n\t// * https://codesandbox.io/s/mnox05qp8\n\tconst hooks =\n\t\tcurrentComponent.__hooks ||\n\t\t(currentComponent.__hooks = {\n\t\t\t_list: [],\n\t\t\t_pendingEffects: []\n\t\t});\n\n\tif (index >= hooks._list.length) {\n\t\thooks._list.push({});\n\t}\n\n\treturn hooks._list[index];\n}\n\n/**\n * @template {unknown} S\n * @param {import('./index').Dispatch>} [initialState]\n * @returns {[S, (state: S) => void]}\n */\nexport function useState(initialState) {\n\tcurrentHook = 1;\n\treturn useReducer(invokeOrReturn, initialState);\n}\n\n/**\n * @template {unknown} S\n * @template {unknown} A\n * @param {import('./index').Reducer} reducer\n * @param {import('./index').Dispatch>} initialState\n * @param {(initialState: any) => void} [init]\n * @returns {[ S, (state: S) => void ]}\n */\nexport function useReducer(reducer, initialState, init) {\n\t/** @type {import('./internal').ReducerHookState} */\n\tconst hookState = getHookState(currentIndex++, 2);\n\thookState._reducer = reducer;\n\tif (!hookState._component) {\n\t\thookState._value = [\n\t\t\t!init ? invokeOrReturn(undefined, initialState) : init(initialState),\n\n\t\t\taction => {\n\t\t\t\tconst currentValue = hookState._nextValue\n\t\t\t\t\t? hookState._nextValue[0]\n\t\t\t\t\t: hookState._value[0];\n\t\t\t\tconst nextValue = hookState._reducer(currentValue, action);\n\n\t\t\t\tif (currentValue !== nextValue) {\n\t\t\t\t\thookState._nextValue = [nextValue, hookState._value[1]];\n\t\t\t\t\thookState._component.setState({});\n\t\t\t\t}\n\t\t\t}\n\t\t];\n\n\t\thookState._component = currentComponent;\n\n\t\tif (!currentComponent._hasScuFromHooks) {\n\t\t\tcurrentComponent._hasScuFromHooks = true;\n\t\t\tlet prevScu = currentComponent.shouldComponentUpdate;\n\t\t\tconst prevCWU = currentComponent.componentWillUpdate;\n\n\t\t\t// If we're dealing with a forced update `shouldComponentUpdate` will\n\t\t\t// not be called. But we use that to update the hook values, so we\n\t\t\t// need to call it.\n\t\t\tcurrentComponent.componentWillUpdate = function (p, s, c) {\n\t\t\t\tif (this._force) {\n\t\t\t\t\tlet tmp = prevScu;\n\t\t\t\t\t// Clear to avoid other sCU hooks from being called\n\t\t\t\t\tprevScu = undefined;\n\t\t\t\t\tupdateHookState(p, s, c);\n\t\t\t\t\tprevScu = tmp;\n\t\t\t\t}\n\n\t\t\t\tif (prevCWU) prevCWU.call(this, p, s, c);\n\t\t\t};\n\n\t\t\t// This SCU has the purpose of bailing out after repeated updates\n\t\t\t// to stateful hooks.\n\t\t\t// we store the next value in _nextValue[0] and keep doing that for all\n\t\t\t// state setters, if we have next states and\n\t\t\t// all next states within a component end up being equal to their original state\n\t\t\t// we are safe to bail out for this specific component.\n\t\t\t/**\n\t\t\t *\n\t\t\t * @type {import('./internal').Component[\"shouldComponentUpdate\"]}\n\t\t\t */\n\t\t\t// @ts-ignore - We don't use TS to downtranspile\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction updateHookState(p, s, c) {\n\t\t\t\tif (!hookState._component.__hooks) return true;\n\n\t\t\t\tconst stateHooks = hookState._component.__hooks._list.filter(\n\t\t\t\t\tx => x._component\n\t\t\t\t);\n\n\t\t\t\tconst allHooksEmpty = stateHooks.every(x => !x._nextValue);\n\t\t\t\t// When we have no updated hooks in the component we invoke the previous SCU or\n\t\t\t\t// traverse the VDOM tree further.\n\t\t\t\tif (allHooksEmpty) {\n\t\t\t\t\treturn prevScu ? prevScu.call(this, p, s, c) : true;\n\t\t\t\t}\n\n\t\t\t\t// We check whether we have components with a nextValue set that\n\t\t\t\t// have values that aren't equal to one another this pushes\n\t\t\t\t// us to update further down the tree\n\t\t\t\tlet shouldUpdate = hookState._component.props !== p;\n\t\t\t\tstateHooks.some(hookItem => {\n\t\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\t\tconst currentValue = hookItem._value[0];\n\t\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t\t\thookItem._nextValue = undefined;\n\t\t\t\t\t\tif (currentValue !== hookItem._value[0]) shouldUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn prevScu\n\t\t\t\t\t? prevScu.call(this, p, s, c) || shouldUpdate\n\t\t\t\t\t: shouldUpdate;\n\t\t\t}\n\n\t\t\tcurrentComponent.shouldComponentUpdate = updateHookState;\n\t\t}\n\t}\n\n\treturn hookState._nextValue || hookState._value;\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 3);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent.__hooks._pendingEffects.push(state);\n\t}\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useLayoutEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 4);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent._renderCallbacks.push(state);\n\t}\n}\n\n/** @type {(initialValue: unknown) => unknown} */\nexport function useRef(initialValue) {\n\tcurrentHook = 5;\n\treturn useMemo(() => ({ current: initialValue }), []);\n}\n\n/**\n * @param {object} ref\n * @param {() => object} createHandle\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useImperativeHandle(ref, createHandle, args) {\n\tcurrentHook = 6;\n\tuseLayoutEffect(\n\t\t() => {\n\t\t\tif (typeof ref == 'function') {\n\t\t\t\tconst result = ref(createHandle());\n\t\t\t\treturn () => {\n\t\t\t\t\tref(null);\n\t\t\t\t\tif (result && typeof result == 'function') result();\n\t\t\t\t};\n\t\t\t} else if (ref) {\n\t\t\t\tref.current = createHandle();\n\t\t\t\treturn () => (ref.current = null);\n\t\t\t}\n\t\t},\n\t\targs == null ? args : args.concat(ref)\n\t);\n}\n\n/**\n * @template {unknown} T\n * @param {() => T} factory\n * @param {unknown[]} args\n * @returns {T}\n */\nexport function useMemo(factory, args) {\n\t/** @type {import('./internal').MemoHookState} */\n\tconst state = getHookState(currentIndex++, 7);\n\tif (argsChanged(state._args, args)) {\n\t\tstate._value = factory();\n\t\tstate._args = args;\n\t\tstate._factory = factory;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * @param {() => void} callback\n * @param {unknown[]} args\n * @returns {() => void}\n */\nexport function useCallback(callback, args) {\n\tcurrentHook = 8;\n\treturn useMemo(() => callback, args);\n}\n\n/**\n * @param {import('./internal').PreactContext} context\n */\nexport function useContext(context) {\n\tconst provider = currentComponent.context[context._id];\n\t// We could skip this call here, but than we'd not call\n\t// `options._hook`. We need to do that in order to make\n\t// the devtools aware of this hook.\n\t/** @type {import('./internal').ContextHookState} */\n\tconst state = getHookState(currentIndex++, 9);\n\t// The devtools needs access to the context object to\n\t// be able to pull of the default value when no provider\n\t// is present in the tree.\n\tstate._context = context;\n\tif (!provider) return context._defaultValue;\n\t// This is probably not safe to convert to \"!\"\n\tif (state._value == null) {\n\t\tstate._value = true;\n\t\tprovider.sub(currentComponent);\n\t}\n\treturn provider.props.value;\n}\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {(value: T, cb?: (value: T) => string | number) => void}\n */\nexport function useDebugValue(value, formatter) {\n\tif (options.useDebugValue) {\n\t\toptions.useDebugValue(\n\t\t\tformatter ? formatter(value) : /** @type {any}*/ (value)\n\t\t);\n\t}\n}\n\n/**\n * @param {(error: unknown, errorInfo: import('preact').ErrorInfo) => void} cb\n * @returns {[unknown, () => void]}\n */\nexport function useErrorBoundary(cb) {\n\t/** @type {import('./internal').ErrorBoundaryHookState} */\n\tconst state = getHookState(currentIndex++, 10);\n\tconst errState = useState();\n\tstate._value = cb;\n\tif (!currentComponent.componentDidCatch) {\n\t\tcurrentComponent.componentDidCatch = (err, errorInfo) => {\n\t\t\tif (state._value) state._value(err, errorInfo);\n\t\t\terrState[1](err);\n\t\t};\n\t}\n\treturn [\n\t\terrState[0],\n\t\t() => {\n\t\t\terrState[1](undefined);\n\t\t}\n\t];\n}\n\n/** @type {() => string} */\nexport function useId() {\n\t/** @type {import('./internal').IdHookState} */\n\tconst state = getHookState(currentIndex++, 11);\n\tif (!state._value) {\n\t\t// Grab either the root node or the nearest async boundary node.\n\t\t/** @type {import('./internal').VNode} */\n\t\tlet root = currentComponent._vnode;\n\t\twhile (root !== null && !root._mask && root._parent !== null) {\n\t\t\troot = root._parent;\n\t\t}\n\n\t\tlet mask = root._mask || (root._mask = [0, 0]);\n\t\tstate._value = 'P' + mask[0] + '-' + mask[1]++;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * After paint effects consumer.\n */\nfunction flushAfterPaintEffects() {\n\tlet component;\n\twhile ((component = afterPaintEffects.shift())) {\n\t\tconst hooks = component.__hooks;\n\t\tif (!component._parentDom || !hooks) continue;\n\t\ttry {\n\t\t\thooks._pendingEffects.some(invokeCleanup);\n\t\t\thooks._pendingEffects.some(invokeEffect);\n\t\t\thooks._pendingEffects = [];\n\t\t} catch (e) {\n\t\t\thooks._pendingEffects = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t}\n}\n\nlet HAS_RAF = typeof requestAnimationFrame == 'function';\n\n/**\n * Schedule a callback to be invoked after the browser has a chance to paint a new frame.\n * Do this by combining requestAnimationFrame (rAF) + setTimeout to invoke a callback after\n * the next browser frame.\n *\n * Also, schedule a timeout in parallel to the the rAF to ensure the callback is invoked\n * even if RAF doesn't fire (for example if the browser tab is not visible)\n *\n * @param {() => void} callback\n */\nfunction afterNextFrame(callback) {\n\tconst done = () => {\n\t\tclearTimeout(timeout);\n\t\tif (HAS_RAF) cancelAnimationFrame(raf);\n\t\tsetTimeout(callback);\n\t};\n\tconst timeout = setTimeout(done, RAF_TIMEOUT);\n\n\tlet raf;\n\tif (HAS_RAF) {\n\t\traf = requestAnimationFrame(done);\n\t}\n}\n\n// Note: if someone used options.debounceRendering = requestAnimationFrame,\n// then effects will ALWAYS run on the NEXT frame instead of the current one, incurring a ~16ms delay.\n// Perhaps this is not such a big deal.\n/**\n * Schedule afterPaintEffects flush after the browser paints\n * @param {number} newQueueLength\n * @returns {void}\n */\nfunction afterPaint(newQueueLength) {\n\tif (newQueueLength === 1 || prevRaf !== options.requestAnimationFrame) {\n\t\tprevRaf = options.requestAnimationFrame;\n\t\t(prevRaf || afterNextFrame)(flushAfterPaintEffects);\n\t}\n}\n\n/**\n * @param {import('./internal').HookState} hook\n * @returns {void}\n */\nfunction invokeCleanup(hook) {\n\t// A hook cleanup can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\tlet cleanup = hook._cleanup;\n\tif (typeof cleanup == 'function') {\n\t\thook._cleanup = undefined;\n\t\tcleanup();\n\t}\n\n\tcurrentComponent = comp;\n}\n\n/**\n * Invoke a Hook's effect\n * @param {import('./internal').EffectHookState} hook\n * @returns {void}\n */\nfunction invokeEffect(hook) {\n\t// A hook call can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\thook._cleanup = hook._value();\n\tcurrentComponent = comp;\n}\n\n/**\n * @param {unknown[]} oldArgs\n * @param {unknown[]} newArgs\n * @returns {boolean}\n */\nfunction argsChanged(oldArgs, newArgs) {\n\treturn (\n\t\t!oldArgs ||\n\t\toldArgs.length !== newArgs.length ||\n\t\tnewArgs.some((arg, index) => arg !== oldArgs[index])\n\t);\n}\n\n/**\n * @template Arg\n * @param {Arg} arg\n * @param {(arg: Arg) => any} f\n * @returns {any}\n */\nfunction invokeOrReturn(arg, f) {\n\treturn typeof f == 'function' ? f(arg) : f;\n}\n"],"names":["currentIndex","currentComponent","previousComponent","prevRaf","currentHook","afterPaintEffects","options","_options","oldBeforeDiff","__b","oldBeforeRender","__r","oldAfterDiff","diffed","oldCommit","__c","oldBeforeUnmount","unmount","oldRoot","__","getHookState","index","type","__h","hooks","__H","length","push","useState","initialState","useReducer","invokeOrReturn","reducer","init","hookState","_reducer","undefined","action","currentValue","__N","nextValue","setState","__f","updateHookState","p","s","c","stateHooks","filter","x","every","prevScu","call","this","shouldUpdate","props","some","hookItem","shouldComponentUpdate","prevCWU","componentWillUpdate","__e","tmp","useLayoutEffect","callback","args","state","__s","argsChanged","_pendingArgs","useMemo","factory","flushAfterPaintEffects","component","shift","__P","invokeCleanup","invokeEffect","e","__v","vnode","parentDom","__k","__m","requestAnimationFrame","afterNextFrame","commitQueue","cb","hasErrored","HAS_RAF","raf","done","clearTimeout","timeout","cancelAnimationFrame","setTimeout","hook","comp","cleanup","oldArgs","newArgs","arg","f","context","provider","sub","value","formatter","useDebugValue","errState","componentDidCatch","err","errorInfo","root","mask","ref","createHandle","result","current","concat","initialValue"],"mappings":"IAGIA,EAGAC,EAGAC,EAsBAC,sBAnBAC,EAAc,EAGdC,EAAoB,GAGlBC,EAAuDC,EAAAA,QAEzDC,EAAgBF,EAAOG,IACvBC,EAAkBJ,EAAOK,IACzBC,EAAeN,EAAQO,OACvBC,EAAYR,EAAOS,IACnBC,EAAmBV,EAAQW,QAC3BC,EAAUZ,EAAOa,GAiHrB,SAASC,EAAaC,EAAOC,GACxBhB,EAAOiB,KACVjB,EAAOiB,IAAOtB,EAAkBoB,EAAOjB,GAAekB,GAEvDlB,EAAc,EAOd,IAAMoB,EACLvB,EAAgBwB,MACfxB,EAAgBwB,IAAW,CAC3BN,GAAO,GACPI,IAAiB,KAOnB,OAJIF,GAASG,EAAKL,GAAOO,QACxBF,EAAKL,GAAOQ,KAAK,CAAE,GAGbH,EAAKL,GAAOE,EACpB,CAOgB,SAAAO,EAASC,GAExB,OADAzB,EAAc,EACP0B,EAAWC,EAAgBF,EACnC,CAUO,SAASC,EAAWE,EAASH,EAAcI,GAEjD,IAAMC,EAAYd,EAAapB,IAAgB,GAE/C,GADAkC,EAAUC,EAAWH,GAChBE,EAASnB,MACbmB,EAASf,GAAU,CACjBc,EAAiDA,EAAKJ,GAA/CE,OAAeK,EAAWP,GAElC,SAAAQ,GACC,IAAMC,EAAeJ,EAASK,IAC3BL,EAASK,IAAY,GACrBL,EAASf,GAAQ,GACdqB,EAAYN,EAAUC,EAASG,EAAcD,GAE/CC,IAAiBE,IACpBN,EAASK,IAAc,CAACC,EAAWN,EAASf,GAAQ,IACpDe,EAASnB,IAAY0B,SAAS,CAAE,GAElC,GAGDP,EAASnB,IAAcd,GAElBA,EAAgByC,KAAmB,CAAA,IAgC9BC,EAAT,SAAyBC,EAAGC,EAAGC,GAC9B,IAAKZ,EAASnB,IAAAU,IAAqB,OAAO,EAE1C,IAAMsB,EAAab,EAASnB,IAAAU,IAAAN,GAA0B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AGzE,EACb,EAEF,gBAGO,WAEN,IAAM8B,EAAQ9C,EAAapB,IAAgB,IAC3C,IAAKkE,EAAK/C,GAAS,CAIlB,IADA,IAAI8F,EAAOhH,EAAgB8E,IACX,OAATkC,IAAkBA,EAAI9B,KAA2B,OAAjB8B,EAAI9F,IAC1C8F,EAAOA,EAAI9F,GAGZ,IAAI+F,EAAOD,EAAI9B,MAAW8B,EAAI9B,IAAS,CAAC,EAAG,IAC3CjB,EAAK/C,GAAU,IAAM+F,EAAK,GAAK,IAAMA,EAAK,IAC3C,CAEA,OAAOhD,EAAK/C,EACb,8BA1HgB,SAAoBgG,EAAKC,EAAcnD,GACtD7D,EAAc,EACd2D,EACC,WACC,GAAkB,mBAAPoD,EAAmB,CAC7B,IAAME,EAASF,EAAIC,KACnB,OAAa,WACZD,EAAI,MACAE,GAA2B,mBAAVA,GAAsBA,GAC5C,CACD,CAAWF,GAAAA,EAEV,OADAA,EAAIG,QAAUF,IACP,WAAA,OAAOD,EAAIG,QAAU,IAAI,CAElC,EACQ,MAARrD,EAAeA,EAAOA,EAAKsD,OAAOJ,GAEpC,kFA5BO,SAAgBK,GAEtB,OADApH,EAAc,EACPkE,EAAQ,WAAO,MAAA,CAAEgD,QAASE,EAAc,EAAG,GACnD"} \ No newline at end of file diff --git a/node_modules/preact/hooks/dist/hooks.mjs b/node_modules/preact/hooks/dist/hooks.mjs new file mode 100644 index 0000000000000000000000000000000000000000..e1ceea1edc685652ae0a25854e98b4349b3c41bb --- /dev/null +++ b/node_modules/preact/hooks/dist/hooks.mjs @@ -0,0 +1,2 @@ +import{options as n}from"preact";var t,r,u,i,o=0,f=[],c=n,e=c.__b,a=c.__r,v=c.diffed,l=c.__c,m=c.unmount,s=c.__;function p(n,t){c.__h&&c.__h(r,n,o||t),o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return o=1,h(D,n)}function h(n,u,i){var o=p(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.__f)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=o.__c.props!==n;return u.some(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),c&&c.call(this,n,t,r)||i};r.__f=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=p(t++,3);!c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__H.__h.push(i))}function _(n,u){var i=p(t++,4);!c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__h.push(i))}function A(n){return o=5,T(function(){return{current:n}},[])}function F(n,t,r){o=6,_(function(){if("function"==typeof n){var r=n(t());return function(){n(null),r&&"function"==typeof r&&r()}}if(n)return n.current=t(),function(){return n.current=null}},null==r?r:r.concat(n))}function T(n,r){var u=p(t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=p(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){c.useDebugValue&&c.useDebugValue(t?t(n):n)}function b(n){var u=p(t++,10),i=d();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=p(t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__}function j(){for(var n;n=f.shift();){var t=n.__H;if(n.__P&&t)try{t.__h.some(z),t.__h.some(B),t.__h=[]}catch(r){t.__h=[],c.__e(r,n.__v)}}}c.__b=function(n){r=null,e&&e(n)},c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},c.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(i.__h.some(z),i.__h.some(B),i.__h=[],t=0)),u=r},c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==f.push(t)&&i===c.requestAnimationFrame||((i=c.requestAnimationFrame)||w)(j)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),u=r=null},c.__c=function(n,t){t.some(function(n){try{n.__h.some(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],c.__e(r,n.__v)}}),l&&l(n,t)},c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.some(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&c.__e(t,r.__v))};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,35);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return"function"==typeof t?t(n):t}export{q as useCallback,x as useContext,P as useDebugValue,y as useEffect,b as useErrorBoundary,g as useId,F as useImperativeHandle,_ as useLayoutEffect,T as useMemo,h as useReducer,A as useRef,d as useState}; +//# sourceMappingURL=hooks.module.js.map diff --git a/node_modules/preact/hooks/dist/hooks.module.js b/node_modules/preact/hooks/dist/hooks.module.js new file mode 100644 index 0000000000000000000000000000000000000000..e1ceea1edc685652ae0a25854e98b4349b3c41bb --- /dev/null +++ b/node_modules/preact/hooks/dist/hooks.module.js @@ -0,0 +1,2 @@ +import{options as n}from"preact";var t,r,u,i,o=0,f=[],c=n,e=c.__b,a=c.__r,v=c.diffed,l=c.__c,m=c.unmount,s=c.__;function p(n,t){c.__h&&c.__h(r,n,o||t),o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return o=1,h(D,n)}function h(n,u,i){var o=p(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.__f)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=o.__c.props!==n;return u.some(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),c&&c.call(this,n,t,r)||i};r.__f=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=p(t++,3);!c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__H.__h.push(i))}function _(n,u){var i=p(t++,4);!c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__h.push(i))}function A(n){return o=5,T(function(){return{current:n}},[])}function F(n,t,r){o=6,_(function(){if("function"==typeof n){var r=n(t());return function(){n(null),r&&"function"==typeof r&&r()}}if(n)return n.current=t(),function(){return n.current=null}},null==r?r:r.concat(n))}function T(n,r){var u=p(t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=p(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){c.useDebugValue&&c.useDebugValue(t?t(n):n)}function b(n){var u=p(t++,10),i=d();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=p(t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__}function j(){for(var n;n=f.shift();){var t=n.__H;if(n.__P&&t)try{t.__h.some(z),t.__h.some(B),t.__h=[]}catch(r){t.__h=[],c.__e(r,n.__v)}}}c.__b=function(n){r=null,e&&e(n)},c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},c.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(i.__h.some(z),i.__h.some(B),i.__h=[],t=0)),u=r},c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==f.push(t)&&i===c.requestAnimationFrame||((i=c.requestAnimationFrame)||w)(j)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),u=r=null},c.__c=function(n,t){t.some(function(n){try{n.__h.some(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],c.__e(r,n.__v)}}),l&&l(n,t)},c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.some(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&c.__e(t,r.__v))};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,35);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return"function"==typeof t?t(n):t}export{q as useCallback,x as useContext,P as useDebugValue,y as useEffect,b as useErrorBoundary,g as useId,F as useImperativeHandle,_ as useLayoutEffect,T as useMemo,h as useReducer,A as useRef,d as useState}; +//# sourceMappingURL=hooks.module.js.map diff --git a/node_modules/preact/hooks/dist/hooks.module.js.map b/node_modules/preact/hooks/dist/hooks.module.js.map new file mode 100644 index 0000000000000000000000000000000000000000..5846289a8cd16ba6b59327109de6bfbbb96fba8b --- /dev/null +++ b/node_modules/preact/hooks/dist/hooks.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"hooks.module.js","sources":["../src/index.js"],"sourcesContent":["import { options as _options } from 'preact';\n\n/** @type {number} */\nlet currentIndex;\n\n/** @type {import('./internal').Component} */\nlet currentComponent;\n\n/** @type {import('./internal').Component} */\nlet previousComponent;\n\n/** @type {number} */\nlet currentHook = 0;\n\n/** @type {Array} */\nlet afterPaintEffects = [];\n\n// Cast to use internal Options type\nconst options = /** @type {import('./internal').Options} */ (_options);\n\nlet oldBeforeDiff = options._diff;\nlet oldBeforeRender = options._render;\nlet oldAfterDiff = options.diffed;\nlet oldCommit = options._commit;\nlet oldBeforeUnmount = options.unmount;\nlet oldRoot = options._root;\n\n// We take the minimum timeout for requestAnimationFrame to ensure that\n// the callback is invoked after the next frame. 35ms is based on a 30hz\n// refresh rate, which is the minimum rate for a smooth user experience.\nconst RAF_TIMEOUT = 35;\nlet prevRaf;\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._diff = vnode => {\n\tcurrentComponent = null;\n\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n};\n\noptions._root = (vnode, parentDom) => {\n\tif (vnode && parentDom._children && parentDom._children._mask) {\n\t\tvnode._mask = parentDom._children._mask;\n\t}\n\n\tif (oldRoot) oldRoot(vnode, parentDom);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._render = vnode => {\n\tif (oldBeforeRender) oldBeforeRender(vnode);\n\n\tcurrentComponent = vnode._component;\n\tcurrentIndex = 0;\n\n\tconst hooks = currentComponent.__hooks;\n\tif (hooks) {\n\t\tif (previousComponent === currentComponent) {\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentComponent._renderCallbacks = [];\n\t\t\thooks._list.some(hookItem => {\n\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t}\n\t\t\t\thookItem._pendingArgs = hookItem._nextValue = undefined;\n\t\t\t});\n\t\t} else {\n\t\t\thooks._pendingEffects.some(invokeCleanup);\n\t\t\thooks._pendingEffects.some(invokeEffect);\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentIndex = 0;\n\t\t}\n\t}\n\tpreviousComponent = currentComponent;\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.diffed = vnode => {\n\tif (oldAfterDiff) oldAfterDiff(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tif (c.__hooks._pendingEffects.length) afterPaint(afterPaintEffects.push(c));\n\t\tc.__hooks._list.some(hookItem => {\n\t\t\tif (hookItem._pendingArgs) {\n\t\t\t\thookItem._args = hookItem._pendingArgs;\n\t\t\t}\n\t\t\thookItem._pendingArgs = undefined;\n\t\t});\n\t}\n\tpreviousComponent = currentComponent = null;\n};\n\n// TODO: Improve typing of commitQueue parameter\n/** @type {(vnode: import('./internal').VNode, commitQueue: any) => void} */\noptions._commit = (vnode, commitQueue) => {\n\tcommitQueue.some(component => {\n\t\ttry {\n\t\t\tcomponent._renderCallbacks.some(invokeCleanup);\n\t\t\tcomponent._renderCallbacks = component._renderCallbacks.filter(cb =>\n\t\t\t\tcb._value ? invokeEffect(cb) : true\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tcommitQueue.some(c => {\n\t\t\t\tif (c._renderCallbacks) c._renderCallbacks = [];\n\t\t\t});\n\t\t\tcommitQueue = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t});\n\n\tif (oldCommit) oldCommit(vnode, commitQueue);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.unmount = vnode => {\n\tif (oldBeforeUnmount) oldBeforeUnmount(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tlet hasErrored;\n\t\tc.__hooks._list.some(s => {\n\t\t\ttry {\n\t\t\t\tinvokeCleanup(s);\n\t\t\t} catch (e) {\n\t\t\t\thasErrored = e;\n\t\t\t}\n\t\t});\n\t\tc.__hooks = undefined;\n\t\tif (hasErrored) options._catchError(hasErrored, c._vnode);\n\t}\n};\n\n/**\n * Get a hook's state from the currentComponent\n * @param {number} index The index of the hook to get\n * @param {number} type The index of the hook to get\n * @returns {any}\n */\nfunction getHookState(index, type) {\n\tif (options._hook) {\n\t\toptions._hook(currentComponent, index, currentHook || type);\n\t}\n\tcurrentHook = 0;\n\n\t// Largely inspired by:\n\t// * https://github.com/michael-klein/funcy.js/blob/f6be73468e6ec46b0ff5aa3cc4c9baf72a29025a/src/hooks/core_hooks.mjs\n\t// * https://github.com/michael-klein/funcy.js/blob/650beaa58c43c33a74820a3c98b3c7079cf2e333/src/renderer.mjs\n\t// Other implementations to look at:\n\t// * https://codesandbox.io/s/mnox05qp8\n\tconst hooks =\n\t\tcurrentComponent.__hooks ||\n\t\t(currentComponent.__hooks = {\n\t\t\t_list: [],\n\t\t\t_pendingEffects: []\n\t\t});\n\n\tif (index >= hooks._list.length) {\n\t\thooks._list.push({});\n\t}\n\n\treturn hooks._list[index];\n}\n\n/**\n * @template {unknown} S\n * @param {import('./index').Dispatch>} [initialState]\n * @returns {[S, (state: S) => void]}\n */\nexport function useState(initialState) {\n\tcurrentHook = 1;\n\treturn useReducer(invokeOrReturn, initialState);\n}\n\n/**\n * @template {unknown} S\n * @template {unknown} A\n * @param {import('./index').Reducer} reducer\n * @param {import('./index').Dispatch>} initialState\n * @param {(initialState: any) => void} [init]\n * @returns {[ S, (state: S) => void ]}\n */\nexport function useReducer(reducer, initialState, init) {\n\t/** @type {import('./internal').ReducerHookState} */\n\tconst hookState = getHookState(currentIndex++, 2);\n\thookState._reducer = reducer;\n\tif (!hookState._component) {\n\t\thookState._value = [\n\t\t\t!init ? invokeOrReturn(undefined, initialState) : init(initialState),\n\n\t\t\taction => {\n\t\t\t\tconst currentValue = hookState._nextValue\n\t\t\t\t\t? hookState._nextValue[0]\n\t\t\t\t\t: hookState._value[0];\n\t\t\t\tconst nextValue = hookState._reducer(currentValue, action);\n\n\t\t\t\tif (currentValue !== nextValue) {\n\t\t\t\t\thookState._nextValue = [nextValue, hookState._value[1]];\n\t\t\t\t\thookState._component.setState({});\n\t\t\t\t}\n\t\t\t}\n\t\t];\n\n\t\thookState._component = currentComponent;\n\n\t\tif (!currentComponent._hasScuFromHooks) {\n\t\t\tcurrentComponent._hasScuFromHooks = true;\n\t\t\tlet prevScu = currentComponent.shouldComponentUpdate;\n\t\t\tconst prevCWU = currentComponent.componentWillUpdate;\n\n\t\t\t// If we're dealing with a forced update `shouldComponentUpdate` will\n\t\t\t// not be called. But we use that to update the hook values, so we\n\t\t\t// need to call it.\n\t\t\tcurrentComponent.componentWillUpdate = function (p, s, c) {\n\t\t\t\tif (this._force) {\n\t\t\t\t\tlet tmp = prevScu;\n\t\t\t\t\t// Clear to avoid other sCU hooks from being called\n\t\t\t\t\tprevScu = undefined;\n\t\t\t\t\tupdateHookState(p, s, c);\n\t\t\t\t\tprevScu = tmp;\n\t\t\t\t}\n\n\t\t\t\tif (prevCWU) prevCWU.call(this, p, s, c);\n\t\t\t};\n\n\t\t\t// This SCU has the purpose of bailing out after repeated updates\n\t\t\t// to stateful hooks.\n\t\t\t// we store the next value in _nextValue[0] and keep doing that for all\n\t\t\t// state setters, if we have next states and\n\t\t\t// all next states within a component end up being equal to their original state\n\t\t\t// we are safe to bail out for this specific component.\n\t\t\t/**\n\t\t\t *\n\t\t\t * @type {import('./internal').Component[\"shouldComponentUpdate\"]}\n\t\t\t */\n\t\t\t// @ts-ignore - We don't use TS to downtranspile\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction updateHookState(p, s, c) {\n\t\t\t\tif (!hookState._component.__hooks) return true;\n\n\t\t\t\tconst stateHooks = hookState._component.__hooks._list.filter(\n\t\t\t\t\tx => x._component\n\t\t\t\t);\n\n\t\t\t\tconst allHooksEmpty = stateHooks.every(x => !x._nextValue);\n\t\t\t\t// When we have no updated hooks in the component we invoke the previous SCU or\n\t\t\t\t// traverse the VDOM tree further.\n\t\t\t\tif (allHooksEmpty) {\n\t\t\t\t\treturn prevScu ? prevScu.call(this, p, s, c) : true;\n\t\t\t\t}\n\n\t\t\t\t// We check whether we have components with a nextValue set that\n\t\t\t\t// have values that aren't equal to one another this pushes\n\t\t\t\t// us to update further down the tree\n\t\t\t\tlet shouldUpdate = hookState._component.props !== p;\n\t\t\t\tstateHooks.some(hookItem => {\n\t\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\t\tconst currentValue = hookItem._value[0];\n\t\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t\t\thookItem._nextValue = undefined;\n\t\t\t\t\t\tif (currentValue !== hookItem._value[0]) shouldUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn prevScu\n\t\t\t\t\t? prevScu.call(this, p, s, c) || shouldUpdate\n\t\t\t\t\t: shouldUpdate;\n\t\t\t}\n\n\t\t\tcurrentComponent.shouldComponentUpdate = updateHookState;\n\t\t}\n\t}\n\n\treturn hookState._nextValue || hookState._value;\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 3);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent.__hooks._pendingEffects.push(state);\n\t}\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useLayoutEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 4);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent._renderCallbacks.push(state);\n\t}\n}\n\n/** @type {(initialValue: unknown) => unknown} */\nexport function useRef(initialValue) {\n\tcurrentHook = 5;\n\treturn useMemo(() => ({ current: initialValue }), []);\n}\n\n/**\n * @param {object} ref\n * @param {() => object} createHandle\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useImperativeHandle(ref, createHandle, args) {\n\tcurrentHook = 6;\n\tuseLayoutEffect(\n\t\t() => {\n\t\t\tif (typeof ref == 'function') {\n\t\t\t\tconst result = ref(createHandle());\n\t\t\t\treturn () => {\n\t\t\t\t\tref(null);\n\t\t\t\t\tif (result && typeof result == 'function') result();\n\t\t\t\t};\n\t\t\t} else if (ref) {\n\t\t\t\tref.current = createHandle();\n\t\t\t\treturn () => (ref.current = null);\n\t\t\t}\n\t\t},\n\t\targs == null ? args : args.concat(ref)\n\t);\n}\n\n/**\n * @template {unknown} T\n * @param {() => T} factory\n * @param {unknown[]} args\n * @returns {T}\n */\nexport function useMemo(factory, args) {\n\t/** @type {import('./internal').MemoHookState} */\n\tconst state = getHookState(currentIndex++, 7);\n\tif (argsChanged(state._args, args)) {\n\t\tstate._value = factory();\n\t\tstate._args = args;\n\t\tstate._factory = factory;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * @param {() => void} callback\n * @param {unknown[]} args\n * @returns {() => void}\n */\nexport function useCallback(callback, args) {\n\tcurrentHook = 8;\n\treturn useMemo(() => callback, args);\n}\n\n/**\n * @param {import('./internal').PreactContext} context\n */\nexport function useContext(context) {\n\tconst provider = currentComponent.context[context._id];\n\t// We could skip this call here, but than we'd not call\n\t// `options._hook`. We need to do that in order to make\n\t// the devtools aware of this hook.\n\t/** @type {import('./internal').ContextHookState} */\n\tconst state = getHookState(currentIndex++, 9);\n\t// The devtools needs access to the context object to\n\t// be able to pull of the default value when no provider\n\t// is present in the tree.\n\tstate._context = context;\n\tif (!provider) return context._defaultValue;\n\t// This is probably not safe to convert to \"!\"\n\tif (state._value == null) {\n\t\tstate._value = true;\n\t\tprovider.sub(currentComponent);\n\t}\n\treturn provider.props.value;\n}\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {(value: T, cb?: (value: T) => string | number) => void}\n */\nexport function useDebugValue(value, formatter) {\n\tif (options.useDebugValue) {\n\t\toptions.useDebugValue(\n\t\t\tformatter ? formatter(value) : /** @type {any}*/ (value)\n\t\t);\n\t}\n}\n\n/**\n * @param {(error: unknown, errorInfo: import('preact').ErrorInfo) => void} cb\n * @returns {[unknown, () => void]}\n */\nexport function useErrorBoundary(cb) {\n\t/** @type {import('./internal').ErrorBoundaryHookState} */\n\tconst state = getHookState(currentIndex++, 10);\n\tconst errState = useState();\n\tstate._value = cb;\n\tif (!currentComponent.componentDidCatch) {\n\t\tcurrentComponent.componentDidCatch = (err, errorInfo) => {\n\t\t\tif (state._value) state._value(err, errorInfo);\n\t\t\terrState[1](err);\n\t\t};\n\t}\n\treturn [\n\t\terrState[0],\n\t\t() => {\n\t\t\terrState[1](undefined);\n\t\t}\n\t];\n}\n\n/** @type {() => string} */\nexport function useId() {\n\t/** @type {import('./internal').IdHookState} */\n\tconst state = getHookState(currentIndex++, 11);\n\tif (!state._value) {\n\t\t// Grab either the root node or the nearest async boundary node.\n\t\t/** @type {import('./internal').VNode} */\n\t\tlet root = currentComponent._vnode;\n\t\twhile (root !== null && !root._mask && root._parent !== null) {\n\t\t\troot = root._parent;\n\t\t}\n\n\t\tlet mask = root._mask || (root._mask = [0, 0]);\n\t\tstate._value = 'P' + mask[0] + '-' + mask[1]++;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * After paint effects consumer.\n */\nfunction flushAfterPaintEffects() {\n\tlet component;\n\twhile ((component = afterPaintEffects.shift())) {\n\t\tconst hooks = component.__hooks;\n\t\tif (!component._parentDom || !hooks) continue;\n\t\ttry {\n\t\t\thooks._pendingEffects.some(invokeCleanup);\n\t\t\thooks._pendingEffects.some(invokeEffect);\n\t\t\thooks._pendingEffects = [];\n\t\t} catch (e) {\n\t\t\thooks._pendingEffects = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t}\n}\n\nlet HAS_RAF = typeof requestAnimationFrame == 'function';\n\n/**\n * Schedule a callback to be invoked after the browser has a chance to paint a new frame.\n * Do this by combining requestAnimationFrame (rAF) + setTimeout to invoke a callback after\n * the next browser frame.\n *\n * Also, schedule a timeout in parallel to the the rAF to ensure the callback is invoked\n * even if RAF doesn't fire (for example if the browser tab is not visible)\n *\n * @param {() => void} callback\n */\nfunction afterNextFrame(callback) {\n\tconst done = () => {\n\t\tclearTimeout(timeout);\n\t\tif (HAS_RAF) cancelAnimationFrame(raf);\n\t\tsetTimeout(callback);\n\t};\n\tconst timeout = setTimeout(done, RAF_TIMEOUT);\n\n\tlet raf;\n\tif (HAS_RAF) {\n\t\traf = requestAnimationFrame(done);\n\t}\n}\n\n// Note: if someone used options.debounceRendering = requestAnimationFrame,\n// then effects will ALWAYS run on the NEXT frame instead of the current one, incurring a ~16ms delay.\n// Perhaps this is not such a big deal.\n/**\n * Schedule afterPaintEffects flush after the browser paints\n * @param {number} newQueueLength\n * @returns {void}\n */\nfunction afterPaint(newQueueLength) {\n\tif (newQueueLength === 1 || prevRaf !== options.requestAnimationFrame) {\n\t\tprevRaf = options.requestAnimationFrame;\n\t\t(prevRaf || afterNextFrame)(flushAfterPaintEffects);\n\t}\n}\n\n/**\n * @param {import('./internal').HookState} hook\n * @returns {void}\n */\nfunction invokeCleanup(hook) {\n\t// A hook cleanup can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\tlet cleanup = hook._cleanup;\n\tif (typeof cleanup == 'function') {\n\t\thook._cleanup = undefined;\n\t\tcleanup();\n\t}\n\n\tcurrentComponent = comp;\n}\n\n/**\n * Invoke a Hook's effect\n * @param {import('./internal').EffectHookState} hook\n * @returns {void}\n */\nfunction invokeEffect(hook) {\n\t// A hook call can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\thook._cleanup = hook._value();\n\tcurrentComponent = comp;\n}\n\n/**\n * @param {unknown[]} oldArgs\n * @param {unknown[]} newArgs\n * @returns {boolean}\n */\nfunction argsChanged(oldArgs, newArgs) {\n\treturn (\n\t\t!oldArgs ||\n\t\toldArgs.length !== newArgs.length ||\n\t\tnewArgs.some((arg, index) => arg !== oldArgs[index])\n\t);\n}\n\n/**\n * @template Arg\n * @param {Arg} arg\n * @param {(arg: Arg) => any} f\n * @returns {any}\n */\nfunction invokeOrReturn(arg, f) {\n\treturn typeof f == 'function' ? f(arg) : f;\n}\n"],"names":["currentIndex","currentComponent","previousComponent","prevRaf","currentHook","afterPaintEffects","options","_options","oldBeforeDiff","__b","oldBeforeRender","__r","oldAfterDiff","diffed","oldCommit","__c","oldBeforeUnmount","unmount","oldRoot","__","getHookState","index","type","__h","hooks","__H","length","push","useState","initialState","useReducer","invokeOrReturn","reducer","init","hookState","_reducer","undefined","action","currentValue","__N","nextValue","setState","__f","updateHookState","p","s","c","stateHooks","filter","x","every","prevScu","call","this","shouldUpdate","props","some","hookItem","shouldComponentUpdate","prevCWU","componentWillUpdate","__e","tmp","useEffect","callback","args","state","__s","argsChanged","_pendingArgs","useLayoutEffect","useRef","initialValue","useMemo","current","useImperativeHandle","ref","createHandle","result","concat","factory","useCallback","useContext","context","provider","sub","value","useDebugValue","formatter","useErrorBoundary","cb","errState","componentDidCatch","err","errorInfo","useId","root","__v","__m","mask","flushAfterPaintEffects","component","shift","__P","invokeCleanup","invokeEffect","e","vnode","parentDom","__k","requestAnimationFrame","afterNextFrame","commitQueue","hasErrored","HAS_RAF","raf","done","clearTimeout","timeout","cancelAnimationFrame","setTimeout","hook","comp","cleanup","oldArgs","newArgs","arg","f"],"mappings":"iCAGA,IAAIA,EAGAC,EAGAC,EAsBAC,EAnBAC,EAAc,EAGdC,EAAoB,GAGlBC,EAAuDC,EAEzDC,EAAgBF,EAAOG,IACvBC,EAAkBJ,EAAOK,IACzBC,EAAeN,EAAQO,OACvBC,EAAYR,EAAOS,IACnBC,EAAmBV,EAAQW,QAC3BC,EAAUZ,EAAOa,GAiHrB,SAASC,EAAaC,EAAOC,GACxBhB,EAAOiB,KACVjB,EAAOiB,IAAOtB,EAAkBoB,EAAOjB,GAAekB,GAEvDlB,EAAc,EAOd,IAAMoB,EACLvB,EAAgBwB,MACfxB,EAAgBwB,IAAW,CAC3BN,GAAO,GACPI,IAAiB,KAOnB,OAJIF,GAASG,EAAKL,GAAOO,QACxBF,EAAKL,GAAOQ,KAAK,CAAE,GAGbH,EAAKL,GAAOE,EACpB,CAOgB,SAAAO,EAASC,GAExB,OADAzB,EAAc,EACP0B,EAAWC,EAAgBF,EACnC,CAUO,SAASC,EAAWE,EAASH,EAAcI,GAEjD,IAAMC,EAAYd,EAAapB,IAAgB,GAE/C,GADAkC,EAAUC,EAAWH,GAChBE,EAASnB,MACbmB,EAASf,GAAU,CACjBc,EAAiDA,EAAKJ,GAA/CE,OAAeK,EAAWP,GAElC,SAAAQ,GACC,IAAMC,EAAeJ,EAASK,IAC3BL,EAASK,IAAY,GACrBL,EAASf,GAAQ,GACdqB,EAAYN,EAAUC,EAASG,EAAcD,GAE/CC,IAAiBE,IACpBN,EAASK,IAAc,CAACC,EAAWN,EAASf,GAAQ,IACpDe,EAASnB,IAAY0B,SAAS,CAAE,GAElC,GAGDP,EAASnB,IAAcd,GAElBA,EAAgByC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3F,GAAkBA,EAAiB2F,GAEvC,IAEKM,EAFCnE,EAAI6D,EAAK5F,IACX+B,GAAKA,EAACrB,MAETqB,EAACrB,IAAAN,GAAeqC,KAAK,SAAAX,GACpB,IACC2D,EAAc3D,EAGf,CAFE,MAAO6D,GACRO,EAAaP,CACd,CACD,GACA5D,EAACrB,SAAWW,EACR6E,GAAY3G,EAAOuD,IAAaoD,EAAYnE,EAACmD,KAEnD,EA4UA,IAAIiB,EAA0C,mBAAzBJ,sBAYrB,SAASC,EAAe/C,GACvB,IAOImD,EAPEC,EAAO,WACZC,aAAaC,GACTJ,GAASK,qBAAqBJ,GAClCK,WAAWxD,EACZ,EACMsD,EAAUE,WAAWJ,EAlcR,IAqcfF,IACHC,EAAML,sBAAsBM,GAE9B,CAqBA,SAASZ,EAAciB,GAGtB,IAAMC,EAAOzH,EACT0H,EAAUF,EAAI1G,IACI,mBAAX4G,IACVF,EAAI1G,SAAYqB,EAChBuF,KAGD1H,EAAmByH,CACpB,CAOA,SAASjB,EAAagB,GAGrB,IAAMC,EAAOzH,EACbwH,EAAI1G,IAAY0G,EAAItG,KACpBlB,EAAmByH,CACpB,CAOA,SAAStD,EAAYwD,EAASC,GAC7B,OACED,GACDA,EAAQlG,SAAWmG,EAAQnG,QAC3BmG,EAAQrE,KAAK,SAACsE,EAAKzG,GAAU,OAAAyG,IAAQF,EAAQvG,EAAM,EAErD,CAQA,SAASU,EAAe+F,EAAKC,GAC5B,MAAmB,mBAALA,EAAkBA,EAAED,GAAOC,CAC1C"} \ No newline at end of file diff --git a/node_modules/preact/hooks/dist/hooks.umd.js b/node_modules/preact/hooks/dist/hooks.umd.js new file mode 100644 index 0000000000000000000000000000000000000000..36be2aede556a9629a8c31deee48de0d90737e16 --- /dev/null +++ b/node_modules/preact/hooks/dist/hooks.umd.js @@ -0,0 +1,2 @@ +!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("preact")):"function"==typeof define&&define.amd?define(["exports","preact"],t):t((n||self).preactHooks={},n.preact)}(this,function(n,t){var u,r,i,o,f=0,c=[],e=t.options,a=e.__b,v=e.__r,l=e.diffed,d=e.__c,s=e.unmount,p=e.__;function y(n,t){e.__h&&e.__h(r,n,f||t),f=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function h(n){return f=1,m(j,n)}function m(n,t,i){var o=y(u++,2);if(o.t=n,!o.__c&&(o.__=[i?i(t):j(void 0,t),function(n){var t=o.__N?o.__N[0]:o.__[0],u=o.t(t,n);t!==u&&(o.__N=[u,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.__f)){var f=function(n,t,u){if(!o.__c.__H)return!0;var r=o.__c.__H.__.filter(function(n){return n.__c});if(r.every(function(n){return!n.__N}))return!c||c.call(this,n,t,u);var i=o.__c.props!==n;return r.some(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),c&&c.call(this,n,t,u)||i};r.__f=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,u){if(this.__e){var r=c;c=void 0,f(n,t,u),c=r}e&&e.call(this,n,t,u)},r.shouldComponentUpdate=f}return o.__N||o.__}function T(n,t){var i=y(u++,4);!e.__s&&g(i.__H,t)&&(i.__=n,i.u=t,r.__h.push(i))}function _(n,t){var r=y(u++,7);return g(r.__H,t)&&(r.__=n(),r.__H=t,r.__h=n),r.__}function b(){for(var n;n=c.shift();){var t=n.__H;if(n.__P&&t)try{t.__h.some(A),t.__h.some(F),t.__h=[]}catch(u){t.__h=[],e.__e(u,n.__v)}}}e.__b=function(n){r=null,a&&a(n)},e.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),p&&p(n,t)},e.__r=function(n){v&&v(n),u=0;var t=(r=n.__c).__H;t&&(i===r?(t.__h=[],r.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(A),t.__h.some(F),t.__h=[],u=0)),i=r},e.diffed=function(n){l&&l(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==c.push(t)&&o===e.requestAnimationFrame||((o=e.requestAnimationFrame)||x)(b)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),i=r=null},e.__c=function(n,t){t.some(function(n){try{n.__h.some(A),n.__h=n.__h.filter(function(n){return!n.__||F(n)})}catch(u){t.some(function(n){n.__h&&(n.__h=[])}),t=[],e.__e(u,n.__v)}}),d&&d(n,t)},e.unmount=function(n){s&&s(n);var t,u=n.__c;u&&u.__H&&(u.__H.__.some(function(n){try{A(n)}catch(n){t=n}}),u.__H=void 0,t&&e.__e(t,u.__v))};var q="function"==typeof requestAnimationFrame;function x(n){var t,u=function(){clearTimeout(r),q&&cancelAnimationFrame(t),setTimeout(n)},r=setTimeout(u,35);q&&(t=requestAnimationFrame(u))}function A(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t}function F(n){var t=r;n.__c=n.__(),r=t}function g(n,t){return!n||n.length!==t.length||t.some(function(t,u){return t!==n[u]})}function j(n,t){return"function"==typeof t?t(n):t}n.useCallback=function(n,t){return f=8,_(function(){return n},t)},n.useContext=function(n){var t=r.context[n.__c],i=y(u++,9);return i.c=n,t?(null==i.__&&(i.__=!0,t.sub(r)),t.props.value):n.__},n.useDebugValue=function(n,t){e.useDebugValue&&e.useDebugValue(t?t(n):n)},n.useEffect=function(n,t){var i=y(u++,3);!e.__s&&g(i.__H,t)&&(i.__=n,i.u=t,r.__H.__h.push(i))},n.useErrorBoundary=function(n){var t=y(u++,10),i=h();return t.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,u){t.__&&t.__(n,u),i[1](n)}),[i[0],function(){i[1](void 0)}]},n.useId=function(){var n=y(u++,11);if(!n.__){for(var t=r.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var i=t.__m||(t.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__},n.useImperativeHandle=function(n,t,u){f=6,T(function(){if("function"==typeof n){var u=n(t());return function(){n(null),u&&"function"==typeof u&&u()}}if(n)return n.current=t(),function(){return n.current=null}},null==u?u:u.concat(n))},n.useLayoutEffect=T,n.useMemo=_,n.useReducer=m,n.useRef=function(n){return f=5,_(function(){return{current:n}},[])},n.useState=h}); +//# sourceMappingURL=hooks.umd.js.map diff --git a/node_modules/preact/hooks/dist/hooks.umd.js.map b/node_modules/preact/hooks/dist/hooks.umd.js.map new file mode 100644 index 0000000000000000000000000000000000000000..71bda7013bd68f465a5cfeb7c5370783c157ee94 --- /dev/null +++ b/node_modules/preact/hooks/dist/hooks.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"hooks.umd.js","sources":["../src/index.js"],"sourcesContent":["import { options as _options } from 'preact';\n\n/** @type {number} */\nlet currentIndex;\n\n/** @type {import('./internal').Component} */\nlet currentComponent;\n\n/** @type {import('./internal').Component} */\nlet previousComponent;\n\n/** @type {number} */\nlet currentHook = 0;\n\n/** @type {Array} */\nlet afterPaintEffects = [];\n\n// Cast to use internal Options type\nconst options = /** @type {import('./internal').Options} */ (_options);\n\nlet oldBeforeDiff = options._diff;\nlet oldBeforeRender = options._render;\nlet oldAfterDiff = options.diffed;\nlet oldCommit = options._commit;\nlet oldBeforeUnmount = options.unmount;\nlet oldRoot = options._root;\n\n// We take the minimum timeout for requestAnimationFrame to ensure that\n// the callback is invoked after the next frame. 35ms is based on a 30hz\n// refresh rate, which is the minimum rate for a smooth user experience.\nconst RAF_TIMEOUT = 35;\nlet prevRaf;\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._diff = vnode => {\n\tcurrentComponent = null;\n\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n};\n\noptions._root = (vnode, parentDom) => {\n\tif (vnode && parentDom._children && parentDom._children._mask) {\n\t\tvnode._mask = parentDom._children._mask;\n\t}\n\n\tif (oldRoot) oldRoot(vnode, parentDom);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._render = vnode => {\n\tif (oldBeforeRender) oldBeforeRender(vnode);\n\n\tcurrentComponent = vnode._component;\n\tcurrentIndex = 0;\n\n\tconst hooks = currentComponent.__hooks;\n\tif (hooks) {\n\t\tif (previousComponent === currentComponent) {\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentComponent._renderCallbacks = [];\n\t\t\thooks._list.some(hookItem => {\n\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t}\n\t\t\t\thookItem._pendingArgs = hookItem._nextValue = undefined;\n\t\t\t});\n\t\t} else {\n\t\t\thooks._pendingEffects.some(invokeCleanup);\n\t\t\thooks._pendingEffects.some(invokeEffect);\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentIndex = 0;\n\t\t}\n\t}\n\tpreviousComponent = currentComponent;\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.diffed = vnode => {\n\tif (oldAfterDiff) oldAfterDiff(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tif (c.__hooks._pendingEffects.length) afterPaint(afterPaintEffects.push(c));\n\t\tc.__hooks._list.some(hookItem => {\n\t\t\tif (hookItem._pendingArgs) {\n\t\t\t\thookItem._args = hookItem._pendingArgs;\n\t\t\t}\n\t\t\thookItem._pendingArgs = undefined;\n\t\t});\n\t}\n\tpreviousComponent = currentComponent = null;\n};\n\n// TODO: Improve typing of commitQueue parameter\n/** @type {(vnode: import('./internal').VNode, commitQueue: any) => void} */\noptions._commit = (vnode, commitQueue) => {\n\tcommitQueue.some(component => {\n\t\ttry {\n\t\t\tcomponent._renderCallbacks.some(invokeCleanup);\n\t\t\tcomponent._renderCallbacks = component._renderCallbacks.filter(cb =>\n\t\t\t\tcb._value ? invokeEffect(cb) : true\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tcommitQueue.some(c => {\n\t\t\t\tif (c._renderCallbacks) c._renderCallbacks = [];\n\t\t\t});\n\t\t\tcommitQueue = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t});\n\n\tif (oldCommit) oldCommit(vnode, commitQueue);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.unmount = vnode => {\n\tif (oldBeforeUnmount) oldBeforeUnmount(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tlet hasErrored;\n\t\tc.__hooks._list.some(s => {\n\t\t\ttry {\n\t\t\t\tinvokeCleanup(s);\n\t\t\t} catch (e) {\n\t\t\t\thasErrored = e;\n\t\t\t}\n\t\t});\n\t\tc.__hooks = undefined;\n\t\tif (hasErrored) options._catchError(hasErrored, c._vnode);\n\t}\n};\n\n/**\n * Get a hook's state from the currentComponent\n * @param {number} index The index of the hook to get\n * @param {number} type The index of the hook to get\n * @returns {any}\n */\nfunction getHookState(index, type) {\n\tif (options._hook) {\n\t\toptions._hook(currentComponent, index, currentHook || type);\n\t}\n\tcurrentHook = 0;\n\n\t// Largely inspired by:\n\t// * https://github.com/michael-klein/funcy.js/blob/f6be73468e6ec46b0ff5aa3cc4c9baf72a29025a/src/hooks/core_hooks.mjs\n\t// * https://github.com/michael-klein/funcy.js/blob/650beaa58c43c33a74820a3c98b3c7079cf2e333/src/renderer.mjs\n\t// Other implementations to look at:\n\t// * https://codesandbox.io/s/mnox05qp8\n\tconst hooks =\n\t\tcurrentComponent.__hooks ||\n\t\t(currentComponent.__hooks = {\n\t\t\t_list: [],\n\t\t\t_pendingEffects: []\n\t\t});\n\n\tif (index >= hooks._list.length) {\n\t\thooks._list.push({});\n\t}\n\n\treturn hooks._list[index];\n}\n\n/**\n * @template {unknown} S\n * @param {import('./index').Dispatch>} [initialState]\n * @returns {[S, (state: S) => void]}\n */\nexport function useState(initialState) {\n\tcurrentHook = 1;\n\treturn useReducer(invokeOrReturn, initialState);\n}\n\n/**\n * @template {unknown} S\n * @template {unknown} A\n * @param {import('./index').Reducer} reducer\n * @param {import('./index').Dispatch>} initialState\n * @param {(initialState: any) => void} [init]\n * @returns {[ S, (state: S) => void ]}\n */\nexport function useReducer(reducer, initialState, init) {\n\t/** @type {import('./internal').ReducerHookState} */\n\tconst hookState = getHookState(currentIndex++, 2);\n\thookState._reducer = reducer;\n\tif (!hookState._component) {\n\t\thookState._value = [\n\t\t\t!init ? invokeOrReturn(undefined, initialState) : init(initialState),\n\n\t\t\taction => {\n\t\t\t\tconst currentValue = hookState._nextValue\n\t\t\t\t\t? hookState._nextValue[0]\n\t\t\t\t\t: hookState._value[0];\n\t\t\t\tconst nextValue = hookState._reducer(currentValue, action);\n\n\t\t\t\tif (currentValue !== nextValue) {\n\t\t\t\t\thookState._nextValue = [nextValue, hookState._value[1]];\n\t\t\t\t\thookState._component.setState({});\n\t\t\t\t}\n\t\t\t}\n\t\t];\n\n\t\thookState._component = currentComponent;\n\n\t\tif (!currentComponent._hasScuFromHooks) {\n\t\t\tcurrentComponent._hasScuFromHooks = true;\n\t\t\tlet prevScu = currentComponent.shouldComponentUpdate;\n\t\t\tconst prevCWU = currentComponent.componentWillUpdate;\n\n\t\t\t// If we're dealing with a forced update `shouldComponentUpdate` will\n\t\t\t// not be called. But we use that to update the hook values, so we\n\t\t\t// need to call it.\n\t\t\tcurrentComponent.componentWillUpdate = function (p, s, c) {\n\t\t\t\tif (this._force) {\n\t\t\t\t\tlet tmp = prevScu;\n\t\t\t\t\t// Clear to avoid other sCU hooks from being called\n\t\t\t\t\tprevScu = undefined;\n\t\t\t\t\tupdateHookState(p, s, c);\n\t\t\t\t\tprevScu = tmp;\n\t\t\t\t}\n\n\t\t\t\tif (prevCWU) prevCWU.call(this, p, s, c);\n\t\t\t};\n\n\t\t\t// This SCU has the purpose of bailing out after repeated updates\n\t\t\t// to stateful hooks.\n\t\t\t// we store the next value in _nextValue[0] and keep doing that for all\n\t\t\t// state setters, if we have next states and\n\t\t\t// all next states within a component end up being equal to their original state\n\t\t\t// we are safe to bail out for this specific component.\n\t\t\t/**\n\t\t\t *\n\t\t\t * @type {import('./internal').Component[\"shouldComponentUpdate\"]}\n\t\t\t */\n\t\t\t// @ts-ignore - We don't use TS to downtranspile\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction updateHookState(p, s, c) {\n\t\t\t\tif (!hookState._component.__hooks) return true;\n\n\t\t\t\tconst stateHooks = hookState._component.__hooks._list.filter(\n\t\t\t\t\tx => x._component\n\t\t\t\t);\n\n\t\t\t\tconst allHooksEmpty = stateHooks.every(x => !x._nextValue);\n\t\t\t\t// When we have no updated hooks in the component we invoke the previous SCU or\n\t\t\t\t// traverse the VDOM tree further.\n\t\t\t\tif (allHooksEmpty) {\n\t\t\t\t\treturn prevScu ? prevScu.call(this, p, s, c) : true;\n\t\t\t\t}\n\n\t\t\t\t// We check whether we have components with a nextValue set that\n\t\t\t\t// have values that aren't equal to one another this pushes\n\t\t\t\t// us to update further down the tree\n\t\t\t\tlet shouldUpdate = hookState._component.props !== p;\n\t\t\t\tstateHooks.some(hookItem => {\n\t\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\t\tconst currentValue = hookItem._value[0];\n\t\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t\t\thookItem._nextValue = undefined;\n\t\t\t\t\t\tif (currentValue !== hookItem._value[0]) shouldUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn prevScu\n\t\t\t\t\t? prevScu.call(this, p, s, c) || shouldUpdate\n\t\t\t\t\t: shouldUpdate;\n\t\t\t}\n\n\t\t\tcurrentComponent.shouldComponentUpdate = updateHookState;\n\t\t}\n\t}\n\n\treturn hookState._nextValue || hookState._value;\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 3);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent.__hooks._pendingEffects.push(state);\n\t}\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useLayoutEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 4);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent._renderCallbacks.push(state);\n\t}\n}\n\n/** @type {(initialValue: unknown) => unknown} */\nexport function useRef(initialValue) {\n\tcurrentHook = 5;\n\treturn useMemo(() => ({ current: initialValue }), []);\n}\n\n/**\n * @param {object} ref\n * @param {() => object} createHandle\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useImperativeHandle(ref, createHandle, args) {\n\tcurrentHook = 6;\n\tuseLayoutEffect(\n\t\t() => {\n\t\t\tif (typeof ref == 'function') {\n\t\t\t\tconst result = ref(createHandle());\n\t\t\t\treturn () => {\n\t\t\t\t\tref(null);\n\t\t\t\t\tif (result && typeof result == 'function') result();\n\t\t\t\t};\n\t\t\t} else if (ref) {\n\t\t\t\tref.current = createHandle();\n\t\t\t\treturn () => (ref.current = null);\n\t\t\t}\n\t\t},\n\t\targs == null ? args : args.concat(ref)\n\t);\n}\n\n/**\n * @template {unknown} T\n * @param {() => T} factory\n * @param {unknown[]} args\n * @returns {T}\n */\nexport function useMemo(factory, args) {\n\t/** @type {import('./internal').MemoHookState} */\n\tconst state = getHookState(currentIndex++, 7);\n\tif (argsChanged(state._args, args)) {\n\t\tstate._value = factory();\n\t\tstate._args = args;\n\t\tstate._factory = factory;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * @param {() => void} callback\n * @param {unknown[]} args\n * @returns {() => void}\n */\nexport function useCallback(callback, args) {\n\tcurrentHook = 8;\n\treturn useMemo(() => callback, args);\n}\n\n/**\n * @param {import('./internal').PreactContext} context\n */\nexport function useContext(context) {\n\tconst provider = currentComponent.context[context._id];\n\t// We could skip this call here, but than we'd not call\n\t// `options._hook`. We need to do that in order to make\n\t// the devtools aware of this hook.\n\t/** @type {import('./internal').ContextHookState} */\n\tconst state = getHookState(currentIndex++, 9);\n\t// The devtools needs access to the context object to\n\t// be able to pull of the default value when no provider\n\t// is present in the tree.\n\tstate._context = context;\n\tif (!provider) return context._defaultValue;\n\t// This is probably not safe to convert to \"!\"\n\tif (state._value == null) {\n\t\tstate._value = true;\n\t\tprovider.sub(currentComponent);\n\t}\n\treturn provider.props.value;\n}\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {(value: T, cb?: (value: T) => string | number) => void}\n */\nexport function useDebugValue(value, formatter) {\n\tif (options.useDebugValue) {\n\t\toptions.useDebugValue(\n\t\t\tformatter ? formatter(value) : /** @type {any}*/ (value)\n\t\t);\n\t}\n}\n\n/**\n * @param {(error: unknown, errorInfo: import('preact').ErrorInfo) => void} cb\n * @returns {[unknown, () => void]}\n */\nexport function useErrorBoundary(cb) {\n\t/** @type {import('./internal').ErrorBoundaryHookState} */\n\tconst state = getHookState(currentIndex++, 10);\n\tconst errState = useState();\n\tstate._value = cb;\n\tif (!currentComponent.componentDidCatch) {\n\t\tcurrentComponent.componentDidCatch = (err, errorInfo) => {\n\t\t\tif (state._value) state._value(err, errorInfo);\n\t\t\terrState[1](err);\n\t\t};\n\t}\n\treturn [\n\t\terrState[0],\n\t\t() => {\n\t\t\terrState[1](undefined);\n\t\t}\n\t];\n}\n\n/** @type {() => string} */\nexport function useId() {\n\t/** @type {import('./internal').IdHookState} */\n\tconst state = getHookState(currentIndex++, 11);\n\tif (!state._value) {\n\t\t// Grab either the root node or the nearest async boundary node.\n\t\t/** @type {import('./internal').VNode} */\n\t\tlet root = currentComponent._vnode;\n\t\twhile (root !== null && !root._mask && root._parent !== null) {\n\t\t\troot = root._parent;\n\t\t}\n\n\t\tlet mask = root._mask || (root._mask = [0, 0]);\n\t\tstate._value = 'P' + mask[0] + '-' + mask[1]++;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * After paint effects consumer.\n */\nfunction flushAfterPaintEffects() {\n\tlet component;\n\twhile ((component = afterPaintEffects.shift())) {\n\t\tconst hooks = component.__hooks;\n\t\tif (!component._parentDom || !hooks) continue;\n\t\ttry {\n\t\t\thooks._pendingEffects.some(invokeCleanup);\n\t\t\thooks._pendingEffects.some(invokeEffect);\n\t\t\thooks._pendingEffects = [];\n\t\t} catch (e) {\n\t\t\thooks._pendingEffects = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t}\n}\n\nlet HAS_RAF = typeof requestAnimationFrame == 'function';\n\n/**\n * Schedule a callback to be invoked after the browser has a chance to paint a new frame.\n * Do this by combining requestAnimationFrame (rAF) + setTimeout to invoke a callback after\n * the next browser frame.\n *\n * Also, schedule a timeout in parallel to the the rAF to ensure the callback is invoked\n * even if RAF doesn't fire (for example if the browser tab is not visible)\n *\n * @param {() => void} callback\n */\nfunction afterNextFrame(callback) {\n\tconst done = () => {\n\t\tclearTimeout(timeout);\n\t\tif (HAS_RAF) cancelAnimationFrame(raf);\n\t\tsetTimeout(callback);\n\t};\n\tconst timeout = setTimeout(done, RAF_TIMEOUT);\n\n\tlet raf;\n\tif (HAS_RAF) {\n\t\traf = requestAnimationFrame(done);\n\t}\n}\n\n// Note: if someone used options.debounceRendering = requestAnimationFrame,\n// then effects will ALWAYS run on the NEXT frame instead of the current one, incurring a ~16ms delay.\n// Perhaps this is not such a big deal.\n/**\n * Schedule afterPaintEffects flush after the browser paints\n * @param {number} newQueueLength\n * @returns {void}\n */\nfunction afterPaint(newQueueLength) {\n\tif (newQueueLength === 1 || prevRaf !== options.requestAnimationFrame) {\n\t\tprevRaf = options.requestAnimationFrame;\n\t\t(prevRaf || afterNextFrame)(flushAfterPaintEffects);\n\t}\n}\n\n/**\n * @param {import('./internal').HookState} hook\n * @returns {void}\n */\nfunction invokeCleanup(hook) {\n\t// A hook cleanup can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\tlet cleanup = hook._cleanup;\n\tif (typeof cleanup == 'function') {\n\t\thook._cleanup = undefined;\n\t\tcleanup();\n\t}\n\n\tcurrentComponent = comp;\n}\n\n/**\n * Invoke a Hook's effect\n * @param {import('./internal').EffectHookState} hook\n * @returns {void}\n */\nfunction invokeEffect(hook) {\n\t// A hook call can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\thook._cleanup = hook._value();\n\tcurrentComponent = comp;\n}\n\n/**\n * @param {unknown[]} oldArgs\n * @param {unknown[]} newArgs\n * @returns {boolean}\n */\nfunction argsChanged(oldArgs, newArgs) {\n\treturn (\n\t\t!oldArgs ||\n\t\toldArgs.length !== newArgs.length ||\n\t\tnewArgs.some((arg, index) => arg !== oldArgs[index])\n\t);\n}\n\n/**\n * @template Arg\n * @param {Arg} arg\n * @param {(arg: Arg) => any} f\n * @returns {any}\n */\nfunction invokeOrReturn(arg, f) {\n\treturn typeof f == 'function' ? f(arg) : f;\n}\n"],"names":["currentIndex","currentComponent","previousComponent","prevRaf","currentHook","afterPaintEffects","options","_options","oldBeforeDiff","__b","oldBeforeRender","__r","oldAfterDiff","diffed","oldCommit","__c","oldBeforeUnmount","unmount","oldRoot","__","getHookState","index","type","__h","hooks","__H","length","push","useState","initialState","useReducer","invokeOrReturn","reducer","init","hookState","_reducer","undefined","action","currentValue","__N","nextValue","setState","__f","updateHookState","p","s","c","stateHooks","filter","x","every","prevScu","call","this","shouldUpdate","props","some","hookItem","shouldComponentUpdate","prevCWU","componentWillUpdate","__e","tmp","useLayoutEffect","callback","args","state","__s","argsChanged","_pendingArgs","useMemo","factory","flushAfterPaintEffects","component","shift","__P","invokeCleanup","invokeEffect","e","__v","vnode","parentDom","__k","__m","requestAnimationFrame","afterNextFrame","commitQueue","cb","hasErrored","HAS_RAF","raf","done","clearTimeout","timeout","cancelAnimationFrame","setTimeout","hook","comp","cleanup","oldArgs","newArgs","arg","f","context","provider","sub","value","formatter","useDebugValue","errState","componentDidCatch","err","errorInfo","root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AM8B,EAAQ9C,EAAapB,IAAgB,IAC3C,IAAKkE,EAAK/C,GAAS,CAIlB,IADA,IAAI8F,EAAOhH,EAAgB8E,IACX,OAATkC,IAAkBA,EAAI9B,KAA2B,OAAjB8B,EAAI9F,IAC1C8F,EAAOA,EAAI9F,GAGZ,IAAI+F,EAAOD,EAAI9B,MAAW8B,EAAI9B,IAAS,CAAC,EAAG,IAC3CjB,EAAK/C,GAAU,IAAM+F,EAAK,GAAK,IAAMA,EAAK,IAC3C,CAEA,OAAOhD,EAAK/C,EACb,wBA1HgB,SAAoBgG,EAAKC,EAAcnD,GACtD7D,EAAc,EACd2D,EACC,WACC,GAAkB,mBAAPoD,EAAmB,CAC7B,IAAME,EAASF,EAAIC,KACnB,OAAa,WACZD,EAAI,MACAE,GAA2B,mBAAVA,GAAsBA,GAC5C,CACD,CAAWF,GAAAA,EAEV,OADAA,EAAIG,QAAUF,IACP,WAAA,OAAOD,EAAIG,QAAU,IAAI,CAElC,EACQ,MAARrD,EAAeA,EAAOA,EAAKsD,OAAOJ,GAEpC,0DA5BO,SAAgBK,GAEtB,OADApH,EAAc,EACPkE,EAAQ,WAAO,MAAA,CAAEgD,QAASE,EAAc,EAAG,GACnD"} \ No newline at end of file diff --git a/node_modules/preact/hooks/package.json b/node_modules/preact/hooks/package.json new file mode 100644 index 0000000000000000000000000000000000000000..787927573e95500078cf423711fa07ddbead37f1 --- /dev/null +++ b/node_modules/preact/hooks/package.json @@ -0,0 +1,35 @@ +{ + "name": "preact-hooks", + "amdName": "preactHooks", + "version": "0.1.0", + "private": true, + "description": "Hook addon for Preact", + "main": "dist/hooks.js", + "module": "dist/hooks.module.js", + "umd:main": "dist/hooks.umd.js", + "source": "src/index.js", + "license": "MIT", + "types": "src/index.d.ts", + "scripts": { + "build": "microbundle build --raw", + "dev": "microbundle watch --raw --format cjs", + "test": "npm-run-all build --parallel test:karma", + "test:karma": "karma start test/karma.conf.js --single-run", + "test:karma:watch": "karma start test/karma.conf.js --no-single-run" + }, + "peerDependencies": { + "preact": "^10.0.0" + }, + "mangle": { + "regex": "^_" + }, + "exports": { + ".": { + "types": "./src/index.d.ts", + "browser": "./dist/hooks.module.js", + "umd": "./dist/hooks.umd.js", + "import": "./dist/hooks.mjs", + "require": "./dist/hooks.js" + } + } +} diff --git a/node_modules/preact/hooks/src/index.d.ts b/node_modules/preact/hooks/src/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d7f77dbb49fb3f74d1675278766c54a6743d0e84 --- /dev/null +++ b/node_modules/preact/hooks/src/index.d.ts @@ -0,0 +1,145 @@ +// Intentionally not using a relative path to take advantage of +// the TS version resolution mechanism +import { ErrorInfo, PreactContext, Ref, RefObject } from 'preact'; + +type Inputs = ReadonlyArray; + +export type Dispatch = (value: A) => void; +export type StateUpdater = S | ((prevState: S) => S); + +/** + * Returns a stateful value, and a function to update it. + * @param initialState The initial value (or a function that returns the initial value) + */ +export function useState( + initialState: S | (() => S) +): [S, Dispatch>]; + +export function useState(): [ + S | undefined, + Dispatch> +]; + +export type Reducer = (prevState: S, action: A) => S; + +/** + * An alternative to `useState`. + * + * `useReducer` is usually preferable to `useState` when you have complex state logic that involves + * multiple sub-values. It also lets you optimize performance for components that trigger deep + * updates because you can pass `dispatch` down instead of callbacks. + * @param reducer Given the current state and an action, returns the new state + * @param initialState The initial value to store as state + */ +export function useReducer( + reducer: Reducer, + initialState: S +): [S, Dispatch]; + +/** + * An alternative to `useState`. + * + * `useReducer` is usually preferable to `useState` when you have complex state logic that involves + * multiple sub-values. It also lets you optimize performance for components that trigger deep + * updates because you can pass `dispatch` down instead of callbacks. + * @param reducer Given the current state and an action, returns the new state + * @param initialArg The initial argument to pass to the `init` function + * @param init A function that, given the `initialArg`, returns the initial value to store as state + */ +export function useReducer( + reducer: Reducer, + initialArg: I, + init: (arg: I) => S +): [S, Dispatch]; + +/** @deprecated Use the `Ref` type instead. */ +type PropRef = MutableRef; + +interface MutableRef { + current: T; +} + +/** + * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument + * (`initialValue`). The returned object will persist for the full lifetime of the component. + * + * Note that `useRef()` is useful for more than the `ref` attribute. It’s handy for keeping any mutable + * value around similar to how you’d use instance fields in classes. + * + * @param initialValue the initial value to store in the ref object + */ +export function useRef(initialValue: T): MutableRef; +export function useRef(initialValue: T | null): RefObject; +export function useRef(): MutableRef; + +type EffectCallback = () => void | (() => void); +/** + * Accepts a function that contains imperative, possibly effectful code. + * The effects run after browser paint, without blocking it. + * + * @param effect Imperative function that can return a cleanup function + * @param inputs If present, effect will only activate if the values in the list change (using ===). + */ +export function useEffect(effect: EffectCallback, inputs?: Inputs): void; + +type CreateHandle = () => object; + +/** + * @param ref The ref that will be mutated + * @param create The function that will be executed to get the value that will be attached to + * ref.current + * @param inputs If present, effect will only activate if the values in the list change (using ===). + */ +export function useImperativeHandle( + ref: Ref, + create: () => R, + inputs?: Inputs +): void; + +/** + * Accepts a function that contains imperative, possibly effectful code. + * Use this to read layout from the DOM and synchronously re-render. + * Updates scheduled inside `useLayoutEffect` will be flushed synchronously, after all DOM mutations but before the browser has a chance to paint. + * Prefer the standard `useEffect` hook when possible to avoid blocking visual updates. + * + * @param effect Imperative function that can return a cleanup function + * @param inputs If present, effect will only activate if the values in the list change (using ===). + */ +export function useLayoutEffect(effect: EffectCallback, inputs?: Inputs): void; + +/** + * Returns a memoized version of the callback that only changes if one of the `inputs` + * has changed (using ===). + */ +export function useCallback(callback: T, inputs: Inputs): T; + +/** + * Pass a factory function and an array of inputs. + * useMemo will only recompute the memoized value when one of the inputs has changed. + * This optimization helps to avoid expensive calculations on every render. + * If no array is provided, a new value will be computed whenever a new function instance is passed as the first argument. + */ +// for `inputs`, allow undefined, but don't make it optional as that is very likely a mistake +export function useMemo(factory: () => T, inputs: Inputs | undefined): T; + +/** + * Returns the current context value, as given by the nearest context provider for the given context. + * When the provider updates, this Hook will trigger a rerender with the latest context value. + * + * @param context The context you want to use + */ +export function useContext(context: PreactContext): T; + +/** + * Customize the displayed value in the devtools panel. + * + * @param value Custom hook name or object that is passed to formatter + * @param formatter Formatter to modify value before sending it to the devtools + */ +export function useDebugValue(value: T, formatter?: (value: T) => any): void; + +export function useErrorBoundary( + callback?: (error: any, errorInfo: ErrorInfo) => Promise | void +): [any, () => void]; + +export function useId(): string; diff --git a/node_modules/preact/hooks/src/index.js b/node_modules/preact/hooks/src/index.js new file mode 100644 index 0000000000000000000000000000000000000000..aeca5944da5af72d7c44d54b11694185de142ae5 --- /dev/null +++ b/node_modules/preact/hooks/src/index.js @@ -0,0 +1,555 @@ +import { options as _options } from 'preact'; + +/** @type {number} */ +let currentIndex; + +/** @type {import('./internal').Component} */ +let currentComponent; + +/** @type {import('./internal').Component} */ +let previousComponent; + +/** @type {number} */ +let currentHook = 0; + +/** @type {Array} */ +let afterPaintEffects = []; + +// Cast to use internal Options type +const options = /** @type {import('./internal').Options} */ (_options); + +let oldBeforeDiff = options._diff; +let oldBeforeRender = options._render; +let oldAfterDiff = options.diffed; +let oldCommit = options._commit; +let oldBeforeUnmount = options.unmount; +let oldRoot = options._root; + +// We take the minimum timeout for requestAnimationFrame to ensure that +// the callback is invoked after the next frame. 35ms is based on a 30hz +// refresh rate, which is the minimum rate for a smooth user experience. +const RAF_TIMEOUT = 35; +let prevRaf; + +/** @type {(vnode: import('./internal').VNode) => void} */ +options._diff = vnode => { + currentComponent = null; + if (oldBeforeDiff) oldBeforeDiff(vnode); +}; + +options._root = (vnode, parentDom) => { + if (vnode && parentDom._children && parentDom._children._mask) { + vnode._mask = parentDom._children._mask; + } + + if (oldRoot) oldRoot(vnode, parentDom); +}; + +/** @type {(vnode: import('./internal').VNode) => void} */ +options._render = vnode => { + if (oldBeforeRender) oldBeforeRender(vnode); + + currentComponent = vnode._component; + currentIndex = 0; + + const hooks = currentComponent.__hooks; + if (hooks) { + if (previousComponent === currentComponent) { + hooks._pendingEffects = []; + currentComponent._renderCallbacks = []; + hooks._list.some(hookItem => { + if (hookItem._nextValue) { + hookItem._value = hookItem._nextValue; + } + hookItem._pendingArgs = hookItem._nextValue = undefined; + }); + } else { + hooks._pendingEffects.some(invokeCleanup); + hooks._pendingEffects.some(invokeEffect); + hooks._pendingEffects = []; + currentIndex = 0; + } + } + previousComponent = currentComponent; +}; + +/** @type {(vnode: import('./internal').VNode) => void} */ +options.diffed = vnode => { + if (oldAfterDiff) oldAfterDiff(vnode); + + const c = vnode._component; + if (c && c.__hooks) { + if (c.__hooks._pendingEffects.length) afterPaint(afterPaintEffects.push(c)); + c.__hooks._list.some(hookItem => { + if (hookItem._pendingArgs) { + hookItem._args = hookItem._pendingArgs; + } + hookItem._pendingArgs = undefined; + }); + } + previousComponent = currentComponent = null; +}; + +// TODO: Improve typing of commitQueue parameter +/** @type {(vnode: import('./internal').VNode, commitQueue: any) => void} */ +options._commit = (vnode, commitQueue) => { + commitQueue.some(component => { + try { + component._renderCallbacks.some(invokeCleanup); + component._renderCallbacks = component._renderCallbacks.filter(cb => + cb._value ? invokeEffect(cb) : true + ); + } catch (e) { + commitQueue.some(c => { + if (c._renderCallbacks) c._renderCallbacks = []; + }); + commitQueue = []; + options._catchError(e, component._vnode); + } + }); + + if (oldCommit) oldCommit(vnode, commitQueue); +}; + +/** @type {(vnode: import('./internal').VNode) => void} */ +options.unmount = vnode => { + if (oldBeforeUnmount) oldBeforeUnmount(vnode); + + const c = vnode._component; + if (c && c.__hooks) { + let hasErrored; + c.__hooks._list.some(s => { + try { + invokeCleanup(s); + } catch (e) { + hasErrored = e; + } + }); + c.__hooks = undefined; + if (hasErrored) options._catchError(hasErrored, c._vnode); + } +}; + +/** + * Get a hook's state from the currentComponent + * @param {number} index The index of the hook to get + * @param {number} type The index of the hook to get + * @returns {any} + */ +function getHookState(index, type) { + if (options._hook) { + options._hook(currentComponent, index, currentHook || type); + } + currentHook = 0; + + // Largely inspired by: + // * https://github.com/michael-klein/funcy.js/blob/f6be73468e6ec46b0ff5aa3cc4c9baf72a29025a/src/hooks/core_hooks.mjs + // * https://github.com/michael-klein/funcy.js/blob/650beaa58c43c33a74820a3c98b3c7079cf2e333/src/renderer.mjs + // Other implementations to look at: + // * https://codesandbox.io/s/mnox05qp8 + const hooks = + currentComponent.__hooks || + (currentComponent.__hooks = { + _list: [], + _pendingEffects: [] + }); + + if (index >= hooks._list.length) { + hooks._list.push({}); + } + + return hooks._list[index]; +} + +/** + * @template {unknown} S + * @param {import('./index').Dispatch>} [initialState] + * @returns {[S, (state: S) => void]} + */ +export function useState(initialState) { + currentHook = 1; + return useReducer(invokeOrReturn, initialState); +} + +/** + * @template {unknown} S + * @template {unknown} A + * @param {import('./index').Reducer} reducer + * @param {import('./index').Dispatch>} initialState + * @param {(initialState: any) => void} [init] + * @returns {[ S, (state: S) => void ]} + */ +export function useReducer(reducer, initialState, init) { + /** @type {import('./internal').ReducerHookState} */ + const hookState = getHookState(currentIndex++, 2); + hookState._reducer = reducer; + if (!hookState._component) { + hookState._value = [ + !init ? invokeOrReturn(undefined, initialState) : init(initialState), + + action => { + const currentValue = hookState._nextValue + ? hookState._nextValue[0] + : hookState._value[0]; + const nextValue = hookState._reducer(currentValue, action); + + if (currentValue !== nextValue) { + hookState._nextValue = [nextValue, hookState._value[1]]; + hookState._component.setState({}); + } + } + ]; + + hookState._component = currentComponent; + + if (!currentComponent._hasScuFromHooks) { + currentComponent._hasScuFromHooks = true; + let prevScu = currentComponent.shouldComponentUpdate; + const prevCWU = currentComponent.componentWillUpdate; + + // If we're dealing with a forced update `shouldComponentUpdate` will + // not be called. But we use that to update the hook values, so we + // need to call it. + currentComponent.componentWillUpdate = function (p, s, c) { + if (this._force) { + let tmp = prevScu; + // Clear to avoid other sCU hooks from being called + prevScu = undefined; + updateHookState(p, s, c); + prevScu = tmp; + } + + if (prevCWU) prevCWU.call(this, p, s, c); + }; + + // This SCU has the purpose of bailing out after repeated updates + // to stateful hooks. + // we store the next value in _nextValue[0] and keep doing that for all + // state setters, if we have next states and + // all next states within a component end up being equal to their original state + // we are safe to bail out for this specific component. + /** + * + * @type {import('./internal').Component["shouldComponentUpdate"]} + */ + // @ts-ignore - We don't use TS to downtranspile + // eslint-disable-next-line no-inner-declarations + function updateHookState(p, s, c) { + if (!hookState._component.__hooks) return true; + + const stateHooks = hookState._component.__hooks._list.filter( + x => x._component + ); + + const allHooksEmpty = stateHooks.every(x => !x._nextValue); + // When we have no updated hooks in the component we invoke the previous SCU or + // traverse the VDOM tree further. + if (allHooksEmpty) { + return prevScu ? prevScu.call(this, p, s, c) : true; + } + + // We check whether we have components with a nextValue set that + // have values that aren't equal to one another this pushes + // us to update further down the tree + let shouldUpdate = hookState._component.props !== p; + stateHooks.some(hookItem => { + if (hookItem._nextValue) { + const currentValue = hookItem._value[0]; + hookItem._value = hookItem._nextValue; + hookItem._nextValue = undefined; + if (currentValue !== hookItem._value[0]) shouldUpdate = true; + } + }); + + return prevScu + ? prevScu.call(this, p, s, c) || shouldUpdate + : shouldUpdate; + } + + currentComponent.shouldComponentUpdate = updateHookState; + } + } + + return hookState._nextValue || hookState._value; +} + +/** + * @param {import('./internal').Effect} callback + * @param {unknown[]} args + * @returns {void} + */ +export function useEffect(callback, args) { + /** @type {import('./internal').EffectHookState} */ + const state = getHookState(currentIndex++, 3); + if (!options._skipEffects && argsChanged(state._args, args)) { + state._value = callback; + state._pendingArgs = args; + + currentComponent.__hooks._pendingEffects.push(state); + } +} + +/** + * @param {import('./internal').Effect} callback + * @param {unknown[]} args + * @returns {void} + */ +export function useLayoutEffect(callback, args) { + /** @type {import('./internal').EffectHookState} */ + const state = getHookState(currentIndex++, 4); + if (!options._skipEffects && argsChanged(state._args, args)) { + state._value = callback; + state._pendingArgs = args; + + currentComponent._renderCallbacks.push(state); + } +} + +/** @type {(initialValue: unknown) => unknown} */ +export function useRef(initialValue) { + currentHook = 5; + return useMemo(() => ({ current: initialValue }), []); +} + +/** + * @param {object} ref + * @param {() => object} createHandle + * @param {unknown[]} args + * @returns {void} + */ +export function useImperativeHandle(ref, createHandle, args) { + currentHook = 6; + useLayoutEffect( + () => { + if (typeof ref == 'function') { + const result = ref(createHandle()); + return () => { + ref(null); + if (result && typeof result == 'function') result(); + }; + } else if (ref) { + ref.current = createHandle(); + return () => (ref.current = null); + } + }, + args == null ? args : args.concat(ref) + ); +} + +/** + * @template {unknown} T + * @param {() => T} factory + * @param {unknown[]} args + * @returns {T} + */ +export function useMemo(factory, args) { + /** @type {import('./internal').MemoHookState} */ + const state = getHookState(currentIndex++, 7); + if (argsChanged(state._args, args)) { + state._value = factory(); + state._args = args; + state._factory = factory; + } + + return state._value; +} + +/** + * @param {() => void} callback + * @param {unknown[]} args + * @returns {() => void} + */ +export function useCallback(callback, args) { + currentHook = 8; + return useMemo(() => callback, args); +} + +/** + * @param {import('./internal').PreactContext} context + */ +export function useContext(context) { + const provider = currentComponent.context[context._id]; + // We could skip this call here, but than we'd not call + // `options._hook`. We need to do that in order to make + // the devtools aware of this hook. + /** @type {import('./internal').ContextHookState} */ + const state = getHookState(currentIndex++, 9); + // The devtools needs access to the context object to + // be able to pull of the default value when no provider + // is present in the tree. + state._context = context; + if (!provider) return context._defaultValue; + // This is probably not safe to convert to "!" + if (state._value == null) { + state._value = true; + provider.sub(currentComponent); + } + return provider.props.value; +} + +/** + * Display a custom label for a custom hook for the devtools panel + * @type {(value: T, cb?: (value: T) => string | number) => void} + */ +export function useDebugValue(value, formatter) { + if (options.useDebugValue) { + options.useDebugValue( + formatter ? formatter(value) : /** @type {any}*/ (value) + ); + } +} + +/** + * @param {(error: unknown, errorInfo: import('preact').ErrorInfo) => void} cb + * @returns {[unknown, () => void]} + */ +export function useErrorBoundary(cb) { + /** @type {import('./internal').ErrorBoundaryHookState} */ + const state = getHookState(currentIndex++, 10); + const errState = useState(); + state._value = cb; + if (!currentComponent.componentDidCatch) { + currentComponent.componentDidCatch = (err, errorInfo) => { + if (state._value) state._value(err, errorInfo); + errState[1](err); + }; + } + return [ + errState[0], + () => { + errState[1](undefined); + } + ]; +} + +/** @type {() => string} */ +export function useId() { + /** @type {import('./internal').IdHookState} */ + const state = getHookState(currentIndex++, 11); + if (!state._value) { + // Grab either the root node or the nearest async boundary node. + /** @type {import('./internal').VNode} */ + let root = currentComponent._vnode; + while (root !== null && !root._mask && root._parent !== null) { + root = root._parent; + } + + let mask = root._mask || (root._mask = [0, 0]); + state._value = 'P' + mask[0] + '-' + mask[1]++; + } + + return state._value; +} + +/** + * After paint effects consumer. + */ +function flushAfterPaintEffects() { + let component; + while ((component = afterPaintEffects.shift())) { + const hooks = component.__hooks; + if (!component._parentDom || !hooks) continue; + try { + hooks._pendingEffects.some(invokeCleanup); + hooks._pendingEffects.some(invokeEffect); + hooks._pendingEffects = []; + } catch (e) { + hooks._pendingEffects = []; + options._catchError(e, component._vnode); + } + } +} + +let HAS_RAF = typeof requestAnimationFrame == 'function'; + +/** + * Schedule a callback to be invoked after the browser has a chance to paint a new frame. + * Do this by combining requestAnimationFrame (rAF) + setTimeout to invoke a callback after + * the next browser frame. + * + * Also, schedule a timeout in parallel to the the rAF to ensure the callback is invoked + * even if RAF doesn't fire (for example if the browser tab is not visible) + * + * @param {() => void} callback + */ +function afterNextFrame(callback) { + const done = () => { + clearTimeout(timeout); + if (HAS_RAF) cancelAnimationFrame(raf); + setTimeout(callback); + }; + const timeout = setTimeout(done, RAF_TIMEOUT); + + let raf; + if (HAS_RAF) { + raf = requestAnimationFrame(done); + } +} + +// Note: if someone used options.debounceRendering = requestAnimationFrame, +// then effects will ALWAYS run on the NEXT frame instead of the current one, incurring a ~16ms delay. +// Perhaps this is not such a big deal. +/** + * Schedule afterPaintEffects flush after the browser paints + * @param {number} newQueueLength + * @returns {void} + */ +function afterPaint(newQueueLength) { + if (newQueueLength === 1 || prevRaf !== options.requestAnimationFrame) { + prevRaf = options.requestAnimationFrame; + (prevRaf || afterNextFrame)(flushAfterPaintEffects); + } +} + +/** + * @param {import('./internal').HookState} hook + * @returns {void} + */ +function invokeCleanup(hook) { + // A hook cleanup can introduce a call to render which creates a new root, this will call options.vnode + // and move the currentComponent away. + const comp = currentComponent; + let cleanup = hook._cleanup; + if (typeof cleanup == 'function') { + hook._cleanup = undefined; + cleanup(); + } + + currentComponent = comp; +} + +/** + * Invoke a Hook's effect + * @param {import('./internal').EffectHookState} hook + * @returns {void} + */ +function invokeEffect(hook) { + // A hook call can introduce a call to render which creates a new root, this will call options.vnode + // and move the currentComponent away. + const comp = currentComponent; + hook._cleanup = hook._value(); + currentComponent = comp; +} + +/** + * @param {unknown[]} oldArgs + * @param {unknown[]} newArgs + * @returns {boolean} + */ +function argsChanged(oldArgs, newArgs) { + return ( + !oldArgs || + oldArgs.length !== newArgs.length || + newArgs.some((arg, index) => arg !== oldArgs[index]) + ); +} + +/** + * @template Arg + * @param {Arg} arg + * @param {(arg: Arg) => any} f + * @returns {any} + */ +function invokeOrReturn(arg, f) { + return typeof f == 'function' ? f(arg) : f; +} diff --git a/node_modules/preact/hooks/src/internal.d.ts b/node_modules/preact/hooks/src/internal.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..76cd97812b0a9a9dc6ec017be96060ce6eb5b72e --- /dev/null +++ b/node_modules/preact/hooks/src/internal.d.ts @@ -0,0 +1,103 @@ +import { + Options as PreactOptions, + Component as PreactComponent, + VNode as PreactVNode, + PreactContext, + HookType, + ErrorInfo, +} from '../../src/internal'; +import { Reducer, StateUpdater } from '.'; + +export { PreactContext }; + +export interface Options extends PreactOptions { + /** Attach a hook that is invoked before a vnode is diffed. */ + _diff?(vnode: VNode): void; + diffed?(vnode: VNode): void; + /** Attach a hook that is invoked before a vnode has rendered. */ + _render?(vnode: VNode): void; + /** Attach a hook that is invoked after a tree was mounted or was updated. */ + _commit?(vnode: VNode, commitQueue: Component[]): void; + _unmount?(vnode: VNode): void; + /** Attach a hook that is invoked before a hook's state is queried. */ + _hook?(component: Component, index: number, type: HookType): void; +} + +// Hook tracking + +export interface ComponentHooks { + /** The list of hooks a component uses */ + _list: HookState[]; + /** List of Effects to be invoked after the next frame is rendered */ + _pendingEffects: EffectHookState[]; +} + +export interface Component extends Omit, '_renderCallbacks'> { + __hooks?: ComponentHooks; + // Extend to include HookStates + _renderCallbacks?: Array void)>; + _hasScuFromHooks?: boolean; +} + +export interface VNode extends Omit { + _mask?: [number, number]; + _component?: Component; // Override with our specific Component type +} + +export type HookState = + | EffectHookState + | MemoHookState + | ReducerHookState + | ContextHookState + | ErrorBoundaryHookState + | IdHookState; + +interface BaseHookState { + _value?: unknown; + _nextValue?: unknown; + _pendingValue?: unknown; + _args?: unknown; + _pendingArgs?: unknown; + _component?: unknown; + _cleanup?: unknown; +} + +export type Effect = () => void | Cleanup; +export type Cleanup = () => void; + +export interface EffectHookState extends BaseHookState { + _value?: Effect; + _args?: unknown[]; + _pendingArgs?: unknown[]; + _cleanup?: Cleanup | void; +} + +export interface MemoHookState extends BaseHookState { + _value?: T; + _pendingValue?: T; + _args?: unknown[]; + _pendingArgs?: unknown[]; + _factory?: () => T; +} + +export interface ReducerHookState + extends BaseHookState { + _nextValue?: [S, StateUpdater]; + _value?: [S, StateUpdater]; + _component?: Component; + _reducer?: Reducer; +} + +export interface ContextHookState extends BaseHookState { + /** Whether this hooks as subscribed to updates yet */ + _value?: boolean; + _context?: PreactContext; +} + +export interface ErrorBoundaryHookState extends BaseHookState { + _value?: (error: unknown, errorInfo: ErrorInfo) => void; +} + +export interface IdHookState extends BaseHookState { + _value?: string; +} diff --git a/node_modules/preact/jsx-runtime/dist/jsxRuntime.js b/node_modules/preact/jsx-runtime/dist/jsxRuntime.js new file mode 100644 index 0000000000000000000000000000000000000000..9ed698115278de0616661699c1cc20e25681d1b6 --- /dev/null +++ b/node_modules/preact/jsx-runtime/dist/jsxRuntime.js @@ -0,0 +1,2 @@ +var r=require("preact"),e=/["&<]/;function t(r){if(0===r.length||!1===e.test(r))return r;for(var t=0,n=0,o="",f="";n} exprs\n * @returns {VNode}\n */\nfunction jsxTemplate(templates, ...exprs) {\n\tconst vnode = createVNode(Fragment, { tpl: templates, exprs });\n\t// Bypass render to string top level Fragment optimization\n\tvnode.key = vnode._vnode;\n\treturn vnode;\n}\n\nconst JS_TO_CSS = {};\nconst CSS_REGEX = /[A-Z]/g;\n\n/**\n * Unwrap potential signals.\n * @param {*} value\n * @returns {*}\n */\nfunction normalizeAttrValue(value) {\n\treturn value !== null &&\n\t\ttypeof value === 'object' &&\n\t\ttypeof value.valueOf === 'function'\n\t\t? value.valueOf()\n\t\t: value;\n}\n\n/**\n * Serialize an HTML attribute to a string. This function is not\n * expected to be used directly, but rather through a precompile\n * JSX transform\n * @param {string} name The attribute name\n * @param {*} value The attribute value\n * @returns {string}\n */\nfunction jsxAttr(name, value) {\n\tif (options.attr) {\n\t\tconst result = options.attr(name, value);\n\t\tif (typeof result === 'string') return result;\n\t}\n\n\tvalue = normalizeAttrValue(value);\n\n\tif (name === 'ref' || name === 'key') return '';\n\tif (name === 'style' && typeof value === 'object') {\n\t\tlet str = '';\n\t\tfor (let prop in value) {\n\t\t\tlet val = value[prop];\n\t\t\tif (val != null && val !== '') {\n\t\t\t\tconst name =\n\t\t\t\t\tprop[0] == '-'\n\t\t\t\t\t\t? prop\n\t\t\t\t\t\t: JS_TO_CSS[prop] ||\n\t\t\t\t\t\t\t(JS_TO_CSS[prop] = prop.replace(CSS_REGEX, '-$&').toLowerCase());\n\n\t\t\t\tlet suffix = ';';\n\t\t\t\tif (\n\t\t\t\t\ttypeof val === 'number' &&\n\t\t\t\t\t// Exclude custom-attributes\n\t\t\t\t\t!name.startsWith('--') &&\n\t\t\t\t\t!IS_NON_DIMENSIONAL.test(name)\n\t\t\t\t) {\n\t\t\t\t\tsuffix = 'px;';\n\t\t\t\t}\n\t\t\t\tstr = str + name + ':' + val + suffix;\n\t\t\t}\n\t\t}\n\t\treturn name + '=\"' + encodeEntities(str) + '\"';\n\t}\n\n\tif (\n\t\tvalue == null ||\n\t\tvalue === false ||\n\t\ttypeof value === 'function' ||\n\t\ttypeof value === 'object'\n\t) {\n\t\treturn '';\n\t} else if (value === true) return name;\n\n\treturn name + '=\"' + encodeEntities('' + value) + '\"';\n}\n\n/**\n * Escape a dynamic child passed to `jsxTemplate`. This function\n * is not expected to be used directly, but rather through a\n * precompile JSX transform\n * @param {*} value\n * @returns {string | null | VNode | Array}\n */\nfunction jsxEscape(value) {\n\tif (\n\t\tvalue == null ||\n\t\ttypeof value === 'boolean' ||\n\t\ttypeof value === 'function'\n\t) {\n\t\treturn null;\n\t}\n\n\tif (typeof value === 'object') {\n\t\t// Check for VNode\n\t\tif (value.constructor === undefined) return value;\n\n\t\tif (isArray(value)) {\n\t\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\t\tvalue[i] = jsxEscape(value[i]);\n\t\t\t}\n\t\t\treturn value;\n\t\t}\n\t}\n\n\treturn encodeEntities('' + value);\n}\n\nexport {\n\tcreateVNode as jsx,\n\tcreateVNode as jsxs,\n\tcreateVNode as jsxDEV,\n\tFragment,\n\t// precompiled JSX transform\n\tjsxTemplate,\n\tjsxAttr,\n\tjsxEscape\n};\n"],"names":["ENCODED_ENTITIES","encodeEntities","str","length","test","last","i","out","ch","charCodeAt","slice","IS_NON_DIMENSIONAL","vnodeId","isArray","Array","createVNode","type","props","key","isStaticChildren","__source","__self","ref","normalizedProps","vnode","__k","__","__b","__e","__c","constructor","undefined","__v","__i","__u","defaultProps","options","JS_TO_CSS","CSS_REGEX","name","value","attr","result","valueOf","normalizeAttrValue","prop","val","replace","toLowerCase","suffix","startsWith","jsxEscape","templates","Fragment","tpl","exprs","call","arguments"],"mappings":"wBAAMA,EAAmB,QAGlB,SAASC,EAAeC,GAE9B,GAAmB,IAAfA,EAAIC,SAA+C,IAA/BH,EAAiBI,KAAKF,GAAgB,OAAOA,EAQrE,IANA,IAAIG,EAAO,EACVC,EAAI,EACJC,EAAM,GACNC,EAAK,GAGCF,EAAIJ,EAAIC,OAAQG,IAAK,CAC3B,OAAQJ,EAAIO,WAAWH,IACtB,KAAK,GACJE,EAAK,SACL,MACD,KAAO,GACNA,EAAK,QACL,MACD,KAAK,GACJA,EAAK,OACL,MACD,QACC,SAG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,UAATA,GAAqC,iBAAVC,EAAoB,CAClD,IAAItC,EAAM,GACV,IAAK,IAAI2C,KAAQL,EAAO,CACvB,IAAIM,EAAMN,EAAMK,GAChB,GAAW,MAAPC,GAAuB,KAARA,EAAY,CAC9B,IAAMP,EACM,KAAXM,EAAK,GACFA,EACAR,EAAUQ,KACVR,EAAUQ,GAAQA,EAAKE,QAAQT,EAAW,OAAOU,eAEjDC,EAAS,IAEG,iBAARH,GAENP,EAAKW,WAAW,OAChBvC,EAAmBP,KAAKmC,KAEzBU,EAAS,OAEV/C,EAAMA,EAAMqC,EAAO,IAAMO,EAAMG,CAChC,CACD,CACA,OAAOV,EAAO,KAAOtC,EAAeC,GAAO,GAC5C,CAEA,OACU,MAATsC,IACU,IAAVA,GACiB,mBAAVA,GACU,iBAAVA,EAEA,IACa,IAAVA,EAAuBD,EAE3BA,EAAO,KAAOtC,EAAe,GAAKuC,GAAS,GACnD,qCASA,SAASW,EAAUX,GAClB,GACU,MAATA,GACiB,kBAAVA,GACU,mBAAVA,EAEP,OACD,KAEA,GAAqB,iBAAVA,EAAoB,CAE9B,QAA0BT,IAAtBS,EAAMV,YAA2B,OAAOU,EAE5C,GAAI3B,EAAQ2B,GAAQ,CACnB,IAAK,IAAIlC,EAAI,EAAGA,EAAIkC,EAAMrC,OAAQG,IACjCkC,EAAMlC,GAAK6C,EAAUX,EAAMlC,IAE5B,OAAOkC,CACR,CACD,CAEA,OAAOvC,EAAe,GAAKuC,EAC5B,sBA3GA,SAAqBY,GACpB,IAAM5B,EAAQT,EAAYsC,EAAQA,SAAE,CAAEC,IAAKF,EAAWG,SAAK7C,MAAA8C,KAAAC,UAAC,KAG5D,OADAjC,EAAMN,IAAMM,EAAKQ,IACVR,CACR"} \ No newline at end of file diff --git a/node_modules/preact/jsx-runtime/dist/jsxRuntime.mjs b/node_modules/preact/jsx-runtime/dist/jsxRuntime.mjs new file mode 100644 index 0000000000000000000000000000000000000000..15cafef3fcd0a3133cda419210c6a51edad8de63 --- /dev/null +++ b/node_modules/preact/jsx-runtime/dist/jsxRuntime.mjs @@ -0,0 +1,2 @@ +import{options as r,Fragment as e}from"preact";export{Fragment}from"preact";var t=/["&<]/;function n(r){if(0===r.length||!1===t.test(r))return r;for(var e=0,n=0,o="",f="";n} exprs\n * @returns {VNode}\n */\nfunction jsxTemplate(templates, ...exprs) {\n\tconst vnode = createVNode(Fragment, { tpl: templates, exprs });\n\t// Bypass render to string top level Fragment optimization\n\tvnode.key = vnode._vnode;\n\treturn vnode;\n}\n\nconst JS_TO_CSS = {};\nconst CSS_REGEX = /[A-Z]/g;\n\n/**\n * Unwrap potential signals.\n * @param {*} value\n * @returns {*}\n */\nfunction normalizeAttrValue(value) {\n\treturn value !== null &&\n\t\ttypeof value === 'object' &&\n\t\ttypeof value.valueOf === 'function'\n\t\t? value.valueOf()\n\t\t: value;\n}\n\n/**\n * Serialize an HTML attribute to a string. This function is not\n * expected to be used directly, but rather through a precompile\n * JSX transform\n * @param {string} name The attribute name\n * @param {*} value The attribute value\n * @returns {string}\n */\nfunction jsxAttr(name, value) {\n\tif (options.attr) {\n\t\tconst result = options.attr(name, value);\n\t\tif (typeof result === 'string') return result;\n\t}\n\n\tvalue = normalizeAttrValue(value);\n\n\tif (name === 'ref' || name === 'key') return '';\n\tif (name === 'style' && typeof value === 'object') {\n\t\tlet str = '';\n\t\tfor (let prop in value) {\n\t\t\tlet val = value[prop];\n\t\t\tif (val != null && val !== '') {\n\t\t\t\tconst name =\n\t\t\t\t\tprop[0] == '-'\n\t\t\t\t\t\t? prop\n\t\t\t\t\t\t: JS_TO_CSS[prop] ||\n\t\t\t\t\t\t\t(JS_TO_CSS[prop] = prop.replace(CSS_REGEX, '-$&').toLowerCase());\n\n\t\t\t\tlet suffix = ';';\n\t\t\t\tif (\n\t\t\t\t\ttypeof val === 'number' &&\n\t\t\t\t\t// Exclude custom-attributes\n\t\t\t\t\t!name.startsWith('--') &&\n\t\t\t\t\t!IS_NON_DIMENSIONAL.test(name)\n\t\t\t\t) {\n\t\t\t\t\tsuffix = 'px;';\n\t\t\t\t}\n\t\t\t\tstr = str + name + ':' + val + suffix;\n\t\t\t}\n\t\t}\n\t\treturn name + '=\"' + encodeEntities(str) + '\"';\n\t}\n\n\tif (\n\t\tvalue == null ||\n\t\tvalue === false ||\n\t\ttypeof value === 'function' ||\n\t\ttypeof value === 'object'\n\t) {\n\t\treturn '';\n\t} else if (value === true) return name;\n\n\treturn name + '=\"' + encodeEntities('' + value) + '\"';\n}\n\n/**\n * Escape a dynamic child passed to `jsxTemplate`. This function\n * is not expected to be used directly, but rather through a\n * precompile JSX transform\n * @param {*} value\n * @returns {string | null | VNode | Array}\n */\nfunction jsxEscape(value) {\n\tif (\n\t\tvalue == null ||\n\t\ttypeof value === 'boolean' ||\n\t\ttypeof value === 'function'\n\t) {\n\t\treturn null;\n\t}\n\n\tif (typeof value === 'object') {\n\t\t// Check for VNode\n\t\tif (value.constructor === undefined) return value;\n\n\t\tif (isArray(value)) {\n\t\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\t\tvalue[i] = jsxEscape(value[i]);\n\t\t\t}\n\t\t\treturn value;\n\t\t}\n\t}\n\n\treturn encodeEntities('' + value);\n}\n\nexport {\n\tcreateVNode as jsx,\n\tcreateVNode as jsxs,\n\tcreateVNode as jsxDEV,\n\tFragment,\n\t// precompiled JSX transform\n\tjsxTemplate,\n\tjsxAttr,\n\tjsxEscape\n};\n"],"names":["ENCODED_ENTITIES","encodeEntities","str","length","test","last","i","out","ch","charCodeAt","slice","IS_NON_DIMENSIONAL","vnodeId","isArray","Array","createVNode","type","props","key","isStaticChildren","__source","__self","ref","normalizedProps","vnode","__k","__","__b","__e","__c","constructor","undefined","__v","__i","__u","defaultProps","options","jsxTemplate","templates","Fragment","tpl","exprs","call","arguments","JS_TO_CSS","CSS_REGEX","jsxAttr","name","value","attr","result","valueOf","normalizeAttrValue","prop","val","replace","toLowerCase","suffix","startsWith","jsxEscape"],"mappings":"4EAAA,IAAMA,EA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AI,EAAGA,EAAI0C,EAAM7C,OAAQG,IACjC0C,EAAM1C,GAAKqD,EAAUX,EAAM1C,IAE5B,OAAO0C,CACR,CACD,CAEA,OAAO/C,EAAe,GAAK+C,EAC5B"} \ No newline at end of file diff --git a/node_modules/preact/jsx-runtime/dist/jsxRuntime.umd.js b/node_modules/preact/jsx-runtime/dist/jsxRuntime.umd.js new file mode 100644 index 0000000000000000000000000000000000000000..0ff5a2ff160c74516cf475e076954ee1b66cb7d7 --- /dev/null +++ b/node_modules/preact/jsx-runtime/dist/jsxRuntime.umd.js @@ -0,0 +1,2 @@ +!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("preact")):"function"==typeof define&&define.amd?define(["exports","preact"],r):r((e||self).jsxRuntime={},e.preact)}(this,function(e,r){var n=/["&<]/;function t(e){if(0===e.length||!1===n.test(e))return e;for(var r=0,t=0,o="",f="";t} exprs\n * @returns {VNode}\n */\nfunction jsxTemplate(templates, ...exprs) {\n\tconst vnode = createVNode(Fragment, { tpl: templates, exprs });\n\t// Bypass render to string top level Fragment optimization\n\tvnode.key = vnode._vnode;\n\treturn vnode;\n}\n\nconst JS_TO_CSS = {};\nconst CSS_REGEX = /[A-Z]/g;\n\n/**\n * Unwrap potential signals.\n * @param {*} value\n * @returns {*}\n */\nfunction normalizeAttrValue(value) {\n\treturn value !== null &&\n\t\ttypeof value === 'object' &&\n\t\ttypeof value.valueOf === 'function'\n\t\t? value.valueOf()\n\t\t: value;\n}\n\n/**\n * Serialize an HTML attribute to a string. This function is not\n * expected to be used directly, but rather through a precompile\n * JSX transform\n * @param {string} name The attribute name\n * @param {*} value The attribute value\n * @returns {string}\n */\nfunction jsxAttr(name, value) {\n\tif (options.attr) {\n\t\tconst result = options.attr(name, value);\n\t\tif (typeof result === 'string') return result;\n\t}\n\n\tvalue = normalizeAttrValue(value);\n\n\tif (name === 'ref' || name === 'key') return '';\n\tif (name === 'style' && typeof value === 'object') {\n\t\tlet str = '';\n\t\tfor (let prop in value) {\n\t\t\tlet val = value[prop];\n\t\t\tif (val != null && val !== '') {\n\t\t\t\tconst name =\n\t\t\t\t\tprop[0] == '-'\n\t\t\t\t\t\t? prop\n\t\t\t\t\t\t: JS_TO_CSS[prop] ||\n\t\t\t\t\t\t\t(JS_TO_CSS[prop] = prop.replace(CSS_REGEX, '-$&').toLowerCase());\n\n\t\t\t\tlet suffix = ';';\n\t\t\t\tif (\n\t\t\t\t\ttypeof val === 'number' &&\n\t\t\t\t\t// Exclude custom-attributes\n\t\t\t\t\t!name.startsWith('--') &&\n\t\t\t\t\t!IS_NON_DIMENSIONAL.test(name)\n\t\t\t\t) {\n\t\t\t\t\tsuffix = 'px;';\n\t\t\t\t}\n\t\t\t\tstr = str + name + ':' + val + suffix;\n\t\t\t}\n\t\t}\n\t\treturn name + '=\"' + encodeEntities(str) + '\"';\n\t}\n\n\tif (\n\t\tvalue == null ||\n\t\tvalue === false ||\n\t\ttypeof value === 'function' ||\n\t\ttypeof value === 'object'\n\t) {\n\t\treturn '';\n\t} else if (value === true) return name;\n\n\treturn name + '=\"' + encodeEntities('' + value) + '\"';\n}\n\n/**\n * Escape a dynamic child passed to `jsxTemplate`. This function\n * is not expected to be used directly, but rather through a\n * precompile JSX transform\n * @param {*} value\n * @returns {string | null | VNode | Array}\n */\nfunction jsxEscape(value) {\n\tif (\n\t\tvalue == null ||\n\t\ttypeof value === 'boolean' ||\n\t\ttypeof value === 'function'\n\t) {\n\t\treturn null;\n\t}\n\n\tif (typeof value === 'object') {\n\t\t// Check for VNode\n\t\tif (value.constructor === undefined) return value;\n\n\t\tif (isArray(value)) {\n\t\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\t\tvalue[i] = jsxEscape(value[i]);\n\t\t\t}\n\t\t\treturn value;\n\t\t}\n\t}\n\n\treturn encodeEntities('' + value);\n}\n\nexport {\n\tcreateVNode as jsx,\n\tcreateVNode as jsxs,\n\tcreateVNode as jsxDEV,\n\tFragment,\n\t// precompiled JSX transform\n\tjsxTemplate,\n\tjsxAttr,\n\tjsxEscape\n};\n"],"names":["ENCODED_ENTITIES","encodeEntities","str","length","test","last","i","out","ch","charCodeAt","slice","IS_NON_DIMENSIONAL","vnodeId","isArray","Array","createVNode","type","props","key","isStaticChildren","__source","__self","ref","normalizedProps","vnode","__k","__","__b","__e","__c","constructor","undefined","__v","__i","__u","defaultProps","options","JS_TO_CSS","CSS_REGEX","name","value","attr","result","valueOf","normalizeAttrValue","prop","val","replace","toLowerCase","suffix","startsWith","jsxEscape","templates","Fragment","tpl","exprs","call","arguments"],"mappings":"0QAAA,IAAMA,EAAmB,QAGlB,SAASC,EAAeC,GAE9B,GAAmB,IAAfA,EAAIC,SAA+C,IAA/BH,EAAiBI,KAAKF,GAAgB,OAAOA,EAQrE,IANA,IAAIG,EAAO,EACVC,EAAI,EACJC,EAAM,GACNC,EAAK,GAGCF,EAAIJ,EAAIC,OAAQG,IAAK,CAC3B,OAAQJ,EAAIO,WAAWH,IACtB,KAAK,GACJE,EAAK,SACL,MACD,KAAO,GACNA,EAAK,QACL,MACD,KAAK,GACJA,EAAK,OACL,MACD,QACC,SAGEF,IAAMD,IAAME,GAAOL,EAAIQ,MAAML,EAAMC,IACvCC,GAAOC,EAEPH,EAAOC,EAAI,CACZ,CAEA,OADIA,IAAMD,IAAME,GAAOL,EAAIQ,MAAML,EAAMC,IAChCC,CACR,CCfa,IAAAI,EACZ,oECjBGC,EAAU,EAERC,EAAUC,MAAMD,QAsBtB,SAASE,EAAYC,EAAMC,EAAOC,EAAKC,EAAkBC,EAAUC,GAC7DJ,IAAOA,EAAQ,IAIpB,IACCK,EACAhB,EAFGiB,EAAkBN,EAItB,GAAI,QAASM,EAEZ,IAAKjB,KADLiB,EAAkB,GACRN,EACA,OAALX,EACHgB,EAAML,EAAMX,GAEZiB,EAAgBjB,GAAKW,EAAMX,GAM9B,IAAMkB,EAAQ,CACbR,KAAAA,EACAC,MAAOM,EACPL,IAAAA,EACAI,IAAAA,EACAG,IAAW,KACXC,GA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OtC,EAAe,GAAKuC,GAAS,GACnD,yBASA,SAASW,EAAUX,GAClB,GACU,MAATA,GACiB,kBAAVA,GACU,mBAAVA,EAEP,OACD,KAEA,GAAqB,iBAAVA,EAAoB,CAE9B,QAA0BT,IAAtBS,EAAMV,YAA2B,OAAOU,EAE5C,GAAI3B,EAAQ2B,GAAQ,CACnB,IAAK,IAAIlC,EAAI,EAAGA,EAAIkC,EAAMrC,OAAQG,IACjCkC,EAAMlC,GAAK6C,EAAUX,EAAMlC,IAE5B,OAAOkC,CACR,CACD,CAEA,OAAOvC,EAAe,GAAKuC,EAC5B,gBA3GA,SAAqBY,GACpB,IAAM5B,EAAQT,EAAYsC,EAAQA,SAAE,CAAEC,IAAKF,EAAWG,SAAK7C,MAAA8C,KAAAC,UAAC,KAG5D,OADAjC,EAAMN,IAAMM,EAAKQ,IACVR,CACR"} \ No newline at end of file diff --git a/node_modules/preact/jsx-runtime/package.json b/node_modules/preact/jsx-runtime/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1014de1c8222e3a4aa03fbd64f226ef3de503562 --- /dev/null +++ b/node_modules/preact/jsx-runtime/package.json @@ -0,0 +1,28 @@ +{ + "name": "jsx-runtime", + "amdName": "jsxRuntime", + "version": "1.0.0", + "private": true, + "description": "Preact JSX runtime", + "main": "dist/jsxRuntime.js", + "module": "dist/jsxRuntime.module.js", + "umd:main": "dist/jsxRuntime.umd.js", + "source": "src/index.js", + "types": "src/index.d.ts", + "license": "MIT", + "peerDependencies": { + "preact": "^10.0.0" + }, + "mangle": { + "regex": "^_" + }, + "exports": { + ".": { + "types": "./src/index.d.ts", + "browser": "./dist/jsxRuntime.module.js", + "umd": "./dist/jsxRuntime.umd.js", + "import": "./dist/jsxRuntime.mjs", + "require": "./dist/jsxRuntime.js" + } + } +} diff --git a/node_modules/preact/jsx-runtime/src/index.d.ts b/node_modules/preact/jsx-runtime/src/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..46649e8bdfab6a35adb7175018b9e8a1ae3679de --- /dev/null +++ b/node_modules/preact/jsx-runtime/src/index.d.ts @@ -0,0 +1,62 @@ +// Intentionally not using a relative path to take advantage of +// the TS version resolution mechanism +export { Fragment } from 'preact'; +import { + ComponentType, + ComponentChild, + ComponentChildren, + VNode, + Attributes +} from 'preact'; +import { JSXInternal } from '../../src/jsx'; + +export function jsx( + type: string, + props: JSXInternal.HTMLAttributes & + JSXInternal.SVGAttributes & + Record & { children?: ComponentChild }, + key?: string +): VNode; +export function jsx

( + type: ComponentType

, + props: Attributes & P & { children?: ComponentChild }, + key?: string +): VNode; + +export function jsxs( + type: string, + props: JSXInternal.HTMLAttributes & + JSXInternal.SVGAttributes & + Record & { children?: ComponentChild[] }, + key?: string +): VNode; +export function jsxs

( + type: ComponentType

, + props: Attributes & P & { children?: ComponentChild[] }, + key?: string +): VNode; + +export function jsxDEV( + type: string, + props: JSXInternal.HTMLAttributes & + JSXInternal.SVGAttributes & + Record & { children?: ComponentChildren }, + key?: string +): VNode; +export function jsxDEV

( + type: ComponentType

, + props: Attributes & P & { children?: ComponentChildren }, + key?: string +): VNode; + +// These are not expected to be used manually, but by a JSX transform +export function jsxTemplate( + template: string[], + ...expressions: any[] +): VNode; +export function jsxAttr(name: string, value: any): string | null; +export function jsxEscape( + value: T +): string | null | VNode | Array; + +export { JSXInternal as JSX }; diff --git a/node_modules/preact/jsx-runtime/src/index.js b/node_modules/preact/jsx-runtime/src/index.js new file mode 100644 index 0000000000000000000000000000000000000000..bfd17bd4fcda2d110fbcc11986d1fde0ba3df894 --- /dev/null +++ b/node_modules/preact/jsx-runtime/src/index.js @@ -0,0 +1,206 @@ +import { options, Fragment } from 'preact'; +import { encodeEntities } from './utils'; +import { IS_NON_DIMENSIONAL } from '../../src/constants'; + +let vnodeId = 0; + +const isArray = Array.isArray; + +/** + * @fileoverview + * This file exports various methods that implement Babel's "automatic" JSX runtime API: + * - jsx(type, props, key) + * - jsxs(type, props, key) + * - jsxDEV(type, props, key, __source, __self) + * + * The implementation of createVNode here is optimized for performance. + * Benchmarks: https://esbench.com/bench/5f6b54a0b4632100a7dcd2b3 + */ + +/** + * JSX.Element factory used by Babel's {runtime:"automatic"} JSX transform + * @param {VNode['type']} type + * @param {VNode['props']} props + * @param {VNode['key']} [key] + * @param {unknown} [isStaticChildren] + * @param {unknown} [__source] + * @param {unknown} [__self] + */ +function createVNode(type, props, key, isStaticChildren, __source, __self) { + if (!props) props = {}; + // We'll want to preserve `ref` in props to get rid of the need for + // forwardRef components in the future, but that should happen via + // a separate PR. + let normalizedProps = props, + ref, + i; + + if ('ref' in normalizedProps) { + normalizedProps = {}; + for (i in props) { + if (i == 'ref') { + ref = props[i]; + } else { + normalizedProps[i] = props[i]; + } + } + } + + /** @type {VNode & { __source: any; __self: any }} */ + const vnode = { + type, + props: normalizedProps, + key, + ref, + _children: null, + _parent: null, + _depth: 0, + _dom: null, + _component: null, + constructor: undefined, + _original: --vnodeId, + _index: -1, + _flags: 0, + __source, + __self + }; + + // If a Component VNode, check for and apply defaultProps. + // Note: `type` is often a String, and can be `undefined` in development. + if (typeof type === 'function' && (ref = type.defaultProps)) { + for (i in ref) + if (normalizedProps[i] === undefined) { + normalizedProps[i] = ref[i]; + } + } + + if (options.vnode) options.vnode(vnode); + return vnode; +} + +/** + * Create a template vnode. This function is not expected to be + * used directly, but rather through a precompile JSX transform + * @param {string[]} templates + * @param {Array} exprs + * @returns {VNode} + */ +function jsxTemplate(templates, ...exprs) { + const vnode = createVNode(Fragment, { tpl: templates, exprs }); + // Bypass render to string top level Fragment optimization + vnode.key = vnode._vnode; + return vnode; +} + +const JS_TO_CSS = {}; +const CSS_REGEX = /[A-Z]/g; + +/** + * Unwrap potential signals. + * @param {*} value + * @returns {*} + */ +function normalizeAttrValue(value) { + return value !== null && + typeof value === 'object' && + typeof value.valueOf === 'function' + ? value.valueOf() + : value; +} + +/** + * Serialize an HTML attribute to a string. This function is not + * expected to be used directly, but rather through a precompile + * JSX transform + * @param {string} name The attribute name + * @param {*} value The attribute value + * @returns {string} + */ +function jsxAttr(name, value) { + if (options.attr) { + const result = options.attr(name, value); + if (typeof result === 'string') return result; + } + + value = normalizeAttrValue(value); + + if (name === 'ref' || name === 'key') return ''; + if (name === 'style' && typeof value === 'object') { + let str = ''; + for (let prop in value) { + let val = value[prop]; + if (val != null && val !== '') { + const name = + prop[0] == '-' + ? prop + : JS_TO_CSS[prop] || + (JS_TO_CSS[prop] = prop.replace(CSS_REGEX, '-$&').toLowerCase()); + + let suffix = ';'; + if ( + typeof val === 'number' && + // Exclude custom-attributes + !name.startsWith('--') && + !IS_NON_DIMENSIONAL.test(name) + ) { + suffix = 'px;'; + } + str = str + name + ':' + val + suffix; + } + } + return name + '="' + encodeEntities(str) + '"'; + } + + if ( + value == null || + value === false || + typeof value === 'function' || + typeof value === 'object' + ) { + return ''; + } else if (value === true) return name; + + return name + '="' + encodeEntities('' + value) + '"'; +} + +/** + * Escape a dynamic child passed to `jsxTemplate`. This function + * is not expected to be used directly, but rather through a + * precompile JSX transform + * @param {*} value + * @returns {string | null | VNode | Array} + */ +function jsxEscape(value) { + if ( + value == null || + typeof value === 'boolean' || + typeof value === 'function' + ) { + return null; + } + + if (typeof value === 'object') { + // Check for VNode + if (value.constructor === undefined) return value; + + if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + value[i] = jsxEscape(value[i]); + } + return value; + } + } + + return encodeEntities('' + value); +} + +export { + createVNode as jsx, + createVNode as jsxs, + createVNode as jsxDEV, + Fragment, + // precompiled JSX transform + jsxTemplate, + jsxAttr, + jsxEscape +}; diff --git a/node_modules/preact/jsx-runtime/src/utils.js b/node_modules/preact/jsx-runtime/src/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..1274998624a5c243c36332bc8d0e18ee80f0e019 --- /dev/null +++ b/node_modules/preact/jsx-runtime/src/utils.js @@ -0,0 +1,36 @@ +const ENCODED_ENTITIES = /["&<]/; + +/** @param {string} str */ +export function encodeEntities(str) { + // Skip all work for strings with no entities needing encoding: + if (str.length === 0 || ENCODED_ENTITIES.test(str) === false) return str; + + let last = 0, + i = 0, + out = '', + ch = ''; + + // Seek forward in str until the next entity char: + for (; i < str.length; i++) { + switch (str.charCodeAt(i)) { + case 34: + ch = '"'; + break; + case 38: + ch = '&'; + break; + case 60: + ch = '<'; + break; + default: + continue; + } + // Append skipped/buffered characters and the encoded entity: + if (i !== last) out += str.slice(last, i); + out += ch; + // Start the next seek/buffer after the entity's offset: + last = i + 1; + } + if (i !== last) out += str.slice(last, i); + return out; +} diff --git a/node_modules/preact/package.json b/node_modules/preact/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2db27d19c7b069ca2a3058e60a850bdd696d95d8 --- /dev/null +++ b/node_modules/preact/package.json @@ -0,0 +1,258 @@ +{ + "name": "preact", + "amdName": "preact", + "version": "10.29.0", + "private": false, + "description": "Fast 3kb React-compatible Virtual DOM library.", + "main": "dist/preact.js", + "module": "dist/preact.module.js", + "umd:main": "dist/preact.umd.js", + "unpkg": "dist/preact.min.js", + "source": "src/index.js", + "typesVersions": { + "<=5.0": { + ".": ["./src/index-5.d.ts"] + } + }, + "exports": { + ".": { + "types@<=5.0": { + "types": "./src/index-5.d.ts" + }, + "types": "./src/index.d.ts", + "browser": "./dist/preact.module.js", + "umd": "./dist/preact.umd.js", + "import": "./dist/preact.mjs", + "require": "./dist/preact.js" + }, + "./compat": { + "types": "./compat/src/index.d.ts", + "browser": "./compat/dist/compat.module.js", + "umd": "./compat/dist/compat.umd.js", + "import": "./compat/dist/compat.mjs", + "require": "./compat/dist/compat.js" + }, + "./debug": { + "types": "./debug/src/index.d.ts", + "browser": "./debug/dist/debug.module.js", + "umd": "./debug/dist/debug.umd.js", + "import": "./debug/dist/debug.mjs", + "require": "./debug/dist/debug.js" + }, + "./devtools": { + "types": "./devtools/src/index.d.ts", + "browser": "./devtools/dist/devtools.module.js", + "umd": "./devtools/dist/devtools.umd.js", + "import": "./devtools/dist/devtools.mjs", + "require": "./devtools/dist/devtools.js" + }, + "./hooks": { + "types": "./hooks/src/index.d.ts", + "browser": "./hooks/dist/hooks.module.js", + "umd": "./hooks/dist/hooks.umd.js", + "import": "./hooks/dist/hooks.mjs", + "require": "./hooks/dist/hooks.js" + }, + "./test-utils": { + "types": "./test-utils/src/index.d.ts", + "browser": "./test-utils/dist/testUtils.module.js", + "umd": "./test-utils/dist/testUtils.umd.js", + "import": "./test-utils/dist/testUtils.mjs", + "require": "./test-utils/dist/testUtils.js" + }, + "./compat/test-utils": { + "types": "./test-utils/src/index.d.ts", + "browser": "./test-utils/dist/testUtils.module.js", + "umd": "./test-utils/dist/testUtils.umd.js", + "import": "./test-utils/dist/testUtils.mjs", + "require": "./test-utils/dist/testUtils.js" + }, + "./jsx-runtime": { + "types": "./jsx-runtime/src/index.d.ts", + "browser": "./jsx-runtime/dist/jsxRuntime.module.js", + "umd": "./jsx-runtime/dist/jsxRuntime.umd.js", + "import": "./jsx-runtime/dist/jsxRuntime.mjs", + "require": "./jsx-runtime/dist/jsxRuntime.js" + }, + "./jsx-dev-runtime": { + "types": "./jsx-runtime/src/index.d.ts", + "browser": "./jsx-runtime/dist/jsxRuntime.module.js", + "umd": "./jsx-runtime/dist/jsxRuntime.umd.js", + "import": "./jsx-runtime/dist/jsxRuntime.mjs", + "require": "./jsx-runtime/dist/jsxRuntime.js" + }, + "./compat/client": { + "types": "./compat/client.d.ts", + "import": "./compat/client.mjs", + "require": "./compat/client.js" + }, + "./compat/server": { + "browser": "./compat/server.browser.js", + "import": "./compat/server.mjs", + "require": "./compat/server.js" + }, + "./compat/server.browser": { + "types": "./compat/server.d.ts", + "default": "./compat/server.browser.js" + }, + "./compat/jsx-runtime": { + "types": "./jsx-runtime/src/index.d.ts", + "import": "./compat/jsx-runtime.mjs", + "require": "./compat/jsx-runtime.js" + }, + "./compat/jsx-dev-runtime": { + "types": "./jsx-runtime/src/index.d.ts", + "import": "./compat/jsx-dev-runtime.mjs", + "require": "./compat/jsx-dev-runtime.js" + }, + "./compat/scheduler": { + "import": "./compat/scheduler.mjs", + "require": "./compat/scheduler.js" + }, + "./package.json": "./package.json", + "./compat/package.json": "./compat/package.json", + "./debug/package.json": "./debug/package.json", + "./devtools/package.json": "./devtools/package.json", + "./hooks/package.json": "./hooks/package.json", + "./test-utils/package.json": "./test-utils/package.json", + "./jsx-runtime/package.json": "./jsx-runtime/package.json" + }, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + }, + "types": "src/index.d.ts", + "scripts": { + "prepare": "husky && run-s build", + "build": "npm-run-all --parallel 'build:*'", + "build:core": "microbundle build --raw --no-generateTypes -f cjs,esm,umd", + "build:core-min": "microbundle build --raw --no-generateTypes -f cjs,esm,umd,iife src/cjs.js -o dist/preact.min.js", + "build:debug": "microbundle build --raw --no-generateTypes -f cjs,esm,umd --cwd debug", + "build:devtools": "microbundle build --raw --no-generateTypes -f cjs,esm,umd --cwd devtools", + "build:hooks": "microbundle build --raw --no-generateTypes -f cjs,esm,umd --cwd hooks", + "build:test-utils": "microbundle build --raw --no-generateTypes -f cjs,esm,umd --cwd test-utils", + "build:compat": "microbundle build --raw --no-generateTypes -f cjs,esm,umd --cwd compat --globals 'preact/hooks=preactHooks'", + "build:jsx": "microbundle build --raw --no-generateTypes -f cjs,esm,umd --cwd jsx-runtime", + "postbuild": "node ./config/node-13-exports.js && node ./config/compat-entries.js", + "dev": "microbundle watch --raw --no-generateTypes --format cjs", + "dev:hooks": "microbundle watch --raw --no-generateTypes --format cjs --cwd hooks", + "dev:compat": "microbundle watch --raw --no-generateTypes --format cjs --cwd compat --globals 'preact/hooks=preactHooks'", + "test": "npm-run-all build lint test:unit", + "test:unit": "run-p test:mocha test:vitest:min test:ts", + "test:vitest": "cross-env COVERAGE=true vitest run", + "test:vitest:min": "cross-env MINIFY=true vitest run", + "test:vitest:watch": "vitest", + "test:ts": "run-p 'test:ts:*'", + "test:ts:core": "tsc -p test/ts/ && mocha --require \"@babel/register\" test/ts/**/*-test.js", + "test:ts:compat": "tsc -p compat/test/ts/", + "test:mocha": "mocha --recursive --require \"@babel/register\" test/shared test/node", + "test:mocha:watch": "npm run test:mocha -- --watch", + "lint": "run-s oxlint tsc", + "tsc": "tsc -p jsconfig-lint.json", + "oxlint": "oxlint -c oxlint.json src test/browser test/node test/shared debug compat hooks test-utils", + "format": "biome format --write .", + "format:check": "biome format ." + }, + "nano-staged": { + "**/*.{js,jsx,mjs,cjs,ts,tsx,yml,json,html,md,css,scss}": [ + "biome format --write --no-errors-on-unmatched" + ] + }, + "files": [ + "src", + "dist", + "compat/dist", + "compat/src", + "compat/client.d.ts", + "compat/client.js", + "compat/client.mjs", + "compat/server.browser.js", + "compat/server.js", + "compat/server.mjs", + "compat/scheduler.js", + "compat/scheduler.mjs", + "compat/test-utils.js", + "compat/test-utils.mjs", + "compat/jsx-runtime.js", + "compat/jsx-runtime.mjs", + "compat/jsx-dev-runtime.js", + "compat/jsx-dev-runtime.mjs", + "compat/package.json", + "debug/dist", + "debug/src", + "debug/package.json", + "devtools/dist", + "devtools/src", + "devtools/package.json", + "hooks/dist", + "hooks/src", + "hooks/package.json", + "jsx-runtime/dist", + "jsx-runtime/src", + "jsx-runtime/package.json", + "test-utils/src", + "test-utils/package.json", + "test-utils/dist" + ], + "keywords": [ + "preact", + "react", + "ui", + "user interface", + "virtual dom", + "vdom", + "components", + "dom diff", + "front-end", + "framework" + ], + "authors": [ + "The Preact Authors (https://github.com/preactjs/preact/contributors)" + ], + "repository": "preactjs/preact", + "bugs": "https://github.com/preactjs/preact/issues", + "homepage": "https://preactjs.com", + "devDependencies": { + "@actions/github": "^6.0.0", + "@actions/glob": "^0.5.0", + "@babel/core": "^7.26.0", + "@babel/plugin-transform-react-jsx": "^7.25.9", + "@babel/plugin-transform-react-jsx-source": "^7.25.9", + "@babel/preset-env": "^7.26.0", + "@babel/register": "^7.25.9", + "@biomejs/biome": "^1.9.4", + "@types/chai": "^5.0.1", + "@types/mocha": "^10.0.0", + "@types/node": "^18.19.87", + "@types/sinon": "^17.0.3", + "@vitest/browser": "^3.2.1", + "@vitest/coverage-istanbul": "^3.2.1", + "babel-plugin-transform-rename-properties": "0.1.0", + "chai": "^5.2.0", + "coveralls": "^3.1.1", + "cross-env": "^7.0.3", + "errorstacks": "^2.4.1", + "esbuild": "^0.24.0", + "husky": "^9.1.7", + "kolorist": "^1.8.0", + "microbundle": "^0.15.1", + "mocha": "^11.0.0", + "npm-run-all2": "^7.0.0", + "oxlint": "^0.15.12", + "preact-render-to-string": "^6.5.0", + "prop-types": "^15.8.1", + "sade": "^1.8.1", + "sinon": "^19.0.2", + "sinon-chai": "^4.0.0", + "terser": "5.16.0", + "typescript": "5.1.6", + "undici": "^4.12.0", + "vite": "^6.2.0", + "vitest": "^3.2.1", + "webdriverio": "^9.15.0" + }, + "volta": { + "node": "20.19.1" + } +} diff --git a/node_modules/preact/src/cjs.js b/node_modules/preact/src/cjs.js new file mode 100644 index 0000000000000000000000000000000000000000..b4721b1d44182a1684c52fd5dd78fb7c1a41ecc6 --- /dev/null +++ b/node_modules/preact/src/cjs.js @@ -0,0 +1,3 @@ +import * as preact from './index.js'; +if (typeof module < 'u') module.exports = preact; +else self.preact = preact; diff --git a/node_modules/preact/src/clone-element.js b/node_modules/preact/src/clone-element.js new file mode 100644 index 0000000000000000000000000000000000000000..671eb4e63fcedc10a68ad6de38970fca1dc841e4 --- /dev/null +++ b/node_modules/preact/src/clone-element.js @@ -0,0 +1,48 @@ +import { assign, slice } from './util'; +import { createVNode } from './create-element'; +import { NULL, UNDEFINED } from './constants'; + +/** + * Clones the given VNode, optionally adding attributes/props and replacing its + * children. + * @param {import('./internal').VNode} vnode The virtual DOM element to clone + * @param {object} props Attributes/props to add when cloning + * @param {Array} rest Any additional arguments will be used + * as replacement children. + * @returns {import('./internal').VNode} + */ +export function cloneElement(vnode, props, children) { + let normalizedProps = assign({}, vnode.props), + key, + ref, + i; + + let defaultProps; + + if (vnode.type && vnode.type.defaultProps) { + defaultProps = vnode.type.defaultProps; + } + + for (i in props) { + if (i == 'key') key = props[i]; + else if (i == 'ref') ref = props[i]; + else if (props[i] === UNDEFINED && defaultProps != UNDEFINED) { + normalizedProps[i] = defaultProps[i]; + } else { + normalizedProps[i] = props[i]; + } + } + + if (arguments.length > 2) { + normalizedProps.children = + arguments.length > 3 ? slice.call(arguments, 2) : children; + } + + return createVNode( + vnode.type, + normalizedProps, + key || vnode.key, + ref || vnode.ref, + NULL + ); +} diff --git a/node_modules/preact/src/component.js b/node_modules/preact/src/component.js new file mode 100644 index 0000000000000000000000000000000000000000..0de2d7aeba757800692dc0808ebe0e776cf5cb51 --- /dev/null +++ b/node_modules/preact/src/component.js @@ -0,0 +1,247 @@ +import { assign } from './util'; +import { diff, commitRoot } from './diff/index'; +import options from './options'; +import { Fragment } from './create-element'; +import { MODE_HYDRATE, NULL } from './constants'; + +/** + * Base Component class. Provides `setState()` and `forceUpdate()`, which + * trigger rendering + * @param {object} props The initial component props + * @param {object} context The initial context from parent components' + * getChildContext + */ +export function BaseComponent(props, context) { + this.props = props; + this.context = context; +} + +/** + * Update component state and schedule a re-render. + * @this {import('./internal').Component} + * @param {object | ((s: object, p: object) => object)} update A hash of state + * properties to update with new values or a function that given the current + * state and props returns a new partial state + * @param {() => void} [callback] A function to be called once component state is + * updated + */ +BaseComponent.prototype.setState = function (update, callback) { + // only clone state when copying to nextState the first time. + let s; + if (this._nextState != NULL && this._nextState != this.state) { + s = this._nextState; + } else { + s = this._nextState = assign({}, this.state); + } + + if (typeof update == 'function') { + // Some libraries like `immer` mark the current state as readonly, + // preventing us from mutating it, so we need to clone it. See #2716 + update = update(assign({}, s), this.props); + } + + if (update) { + assign(s, update); + } + + // Skip update if updater function returned null + if (update == NULL) return; + + if (this._vnode) { + if (callback) { + this._stateCallbacks.push(callback); + } + enqueueRender(this); + } +}; + +/** + * Immediately perform a synchronous re-render of the component + * @this {import('./internal').Component} + * @param {() => void} [callback] A function to be called after component is + * re-rendered + */ +BaseComponent.prototype.forceUpdate = function (callback) { + if (this._vnode) { + // Set render mode so that we can differentiate where the render request + // is coming from. We need this because forceUpdate should never call + // shouldComponentUpdate + this._force = true; + if (callback) this._renderCallbacks.push(callback); + enqueueRender(this); + } +}; + +/** + * Accepts `props` and `state`, and returns a new Virtual DOM tree to build. + * Virtual DOM is generally constructed via [JSX](https://jasonformat.com/wtf-is-jsx). + * @param {object} props Props (eg: JSX attributes) received from parent + * element/component + * @param {object} state The component's current state + * @param {object} context Context object, as returned by the nearest + * ancestor's `getChildContext()` + * @returns {ComponentChildren | void} + */ +BaseComponent.prototype.render = Fragment; + +/** + * @param {import('./internal').VNode} vnode + * @param {number | null} [childIndex] + */ +export function getDomSibling(vnode, childIndex) { + if (childIndex == NULL) { + // Use childIndex==null as a signal to resume the search from the vnode's sibling + return vnode._parent + ? getDomSibling(vnode._parent, vnode._index + 1) + : NULL; + } + + let sibling; + for (; childIndex < vnode._children.length; childIndex++) { + sibling = vnode._children[childIndex]; + + if (sibling != NULL && sibling._dom != NULL) { + // Since updateParentDomPointers keeps _dom pointer correct, + // we can rely on _dom to tell us if this subtree contains a + // rendered DOM node, and what the first rendered DOM node is + return sibling._dom; + } + } + + // If we get here, we have not found a DOM node in this vnode's children. + // We must resume from this vnode's sibling (in it's parent _children array) + // Only climb up and search the parent if we aren't searching through a DOM + // VNode (meaning we reached the DOM parent of the original vnode that began + // the search) + return typeof vnode.type == 'function' ? getDomSibling(vnode) : NULL; +} + +/** + * Trigger in-place re-rendering of a component. + * @param {import('./internal').Component} component The component to rerender + */ +function renderComponent(component) { + if (component._parentDom && component._dirty) { + let oldVNode = component._vnode, + oldDom = oldVNode._dom, + commitQueue = [], + refQueue = [], + newVNode = assign({}, oldVNode); + newVNode._original = oldVNode._original + 1; + if (options.vnode) options.vnode(newVNode); + + diff( + component._parentDom, + newVNode, + oldVNode, + component._globalContext, + component._parentDom.namespaceURI, + oldVNode._flags & MODE_HYDRATE ? [oldDom] : NULL, + commitQueue, + oldDom == NULL ? getDomSibling(oldVNode) : oldDom, + !!(oldVNode._flags & MODE_HYDRATE), + refQueue + ); + + newVNode._original = oldVNode._original; + newVNode._parent._children[newVNode._index] = newVNode; + commitRoot(commitQueue, newVNode, refQueue); + oldVNode._dom = oldVNode._parent = null; + + if (newVNode._dom != oldDom) { + updateParentDomPointers(newVNode); + } + } +} + +/** + * @param {import('./internal').VNode} vnode + */ +function updateParentDomPointers(vnode) { + if ((vnode = vnode._parent) != NULL && vnode._component != NULL) { + vnode._dom = vnode._component.base = NULL; + vnode._children.some(child => { + if (child != NULL && child._dom != NULL) { + return (vnode._dom = vnode._component.base = child._dom); + } + }); + + return updateParentDomPointers(vnode); + } +} + +/** + * The render queue + * @type {Array} + */ +let rerenderQueue = []; + +/* + * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is + * important that contributors to Preact can consistently reason about what calls to `setState`, etc. + * do, and when their effects will be applied. See the links below for some further reading on designing + * asynchronous APIs. + * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony) + * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/) + */ + +let prevDebounce; + +const defer = + typeof Promise == 'function' + ? Promise.prototype.then.bind(Promise.resolve()) + : setTimeout; + +/** + * Enqueue a rerender of a component + * @param {import('./internal').Component} c The component to rerender + */ +export function enqueueRender(c) { + if ( + (!c._dirty && + (c._dirty = true) && + rerenderQueue.push(c) && + !process._rerenderCount++) || + prevDebounce != options.debounceRendering + ) { + prevDebounce = options.debounceRendering; + (prevDebounce || defer)(process); + } +} + +/** + * @param {import('./internal').Component} a + * @param {import('./internal').Component} b + */ +const depthSort = (a, b) => a._vnode._depth - b._vnode._depth; + +/** Flush the render queue by rerendering all queued components */ +function process() { + try { + let c, + l = 1; + + // Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary + // process() calls from getting scheduled while `queue` is still being consumed. + while (rerenderQueue.length) { + // Keep the rerender queue sorted by (depth, insertion order). The queue + // will initially be sorted on the first iteration only if it has more than 1 item. + // + // New items can be added to the queue e.g. when rerendering a provider, so we want to + // keep the order from top to bottom with those new items so we can handle them in a + // single pass + if (rerenderQueue.length > l) { + rerenderQueue.sort(depthSort); + } + + c = rerenderQueue.shift(); + l = rerenderQueue.length; + + renderComponent(c); + } + } finally { + rerenderQueue.length = process._rerenderCount = 0; + } +} + +process._rerenderCount = 0; diff --git a/node_modules/preact/src/constants.js b/node_modules/preact/src/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..c60df07b931bca9005dfa6a7b358e2dd730e24ae --- /dev/null +++ b/node_modules/preact/src/constants.js @@ -0,0 +1,22 @@ +/** Normal hydration that attaches to a DOM tree but does not diff it. */ +export const MODE_HYDRATE = 1 << 5; +/** Signifies this VNode suspended on the previous render */ +export const MODE_SUSPENDED = 1 << 7; +/** Indicates that this node needs to be inserted while patching children */ +export const INSERT_VNODE = 1 << 2; +/** Indicates a VNode has been matched with another VNode in the diff */ +export const MATCHED = 1 << 1; + +/** Reset all mode flags */ +export const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED); + +export const SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; +export const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'; +export const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML'; + +export const NULL = null; +export const UNDEFINED = undefined; +export const EMPTY_OBJ = /** @type {any} */ ({}); +export const EMPTY_ARR = []; +export const IS_NON_DIMENSIONAL = + /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i; diff --git a/node_modules/preact/src/create-context.js b/node_modules/preact/src/create-context.js new file mode 100644 index 0000000000000000000000000000000000000000..851b95acbc95cfa13e26c84d53495ffb01cce6d2 --- /dev/null +++ b/node_modules/preact/src/create-context.js @@ -0,0 +1,60 @@ +import { enqueueRender } from './component'; +import { NULL } from './constants'; + +export let i = 0; + +export function createContext(defaultValue) { + function Context(props) { + if (!this.getChildContext) { + /** @type {Set | null} */ + let subs = new Set(); + let ctx = {}; + ctx[Context._id] = this; + + this.getChildContext = () => ctx; + + this.componentWillUnmount = () => { + subs = NULL; + }; + + this.shouldComponentUpdate = function (_props) { + // @ts-expect-error even + if (this.props.value != _props.value) { + subs.forEach(c => { + c._force = true; + enqueueRender(c); + }); + } + }; + + this.sub = c => { + subs.add(c); + let old = c.componentWillUnmount; + c.componentWillUnmount = () => { + if (subs) { + subs.delete(c); + } + if (old) old.call(c); + }; + }; + } + + return props.children; + } + + Context._id = '__cC' + i++; + Context._defaultValue = defaultValue; + + /** @type {import('./internal').FunctionComponent} */ + Context.Consumer = (props, contextValue) => { + return props.children(contextValue); + }; + + // we could also get rid of _contextRef entirely + Context.Provider = + Context._contextRef = + Context.Consumer.contextType = + Context; + + return Context; +} diff --git a/node_modules/preact/src/create-element.js b/node_modules/preact/src/create-element.js new file mode 100644 index 0000000000000000000000000000000000000000..53376382317fa0a43d741e23553b9cc51313656f --- /dev/null +++ b/node_modules/preact/src/create-element.js @@ -0,0 +1,97 @@ +import { slice } from './util'; +import options from './options'; +import { NULL, UNDEFINED } from './constants'; + +let vnodeId = 0; + +/** + * Create an virtual node (used for JSX) + * @param {import('./internal').VNode["type"]} type The node name or Component constructor for this + * virtual node + * @param {object | null | undefined} [props] The properties of the virtual node + * @param {Array} [children] The children of the + * virtual node + * @returns {import('./internal').VNode} + */ +export function createElement(type, props, children) { + let normalizedProps = {}, + key, + ref, + i; + for (i in props) { + if (i == 'key') key = props[i]; + else if (i == 'ref') ref = props[i]; + else normalizedProps[i] = props[i]; + } + + if (arguments.length > 2) { + normalizedProps.children = + arguments.length > 3 ? slice.call(arguments, 2) : children; + } + + // If a Component VNode, check for and apply defaultProps + // Note: type may be undefined in development, must never error here. + if (typeof type == 'function' && type.defaultProps != NULL) { + for (i in type.defaultProps) { + if (normalizedProps[i] === UNDEFINED) { + normalizedProps[i] = type.defaultProps[i]; + } + } + } + + return createVNode(type, normalizedProps, key, ref, NULL); +} + +/** + * Create a VNode (used internally by Preact) + * @param {import('./internal').VNode["type"]} type The node name or Component + * Constructor for this virtual node + * @param {object | string | number | null} props The properties of this virtual node. + * If this virtual node represents a text node, this is the text of the node (string or number). + * @param {string | number | null} key The key for this virtual node, used when + * diffing it against its children + * @param {import('./internal').VNode["ref"]} ref The ref property that will + * receive a reference to its created child + * @returns {import('./internal').VNode} + */ +export function createVNode(type, props, key, ref, original) { + // V8 seems to be better at detecting type shapes if the object is allocated from the same call site + // Do not inline into createElement and coerceToVNode! + /** @type {import('./internal').VNode} */ + const vnode = { + type, + props, + key, + ref, + _children: NULL, + _parent: NULL, + _depth: 0, + _dom: NULL, + _component: NULL, + constructor: UNDEFINED, + _original: original == NULL ? ++vnodeId : original, + _index: -1, + _flags: 0 + }; + + // Only invoke the vnode hook if this was *not* a direct copy: + if (original == NULL && options.vnode != NULL) options.vnode(vnode); + + return vnode; +} + +export function createRef() { + return { current: NULL }; +} + +export function Fragment(props) { + return props.children; +} + +/** + * Check if a the argument is a valid Preact VNode. + * @param {*} vnode + * @returns {vnode is VNode} + */ +export const isValidElement = vnode => + vnode != NULL && vnode.constructor === UNDEFINED; diff --git a/node_modules/preact/src/diff/catch-error.js b/node_modules/preact/src/diff/catch-error.js new file mode 100644 index 0000000000000000000000000000000000000000..ada46f1942cfb66c1801a637b433378f20905800 --- /dev/null +++ b/node_modules/preact/src/diff/catch-error.js @@ -0,0 +1,46 @@ +import { NULL } from '../constants'; + +/** + * Find the closest error boundary to a thrown error and call it + * @param {object} error The thrown value + * @param {import('../internal').VNode} vnode The vnode that threw the error that was caught (except + * for unmounting when this parameter is the highest parent that was being + * unmounted) + * @param {import('../internal').VNode} [oldVNode] + * @param {import('../internal').ErrorInfo} [errorInfo] + */ +export function _catchError(error, vnode, oldVNode, errorInfo) { + /** @type {import('../internal').Component} */ + let component, + /** @type {import('../internal').ComponentType} */ + ctor, + /** @type {boolean} */ + handled; + + for (; (vnode = vnode._parent); ) { + if ((component = vnode._component) && !component._processingException) { + try { + ctor = component.constructor; + + if (ctor && ctor.getDerivedStateFromError != NULL) { + component.setState(ctor.getDerivedStateFromError(error)); + handled = component._dirty; + } + + if (component.componentDidCatch != NULL) { + component.componentDidCatch(error, errorInfo || {}); + handled = component._dirty; + } + + // This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration. + if (handled) { + return (component._pendingError = component); + } + } catch (e) { + error = e; + } + } + } + + throw error; +} diff --git a/node_modules/preact/src/diff/children.js b/node_modules/preact/src/diff/children.js new file mode 100644 index 0000000000000000000000000000000000000000..4d68d95618f2e9a6370ec3aa75fb90c2c7d22e3b --- /dev/null +++ b/node_modules/preact/src/diff/children.js @@ -0,0 +1,448 @@ +import { diff, unmount, applyRef } from './index'; +import { createVNode, Fragment } from '../create-element'; +import { + EMPTY_OBJ, + EMPTY_ARR, + INSERT_VNODE, + MATCHED, + UNDEFINED, + NULL +} from '../constants'; +import { isArray } from '../util'; +import { getDomSibling } from '../component'; + +/** + * @typedef {import('../internal').ComponentChildren} ComponentChildren + * @typedef {import('../internal').Component} Component + * @typedef {import('../internal').PreactElement} PreactElement + * @typedef {import('../internal').VNode} VNode + */ + +/** + * Diff the children of a virtual node + * @param {PreactElement} parentDom The DOM element whose children are being + * diffed + * @param {ComponentChildren[]} renderResult + * @param {VNode} newParentVNode The new virtual node whose children should be + * diff'ed against oldParentVNode + * @param {VNode} oldParentVNode The old virtual node whose children should be + * diff'ed against newParentVNode + * @param {object} globalContext The current context object - modified by + * getChildContext + * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML) + * @param {Array} excessDomChildren + * @param {Array} commitQueue List of components which have callbacks + * to invoke in commitRoot + * @param {PreactElement} oldDom The current attached DOM element any new dom + * elements should be placed around. Likely `null` on first render (except when + * hydrating). Can be a sibling DOM element when diffing Fragments that have + * siblings. In most cases, it starts out as `oldChildren[0]._dom`. + * @param {boolean} isHydrating Whether or not we are in hydration + * @param {any[]} refQueue an array of elements needed to invoke refs + */ +export function diffChildren( + parentDom, + renderResult, + newParentVNode, + oldParentVNode, + globalContext, + namespace, + excessDomChildren, + commitQueue, + oldDom, + isHydrating, + refQueue +) { + let i, + /** @type {VNode} */ + oldVNode, + /** @type {VNode} */ + childVNode, + /** @type {PreactElement} */ + newDom, + /** @type {PreactElement} */ + firstChildDom; + + // This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR + // as EMPTY_OBJ._children should be `undefined`. + /** @type {VNode[]} */ + let oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR; + + let newChildrenLength = renderResult.length; + + oldDom = constructNewChildrenArray( + newParentVNode, + renderResult, + oldChildren, + oldDom, + newChildrenLength + ); + + for (i = 0; i < newChildrenLength; i++) { + childVNode = newParentVNode._children[i]; + if (childVNode == NULL) continue; + + // At this point, constructNewChildrenArray has assigned _index to be the + // matchingIndex for this VNode's oldVNode (or -1 if there is no oldVNode). + oldVNode = + (childVNode._index != -1 && oldChildren[childVNode._index]) || EMPTY_OBJ; + + // Update childVNode._index to its final index + childVNode._index = i; + + // Morph the old element into the new one, but don't append it to the dom yet + let result = diff( + parentDom, + childVNode, + oldVNode, + globalContext, + namespace, + excessDomChildren, + commitQueue, + oldDom, + isHydrating, + refQueue + ); + + // Adjust DOM nodes + newDom = childVNode._dom; + if (childVNode.ref && oldVNode.ref != childVNode.ref) { + if (oldVNode.ref) { + applyRef(oldVNode.ref, NULL, childVNode); + } + refQueue.push( + childVNode.ref, + childVNode._component || newDom, + childVNode + ); + } + + if (firstChildDom == NULL && newDom != NULL) { + firstChildDom = newDom; + } + + let shouldPlace = !!(childVNode._flags & INSERT_VNODE); + if (shouldPlace || oldVNode._children === childVNode._children) { + oldDom = insert(childVNode, oldDom, parentDom, shouldPlace); + } else if (typeof childVNode.type == 'function' && result !== UNDEFINED) { + oldDom = result; + } else if (newDom) { + oldDom = newDom.nextSibling; + } + + // Unset diffing flags + childVNode._flags &= ~(INSERT_VNODE | MATCHED); + } + + newParentVNode._dom = firstChildDom; + + return oldDom; +} + +/** + * @param {VNode} newParentVNode + * @param {ComponentChildren[]} renderResult + * @param {VNode[]} oldChildren + */ +function constructNewChildrenArray( + newParentVNode, + renderResult, + oldChildren, + oldDom, + newChildrenLength +) { + /** @type {number} */ + let i; + /** @type {VNode} */ + let childVNode; + /** @type {VNode} */ + let oldVNode; + + let oldChildrenLength = oldChildren.length, + remainingOldChildren = oldChildrenLength; + + let skew = 0; + + newParentVNode._children = new Array(newChildrenLength); + for (i = 0; i < newChildrenLength; i++) { + // @ts-expect-error We are reusing the childVNode variable to hold both the + // pre and post normalized childVNode + childVNode = renderResult[i]; + + if ( + childVNode == NULL || + typeof childVNode == 'boolean' || + typeof childVNode == 'function' + ) { + newParentVNode._children[i] = NULL; + continue; + } + // If this newVNode is being reused (e.g.

{reuse}{reuse}
) in the same diff, + // or we are rendering a component (e.g. setState) copy the oldVNodes so it can have + // it's own DOM & etc. pointers + else if ( + typeof childVNode == 'string' || + typeof childVNode == 'number' || + // eslint-disable-next-line valid-typeof + typeof childVNode == 'bigint' || + childVNode.constructor == String + ) { + childVNode = newParentVNode._children[i] = createVNode( + NULL, + childVNode, + NULL, + NULL, + NULL + ); + } else if (isArray(childVNode)) { + childVNode = newParentVNode._children[i] = createVNode( + Fragment, + { children: childVNode }, + NULL, + NULL, + NULL + ); + } else if (childVNode.constructor === UNDEFINED && childVNode._depth > 0) { + // VNode is already in use, clone it. This can happen in the following + // scenario: + // const reuse =
+ //
{reuse}{reuse}
+ childVNode = newParentVNode._children[i] = createVNode( + childVNode.type, + childVNode.props, + childVNode.key, + childVNode.ref ? childVNode.ref : NULL, + childVNode._original + ); + } else { + newParentVNode._children[i] = childVNode; + } + + const skewedIndex = i + skew; + childVNode._parent = newParentVNode; + childVNode._depth = newParentVNode._depth + 1; + + // Temporarily store the matchingIndex on the _index property so we can pull + // out the oldVNode in diffChildren. We'll override this to the VNode's + // final index after using this property to get the oldVNode + const matchingIndex = (childVNode._index = findMatchingIndex( + childVNode, + oldChildren, + skewedIndex, + remainingOldChildren + )); + + oldVNode = NULL; + if (matchingIndex != -1) { + oldVNode = oldChildren[matchingIndex]; + remainingOldChildren--; + if (oldVNode) { + oldVNode._flags |= MATCHED; + } + } + + // Here, we define isMounting for the purposes of the skew diffing + // algorithm. Nodes that are unsuspending are considered mounting and we detect + // this by checking if oldVNode._original == null + const isMounting = oldVNode == NULL || oldVNode._original == NULL; + + if (isMounting) { + if (matchingIndex == -1) { + // When the array of children is growing we need to decrease the skew + // as we are adding a new element to the array. + // Example: + // [1, 2, 3] --> [0, 1, 2, 3] + // oldChildren newChildren + // + // The new element is at index 0, so our skew is 0, + // we need to decrease the skew as we are adding a new element. + // The decrease will cause us to compare the element at position 1 + // with value 1 with the element at position 0 with value 0. + // + // A linear concept is applied when the array is shrinking, + // if the length is unchanged we can assume that no skew + // changes are needed. + if (newChildrenLength > oldChildrenLength) { + skew--; + } else if (newChildrenLength < oldChildrenLength) { + skew++; + } + } + + // If we are mounting a DOM VNode, mark it for insertion + if (typeof childVNode.type != 'function') { + childVNode._flags |= INSERT_VNODE; + } + } else if (matchingIndex != skewedIndex) { + // When we move elements around i.e. [0, 1, 2] --> [1, 0, 2] + // --> we diff 1, we find it at position 1 while our skewed index is 0 and our skew is 0 + // we set the skew to 1 as we found an offset. + // --> we diff 0, we find it at position 0 while our skewed index is at 2 and our skew is 1 + // this makes us increase the skew again. + // --> we diff 2, we find it at position 2 while our skewed index is at 4 and our skew is 2 + // + // this becomes an optimization question where currently we see a 1 element offset as an insertion + // or deletion i.e. we optimize for [0, 1, 2] --> [9, 0, 1, 2] + // while a more than 1 offset we see as a swap. + // We could probably build heuristics for having an optimized course of action here as well, but + // might go at the cost of some bytes. + // + // If we wanted to optimize for i.e. only swaps we'd just do the last two code-branches and have + // only the first item be a re-scouting and all the others fall in their skewed counter-part. + // We could also further optimize for swaps + if (matchingIndex == skewedIndex - 1) { + skew--; + } else if (matchingIndex == skewedIndex + 1) { + skew++; + } else { + if (matchingIndex > skewedIndex) { + skew--; + } else { + skew++; + } + + // Move this VNode's DOM if the original index (matchingIndex) doesn't + // match the new skew index (i + new skew) + // In the former two branches we know that it matches after skewing + childVNode._flags |= INSERT_VNODE; + } + } + } + + // Remove remaining oldChildren if there are any. Loop forwards so that as we + // unmount DOM from the beginning of the oldChildren, we can adjust oldDom to + // point to the next child, which needs to be the first DOM node that won't be + // unmounted. + if (remainingOldChildren) { + for (i = 0; i < oldChildrenLength; i++) { + oldVNode = oldChildren[i]; + if (oldVNode != NULL && (oldVNode._flags & MATCHED) == 0) { + if (oldVNode._dom == oldDom) { + oldDom = getDomSibling(oldVNode); + } + + unmount(oldVNode, oldVNode); + } + } + } + + return oldDom; +} + +/** + * @param {VNode} parentVNode + * @param {PreactElement} oldDom + * @param {PreactElement} parentDom + * @param {boolean} shouldPlace + * @returns {PreactElement} + */ +function insert(parentVNode, oldDom, parentDom, shouldPlace) { + // Note: VNodes in nested suspended trees may be missing _children. + + if (typeof parentVNode.type == 'function') { + let children = parentVNode._children; + for (let i = 0; children && i < children.length; i++) { + if (children[i]) { + // If we enter this code path on sCU bailout, where we copy + // oldVNode._children to newVNode._children, we need to update the old + // children's _parent pointer to point to the newVNode (parentVNode + // here). + children[i]._parent = parentVNode; + oldDom = insert(children[i], oldDom, parentDom, shouldPlace); + } + } + + return oldDom; + } else if (parentVNode._dom != oldDom) { + if (shouldPlace) { + if (oldDom && parentVNode.type && !oldDom.parentNode) { + oldDom = getDomSibling(parentVNode); + } + parentDom.insertBefore(parentVNode._dom, oldDom || NULL); + } + oldDom = parentVNode._dom; + } + + do { + oldDom = oldDom && oldDom.nextSibling; + } while (oldDom != NULL && oldDom.nodeType == 8); + + return oldDom; +} + +/** + * Flatten and loop through the children of a virtual node + * @param {ComponentChildren} children The unflattened children of a virtual + * node + * @returns {VNode[]} + */ +export function toChildArray(children, out) { + out = out || []; + if (children == NULL || typeof children == 'boolean') { + } else if (isArray(children)) { + children.some(child => { + toChildArray(child, out); + }); + } else { + out.push(children); + } + return out; +} + +/** + * @param {VNode} childVNode + * @param {VNode[]} oldChildren + * @param {number} skewedIndex + * @param {number} remainingOldChildren + * @returns {number} + */ +function findMatchingIndex( + childVNode, + oldChildren, + skewedIndex, + remainingOldChildren +) { + const key = childVNode.key; + const type = childVNode.type; + let oldVNode = oldChildren[skewedIndex]; + const matched = oldVNode != NULL && (oldVNode._flags & MATCHED) == 0; + + // We only need to perform a search if there are more children + // (remainingOldChildren) to search. However, if the oldVNode we just looked + // at skewedIndex was not already used in this diff, then there must be at + // least 1 other (so greater than 1) remainingOldChildren to attempt to match + // against. So the following condition checks that ensuring + // remainingOldChildren > 1 if the oldVNode is not already used/matched. Else + // if the oldVNode was null or matched, then there could needs to be at least + // 1 (aka `remainingOldChildren > 0`) children to find and compare against. + // + // If there is an unkeyed functional VNode, that isn't a built-in like our Fragment, + // we should not search as we risk re-using state of an unrelated VNode. (reverted for now) + let shouldSearch = + // (typeof type != 'function' || type === Fragment || key) && + remainingOldChildren > (matched ? 1 : 0); + + if ( + (oldVNode === NULL && key == null) || + (matched && key == oldVNode.key && type == oldVNode.type) + ) { + return skewedIndex; + } else if (shouldSearch) { + let x = skewedIndex - 1; + let y = skewedIndex + 1; + while (x >= 0 || y < oldChildren.length) { + const childIndex = x >= 0 ? x-- : y++; + oldVNode = oldChildren[childIndex]; + if ( + oldVNode != NULL && + (oldVNode._flags & MATCHED) == 0 && + key == oldVNode.key && + type == oldVNode.type + ) { + return childIndex; + } + } + } + + return -1; +} diff --git a/node_modules/preact/src/diff/index.js b/node_modules/preact/src/diff/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8344b019e9f71bf0854ab774e0c48bb42617329f --- /dev/null +++ b/node_modules/preact/src/diff/index.js @@ -0,0 +1,673 @@ +import { + EMPTY_ARR, + EMPTY_OBJ, + MATH_NAMESPACE, + MODE_HYDRATE, + MODE_SUSPENDED, + NULL, + RESET_MODE, + SVG_NAMESPACE, + UNDEFINED, + XHTML_NAMESPACE +} from '../constants'; +import { BaseComponent, getDomSibling } from '../component'; +import { Fragment } from '../create-element'; +import { diffChildren } from './children'; +import { setProperty } from './props'; +import { assign, isArray, removeNode, slice } from '../util'; +import options from '../options'; + +/** + * @typedef {import('../internal').ComponentChildren} ComponentChildren + * @typedef {import('../internal').Component} Component + * @typedef {import('../internal').PreactElement} PreactElement + * @typedef {import('../internal').VNode} VNode + */ + +/** + * @template {any} T + * @typedef {import('../internal').Ref} Ref + */ + +/** + * Diff two virtual nodes and apply proper changes to the DOM + * @param {PreactElement} parentDom The parent of the DOM element + * @param {VNode} newVNode The new virtual node + * @param {VNode} oldVNode The old virtual node + * @param {object} globalContext The current context object. Modified by + * getChildContext + * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML) + * @param {Array} excessDomChildren + * @param {Array} commitQueue List of components which have callbacks + * to invoke in commitRoot + * @param {PreactElement} oldDom The current attached DOM element any new dom + * elements should be placed around. Likely `null` on first render (except when + * hydrating). Can be a sibling DOM element when diffing Fragments that have + * siblings. In most cases, it starts out as `oldChildren[0]._dom`. + * @param {boolean} isHydrating Whether or not we are in hydration + * @param {any[]} refQueue an array of elements needed to invoke refs + */ +export function diff( + parentDom, + newVNode, + oldVNode, + globalContext, + namespace, + excessDomChildren, + commitQueue, + oldDom, + isHydrating, + refQueue +) { + /** @type {any} */ + let tmp, + newType = newVNode.type; + + // When passing through createElement it assigns the object + // constructor as undefined. This to prevent JSON-injection. + if (newVNode.constructor !== UNDEFINED) return NULL; + + // If the previous diff bailed out, resume creating/hydrating. + if (oldVNode._flags & MODE_SUSPENDED) { + isHydrating = !!(oldVNode._flags & MODE_HYDRATE); + oldDom = newVNode._dom = oldVNode._dom; + excessDomChildren = [oldDom]; + } + + if ((tmp = options._diff)) tmp(newVNode); + + outer: if (typeof newType == 'function') { + try { + let c, isNew, oldProps, oldState, snapshot, clearProcessingException; + let newProps = newVNode.props; + const isClassComponent = newType.prototype && newType.prototype.render; + + // Necessary for createContext api. Setting this property will pass + // the context value as `this.context` just for this component. + tmp = newType.contextType; + let provider = tmp && globalContext[tmp._id]; + let componentContext = tmp + ? provider + ? provider.props.value + : tmp._defaultValue + : globalContext; + + // Get component and set it to `c` + if (oldVNode._component) { + c = newVNode._component = oldVNode._component; + clearProcessingException = c._processingException = c._pendingError; + } else { + // Instantiate the new component + if (isClassComponent) { + // @ts-expect-error The check above verifies that newType is suppose to be constructed + newVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap + } else { + // @ts-expect-error Trust me, Component implements the interface we want + newVNode._component = c = new BaseComponent( + newProps, + componentContext + ); + c.constructor = newType; + c.render = doRender; + } + if (provider) provider.sub(c); + + if (!c.state) c.state = {}; + c._globalContext = globalContext; + isNew = c._dirty = true; + c._renderCallbacks = []; + c._stateCallbacks = []; + } + + // Invoke getDerivedStateFromProps + if (isClassComponent && c._nextState == NULL) { + c._nextState = c.state; + } + + if (isClassComponent && newType.getDerivedStateFromProps != NULL) { + if (c._nextState == c.state) { + c._nextState = assign({}, c._nextState); + } + + assign( + c._nextState, + newType.getDerivedStateFromProps(newProps, c._nextState) + ); + } + + oldProps = c.props; + oldState = c.state; + c._vnode = newVNode; + + // Invoke pre-render lifecycle methods + if (isNew) { + if ( + isClassComponent && + newType.getDerivedStateFromProps == NULL && + c.componentWillMount != NULL + ) { + c.componentWillMount(); + } + + if (isClassComponent && c.componentDidMount != NULL) { + c._renderCallbacks.push(c.componentDidMount); + } + } else { + if ( + isClassComponent && + newType.getDerivedStateFromProps == NULL && + newProps !== oldProps && + c.componentWillReceiveProps != NULL + ) { + c.componentWillReceiveProps(newProps, componentContext); + } + + if ( + newVNode._original == oldVNode._original || + (!c._force && + c.shouldComponentUpdate != NULL && + c.shouldComponentUpdate( + newProps, + c._nextState, + componentContext + ) === false) + ) { + // More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8 + if (newVNode._original != oldVNode._original) { + // When we are dealing with a bail because of sCU we have to update + // the props, state and dirty-state. + // when we are dealing with strict-equality we don't as the child could still + // be dirtied see #3883 + c.props = newProps; + c.state = c._nextState; + c._dirty = false; + } + + newVNode._dom = oldVNode._dom; + newVNode._children = oldVNode._children; + newVNode._children.some(vnode => { + if (vnode) vnode._parent = newVNode; + }); + + EMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks); + c._stateCallbacks = []; + + if (c._renderCallbacks.length) { + commitQueue.push(c); + } + + break outer; + } + + if (c.componentWillUpdate != NULL) { + c.componentWillUpdate(newProps, c._nextState, componentContext); + } + + if (isClassComponent && c.componentDidUpdate != NULL) { + c._renderCallbacks.push(() => { + c.componentDidUpdate(oldProps, oldState, snapshot); + }); + } + } + + c.context = componentContext; + c.props = newProps; + c._parentDom = parentDom; + c._force = false; + + let renderHook = options._render, + count = 0; + if (isClassComponent) { + c.state = c._nextState; + c._dirty = false; + + if (renderHook) renderHook(newVNode); + + tmp = c.render(c.props, c.state, c.context); + + EMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks); + c._stateCallbacks = []; + } else { + do { + c._dirty = false; + if (renderHook) renderHook(newVNode); + + tmp = c.render(c.props, c.state, c.context); + + // Handle setState called in render, see #2553 + c.state = c._nextState; + } while (c._dirty && ++count < 25); + } + + // Handle setState called in render, see #2553 + c.state = c._nextState; + + if (c.getChildContext != NULL) { + globalContext = assign(assign({}, globalContext), c.getChildContext()); + } + + if (isClassComponent && !isNew && c.getSnapshotBeforeUpdate != NULL) { + snapshot = c.getSnapshotBeforeUpdate(oldProps, oldState); + } + + let renderResult = + tmp != NULL && tmp.type === Fragment && tmp.key == NULL + ? cloneNode(tmp.props.children) + : tmp; + + oldDom = diffChildren( + parentDom, + isArray(renderResult) ? renderResult : [renderResult], + newVNode, + oldVNode, + globalContext, + namespace, + excessDomChildren, + commitQueue, + oldDom, + isHydrating, + refQueue + ); + + c.base = newVNode._dom; + + // We successfully rendered this VNode, unset any stored hydration/bailout state: + newVNode._flags &= RESET_MODE; + + if (c._renderCallbacks.length) { + commitQueue.push(c); + } + + if (clearProcessingException) { + c._pendingError = c._processingException = NULL; + } + } catch (e) { + newVNode._original = NULL; + // if hydrating or creating initial tree, bailout preserves DOM: + if (isHydrating || excessDomChildren != NULL) { + if (e.then) { + newVNode._flags |= isHydrating + ? MODE_HYDRATE | MODE_SUSPENDED + : MODE_SUSPENDED; + + while (oldDom && oldDom.nodeType == 8 && oldDom.nextSibling) { + oldDom = oldDom.nextSibling; + } + + excessDomChildren[excessDomChildren.indexOf(oldDom)] = NULL; + newVNode._dom = oldDom; + } else { + for (let i = excessDomChildren.length; i--; ) { + removeNode(excessDomChildren[i]); + } + markAsForce(newVNode); + } + } else { + newVNode._dom = oldVNode._dom; + newVNode._children = oldVNode._children; + if (!e.then) markAsForce(newVNode); + } + options._catchError(e, newVNode, oldVNode); + } + } else if ( + excessDomChildren == NULL && + newVNode._original == oldVNode._original + ) { + newVNode._children = oldVNode._children; + newVNode._dom = oldVNode._dom; + } else { + oldDom = newVNode._dom = diffElementNodes( + oldVNode._dom, + newVNode, + oldVNode, + globalContext, + namespace, + excessDomChildren, + commitQueue, + isHydrating, + refQueue + ); + } + + if ((tmp = options.diffed)) tmp(newVNode); + + return newVNode._flags & MODE_SUSPENDED ? undefined : oldDom; +} + +function markAsForce(vnode) { + if (vnode) { + if (vnode._component) vnode._component._force = true; + if (vnode._children) vnode._children.some(markAsForce); + } +} + +/** + * @param {Array} commitQueue List of components + * which have callbacks to invoke in commitRoot + * @param {VNode} root + */ +export function commitRoot(commitQueue, root, refQueue) { + for (let i = 0; i < refQueue.length; i++) { + applyRef(refQueue[i], refQueue[++i], refQueue[++i]); + } + + if (options._commit) options._commit(root, commitQueue); + + commitQueue.some(c => { + try { + // @ts-expect-error Reuse the commitQueue variable here so the type changes + commitQueue = c._renderCallbacks; + c._renderCallbacks = []; + commitQueue.some(cb => { + // @ts-expect-error See above comment on commitQueue + cb.call(c); + }); + } catch (e) { + options._catchError(e, c._vnode); + } + }); +} + +function cloneNode(node) { + if (typeof node != 'object' || node == NULL || node._depth > 0) { + return node; + } + + if (isArray(node)) { + return node.map(cloneNode); + } + + return assign({}, node); +} + +/** + * Diff two virtual nodes representing DOM element + * @param {PreactElement} dom The DOM element representing the virtual nodes + * being diffed + * @param {VNode} newVNode The new virtual node + * @param {VNode} oldVNode The old virtual node + * @param {object} globalContext The current context object + * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML) + * @param {Array} excessDomChildren + * @param {Array} commitQueue List of components which have callbacks + * to invoke in commitRoot + * @param {boolean} isHydrating Whether or not we are in hydration + * @param {any[]} refQueue an array of elements needed to invoke refs + * @returns {PreactElement} + */ +function diffElementNodes( + dom, + newVNode, + oldVNode, + globalContext, + namespace, + excessDomChildren, + commitQueue, + isHydrating, + refQueue +) { + let oldProps = oldVNode.props || EMPTY_OBJ; + let newProps = newVNode.props; + let nodeType = /** @type {string} */ (newVNode.type); + /** @type {any} */ + let i; + /** @type {{ __html?: string }} */ + let newHtml; + /** @type {{ __html?: string }} */ + let oldHtml; + /** @type {ComponentChildren} */ + let newChildren; + let value; + let inputValue; + let checked; + + // Tracks entering and exiting namespaces when descending through the tree. + if (nodeType == 'svg') namespace = SVG_NAMESPACE; + else if (nodeType == 'math') namespace = MATH_NAMESPACE; + else if (!namespace) namespace = XHTML_NAMESPACE; + + if (excessDomChildren != NULL) { + for (i = 0; i < excessDomChildren.length; i++) { + value = excessDomChildren[i]; + + // if newVNode matches an element in excessDomChildren or the `dom` + // argument matches an element in excessDomChildren, remove it from + // excessDomChildren so it isn't later removed in diffChildren + if ( + value && + 'setAttribute' in value == !!nodeType && + (nodeType ? value.localName == nodeType : value.nodeType == 3) + ) { + dom = value; + excessDomChildren[i] = NULL; + break; + } + } + } + + if (dom == NULL) { + if (nodeType == NULL) { + return document.createTextNode(newProps); + } + + dom = document.createElementNS( + namespace, + nodeType, + newProps.is && newProps + ); + + // we are creating a new node, so we can assume this is a new subtree (in + // case we are hydrating), this deopts the hydrate + if (isHydrating) { + if (options._hydrationMismatch) + options._hydrationMismatch(newVNode, excessDomChildren); + isHydrating = false; + } + // we created a new parent, so none of the previously attached children can be reused: + excessDomChildren = NULL; + } + + if (nodeType == NULL) { + // During hydration, we still have to split merged text from SSR'd HTML. + if (oldProps !== newProps && (!isHydrating || dom.data != newProps)) { + dom.data = newProps; + } + } else { + // If excessDomChildren was not null, repopulate it with the current element's children: + excessDomChildren = excessDomChildren && slice.call(dom.childNodes); + + // If we are in a situation where we are not hydrating but are using + // existing DOM (e.g. replaceNode) we should read the existing DOM + // attributes to diff them + if (!isHydrating && excessDomChildren != NULL) { + oldProps = {}; + for (i = 0; i < dom.attributes.length; i++) { + value = dom.attributes[i]; + oldProps[value.name] = value.value; + } + } + + for (i in oldProps) { + value = oldProps[i]; + if (i == 'dangerouslySetInnerHTML') { + oldHtml = value; + } else if ( + i != 'children' && + !(i in newProps) && + !(i == 'value' && 'defaultValue' in newProps) && + !(i == 'checked' && 'defaultChecked' in newProps) + ) { + setProperty(dom, i, NULL, value, namespace); + } + } + + // During hydration, props are not diffed at all (including dangerouslySetInnerHTML) + // @TODO we should warn in debug mode when props don't match here. + for (i in newProps) { + value = newProps[i]; + if (i == 'children') { + newChildren = value; + } else if (i == 'dangerouslySetInnerHTML') { + newHtml = value; + } else if (i == 'value') { + inputValue = value; + } else if (i == 'checked') { + checked = value; + } else if ( + (!isHydrating || typeof value == 'function') && + oldProps[i] !== value + ) { + setProperty(dom, i, value, oldProps[i], namespace); + } + } + + // If the new vnode didn't have dangerouslySetInnerHTML, diff its children + if (newHtml) { + // Avoid re-applying the same '__html' if it did not changed between re-render + if ( + !isHydrating && + (!oldHtml || + (newHtml.__html != oldHtml.__html && newHtml.__html != dom.innerHTML)) + ) { + dom.innerHTML = newHtml.__html; + } + + newVNode._children = []; + } else { + if (oldHtml) dom.innerHTML = ''; + + diffChildren( + // @ts-expect-error + newVNode.type == 'template' ? dom.content : dom, + isArray(newChildren) ? newChildren : [newChildren], + newVNode, + oldVNode, + globalContext, + nodeType == 'foreignObject' ? XHTML_NAMESPACE : namespace, + excessDomChildren, + commitQueue, + excessDomChildren + ? excessDomChildren[0] + : oldVNode._children && getDomSibling(oldVNode, 0), + isHydrating, + refQueue + ); + + // Remove children that are not part of any vnode. + if (excessDomChildren != NULL) { + for (i = excessDomChildren.length; i--; ) { + removeNode(excessDomChildren[i]); + } + } + } + + // As above, don't diff props during hydration + if (!isHydrating) { + i = 'value'; + if (nodeType == 'progress' && inputValue == NULL) { + dom.removeAttribute('value'); + } else if ( + inputValue != UNDEFINED && + // #2756 For the -element the initial value is 0, + // despite the attribute not being present. When the attribute + // is missing the progress bar is treated as indeterminate. + // To fix that we'll always update it when it is 0 for progress elements + (inputValue !== dom[i] || + (nodeType == 'progress' && !inputValue) || + // This is only for IE 11 to fix
should have a
should have a
+ + + + ${columns.map(col => html` + + `)} + ${actions.length > 0 ? html`` : ''} + + + + ${data.length === 0 ? html` + + + + ` : data.map(row => html` + + + ${columns.map(col => html` + + `)} + ${actions.length > 0 ? html` + + ` : ''} + + `)} + +
+ + ${col.header}Actions
+ No data available +
+ toggleSelect(row.id)} + /> + + ${editingId === row.id && col.editable ? html` +
+ setEditValue(e.target.value)} + onBlur=${() => saveEdit(col.key)} + onKeyDown=${(e) => { + if (e.key === 'Enter') saveEdit(col.key); + if (e.key === 'Escape') cancelEdit(); + }} + autofocus + /> +
+ ` : html` +
col.editable && startEditing(row, col.key)} + > + ${col.render ? col.render(row[col.key], row) : row[col.key]} + ${col.editable ? html`` : ''} +
+ `} +
+
+ ${actions.map(action => { + // Skip hidden actions + if (action.hidden && action.hidden(row)) { + return null; + } + return html` + + `; + })} +
+
+ + `; +} + +// === Filter Tabs Component === +export function FilterTabs({ + filters = [], + activeFilter = 'all', + onChange, + className = '' +}) { + const html = window.html; + + return html` + + `; +} + +// === Bulk Actions Bar === +export function BulkActionsBar({ + selectedCount = 0, + actions = [], + onClearSelection, + className = '' +}) { + const html = window.html; + + if (selectedCount === 0) return null; + + return html` +
+ + + ${selectedCount} item${selectedCount > 1 ? 's' : ''} selected + +
+ ${actions.map(action => html` + + `)} + +
+
+ `; +} + +export default DashboardTable; diff --git a/static/js/components/FileUpload.js b/static/js/components/FileUpload.js new file mode 100644 index 0000000000000000000000000000000000000000..72482d6652a6f01cfd2b1d4544b9c4c5664842a6 --- /dev/null +++ b/static/js/components/FileUpload.js @@ -0,0 +1,300 @@ +/** + * File Upload Component with Drag & Drop and Preview + * For image/file upload interfaces + */ + +const { useState, useRef, useCallback, useEffect } = window.PreactLib || {}; + +export function FileUpload({ + accept = 'image/*', + multiple = true, + maxFiles = null, + onFilesSelected, + className = '' +}) { + const html = window.html; + const [isDragOver, setIsDragOver] = useState(false); + const inputRef = useRef(null); + + const handleFiles = useCallback((files) => { + const fileArray = Array.from(files); + if (onFilesSelected) { + onFilesSelected(fileArray); + } + }, [onFilesSelected]); + + const onDragOver = useCallback((e) => { + e.preventDefault(); + setIsDragOver(true); + }, []); + + const onDragLeave = useCallback((e) => { + e.preventDefault(); + setIsDragOver(false); + }, []); + + const onDrop = useCallback((e) => { + e.preventDefault(); + setIsDragOver(false); + handleFiles(e.dataTransfer.files); + }, [handleFiles]); + + const onClick = () => { + inputRef.current?.click(); + }; + + const onInputChange = (e) => { + handleFiles(e.target.files); + // Reset input so same file can be selected again + e.target.value = ''; + }; + + return html` +
+ + +
Drag & Drop files here
+

or click to browse

+ ${accept ? html`

Accepted: ${accept}

` : ''} + ${multiple && maxFiles ? html`

Max ${maxFiles} files

` : ''} +
+ `; +} + +// === File Preview Card === +export function FilePreviewCard({ + file, + index, + onRemove, + onDragStart, + onDrop, + onDragOver, + isDragging = false +}) { + const html = window.html; + const [previewUrl, setPreviewUrl] = useState(null); + + useEffect(() => { + if (file && file.type?.startsWith('image/')) { + const url = URL.createObjectURL(file); + setPreviewUrl(url); + return () => URL.revokeObjectURL(url); + } + }, [file]); + + const cardClass = isDragging + ? 'preview-card dragging' + : 'preview-card'; + + return html` +
onDragStart?.(e, index)} + onDragOver=${(e) => onDragOver?.(e, index)} + onDrop=${(e) => onDrop?.(e, index)} + > + ${previewUrl ? html` + ${file.name} + ` : html` +
+ +
+ `} +
+ ${file.name} +
+ +
+ `; +} + +// === File Preview Grid === +export function FilePreviewGrid({ + files = [], + onFilesChange, + sortable = true, + className = '' +}) { + const html = window.html; + const [draggedIndex, setDraggedIndex] = useState(null); + + if (files.length === 0) return null; + + const removeFile = (index) => { + const newFiles = files.filter((_, i) => i !== index); + onFilesChange?.(newFiles); + }; + + const handleDragStart = (e, index) => { + if (!sortable) return; + setDraggedIndex(index); + e.target.classList.add('dragging'); + }; + + const handleDragOver = (e, index) => { + if (!sortable || draggedIndex === null) return; + e.preventDefault(); + if (draggedIndex !== index) { + e.currentTarget.classList.add('drag-over'); + } + }; + + const handleDragLeave = (e) => { + e.currentTarget.classList.remove('drag-over'); + }; + + const handleDrop = (e, dropIndex) => { + if (!sortable || draggedIndex === null) return; + e.preventDefault(); + e.currentTarget.classList.remove('drag-over'); + + if (draggedIndex !== dropIndex) { + const newFiles = [...files]; + const [draggedFile] = newFiles.splice(draggedIndex, 1); + newFiles.splice(dropIndex, 0, draggedFile); + onFilesChange?.(newFiles); + } + setDraggedIndex(null); + }; + + const handleDragEnd = (e) => { + e.target.classList.remove('dragging'); + setDraggedIndex(null); + document.querySelectorAll('.drag-over').forEach(el => { + el.classList.remove('drag-over'); + }); + }; + + return html` +
+ ${files.map((file, index) => html` +
+ <${FilePreviewCard} + file=${file} + index=${index} + onRemove=${removeFile} + onDragStart=${handleDragStart} + onDragOver=${handleDragOver} + onDrop=${handleDrop} + isDragging=${draggedIndex === index} + /> +
+ `)} +
+ `; +} + +// === Complete Upload Interface === +export function UploadInterface({ + accept = 'image/*', + multiple = true, + maxFiles = null, + onUpload, + className = '' +}) { + const html = window.html; + const [files, setFiles] = useState([]); + const [isUploading, setIsUploading] = useState(false); + const [status, setStatus] = useState(null); + + const handleFilesSelected = (newFiles) => { + if (maxFiles && files.length + newFiles.length > maxFiles) { + setStatus({ + type: 'danger', + message: `Maximum ${maxFiles} files allowed` + }); + return; + } + setFiles([...files, ...newFiles]); + setStatus(null); + }; + + const handleUpload = async () => { + if (files.length === 0) return; + + setIsUploading(true); + setStatus({ type: 'info', message: `Uploading ${files.length} files...` }); + + try { + if (onUpload) { + await onUpload(files); + } + setStatus({ type: 'success', message: 'Upload successful!' }); + setFiles([]); + } catch (error) { + setStatus({ type: 'danger', message: `Upload failed: ${error.message}` }); + } finally { + setIsUploading(false); + } + }; + + return html` +
+ <${FileUpload} + accept=${accept} + multiple=${multiple} + onFilesSelected=${handleFilesSelected} + className="mb-4" + /> + + ${files.length > 0 ? html` + <> +
+ Preview ${sortable ? html`(Drag to reorder)` : ''} +
+ <${FilePreviewGrid} + files=${files} + onFilesChange=${setFiles} + sortable=${sortable} + className="mb-4" + /> + + ` : ''} + + ${status ? html` + + ` : ''} + + ${files.length > 0 ? html` + <${Button} + variant="success" + size="lg" + className="w-100 py-3" + onClick=${handleUpload} + loading=${isUploading} + > + ${isUploading ? 'Uploading...' : `Upload ${files.length} File${files.length > 1 ? 's' : ''}`} + + ` : ''} +
+ `; +} + +export default FileUpload; diff --git a/static/js/components/core.js b/static/js/components/core.js new file mode 100644 index 0000000000000000000000000000000000000000..20a0d084f4a7ba1d2cf605440306d8c2ca69ffef --- /dev/null +++ b/static/js/components/core.js @@ -0,0 +1,605 @@ +/** + * Preact Component Library (No Build) + * Reusable components for DocuPDF templates + * Import via ES modules from templates + */ + +const { h, Fragment } = window.PreactLib || {}; +const { useState, useEffect, useCallback, useMemo } = window.PreactLib || {}; + +// === Button Component === +export function Button({ + children, + variant = 'primary', + size = '', + pill = false, + disabled = false, + loading = false, + icon = null, + onClick, + className = '', + ...props +}) { + const html = window.html; + + const variantClasses = { + primary: 'btn-primary', + secondary: 'btn-secondary', + success: 'btn-success', + danger: 'btn-danger', + warning: 'btn-warning', + info: 'btn-info', + light: 'btn-light', + dark: 'btn-dark', + outline: 'btn-outline-primary', + outlineSuccess: 'btn-outline-success', + outlineDanger: 'btn-outline-danger' + }; + + const sizeClasses = { + sm: 'btn-sm', + lg: 'btn-lg' + }; + + const classes = [ + 'btn', + variantClasses[variant] || variantClasses.primary, + sizeClasses[size] || '', + pill ? 'btn-pill' : '', + className + ].filter(Boolean).join(' '); + + return html` + + `; +} + +// === Card Component === +export function Card({ + children, + title = null, + header = null, + footer = null, + className = '', + hoverable = false, + ...props +}) { + const html = window.html; + + const classes = [ + 'card', + 'bg-dark', + 'text-white', + hoverable ? 'card-hover' : '', + className + ].filter(Boolean).join(' '); + + return html` +
+ ${(title || header) ? html` +
+ ${header || html`
${title}
`} +
+ ` : ''} +
+ ${children} +
+ ${footer ? html`` : ''} +
+ `; +} + +// === Badge Component === +export function Badge({ + children, + variant = 'secondary', + className = '', + ...props +}) { + const html = window.html; + + const variantClasses = { + primary: 'bg-primary', + secondary: 'bg-secondary', + success: 'bg-success', + danger: 'bg-danger', + warning: 'bg-warning text-dark', + info: 'bg-info text-dark', + light: 'bg-light text-dark', + dark: 'bg-dark' + }; + + const classes = [ + 'badge', + variantClasses[variant] || variantClasses.secondary, + className + ].filter(Boolean).join(' '); + + return html` + ${children} + `; +} + +// === Alert Component === +export function Alert({ + children, + variant = 'info', + dismissible = false, + onDismiss, + className = '', + ...props +}) { + const html = window.html; + const [visible, setVisible] = useState(true); + + const variantClasses = { + primary: 'alert-primary', + secondary: 'alert-secondary', + success: 'alert-success', + danger: 'alert-danger', + warning: 'alert-warning', + info: 'alert-info', + light: 'alert-light', + dark: 'alert-dark' + }; + + const classes = [ + 'alert', + variantClasses[variant] || variantClasses.info, + dismissible ? 'alert-dismissible fade show' : '', + className + ].filter(Boolean).join(' '); + + if (!visible) return null; + + return html` + + `; +} + +// === Form Input Component === +export function FormInput({ + label = null, + type = 'text', + value = '', + onInput, + error = null, + helpText = null, + className = '', + ...props +}) { + const html = window.html; + + return html` +
+ ${label ? html`` : ''} + + ${error ? html`
${error}
` : ''} + ${helpText && !error ? html`
${helpText}
` : ''} +
+ `; +} + +// === Form Select Component === +export function FormSelect({ + label = null, + value = '', + onChange, + options = [], + placeholder = 'Select...', + error = null, + className = '', + ...props +}) { + const html = window.html; + + return html` +
+ ${label ? html`` : ''} + + ${error ? html`
${error}
` : ''} +
+ `; +} + +// === Modal Component === +export function Modal({ + show = false, + title = '', + children, + footer = null, + onClose, + size = 'md', + staticBackdrop = false, +}) { + const html = window.html; + const modalRef = useRef(null); + + useEffect(() => { + if (show && modalRef.current) { + const bsModal = new bootstrap.Modal(modalRef.current, { + backdrop: staticBackdrop ? 'static' : true, + keyboard: !staticBackdrop + }); + bsModal.show(); + + const handleHidden = () => { + if (onClose) onClose(); + }; + + modalRef.current.addEventListener('hidden.bs.modal', handleHidden); + return () => { + modalRef.current.removeEventListener('hidden.bs.modal', handleHidden); + bsModal.dispose(); + }; + } + }, [show]); + + const sizeClasses = { + sm: 'modal-sm', + md: '', + lg: 'modal-lg', + xl: 'modal-xl' + }; + + return html` + + `; +} + +// === Spinner Component === +export function Spinner({ + variant = 'primary', + size = 'md', + className = '' +}) { + const html = window.html; + + const sizeClasses = { + sm: 'spinner-border-sm', + md: 'spinner-border', + lg: 'spinner-grow-lg' + }; + + return html` +
+ Loading... +
+ `; +} + +// === Table Components === +export function Table({ + columns = [], + data = [], + keyField = 'id', + onRowClick = null, + className = '', + striped = true, + hover = true, + renderCell = null, + emptyMessage = 'No data available' +}) { + const html = window.html; + + return html` +
+ + + + ${columns.map(col => html` + + `)} + + + + ${data.length === 0 ? html` + + + + ` : data.map(row => html` + onRowClick(row)}` : ''} + style="${onRowClick ? 'cursor: pointer;' : ''}" + > + ${columns.map(col => html` + + `)} + + `)} + +
${col.header}
${emptyMessage}
+ ${renderCell + ? renderCell(row, col.key) + : row[col.key] + } +
+
+ `; +} + +// === Progress Bar Component === +export function ProgressBar({ + value = 0, + max = 100, + variant = 'primary', + label = null, + striped = false, + animated = false, + className = '' +}) { + const html = window.html; + const percentage = Math.min(100, Math.max(0, (value / max) * 100)); + + const variantClasses = { + primary: 'bg-primary', + success: 'bg-success', + danger: 'bg-danger', + warning: 'bg-warning', + info: 'bg-info' + }; + + return html` +
+
+ ${label !== null ? label : `${Math.round(percentage)}%`} +
+
+ `; +} + +// === Tabs Component === +export function Tabs({ + tabs = [], + activeTab = 0, + onChange, + className = '' +}) { + const html = window.html; + const [active, setActive] = useState(activeTab); + + const handleChange = (index) => { + setActive(index); + if (onChange) onChange(index, tabs[index]); + }; + + return html` + + ${tabs[active]?.content} + `; +} + +// === Checkbox Component === +export function Checkbox({ + label = null, + checked = false, + onChange, + disabled = false, + className = '' +}) { + const html = window.html; + + return html` +
+ + ${label ? html` + + ` : ''} +
+ `; +} + +// === Toggle Switch Component === +export function Toggle({ + label = null, + checked = false, + onChange, + disabled = false, + className = '' +}) { + const html = window.html; + + return html` +
+ + ${label ? html`` : ''} +
+ `; +} + +// === File Upload Component === +export function FileUpload({ + accept = '*', + multiple = false, + onFilesSelected, + children = null, + className = '' +}) { + const html = window.html; + const inputRef = useRef(null); + + const handleChange = (e) => { + const files = Array.from(e.target.files); + if (onFilesSelected) onFilesSelected(files); + // Reset input so same file can be selected again + e.target.value = ''; + }; + + const handleClick = () => { + inputRef.current?.click(); + }; + + return html` + <> + + ${children + ? children({ onClick: handleClick }) + : html`<${Button} onClick=${handleClick}>Choose Files` + } + + `; +} + +// === Search Input Component === +export function SearchInput({ + value = '', + onSearch, + placeholder = 'Search...', + debounceMs = 300, + className = '' +}) { + const html = window.html; + const [localValue, setLocalValue] = useState(value); + + useEffect(() => { + const timer = setTimeout(() => { + if (onSearch) onSearch(localValue); + }, debounceMs); + + return () => clearTimeout(timer); + }, [localValue]); + + return html` +
+ + setLocalValue(e.target.value)} + /> +
+ `; +} + +// Export all components +export const Components = { + Button, + Card, + Badge, + Alert, + FormInput, + FormSelect, + Modal, + Spinner, + Table, + ProgressBar, + Tabs, + Checkbox, + Toggle, + FileUpload, + SearchInput +}; diff --git a/template_utils.py b/template_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..768a586c22eb0b3ec2ee9700716cdf60450327de --- /dev/null +++ b/template_utils.py @@ -0,0 +1,67 @@ +""" +Template rendering utilities for DocuPDF. + +Provides separate render functions for different template directories: +- render_template(): Regular templates from 'templates/' folder +- render_esm_template(): Preact/ESM templates from 'templates_preact/' folder +""" + +import os +import json +from jinja2 import Environment, FileSystemLoader, ChoiceLoader + + +def _humanize_datetime(dt_str): + """Converts a datetime string to a human-friendly format.""" + if not dt_str: + return "" + try: + from datetime import datetime, date + dt = datetime.fromisoformat(dt_str.split('.')[0]) + today = date.today() + if dt.date() == today: + return "Today" + elif dt.date() == date.fromordinal(today.toordinal() - 1): + return "Yesterday" + else: + return dt.strftime('%b %d, %Y') + except (ValueError, TypeError): + return dt_str + + +def render_esm_template(template_name, templates_preact_path, templates_path=None, **context): + """ + Render a template from the templates_preact folder (Preact/ESM templates). + Uses a separate Jinja2 environment to avoid conflicts with regular templates. + + Args: + template_name: Name of the template file + templates_preact_path: Path to the templates_preact directory + templates_path: Optional path to regular templates directory (for includes) + **context: Template context variables + """ + from flask import url_for as flask_url_for + from flask_login import current_user + + # Use ChoiceLoader to search both directories (preact first, then regular for includes) + loaders = [FileSystemLoader(templates_preact_path)] + if templates_path: + loaders.append(FileSystemLoader(templates_path)) + + esm_loader = ChoiceLoader(loaders) + esm_env = Environment(loader=esm_loader, auto_reload=True) + + # Copy custom filters to ESM environment + esm_env.filters['humanize'] = _humanize_datetime + esm_env.filters['chr'] = chr + esm_env.filters['from_json'] = lambda x: json.loads(x) if x else [] + esm_env.filters['tojson'] = lambda x: json.dumps(x or []) + + # Add Flask-Login and other globals + esm_env.globals['url_for'] = flask_url_for + esm_env.globals['get_flashed_messages'] = lambda: [] + esm_env.globals['current_user'] = current_user + + # Get template and render + template = esm_env.get_template(template_name) + return template.render(**context) diff --git a/templates/_nav_links.html b/templates/_nav_links.html index 041f849c2b456b8ed321a5ce20f032011817cce9..d3c849e71794b1dde4d6ad487fc3aac04b9219fa 100644 --- a/templates/_nav_links.html +++ b/templates/_nav_links.html @@ -3,6 +3,15 @@
Dashboard + NeetPrep Sync diff --git a/templates/_revision_notes.html b/templates/_revision_notes.html index ea353682ee1fde2b8279951c95eeb5c70c8900ac..09440e789a11c213f4ad245c4446eb08bab537da 100644 --- a/templates/_revision_notes.html +++ b/templates/_revision_notes.html @@ -1,213 +1,245 @@ -{# Revision Notes Modal - v3 Compact #} +{# Revision Notes Modal - v5 Ultra Fast #} -