scenri 0.18.2 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +2 -2
- package/dist/{chunk-VQPHG2GQ.js → chunk-4PJPJGGP.js} +33 -4
- package/dist/{cli-HHU7DUWE.js → cli-6LLQ5INA.js} +3 -3
- package/dist/index.js +2 -2
- package/dist/serve.js +2297 -1443
- package/dist/{src-CHSXV3ZA.js → src-7RKZJC7Y.js} +3 -3
- package/package.json +1 -1
- package/studio-dist/assets/index-BPTXm681.js +108 -0
- package/studio-dist/assets/{index-DJoQ6v4Y.css → index-Cc29XMiU.css} +1 -1
- package/studio-dist/index.html +2 -2
- package/templates/balloon-knot.json +15 -0
- package/templates/beauty-dish.json +15 -0
- package/templates/block-tower.json +15 -0
- package/templates/chalk-steps.json +24 -0
- package/templates/chrome-bubble-warp.json +4 -3
- package/templates/clay-court.json +15 -0
- package/templates/coal-blind-light.json +24 -0
- package/templates/cobalt-color-room.json +15 -0
- package/templates/cobalt-container.json +15 -0
- package/templates/conversation-pit.json +24 -0
- package/templates/demo-products/aldergate-field-38.json +28 -0
- package/templates/demo-products/aubrey-lisle-court-72.json +19 -0
- package/templates/demo-products/birch-hollow-fig-leaf-candle.json +19 -0
- package/templates/demo-products/brixa-yuzu-tonic.json +19 -0
- package/templates/demo-products/calder-vane-c15-serum.json +19 -0
- package/templates/demo-products/carrick-stead-chug-710.json +19 -0
- package/templates/demo-products/dunmore-kerr-cricket-jumper.json +19 -0
- package/templates/demo-products/fenner-ross-aperitivo.json +19 -0
- package/templates/demo-products/fenwick-slade-barrier-cream.json +19 -0
- package/templates/demo-products/halden-bay-spf-50.json +19 -0
- package/templates/demo-products/harlow-made-fig-vetiver-wash.json +19 -0
- package/templates/demo-products/hollow-reed-sleep-gummies.json +19 -0
- package/templates/demo-products/ilse-varden-scarlet-11.json +19 -0
- package/templates/demo-products/lydford-forge-24-casserole.json +19 -0
- package/templates/demo-products/marden-cole-square-acetates.json +19 -0
- package/templates/demo-products/marrow-vale-noir-cedar.json +19 -0
- package/templates/demo-products/maud-ferrers-sun-coin.json +19 -0
- package/templates/demo-products/moss-larkin-oak-lounge-chair.json +19 -0
- package/templates/demo-products/nordhavn-over-ear.json +19 -0
- package/templates/demo-products/orchard-oat-green-04.json +19 -0
- package/templates/demo-products/ossett-hume-capsule.json +19 -0
- package/templates/demo-products/oswin-hale-open-buds.json +19 -0
- package/templates/demo-products/ottery-lane-72-dark.json +19 -0
- package/templates/demo-products/pellow-hibiscus-soda.json +19 -0
- package/templates/demo-products/rowan-ash-bowler-bag.json +19 -0
- package/templates/demo-products/slate-harbor-cropped-puffer.json +19 -0
- package/templates/demo-products/tanner-fielding-collagen.json +19 -0
- package/templates/demo-products/verity-stone-dome-hoops.json +19 -0
- package/templates/demo-products/verlaine-salt-orris.json +19 -0
- package/templates/demo-products/voss-rowe-ridgeline-trail.json +19 -0
- package/templates/foil-tent.json +15 -0
- package/templates/glass-block-room.json +15 -0
- package/templates/green-tyre-stack.json +15 -0
- package/templates/hair-nest.json +15 -0
- package/templates/hand-studio.json +15 -0
- package/templates/lantern-room.json +15 -0
- package/templates/laundry-line.json +15 -0
- package/templates/linen-morning-room.json +15 -0
- package/templates/martini-hour.json +15 -0
- package/templates/model-village.json +15 -0
- package/templates/painted-canvas.json +15 -0
- package/templates/palm-shade-garden.json +15 -0
- package/templates/paper-garden.json +25 -0
- package/templates/pink-ball-pit.json +15 -0
- package/templates/pink-smoke.json +15 -0
- package/templates/presenters/amara.json +18 -0
- package/templates/presenters/anaya.json +18 -0
- package/templates/presenters/anton.json +18 -0
- package/templates/presenters/elias.json +18 -0
- package/templates/presenters/finn.json +18 -0
- package/templates/presenters/helene.json +18 -0
- package/templates/presenters/kwame.json +18 -0
- package/templates/presenters/leila.json +18 -0
- package/templates/presenters/liv.json +18 -0
- package/templates/presenters/luz.json +18 -0
- package/templates/presenters/maeve.json +18 -0
- package/templates/presenters/nico.json +18 -0
- package/templates/presenters/odette.json +18 -0
- package/templates/presenters/paloma.json +18 -0
- package/templates/presenters/ren.json +18 -0
- package/templates/presenters/soren.json +18 -0
- package/templates/presenters/tove.json +18 -0
- package/templates/presenters/yuna.json +18 -0
- package/templates/presenters/zuri.json +18 -0
- package/templates/previews/balloon-knot.jpg +0 -0
- package/templates/previews/beauty-dish.jpg +0 -0
- package/templates/previews/block-tower.jpg +0 -0
- package/templates/previews/chalk-steps.jpg +0 -0
- package/templates/previews/chrome-bubble-warp.jpg +0 -0
- package/templates/previews/clay-court.jpg +0 -0
- package/templates/previews/coal-blind-light.jpg +0 -0
- package/templates/previews/cobalt-color-room.jpg +0 -0
- package/templates/previews/cobalt-container.jpg +0 -0
- package/templates/previews/conversation-pit.jpg +0 -0
- package/templates/previews/foil-tent.jpg +0 -0
- package/templates/previews/glass-block-room.jpg +0 -0
- package/templates/previews/green-tyre-stack.jpg +0 -0
- package/templates/previews/hair-nest.jpg +0 -0
- package/templates/previews/hand-studio.jpg +0 -0
- package/templates/previews/lantern-room.jpg +0 -0
- package/templates/previews/laundry-line.jpg +0 -0
- package/templates/previews/linen-morning-room.jpg +0 -0
- package/templates/previews/martini-hour.jpg +0 -0
- package/templates/previews/model-village.jpg +0 -0
- package/templates/previews/painted-canvas.jpg +0 -0
- package/templates/previews/palm-shade-garden.jpg +0 -0
- package/templates/previews/paper-garden.jpg +0 -0
- package/templates/previews/pink-ball-pit.jpg +0 -0
- package/templates/previews/pink-smoke.jpg +0 -0
- package/templates/previews/presenters/amara.jpg +0 -0
- package/templates/previews/presenters/anaya.jpg +0 -0
- package/templates/previews/presenters/anton.jpg +0 -0
- package/templates/previews/presenters/elias.jpg +0 -0
- package/templates/previews/presenters/finn.jpg +0 -0
- package/templates/previews/presenters/helene.jpg +0 -0
- package/templates/previews/presenters/kwame.jpg +0 -0
- package/templates/previews/presenters/leila.jpg +0 -0
- package/templates/previews/presenters/liv.jpg +0 -0
- package/templates/previews/presenters/luz.jpg +0 -0
- package/templates/previews/presenters/maeve.jpg +0 -0
- package/templates/previews/presenters/nico.jpg +0 -0
- package/templates/previews/presenters/odette.jpg +0 -0
- package/templates/previews/presenters/paloma.jpg +0 -0
- package/templates/previews/presenters/ren.jpg +0 -0
- package/templates/previews/presenters/soren.jpg +0 -0
- package/templates/previews/presenters/tove.jpg +0 -0
- package/templates/previews/presenters/yuna.jpg +0 -0
- package/templates/previews/presenters/zuri.jpg +0 -0
- package/templates/previews/red-light-blade.jpg +0 -0
- package/templates/previews/ruby-syrup-pour.jpg +0 -0
- package/templates/previews/sand-mound-spotlight.jpg +0 -0
- package/templates/previews/shadow-hand.jpg +0 -0
- package/templates/previews/showcase/acetates-salt-flat.jpg +0 -0
- package/templates/previews/showcase/bowler-car-exit.jpg +0 -0
- package/templates/previews/showcase/c15-orange-pool.jpg +0 -0
- package/templates/previews/showcase/fig-leaf-frost-window.jpg +0 -0
- package/templates/previews/showcase/hibiscus-pour.jpg +0 -0
- package/templates/previews/showcase/hoops-painted-canvas.jpg +0 -0
- package/templates/previews/showcase/noir-cedar-char.jpg +0 -0
- package/templates/previews/showcase/orris-waterline.jpg +0 -0
- package/templates/previews/showcase/over-ear-pool-edge.jpg +0 -0
- package/templates/previews/showcase/puffer-container-lean.jpg +0 -0
- package/templates/previews/showcase/puffer-ghost-snow.jpg +0 -0
- package/templates/previews/showcase/ridgeline-tyre-top.jpg +0 -0
- package/templates/previews/showcase/scarlet-red-blade.jpg +0 -0
- package/templates/previews/showcase/scarlet-summer-laugh.jpg +0 -0
- package/templates/previews/showcase/yuzu-ice-burst.jpg +0 -0
- package/templates/previews/sky-color-block.jpg +0 -0
- package/templates/previews/studio-boulder-gap.jpg +0 -0
- package/templates/previews/studio-glacier-ice-core.jpg +0 -0
- package/templates/previews/studio-soft-horizon.jpg +0 -0
- package/templates/previews/succulent-dew-bed.jpg +0 -0
- package/templates/previews/sunlit-color-field.jpg +0 -0
- package/templates/previews/teak-bath-caddy.jpg +0 -0
- package/templates/previews/tight-corner.jpg +0 -0
- package/templates/previews/tomato-vine.jpg +0 -0
- package/templates/previews/tonal-apricot-ledge.jpg +0 -0
- package/templates/previews/travertine-window-light.jpg +0 -0
- package/templates/previews/waterline-caustics.jpg +0 -0
- package/templates/previews/white-glove-tray.jpg +0 -0
- package/templates/red-light-blade.json +15 -0
- package/templates/ruby-syrup-pour.json +15 -0
- package/templates/sand-mound-spotlight.json +15 -0
- package/templates/shadow-hand.json +15 -0
- package/templates/showcase/72-dark-bite.json +33 -0
- package/templates/showcase/72-dark-palm-shade.json +33 -0
- package/templates/showcase/72-dark-snap.json +29 -0
- package/templates/showcase/acetates-harbour-light.json +33 -0
- package/templates/showcase/acetates-ice-block.json +29 -0
- package/templates/showcase/acetates-salt-flat.json +37 -0
- package/templates/showcase/acetates-silk-drape.json +33 -0
- package/templates/showcase/aperitivo-chrome-bar.json +33 -0
- package/templates/showcase/aperitivo-pit.json +37 -0
- package/templates/showcase/aperitivo-ruby-pour.json +33 -0
- package/templates/showcase/aperitivo-tomato-vine.json +35 -0
- package/templates/showcase/barrier-cream-caddy.json +33 -0
- package/templates/showcase/barrier-cream-cheek.json +33 -0
- package/templates/showcase/barrier-cream-ice-core.json +35 -0
- package/templates/showcase/barrier-cream-oats.json +29 -0
- package/templates/showcase/bowler-bonnet-rain.json +29 -0
- package/templates/showcase/bowler-car-exit.json +33 -0
- package/templates/showcase/bowler-cobalt-room.json +33 -0
- package/templates/showcase/bowler-red-blade.json +37 -0
- package/templates/showcase/c15-apricot-ledge.json +33 -0
- package/templates/showcase/c15-dew-bed.json +33 -0
- package/templates/showcase/c15-morning-drop.json +33 -0
- package/templates/showcase/c15-orange-pool.json +29 -0
- package/templates/showcase/capsule-block-tower.json +33 -0
- package/templates/showcase/capsule-model-village.json +33 -0
- package/templates/showcase/capsule-stoop.json +33 -0
- package/templates/showcase/casserole-long-table.json +33 -0
- package/templates/showcase/casserole-steam.json +29 -0
- package/templates/showcase/casserole-tomatoes.json +33 -0
- package/templates/showcase/chug-courtside.json +37 -0
- package/templates/showcase/chug-long-shadow.json +33 -0
- package/templates/showcase/chug-mountain-stream.json +29 -0
- package/templates/showcase/chug-waterline.json +35 -0
- package/templates/showcase/collagen-berry-splash.json +29 -0
- package/templates/showcase/collagen-morning-shake.json +33 -0
- package/templates/showcase/collagen-paper-garden.json +33 -0
- package/templates/showcase/court-72-baseline.json +33 -0
- package/templates/showcase/court-72-checker-sit.json +37 -0
- package/templates/showcase/court-72-fisheye-steps.json +33 -0
- package/templates/showcase/court-72-salt-flat.json +35 -0
- package/templates/showcase/cricket-jumper-green.json +33 -0
- package/templates/showcase/cricket-jumper-hamper.json +29 -0
- package/templates/showcase/cricket-jumper-sheets.json +37 -0
- package/templates/showcase/field-watch-boulder-gap.json +37 -0
- package/templates/showcase/field-watch-corner.json +37 -0
- package/templates/showcase/field-watch-helm.json +33 -0
- package/templates/showcase/field-watch-ice-core.json +33 -0
- package/templates/showcase/fig-leaf-frost-window.json +29 -0
- package/templates/showcase/fig-leaf-lanterns.json +33 -0
- package/templates/showcase/fig-leaf-still-life.json +29 -0
- package/templates/showcase/fig-vetiver-travertine.json +35 -0
- package/templates/showcase/green-04-ice-trough.json +29 -0
- package/templates/showcase/green-04-ingredients.json +29 -0
- package/templates/showcase/green-04-track.json +33 -0
- package/templates/showcase/gummies-bedside.json +33 -0
- package/templates/showcase/gummies-cherry-heap.json +29 -0
- package/templates/showcase/gummies-moonlit-pillow.json +29 -0
- package/templates/showcase/hibiscus-dew-bed.json +33 -0
- package/templates/showcase/hibiscus-flower-nest.json +29 -0
- package/templates/showcase/hibiscus-long-lunch.json +37 -0
- package/templates/showcase/hibiscus-pour.json +29 -0
- package/templates/showcase/hoops-honey-drip.json +29 -0
- package/templates/showcase/hoops-painted-canvas.json +37 -0
- package/templates/showcase/hoops-pink-smoke.json +37 -0
- package/templates/showcase/hoops-sculpted-hands.json +33 -0
- package/templates/showcase/lounge-chair-reading.json +33 -0
- package/templates/showcase/lounge-chair-snowfall.json +29 -0
- package/templates/showcase/lounge-chair-travertine.json +33 -0
- package/templates/showcase/noir-cedar-char.json +29 -0
- package/templates/showcase/noir-cedar-coal.json +33 -0
- package/templates/showcase/noir-cedar-silk-drape.json +33 -0
- package/templates/showcase/noir-cedar-smoke.json +33 -0
- package/templates/showcase/open-buds-hands.json +33 -0
- package/templates/showcase/open-buds-surf-check.json +33 -0
- package/templates/showcase/open-buds-vinyl.json +29 -0
- package/templates/showcase/orris-collarbone.json +33 -0
- package/templates/showcase/orris-salt-pan.json +29 -0
- package/templates/showcase/orris-waterline.json +33 -0
- package/templates/showcase/orris-window-stripe.json +33 -0
- package/templates/showcase/over-ear-arch.json +33 -0
- package/templates/showcase/over-ear-balloons.json +37 -0
- package/templates/showcase/over-ear-glass-blocks.json +37 -0
- package/templates/showcase/over-ear-pool-edge.json +29 -0
- package/templates/showcase/puffer-container-lean.json +37 -0
- package/templates/showcase/puffer-foil-jump.json +37 -0
- package/templates/showcase/puffer-ghost-snow.json +29 -0
- package/templates/showcase/puffer-snow-street.json +33 -0
- package/templates/showcase/ridgeline-boulder-gap.json +33 -0
- package/templates/showcase/ridgeline-chalk-sprint.json +37 -0
- package/templates/showcase/ridgeline-stream-leap.json +33 -0
- package/templates/showcase/ridgeline-tyre-top.json +33 -0
- package/templates/showcase/scarlet-beauty-dish.json +37 -0
- package/templates/showcase/scarlet-red-blade.json +33 -0
- package/templates/showcase/scarlet-summer-laugh.json +33 -0
- package/templates/showcase/scarlet-swatch.json +29 -0
- package/templates/showcase/spf-poolside.json +33 -0
- package/templates/showcase/spf-salt-flat.json +37 -0
- package/templates/showcase/spf-shadow-hand.json +33 -0
- package/templates/showcase/spf-yellow-field.json +33 -0
- package/templates/showcase/sun-coin-collarbone.json +33 -0
- package/templates/showcase/sun-coin-hair-nest.json +33 -0
- package/templates/showcase/sun-coin-sundial.json +29 -0
- package/templates/showcase/sun-coin-white-glove.json +33 -0
- package/templates/showcase/wash-fig-leaves.json +29 -0
- package/templates/showcase/wash-slate-shower.json +29 -0
- package/templates/showcase/wash-steam.json +33 -0
- package/templates/showcase/yuzu-arch-lean.json +37 -0
- package/templates/showcase/yuzu-container-sill.json +33 -0
- package/templates/showcase/yuzu-flash-walk.json +33 -0
- package/templates/showcase/yuzu-ice-burst.json +29 -0
- package/templates/sky-color-block.json +15 -0
- package/templates/studio-boulder-gap.json +5 -4
- package/templates/studio-glacier-ice-core.json +5 -4
- package/templates/studio-soft-horizon.json +5 -4
- package/templates/succulent-dew-bed.json +6 -5
- package/templates/sunlit-color-field.json +15 -0
- package/templates/teak-bath-caddy.json +15 -0
- package/templates/tight-corner.json +15 -0
- package/templates/tomato-vine.json +15 -0
- package/templates/tonal-apricot-ledge.json +15 -0
- package/templates/travertine-window-light.json +15 -0
- package/templates/waterline-caustics.json +15 -0
- package/templates/white-glove-tray.json +15 -0
- package/studio-dist/assets/index-VKUZvbLQ.js +0 -106
- package/templates/action-motion-freeze.json +0 -14
- package/templates/beauty-dish-glow-portrait.json +0 -15
- package/templates/closeup-face-product-interaction.json +0 -14
- package/templates/cold-table-clinic.json +0 -15
- package/templates/confetti-burst-freeze.json +0 -15
- package/templates/contour-key-portrait.json +0 -15
- package/templates/cut-paper-stage.json +0 -14
- package/templates/cut-shadow-pedestal.json +0 -15
- package/templates/demo-products/aldergate-frost-field-watch.json +0 -27
- package/templates/demo-products/almanac-supply-canvas-low-top.json +0 -18
- package/templates/demo-products/amble-roasting-co-ethiopia-light-roast.json +0 -18
- package/templates/demo-products/ashwell-kin-ribbed-table-lamp.json +0 -18
- package/templates/demo-products/aurelia-amber-serum.json +0 -18
- package/templates/demo-products/basalt-bloom-sparkling-mineral-water.json +0 -18
- package/templates/demo-products/birch-hollow-stoneware-vase.json +0 -18
- package/templates/demo-products/birchwood-page-leather-derby.json +0 -18
- package/templates/demo-products/cairn-mineral-sun-stick.json +0 -18
- package/templates/demo-products/calder-vane-boucle-two-seater.json +0 -18
- package/templates/demo-products/cypress-row-olive-oil.json +0 -18
- package/templates/demo-products/fenwick-slade-open-shelving.json +0 -18
- package/templates/demo-products/fernweg-wanderlust-oil.json +0 -18
- package/templates/demo-products/ferro-sons-yuzu-soda.json +0 -18
- package/templates/demo-products/fieldnote-rangefinder-camera.json +0 -18
- package/templates/demo-products/halcyon-aura-speaker.json +0 -18
- package/templates/demo-products/harlow-made-woven-rattan-basket.json +0 -18
- package/templates/demo-products/hollow-reed-wildflower-honey.json +0 -18
- package/templates/demo-products/holloway-stacked-band-set.json +0 -18
- package/templates/demo-products/kestrel-waxed-field-jacket.json +0 -18
- package/templates/demo-products/keystone-works-low-profile-keyboard.json +0 -29
- package/templates/demo-products/lumen-co-signet-ring.json +0 -18
- package/templates/demo-products/marden-cole-selvedge-denim-jacket.json +0 -18
- package/templates/demo-products/marrow-vale-nocturne.json +0 -18
- package/templates/demo-products/meridian-pulse-smartwatch.json +0 -18
- package/templates/demo-products/moss-larkin-sling-lounge-chair.json +0 -18
- package/templates/demo-products/nordhavn-canvas-over-ear-headphones.json +0 -18
- package/templates/demo-products/northward-vacuum-flask.json +0 -18
- package/templates/demo-products/orchard-oat-cold-pressed-juice.json +0 -18
- package/templates/demo-products/orla-mackenzie-cashmere-turtleneck.json +0 -18
- package/templates/demo-products/perihelion-pebble-earbuds.json +0 -18
- package/templates/demo-products/rowan-ash-leather-tote.json +0 -18
- package/templates/demo-products/slate-harbor-tech-shell.json +0 -28
- package/templates/demo-products/solenne-mineral-pressed-cream.json +0 -18
- package/templates/demo-products/solstice-titanium-aviators.json +0 -18
- package/templates/demo-products/tanner-fielding-single-origin-bar.json +0 -18
- package/templates/demo-products/thornebury-pedestal-dining-table.json +0 -18
- package/templates/demo-products/tidewater-grapefruit-seltzer.json +0 -18
- package/templates/demo-products/verity-stone-gold-hoop-earrings.json +0 -18
- package/templates/demo-products/verity-stone-pearl-drop-necklace.json +0 -18
- package/templates/demo-products/verlaine-lumiere.json +0 -18
- package/templates/demo-products/verse-beauty-sheer-bloom.json +0 -18
- package/templates/demo-products/voss-rowe-trail-runner.json +0 -18
- package/templates/demo-products/wavelength-studio-headphones.json +0 -18
- package/templates/editorial-fisheye-flash-studio.json +0 -15
- package/templates/editorial-pale-wrap-studio.json +0 -15
- package/templates/editorial-walk-fashion-strip.json +0 -14
- package/templates/full-length-mirror-ootd.json +0 -14
- package/templates/furniture-joiners-workshop.json +0 -14
- package/templates/furniture-lamplight-hours.json +0 -14
- package/templates/furniture-long-shadow-gallery.json +0 -15
- package/templates/furniture-low-sun-terrace.json +0 -14
- package/templates/furniture-snowlight-room.json +0 -14
- package/templates/furniture-travertine-atrium.json +0 -14
- package/templates/handheld-offer-crop.json +0 -14
- package/templates/heliconia-bloom-field.json +0 -15
- package/templates/indigo-fold.json +0 -14
- package/templates/interiors-attic-reading-nook.json +0 -15
- package/templates/interiors-bathroom-vanity.json +0 -15
- package/templates/interiors-greenhouse-potting-nook.json +0 -15
- package/templates/interiors-marble-kitchen-counter.json +0 -15
- package/templates/interiors-wood-table-flatlay.json +0 -15
- package/templates/lifestyle-incidental-tablescape.json +0 -15
- package/templates/liquid-marble-pour.json +0 -15
- package/templates/low-key-character-study.json +0 -15
- package/templates/macro-texture-detail.json +0 -15
- package/templates/neon-tube-corridor.json +0 -15
- package/templates/overhead-styled-flatlay-grid.json +0 -15
- package/templates/plain-light-portrait.json +0 -15
- package/templates/precision-bench-anodised.json +0 -14
- package/templates/presenters/astrid.json +0 -22
- package/templates/presenters/bree.json +0 -18
- package/templates/presenters/dax.json +0 -18
- package/templates/presenters/elin.json +0 -18
- package/templates/presenters/ines.json +0 -23
- package/templates/presenters/itai.json +0 -23
- package/templates/presenters/julien.json +0 -18
- package/templates/presenters/jun.json +0 -23
- package/templates/presenters/kenji.json +0 -18
- package/templates/presenters/malik.json +0 -23
- package/templates/presenters/maren.json +0 -18
- package/templates/presenters/mateo.json +0 -23
- package/templates/presenters/noa.json +0 -23
- package/templates/presenters/otis.json +0 -18
- package/templates/presenters/priya.json +0 -18
- package/templates/presenters/rafael.json +0 -18
- package/templates/presenters/sasha.json +0 -23
- package/templates/presenters/soraya.json +0 -22
- package/templates/presenters/tallulah.json +0 -18
- package/templates/presenters/theo.json +0 -18
- package/templates/presenters/wen.json +0 -18
- package/templates/previews/action-motion-freeze.jpg +0 -0
- package/templates/previews/beauty-dish-glow-portrait.jpg +0 -0
- package/templates/previews/closeup-face-product-interaction.jpg +0 -0
- package/templates/previews/cold-table-clinic.jpg +0 -0
- package/templates/previews/confetti-burst-freeze.jpg +0 -0
- package/templates/previews/contour-key-portrait.jpg +0 -0
- package/templates/previews/cut-paper-stage.jpg +0 -0
- package/templates/previews/cut-shadow-pedestal.jpg +0 -0
- package/templates/previews/editorial-fisheye-flash-studio.jpg +0 -0
- package/templates/previews/editorial-pale-wrap-studio.jpg +0 -0
- package/templates/previews/editorial-walk-fashion-strip.jpg +0 -0
- package/templates/previews/full-length-mirror-ootd.jpg +0 -0
- package/templates/previews/furniture-joiners-workshop.jpg +0 -0
- package/templates/previews/furniture-lamplight-hours.jpg +0 -0
- package/templates/previews/furniture-long-shadow-gallery.jpg +0 -0
- package/templates/previews/furniture-low-sun-terrace.jpg +0 -0
- package/templates/previews/furniture-snowlight-room.jpg +0 -0
- package/templates/previews/furniture-travertine-atrium.jpg +0 -0
- package/templates/previews/handheld-offer-crop.jpg +0 -0
- package/templates/previews/heliconia-bloom-field.jpg +0 -0
- package/templates/previews/indigo-fold.jpg +0 -0
- package/templates/previews/interiors-attic-reading-nook.jpg +0 -0
- package/templates/previews/interiors-bathroom-vanity.jpg +0 -0
- package/templates/previews/interiors-greenhouse-potting-nook.jpg +0 -0
- package/templates/previews/interiors-marble-kitchen-counter.jpg +0 -0
- package/templates/previews/interiors-wood-table-flatlay.jpg +0 -0
- package/templates/previews/lifestyle-incidental-tablescape.jpg +0 -0
- package/templates/previews/liquid-marble-pour.jpg +0 -0
- package/templates/previews/low-key-character-study.jpg +0 -0
- package/templates/previews/macro-texture-detail.jpg +0 -0
- package/templates/previews/neon-tube-corridor.jpg +0 -0
- package/templates/previews/overhead-styled-flatlay-grid.jpg +0 -0
- package/templates/previews/plain-light-portrait.jpg +0 -0
- package/templates/previews/precision-bench-anodised.jpg +0 -0
- package/templates/previews/presenters/astrid.jpg +0 -0
- package/templates/previews/presenters/bree.jpg +0 -0
- package/templates/previews/presenters/dax.jpg +0 -0
- package/templates/previews/presenters/elin.jpg +0 -0
- package/templates/previews/presenters/ines.jpg +0 -0
- package/templates/previews/presenters/itai.jpg +0 -0
- package/templates/previews/presenters/julien.jpg +0 -0
- package/templates/previews/presenters/jun.jpg +0 -0
- package/templates/previews/presenters/kenji.jpg +0 -0
- package/templates/previews/presenters/malik.jpg +0 -0
- package/templates/previews/presenters/maren.jpg +0 -0
- package/templates/previews/presenters/mateo.jpg +0 -0
- package/templates/previews/presenters/noa.jpg +0 -0
- package/templates/previews/presenters/otis.jpg +0 -0
- package/templates/previews/presenters/priya.jpg +0 -0
- package/templates/previews/presenters/rafael.jpg +0 -0
- package/templates/previews/presenters/sasha.jpg +0 -0
- package/templates/previews/presenters/soraya.jpg +0 -0
- package/templates/previews/presenters/tallulah.jpg +0 -0
- package/templates/previews/presenters/theo.jpg +0 -0
- package/templates/previews/presenters/wen.jpg +0 -0
- package/templates/previews/rain-glass-night-city.jpg +0 -0
- package/templates/previews/rembrandt-triangle-portrait.jpg +0 -0
- package/templates/previews/screen-print-duotone.jpg +0 -0
- package/templates/previews/showcase/almanac-canvas-theo-billboard.jpg +0 -0
- package/templates/previews/showcase/ashwell-kin-lamp-elin-lamplight.jpg +0 -0
- package/templates/previews/showcase/aurelia-serum-succulent-dew.jpg +0 -0
- package/templates/previews/showcase/basalt-snells-window.jpg +0 -0
- package/templates/previews/showcase/birchwood-salt-flat.jpg +0 -0
- package/templates/previews/showcase/cairn-sun-stick-agave-noon.jpg +0 -0
- package/templates/previews/showcase/calder-snow-loft.jpg +0 -0
- package/templates/previews/showcase/marrow-vale-halite-ledge.jpg +0 -0
- package/templates/previews/showcase/moss-larkin-chair-travertine-atrium.jpg +0 -0
- package/templates/previews/showcase/orchard-oat-orchard-burst.jpg +0 -0
- package/templates/previews/showcase/orla-priya-fjord-ferry.jpg +0 -0
- package/templates/previews/showcase/solstice-aviators-screen-print.jpg +0 -0
- package/templates/previews/showcase/verity-pearls-suspended-silk.jpg +0 -0
- package/templates/previews/showcase/voss-rowe-runner-volcanic-ash.jpg +0 -0
- package/templates/previews/showcase/wen-meridian-trailhead.jpg +0 -0
- package/templates/previews/social-amber-flare-motion.jpg +0 -0
- package/templates/previews/social-beauty-editorial-grid.jpg +0 -0
- package/templates/previews/social-beverage-launch-splash.jpg +0 -0
- package/templates/previews/social-cobalt-hand-reveal.jpg +0 -0
- package/templates/previews/social-fashion-campaign-billboard.jpg +0 -0
- package/templates/previews/social-product-drop-hype.jpg +0 -0
- package/templates/previews/social-vertical-story-motion.jpg +0 -0
- package/templates/previews/soft-diffusion-portrait.jpg +0 -0
- package/templates/previews/split-tone-color-gel-portrait.jpg +0 -0
- package/templates/previews/stitched-construction-detail.jpg +0 -0
- package/templates/previews/studio-aloe-flesh-macro.jpg +0 -0
- package/templates/previews/studio-amber-resin-suspension.jpg +0 -0
- package/templates/previews/studio-basalt-crust-glow.jpg +0 -0
- package/templates/previews/studio-blue-ice-melt-channel.jpg +0 -0
- package/templates/previews/studio-dune-slip-face.jpg +0 -0
- package/templates/previews/studio-molten-sugar-pull.jpg +0 -0
- package/templates/previews/studio-polished-pedestal.jpg +0 -0
- package/templates/previews/studio-rainforest-canopy.jpg +0 -0
- package/templates/previews/studio-reef-shelf-caustics.jpg +0 -0
- package/templates/previews/studio-salt-crystal-cavern.jpg +0 -0
- package/templates/previews/studio-sea-stack-horizon.jpg +0 -0
- package/templates/previews/studio-sharp-shadow-stage.jpg +0 -0
- package/templates/previews/studio-spotlit-vertical-stage.jpg +0 -0
- package/templates/previews/studio-submerged-bloom-drift.jpg +0 -0
- package/templates/previews/studio-vertical-light-well.jpg +0 -0
- package/templates/previews/studio-volcanic-ash-field.jpg +0 -0
- package/templates/previews/suspended-color-field.jpg +0 -0
- package/templates/previews/terracotta-ledge-glow.jpg +0 -0
- package/templates/previews/wide-establishing-environment.jpg +0 -0
- package/templates/previews/worn-scale-cropped-gesture.jpg +0 -0
- package/templates/rain-glass-night-city.json +0 -15
- package/templates/rembrandt-triangle-portrait.json +0 -15
- package/templates/screen-print-duotone.json +0 -15
- package/templates/showcase/aldergate-ice-core.json +0 -29
- package/templates/showcase/aldergate-watch-kenji-candid-crop.json +0 -37
- package/templates/showcase/almanac-canvas-theo-billboard.json +0 -37
- package/templates/showcase/amble-ethiopia-bloom-pour.json +0 -29
- package/templates/showcase/amble-fire-tower.json +0 -29
- package/templates/showcase/amble-roasting-doorway.json +0 -33
- package/templates/showcase/ashwell-kin-lamp-elin-lamplight.json +0 -37
- package/templates/showcase/aurelia-serum-succulent-dew.json +0 -33
- package/templates/showcase/basalt-bloom-water-bell.json +0 -29
- package/templates/showcase/basalt-hot-spring.json +0 -29
- package/templates/showcase/basalt-snells-window.json +0 -33
- package/templates/showcase/birch-hollow-vase-blossom-counter.json +0 -33
- package/templates/showcase/birch-hollow-vase-greenhouse-nook.json +0 -33
- package/templates/showcase/birch-hollow-vase-rosehip-frost.json +0 -29
- package/templates/showcase/birchwood-derby-night-train.json +0 -29
- package/templates/showcase/birchwood-salt-flat.json +0 -33
- package/templates/showcase/cairn-balm-drag-wet-slate.json +0 -29
- package/templates/showcase/cairn-sun-stick-agave-noon.json +0 -29
- package/templates/showcase/cairn-sun-stick-aloe-flesh.json +0 -33
- package/templates/showcase/calder-snow-loft.json +0 -29
- package/templates/showcase/cypress-row-oil-frosted-rosemary.json +0 -29
- package/templates/showcase/cypress-row-oil-olive-limb.json +0 -29
- package/templates/showcase/cypress-row-oil-running-glass.json +0 -29
- package/templates/showcase/fenwick-slade-long-shadow.json +0 -33
- package/templates/showcase/fernweg-cracked-clay-shadow.json +0 -29
- package/templates/showcase/fernweg-oil-heliconia-field.json +0 -33
- package/templates/showcase/fernweg-vial-soap-loaf.json +0 -29
- package/templates/showcase/ferro-beach-cooler.json +0 -29
- package/templates/showcase/ferro-yuzu-pressure-jet.json +0 -29
- package/templates/showcase/fieldnote-camera-precision-bench.json +0 -33
- package/templates/showcase/halcyon-drive-in.json +0 -29
- package/templates/showcase/harlow-basket-attic-light.json +0 -33
- package/templates/showcase/hollow-reed-honey-heather-wind.json +0 -29
- package/templates/showcase/hollow-reed-honey-light-well.json +0 -33
- package/templates/showcase/hollow-reed-honey-meadow-bee.json +0 -29
- package/templates/showcase/holloway-rings-gilders-cushion.json +0 -29
- package/templates/showcase/holloway-rings-indigo-fold-trough.json +0 -33
- package/templates/showcase/holloway-rings-loupe-surface-plate.json +0 -33
- package/templates/showcase/julien-almanac-fisheye.json +0 -37
- package/templates/showcase/kenji-wavelength-listening.json +0 -37
- package/templates/showcase/kestrel-jacket-julien-low-key.json +0 -37
- package/templates/showcase/kestrel-otis-alpine-ridge.json +0 -37
- package/templates/showcase/keystone-keyboard-cut-paper-poster.json +0 -33
- package/templates/showcase/keystone-keyboard-home-row-halo.json +0 -29
- package/templates/showcase/lumen-hotel-bar.json +0 -29
- package/templates/showcase/lumen-signet-clay-impression.json +0 -29
- package/templates/showcase/lumen-signet-ink-bloom.json +0 -29
- package/templates/showcase/marden-cole-denim-maren-editorial-walk.json +0 -37
- package/templates/showcase/marden-cole-denim-mateo-car-window.json +0 -33
- package/templates/showcase/marden-cole-denim-rain-glass-beads.json +0 -29
- package/templates/showcase/marrow-vale-flacon-boulder-gap.json +0 -33
- package/templates/showcase/marrow-vale-halite-ledge.json +0 -33
- package/templates/showcase/marrow-vale-reeded-colour-bands.json +0 -29
- package/templates/showcase/marrow-vale-resin-block.json +0 -33
- package/templates/showcase/moss-larkin-chair-travertine-atrium.json +0 -33
- package/templates/showcase/nordhavn-headphones-jun-light-bar.json +0 -33
- package/templates/showcase/nordhavn-headphones-wen-kitchen-seven.json +0 -33
- package/templates/showcase/northward-flask-hoarfrost-pavement.json +0 -29
- package/templates/showcase/northward-flask-melt-channel.json +0 -29
- package/templates/showcase/orchard-oat-orchard-burst.json +0 -33
- package/templates/showcase/orchard-oat-overhead-fold-pour.json +0 -29
- package/templates/showcase/orchard-oat-reeded-glass-refraction.json +0 -29
- package/templates/showcase/orla-priya-fjord-ferry.json +0 -33
- package/templates/showcase/orla-turtleneck-fennel-dawn.json +0 -29
- package/templates/showcase/perihelion-buds-astrid-beauty-crop.json +0 -33
- package/templates/showcase/perihelion-buds-gate-window-dawn.json +0 -29
- package/templates/showcase/rafael-aurelia-morning.json +0 -37
- package/templates/showcase/rowan-market-bike.json +0 -29
- package/templates/showcase/sasha-slate-harbor-spray-zone.json +0 -33
- package/templates/showcase/slate-harbor-shell-itai-neon-corridor.json +0 -37
- package/templates/showcase/slate-harbor-yoke-on-wet-slate.json +0 -29
- package/templates/showcase/solenne-cream-bree-closeup.json +0 -37
- package/templates/showcase/solenne-spa-ledge.json +0 -29
- package/templates/showcase/solstice-aviators-screen-print.json +0 -33
- package/templates/showcase/solstice-cracked-clay.json +0 -33
- package/templates/showcase/soraya-taxi-hoops.json +0 -33
- package/templates/showcase/tallulah-ferro-story-motion.json +0 -37
- package/templates/showcase/tanner-fielding-bar-sugar-pull.json +0 -33
- package/templates/showcase/tanner-fielding-cocoa-crown.json +0 -33
- package/templates/showcase/thornebury-table-dust-sheet.json +0 -33
- package/templates/showcase/tidewater-coral-can-melt-channel.json +0 -33
- package/templates/showcase/tidewater-seltzer-basalt-columns.json +0 -29
- package/templates/showcase/tidewater-seltzer-wave-break.json +0 -29
- package/templates/showcase/verity-hoops-charred-cedar.json +0 -29
- package/templates/showcase/verity-hoops-pigment-lift.json +0 -29
- package/templates/showcase/verity-pearls-suspended-silk.json +0 -33
- package/templates/showcase/verity-travel-case.json +0 -29
- package/templates/showcase/verlaine-flacon-amber-resin.json +0 -29
- package/templates/showcase/verlaine-molten-wax.json +0 -33
- package/templates/showcase/verlaine-vanity-mirror.json +0 -29
- package/templates/showcase/verse-color-court.json +0 -29
- package/templates/showcase/verse-lipstick-soraya-soft-diffusion.json +0 -37
- package/templates/showcase/voss-rowe-dune-slip-face.json +0 -33
- package/templates/showcase/voss-rowe-runner-volcanic-ash.json +0 -33
- package/templates/showcase/voss-rowe-sasha-grit-cut-freeze.json +0 -37
- package/templates/showcase/voss-rowe-tarn-refraction.json +0 -29
- package/templates/showcase/wen-meridian-trailhead.json +0 -33
- package/templates/social-amber-flare-motion.json +0 -15
- package/templates/social-beauty-editorial-grid.json +0 -15
- package/templates/social-beverage-launch-splash.json +0 -15
- package/templates/social-cobalt-hand-reveal.json +0 -15
- package/templates/social-fashion-campaign-billboard.json +0 -15
- package/templates/social-product-drop-hype.json +0 -15
- package/templates/social-vertical-story-motion.json +0 -15
- package/templates/soft-diffusion-portrait.json +0 -15
- package/templates/split-tone-color-gel-portrait.json +0 -15
- package/templates/stitched-construction-detail.json +0 -15
- package/templates/studio-aloe-flesh-macro.json +0 -15
- package/templates/studio-amber-resin-suspension.json +0 -15
- package/templates/studio-basalt-crust-glow.json +0 -15
- package/templates/studio-blue-ice-melt-channel.json +0 -15
- package/templates/studio-dune-slip-face.json +0 -14
- package/templates/studio-molten-sugar-pull.json +0 -15
- package/templates/studio-polished-pedestal.json +0 -15
- package/templates/studio-rainforest-canopy.json +0 -15
- package/templates/studio-reef-shelf-caustics.json +0 -15
- package/templates/studio-salt-crystal-cavern.json +0 -15
- package/templates/studio-sea-stack-horizon.json +0 -14
- package/templates/studio-sharp-shadow-stage.json +0 -15
- package/templates/studio-spotlit-vertical-stage.json +0 -15
- package/templates/studio-submerged-bloom-drift.json +0 -15
- package/templates/studio-vertical-light-well.json +0 -15
- package/templates/studio-volcanic-ash-field.json +0 -15
- package/templates/suspended-color-field.json +0 -15
- package/templates/terracotta-ledge-glow.json +0 -15
- package/templates/wide-establishing-environment.json +0 -15
- package/templates/worn-scale-cropped-gesture.json +0 -15
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
var Ob=e=>{throw TypeError(e)};var Ib=(e,t,n)=>t.has(e)||Ob("Cannot "+n);var Kr=(e,t,n)=>(Ib(e,t,"read from private field"),n?n.call(e):t.get(e)),Fb=(e,t,n)=>t.has(e)?Ob("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),X2=(e,t,n,r)=>(Ib(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function PL(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const c of i.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();function oS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Q2={exports:{}},Od={},J2={exports:{}},hn={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var _b;function LL(){if(_b)return hn;_b=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function v(I){return I===null||typeof I!="object"?null:(I=m&&I[m]||I["@@iterator"],typeof I=="function"?I:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,b={};function k(I,B,Y){this.props=I,this.context=B,this.refs=b,this.updater=Y||w}k.prototype.isReactComponent={},k.prototype.setState=function(I,B){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,B,"setState")},k.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function S(){}S.prototype=k.prototype;function C(I,B,Y){this.props=I,this.context=B,this.refs=b,this.updater=Y||w}var j=C.prototype=new S;j.constructor=C,y(j,k.prototype),j.isPureReactComponent=!0;var N=Array.isArray,P=Object.prototype.hasOwnProperty,$={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function E(I,B,Y){var ae,X={},le=null,ke=null;if(B!=null)for(ae in B.ref!==void 0&&(ke=B.ref),B.key!==void 0&&(le=""+B.key),B)P.call(B,ae)&&!R.hasOwnProperty(ae)&&(X[ae]=B[ae]);var te=arguments.length-2;if(te===1)X.children=Y;else if(1<te){for(var be=Array(te),G=0;G<te;G++)be[G]=arguments[G+2];X.children=be}if(I&&I.defaultProps)for(ae in te=I.defaultProps,te)X[ae]===void 0&&(X[ae]=te[ae]);return{$$typeof:e,type:I,key:le,ref:ke,props:X,_owner:$.current}}function M(I,B){return{$$typeof:e,type:I.type,key:B,ref:I.ref,props:I.props,_owner:I._owner}}function L(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function H(I){var B={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(Y){return B[Y]})}var D=/\/+/g;function K(I,B){return typeof I=="object"&&I!==null&&I.key!=null?H(""+I.key):B.toString(36)}function O(I,B,Y,ae,X){var le=typeof I;(le==="undefined"||le==="boolean")&&(I=null);var ke=!1;if(I===null)ke=!0;else switch(le){case"string":case"number":ke=!0;break;case"object":switch(I.$$typeof){case e:case t:ke=!0}}if(ke)return ke=I,X=X(ke),I=ae===""?"."+K(ke,0):ae,N(X)?(Y="",I!=null&&(Y=I.replace(D,"$&/")+"/"),O(X,B,Y,"",function(G){return G})):X!=null&&(L(X)&&(X=M(X,Y+(!X.key||ke&&ke.key===X.key?"":(""+X.key).replace(D,"$&/")+"/")+I)),B.push(X)),1;if(ke=0,ae=ae===""?".":ae+":",N(I))for(var te=0;te<I.length;te++){le=I[te];var be=ae+K(le,te);ke+=O(le,B,Y,be,X)}else if(be=v(I),typeof be=="function")for(I=be.call(I),te=0;!(le=I.next()).done;)le=le.value,be=ae+K(le,te++),ke+=O(le,B,Y,be,X);else if(le==="object")throw B=String(I),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.");return ke}function _(I,B,Y){if(I==null)return I;var ae=[],X=0;return O(I,ae,"","",function(le){return B.call(Y,le,X++)}),ae}function re(I){if(I._status===-1){var B=I._result;B=B(),B.then(function(Y){(I._status===0||I._status===-1)&&(I._status=1,I._result=Y)},function(Y){(I._status===0||I._status===-1)&&(I._status=2,I._result=Y)}),I._status===-1&&(I._status=0,I._result=B)}if(I._status===1)return I._result.default;throw I._result}var z={current:null},F={transition:null},Q={ReactCurrentDispatcher:z,ReactCurrentBatchConfig:F,ReactCurrentOwner:$};function V(){throw Error("act(...) is not supported in production builds of React.")}return hn.Children={map:_,forEach:function(I,B,Y){_(I,function(){B.apply(this,arguments)},Y)},count:function(I){var B=0;return _(I,function(){B++}),B},toArray:function(I){return _(I,function(B){return B})||[]},only:function(I){if(!L(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},hn.Component=k,hn.Fragment=n,hn.Profiler=a,hn.PureComponent=C,hn.StrictMode=r,hn.Suspense=f,hn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q,hn.act=V,hn.cloneElement=function(I,B,Y){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var ae=y({},I.props),X=I.key,le=I.ref,ke=I._owner;if(B!=null){if(B.ref!==void 0&&(le=B.ref,ke=$.current),B.key!==void 0&&(X=""+B.key),I.type&&I.type.defaultProps)var te=I.type.defaultProps;for(be in B)P.call(B,be)&&!R.hasOwnProperty(be)&&(ae[be]=B[be]===void 0&&te!==void 0?te[be]:B[be])}var be=arguments.length-2;if(be===1)ae.children=Y;else if(1<be){te=Array(be);for(var G=0;G<be;G++)te[G]=arguments[G+2];ae.children=te}return{$$typeof:e,type:I.type,key:X,ref:le,props:ae,_owner:ke}},hn.createContext=function(I){return I={$$typeof:c,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:i,_context:I},I.Consumer=I},hn.createElement=E,hn.createFactory=function(I){var B=E.bind(null,I);return B.type=I,B},hn.createRef=function(){return{current:null}},hn.forwardRef=function(I){return{$$typeof:u,render:I}},hn.isValidElement=L,hn.lazy=function(I){return{$$typeof:p,_payload:{_status:-1,_result:I},_init:re}},hn.memo=function(I,B){return{$$typeof:h,type:I,compare:B===void 0?null:B}},hn.startTransition=function(I){var B=F.transition;F.transition={};try{I()}finally{F.transition=B}},hn.unstable_act=V,hn.useCallback=function(I,B){return z.current.useCallback(I,B)},hn.useContext=function(I){return z.current.useContext(I)},hn.useDebugValue=function(){},hn.useDeferredValue=function(I){return z.current.useDeferredValue(I)},hn.useEffect=function(I,B){return z.current.useEffect(I,B)},hn.useId=function(){return z.current.useId()},hn.useImperativeHandle=function(I,B,Y){return z.current.useImperativeHandle(I,B,Y)},hn.useInsertionEffect=function(I,B){return z.current.useInsertionEffect(I,B)},hn.useLayoutEffect=function(I,B){return z.current.useLayoutEffect(I,B)},hn.useMemo=function(I,B){return z.current.useMemo(I,B)},hn.useReducer=function(I,B,Y){return z.current.useReducer(I,B,Y)},hn.useRef=function(I){return z.current.useRef(I)},hn.useState=function(I){return z.current.useState(I)},hn.useSyncExternalStore=function(I,B,Y){return z.current.useSyncExternalStore(I,B,Y)},hn.useTransition=function(){return z.current.useTransition()},hn.version="18.3.1",hn}var Zb;function Q6(){return Zb||(Zb=1,J2.exports=LL()),J2.exports}/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Vb;function TL(){if(Vb)return Od;Vb=1;var e=Q6(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function c(u,f,h){var p,m={},v=null,w=null;h!==void 0&&(v=""+h),f.key!==void 0&&(v=""+f.key),f.ref!==void 0&&(w=f.ref);for(p in f)r.call(f,p)&&!i.hasOwnProperty(p)&&(m[p]=f[p]);if(u&&u.defaultProps)for(p in f=u.defaultProps,f)m[p]===void 0&&(m[p]=f[p]);return{$$typeof:t,type:u,key:v,ref:w,props:m,_owner:a.current}}return Od.Fragment=n,Od.jsx=c,Od.jsxs=c,Od}var zb;function $L(){return zb||(zb=1,Q2.exports=TL()),Q2.exports}var o=$L(),s=Q6();const $n=oS(s),lc=PL({__proto__:null,default:$n},[s]);var R1={},eg={exports:{}},bs={},tg={exports:{}},ng={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var Bb;function DL(){return Bb||(Bb=1,(function(e){function t(F,Q){var V=F.length;F.push(Q);e:for(;0<V;){var I=V-1>>>1,B=F[I];if(0<a(B,Q))F[I]=Q,F[V]=B,V=I;else break e}}function n(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var Q=F[0],V=F.pop();if(V!==Q){F[0]=V;e:for(var I=0,B=F.length,Y=B>>>1;I<Y;){var ae=2*(I+1)-1,X=F[ae],le=ae+1,ke=F[le];if(0>a(X,V))le<B&&0>a(ke,X)?(F[I]=ke,F[le]=V,I=le):(F[I]=X,F[ae]=V,I=ae);else if(le<B&&0>a(ke,V))F[I]=ke,F[le]=V,I=le;else break e}}return Q}function a(F,Q){var V=F.sortIndex-Q.sortIndex;return V!==0?V:F.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],h=[],p=1,m=null,v=3,w=!1,y=!1,b=!1,k=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function j(F){for(var Q=n(h);Q!==null;){if(Q.callback===null)r(h);else if(Q.startTime<=F)r(h),Q.sortIndex=Q.expirationTime,t(f,Q);else break;Q=n(h)}}function N(F){if(b=!1,j(F),!y)if(n(f)!==null)y=!0,re(P);else{var Q=n(h);Q!==null&&z(N,Q.startTime-F)}}function P(F,Q){y=!1,b&&(b=!1,S(E),E=-1),w=!0;var V=v;try{for(j(Q),m=n(f);m!==null&&(!(m.expirationTime>Q)||F&&!H());){var I=m.callback;if(typeof I=="function"){m.callback=null,v=m.priorityLevel;var B=I(m.expirationTime<=Q);Q=e.unstable_now(),typeof B=="function"?m.callback=B:m===n(f)&&r(f),j(Q)}else r(f);m=n(f)}if(m!==null)var Y=!0;else{var ae=n(h);ae!==null&&z(N,ae.startTime-Q),Y=!1}return Y}finally{m=null,v=V,w=!1}}var $=!1,R=null,E=-1,M=5,L=-1;function H(){return!(e.unstable_now()-L<M)}function D(){if(R!==null){var F=e.unstable_now();L=F;var Q=!0;try{Q=R(!0,F)}finally{Q?K():($=!1,R=null)}}else $=!1}var K;if(typeof C=="function")K=function(){C(D)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,_=O.port2;O.port1.onmessage=D,K=function(){_.postMessage(null)}}else K=function(){k(D,0)};function re(F){R=F,$||($=!0,K())}function z(F,Q){E=k(function(){F(e.unstable_now())},Q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(F){F.callback=null},e.unstable_continueExecution=function(){y||w||(y=!0,re(P))},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(F){switch(v){case 1:case 2:case 3:var Q=3;break;default:Q=v}var V=v;v=Q;try{return F()}finally{v=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,Q){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var V=v;v=F;try{return Q()}finally{v=V}},e.unstable_scheduleCallback=function(F,Q,V){var I=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?I+V:I):V=I,F){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=V+B,F={id:p++,callback:Q,priorityLevel:F,startTime:V,expirationTime:B,sortIndex:-1},V>I?(F.sortIndex=V,t(h,F),n(f)===null&&F===n(h)&&(b?(S(E),E=-1):b=!0,z(N,V-I))):(F.sortIndex=B,t(f,F),y||w||(y=!0,re(P))),F},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(F){var Q=v;return function(){var V=v;v=Q;try{return F.apply(this,arguments)}finally{v=V}}}})(ng)),ng}var Ub;function HL(){return Ub||(Ub=1,tg.exports=DL()),tg.exports}/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var Wb;function OL(){if(Wb)return bs;Wb=1;var e=Q6(),t=HL();function n(l){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+l,g=1;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g]);return"Minified React error #"+l+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,a={};function i(l,d){c(l,d),c(l+"Capture",d)}function c(l,d){for(a[l]=d,l=0;l<d.length;l++)r.add(d[l])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},m={};function v(l){return f.call(m,l)?!0:f.call(p,l)?!1:h.test(l)?m[l]=!0:(p[l]=!0,!1)}function w(l,d,g,x){if(g!==null&&g.type===0)return!1;switch(typeof d){case"function":case"symbol":return!0;case"boolean":return x?!1:g!==null?!g.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function y(l,d,g,x){if(d===null||typeof d>"u"||w(l,d,g,x))return!0;if(x)return!1;if(g!==null)switch(g.type){case 3:return!d;case 4:return d===!1;case 5:return isNaN(d);case 6:return isNaN(d)||1>d}return!1}function b(l,d,g,x,A,T,Z){this.acceptsBooleans=d===2||d===3||d===4,this.attributeName=x,this.attributeNamespace=A,this.mustUseProperty=g,this.propertyName=l,this.type=d,this.sanitizeURL=T,this.removeEmptyString=Z}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){k[l]=new b(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var d=l[0];k[d]=new b(d,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){k[l]=new b(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){k[l]=new b(l,2,!1,l,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(l){k[l]=new b(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){k[l]=new b(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){k[l]=new b(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){k[l]=new b(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){k[l]=new b(l,5,!1,l.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function C(l){return l[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(l){var d=l.replace(S,C);k[d]=new b(d,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var d=l.replace(S,C);k[d]=new b(d,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var d=l.replace(S,C);k[d]=new b(d,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){k[l]=new b(l,1,!1,l.toLowerCase(),null,!1,!1)}),k.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){k[l]=new b(l,1,!1,l.toLowerCase(),null,!0,!0)});function j(l,d,g,x){var A=k.hasOwnProperty(d)?k[d]:null;(A!==null?A.type!==0:x||!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(y(d,g,A,x)&&(g=null),x||A===null?v(d)&&(g===null?l.removeAttribute(d):l.setAttribute(d,""+g)):A.mustUseProperty?l[A.propertyName]=g===null?A.type===3?!1:"":g:(d=A.attributeName,x=A.attributeNamespace,g===null?l.removeAttribute(d):(A=A.type,g=A===3||A===4&&g===!0?"":""+g,x?l.setAttributeNS(x,d,g):l.setAttribute(d,g))))}var N=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),$=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),H=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),z=Symbol.for("react.offscreen"),F=Symbol.iterator;function Q(l){return l===null||typeof l!="object"?null:(l=F&&l[F]||l["@@iterator"],typeof l=="function"?l:null)}var V=Object.assign,I;function B(l){if(I===void 0)try{throw Error()}catch(g){var d=g.stack.trim().match(/\n( *(at )?)/);I=d&&d[1]||""}return`
|
|
34
|
-
`+I+l}var Y=!1;function ae(l,d){if(!l||Y)return"";Y=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(d)if(d=function(){throw Error()},Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(Ve){var x=Ve}Reflect.construct(l,[],d)}else{try{d.call()}catch(Ve){x=Ve}l.call(d.prototype)}else{try{throw Error()}catch(Ve){x=Ve}l()}}catch(Ve){if(Ve&&x&&typeof Ve.stack=="string"){for(var A=Ve.stack.split(`
|
|
35
|
-
`),T=x.stack.split(`
|
|
36
|
-
`),Z=A.length-1,de=T.length-1;1<=Z&&0<=de&&A[Z]!==T[de];)de--;for(;1<=Z&&0<=de;Z--,de--)if(A[Z]!==T[de]){if(Z!==1||de!==1)do if(Z--,de--,0>de||A[Z]!==T[de]){var xe=`
|
|
37
|
-
`+A[Z].replace(" at new "," at ");return l.displayName&&xe.includes("<anonymous>")&&(xe=xe.replace("<anonymous>",l.displayName)),xe}while(1<=Z&&0<=de);break}}}finally{Y=!1,Error.prepareStackTrace=g}return(l=l?l.displayName||l.name:"")?B(l):""}function X(l){switch(l.tag){case 5:return B(l.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return l=ae(l.type,!1),l;case 11:return l=ae(l.type.render,!1),l;case 1:return l=ae(l.type,!0),l;default:return""}}function le(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case R:return"Fragment";case $:return"Portal";case M:return"Profiler";case E:return"StrictMode";case K:return"Suspense";case O:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case H:return(l.displayName||"Context")+".Consumer";case L:return(l._context.displayName||"Context")+".Provider";case D:var d=l.render;return l=l.displayName,l||(l=d.displayName||d.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case _:return d=l.displayName||null,d!==null?d:le(l.type)||"Memo";case re:d=l._payload,l=l._init;try{return le(l(d))}catch{}}return null}function ke(l){var d=l.type;switch(l.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=d.render,l=l.displayName||l.name||"",d.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return le(d);case 8:return d===E?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function te(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function be(l){var d=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function G(l){var d=be(l)?"checked":"value",g=Object.getOwnPropertyDescriptor(l.constructor.prototype,d),x=""+l[d];if(!l.hasOwnProperty(d)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var A=g.get,T=g.set;return Object.defineProperty(l,d,{configurable:!0,get:function(){return A.call(this)},set:function(Z){x=""+Z,T.call(this,Z)}}),Object.defineProperty(l,d,{enumerable:g.enumerable}),{getValue:function(){return x},setValue:function(Z){x=""+Z},stopTracking:function(){l._valueTracker=null,delete l[d]}}}}function J(l){l._valueTracker||(l._valueTracker=G(l))}function ne(l){if(!l)return!1;var d=l._valueTracker;if(!d)return!0;var g=d.getValue(),x="";return l&&(x=be(l)?l.checked?"true":"false":l.value),l=x,l!==g?(d.setValue(l),!0):!1}function W(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function he(l,d){var g=d.checked;return V({},d,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:g??l._wrapperState.initialChecked})}function Xe(l,d){var g=d.defaultValue==null?"":d.defaultValue,x=d.checked!=null?d.checked:d.defaultChecked;g=te(d.value!=null?d.value:g),l._wrapperState={initialChecked:x,initialValue:g,controlled:d.type==="checkbox"||d.type==="radio"?d.checked!=null:d.value!=null}}function tt(l,d){d=d.checked,d!=null&&j(l,"checked",d,!1)}function ze(l,d){tt(l,d);var g=te(d.value),x=d.type;if(g!=null)x==="number"?(g===0&&l.value===""||l.value!=g)&&(l.value=""+g):l.value!==""+g&&(l.value=""+g);else if(x==="submit"||x==="reset"){l.removeAttribute("value");return}d.hasOwnProperty("value")?ce(l,d.type,g):d.hasOwnProperty("defaultValue")&&ce(l,d.type,te(d.defaultValue)),d.checked==null&&d.defaultChecked!=null&&(l.defaultChecked=!!d.defaultChecked)}function nt(l,d,g){if(d.hasOwnProperty("value")||d.hasOwnProperty("defaultValue")){var x=d.type;if(!(x!=="submit"&&x!=="reset"||d.value!==void 0&&d.value!==null))return;d=""+l._wrapperState.initialValue,g||d===l.value||(l.value=d),l.defaultValue=d}g=l.name,g!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,g!==""&&(l.name=g)}function ce(l,d,g){(d!=="number"||W(l.ownerDocument)!==l)&&(g==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+g&&(l.defaultValue=""+g))}var ve=Array.isArray;function Pe(l,d,g,x){if(l=l.options,d){d={};for(var A=0;A<g.length;A++)d["$"+g[A]]=!0;for(g=0;g<l.length;g++)A=d.hasOwnProperty("$"+l[g].value),l[g].selected!==A&&(l[g].selected=A),A&&x&&(l[g].defaultSelected=!0)}else{for(g=""+te(g),d=null,A=0;A<l.length;A++){if(l[A].value===g){l[A].selected=!0,x&&(l[A].defaultSelected=!0);return}d!==null||l[A].disabled||(d=l[A])}d!==null&&(d.selected=!0)}}function ue(l,d){if(d.dangerouslySetInnerHTML!=null)throw Error(n(91));return V({},d,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function Ee(l,d){var g=d.value;if(g==null){if(g=d.children,d=d.defaultValue,g!=null){if(d!=null)throw Error(n(92));if(ve(g)){if(1<g.length)throw Error(n(93));g=g[0]}d=g}d==null&&(d=""),g=d}l._wrapperState={initialValue:te(g)}}function Ke(l,d){var g=te(d.value),x=te(d.defaultValue);g!=null&&(g=""+g,g!==l.value&&(l.value=g),d.defaultValue==null&&l.defaultValue!==g&&(l.defaultValue=g)),x!=null&&(l.defaultValue=""+x)}function ye(l){var d=l.textContent;d===l._wrapperState.initialValue&&d!==""&&d!==null&&(l.value=d)}function Se(l){switch(l){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ie(l,d){return l==null||l==="http://www.w3.org/1999/xhtml"?Se(d):l==="http://www.w3.org/2000/svg"&&d==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var Be,Re=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(d,g,x,A){MSApp.execUnsafeLocalFunction(function(){return l(d,g,x,A)})}:l})(function(l,d){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=d;else{for(Be=Be||document.createElement("div"),Be.innerHTML="<svg>"+d.valueOf().toString()+"</svg>",d=Be.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;d.firstChild;)l.appendChild(d.firstChild)}});function Ze(l,d){if(d){var g=l.firstChild;if(g&&g===l.lastChild&&g.nodeType===3){g.nodeValue=d;return}}l.textContent=d}var Qe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},lt=["Webkit","ms","Moz","O"];Object.keys(Qe).forEach(function(l){lt.forEach(function(d){d=d+l.charAt(0).toUpperCase()+l.substring(1),Qe[d]=Qe[l]})});function Lt(l,d,g){return d==null||typeof d=="boolean"||d===""?"":g||typeof d!="number"||d===0||Qe.hasOwnProperty(l)&&Qe[l]?(""+d).trim():d+"px"}function Ut(l,d){l=l.style;for(var g in d)if(d.hasOwnProperty(g)){var x=g.indexOf("--")===0,A=Lt(g,d[g],x);g==="float"&&(g="cssFloat"),x?l.setProperty(g,A):l[g]=A}}var Ct=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function cn(l,d){if(d){if(Ct[l]&&(d.children!=null||d.dangerouslySetInnerHTML!=null))throw Error(n(137,l));if(d.dangerouslySetInnerHTML!=null){if(d.children!=null)throw Error(n(60));if(typeof d.dangerouslySetInnerHTML!="object"||!("__html"in d.dangerouslySetInnerHTML))throw Error(n(61))}if(d.style!=null&&typeof d.style!="object")throw Error(n(62))}}function Fe(l,d){if(l.indexOf("-")===-1)return typeof d.is=="string";switch(l){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var mt=null;function it(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var St=null,xt=null,Nt=null;function Kt(l){if(l=kd(l)){if(typeof St!="function")throw Error(n(280));var d=l.stateNode;d&&(d=Uf(d),St(l.stateNode,l.type,d))}}function et(l){xt?Nt?Nt.push(l):Nt=[l]:xt=l}function gt(){if(xt){var l=xt,d=Nt;if(Nt=xt=null,Kt(l),d)for(l=0;l<d.length;l++)Kt(d[l])}}function ot(l,d){return l(d)}function kn(){}var dt=!1;function Gt(l,d,g){if(dt)return l(d,g);dt=!0;try{return ot(l,d,g)}finally{dt=!1,(xt!==null||Nt!==null)&&(kn(),gt())}}function Ft(l,d){var g=l.stateNode;if(g===null)return null;var x=Uf(g);if(x===null)return null;g=x[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(x=!x.disabled)||(l=l.type,x=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!x;break e;default:l=!1}if(l)return null;if(g&&typeof g!="function")throw Error(n(231,d,typeof g));return g}var en=!1;if(u)try{var Jt={};Object.defineProperty(Jt,"passive",{get:function(){en=!0}}),window.addEventListener("test",Jt,Jt),window.removeEventListener("test",Jt,Jt)}catch{en=!1}function se(l,d,g,x,A,T,Z,de,xe){var Ve=Array.prototype.slice.call(arguments,3);try{d.apply(g,Ve)}catch(at){this.onError(at)}}var oe=!1,we=null,ge=!1,ee=null,He={onError:function(l){oe=!0,we=l}};function We(l,d,g,x,A,T,Z,de,xe){oe=!1,we=null,se.apply(He,arguments)}function Ue(l,d,g,x,A,T,Z,de,xe){if(We.apply(this,arguments),oe){if(oe){var Ve=we;oe=!1,we=null}else throw Error(n(198));ge||(ge=!0,ee=Ve)}}function Ge(l){var d=l,g=l;if(l.alternate)for(;d.return;)d=d.return;else{l=d;do d=l,(d.flags&4098)!==0&&(g=d.return),l=d.return;while(l)}return d.tag===3?g:null}function me(l){if(l.tag===13){var d=l.memoizedState;if(d===null&&(l=l.alternate,l!==null&&(d=l.memoizedState)),d!==null)return d.dehydrated}return null}function _e(l){if(Ge(l)!==l)throw Error(n(188))}function U(l){var d=l.alternate;if(!d){if(d=Ge(l),d===null)throw Error(n(188));return d!==l?null:l}for(var g=l,x=d;;){var A=g.return;if(A===null)break;var T=A.alternate;if(T===null){if(x=A.return,x!==null){g=x;continue}break}if(A.child===T.child){for(T=A.child;T;){if(T===g)return _e(A),l;if(T===x)return _e(A),d;T=T.sibling}throw Error(n(188))}if(g.return!==x.return)g=A,x=T;else{for(var Z=!1,de=A.child;de;){if(de===g){Z=!0,g=A,x=T;break}if(de===x){Z=!0,x=A,g=T;break}de=de.sibling}if(!Z){for(de=T.child;de;){if(de===g){Z=!0,g=T,x=A;break}if(de===x){Z=!0,x=T,g=A;break}de=de.sibling}if(!Z)throw Error(n(189))}}if(g.alternate!==x)throw Error(n(190))}if(g.tag!==3)throw Error(n(188));return g.stateNode.current===g?l:d}function pe(l){return l=U(l),l!==null?Oe(l):null}function Oe(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var d=Oe(l);if(d!==null)return d;l=l.sibling}return null}var Le=t.unstable_scheduleCallback,bt=t.unstable_cancelCallback,vt=t.unstable_shouldYield,jt=t.unstable_requestPaint,st=t.unstable_now,$t=t.unstable_getCurrentPriorityLevel,An=t.unstable_ImmediatePriority,q=t.unstable_UserBlockingPriority,fe=t.unstable_NormalPriority,Ae=t.unstable_LowPriority,Ye=t.unstable_IdlePriority,ft=null,wt=null;function Zt(l){if(wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(ft,l,void 0,(l.current.flags&128)===128)}catch{}}var Ht=Math.clz32?Math.clz32:wn,pn=Math.log,Wt=Math.LN2;function wn(l){return l>>>=0,l===0?32:31-(pn(l)/Wt|0)|0}var sn=64,In=4194304;function Dt(l){switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function On(l,d){var g=l.pendingLanes;if(g===0)return 0;var x=0,A=l.suspendedLanes,T=l.pingedLanes,Z=g&268435455;if(Z!==0){var de=Z&~A;de!==0?x=Dt(de):(T&=Z,T!==0&&(x=Dt(T)))}else Z=g&~A,Z!==0?x=Dt(Z):T!==0&&(x=Dt(T));if(x===0)return 0;if(d!==0&&d!==x&&(d&A)===0&&(A=x&-x,T=d&-d,A>=T||A===16&&(T&4194240)!==0))return d;if((x&4)!==0&&(x|=g&16),d=l.entangledLanes,d!==0)for(l=l.entanglements,d&=x;0<d;)g=31-Ht(d),A=1<<g,x|=l[g],d&=~A;return x}function Et(l,d){switch(l){case 1:case 2:case 4:return d+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return d+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Hn(l,d){for(var g=l.suspendedLanes,x=l.pingedLanes,A=l.expirationTimes,T=l.pendingLanes;0<T;){var Z=31-Ht(T),de=1<<Z,xe=A[Z];xe===-1?((de&g)===0||(de&x)!==0)&&(A[Z]=Et(de,d)):xe<=d&&(l.expiredLanes|=de),T&=~de}}function Ot(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function tn(){var l=sn;return sn<<=1,(sn&4194240)===0&&(sn=64),l}function Vn(l){for(var d=[],g=0;31>g;g++)d.push(l);return d}function ur(l,d,g){l.pendingLanes|=d,d!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,d=31-Ht(d),l[d]=g}function Zr(l,d){var g=l.pendingLanes&~d;l.pendingLanes=d,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=d,l.mutableReadLanes&=d,l.entangledLanes&=d,d=l.entanglements;var x=l.eventTimes;for(l=l.expirationTimes;0<g;){var A=31-Ht(g),T=1<<A;d[A]=0,x[A]=-1,l[A]=-1,g&=~T}}function zn(l,d){var g=l.entangledLanes|=d;for(l=l.entanglements;g;){var x=31-Ht(g),A=1<<x;A&d|l[x]&d&&(l[x]|=d),g&=~A}}var yn=0;function za(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var xo,ko,dl,wa,So,ya=!1,ba=[],Vr=null,ts=null,Gs=null,Ba=new Map,Pr=new Map,Lr=[],Ua="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function di(l,d){switch(l){case"focusin":case"focusout":Vr=null;break;case"dragenter":case"dragleave":ts=null;break;case"mouseover":case"mouseout":Gs=null;break;case"pointerover":case"pointerout":Ba.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pr.delete(d.pointerId)}}function ie(l,d,g,x,A,T){return l===null||l.nativeEvent!==T?(l={blockedOn:d,domEventName:g,eventSystemFlags:x,nativeEvent:T,targetContainers:[A]},d!==null&&(d=kd(d),d!==null&&ko(d)),l):(l.eventSystemFlags|=x,d=l.targetContainers,A!==null&&d.indexOf(A)===-1&&d.push(A),l)}function $e(l,d,g,x,A){switch(d){case"focusin":return Vr=ie(Vr,l,d,g,x,A),!0;case"dragenter":return ts=ie(ts,l,d,g,x,A),!0;case"mouseover":return Gs=ie(Gs,l,d,g,x,A),!0;case"pointerover":var T=A.pointerId;return Ba.set(T,ie(Ba.get(T)||null,l,d,g,x,A)),!0;case"gotpointercapture":return T=A.pointerId,Pr.set(T,ie(Pr.get(T)||null,l,d,g,x,A)),!0}return!1}function Je(l){var d=ml(l.target);if(d!==null){var g=Ge(d);if(g!==null){if(d=g.tag,d===13){if(d=me(g),d!==null){l.blockedOn=d,So(l.priority,function(){dl(g)});return}}else if(d===3&&g.stateNode.current.memoizedState.isDehydrated){l.blockedOn=g.tag===3?g.stateNode.containerInfo:null;return}}}l.blockedOn=null}function Vt(l){if(l.blockedOn!==null)return!1;for(var d=l.targetContainers;0<d.length;){var g=Nc(l.domEventName,l.eventSystemFlags,d[0],l.nativeEvent);if(g===null){g=l.nativeEvent;var x=new g.constructor(g.type,g);mt=x,g.target.dispatchEvent(x),mt=null}else return d=kd(g),d!==null&&ko(d),l.blockedOn=g,!1;d.shift()}return!0}function Yt(l,d,g){Vt(l)&&g.delete(d)}function Bn(){ya=!1,Vr!==null&&Vt(Vr)&&(Vr=null),ts!==null&&Vt(ts)&&(ts=null),Gs!==null&&Vt(Gs)&&(Gs=null),Ba.forEach(Yt),Pr.forEach(Yt)}function Nn(l,d){l.blockedOn===d&&(l.blockedOn=null,ya||(ya=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Bn)))}function xn(l){function d(A){return Nn(A,l)}if(0<ba.length){Nn(ba[0],l);for(var g=1;g<ba.length;g++){var x=ba[g];x.blockedOn===l&&(x.blockedOn=null)}}for(Vr!==null&&Nn(Vr,l),ts!==null&&Nn(ts,l),Gs!==null&&Nn(Gs,l),Ba.forEach(d),Pr.forEach(d),g=0;g<Lr.length;g++)x=Lr[g],x.blockedOn===l&&(x.blockedOn=null);for(;0<Lr.length&&(g=Lr[0],g.blockedOn===null);)Je(g),g.blockedOn===null&&Lr.shift()}var Sn=N.ReactCurrentBatchConfig,hs=!0;function ud(l,d,g,x){var A=yn,T=Sn.transition;Sn.transition=null;try{yn=1,hi(l,d,g,x)}finally{yn=A,Sn.transition=T}}function fi(l,d,g,x){var A=yn,T=Sn.transition;Sn.transition=null;try{yn=4,hi(l,d,g,x)}finally{yn=A,Sn.transition=T}}function hi(l,d,g,x){if(hs){var A=Nc(l,d,g,x);if(A===null)Zm(l,d,x,fl,g),di(l,x);else if($e(A,l,d,g,x))x.stopPropagation();else if(di(l,x),d&4&&-1<Ua.indexOf(l)){for(;A!==null;){var T=kd(A);if(T!==null&&xo(T),T=Nc(l,d,g,x),T===null&&Zm(l,d,x,fl,g),T===A)break;A=T}A!==null&&x.stopPropagation()}else Zm(l,d,x,null,g)}}var fl=null;function Nc(l,d,g,x){if(fl=null,l=it(x),l=ml(l),l!==null)if(d=Ge(l),d===null)l=null;else if(g=d.tag,g===13){if(l=me(d),l!==null)return l;l=null}else if(g===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;l=null}else d!==l&&(l=null);return fl=l,null}function dd(l){switch(l){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch($t()){case An:return 1;case q:return 4;case fe:case Ae:return 16;case Ye:return 536870912;default:return 16}default:return 16}}var Ys=null,Mc=null,hl=null;function fd(){if(hl)return hl;var l,d=Mc,g=d.length,x,A="value"in Ys?Ys.value:Ys.textContent,T=A.length;for(l=0;l<g&&d[l]===A[l];l++);var Z=g-l;for(x=1;x<=Z&&d[g-x]===A[T-x];x++);return hl=A.slice(l,1<x?1-x:void 0)}function pl(l){var d=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&d===13&&(l=13)):l=d,l===10&&(l=13),32<=l||l===13?l:0}function Ce(){return!0}function pt(){return!1}function It(l){function d(g,x,A,T,Z){this._reactName=g,this._targetInst=A,this.type=x,this.nativeEvent=T,this.target=Z,this.currentTarget=null;for(var de in l)l.hasOwnProperty(de)&&(g=l[de],this[de]=g?g(T):T[de]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?Ce:pt,this.isPropagationStopped=pt,this}return V(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var g=this.nativeEvent;g&&(g.preventDefault?g.preventDefault():typeof g.returnValue!="unknown"&&(g.returnValue=!1),this.isDefaultPrevented=Ce)},stopPropagation:function(){var g=this.nativeEvent;g&&(g.stopPropagation?g.stopPropagation():typeof g.cancelBubble!="unknown"&&(g.cancelBubble=!0),this.isPropagationStopped=Ce)},persist:function(){},isPersistent:Ce}),d}var qt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fn=It(qt),mn=V({},qt,{view:0,detail:0}),ps=It(mn),Xt,Fn,Tn,Wa=V({},mn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rm,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==Tn&&(Tn&&l.type==="mousemove"?(Xt=l.screenX-Tn.screenX,Fn=l.screenY-Tn.screenY):Fn=Xt=0,Tn=l),Xt)},movementY:function(l){return"movementY"in l?l.movementY:Fn}}),Rc=It(Wa),xa=V({},Wa,{dataTransfer:0}),Hf=It(xa),Of=V({},mn,{relatedTarget:0}),Mm=It(Of),lP=V({},qt,{animationName:0,elapsedTime:0,pseudoElement:0}),cP=It(lP),uP=V({},qt,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),dP=It(uP),fP=V({},qt,{data:0}),Aw=It(fP),hP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pP={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},mP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gP(l){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(l):(l=mP[l])?!!d[l]:!1}function Rm(){return gP}var vP=V({},mn,{key:function(l){if(l.key){var d=hP[l.key]||l.key;if(d!=="Unidentified")return d}return l.type==="keypress"?(l=pl(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?pP[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rm,charCode:function(l){return l.type==="keypress"?pl(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?pl(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),wP=It(vP),yP=V({},Wa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nw=It(yP),bP=V({},mn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rm}),xP=It(bP),kP=V({},qt,{propertyName:0,elapsedTime:0,pseudoElement:0}),SP=It(kP),EP=V({},Wa,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),CP=It(EP),jP=[9,13,27,32],Pm=u&&"CompositionEvent"in window,hd=null;u&&"documentMode"in document&&(hd=document.documentMode);var AP=u&&"TextEvent"in window&&!hd,Mw=u&&(!Pm||hd&&8<hd&&11>=hd),Rw=" ",Pw=!1;function Lw(l,d){switch(l){case"keyup":return jP.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tw(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Pc=!1;function NP(l,d){switch(l){case"compositionend":return Tw(d);case"keypress":return d.which!==32?null:(Pw=!0,Rw);case"textInput":return l=d.data,l===Rw&&Pw?null:l;default:return null}}function MP(l,d){if(Pc)return l==="compositionend"||!Pm&&Lw(l,d)?(l=fd(),hl=Mc=Ys=null,Pc=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return Mw&&d.locale!=="ko"?null:d.data;default:return null}}var RP={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function $w(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d==="input"?!!RP[l.type]:d==="textarea"}function Dw(l,d,g,x){et(x),d=Vf(d,"onChange"),0<d.length&&(g=new fn("onChange","change",null,g,x),l.push({event:g,listeners:d}))}var pd=null,md=null;function PP(l){Jw(l,0)}function If(l){var d=Hc(l);if(ne(d))return l}function LP(l,d){if(l==="change")return d}var Hw=!1;if(u){var Lm;if(u){var Tm="oninput"in document;if(!Tm){var Ow=document.createElement("div");Ow.setAttribute("oninput","return;"),Tm=typeof Ow.oninput=="function"}Lm=Tm}else Lm=!1;Hw=Lm&&(!document.documentMode||9<document.documentMode)}function Iw(){pd&&(pd.detachEvent("onpropertychange",Fw),md=pd=null)}function Fw(l){if(l.propertyName==="value"&&If(md)){var d=[];Dw(d,md,l,it(l)),Gt(PP,d)}}function TP(l,d,g){l==="focusin"?(Iw(),pd=d,md=g,pd.attachEvent("onpropertychange",Fw)):l==="focusout"&&Iw()}function $P(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return If(md)}function DP(l,d){if(l==="click")return If(d)}function HP(l,d){if(l==="input"||l==="change")return If(d)}function OP(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}var ka=typeof Object.is=="function"?Object.is:OP;function gd(l,d){if(ka(l,d))return!0;if(typeof l!="object"||l===null||typeof d!="object"||d===null)return!1;var g=Object.keys(l),x=Object.keys(d);if(g.length!==x.length)return!1;for(x=0;x<g.length;x++){var A=g[x];if(!f.call(d,A)||!ka(l[A],d[A]))return!1}return!0}function _w(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function Zw(l,d){var g=_w(l);l=0;for(var x;g;){if(g.nodeType===3){if(x=l+g.textContent.length,l<=d&&x>=d)return{node:g,offset:d-l};l=x}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=_w(g)}}function Vw(l,d){return l&&d?l===d?!0:l&&l.nodeType===3?!1:d&&d.nodeType===3?Vw(l,d.parentNode):"contains"in l?l.contains(d):l.compareDocumentPosition?!!(l.compareDocumentPosition(d)&16):!1:!1}function zw(){for(var l=window,d=W();d instanceof l.HTMLIFrameElement;){try{var g=typeof d.contentWindow.location.href=="string"}catch{g=!1}if(g)l=d.contentWindow;else break;d=W(l.document)}return d}function $m(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d&&(d==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||d==="textarea"||l.contentEditable==="true")}function IP(l){var d=zw(),g=l.focusedElem,x=l.selectionRange;if(d!==g&&g&&g.ownerDocument&&Vw(g.ownerDocument.documentElement,g)){if(x!==null&&$m(g)){if(d=x.start,l=x.end,l===void 0&&(l=d),"selectionStart"in g)g.selectionStart=d,g.selectionEnd=Math.min(l,g.value.length);else if(l=(d=g.ownerDocument||document)&&d.defaultView||window,l.getSelection){l=l.getSelection();var A=g.textContent.length,T=Math.min(x.start,A);x=x.end===void 0?T:Math.min(x.end,A),!l.extend&&T>x&&(A=x,x=T,T=A),A=Zw(g,T);var Z=Zw(g,x);A&&Z&&(l.rangeCount!==1||l.anchorNode!==A.node||l.anchorOffset!==A.offset||l.focusNode!==Z.node||l.focusOffset!==Z.offset)&&(d=d.createRange(),d.setStart(A.node,A.offset),l.removeAllRanges(),T>x?(l.addRange(d),l.extend(Z.node,Z.offset)):(d.setEnd(Z.node,Z.offset),l.addRange(d)))}}for(d=[],l=g;l=l.parentNode;)l.nodeType===1&&d.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<d.length;g++)l=d[g],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var FP=u&&"documentMode"in document&&11>=document.documentMode,Lc=null,Dm=null,vd=null,Hm=!1;function Bw(l,d,g){var x=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;Hm||Lc==null||Lc!==W(x)||(x=Lc,"selectionStart"in x&&$m(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),vd&&gd(vd,x)||(vd=x,x=Vf(Dm,"onSelect"),0<x.length&&(d=new fn("onSelect","select",null,d,g),l.push({event:d,listeners:x}),d.target=Lc)))}function Ff(l,d){var g={};return g[l.toLowerCase()]=d.toLowerCase(),g["Webkit"+l]="webkit"+d,g["Moz"+l]="moz"+d,g}var Tc={animationend:Ff("Animation","AnimationEnd"),animationiteration:Ff("Animation","AnimationIteration"),animationstart:Ff("Animation","AnimationStart"),transitionend:Ff("Transition","TransitionEnd")},Om={},Uw={};u&&(Uw=document.createElement("div").style,"AnimationEvent"in window||(delete Tc.animationend.animation,delete Tc.animationiteration.animation,delete Tc.animationstart.animation),"TransitionEvent"in window||delete Tc.transitionend.transition);function _f(l){if(Om[l])return Om[l];if(!Tc[l])return l;var d=Tc[l],g;for(g in d)if(d.hasOwnProperty(g)&&g in Uw)return Om[l]=d[g];return l}var Ww=_f("animationend"),Kw=_f("animationiteration"),Gw=_f("animationstart"),Yw=_f("transitionend"),qw=new Map,Xw="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function pi(l,d){qw.set(l,d),i(d,[l])}for(var Im=0;Im<Xw.length;Im++){var Fm=Xw[Im],_P=Fm.toLowerCase(),ZP=Fm[0].toUpperCase()+Fm.slice(1);pi(_P,"on"+ZP)}pi(Ww,"onAnimationEnd"),pi(Kw,"onAnimationIteration"),pi(Gw,"onAnimationStart"),pi("dblclick","onDoubleClick"),pi("focusin","onFocus"),pi("focusout","onBlur"),pi(Yw,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wd="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),VP=new Set("cancel close invalid load scroll toggle".split(" ").concat(wd));function Qw(l,d,g){var x=l.type||"unknown-event";l.currentTarget=g,Ue(x,d,void 0,l),l.currentTarget=null}function Jw(l,d){d=(d&4)!==0;for(var g=0;g<l.length;g++){var x=l[g],A=x.event;x=x.listeners;e:{var T=void 0;if(d)for(var Z=x.length-1;0<=Z;Z--){var de=x[Z],xe=de.instance,Ve=de.currentTarget;if(de=de.listener,xe!==T&&A.isPropagationStopped())break e;Qw(A,de,Ve),T=xe}else for(Z=0;Z<x.length;Z++){if(de=x[Z],xe=de.instance,Ve=de.currentTarget,de=de.listener,xe!==T&&A.isPropagationStopped())break e;Qw(A,de,Ve),T=xe}}}if(ge)throw l=ee,ge=!1,ee=null,l}function Gn(l,d){var g=d[Km];g===void 0&&(g=d[Km]=new Set);var x=l+"__bubble";g.has(x)||(ey(d,l,2,!1),g.add(x))}function _m(l,d,g){var x=0;d&&(x|=4),ey(g,l,x,d)}var Zf="_reactListening"+Math.random().toString(36).slice(2);function yd(l){if(!l[Zf]){l[Zf]=!0,r.forEach(function(g){g!=="selectionchange"&&(VP.has(g)||_m(g,!1,l),_m(g,!0,l))});var d=l.nodeType===9?l:l.ownerDocument;d===null||d[Zf]||(d[Zf]=!0,_m("selectionchange",!1,d))}}function ey(l,d,g,x){switch(dd(d)){case 1:var A=ud;break;case 4:A=fi;break;default:A=hi}g=A.bind(null,d,g,l),A=void 0,!en||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(A=!0),x?A!==void 0?l.addEventListener(d,g,{capture:!0,passive:A}):l.addEventListener(d,g,!0):A!==void 0?l.addEventListener(d,g,{passive:A}):l.addEventListener(d,g,!1)}function Zm(l,d,g,x,A){var T=x;if((d&1)===0&&(d&2)===0&&x!==null)e:for(;;){if(x===null)return;var Z=x.tag;if(Z===3||Z===4){var de=x.stateNode.containerInfo;if(de===A||de.nodeType===8&&de.parentNode===A)break;if(Z===4)for(Z=x.return;Z!==null;){var xe=Z.tag;if((xe===3||xe===4)&&(xe=Z.stateNode.containerInfo,xe===A||xe.nodeType===8&&xe.parentNode===A))return;Z=Z.return}for(;de!==null;){if(Z=ml(de),Z===null)return;if(xe=Z.tag,xe===5||xe===6){x=T=Z;continue e}de=de.parentNode}}x=x.return}Gt(function(){var Ve=T,at=it(g),ct=[];e:{var rt=qw.get(l);if(rt!==void 0){var At=fn,Rt=l;switch(l){case"keypress":if(pl(g)===0)break e;case"keydown":case"keyup":At=wP;break;case"focusin":Rt="focus",At=Mm;break;case"focusout":Rt="blur",At=Mm;break;case"beforeblur":case"afterblur":At=Mm;break;case"click":if(g.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":At=Rc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":At=Hf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":At=xP;break;case Ww:case Kw:case Gw:At=cP;break;case Yw:At=SP;break;case"scroll":At=ps;break;case"wheel":At=CP;break;case"copy":case"cut":case"paste":At=dP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":At=Nw}var Pt=(d&4)!==0,lr=!Pt&&l==="scroll",Te=Pt?rt!==null?rt+"Capture":null:rt;Pt=[];for(var je=Ve,De;je!==null;){De=je;var ht=De.stateNode;if(De.tag===5&&ht!==null&&(De=ht,Te!==null&&(ht=Ft(je,Te),ht!=null&&Pt.push(bd(je,ht,De)))),lr)break;je=je.return}0<Pt.length&&(rt=new At(rt,Rt,null,g,at),ct.push({event:rt,listeners:Pt}))}}if((d&7)===0){e:{if(rt=l==="mouseover"||l==="pointerover",At=l==="mouseout"||l==="pointerout",rt&&g!==mt&&(Rt=g.relatedTarget||g.fromElement)&&(ml(Rt)||Rt[Eo]))break e;if((At||rt)&&(rt=at.window===at?at:(rt=at.ownerDocument)?rt.defaultView||rt.parentWindow:window,At?(Rt=g.relatedTarget||g.toElement,At=Ve,Rt=Rt?ml(Rt):null,Rt!==null&&(lr=Ge(Rt),Rt!==lr||Rt.tag!==5&&Rt.tag!==6)&&(Rt=null)):(At=null,Rt=Ve),At!==Rt)){if(Pt=Rc,ht="onMouseLeave",Te="onMouseEnter",je="mouse",(l==="pointerout"||l==="pointerover")&&(Pt=Nw,ht="onPointerLeave",Te="onPointerEnter",je="pointer"),lr=At==null?rt:Hc(At),De=Rt==null?rt:Hc(Rt),rt=new Pt(ht,je+"leave",At,g,at),rt.target=lr,rt.relatedTarget=De,ht=null,ml(at)===Ve&&(Pt=new Pt(Te,je+"enter",Rt,g,at),Pt.target=De,Pt.relatedTarget=lr,ht=Pt),lr=ht,At&&Rt)t:{for(Pt=At,Te=Rt,je=0,De=Pt;De;De=$c(De))je++;for(De=0,ht=Te;ht;ht=$c(ht))De++;for(;0<je-De;)Pt=$c(Pt),je--;for(;0<De-je;)Te=$c(Te),De--;for(;je--;){if(Pt===Te||Te!==null&&Pt===Te.alternate)break t;Pt=$c(Pt),Te=$c(Te)}Pt=null}else Pt=null;At!==null&&ty(ct,rt,At,Pt,!1),Rt!==null&&lr!==null&&ty(ct,lr,Rt,Pt,!0)}}e:{if(rt=Ve?Hc(Ve):window,At=rt.nodeName&&rt.nodeName.toLowerCase(),At==="select"||At==="input"&&rt.type==="file")var Tt=LP;else if($w(rt))if(Hw)Tt=HP;else{Tt=$P;var zt=TP}else(At=rt.nodeName)&&At.toLowerCase()==="input"&&(rt.type==="checkbox"||rt.type==="radio")&&(Tt=DP);if(Tt&&(Tt=Tt(l,Ve))){Dw(ct,Tt,g,at);break e}zt&&zt(l,rt,Ve),l==="focusout"&&(zt=rt._wrapperState)&&zt.controlled&&rt.type==="number"&&ce(rt,"number",rt.value)}switch(zt=Ve?Hc(Ve):window,l){case"focusin":($w(zt)||zt.contentEditable==="true")&&(Lc=zt,Dm=Ve,vd=null);break;case"focusout":vd=Dm=Lc=null;break;case"mousedown":Hm=!0;break;case"contextmenu":case"mouseup":case"dragend":Hm=!1,Bw(ct,g,at);break;case"selectionchange":if(FP)break;case"keydown":case"keyup":Bw(ct,g,at)}var Bt;if(Pm)e:{switch(l){case"compositionstart":var Qt="onCompositionStart";break e;case"compositionend":Qt="onCompositionEnd";break e;case"compositionupdate":Qt="onCompositionUpdate";break e}Qt=void 0}else Pc?Lw(l,g)&&(Qt="onCompositionEnd"):l==="keydown"&&g.keyCode===229&&(Qt="onCompositionStart");Qt&&(Mw&&g.locale!=="ko"&&(Pc||Qt!=="onCompositionStart"?Qt==="onCompositionEnd"&&Pc&&(Bt=fd()):(Ys=at,Mc="value"in Ys?Ys.value:Ys.textContent,Pc=!0)),zt=Vf(Ve,Qt),0<zt.length&&(Qt=new Aw(Qt,l,null,g,at),ct.push({event:Qt,listeners:zt}),Bt?Qt.data=Bt:(Bt=Tw(g),Bt!==null&&(Qt.data=Bt)))),(Bt=AP?NP(l,g):MP(l,g))&&(Ve=Vf(Ve,"onBeforeInput"),0<Ve.length&&(at=new Aw("onBeforeInput","beforeinput",null,g,at),ct.push({event:at,listeners:Ve}),at.data=Bt))}Jw(ct,d)})}function bd(l,d,g){return{instance:l,listener:d,currentTarget:g}}function Vf(l,d){for(var g=d+"Capture",x=[];l!==null;){var A=l,T=A.stateNode;A.tag===5&&T!==null&&(A=T,T=Ft(l,g),T!=null&&x.unshift(bd(l,T,A)),T=Ft(l,d),T!=null&&x.push(bd(l,T,A))),l=l.return}return x}function $c(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function ty(l,d,g,x,A){for(var T=d._reactName,Z=[];g!==null&&g!==x;){var de=g,xe=de.alternate,Ve=de.stateNode;if(xe!==null&&xe===x)break;de.tag===5&&Ve!==null&&(de=Ve,A?(xe=Ft(g,T),xe!=null&&Z.unshift(bd(g,xe,de))):A||(xe=Ft(g,T),xe!=null&&Z.push(bd(g,xe,de)))),g=g.return}Z.length!==0&&l.push({event:d,listeners:Z})}var zP=/\r\n?/g,BP=/\u0000|\uFFFD/g;function ny(l){return(typeof l=="string"?l:""+l).replace(zP,`
|
|
38
|
-
`).replace(BP,"")}function zf(l,d,g){if(d=ny(d),ny(l)!==d&&g)throw Error(n(425))}function Bf(){}var Vm=null,zm=null;function Bm(l,d){return l==="textarea"||l==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var Um=typeof setTimeout=="function"?setTimeout:void 0,UP=typeof clearTimeout=="function"?clearTimeout:void 0,ry=typeof Promise=="function"?Promise:void 0,WP=typeof queueMicrotask=="function"?queueMicrotask:typeof ry<"u"?function(l){return ry.resolve(null).then(l).catch(KP)}:Um;function KP(l){setTimeout(function(){throw l})}function Wm(l,d){var g=d,x=0;do{var A=g.nextSibling;if(l.removeChild(g),A&&A.nodeType===8)if(g=A.data,g==="/$"){if(x===0){l.removeChild(A),xn(d);return}x--}else g!=="$"&&g!=="$?"&&g!=="$!"||x++;g=A}while(g);xn(d)}function mi(l){for(;l!=null;l=l.nextSibling){var d=l.nodeType;if(d===1||d===3)break;if(d===8){if(d=l.data,d==="$"||d==="$!"||d==="$?")break;if(d==="/$")return null}}return l}function sy(l){l=l.previousSibling;for(var d=0;l;){if(l.nodeType===8){var g=l.data;if(g==="$"||g==="$!"||g==="$?"){if(d===0)return l;d--}else g==="/$"&&d++}l=l.previousSibling}return null}var Dc=Math.random().toString(36).slice(2),Ka="__reactFiber$"+Dc,xd="__reactProps$"+Dc,Eo="__reactContainer$"+Dc,Km="__reactEvents$"+Dc,GP="__reactListeners$"+Dc,YP="__reactHandles$"+Dc;function ml(l){var d=l[Ka];if(d)return d;for(var g=l.parentNode;g;){if(d=g[Eo]||g[Ka]){if(g=d.alternate,d.child!==null||g!==null&&g.child!==null)for(l=sy(l);l!==null;){if(g=l[Ka])return g;l=sy(l)}return d}l=g,g=l.parentNode}return null}function kd(l){return l=l[Ka]||l[Eo],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function Hc(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function Uf(l){return l[xd]||null}var Gm=[],Oc=-1;function gi(l){return{current:l}}function Yn(l){0>Oc||(l.current=Gm[Oc],Gm[Oc]=null,Oc--)}function Un(l,d){Oc++,Gm[Oc]=l.current,l.current=d}var vi={},zr=gi(vi),ms=gi(!1),gl=vi;function Ic(l,d){var g=l.type.contextTypes;if(!g)return vi;var x=l.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===d)return x.__reactInternalMemoizedMaskedChildContext;var A={},T;for(T in g)A[T]=d[T];return x&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=d,l.__reactInternalMemoizedMaskedChildContext=A),A}function gs(l){return l=l.childContextTypes,l!=null}function Wf(){Yn(ms),Yn(zr)}function ay(l,d,g){if(zr.current!==vi)throw Error(n(168));Un(zr,d),Un(ms,g)}function oy(l,d,g){var x=l.stateNode;if(d=d.childContextTypes,typeof x.getChildContext!="function")return g;x=x.getChildContext();for(var A in x)if(!(A in d))throw Error(n(108,ke(l)||"Unknown",A));return V({},g,x)}function Kf(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||vi,gl=zr.current,Un(zr,l),Un(ms,ms.current),!0}function iy(l,d,g){var x=l.stateNode;if(!x)throw Error(n(169));g?(l=oy(l,d,gl),x.__reactInternalMemoizedMergedChildContext=l,Yn(ms),Yn(zr),Un(zr,l)):Yn(ms),Un(ms,g)}var Co=null,Gf=!1,Ym=!1;function ly(l){Co===null?Co=[l]:Co.push(l)}function qP(l){Gf=!0,ly(l)}function wi(){if(!Ym&&Co!==null){Ym=!0;var l=0,d=yn;try{var g=Co;for(yn=1;l<g.length;l++){var x=g[l];do x=x(!0);while(x!==null)}Co=null,Gf=!1}catch(A){throw Co!==null&&(Co=Co.slice(l+1)),Le(An,wi),A}finally{yn=d,Ym=!1}}return null}var Fc=[],_c=0,Yf=null,qf=0,qs=[],Xs=0,vl=null,jo=1,Ao="";function wl(l,d){Fc[_c++]=qf,Fc[_c++]=Yf,Yf=l,qf=d}function cy(l,d,g){qs[Xs++]=jo,qs[Xs++]=Ao,qs[Xs++]=vl,vl=l;var x=jo;l=Ao;var A=32-Ht(x)-1;x&=~(1<<A),g+=1;var T=32-Ht(d)+A;if(30<T){var Z=A-A%5;T=(x&(1<<Z)-1).toString(32),x>>=Z,A-=Z,jo=1<<32-Ht(d)+A|g<<A|x,Ao=T+l}else jo=1<<T|g<<A|x,Ao=l}function qm(l){l.return!==null&&(wl(l,1),cy(l,1,0))}function Xm(l){for(;l===Yf;)Yf=Fc[--_c],Fc[_c]=null,qf=Fc[--_c],Fc[_c]=null;for(;l===vl;)vl=qs[--Xs],qs[Xs]=null,Ao=qs[--Xs],qs[Xs]=null,jo=qs[--Xs],qs[Xs]=null}var $s=null,Ds=null,Xn=!1,Sa=null;function uy(l,d){var g=ta(5,null,null,0);g.elementType="DELETED",g.stateNode=d,g.return=l,d=l.deletions,d===null?(l.deletions=[g],l.flags|=16):d.push(g)}function dy(l,d){switch(l.tag){case 5:var g=l.type;return d=d.nodeType!==1||g.toLowerCase()!==d.nodeName.toLowerCase()?null:d,d!==null?(l.stateNode=d,$s=l,Ds=mi(d.firstChild),!0):!1;case 6:return d=l.pendingProps===""||d.nodeType!==3?null:d,d!==null?(l.stateNode=d,$s=l,Ds=null,!0):!1;case 13:return d=d.nodeType!==8?null:d,d!==null?(g=vl!==null?{id:jo,overflow:Ao}:null,l.memoizedState={dehydrated:d,treeContext:g,retryLane:1073741824},g=ta(18,null,null,0),g.stateNode=d,g.return=l,l.child=g,$s=l,Ds=null,!0):!1;default:return!1}}function Qm(l){return(l.mode&1)!==0&&(l.flags&128)===0}function Jm(l){if(Xn){var d=Ds;if(d){var g=d;if(!dy(l,d)){if(Qm(l))throw Error(n(418));d=mi(g.nextSibling);var x=$s;d&&dy(l,d)?uy(x,g):(l.flags=l.flags&-4097|2,Xn=!1,$s=l)}}else{if(Qm(l))throw Error(n(418));l.flags=l.flags&-4097|2,Xn=!1,$s=l}}}function fy(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;$s=l}function Xf(l){if(l!==$s)return!1;if(!Xn)return fy(l),Xn=!0,!1;var d;if((d=l.tag!==3)&&!(d=l.tag!==5)&&(d=l.type,d=d!=="head"&&d!=="body"&&!Bm(l.type,l.memoizedProps)),d&&(d=Ds)){if(Qm(l))throw hy(),Error(n(418));for(;d;)uy(l,d),d=mi(d.nextSibling)}if(fy(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));e:{for(l=l.nextSibling,d=0;l;){if(l.nodeType===8){var g=l.data;if(g==="/$"){if(d===0){Ds=mi(l.nextSibling);break e}d--}else g!=="$"&&g!=="$!"&&g!=="$?"||d++}l=l.nextSibling}Ds=null}}else Ds=$s?mi(l.stateNode.nextSibling):null;return!0}function hy(){for(var l=Ds;l;)l=mi(l.nextSibling)}function Zc(){Ds=$s=null,Xn=!1}function e2(l){Sa===null?Sa=[l]:Sa.push(l)}var XP=N.ReactCurrentBatchConfig;function Sd(l,d,g){if(l=g.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(g._owner){if(g=g._owner,g){if(g.tag!==1)throw Error(n(309));var x=g.stateNode}if(!x)throw Error(n(147,l));var A=x,T=""+l;return d!==null&&d.ref!==null&&typeof d.ref=="function"&&d.ref._stringRef===T?d.ref:(d=function(Z){var de=A.refs;Z===null?delete de[T]:de[T]=Z},d._stringRef=T,d)}if(typeof l!="string")throw Error(n(284));if(!g._owner)throw Error(n(290,l))}return l}function Qf(l,d){throw l=Object.prototype.toString.call(d),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":l))}function py(l){var d=l._init;return d(l._payload)}function my(l){function d(Te,je){if(l){var De=Te.deletions;De===null?(Te.deletions=[je],Te.flags|=16):De.push(je)}}function g(Te,je){if(!l)return null;for(;je!==null;)d(Te,je),je=je.sibling;return null}function x(Te,je){for(Te=new Map;je!==null;)je.key!==null?Te.set(je.key,je):Te.set(je.index,je),je=je.sibling;return Te}function A(Te,je){return Te=ji(Te,je),Te.index=0,Te.sibling=null,Te}function T(Te,je,De){return Te.index=De,l?(De=Te.alternate,De!==null?(De=De.index,De<je?(Te.flags|=2,je):De):(Te.flags|=2,je)):(Te.flags|=1048576,je)}function Z(Te){return l&&Te.alternate===null&&(Te.flags|=2),Te}function de(Te,je,De,ht){return je===null||je.tag!==6?(je=U2(De,Te.mode,ht),je.return=Te,je):(je=A(je,De),je.return=Te,je)}function xe(Te,je,De,ht){var Tt=De.type;return Tt===R?at(Te,je,De.props.children,ht,De.key):je!==null&&(je.elementType===Tt||typeof Tt=="object"&&Tt!==null&&Tt.$$typeof===re&&py(Tt)===je.type)?(ht=A(je,De.props),ht.ref=Sd(Te,je,De),ht.return=Te,ht):(ht=k1(De.type,De.key,De.props,null,Te.mode,ht),ht.ref=Sd(Te,je,De),ht.return=Te,ht)}function Ve(Te,je,De,ht){return je===null||je.tag!==4||je.stateNode.containerInfo!==De.containerInfo||je.stateNode.implementation!==De.implementation?(je=W2(De,Te.mode,ht),je.return=Te,je):(je=A(je,De.children||[]),je.return=Te,je)}function at(Te,je,De,ht,Tt){return je===null||je.tag!==7?(je=jl(De,Te.mode,ht,Tt),je.return=Te,je):(je=A(je,De),je.return=Te,je)}function ct(Te,je,De){if(typeof je=="string"&&je!==""||typeof je=="number")return je=U2(""+je,Te.mode,De),je.return=Te,je;if(typeof je=="object"&&je!==null){switch(je.$$typeof){case P:return De=k1(je.type,je.key,je.props,null,Te.mode,De),De.ref=Sd(Te,null,je),De.return=Te,De;case $:return je=W2(je,Te.mode,De),je.return=Te,je;case re:var ht=je._init;return ct(Te,ht(je._payload),De)}if(ve(je)||Q(je))return je=jl(je,Te.mode,De,null),je.return=Te,je;Qf(Te,je)}return null}function rt(Te,je,De,ht){var Tt=je!==null?je.key:null;if(typeof De=="string"&&De!==""||typeof De=="number")return Tt!==null?null:de(Te,je,""+De,ht);if(typeof De=="object"&&De!==null){switch(De.$$typeof){case P:return De.key===Tt?xe(Te,je,De,ht):null;case $:return De.key===Tt?Ve(Te,je,De,ht):null;case re:return Tt=De._init,rt(Te,je,Tt(De._payload),ht)}if(ve(De)||Q(De))return Tt!==null?null:at(Te,je,De,ht,null);Qf(Te,De)}return null}function At(Te,je,De,ht,Tt){if(typeof ht=="string"&&ht!==""||typeof ht=="number")return Te=Te.get(De)||null,de(je,Te,""+ht,Tt);if(typeof ht=="object"&&ht!==null){switch(ht.$$typeof){case P:return Te=Te.get(ht.key===null?De:ht.key)||null,xe(je,Te,ht,Tt);case $:return Te=Te.get(ht.key===null?De:ht.key)||null,Ve(je,Te,ht,Tt);case re:var zt=ht._init;return At(Te,je,De,zt(ht._payload),Tt)}if(ve(ht)||Q(ht))return Te=Te.get(De)||null,at(je,Te,ht,Tt,null);Qf(je,ht)}return null}function Rt(Te,je,De,ht){for(var Tt=null,zt=null,Bt=je,Qt=je=0,jr=null;Bt!==null&&Qt<De.length;Qt++){Bt.index>Qt?(jr=Bt,Bt=null):jr=Bt.sibling;var Mn=rt(Te,Bt,De[Qt],ht);if(Mn===null){Bt===null&&(Bt=jr);break}l&&Bt&&Mn.alternate===null&&d(Te,Bt),je=T(Mn,je,Qt),zt===null?Tt=Mn:zt.sibling=Mn,zt=Mn,Bt=jr}if(Qt===De.length)return g(Te,Bt),Xn&&wl(Te,Qt),Tt;if(Bt===null){for(;Qt<De.length;Qt++)Bt=ct(Te,De[Qt],ht),Bt!==null&&(je=T(Bt,je,Qt),zt===null?Tt=Bt:zt.sibling=Bt,zt=Bt);return Xn&&wl(Te,Qt),Tt}for(Bt=x(Te,Bt);Qt<De.length;Qt++)jr=At(Bt,Te,Qt,De[Qt],ht),jr!==null&&(l&&jr.alternate!==null&&Bt.delete(jr.key===null?Qt:jr.key),je=T(jr,je,Qt),zt===null?Tt=jr:zt.sibling=jr,zt=jr);return l&&Bt.forEach(function(Ai){return d(Te,Ai)}),Xn&&wl(Te,Qt),Tt}function Pt(Te,je,De,ht){var Tt=Q(De);if(typeof Tt!="function")throw Error(n(150));if(De=Tt.call(De),De==null)throw Error(n(151));for(var zt=Tt=null,Bt=je,Qt=je=0,jr=null,Mn=De.next();Bt!==null&&!Mn.done;Qt++,Mn=De.next()){Bt.index>Qt?(jr=Bt,Bt=null):jr=Bt.sibling;var Ai=rt(Te,Bt,Mn.value,ht);if(Ai===null){Bt===null&&(Bt=jr);break}l&&Bt&&Ai.alternate===null&&d(Te,Bt),je=T(Ai,je,Qt),zt===null?Tt=Ai:zt.sibling=Ai,zt=Ai,Bt=jr}if(Mn.done)return g(Te,Bt),Xn&&wl(Te,Qt),Tt;if(Bt===null){for(;!Mn.done;Qt++,Mn=De.next())Mn=ct(Te,Mn.value,ht),Mn!==null&&(je=T(Mn,je,Qt),zt===null?Tt=Mn:zt.sibling=Mn,zt=Mn);return Xn&&wl(Te,Qt),Tt}for(Bt=x(Te,Bt);!Mn.done;Qt++,Mn=De.next())Mn=At(Bt,Te,Qt,Mn.value,ht),Mn!==null&&(l&&Mn.alternate!==null&&Bt.delete(Mn.key===null?Qt:Mn.key),je=T(Mn,je,Qt),zt===null?Tt=Mn:zt.sibling=Mn,zt=Mn);return l&&Bt.forEach(function(RL){return d(Te,RL)}),Xn&&wl(Te,Qt),Tt}function lr(Te,je,De,ht){if(typeof De=="object"&&De!==null&&De.type===R&&De.key===null&&(De=De.props.children),typeof De=="object"&&De!==null){switch(De.$$typeof){case P:e:{for(var Tt=De.key,zt=je;zt!==null;){if(zt.key===Tt){if(Tt=De.type,Tt===R){if(zt.tag===7){g(Te,zt.sibling),je=A(zt,De.props.children),je.return=Te,Te=je;break e}}else if(zt.elementType===Tt||typeof Tt=="object"&&Tt!==null&&Tt.$$typeof===re&&py(Tt)===zt.type){g(Te,zt.sibling),je=A(zt,De.props),je.ref=Sd(Te,zt,De),je.return=Te,Te=je;break e}g(Te,zt);break}else d(Te,zt);zt=zt.sibling}De.type===R?(je=jl(De.props.children,Te.mode,ht,De.key),je.return=Te,Te=je):(ht=k1(De.type,De.key,De.props,null,Te.mode,ht),ht.ref=Sd(Te,je,De),ht.return=Te,Te=ht)}return Z(Te);case $:e:{for(zt=De.key;je!==null;){if(je.key===zt)if(je.tag===4&&je.stateNode.containerInfo===De.containerInfo&&je.stateNode.implementation===De.implementation){g(Te,je.sibling),je=A(je,De.children||[]),je.return=Te,Te=je;break e}else{g(Te,je);break}else d(Te,je);je=je.sibling}je=W2(De,Te.mode,ht),je.return=Te,Te=je}return Z(Te);case re:return zt=De._init,lr(Te,je,zt(De._payload),ht)}if(ve(De))return Rt(Te,je,De,ht);if(Q(De))return Pt(Te,je,De,ht);Qf(Te,De)}return typeof De=="string"&&De!==""||typeof De=="number"?(De=""+De,je!==null&&je.tag===6?(g(Te,je.sibling),je=A(je,De),je.return=Te,Te=je):(g(Te,je),je=U2(De,Te.mode,ht),je.return=Te,Te=je),Z(Te)):g(Te,je)}return lr}var Vc=my(!0),gy=my(!1),Jf=gi(null),e1=null,zc=null,t2=null;function n2(){t2=zc=e1=null}function r2(l){var d=Jf.current;Yn(Jf),l._currentValue=d}function s2(l,d,g){for(;l!==null;){var x=l.alternate;if((l.childLanes&d)!==d?(l.childLanes|=d,x!==null&&(x.childLanes|=d)):x!==null&&(x.childLanes&d)!==d&&(x.childLanes|=d),l===g)break;l=l.return}}function Bc(l,d){e1=l,t2=zc=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&d)!==0&&(vs=!0),l.firstContext=null)}function Qs(l){var d=l._currentValue;if(t2!==l)if(l={context:l,memoizedValue:d,next:null},zc===null){if(e1===null)throw Error(n(308));zc=l,e1.dependencies={lanes:0,firstContext:l}}else zc=zc.next=l;return d}var yl=null;function a2(l){yl===null?yl=[l]:yl.push(l)}function vy(l,d,g,x){var A=d.interleaved;return A===null?(g.next=g,a2(d)):(g.next=A.next,A.next=g),d.interleaved=g,No(l,x)}function No(l,d){l.lanes|=d;var g=l.alternate;for(g!==null&&(g.lanes|=d),g=l,l=l.return;l!==null;)l.childLanes|=d,g=l.alternate,g!==null&&(g.childLanes|=d),g=l,l=l.return;return g.tag===3?g.stateNode:null}var yi=!1;function o2(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function wy(l,d){l=l.updateQueue,d.updateQueue===l&&(d.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function Mo(l,d){return{eventTime:l,lane:d,tag:0,payload:null,callback:null,next:null}}function bi(l,d,g){var x=l.updateQueue;if(x===null)return null;if(x=x.shared,(Cn&2)!==0){var A=x.pending;return A===null?d.next=d:(d.next=A.next,A.next=d),x.pending=d,No(l,g)}return A=x.interleaved,A===null?(d.next=d,a2(x)):(d.next=A.next,A.next=d),x.interleaved=d,No(l,g)}function t1(l,d,g){if(d=d.updateQueue,d!==null&&(d=d.shared,(g&4194240)!==0)){var x=d.lanes;x&=l.pendingLanes,g|=x,d.lanes=g,zn(l,g)}}function yy(l,d){var g=l.updateQueue,x=l.alternate;if(x!==null&&(x=x.updateQueue,g===x)){var A=null,T=null;if(g=g.firstBaseUpdate,g!==null){do{var Z={eventTime:g.eventTime,lane:g.lane,tag:g.tag,payload:g.payload,callback:g.callback,next:null};T===null?A=T=Z:T=T.next=Z,g=g.next}while(g!==null);T===null?A=T=d:T=T.next=d}else A=T=d;g={baseState:x.baseState,firstBaseUpdate:A,lastBaseUpdate:T,shared:x.shared,effects:x.effects},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=d:l.next=d,g.lastBaseUpdate=d}function n1(l,d,g,x){var A=l.updateQueue;yi=!1;var T=A.firstBaseUpdate,Z=A.lastBaseUpdate,de=A.shared.pending;if(de!==null){A.shared.pending=null;var xe=de,Ve=xe.next;xe.next=null,Z===null?T=Ve:Z.next=Ve,Z=xe;var at=l.alternate;at!==null&&(at=at.updateQueue,de=at.lastBaseUpdate,de!==Z&&(de===null?at.firstBaseUpdate=Ve:de.next=Ve,at.lastBaseUpdate=xe))}if(T!==null){var ct=A.baseState;Z=0,at=Ve=xe=null,de=T;do{var rt=de.lane,At=de.eventTime;if((x&rt)===rt){at!==null&&(at=at.next={eventTime:At,lane:0,tag:de.tag,payload:de.payload,callback:de.callback,next:null});e:{var Rt=l,Pt=de;switch(rt=d,At=g,Pt.tag){case 1:if(Rt=Pt.payload,typeof Rt=="function"){ct=Rt.call(At,ct,rt);break e}ct=Rt;break e;case 3:Rt.flags=Rt.flags&-65537|128;case 0:if(Rt=Pt.payload,rt=typeof Rt=="function"?Rt.call(At,ct,rt):Rt,rt==null)break e;ct=V({},ct,rt);break e;case 2:yi=!0}}de.callback!==null&&de.lane!==0&&(l.flags|=64,rt=A.effects,rt===null?A.effects=[de]:rt.push(de))}else At={eventTime:At,lane:rt,tag:de.tag,payload:de.payload,callback:de.callback,next:null},at===null?(Ve=at=At,xe=ct):at=at.next=At,Z|=rt;if(de=de.next,de===null){if(de=A.shared.pending,de===null)break;rt=de,de=rt.next,rt.next=null,A.lastBaseUpdate=rt,A.shared.pending=null}}while(!0);if(at===null&&(xe=ct),A.baseState=xe,A.firstBaseUpdate=Ve,A.lastBaseUpdate=at,d=A.shared.interleaved,d!==null){A=d;do Z|=A.lane,A=A.next;while(A!==d)}else T===null&&(A.shared.lanes=0);kl|=Z,l.lanes=Z,l.memoizedState=ct}}function by(l,d,g){if(l=d.effects,d.effects=null,l!==null)for(d=0;d<l.length;d++){var x=l[d],A=x.callback;if(A!==null){if(x.callback=null,x=g,typeof A!="function")throw Error(n(191,A));A.call(x)}}}var Ed={},Ga=gi(Ed),Cd=gi(Ed),jd=gi(Ed);function bl(l){if(l===Ed)throw Error(n(174));return l}function i2(l,d){switch(Un(jd,d),Un(Cd,l),Un(Ga,Ed),l=d.nodeType,l){case 9:case 11:d=(d=d.documentElement)?d.namespaceURI:Ie(null,"");break;default:l=l===8?d.parentNode:d,d=l.namespaceURI||null,l=l.tagName,d=Ie(d,l)}Yn(Ga),Un(Ga,d)}function Uc(){Yn(Ga),Yn(Cd),Yn(jd)}function xy(l){bl(jd.current);var d=bl(Ga.current),g=Ie(d,l.type);d!==g&&(Un(Cd,l),Un(Ga,g))}function l2(l){Cd.current===l&&(Yn(Ga),Yn(Cd))}var Qn=gi(0);function r1(l){for(var d=l;d!==null;){if(d.tag===13){var g=d.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||g.data==="$?"||g.data==="$!"))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var c2=[];function u2(){for(var l=0;l<c2.length;l++)c2[l]._workInProgressVersionPrimary=null;c2.length=0}var s1=N.ReactCurrentDispatcher,d2=N.ReactCurrentBatchConfig,xl=0,Jn=null,yr=null,Er=null,a1=!1,Ad=!1,Nd=0,QP=0;function Br(){throw Error(n(321))}function f2(l,d){if(d===null)return!1;for(var g=0;g<d.length&&g<l.length;g++)if(!ka(l[g],d[g]))return!1;return!0}function h2(l,d,g,x,A,T){if(xl=T,Jn=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,s1.current=l===null||l.memoizedState===null?nL:rL,l=g(x,A),Ad){T=0;do{if(Ad=!1,Nd=0,25<=T)throw Error(n(301));T+=1,Er=yr=null,d.updateQueue=null,s1.current=sL,l=g(x,A)}while(Ad)}if(s1.current=l1,d=yr!==null&&yr.next!==null,xl=0,Er=yr=Jn=null,a1=!1,d)throw Error(n(300));return l}function p2(){var l=Nd!==0;return Nd=0,l}function Ya(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Er===null?Jn.memoizedState=Er=l:Er=Er.next=l,Er}function Js(){if(yr===null){var l=Jn.alternate;l=l!==null?l.memoizedState:null}else l=yr.next;var d=Er===null?Jn.memoizedState:Er.next;if(d!==null)Er=d,yr=l;else{if(l===null)throw Error(n(310));yr=l,l={memoizedState:yr.memoizedState,baseState:yr.baseState,baseQueue:yr.baseQueue,queue:yr.queue,next:null},Er===null?Jn.memoizedState=Er=l:Er=Er.next=l}return Er}function Md(l,d){return typeof d=="function"?d(l):d}function m2(l){var d=Js(),g=d.queue;if(g===null)throw Error(n(311));g.lastRenderedReducer=l;var x=yr,A=x.baseQueue,T=g.pending;if(T!==null){if(A!==null){var Z=A.next;A.next=T.next,T.next=Z}x.baseQueue=A=T,g.pending=null}if(A!==null){T=A.next,x=x.baseState;var de=Z=null,xe=null,Ve=T;do{var at=Ve.lane;if((xl&at)===at)xe!==null&&(xe=xe.next={lane:0,action:Ve.action,hasEagerState:Ve.hasEagerState,eagerState:Ve.eagerState,next:null}),x=Ve.hasEagerState?Ve.eagerState:l(x,Ve.action);else{var ct={lane:at,action:Ve.action,hasEagerState:Ve.hasEagerState,eagerState:Ve.eagerState,next:null};xe===null?(de=xe=ct,Z=x):xe=xe.next=ct,Jn.lanes|=at,kl|=at}Ve=Ve.next}while(Ve!==null&&Ve!==T);xe===null?Z=x:xe.next=de,ka(x,d.memoizedState)||(vs=!0),d.memoizedState=x,d.baseState=Z,d.baseQueue=xe,g.lastRenderedState=x}if(l=g.interleaved,l!==null){A=l;do T=A.lane,Jn.lanes|=T,kl|=T,A=A.next;while(A!==l)}else A===null&&(g.lanes=0);return[d.memoizedState,g.dispatch]}function g2(l){var d=Js(),g=d.queue;if(g===null)throw Error(n(311));g.lastRenderedReducer=l;var x=g.dispatch,A=g.pending,T=d.memoizedState;if(A!==null){g.pending=null;var Z=A=A.next;do T=l(T,Z.action),Z=Z.next;while(Z!==A);ka(T,d.memoizedState)||(vs=!0),d.memoizedState=T,d.baseQueue===null&&(d.baseState=T),g.lastRenderedState=T}return[T,x]}function ky(){}function Sy(l,d){var g=Jn,x=Js(),A=d(),T=!ka(x.memoizedState,A);if(T&&(x.memoizedState=A,vs=!0),x=x.queue,v2(jy.bind(null,g,x,l),[l]),x.getSnapshot!==d||T||Er!==null&&Er.memoizedState.tag&1){if(g.flags|=2048,Rd(9,Cy.bind(null,g,x,A,d),void 0,null),Cr===null)throw Error(n(349));(xl&30)!==0||Ey(g,d,A)}return A}function Ey(l,d,g){l.flags|=16384,l={getSnapshot:d,value:g},d=Jn.updateQueue,d===null?(d={lastEffect:null,stores:null},Jn.updateQueue=d,d.stores=[l]):(g=d.stores,g===null?d.stores=[l]:g.push(l))}function Cy(l,d,g,x){d.value=g,d.getSnapshot=x,Ay(d)&&Ny(l)}function jy(l,d,g){return g(function(){Ay(d)&&Ny(l)})}function Ay(l){var d=l.getSnapshot;l=l.value;try{var g=d();return!ka(l,g)}catch{return!0}}function Ny(l){var d=No(l,1);d!==null&&Aa(d,l,1,-1)}function My(l){var d=Ya();return typeof l=="function"&&(l=l()),d.memoizedState=d.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Md,lastRenderedState:l},d.queue=l,l=l.dispatch=tL.bind(null,Jn,l),[d.memoizedState,l]}function Rd(l,d,g,x){return l={tag:l,create:d,destroy:g,deps:x,next:null},d=Jn.updateQueue,d===null?(d={lastEffect:null,stores:null},Jn.updateQueue=d,d.lastEffect=l.next=l):(g=d.lastEffect,g===null?d.lastEffect=l.next=l:(x=g.next,g.next=l,l.next=x,d.lastEffect=l)),l}function Ry(){return Js().memoizedState}function o1(l,d,g,x){var A=Ya();Jn.flags|=l,A.memoizedState=Rd(1|d,g,void 0,x===void 0?null:x)}function i1(l,d,g,x){var A=Js();x=x===void 0?null:x;var T=void 0;if(yr!==null){var Z=yr.memoizedState;if(T=Z.destroy,x!==null&&f2(x,Z.deps)){A.memoizedState=Rd(d,g,T,x);return}}Jn.flags|=l,A.memoizedState=Rd(1|d,g,T,x)}function Py(l,d){return o1(8390656,8,l,d)}function v2(l,d){return i1(2048,8,l,d)}function Ly(l,d){return i1(4,2,l,d)}function Ty(l,d){return i1(4,4,l,d)}function $y(l,d){if(typeof d=="function")return l=l(),d(l),function(){d(null)};if(d!=null)return l=l(),d.current=l,function(){d.current=null}}function Dy(l,d,g){return g=g!=null?g.concat([l]):null,i1(4,4,$y.bind(null,d,l),g)}function w2(){}function Hy(l,d){var g=Js();d=d===void 0?null:d;var x=g.memoizedState;return x!==null&&d!==null&&f2(d,x[1])?x[0]:(g.memoizedState=[l,d],l)}function Oy(l,d){var g=Js();d=d===void 0?null:d;var x=g.memoizedState;return x!==null&&d!==null&&f2(d,x[1])?x[0]:(l=l(),g.memoizedState=[l,d],l)}function Iy(l,d,g){return(xl&21)===0?(l.baseState&&(l.baseState=!1,vs=!0),l.memoizedState=g):(ka(g,d)||(g=tn(),Jn.lanes|=g,kl|=g,l.baseState=!0),d)}function JP(l,d){var g=yn;yn=g!==0&&4>g?g:4,l(!0);var x=d2.transition;d2.transition={};try{l(!1),d()}finally{yn=g,d2.transition=x}}function Fy(){return Js().memoizedState}function eL(l,d,g){var x=Ei(l);if(g={lane:x,action:g,hasEagerState:!1,eagerState:null,next:null},_y(l))Zy(d,g);else if(g=vy(l,d,g,x),g!==null){var A=rs();Aa(g,l,x,A),Vy(g,d,x)}}function tL(l,d,g){var x=Ei(l),A={lane:x,action:g,hasEagerState:!1,eagerState:null,next:null};if(_y(l))Zy(d,A);else{var T=l.alternate;if(l.lanes===0&&(T===null||T.lanes===0)&&(T=d.lastRenderedReducer,T!==null))try{var Z=d.lastRenderedState,de=T(Z,g);if(A.hasEagerState=!0,A.eagerState=de,ka(de,Z)){var xe=d.interleaved;xe===null?(A.next=A,a2(d)):(A.next=xe.next,xe.next=A),d.interleaved=A;return}}catch{}finally{}g=vy(l,d,A,x),g!==null&&(A=rs(),Aa(g,l,x,A),Vy(g,d,x))}}function _y(l){var d=l.alternate;return l===Jn||d!==null&&d===Jn}function Zy(l,d){Ad=a1=!0;var g=l.pending;g===null?d.next=d:(d.next=g.next,g.next=d),l.pending=d}function Vy(l,d,g){if((g&4194240)!==0){var x=d.lanes;x&=l.pendingLanes,g|=x,d.lanes=g,zn(l,g)}}var l1={readContext:Qs,useCallback:Br,useContext:Br,useEffect:Br,useImperativeHandle:Br,useInsertionEffect:Br,useLayoutEffect:Br,useMemo:Br,useReducer:Br,useRef:Br,useState:Br,useDebugValue:Br,useDeferredValue:Br,useTransition:Br,useMutableSource:Br,useSyncExternalStore:Br,useId:Br,unstable_isNewReconciler:!1},nL={readContext:Qs,useCallback:function(l,d){return Ya().memoizedState=[l,d===void 0?null:d],l},useContext:Qs,useEffect:Py,useImperativeHandle:function(l,d,g){return g=g!=null?g.concat([l]):null,o1(4194308,4,$y.bind(null,d,l),g)},useLayoutEffect:function(l,d){return o1(4194308,4,l,d)},useInsertionEffect:function(l,d){return o1(4,2,l,d)},useMemo:function(l,d){var g=Ya();return d=d===void 0?null:d,l=l(),g.memoizedState=[l,d],l},useReducer:function(l,d,g){var x=Ya();return d=g!==void 0?g(d):d,x.memoizedState=x.baseState=d,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:d},x.queue=l,l=l.dispatch=eL.bind(null,Jn,l),[x.memoizedState,l]},useRef:function(l){var d=Ya();return l={current:l},d.memoizedState=l},useState:My,useDebugValue:w2,useDeferredValue:function(l){return Ya().memoizedState=l},useTransition:function(){var l=My(!1),d=l[0];return l=JP.bind(null,l[1]),Ya().memoizedState=l,[d,l]},useMutableSource:function(){},useSyncExternalStore:function(l,d,g){var x=Jn,A=Ya();if(Xn){if(g===void 0)throw Error(n(407));g=g()}else{if(g=d(),Cr===null)throw Error(n(349));(xl&30)!==0||Ey(x,d,g)}A.memoizedState=g;var T={value:g,getSnapshot:d};return A.queue=T,Py(jy.bind(null,x,T,l),[l]),x.flags|=2048,Rd(9,Cy.bind(null,x,T,g,d),void 0,null),g},useId:function(){var l=Ya(),d=Cr.identifierPrefix;if(Xn){var g=Ao,x=jo;g=(x&~(1<<32-Ht(x)-1)).toString(32)+g,d=":"+d+"R"+g,g=Nd++,0<g&&(d+="H"+g.toString(32)),d+=":"}else g=QP++,d=":"+d+"r"+g.toString(32)+":";return l.memoizedState=d},unstable_isNewReconciler:!1},rL={readContext:Qs,useCallback:Hy,useContext:Qs,useEffect:v2,useImperativeHandle:Dy,useInsertionEffect:Ly,useLayoutEffect:Ty,useMemo:Oy,useReducer:m2,useRef:Ry,useState:function(){return m2(Md)},useDebugValue:w2,useDeferredValue:function(l){var d=Js();return Iy(d,yr.memoizedState,l)},useTransition:function(){var l=m2(Md)[0],d=Js().memoizedState;return[l,d]},useMutableSource:ky,useSyncExternalStore:Sy,useId:Fy,unstable_isNewReconciler:!1},sL={readContext:Qs,useCallback:Hy,useContext:Qs,useEffect:v2,useImperativeHandle:Dy,useInsertionEffect:Ly,useLayoutEffect:Ty,useMemo:Oy,useReducer:g2,useRef:Ry,useState:function(){return g2(Md)},useDebugValue:w2,useDeferredValue:function(l){var d=Js();return yr===null?d.memoizedState=l:Iy(d,yr.memoizedState,l)},useTransition:function(){var l=g2(Md)[0],d=Js().memoizedState;return[l,d]},useMutableSource:ky,useSyncExternalStore:Sy,useId:Fy,unstable_isNewReconciler:!1};function Ea(l,d){if(l&&l.defaultProps){d=V({},d),l=l.defaultProps;for(var g in l)d[g]===void 0&&(d[g]=l[g]);return d}return d}function y2(l,d,g,x){d=l.memoizedState,g=g(x,d),g=g==null?d:V({},d,g),l.memoizedState=g,l.lanes===0&&(l.updateQueue.baseState=g)}var c1={isMounted:function(l){return(l=l._reactInternals)?Ge(l)===l:!1},enqueueSetState:function(l,d,g){l=l._reactInternals;var x=rs(),A=Ei(l),T=Mo(x,A);T.payload=d,g!=null&&(T.callback=g),d=bi(l,T,A),d!==null&&(Aa(d,l,A,x),t1(d,l,A))},enqueueReplaceState:function(l,d,g){l=l._reactInternals;var x=rs(),A=Ei(l),T=Mo(x,A);T.tag=1,T.payload=d,g!=null&&(T.callback=g),d=bi(l,T,A),d!==null&&(Aa(d,l,A,x),t1(d,l,A))},enqueueForceUpdate:function(l,d){l=l._reactInternals;var g=rs(),x=Ei(l),A=Mo(g,x);A.tag=2,d!=null&&(A.callback=d),d=bi(l,A,x),d!==null&&(Aa(d,l,x,g),t1(d,l,x))}};function zy(l,d,g,x,A,T,Z){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(x,T,Z):d.prototype&&d.prototype.isPureReactComponent?!gd(g,x)||!gd(A,T):!0}function By(l,d,g){var x=!1,A=vi,T=d.contextType;return typeof T=="object"&&T!==null?T=Qs(T):(A=gs(d)?gl:zr.current,x=d.contextTypes,T=(x=x!=null)?Ic(l,A):vi),d=new d(g,T),l.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=c1,l.stateNode=d,d._reactInternals=l,x&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=A,l.__reactInternalMemoizedMaskedChildContext=T),d}function Uy(l,d,g,x){l=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(g,x),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(g,x),d.state!==l&&c1.enqueueReplaceState(d,d.state,null)}function b2(l,d,g,x){var A=l.stateNode;A.props=g,A.state=l.memoizedState,A.refs={},o2(l);var T=d.contextType;typeof T=="object"&&T!==null?A.context=Qs(T):(T=gs(d)?gl:zr.current,A.context=Ic(l,T)),A.state=l.memoizedState,T=d.getDerivedStateFromProps,typeof T=="function"&&(y2(l,d,T,g),A.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(d=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),d!==A.state&&c1.enqueueReplaceState(A,A.state,null),n1(l,g,A,x),A.state=l.memoizedState),typeof A.componentDidMount=="function"&&(l.flags|=4194308)}function Wc(l,d){try{var g="",x=d;do g+=X(x),x=x.return;while(x);var A=g}catch(T){A=`
|
|
39
|
-
Error generating stack: `+T.message+`
|
|
40
|
-
`+T.stack}return{value:l,source:d,stack:A,digest:null}}function x2(l,d,g){return{value:l,source:null,stack:g??null,digest:d??null}}function k2(l,d){try{console.error(d.value)}catch(g){setTimeout(function(){throw g})}}var aL=typeof WeakMap=="function"?WeakMap:Map;function Wy(l,d,g){g=Mo(-1,g),g.tag=3,g.payload={element:null};var x=d.value;return g.callback=function(){g1||(g1=!0,O2=x),k2(l,d)},g}function Ky(l,d,g){g=Mo(-1,g),g.tag=3;var x=l.type.getDerivedStateFromError;if(typeof x=="function"){var A=d.value;g.payload=function(){return x(A)},g.callback=function(){k2(l,d)}}var T=l.stateNode;return T!==null&&typeof T.componentDidCatch=="function"&&(g.callback=function(){k2(l,d),typeof x!="function"&&(ki===null?ki=new Set([this]):ki.add(this));var Z=d.stack;this.componentDidCatch(d.value,{componentStack:Z!==null?Z:""})}),g}function Gy(l,d,g){var x=l.pingCache;if(x===null){x=l.pingCache=new aL;var A=new Set;x.set(d,A)}else A=x.get(d),A===void 0&&(A=new Set,x.set(d,A));A.has(g)||(A.add(g),l=yL.bind(null,l,d,g),d.then(l,l))}function Yy(l){do{var d;if((d=l.tag===13)&&(d=l.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return l;l=l.return}while(l!==null);return null}function qy(l,d,g,x,A){return(l.mode&1)===0?(l===d?l.flags|=65536:(l.flags|=128,g.flags|=131072,g.flags&=-52805,g.tag===1&&(g.alternate===null?g.tag=17:(d=Mo(-1,1),d.tag=2,bi(g,d,1))),g.lanes|=1),l):(l.flags|=65536,l.lanes=A,l)}var oL=N.ReactCurrentOwner,vs=!1;function ns(l,d,g,x){d.child=l===null?gy(d,null,g,x):Vc(d,l.child,g,x)}function Xy(l,d,g,x,A){g=g.render;var T=d.ref;return Bc(d,A),x=h2(l,d,g,x,T,A),g=p2(),l!==null&&!vs?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~A,Ro(l,d,A)):(Xn&&g&&qm(d),d.flags|=1,ns(l,d,x,A),d.child)}function Qy(l,d,g,x,A){if(l===null){var T=g.type;return typeof T=="function"&&!B2(T)&&T.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(d.tag=15,d.type=T,Jy(l,d,T,x,A)):(l=k1(g.type,null,x,d,d.mode,A),l.ref=d.ref,l.return=d,d.child=l)}if(T=l.child,(l.lanes&A)===0){var Z=T.memoizedProps;if(g=g.compare,g=g!==null?g:gd,g(Z,x)&&l.ref===d.ref)return Ro(l,d,A)}return d.flags|=1,l=ji(T,x),l.ref=d.ref,l.return=d,d.child=l}function Jy(l,d,g,x,A){if(l!==null){var T=l.memoizedProps;if(gd(T,x)&&l.ref===d.ref)if(vs=!1,d.pendingProps=x=T,(l.lanes&A)!==0)(l.flags&131072)!==0&&(vs=!0);else return d.lanes=l.lanes,Ro(l,d,A)}return S2(l,d,g,x,A)}function eb(l,d,g){var x=d.pendingProps,A=x.children,T=l!==null?l.memoizedState:null;if(x.mode==="hidden")if((d.mode&1)===0)d.memoizedState={baseLanes:0,cachePool:null,transitions:null},Un(Gc,Hs),Hs|=g;else{if((g&1073741824)===0)return l=T!==null?T.baseLanes|g:g,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:l,cachePool:null,transitions:null},d.updateQueue=null,Un(Gc,Hs),Hs|=l,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},x=T!==null?T.baseLanes:g,Un(Gc,Hs),Hs|=x}else T!==null?(x=T.baseLanes|g,d.memoizedState=null):x=g,Un(Gc,Hs),Hs|=x;return ns(l,d,A,g),d.child}function tb(l,d){var g=d.ref;(l===null&&g!==null||l!==null&&l.ref!==g)&&(d.flags|=512,d.flags|=2097152)}function S2(l,d,g,x,A){var T=gs(g)?gl:zr.current;return T=Ic(d,T),Bc(d,A),g=h2(l,d,g,x,T,A),x=p2(),l!==null&&!vs?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~A,Ro(l,d,A)):(Xn&&x&&qm(d),d.flags|=1,ns(l,d,g,A),d.child)}function nb(l,d,g,x,A){if(gs(g)){var T=!0;Kf(d)}else T=!1;if(Bc(d,A),d.stateNode===null)d1(l,d),By(d,g,x),b2(d,g,x,A),x=!0;else if(l===null){var Z=d.stateNode,de=d.memoizedProps;Z.props=de;var xe=Z.context,Ve=g.contextType;typeof Ve=="object"&&Ve!==null?Ve=Qs(Ve):(Ve=gs(g)?gl:zr.current,Ve=Ic(d,Ve));var at=g.getDerivedStateFromProps,ct=typeof at=="function"||typeof Z.getSnapshotBeforeUpdate=="function";ct||typeof Z.UNSAFE_componentWillReceiveProps!="function"&&typeof Z.componentWillReceiveProps!="function"||(de!==x||xe!==Ve)&&Uy(d,Z,x,Ve),yi=!1;var rt=d.memoizedState;Z.state=rt,n1(d,x,Z,A),xe=d.memoizedState,de!==x||rt!==xe||ms.current||yi?(typeof at=="function"&&(y2(d,g,at,x),xe=d.memoizedState),(de=yi||zy(d,g,de,x,rt,xe,Ve))?(ct||typeof Z.UNSAFE_componentWillMount!="function"&&typeof Z.componentWillMount!="function"||(typeof Z.componentWillMount=="function"&&Z.componentWillMount(),typeof Z.UNSAFE_componentWillMount=="function"&&Z.UNSAFE_componentWillMount()),typeof Z.componentDidMount=="function"&&(d.flags|=4194308)):(typeof Z.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=x,d.memoizedState=xe),Z.props=x,Z.state=xe,Z.context=Ve,x=de):(typeof Z.componentDidMount=="function"&&(d.flags|=4194308),x=!1)}else{Z=d.stateNode,wy(l,d),de=d.memoizedProps,Ve=d.type===d.elementType?de:Ea(d.type,de),Z.props=Ve,ct=d.pendingProps,rt=Z.context,xe=g.contextType,typeof xe=="object"&&xe!==null?xe=Qs(xe):(xe=gs(g)?gl:zr.current,xe=Ic(d,xe));var At=g.getDerivedStateFromProps;(at=typeof At=="function"||typeof Z.getSnapshotBeforeUpdate=="function")||typeof Z.UNSAFE_componentWillReceiveProps!="function"&&typeof Z.componentWillReceiveProps!="function"||(de!==ct||rt!==xe)&&Uy(d,Z,x,xe),yi=!1,rt=d.memoizedState,Z.state=rt,n1(d,x,Z,A);var Rt=d.memoizedState;de!==ct||rt!==Rt||ms.current||yi?(typeof At=="function"&&(y2(d,g,At,x),Rt=d.memoizedState),(Ve=yi||zy(d,g,Ve,x,rt,Rt,xe)||!1)?(at||typeof Z.UNSAFE_componentWillUpdate!="function"&&typeof Z.componentWillUpdate!="function"||(typeof Z.componentWillUpdate=="function"&&Z.componentWillUpdate(x,Rt,xe),typeof Z.UNSAFE_componentWillUpdate=="function"&&Z.UNSAFE_componentWillUpdate(x,Rt,xe)),typeof Z.componentDidUpdate=="function"&&(d.flags|=4),typeof Z.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof Z.componentDidUpdate!="function"||de===l.memoizedProps&&rt===l.memoizedState||(d.flags|=4),typeof Z.getSnapshotBeforeUpdate!="function"||de===l.memoizedProps&&rt===l.memoizedState||(d.flags|=1024),d.memoizedProps=x,d.memoizedState=Rt),Z.props=x,Z.state=Rt,Z.context=xe,x=Ve):(typeof Z.componentDidUpdate!="function"||de===l.memoizedProps&&rt===l.memoizedState||(d.flags|=4),typeof Z.getSnapshotBeforeUpdate!="function"||de===l.memoizedProps&&rt===l.memoizedState||(d.flags|=1024),x=!1)}return E2(l,d,g,x,T,A)}function E2(l,d,g,x,A,T){tb(l,d);var Z=(d.flags&128)!==0;if(!x&&!Z)return A&&iy(d,g,!1),Ro(l,d,T);x=d.stateNode,oL.current=d;var de=Z&&typeof g.getDerivedStateFromError!="function"?null:x.render();return d.flags|=1,l!==null&&Z?(d.child=Vc(d,l.child,null,T),d.child=Vc(d,null,de,T)):ns(l,d,de,T),d.memoizedState=x.state,A&&iy(d,g,!0),d.child}function rb(l){var d=l.stateNode;d.pendingContext?ay(l,d.pendingContext,d.pendingContext!==d.context):d.context&&ay(l,d.context,!1),i2(l,d.containerInfo)}function sb(l,d,g,x,A){return Zc(),e2(A),d.flags|=256,ns(l,d,g,x),d.child}var C2={dehydrated:null,treeContext:null,retryLane:0};function j2(l){return{baseLanes:l,cachePool:null,transitions:null}}function ab(l,d,g){var x=d.pendingProps,A=Qn.current,T=!1,Z=(d.flags&128)!==0,de;if((de=Z)||(de=l!==null&&l.memoizedState===null?!1:(A&2)!==0),de?(T=!0,d.flags&=-129):(l===null||l.memoizedState!==null)&&(A|=1),Un(Qn,A&1),l===null)return Jm(d),l=d.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((d.mode&1)===0?d.lanes=1:l.data==="$!"?d.lanes=8:d.lanes=1073741824,null):(Z=x.children,l=x.fallback,T?(x=d.mode,T=d.child,Z={mode:"hidden",children:Z},(x&1)===0&&T!==null?(T.childLanes=0,T.pendingProps=Z):T=S1(Z,x,0,null),l=jl(l,x,g,null),T.return=d,l.return=d,T.sibling=l,d.child=T,d.child.memoizedState=j2(g),d.memoizedState=C2,l):A2(d,Z));if(A=l.memoizedState,A!==null&&(de=A.dehydrated,de!==null))return iL(l,d,Z,x,de,A,g);if(T){T=x.fallback,Z=d.mode,A=l.child,de=A.sibling;var xe={mode:"hidden",children:x.children};return(Z&1)===0&&d.child!==A?(x=d.child,x.childLanes=0,x.pendingProps=xe,d.deletions=null):(x=ji(A,xe),x.subtreeFlags=A.subtreeFlags&14680064),de!==null?T=ji(de,T):(T=jl(T,Z,g,null),T.flags|=2),T.return=d,x.return=d,x.sibling=T,d.child=x,x=T,T=d.child,Z=l.child.memoizedState,Z=Z===null?j2(g):{baseLanes:Z.baseLanes|g,cachePool:null,transitions:Z.transitions},T.memoizedState=Z,T.childLanes=l.childLanes&~g,d.memoizedState=C2,x}return T=l.child,l=T.sibling,x=ji(T,{mode:"visible",children:x.children}),(d.mode&1)===0&&(x.lanes=g),x.return=d,x.sibling=null,l!==null&&(g=d.deletions,g===null?(d.deletions=[l],d.flags|=16):g.push(l)),d.child=x,d.memoizedState=null,x}function A2(l,d){return d=S1({mode:"visible",children:d},l.mode,0,null),d.return=l,l.child=d}function u1(l,d,g,x){return x!==null&&e2(x),Vc(d,l.child,null,g),l=A2(d,d.pendingProps.children),l.flags|=2,d.memoizedState=null,l}function iL(l,d,g,x,A,T,Z){if(g)return d.flags&256?(d.flags&=-257,x=x2(Error(n(422))),u1(l,d,Z,x)):d.memoizedState!==null?(d.child=l.child,d.flags|=128,null):(T=x.fallback,A=d.mode,x=S1({mode:"visible",children:x.children},A,0,null),T=jl(T,A,Z,null),T.flags|=2,x.return=d,T.return=d,x.sibling=T,d.child=x,(d.mode&1)!==0&&Vc(d,l.child,null,Z),d.child.memoizedState=j2(Z),d.memoizedState=C2,T);if((d.mode&1)===0)return u1(l,d,Z,null);if(A.data==="$!"){if(x=A.nextSibling&&A.nextSibling.dataset,x)var de=x.dgst;return x=de,T=Error(n(419)),x=x2(T,x,void 0),u1(l,d,Z,x)}if(de=(Z&l.childLanes)!==0,vs||de){if(x=Cr,x!==null){switch(Z&-Z){case 4:A=2;break;case 16:A=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:A=32;break;case 536870912:A=268435456;break;default:A=0}A=(A&(x.suspendedLanes|Z))!==0?0:A,A!==0&&A!==T.retryLane&&(T.retryLane=A,No(l,A),Aa(x,l,A,-1))}return z2(),x=x2(Error(n(421))),u1(l,d,Z,x)}return A.data==="$?"?(d.flags|=128,d.child=l.child,d=bL.bind(null,l),A._reactRetry=d,null):(l=T.treeContext,Ds=mi(A.nextSibling),$s=d,Xn=!0,Sa=null,l!==null&&(qs[Xs++]=jo,qs[Xs++]=Ao,qs[Xs++]=vl,jo=l.id,Ao=l.overflow,vl=d),d=A2(d,x.children),d.flags|=4096,d)}function ob(l,d,g){l.lanes|=d;var x=l.alternate;x!==null&&(x.lanes|=d),s2(l.return,d,g)}function N2(l,d,g,x,A){var T=l.memoizedState;T===null?l.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:x,tail:g,tailMode:A}:(T.isBackwards=d,T.rendering=null,T.renderingStartTime=0,T.last=x,T.tail=g,T.tailMode=A)}function ib(l,d,g){var x=d.pendingProps,A=x.revealOrder,T=x.tail;if(ns(l,d,x.children,g),x=Qn.current,(x&2)!==0)x=x&1|2,d.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=d.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&ob(l,g,d);else if(l.tag===19)ob(l,g,d);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===d)break e;for(;l.sibling===null;){if(l.return===null||l.return===d)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}x&=1}if(Un(Qn,x),(d.mode&1)===0)d.memoizedState=null;else switch(A){case"forwards":for(g=d.child,A=null;g!==null;)l=g.alternate,l!==null&&r1(l)===null&&(A=g),g=g.sibling;g=A,g===null?(A=d.child,d.child=null):(A=g.sibling,g.sibling=null),N2(d,!1,A,g,T);break;case"backwards":for(g=null,A=d.child,d.child=null;A!==null;){if(l=A.alternate,l!==null&&r1(l)===null){d.child=A;break}l=A.sibling,A.sibling=g,g=A,A=l}N2(d,!0,g,null,T);break;case"together":N2(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function d1(l,d){(d.mode&1)===0&&l!==null&&(l.alternate=null,d.alternate=null,d.flags|=2)}function Ro(l,d,g){if(l!==null&&(d.dependencies=l.dependencies),kl|=d.lanes,(g&d.childLanes)===0)return null;if(l!==null&&d.child!==l.child)throw Error(n(153));if(d.child!==null){for(l=d.child,g=ji(l,l.pendingProps),d.child=g,g.return=d;l.sibling!==null;)l=l.sibling,g=g.sibling=ji(l,l.pendingProps),g.return=d;g.sibling=null}return d.child}function lL(l,d,g){switch(d.tag){case 3:rb(d),Zc();break;case 5:xy(d);break;case 1:gs(d.type)&&Kf(d);break;case 4:i2(d,d.stateNode.containerInfo);break;case 10:var x=d.type._context,A=d.memoizedProps.value;Un(Jf,x._currentValue),x._currentValue=A;break;case 13:if(x=d.memoizedState,x!==null)return x.dehydrated!==null?(Un(Qn,Qn.current&1),d.flags|=128,null):(g&d.child.childLanes)!==0?ab(l,d,g):(Un(Qn,Qn.current&1),l=Ro(l,d,g),l!==null?l.sibling:null);Un(Qn,Qn.current&1);break;case 19:if(x=(g&d.childLanes)!==0,(l.flags&128)!==0){if(x)return ib(l,d,g);d.flags|=128}if(A=d.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),Un(Qn,Qn.current),x)break;return null;case 22:case 23:return d.lanes=0,eb(l,d,g)}return Ro(l,d,g)}var lb,M2,cb,ub;lb=function(l,d){for(var g=d.child;g!==null;){if(g.tag===5||g.tag===6)l.appendChild(g.stateNode);else if(g.tag!==4&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===d)break;for(;g.sibling===null;){if(g.return===null||g.return===d)return;g=g.return}g.sibling.return=g.return,g=g.sibling}},M2=function(){},cb=function(l,d,g,x){var A=l.memoizedProps;if(A!==x){l=d.stateNode,bl(Ga.current);var T=null;switch(g){case"input":A=he(l,A),x=he(l,x),T=[];break;case"select":A=V({},A,{value:void 0}),x=V({},x,{value:void 0}),T=[];break;case"textarea":A=ue(l,A),x=ue(l,x),T=[];break;default:typeof A.onClick!="function"&&typeof x.onClick=="function"&&(l.onclick=Bf)}cn(g,x);var Z;g=null;for(Ve in A)if(!x.hasOwnProperty(Ve)&&A.hasOwnProperty(Ve)&&A[Ve]!=null)if(Ve==="style"){var de=A[Ve];for(Z in de)de.hasOwnProperty(Z)&&(g||(g={}),g[Z]="")}else Ve!=="dangerouslySetInnerHTML"&&Ve!=="children"&&Ve!=="suppressContentEditableWarning"&&Ve!=="suppressHydrationWarning"&&Ve!=="autoFocus"&&(a.hasOwnProperty(Ve)?T||(T=[]):(T=T||[]).push(Ve,null));for(Ve in x){var xe=x[Ve];if(de=A!=null?A[Ve]:void 0,x.hasOwnProperty(Ve)&&xe!==de&&(xe!=null||de!=null))if(Ve==="style")if(de){for(Z in de)!de.hasOwnProperty(Z)||xe&&xe.hasOwnProperty(Z)||(g||(g={}),g[Z]="");for(Z in xe)xe.hasOwnProperty(Z)&&de[Z]!==xe[Z]&&(g||(g={}),g[Z]=xe[Z])}else g||(T||(T=[]),T.push(Ve,g)),g=xe;else Ve==="dangerouslySetInnerHTML"?(xe=xe?xe.__html:void 0,de=de?de.__html:void 0,xe!=null&&de!==xe&&(T=T||[]).push(Ve,xe)):Ve==="children"?typeof xe!="string"&&typeof xe!="number"||(T=T||[]).push(Ve,""+xe):Ve!=="suppressContentEditableWarning"&&Ve!=="suppressHydrationWarning"&&(a.hasOwnProperty(Ve)?(xe!=null&&Ve==="onScroll"&&Gn("scroll",l),T||de===xe||(T=[])):(T=T||[]).push(Ve,xe))}g&&(T=T||[]).push("style",g);var Ve=T;(d.updateQueue=Ve)&&(d.flags|=4)}},ub=function(l,d,g,x){g!==x&&(d.flags|=4)};function Pd(l,d){if(!Xn)switch(l.tailMode){case"hidden":d=l.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?l.tail=null:g.sibling=null;break;case"collapsed":g=l.tail;for(var x=null;g!==null;)g.alternate!==null&&(x=g),g=g.sibling;x===null?d||l.tail===null?l.tail=null:l.tail.sibling=null:x.sibling=null}}function Ur(l){var d=l.alternate!==null&&l.alternate.child===l.child,g=0,x=0;if(d)for(var A=l.child;A!==null;)g|=A.lanes|A.childLanes,x|=A.subtreeFlags&14680064,x|=A.flags&14680064,A.return=l,A=A.sibling;else for(A=l.child;A!==null;)g|=A.lanes|A.childLanes,x|=A.subtreeFlags,x|=A.flags,A.return=l,A=A.sibling;return l.subtreeFlags|=x,l.childLanes=g,d}function cL(l,d,g){var x=d.pendingProps;switch(Xm(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ur(d),null;case 1:return gs(d.type)&&Wf(),Ur(d),null;case 3:return x=d.stateNode,Uc(),Yn(ms),Yn(zr),u2(),x.pendingContext&&(x.context=x.pendingContext,x.pendingContext=null),(l===null||l.child===null)&&(Xf(d)?d.flags|=4:l===null||l.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,Sa!==null&&(_2(Sa),Sa=null))),M2(l,d),Ur(d),null;case 5:l2(d);var A=bl(jd.current);if(g=d.type,l!==null&&d.stateNode!=null)cb(l,d,g,x,A),l.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!x){if(d.stateNode===null)throw Error(n(166));return Ur(d),null}if(l=bl(Ga.current),Xf(d)){x=d.stateNode,g=d.type;var T=d.memoizedProps;switch(x[Ka]=d,x[xd]=T,l=(d.mode&1)!==0,g){case"dialog":Gn("cancel",x),Gn("close",x);break;case"iframe":case"object":case"embed":Gn("load",x);break;case"video":case"audio":for(A=0;A<wd.length;A++)Gn(wd[A],x);break;case"source":Gn("error",x);break;case"img":case"image":case"link":Gn("error",x),Gn("load",x);break;case"details":Gn("toggle",x);break;case"input":Xe(x,T),Gn("invalid",x);break;case"select":x._wrapperState={wasMultiple:!!T.multiple},Gn("invalid",x);break;case"textarea":Ee(x,T),Gn("invalid",x)}cn(g,T),A=null;for(var Z in T)if(T.hasOwnProperty(Z)){var de=T[Z];Z==="children"?typeof de=="string"?x.textContent!==de&&(T.suppressHydrationWarning!==!0&&zf(x.textContent,de,l),A=["children",de]):typeof de=="number"&&x.textContent!==""+de&&(T.suppressHydrationWarning!==!0&&zf(x.textContent,de,l),A=["children",""+de]):a.hasOwnProperty(Z)&&de!=null&&Z==="onScroll"&&Gn("scroll",x)}switch(g){case"input":J(x),nt(x,T,!0);break;case"textarea":J(x),ye(x);break;case"select":case"option":break;default:typeof T.onClick=="function"&&(x.onclick=Bf)}x=A,d.updateQueue=x,x!==null&&(d.flags|=4)}else{Z=A.nodeType===9?A:A.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=Se(g)),l==="http://www.w3.org/1999/xhtml"?g==="script"?(l=Z.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof x.is=="string"?l=Z.createElement(g,{is:x.is}):(l=Z.createElement(g),g==="select"&&(Z=l,x.multiple?Z.multiple=!0:x.size&&(Z.size=x.size))):l=Z.createElementNS(l,g),l[Ka]=d,l[xd]=x,lb(l,d,!1,!1),d.stateNode=l;e:{switch(Z=Fe(g,x),g){case"dialog":Gn("cancel",l),Gn("close",l),A=x;break;case"iframe":case"object":case"embed":Gn("load",l),A=x;break;case"video":case"audio":for(A=0;A<wd.length;A++)Gn(wd[A],l);A=x;break;case"source":Gn("error",l),A=x;break;case"img":case"image":case"link":Gn("error",l),Gn("load",l),A=x;break;case"details":Gn("toggle",l),A=x;break;case"input":Xe(l,x),A=he(l,x),Gn("invalid",l);break;case"option":A=x;break;case"select":l._wrapperState={wasMultiple:!!x.multiple},A=V({},x,{value:void 0}),Gn("invalid",l);break;case"textarea":Ee(l,x),A=ue(l,x),Gn("invalid",l);break;default:A=x}cn(g,A),de=A;for(T in de)if(de.hasOwnProperty(T)){var xe=de[T];T==="style"?Ut(l,xe):T==="dangerouslySetInnerHTML"?(xe=xe?xe.__html:void 0,xe!=null&&Re(l,xe)):T==="children"?typeof xe=="string"?(g!=="textarea"||xe!=="")&&Ze(l,xe):typeof xe=="number"&&Ze(l,""+xe):T!=="suppressContentEditableWarning"&&T!=="suppressHydrationWarning"&&T!=="autoFocus"&&(a.hasOwnProperty(T)?xe!=null&&T==="onScroll"&&Gn("scroll",l):xe!=null&&j(l,T,xe,Z))}switch(g){case"input":J(l),nt(l,x,!1);break;case"textarea":J(l),ye(l);break;case"option":x.value!=null&&l.setAttribute("value",""+te(x.value));break;case"select":l.multiple=!!x.multiple,T=x.value,T!=null?Pe(l,!!x.multiple,T,!1):x.defaultValue!=null&&Pe(l,!!x.multiple,x.defaultValue,!0);break;default:typeof A.onClick=="function"&&(l.onclick=Bf)}switch(g){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}}x&&(d.flags|=4)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return Ur(d),null;case 6:if(l&&d.stateNode!=null)ub(l,d,l.memoizedProps,x);else{if(typeof x!="string"&&d.stateNode===null)throw Error(n(166));if(g=bl(jd.current),bl(Ga.current),Xf(d)){if(x=d.stateNode,g=d.memoizedProps,x[Ka]=d,(T=x.nodeValue!==g)&&(l=$s,l!==null))switch(l.tag){case 3:zf(x.nodeValue,g,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&zf(x.nodeValue,g,(l.mode&1)!==0)}T&&(d.flags|=4)}else x=(g.nodeType===9?g:g.ownerDocument).createTextNode(x),x[Ka]=d,d.stateNode=x}return Ur(d),null;case 13:if(Yn(Qn),x=d.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(Xn&&Ds!==null&&(d.mode&1)!==0&&(d.flags&128)===0)hy(),Zc(),d.flags|=98560,T=!1;else if(T=Xf(d),x!==null&&x.dehydrated!==null){if(l===null){if(!T)throw Error(n(318));if(T=d.memoizedState,T=T!==null?T.dehydrated:null,!T)throw Error(n(317));T[Ka]=d}else Zc(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;Ur(d),T=!1}else Sa!==null&&(_2(Sa),Sa=null),T=!0;if(!T)return d.flags&65536?d:null}return(d.flags&128)!==0?(d.lanes=g,d):(x=x!==null,x!==(l!==null&&l.memoizedState!==null)&&x&&(d.child.flags|=8192,(d.mode&1)!==0&&(l===null||(Qn.current&1)!==0?br===0&&(br=3):z2())),d.updateQueue!==null&&(d.flags|=4),Ur(d),null);case 4:return Uc(),M2(l,d),l===null&&yd(d.stateNode.containerInfo),Ur(d),null;case 10:return r2(d.type._context),Ur(d),null;case 17:return gs(d.type)&&Wf(),Ur(d),null;case 19:if(Yn(Qn),T=d.memoizedState,T===null)return Ur(d),null;if(x=(d.flags&128)!==0,Z=T.rendering,Z===null)if(x)Pd(T,!1);else{if(br!==0||l!==null&&(l.flags&128)!==0)for(l=d.child;l!==null;){if(Z=r1(l),Z!==null){for(d.flags|=128,Pd(T,!1),x=Z.updateQueue,x!==null&&(d.updateQueue=x,d.flags|=4),d.subtreeFlags=0,x=g,g=d.child;g!==null;)T=g,l=x,T.flags&=14680066,Z=T.alternate,Z===null?(T.childLanes=0,T.lanes=l,T.child=null,T.subtreeFlags=0,T.memoizedProps=null,T.memoizedState=null,T.updateQueue=null,T.dependencies=null,T.stateNode=null):(T.childLanes=Z.childLanes,T.lanes=Z.lanes,T.child=Z.child,T.subtreeFlags=0,T.deletions=null,T.memoizedProps=Z.memoizedProps,T.memoizedState=Z.memoizedState,T.updateQueue=Z.updateQueue,T.type=Z.type,l=Z.dependencies,T.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),g=g.sibling;return Un(Qn,Qn.current&1|2),d.child}l=l.sibling}T.tail!==null&&st()>Yc&&(d.flags|=128,x=!0,Pd(T,!1),d.lanes=4194304)}else{if(!x)if(l=r1(Z),l!==null){if(d.flags|=128,x=!0,g=l.updateQueue,g!==null&&(d.updateQueue=g,d.flags|=4),Pd(T,!0),T.tail===null&&T.tailMode==="hidden"&&!Z.alternate&&!Xn)return Ur(d),null}else 2*st()-T.renderingStartTime>Yc&&g!==1073741824&&(d.flags|=128,x=!0,Pd(T,!1),d.lanes=4194304);T.isBackwards?(Z.sibling=d.child,d.child=Z):(g=T.last,g!==null?g.sibling=Z:d.child=Z,T.last=Z)}return T.tail!==null?(d=T.tail,T.rendering=d,T.tail=d.sibling,T.renderingStartTime=st(),d.sibling=null,g=Qn.current,Un(Qn,x?g&1|2:g&1),d):(Ur(d),null);case 22:case 23:return V2(),x=d.memoizedState!==null,l!==null&&l.memoizedState!==null!==x&&(d.flags|=8192),x&&(d.mode&1)!==0?(Hs&1073741824)!==0&&(Ur(d),d.subtreeFlags&6&&(d.flags|=8192)):Ur(d),null;case 24:return null;case 25:return null}throw Error(n(156,d.tag))}function uL(l,d){switch(Xm(d),d.tag){case 1:return gs(d.type)&&Wf(),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return Uc(),Yn(ms),Yn(zr),u2(),l=d.flags,(l&65536)!==0&&(l&128)===0?(d.flags=l&-65537|128,d):null;case 5:return l2(d),null;case 13:if(Yn(Qn),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(n(340));Zc()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return Yn(Qn),null;case 4:return Uc(),null;case 10:return r2(d.type._context),null;case 22:case 23:return V2(),null;case 24:return null;default:return null}}var f1=!1,Wr=!1,dL=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function Kc(l,d){var g=l.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(x){ar(l,d,x)}else g.current=null}function R2(l,d,g){try{g()}catch(x){ar(l,d,x)}}var db=!1;function fL(l,d){if(Vm=hs,l=zw(),$m(l)){if("selectionStart"in l)var g={start:l.selectionStart,end:l.selectionEnd};else e:{g=(g=l.ownerDocument)&&g.defaultView||window;var x=g.getSelection&&g.getSelection();if(x&&x.rangeCount!==0){g=x.anchorNode;var A=x.anchorOffset,T=x.focusNode;x=x.focusOffset;try{g.nodeType,T.nodeType}catch{g=null;break e}var Z=0,de=-1,xe=-1,Ve=0,at=0,ct=l,rt=null;t:for(;;){for(var At;ct!==g||A!==0&&ct.nodeType!==3||(de=Z+A),ct!==T||x!==0&&ct.nodeType!==3||(xe=Z+x),ct.nodeType===3&&(Z+=ct.nodeValue.length),(At=ct.firstChild)!==null;)rt=ct,ct=At;for(;;){if(ct===l)break t;if(rt===g&&++Ve===A&&(de=Z),rt===T&&++at===x&&(xe=Z),(At=ct.nextSibling)!==null)break;ct=rt,rt=ct.parentNode}ct=At}g=de===-1||xe===-1?null:{start:de,end:xe}}else g=null}g=g||{start:0,end:0}}else g=null;for(zm={focusedElem:l,selectionRange:g},hs=!1,Mt=d;Mt!==null;)if(d=Mt,l=d.child,(d.subtreeFlags&1028)!==0&&l!==null)l.return=d,Mt=l;else for(;Mt!==null;){d=Mt;try{var Rt=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(Rt!==null){var Pt=Rt.memoizedProps,lr=Rt.memoizedState,Te=d.stateNode,je=Te.getSnapshotBeforeUpdate(d.elementType===d.type?Pt:Ea(d.type,Pt),lr);Te.__reactInternalSnapshotBeforeUpdate=je}break;case 3:var De=d.stateNode.containerInfo;De.nodeType===1?De.textContent="":De.nodeType===9&&De.documentElement&&De.removeChild(De.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ht){ar(d,d.return,ht)}if(l=d.sibling,l!==null){l.return=d.return,Mt=l;break}Mt=d.return}return Rt=db,db=!1,Rt}function Ld(l,d,g){var x=d.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var A=x=x.next;do{if((A.tag&l)===l){var T=A.destroy;A.destroy=void 0,T!==void 0&&R2(d,g,T)}A=A.next}while(A!==x)}}function h1(l,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var g=d=d.next;do{if((g.tag&l)===l){var x=g.create;g.destroy=x()}g=g.next}while(g!==d)}}function P2(l){var d=l.ref;if(d!==null){var g=l.stateNode;switch(l.tag){case 5:l=g;break;default:l=g}typeof d=="function"?d(l):d.current=l}}function fb(l){var d=l.alternate;d!==null&&(l.alternate=null,fb(d)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(d=l.stateNode,d!==null&&(delete d[Ka],delete d[xd],delete d[Km],delete d[GP],delete d[YP])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function hb(l){return l.tag===5||l.tag===3||l.tag===4}function pb(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||hb(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function L2(l,d,g){var x=l.tag;if(x===5||x===6)l=l.stateNode,d?g.nodeType===8?g.parentNode.insertBefore(l,d):g.insertBefore(l,d):(g.nodeType===8?(d=g.parentNode,d.insertBefore(l,g)):(d=g,d.appendChild(l)),g=g._reactRootContainer,g!=null||d.onclick!==null||(d.onclick=Bf));else if(x!==4&&(l=l.child,l!==null))for(L2(l,d,g),l=l.sibling;l!==null;)L2(l,d,g),l=l.sibling}function T2(l,d,g){var x=l.tag;if(x===5||x===6)l=l.stateNode,d?g.insertBefore(l,d):g.appendChild(l);else if(x!==4&&(l=l.child,l!==null))for(T2(l,d,g),l=l.sibling;l!==null;)T2(l,d,g),l=l.sibling}var Tr=null,Ca=!1;function xi(l,d,g){for(g=g.child;g!==null;)mb(l,d,g),g=g.sibling}function mb(l,d,g){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(ft,g)}catch{}switch(g.tag){case 5:Wr||Kc(g,d);case 6:var x=Tr,A=Ca;Tr=null,xi(l,d,g),Tr=x,Ca=A,Tr!==null&&(Ca?(l=Tr,g=g.stateNode,l.nodeType===8?l.parentNode.removeChild(g):l.removeChild(g)):Tr.removeChild(g.stateNode));break;case 18:Tr!==null&&(Ca?(l=Tr,g=g.stateNode,l.nodeType===8?Wm(l.parentNode,g):l.nodeType===1&&Wm(l,g),xn(l)):Wm(Tr,g.stateNode));break;case 4:x=Tr,A=Ca,Tr=g.stateNode.containerInfo,Ca=!0,xi(l,d,g),Tr=x,Ca=A;break;case 0:case 11:case 14:case 15:if(!Wr&&(x=g.updateQueue,x!==null&&(x=x.lastEffect,x!==null))){A=x=x.next;do{var T=A,Z=T.destroy;T=T.tag,Z!==void 0&&((T&2)!==0||(T&4)!==0)&&R2(g,d,Z),A=A.next}while(A!==x)}xi(l,d,g);break;case 1:if(!Wr&&(Kc(g,d),x=g.stateNode,typeof x.componentWillUnmount=="function"))try{x.props=g.memoizedProps,x.state=g.memoizedState,x.componentWillUnmount()}catch(de){ar(g,d,de)}xi(l,d,g);break;case 21:xi(l,d,g);break;case 22:g.mode&1?(Wr=(x=Wr)||g.memoizedState!==null,xi(l,d,g),Wr=x):xi(l,d,g);break;default:xi(l,d,g)}}function gb(l){var d=l.updateQueue;if(d!==null){l.updateQueue=null;var g=l.stateNode;g===null&&(g=l.stateNode=new dL),d.forEach(function(x){var A=xL.bind(null,l,x);g.has(x)||(g.add(x),x.then(A,A))})}}function ja(l,d){var g=d.deletions;if(g!==null)for(var x=0;x<g.length;x++){var A=g[x];try{var T=l,Z=d,de=Z;e:for(;de!==null;){switch(de.tag){case 5:Tr=de.stateNode,Ca=!1;break e;case 3:Tr=de.stateNode.containerInfo,Ca=!0;break e;case 4:Tr=de.stateNode.containerInfo,Ca=!0;break e}de=de.return}if(Tr===null)throw Error(n(160));mb(T,Z,A),Tr=null,Ca=!1;var xe=A.alternate;xe!==null&&(xe.return=null),A.return=null}catch(Ve){ar(A,d,Ve)}}if(d.subtreeFlags&12854)for(d=d.child;d!==null;)vb(d,l),d=d.sibling}function vb(l,d){var g=l.alternate,x=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(ja(d,l),qa(l),x&4){try{Ld(3,l,l.return),h1(3,l)}catch(Pt){ar(l,l.return,Pt)}try{Ld(5,l,l.return)}catch(Pt){ar(l,l.return,Pt)}}break;case 1:ja(d,l),qa(l),x&512&&g!==null&&Kc(g,g.return);break;case 5:if(ja(d,l),qa(l),x&512&&g!==null&&Kc(g,g.return),l.flags&32){var A=l.stateNode;try{Ze(A,"")}catch(Pt){ar(l,l.return,Pt)}}if(x&4&&(A=l.stateNode,A!=null)){var T=l.memoizedProps,Z=g!==null?g.memoizedProps:T,de=l.type,xe=l.updateQueue;if(l.updateQueue=null,xe!==null)try{de==="input"&&T.type==="radio"&&T.name!=null&&tt(A,T),Fe(de,Z);var Ve=Fe(de,T);for(Z=0;Z<xe.length;Z+=2){var at=xe[Z],ct=xe[Z+1];at==="style"?Ut(A,ct):at==="dangerouslySetInnerHTML"?Re(A,ct):at==="children"?Ze(A,ct):j(A,at,ct,Ve)}switch(de){case"input":ze(A,T);break;case"textarea":Ke(A,T);break;case"select":var rt=A._wrapperState.wasMultiple;A._wrapperState.wasMultiple=!!T.multiple;var At=T.value;At!=null?Pe(A,!!T.multiple,At,!1):rt!==!!T.multiple&&(T.defaultValue!=null?Pe(A,!!T.multiple,T.defaultValue,!0):Pe(A,!!T.multiple,T.multiple?[]:"",!1))}A[xd]=T}catch(Pt){ar(l,l.return,Pt)}}break;case 6:if(ja(d,l),qa(l),x&4){if(l.stateNode===null)throw Error(n(162));A=l.stateNode,T=l.memoizedProps;try{A.nodeValue=T}catch(Pt){ar(l,l.return,Pt)}}break;case 3:if(ja(d,l),qa(l),x&4&&g!==null&&g.memoizedState.isDehydrated)try{xn(d.containerInfo)}catch(Pt){ar(l,l.return,Pt)}break;case 4:ja(d,l),qa(l);break;case 13:ja(d,l),qa(l),A=l.child,A.flags&8192&&(T=A.memoizedState!==null,A.stateNode.isHidden=T,!T||A.alternate!==null&&A.alternate.memoizedState!==null||(H2=st())),x&4&&gb(l);break;case 22:if(at=g!==null&&g.memoizedState!==null,l.mode&1?(Wr=(Ve=Wr)||at,ja(d,l),Wr=Ve):ja(d,l),qa(l),x&8192){if(Ve=l.memoizedState!==null,(l.stateNode.isHidden=Ve)&&!at&&(l.mode&1)!==0)for(Mt=l,at=l.child;at!==null;){for(ct=Mt=at;Mt!==null;){switch(rt=Mt,At=rt.child,rt.tag){case 0:case 11:case 14:case 15:Ld(4,rt,rt.return);break;case 1:Kc(rt,rt.return);var Rt=rt.stateNode;if(typeof Rt.componentWillUnmount=="function"){x=rt,g=rt.return;try{d=x,Rt.props=d.memoizedProps,Rt.state=d.memoizedState,Rt.componentWillUnmount()}catch(Pt){ar(x,g,Pt)}}break;case 5:Kc(rt,rt.return);break;case 22:if(rt.memoizedState!==null){bb(ct);continue}}At!==null?(At.return=rt,Mt=At):bb(ct)}at=at.sibling}e:for(at=null,ct=l;;){if(ct.tag===5){if(at===null){at=ct;try{A=ct.stateNode,Ve?(T=A.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none"):(de=ct.stateNode,xe=ct.memoizedProps.style,Z=xe!=null&&xe.hasOwnProperty("display")?xe.display:null,de.style.display=Lt("display",Z))}catch(Pt){ar(l,l.return,Pt)}}}else if(ct.tag===6){if(at===null)try{ct.stateNode.nodeValue=Ve?"":ct.memoizedProps}catch(Pt){ar(l,l.return,Pt)}}else if((ct.tag!==22&&ct.tag!==23||ct.memoizedState===null||ct===l)&&ct.child!==null){ct.child.return=ct,ct=ct.child;continue}if(ct===l)break e;for(;ct.sibling===null;){if(ct.return===null||ct.return===l)break e;at===ct&&(at=null),ct=ct.return}at===ct&&(at=null),ct.sibling.return=ct.return,ct=ct.sibling}}break;case 19:ja(d,l),qa(l),x&4&&gb(l);break;case 21:break;default:ja(d,l),qa(l)}}function qa(l){var d=l.flags;if(d&2){try{e:{for(var g=l.return;g!==null;){if(hb(g)){var x=g;break e}g=g.return}throw Error(n(160))}switch(x.tag){case 5:var A=x.stateNode;x.flags&32&&(Ze(A,""),x.flags&=-33);var T=pb(l);T2(l,T,A);break;case 3:case 4:var Z=x.stateNode.containerInfo,de=pb(l);L2(l,de,Z);break;default:throw Error(n(161))}}catch(xe){ar(l,l.return,xe)}l.flags&=-3}d&4096&&(l.flags&=-4097)}function hL(l,d,g){Mt=l,wb(l)}function wb(l,d,g){for(var x=(l.mode&1)!==0;Mt!==null;){var A=Mt,T=A.child;if(A.tag===22&&x){var Z=A.memoizedState!==null||f1;if(!Z){var de=A.alternate,xe=de!==null&&de.memoizedState!==null||Wr;de=f1;var Ve=Wr;if(f1=Z,(Wr=xe)&&!Ve)for(Mt=A;Mt!==null;)Z=Mt,xe=Z.child,Z.tag===22&&Z.memoizedState!==null?xb(A):xe!==null?(xe.return=Z,Mt=xe):xb(A);for(;T!==null;)Mt=T,wb(T),T=T.sibling;Mt=A,f1=de,Wr=Ve}yb(l)}else(A.subtreeFlags&8772)!==0&&T!==null?(T.return=A,Mt=T):yb(l)}}function yb(l){for(;Mt!==null;){var d=Mt;if((d.flags&8772)!==0){var g=d.alternate;try{if((d.flags&8772)!==0)switch(d.tag){case 0:case 11:case 15:Wr||h1(5,d);break;case 1:var x=d.stateNode;if(d.flags&4&&!Wr)if(g===null)x.componentDidMount();else{var A=d.elementType===d.type?g.memoizedProps:Ea(d.type,g.memoizedProps);x.componentDidUpdate(A,g.memoizedState,x.__reactInternalSnapshotBeforeUpdate)}var T=d.updateQueue;T!==null&&by(d,T,x);break;case 3:var Z=d.updateQueue;if(Z!==null){if(g=null,d.child!==null)switch(d.child.tag){case 5:g=d.child.stateNode;break;case 1:g=d.child.stateNode}by(d,Z,g)}break;case 5:var de=d.stateNode;if(g===null&&d.flags&4){g=de;var xe=d.memoizedProps;switch(d.type){case"button":case"input":case"select":case"textarea":xe.autoFocus&&g.focus();break;case"img":xe.src&&(g.src=xe.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(d.memoizedState===null){var Ve=d.alternate;if(Ve!==null){var at=Ve.memoizedState;if(at!==null){var ct=at.dehydrated;ct!==null&&xn(ct)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Wr||d.flags&512&&P2(d)}catch(rt){ar(d,d.return,rt)}}if(d===l){Mt=null;break}if(g=d.sibling,g!==null){g.return=d.return,Mt=g;break}Mt=d.return}}function bb(l){for(;Mt!==null;){var d=Mt;if(d===l){Mt=null;break}var g=d.sibling;if(g!==null){g.return=d.return,Mt=g;break}Mt=d.return}}function xb(l){for(;Mt!==null;){var d=Mt;try{switch(d.tag){case 0:case 11:case 15:var g=d.return;try{h1(4,d)}catch(xe){ar(d,g,xe)}break;case 1:var x=d.stateNode;if(typeof x.componentDidMount=="function"){var A=d.return;try{x.componentDidMount()}catch(xe){ar(d,A,xe)}}var T=d.return;try{P2(d)}catch(xe){ar(d,T,xe)}break;case 5:var Z=d.return;try{P2(d)}catch(xe){ar(d,Z,xe)}}}catch(xe){ar(d,d.return,xe)}if(d===l){Mt=null;break}var de=d.sibling;if(de!==null){de.return=d.return,Mt=de;break}Mt=d.return}}var pL=Math.ceil,p1=N.ReactCurrentDispatcher,$2=N.ReactCurrentOwner,ea=N.ReactCurrentBatchConfig,Cn=0,Cr=null,dr=null,$r=0,Hs=0,Gc=gi(0),br=0,Td=null,kl=0,m1=0,D2=0,$d=null,ws=null,H2=0,Yc=1/0,Po=null,g1=!1,O2=null,ki=null,v1=!1,Si=null,w1=0,Dd=0,I2=null,y1=-1,b1=0;function rs(){return(Cn&6)!==0?st():y1!==-1?y1:y1=st()}function Ei(l){return(l.mode&1)===0?1:(Cn&2)!==0&&$r!==0?$r&-$r:XP.transition!==null?(b1===0&&(b1=tn()),b1):(l=yn,l!==0||(l=window.event,l=l===void 0?16:dd(l.type)),l)}function Aa(l,d,g,x){if(50<Dd)throw Dd=0,I2=null,Error(n(185));ur(l,g,x),((Cn&2)===0||l!==Cr)&&(l===Cr&&((Cn&2)===0&&(m1|=g),br===4&&Ci(l,$r)),ys(l,x),g===1&&Cn===0&&(d.mode&1)===0&&(Yc=st()+500,Gf&&wi()))}function ys(l,d){var g=l.callbackNode;Hn(l,d);var x=On(l,l===Cr?$r:0);if(x===0)g!==null&&bt(g),l.callbackNode=null,l.callbackPriority=0;else if(d=x&-x,l.callbackPriority!==d){if(g!=null&&bt(g),d===1)l.tag===0?qP(Sb.bind(null,l)):ly(Sb.bind(null,l)),WP(function(){(Cn&6)===0&&wi()}),g=null;else{switch(za(x)){case 1:g=An;break;case 4:g=q;break;case 16:g=fe;break;case 536870912:g=Ye;break;default:g=fe}g=Pb(g,kb.bind(null,l))}l.callbackPriority=d,l.callbackNode=g}}function kb(l,d){if(y1=-1,b1=0,(Cn&6)!==0)throw Error(n(327));var g=l.callbackNode;if(qc()&&l.callbackNode!==g)return null;var x=On(l,l===Cr?$r:0);if(x===0)return null;if((x&30)!==0||(x&l.expiredLanes)!==0||d)d=x1(l,x);else{d=x;var A=Cn;Cn|=2;var T=Cb();(Cr!==l||$r!==d)&&(Po=null,Yc=st()+500,El(l,d));do try{vL();break}catch(de){Eb(l,de)}while(!0);n2(),p1.current=T,Cn=A,dr!==null?d=0:(Cr=null,$r=0,d=br)}if(d!==0){if(d===2&&(A=Ot(l),A!==0&&(x=A,d=F2(l,A))),d===1)throw g=Td,El(l,0),Ci(l,x),ys(l,st()),g;if(d===6)Ci(l,x);else{if(A=l.current.alternate,(x&30)===0&&!mL(A)&&(d=x1(l,x),d===2&&(T=Ot(l),T!==0&&(x=T,d=F2(l,T))),d===1))throw g=Td,El(l,0),Ci(l,x),ys(l,st()),g;switch(l.finishedWork=A,l.finishedLanes=x,d){case 0:case 1:throw Error(n(345));case 2:Cl(l,ws,Po);break;case 3:if(Ci(l,x),(x&130023424)===x&&(d=H2+500-st(),10<d)){if(On(l,0)!==0)break;if(A=l.suspendedLanes,(A&x)!==x){rs(),l.pingedLanes|=l.suspendedLanes&A;break}l.timeoutHandle=Um(Cl.bind(null,l,ws,Po),d);break}Cl(l,ws,Po);break;case 4:if(Ci(l,x),(x&4194240)===x)break;for(d=l.eventTimes,A=-1;0<x;){var Z=31-Ht(x);T=1<<Z,Z=d[Z],Z>A&&(A=Z),x&=~T}if(x=A,x=st()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*pL(x/1960))-x,10<x){l.timeoutHandle=Um(Cl.bind(null,l,ws,Po),x);break}Cl(l,ws,Po);break;case 5:Cl(l,ws,Po);break;default:throw Error(n(329))}}}return ys(l,st()),l.callbackNode===g?kb.bind(null,l):null}function F2(l,d){var g=$d;return l.current.memoizedState.isDehydrated&&(El(l,d).flags|=256),l=x1(l,d),l!==2&&(d=ws,ws=g,d!==null&&_2(d)),l}function _2(l){ws===null?ws=l:ws.push.apply(ws,l)}function mL(l){for(var d=l;;){if(d.flags&16384){var g=d.updateQueue;if(g!==null&&(g=g.stores,g!==null))for(var x=0;x<g.length;x++){var A=g[x],T=A.getSnapshot;A=A.value;try{if(!ka(T(),A))return!1}catch{return!1}}}if(g=d.child,d.subtreeFlags&16384&&g!==null)g.return=d,d=g;else{if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Ci(l,d){for(d&=~D2,d&=~m1,l.suspendedLanes|=d,l.pingedLanes&=~d,l=l.expirationTimes;0<d;){var g=31-Ht(d),x=1<<g;l[g]=-1,d&=~x}}function Sb(l){if((Cn&6)!==0)throw Error(n(327));qc();var d=On(l,0);if((d&1)===0)return ys(l,st()),null;var g=x1(l,d);if(l.tag!==0&&g===2){var x=Ot(l);x!==0&&(d=x,g=F2(l,x))}if(g===1)throw g=Td,El(l,0),Ci(l,d),ys(l,st()),g;if(g===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=d,Cl(l,ws,Po),ys(l,st()),null}function Z2(l,d){var g=Cn;Cn|=1;try{return l(d)}finally{Cn=g,Cn===0&&(Yc=st()+500,Gf&&wi())}}function Sl(l){Si!==null&&Si.tag===0&&(Cn&6)===0&&qc();var d=Cn;Cn|=1;var g=ea.transition,x=yn;try{if(ea.transition=null,yn=1,l)return l()}finally{yn=x,ea.transition=g,Cn=d,(Cn&6)===0&&wi()}}function V2(){Hs=Gc.current,Yn(Gc)}function El(l,d){l.finishedWork=null,l.finishedLanes=0;var g=l.timeoutHandle;if(g!==-1&&(l.timeoutHandle=-1,UP(g)),dr!==null)for(g=dr.return;g!==null;){var x=g;switch(Xm(x),x.tag){case 1:x=x.type.childContextTypes,x!=null&&Wf();break;case 3:Uc(),Yn(ms),Yn(zr),u2();break;case 5:l2(x);break;case 4:Uc();break;case 13:Yn(Qn);break;case 19:Yn(Qn);break;case 10:r2(x.type._context);break;case 22:case 23:V2()}g=g.return}if(Cr=l,dr=l=ji(l.current,null),$r=Hs=d,br=0,Td=null,D2=m1=kl=0,ws=$d=null,yl!==null){for(d=0;d<yl.length;d++)if(g=yl[d],x=g.interleaved,x!==null){g.interleaved=null;var A=x.next,T=g.pending;if(T!==null){var Z=T.next;T.next=A,x.next=Z}g.pending=x}yl=null}return l}function Eb(l,d){do{var g=dr;try{if(n2(),s1.current=l1,a1){for(var x=Jn.memoizedState;x!==null;){var A=x.queue;A!==null&&(A.pending=null),x=x.next}a1=!1}if(xl=0,Er=yr=Jn=null,Ad=!1,Nd=0,$2.current=null,g===null||g.return===null){br=1,Td=d,dr=null;break}e:{var T=l,Z=g.return,de=g,xe=d;if(d=$r,de.flags|=32768,xe!==null&&typeof xe=="object"&&typeof xe.then=="function"){var Ve=xe,at=de,ct=at.tag;if((at.mode&1)===0&&(ct===0||ct===11||ct===15)){var rt=at.alternate;rt?(at.updateQueue=rt.updateQueue,at.memoizedState=rt.memoizedState,at.lanes=rt.lanes):(at.updateQueue=null,at.memoizedState=null)}var At=Yy(Z);if(At!==null){At.flags&=-257,qy(At,Z,de,T,d),At.mode&1&&Gy(T,Ve,d),d=At,xe=Ve;var Rt=d.updateQueue;if(Rt===null){var Pt=new Set;Pt.add(xe),d.updateQueue=Pt}else Rt.add(xe);break e}else{if((d&1)===0){Gy(T,Ve,d),z2();break e}xe=Error(n(426))}}else if(Xn&&de.mode&1){var lr=Yy(Z);if(lr!==null){(lr.flags&65536)===0&&(lr.flags|=256),qy(lr,Z,de,T,d),e2(Wc(xe,de));break e}}T=xe=Wc(xe,de),br!==4&&(br=2),$d===null?$d=[T]:$d.push(T),T=Z;do{switch(T.tag){case 3:T.flags|=65536,d&=-d,T.lanes|=d;var Te=Wy(T,xe,d);yy(T,Te);break e;case 1:de=xe;var je=T.type,De=T.stateNode;if((T.flags&128)===0&&(typeof je.getDerivedStateFromError=="function"||De!==null&&typeof De.componentDidCatch=="function"&&(ki===null||!ki.has(De)))){T.flags|=65536,d&=-d,T.lanes|=d;var ht=Ky(T,de,d);yy(T,ht);break e}}T=T.return}while(T!==null)}Ab(g)}catch(Tt){d=Tt,dr===g&&g!==null&&(dr=g=g.return);continue}break}while(!0)}function Cb(){var l=p1.current;return p1.current=l1,l===null?l1:l}function z2(){(br===0||br===3||br===2)&&(br=4),Cr===null||(kl&268435455)===0&&(m1&268435455)===0||Ci(Cr,$r)}function x1(l,d){var g=Cn;Cn|=2;var x=Cb();(Cr!==l||$r!==d)&&(Po=null,El(l,d));do try{gL();break}catch(A){Eb(l,A)}while(!0);if(n2(),Cn=g,p1.current=x,dr!==null)throw Error(n(261));return Cr=null,$r=0,br}function gL(){for(;dr!==null;)jb(dr)}function vL(){for(;dr!==null&&!vt();)jb(dr)}function jb(l){var d=Rb(l.alternate,l,Hs);l.memoizedProps=l.pendingProps,d===null?Ab(l):dr=d,$2.current=null}function Ab(l){var d=l;do{var g=d.alternate;if(l=d.return,(d.flags&32768)===0){if(g=cL(g,d,Hs),g!==null){dr=g;return}}else{if(g=uL(g,d),g!==null){g.flags&=32767,dr=g;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{br=6,dr=null;return}}if(d=d.sibling,d!==null){dr=d;return}dr=d=l}while(d!==null);br===0&&(br=5)}function Cl(l,d,g){var x=yn,A=ea.transition;try{ea.transition=null,yn=1,wL(l,d,g,x)}finally{ea.transition=A,yn=x}return null}function wL(l,d,g,x){do qc();while(Si!==null);if((Cn&6)!==0)throw Error(n(327));g=l.finishedWork;var A=l.finishedLanes;if(g===null)return null;if(l.finishedWork=null,l.finishedLanes=0,g===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var T=g.lanes|g.childLanes;if(Zr(l,T),l===Cr&&(dr=Cr=null,$r=0),(g.subtreeFlags&2064)===0&&(g.flags&2064)===0||v1||(v1=!0,Pb(fe,function(){return qc(),null})),T=(g.flags&15990)!==0,(g.subtreeFlags&15990)!==0||T){T=ea.transition,ea.transition=null;var Z=yn;yn=1;var de=Cn;Cn|=4,$2.current=null,fL(l,g),vb(g,l),IP(zm),hs=!!Vm,zm=Vm=null,l.current=g,hL(g),jt(),Cn=de,yn=Z,ea.transition=T}else l.current=g;if(v1&&(v1=!1,Si=l,w1=A),T=l.pendingLanes,T===0&&(ki=null),Zt(g.stateNode),ys(l,st()),d!==null)for(x=l.onRecoverableError,g=0;g<d.length;g++)A=d[g],x(A.value,{componentStack:A.stack,digest:A.digest});if(g1)throw g1=!1,l=O2,O2=null,l;return(w1&1)!==0&&l.tag!==0&&qc(),T=l.pendingLanes,(T&1)!==0?l===I2?Dd++:(Dd=0,I2=l):Dd=0,wi(),null}function qc(){if(Si!==null){var l=za(w1),d=ea.transition,g=yn;try{if(ea.transition=null,yn=16>l?16:l,Si===null)var x=!1;else{if(l=Si,Si=null,w1=0,(Cn&6)!==0)throw Error(n(331));var A=Cn;for(Cn|=4,Mt=l.current;Mt!==null;){var T=Mt,Z=T.child;if((Mt.flags&16)!==0){var de=T.deletions;if(de!==null){for(var xe=0;xe<de.length;xe++){var Ve=de[xe];for(Mt=Ve;Mt!==null;){var at=Mt;switch(at.tag){case 0:case 11:case 15:Ld(8,at,T)}var ct=at.child;if(ct!==null)ct.return=at,Mt=ct;else for(;Mt!==null;){at=Mt;var rt=at.sibling,At=at.return;if(fb(at),at===Ve){Mt=null;break}if(rt!==null){rt.return=At,Mt=rt;break}Mt=At}}}var Rt=T.alternate;if(Rt!==null){var Pt=Rt.child;if(Pt!==null){Rt.child=null;do{var lr=Pt.sibling;Pt.sibling=null,Pt=lr}while(Pt!==null)}}Mt=T}}if((T.subtreeFlags&2064)!==0&&Z!==null)Z.return=T,Mt=Z;else e:for(;Mt!==null;){if(T=Mt,(T.flags&2048)!==0)switch(T.tag){case 0:case 11:case 15:Ld(9,T,T.return)}var Te=T.sibling;if(Te!==null){Te.return=T.return,Mt=Te;break e}Mt=T.return}}var je=l.current;for(Mt=je;Mt!==null;){Z=Mt;var De=Z.child;if((Z.subtreeFlags&2064)!==0&&De!==null)De.return=Z,Mt=De;else e:for(Z=je;Mt!==null;){if(de=Mt,(de.flags&2048)!==0)try{switch(de.tag){case 0:case 11:case 15:h1(9,de)}}catch(Tt){ar(de,de.return,Tt)}if(de===Z){Mt=null;break e}var ht=de.sibling;if(ht!==null){ht.return=de.return,Mt=ht;break e}Mt=de.return}}if(Cn=A,wi(),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(ft,l)}catch{}x=!0}return x}finally{yn=g,ea.transition=d}}return!1}function Nb(l,d,g){d=Wc(g,d),d=Wy(l,d,1),l=bi(l,d,1),d=rs(),l!==null&&(ur(l,1,d),ys(l,d))}function ar(l,d,g){if(l.tag===3)Nb(l,l,g);else for(;d!==null;){if(d.tag===3){Nb(d,l,g);break}else if(d.tag===1){var x=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(ki===null||!ki.has(x))){l=Wc(g,l),l=Ky(d,l,1),d=bi(d,l,1),l=rs(),d!==null&&(ur(d,1,l),ys(d,l));break}}d=d.return}}function yL(l,d,g){var x=l.pingCache;x!==null&&x.delete(d),d=rs(),l.pingedLanes|=l.suspendedLanes&g,Cr===l&&($r&g)===g&&(br===4||br===3&&($r&130023424)===$r&&500>st()-H2?El(l,0):D2|=g),ys(l,d)}function Mb(l,d){d===0&&((l.mode&1)===0?d=1:(d=In,In<<=1,(In&130023424)===0&&(In=4194304)));var g=rs();l=No(l,d),l!==null&&(ur(l,d,g),ys(l,g))}function bL(l){var d=l.memoizedState,g=0;d!==null&&(g=d.retryLane),Mb(l,g)}function xL(l,d){var g=0;switch(l.tag){case 13:var x=l.stateNode,A=l.memoizedState;A!==null&&(g=A.retryLane);break;case 19:x=l.stateNode;break;default:throw Error(n(314))}x!==null&&x.delete(d),Mb(l,g)}var Rb;Rb=function(l,d,g){if(l!==null)if(l.memoizedProps!==d.pendingProps||ms.current)vs=!0;else{if((l.lanes&g)===0&&(d.flags&128)===0)return vs=!1,lL(l,d,g);vs=(l.flags&131072)!==0}else vs=!1,Xn&&(d.flags&1048576)!==0&&cy(d,qf,d.index);switch(d.lanes=0,d.tag){case 2:var x=d.type;d1(l,d),l=d.pendingProps;var A=Ic(d,zr.current);Bc(d,g),A=h2(null,d,x,l,A,g);var T=p2();return d.flags|=1,typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,gs(x)?(T=!0,Kf(d)):T=!1,d.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,o2(d),A.updater=c1,d.stateNode=A,A._reactInternals=d,b2(d,x,l,g),d=E2(null,d,x,!0,T,g)):(d.tag=0,Xn&&T&&qm(d),ns(null,d,A,g),d=d.child),d;case 16:x=d.elementType;e:{switch(d1(l,d),l=d.pendingProps,A=x._init,x=A(x._payload),d.type=x,A=d.tag=SL(x),l=Ea(x,l),A){case 0:d=S2(null,d,x,l,g);break e;case 1:d=nb(null,d,x,l,g);break e;case 11:d=Xy(null,d,x,l,g);break e;case 14:d=Qy(null,d,x,Ea(x.type,l),g);break e}throw Error(n(306,x,""))}return d;case 0:return x=d.type,A=d.pendingProps,A=d.elementType===x?A:Ea(x,A),S2(l,d,x,A,g);case 1:return x=d.type,A=d.pendingProps,A=d.elementType===x?A:Ea(x,A),nb(l,d,x,A,g);case 3:e:{if(rb(d),l===null)throw Error(n(387));x=d.pendingProps,T=d.memoizedState,A=T.element,wy(l,d),n1(d,x,null,g);var Z=d.memoizedState;if(x=Z.element,T.isDehydrated)if(T={element:x,isDehydrated:!1,cache:Z.cache,pendingSuspenseBoundaries:Z.pendingSuspenseBoundaries,transitions:Z.transitions},d.updateQueue.baseState=T,d.memoizedState=T,d.flags&256){A=Wc(Error(n(423)),d),d=sb(l,d,x,g,A);break e}else if(x!==A){A=Wc(Error(n(424)),d),d=sb(l,d,x,g,A);break e}else for(Ds=mi(d.stateNode.containerInfo.firstChild),$s=d,Xn=!0,Sa=null,g=gy(d,null,x,g),d.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(Zc(),x===A){d=Ro(l,d,g);break e}ns(l,d,x,g)}d=d.child}return d;case 5:return xy(d),l===null&&Jm(d),x=d.type,A=d.pendingProps,T=l!==null?l.memoizedProps:null,Z=A.children,Bm(x,A)?Z=null:T!==null&&Bm(x,T)&&(d.flags|=32),tb(l,d),ns(l,d,Z,g),d.child;case 6:return l===null&&Jm(d),null;case 13:return ab(l,d,g);case 4:return i2(d,d.stateNode.containerInfo),x=d.pendingProps,l===null?d.child=Vc(d,null,x,g):ns(l,d,x,g),d.child;case 11:return x=d.type,A=d.pendingProps,A=d.elementType===x?A:Ea(x,A),Xy(l,d,x,A,g);case 7:return ns(l,d,d.pendingProps,g),d.child;case 8:return ns(l,d,d.pendingProps.children,g),d.child;case 12:return ns(l,d,d.pendingProps.children,g),d.child;case 10:e:{if(x=d.type._context,A=d.pendingProps,T=d.memoizedProps,Z=A.value,Un(Jf,x._currentValue),x._currentValue=Z,T!==null)if(ka(T.value,Z)){if(T.children===A.children&&!ms.current){d=Ro(l,d,g);break e}}else for(T=d.child,T!==null&&(T.return=d);T!==null;){var de=T.dependencies;if(de!==null){Z=T.child;for(var xe=de.firstContext;xe!==null;){if(xe.context===x){if(T.tag===1){xe=Mo(-1,g&-g),xe.tag=2;var Ve=T.updateQueue;if(Ve!==null){Ve=Ve.shared;var at=Ve.pending;at===null?xe.next=xe:(xe.next=at.next,at.next=xe),Ve.pending=xe}}T.lanes|=g,xe=T.alternate,xe!==null&&(xe.lanes|=g),s2(T.return,g,d),de.lanes|=g;break}xe=xe.next}}else if(T.tag===10)Z=T.type===d.type?null:T.child;else if(T.tag===18){if(Z=T.return,Z===null)throw Error(n(341));Z.lanes|=g,de=Z.alternate,de!==null&&(de.lanes|=g),s2(Z,g,d),Z=T.sibling}else Z=T.child;if(Z!==null)Z.return=T;else for(Z=T;Z!==null;){if(Z===d){Z=null;break}if(T=Z.sibling,T!==null){T.return=Z.return,Z=T;break}Z=Z.return}T=Z}ns(l,d,A.children,g),d=d.child}return d;case 9:return A=d.type,x=d.pendingProps.children,Bc(d,g),A=Qs(A),x=x(A),d.flags|=1,ns(l,d,x,g),d.child;case 14:return x=d.type,A=Ea(x,d.pendingProps),A=Ea(x.type,A),Qy(l,d,x,A,g);case 15:return Jy(l,d,d.type,d.pendingProps,g);case 17:return x=d.type,A=d.pendingProps,A=d.elementType===x?A:Ea(x,A),d1(l,d),d.tag=1,gs(x)?(l=!0,Kf(d)):l=!1,Bc(d,g),By(d,x,A),b2(d,x,A,g),E2(null,d,x,!0,l,g);case 19:return ib(l,d,g);case 22:return eb(l,d,g)}throw Error(n(156,d.tag))};function Pb(l,d){return Le(l,d)}function kL(l,d,g,x){this.tag=l,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ta(l,d,g,x){return new kL(l,d,g,x)}function B2(l){return l=l.prototype,!(!l||!l.isReactComponent)}function SL(l){if(typeof l=="function")return B2(l)?1:0;if(l!=null){if(l=l.$$typeof,l===D)return 11;if(l===_)return 14}return 2}function ji(l,d){var g=l.alternate;return g===null?(g=ta(l.tag,d,l.key,l.mode),g.elementType=l.elementType,g.type=l.type,g.stateNode=l.stateNode,g.alternate=l,l.alternate=g):(g.pendingProps=d,g.type=l.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=l.flags&14680064,g.childLanes=l.childLanes,g.lanes=l.lanes,g.child=l.child,g.memoizedProps=l.memoizedProps,g.memoizedState=l.memoizedState,g.updateQueue=l.updateQueue,d=l.dependencies,g.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},g.sibling=l.sibling,g.index=l.index,g.ref=l.ref,g}function k1(l,d,g,x,A,T){var Z=2;if(x=l,typeof l=="function")B2(l)&&(Z=1);else if(typeof l=="string")Z=5;else e:switch(l){case R:return jl(g.children,A,T,d);case E:Z=8,A|=8;break;case M:return l=ta(12,g,d,A|2),l.elementType=M,l.lanes=T,l;case K:return l=ta(13,g,d,A),l.elementType=K,l.lanes=T,l;case O:return l=ta(19,g,d,A),l.elementType=O,l.lanes=T,l;case z:return S1(g,A,T,d);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case L:Z=10;break e;case H:Z=9;break e;case D:Z=11;break e;case _:Z=14;break e;case re:Z=16,x=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return d=ta(Z,g,d,A),d.elementType=l,d.type=x,d.lanes=T,d}function jl(l,d,g,x){return l=ta(7,l,x,d),l.lanes=g,l}function S1(l,d,g,x){return l=ta(22,l,x,d),l.elementType=z,l.lanes=g,l.stateNode={isHidden:!1},l}function U2(l,d,g){return l=ta(6,l,null,d),l.lanes=g,l}function W2(l,d,g){return d=ta(4,l.children!==null?l.children:[],l.key,d),d.lanes=g,d.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},d}function EL(l,d,g,x,A){this.tag=d,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vn(0),this.expirationTimes=Vn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vn(0),this.identifierPrefix=x,this.onRecoverableError=A,this.mutableSourceEagerHydrationData=null}function K2(l,d,g,x,A,T,Z,de,xe){return l=new EL(l,d,g,de,xe),d===1?(d=1,T===!0&&(d|=8)):d=0,T=ta(3,null,null,d),l.current=T,T.stateNode=l,T.memoizedState={element:x,isDehydrated:g,cache:null,transitions:null,pendingSuspenseBoundaries:null},o2(T),l}function CL(l,d,g){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$,key:x==null?null:""+x,children:l,containerInfo:d,implementation:g}}function Lb(l){if(!l)return vi;l=l._reactInternals;e:{if(Ge(l)!==l||l.tag!==1)throw Error(n(170));var d=l;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(gs(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(n(171))}if(l.tag===1){var g=l.type;if(gs(g))return oy(l,g,d)}return d}function Tb(l,d,g,x,A,T,Z,de,xe){return l=K2(g,x,!0,l,A,T,Z,de,xe),l.context=Lb(null),g=l.current,x=rs(),A=Ei(g),T=Mo(x,A),T.callback=d??null,bi(g,T,A),l.current.lanes=A,ur(l,A,x),ys(l,x),l}function E1(l,d,g,x){var A=d.current,T=rs(),Z=Ei(A);return g=Lb(g),d.context===null?d.context=g:d.pendingContext=g,d=Mo(T,Z),d.payload={element:l},x=x===void 0?null:x,x!==null&&(d.callback=x),l=bi(A,d,Z),l!==null&&(Aa(l,A,Z,T),t1(l,A,Z)),Z}function C1(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return l.child.stateNode;default:return l.child.stateNode}}function $b(l,d){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var g=l.retryLane;l.retryLane=g!==0&&g<d?g:d}}function G2(l,d){$b(l,d),(l=l.alternate)&&$b(l,d)}function jL(){return null}var Db=typeof reportError=="function"?reportError:function(l){console.error(l)};function Y2(l){this._internalRoot=l}j1.prototype.render=Y2.prototype.render=function(l){var d=this._internalRoot;if(d===null)throw Error(n(409));E1(l,d,null,null)},j1.prototype.unmount=Y2.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var d=l.containerInfo;Sl(function(){E1(null,l,null,null)}),d[Eo]=null}};function j1(l){this._internalRoot=l}j1.prototype.unstable_scheduleHydration=function(l){if(l){var d=wa();l={blockedOn:null,target:l,priority:d};for(var g=0;g<Lr.length&&d!==0&&d<Lr[g].priority;g++);Lr.splice(g,0,l),g===0&&Je(l)}};function q2(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function A1(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function Hb(){}function AL(l,d,g,x,A){if(A){if(typeof x=="function"){var T=x;x=function(){var Ve=C1(Z);T.call(Ve)}}var Z=Tb(d,x,l,0,null,!1,!1,"",Hb);return l._reactRootContainer=Z,l[Eo]=Z.current,yd(l.nodeType===8?l.parentNode:l),Sl(),Z}for(;A=l.lastChild;)l.removeChild(A);if(typeof x=="function"){var de=x;x=function(){var Ve=C1(xe);de.call(Ve)}}var xe=K2(l,0,!1,null,null,!1,!1,"",Hb);return l._reactRootContainer=xe,l[Eo]=xe.current,yd(l.nodeType===8?l.parentNode:l),Sl(function(){E1(d,xe,g,x)}),xe}function N1(l,d,g,x,A){var T=g._reactRootContainer;if(T){var Z=T;if(typeof A=="function"){var de=A;A=function(){var xe=C1(Z);de.call(xe)}}E1(d,Z,l,A)}else Z=AL(g,d,l,A,x);return C1(Z)}xo=function(l){switch(l.tag){case 3:var d=l.stateNode;if(d.current.memoizedState.isDehydrated){var g=Dt(d.pendingLanes);g!==0&&(zn(d,g|1),ys(d,st()),(Cn&6)===0&&(Yc=st()+500,wi()))}break;case 13:Sl(function(){var x=No(l,1);if(x!==null){var A=rs();Aa(x,l,1,A)}}),G2(l,1)}},ko=function(l){if(l.tag===13){var d=No(l,134217728);if(d!==null){var g=rs();Aa(d,l,134217728,g)}G2(l,134217728)}},dl=function(l){if(l.tag===13){var d=Ei(l),g=No(l,d);if(g!==null){var x=rs();Aa(g,l,d,x)}G2(l,d)}},wa=function(){return yn},So=function(l,d){var g=yn;try{return yn=l,d()}finally{yn=g}},St=function(l,d,g){switch(d){case"input":if(ze(l,g),d=g.name,g.type==="radio"&&d!=null){for(g=l;g.parentNode;)g=g.parentNode;for(g=g.querySelectorAll("input[name="+JSON.stringify(""+d)+'][type="radio"]'),d=0;d<g.length;d++){var x=g[d];if(x!==l&&x.form===l.form){var A=Uf(x);if(!A)throw Error(n(90));ne(x),ze(x,A)}}}break;case"textarea":Ke(l,g);break;case"select":d=g.value,d!=null&&Pe(l,!!g.multiple,d,!1)}},ot=Z2,kn=Sl;var NL={usingClientEntryPoint:!1,Events:[kd,Hc,Uf,et,gt,Z2]},Hd={findFiberByHostInstance:ml,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ML={bundleType:Hd.bundleType,version:Hd.version,rendererPackageName:Hd.rendererPackageName,rendererConfig:Hd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:N.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=pe(l),l===null?null:l.stateNode},findFiberByHostInstance:Hd.findFiberByHostInstance||jL,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var M1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!M1.isDisabled&&M1.supportsFiber)try{ft=M1.inject(ML),wt=M1}catch{}}return bs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=NL,bs.createPortal=function(l,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!q2(d))throw Error(n(200));return CL(l,d,null,g)},bs.createRoot=function(l,d){if(!q2(l))throw Error(n(299));var g=!1,x="",A=Db;return d!=null&&(d.unstable_strictMode===!0&&(g=!0),d.identifierPrefix!==void 0&&(x=d.identifierPrefix),d.onRecoverableError!==void 0&&(A=d.onRecoverableError)),d=K2(l,1,!1,null,null,g,!1,x,A),l[Eo]=d.current,yd(l.nodeType===8?l.parentNode:l),new Y2(d)},bs.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var d=l._reactInternals;if(d===void 0)throw typeof l.render=="function"?Error(n(188)):(l=Object.keys(l).join(","),Error(n(268,l)));return l=pe(d),l=l===null?null:l.stateNode,l},bs.flushSync=function(l){return Sl(l)},bs.hydrate=function(l,d,g){if(!A1(d))throw Error(n(200));return N1(null,l,d,!0,g)},bs.hydrateRoot=function(l,d,g){if(!q2(l))throw Error(n(405));var x=g!=null&&g.hydratedSources||null,A=!1,T="",Z=Db;if(g!=null&&(g.unstable_strictMode===!0&&(A=!0),g.identifierPrefix!==void 0&&(T=g.identifierPrefix),g.onRecoverableError!==void 0&&(Z=g.onRecoverableError)),d=Tb(d,null,l,1,g??null,A,!1,T,Z),l[Eo]=d.current,yd(l),x)for(l=0;l<x.length;l++)g=x[l],A=g._getVersion,A=A(g._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[g,A]:d.mutableSourceEagerHydrationData.push(g,A);return new j1(d)},bs.render=function(l,d,g){if(!A1(d))throw Error(n(200));return N1(null,l,d,!1,g)},bs.unmountComponentAtNode=function(l){if(!A1(l))throw Error(n(40));return l._reactRootContainer?(Sl(function(){N1(null,null,l,!1,function(){l._reactRootContainer=null,l[Eo]=null})}),!0):!1},bs.unstable_batchedUpdates=Z2,bs.unstable_renderSubtreeIntoContainer=function(l,d,g,x){if(!A1(g))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return N1(l,d,g,!1,x)},bs.version="18.3.1-next-f1338f8080-20240426",bs}var Kb;function iS(){if(Kb)return eg.exports;Kb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),eg.exports=OL(),eg.exports}var Gb;function IL(){if(Gb)return R1;Gb=1;var e=iS();return R1.createRoot=e.createRoot,R1.hydrateRoot=e.hydrateRoot,R1}var FL=IL();/**
|
|
41
|
-
* react-router v7.18.3
|
|
42
|
-
*
|
|
43
|
-
* Copyright (c) Remix Software Inc.
|
|
44
|
-
*
|
|
45
|
-
* This source code is licensed under the MIT license found in the
|
|
46
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
-
*
|
|
48
|
-
* @license MIT
|
|
49
|
-
*/var lS=e=>{throw TypeError(e)},cS=(e,t,n)=>t.has(e)||lS("Cannot "+n),sa=(e,t,n)=>(cS(e,t,"read from private field"),n?n.call(e):t.get(e)),Jd=(e,t,n)=>t.has(e)?lS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Xa=(e,t,n,r)=>(cS(e,t,"write to private field"),t.set(e,n),n),cp=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,up=/^[\\/]{2}/;function uS(e,t){return t+e.replace(/\\/g,"/")}var Yb="popstate";function qb(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function _L(e={}){function t(r,a){var h;let i=(h=a.state)==null?void 0:h.masked,{pathname:c,search:u,hash:f}=i||r.location;return y0("",{pathname:c,search:u,hash:f},a.state&&a.state.usr||null,a.state&&a.state.key||"default",i?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,a){return typeof a=="string"?a:ls(a)}return VL(t,n,null,e)}function rn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function qn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ZL(){return Math.random().toString(36).substring(2,10)}function Xb(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function y0(e,t,n=null,r,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?wo(t):t,state:n,key:t&&t.key||r||ZL(),mask:a}}function ls({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function wo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function VL(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:i=!1}=r,c=a.history,u="POP",f=null,h=p();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function p(){return(c.state||{idx:null}).idx}function m(){u="POP";let k=p(),S=k==null?null:k-h;h=k,f&&f({action:u,location:b.location,delta:S})}function v(k,S){u="PUSH";let C=qb(k)?k:y0(b.location,k,S);h=p()+1;let j=Xb(C,h),N=b.createHref(C.mask||C);try{c.pushState(j,"",N)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;a.location.assign(N)}i&&f&&f({action:u,location:b.location,delta:1})}function w(k,S){u="REPLACE";let C=qb(k)?k:y0(b.location,k,S);h=p();let j=Xb(C,h),N=b.createHref(C.mask||C);c.replaceState(j,"",N),i&&f&&f({action:u,location:b.location,delta:0})}function y(k){return dS(a,k)}let b={get action(){return u},get location(){return e(a,c)},listen(k){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(Yb,m),f=k,()=>{a.removeEventListener(Yb,m),f=null}},createHref(k){return t(a,k)},createURL:y,encodeLocation(k){let S=y(k);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:v,replace:w,go(k){return c.go(k)}};return b}function dS(e,t,n=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),rn(r,"No window.location.(origin|href) available to create URL");let a=typeof t=="string"?t:ls(t);return a=a.replace(/ $/,"%20"),!n&&up.test(a)&&(a=r+a),new URL(a,r)}var e0,Qb=class{constructor(e){if(Jd(this,e0,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(sa(this,e0).has(e))return sa(this,e0).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){sa(this,e0).set(e,t)}};e0=new WeakMap;var zL=new Set(["lazy","caseSensitive","path","id","index","children"]);function BL(e){return zL.has(e)}var UL=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function WL(e){return UL.has(e)}function KL(e){return e.index===!0}function b0(e,t,n=[],r={},a=!1){return e.map((i,c)=>{let u=[...n,String(c)],f=typeof i.id=="string"?i.id:u.join("-");if(rn(i.index!==!0||!i.children,"Cannot specify children on an index route"),rn(a||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),KL(i)){let h={...i,id:f};return r[f]=Jb(h,t(h)),h}else{let h={...i,id:f,children:void 0};return r[f]=Jb(h,t(h)),i.children&&(h.children=b0(i.children,t,u,r,a)),h}})}function Jb(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function fS(e,t,n="/"){return Na(e,t,n,!1)}function Na(e,t,n,r,a){let i=typeof t=="string"?wo(t):t,c=zs(i.pathname||"/",n);if(c==null)return null;let u=a??ih(e),f=null,h=wS(c);for(let p=0;f==null&&p<u.length;++p)f=rT(u[p],h,r);return f}function hS(e,t){let{route:n,pathname:r,params:a}=e;return{id:n.id,pathname:r,params:a,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function ih(e){let t=pS(e);return GL(t),t}function pS(e,t=[],n=[],r="",a=!1){let i=(c,u,f=a,h)=>{let p={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:u,route:c};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&f)return;rn(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let m=ua([r,p.relativePath]),v=n.concat(p);c.children&&c.children.length>0&&(rn(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),pS(c.children,t,v,m,f)),!(c.path==null&&!c.index)&&t.push({path:m,score:tT(m,c.index),routesMeta:v.map((w,y)=>{let[b,k]=vS(w.relativePath,w.caseSensitive,y===v.length-1);return{...w,matcher:b,compiledParams:k}})})};return e.forEach((c,u)=>{var f;if(c.path===""||!((f=c.path)!=null&&f.includes("?")))i(c,u);else for(let h of mS(c.path))i(c,u,!0,h)}),t}function mS(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let c=mS(r.join("/")),u=[];return u.push(...c.map(f=>f===""?i:[i,f].join("/"))),a&&u.push(...c),u.map(f=>e.startsWith("/")&&f===""?"/":f)}function GL(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:nT(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var YL=/^:[\w-]+$/,qL=3,XL=2,QL=1,JL=10,eT=-2,e3=e=>e==="*";function tT(e,t){let n=e.split("/"),r=n.length;return n.some(e3)&&(r+=eT),t&&(r+=XL),n.filter(a=>!e3(a)).reduce((a,i)=>a+(YL.test(i)?qL:i===""?QL:JL),r)}function nT(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function rT(e,t,n=!1){let{routesMeta:r}=e,a={},i="/",c=[];for(let u=0;u<r.length;++u){let f=r[u],h=u===r.length-1,p=i==="/"?t:t.slice(i.length)||"/",m={path:f.relativePath,caseSensitive:f.caseSensitive,end:h},v=f.matcher&&f.compiledParams?gS(m,p,f.matcher,f.compiledParams):Gi(m,p),w=f.route;if(!v&&h&&n&&!r[r.length-1].route.index&&(v=Gi({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},p)),!v)return null;Object.assign(a,v.params),c.push({params:a,pathname:ua([i,v.pathname]),pathnameBase:oT(ua([i,v.pathnameBase])),route:w}),v.pathnameBase!=="/"&&(i=ua([i,v.pathnameBase]))}return c}function us(e,t={}){let n=e;n.endsWith("*")&&n!=="*"&&!n.endsWith("/*")&&(qn(!1,`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`),n=n.replace(/\*$/,"/*"));const r=n.startsWith("/")?"/":"",a=c=>c==null?"":typeof c=="string"?c:String(c),i=n.split(/\/+/).map((c,u,f)=>{if(u===f.length-1&&c==="*")return a(t["*"]);const p=c.match(/^:([\w-]+)(\??)(.*)/);if(p){const[,m,v,w]=p;let y=t[m];return rn(v==="?"||y!=null,`Missing ":${m}" param`),encodeURIComponent(a(y))+w}return c.replace(/\?$/g,"")}).filter(c=>!!c);return r+i.join("/")}function Gi(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=vS(e.path,e.caseSensitive,e.end);return gS(e,t,n,r)}function gS(e,t,n,r){let a=t.match(n);if(!a)return null;let i=a[0],c=$u(i,1),u=a.slice(1);return{params:r.reduce((h,{paramName:p,isOptional:m},v)=>{if(p==="*"){let y=u[v]||"";c=$u(i.slice(0,i.length-y.length),1)}const w=u[v];return m&&!w?h[p]=void 0:h[p]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:i,pathnameBase:c,pattern:e}}function vS(e,t=!1,n=!0){qn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,u,f,h,p)=>{if(r.push({paramName:u,isOptional:f!=null}),f){let m=p.charAt(h+c.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function wS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return qn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function zs(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function sT({basename:e,pathname:t}){return t==="/"?e:ua([e,t])}var J6=e=>cp.test(e);function aT(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?wo(e):e,i;return n?(n=e4(n),n.startsWith("/")||n.startsWith("\\")?i=t3(n.substring(1),"/"):i=t3(n,t)):i=t,{pathname:i,search:iT(r),hash:lT(a)}}function t3(e,t){let n=$u(t).split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function rg(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function yS(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function dp(e){let t=yS(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function U0(e,t,n,r=!1){let a;typeof e=="string"?a=wo(e):(a={...e},rn(!a.pathname||!a.pathname.includes("?"),rg("?","pathname","search",a)),rn(!a.pathname||!a.pathname.includes("#"),rg("#","pathname","hash",a)),rn(!a.search||!a.search.includes("#"),rg("#","search","hash",a)));let i=e===""||a.pathname==="",c=i?"/":a.pathname,u;if(c==null)u=n;else{let m=t.length-1;if(!r&&c.startsWith("..")){let v=c.split("/");for(;v[0]==="..";)v.shift(),m-=1;a.pathname=v.join("/")}u=m>=0?t[m]:"/"}let f=aT(a,u),h=c&&c!=="/"&&c.endsWith("/"),p=(i||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||p)&&(f.pathname+="/"),f}var e4=e=>e.replace(/[\\/]{2,}/g,"/"),ua=e=>e4(e.join("/"));function $u(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var oT=e=>$u(e).replace(/^\/*/,"/"),iT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,lT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,cT=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],W0=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function x0(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function K0(e){let t=e.map(n=>n.route.path).filter(Boolean);return ua(t)||"/"}var bS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function xS(e,t){let n=e;if(typeof n!="string"||!cp.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(bS)try{let i=new URL(window.location.href),c=up.test(n)?new URL(uS(n,i.protocol)):new URL(n),u=zs(c.pathname,t);c.origin===i.origin&&u!=null?n=u+c.search+c.hash:a=!0}catch{qn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}var Ii=Symbol("Uninstrumented");function uT(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(a=>a({id:t.id,index:t.index,path:t.path,instrument(i){let c=Object.keys(n);for(let u of c)i[u]&&n[u].push(i[u])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let a=gu(n.lazy,t.lazy,()=>{});a&&(r.lazy=a)}if(typeof t.lazy=="object"){let a=t.lazy;["middleware","loader","action"].forEach(i=>{let c=a[i],u=n[`lazy.${i}`];if(typeof c=="function"&&u.length>0){let f=gu(u,c,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[i]:f}))}})}return["loader","action"].forEach(a=>{let i=t[a];if(typeof i=="function"&&n[a].length>0){let c=i[Ii]??i,u=gu(n[a],c,(...f)=>n3(f[0]));u&&(a==="loader"&&c.hydrate===!0&&(u.hydrate=!0),u[Ii]=c,r[a]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(a=>{let i=a[Ii]??a,c=gu(n.middleware,i,(...u)=>n3(u[0]));return c?(c[Ii]=i,c):a})),r}function dT(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(a){let i=Object.keys(a);for(let c of i)a[c]&&n[c].push(a[c])}})),n.navigate.length>0){let r=e.navigate[Ii]??e.navigate,a=gu(n.navigate,r,(...i)=>{let[c,u]=i;return{to:typeof c=="number"||typeof c=="string"?c:c?ls(c):".",...r3(e,u??{})}});a&&(a[Ii]=r,e.navigate=a)}if(n.fetch.length>0){let r=e.fetch[Ii]??e.fetch,a=gu(n.fetch,r,(...i)=>{let[c,,u,f]=i;return{href:u??".",fetcherKey:c,...r3(e,f??{})}});a&&(a[Ii]=r,e.fetch=a)}return e}function gu(e,t,n){return e.length===0?null:async(...r)=>{let a=await kS(e,n(...r),()=>t(...r),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function kS(e,t,n,r){let a=e[r],i;if(a){let c,u=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=kS(e,t,n,r-1),i=await c,rn(i,"Expected a result"),i.type==="error"&&i.value instanceof Error?{status:"error",error:i.value}:{status:"success",error:void 0});try{await a(u,t)}catch(f){console.error("An instrumentation function threw an error:",f)}c||await u(),await c}else try{i={type:"success",value:await n()}}catch(c){i={type:"error",value:c}}return i||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function n3(e){let{request:t,context:n,params:r,pattern:a}=e;return{request:fT(t),params:{...r},pattern:a,context:hT(n)}}function r3(e,t){return{currentUrl:ls(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function fT(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function hT(e){if(mT(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var pT=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function mT(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===pT}var s3=new URL("http://localhost");function t4(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),s3)}catch{return s3}}function sg(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function gT(e,t){if(e.startsWith("//"))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===""||e.slice(n.length).startsWith("//"):!1}function xu(e,t,n,r){let a=null;try{a=e==null?null:new URL(e,n)}catch{}let i=new URL(t,n),c=a!=null&&!sg(a,n),u=!sg(i,n);if(r==="reject"){if(c||u)throw new Error("External navigation is not allowed")}else if(u&&(a==null||!gT(e,a)||!sg(a,i)))throw new Error("External navigation is not allowed")}var SS=["POST","PUT","PATCH","DELETE"],vT=new Set(SS),wT=["GET",...SS],yT=new Set(wT),ES=new Set([301,302,303,307,308]),bT=new Set([307,308]),ag={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},xT={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Id={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},kT=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),CS="remix-router-transitions",jS=Symbol("ResetLoaderData"),Tl,lu,Ri,cu,ST=class{constructor(e){Jd(this,Tl),Jd(this,lu),Jd(this,Ri),Jd(this,cu),Xa(this,Tl,e),Xa(this,lu,ih(e))}get stableRoutes(){return sa(this,Tl)}get activeRoutes(){return sa(this,Ri)??sa(this,Tl)}get branches(){return sa(this,cu)??sa(this,lu)}get hasHMRRoutes(){return sa(this,Ri)!=null}setRoutes(e){Xa(this,Tl,e),Xa(this,lu,ih(e))}setHmrRoutes(e){Xa(this,Ri,e),Xa(this,cu,ih(e))}commitHmrRoutes(){sa(this,Ri)&&(Xa(this,Tl,sa(this,Ri)),Xa(this,lu,sa(this,cu)),Xa(this,Ri,void 0),Xa(this,cu,void 0))}};Tl=new WeakMap;lu=new WeakMap;Ri=new WeakMap;cu=new WeakMap;function ET(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";rn(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],a=e.mapRouteProperties||kT,i=a;if(e.instrumentations){let se=e.instrumentations;i=oe=>({...a(oe),...uT(se.map(we=>we.route).filter(Boolean),oe)})}let c={},u=new ST(b0(e.routes,i,void 0,c)),f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let h=e.dataStrategy||MT,p={...e.future},m=null,v=new Set,w=null,y=null,b=null,k=null,S=e.hydrationData!=null,C=Na(u.activeRoutes,e.history.location,f,!1,u.branches),j=!1,N=null,P,$;if(C==null&&!e.patchRoutesOnNavigation){let se=aa(404,{pathname:e.history.location.pathname}),{matches:oe,route:we}=P1(u.activeRoutes);P=!0,$=!P,C=oe,N={[we.id]:se}}else if(C&&!e.hydrationData&&dt(C,u.activeRoutes,e.history.location.pathname).active&&(C=null),C)if(C.some(se=>se.route.lazy))P=!1,$=!P;else if(!C.some(se=>n4(se.route)))P=!0,$=!P;else{let se=e.hydrationData?e.hydrationData.loaderData:null,oe=e.hydrationData?e.hydrationData.errors:null,we=C;if(oe){let ge=C.findIndex(ee=>oe[ee.route.id]!==void 0);we=we.slice(0,ge+1)}$=!1,P=!0,we.forEach(ge=>{let ee=AS(ge.route,se,oe);$=$||ee.renderFallback,P=P&&!ee.shouldLoad})}else{P=!1,$=!P,C=[];let se=dt(null,u.activeRoutes,e.history.location.pathname);se.active&&se.matches&&(j=!0,C=se.matches)}let R,E={historyAction:e.history.action,location:e.history.location,matches:C,initialized:P,renderFallback:$,navigation:ag,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||N,fetchers:new Map,blockers:new Map},M="POP",L=null,H=!1,D,K=!1,O=new Map,_=null,re=!1,z=!1,F=new Set,Q=new Map,V=0,I=-1,B=new Map,Y=new Set,ae=new Map,X=new Map,le=new Set,ke=new Map,te,be=null;function G(){if(m=e.history.listen(({action:se,location:oe,delta:we})=>{if(te){te(),te=void 0;return}qn(ke.size===0||we!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ge=Nt({currentLocation:E.location,nextLocation:oe,historyAction:se});if(ge&&we!=null){let ee=new Promise(He=>{te=He});e.history.go(we*-1),xt(ge,{state:"blocked",location:oe,proceed(){xt(ge,{state:"proceeding",proceed:void 0,reset:void 0,location:oe}),ee.then(()=>e.history.go(we))},reset(){let He=new Map(E.blockers);He.set(ge,Id),W({blockers:He})}}),L==null||L.resolve(),L=null;return}return ze(se,oe)}),n){GT(t,O);let se=()=>YT(t,O);t.addEventListener("pagehide",se),_=()=>t.removeEventListener("pagehide",se)}return E.initialized||ze("POP",E.location,{initialHydration:!0}),R}function J(){m&&m(),_&&_(),v.clear(),D&&D.abort(),E.fetchers.forEach((se,oe)=>Lt(E.fetchers,oe)),E.blockers.forEach((se,oe)=>St(oe))}function ne(se){if(v.add(se),w){let{newErrors:oe}=w;w=null,se(E,{deletedFetchers:[],newErrors:oe,viewTransitionOpts:void 0,flushSync:!1})}return()=>v.delete(se)}function W(se,oe={}){se.matches&&(se.matches=se.matches.map(ee=>{let He=c[ee.route.id],We=ee.route;return We.element!==He.element||We.errorElement!==He.errorElement||We.hydrateFallbackElement!==He.hydrateFallbackElement?{...ee,route:He}:ee})),E={...E,...se};let we=[],ge=[];E.fetchers.forEach((ee,He)=>{ee.state==="idle"&&(le.has(He)?we.push(He):ge.push(He))}),le.forEach(ee=>{!E.fetchers.has(ee)&&!Q.has(ee)&&we.push(ee)}),v.size===0&&(w={newErrors:se.errors??null}),[...v].forEach(ee=>ee(E,{deletedFetchers:we,newErrors:se.errors??null,viewTransitionOpts:oe.viewTransitionOpts,flushSync:oe.flushSync===!0})),we.forEach(ee=>Lt(E.fetchers,ee)),ge.forEach(ee=>E.fetchers.delete(ee))}function he(se,oe,{flushSync:we}={}){var _e,U;let ge=E.actionData!=null&&E.navigation.formMethod!=null&&Yr(E.navigation.formMethod)&&E.navigation.state==="loading"&&((_e=se.state)==null?void 0:_e._isRedirect)!==!0,ee;oe.actionData?Object.keys(oe.actionData).length>0?ee=oe.actionData:ee=null:ge?ee=E.actionData:ee=null;let He=oe.loaderData?p3(E.loaderData,oe.loaderData,oe.matches||[],oe.errors):E.loaderData,We=E.blockers;We.size>0&&(We=new Map(We),We.forEach((pe,Oe)=>We.set(Oe,Id)));let Ue=re?!1:kn(se,oe.matches||E.matches),Ge=H===!0||E.navigation.formMethod!=null&&Yr(E.navigation.formMethod)&&((U=se.state)==null?void 0:U._isRedirect)!==!0;u.commitHmrRoutes(),re||M==="POP"||(M==="PUSH"?e.history.push(se,se.state):M==="REPLACE"&&e.history.replace(se,se.state));let me;if(M==="POP"){let pe=O.get(E.location.pathname);pe&&pe.has(se.pathname)?me={currentLocation:E.location,nextLocation:se}:O.has(se.pathname)&&(me={currentLocation:se,nextLocation:E.location})}else if(K){let pe=O.get(E.location.pathname);pe?pe.add(se.pathname):(pe=new Set([se.pathname]),O.set(E.location.pathname,pe)),me={currentLocation:E.location,nextLocation:se}}W({...oe,actionData:ee,loaderData:He,historyAction:M,location:se,initialized:!0,renderFallback:!1,navigation:ag,revalidation:"idle",restoreScrollPosition:Ue,preventScrollReset:Ge,blockers:We},{viewTransitionOpts:me,flushSync:we===!0}),M="POP",H=!1,K=!1,re=!1,z=!1,L==null||L.resolve(),L=null,be==null||be.resolve(),be=null}async function Xe(se,oe){if(L==null||L.resolve(),L=null,typeof se=="number"){L||(L=w3());let Le=L.promise;return e.history.go(se),Le}let we=E8(E.location,E.matches,f,se,oe==null?void 0:oe.fromRouteId,oe==null?void 0:oe.relative),{path:ge,submission:ee,error:He}=a3(!1,we,oe),We;if(oe!=null&&oe.mask){let Le=typeof oe.mask=="string"?wo(oe.mask):{...E.location.mask,...oe.mask};if(We={pathname:Le.pathname??"",search:Le.search??"",hash:Le.hash??""},up.test(We.pathname))throw new Error("External navigation is not allowed");We.pathname.startsWith("\\")&&(We.pathname=We.pathname.replace(/^\\+/,"/")),xu(typeof oe.mask=="string"?oe.mask:ls(oe.mask),ls(We),e.history.createURL("/"),"reject")}let Ue=E.location,Ge=y0(Ue,ge,oe&&oe.state,void 0,We);Ge={...Ge,...e.history.encodeLocation(Ge)},xu(se==null?e.history.createHref(E.location):typeof se=="string"?se:ls(se),e.history.createHref(Ge.mask||Ge),e.history.createURL("/"),"reject");let me=oe&&oe.replace!=null?oe.replace:void 0,_e="PUSH";me===!0?_e="REPLACE":me===!1||ee!=null&&Yr(ee.formMethod)&&ee.formAction===E.location.pathname+E.location.search&&(_e="REPLACE");let U=oe&&"preventScrollReset"in oe?oe.preventScrollReset===!0:void 0,pe=(oe&&oe.flushSync)===!0,Oe=Nt({currentLocation:Ue,nextLocation:Ge,historyAction:_e});if(Oe){xt(Oe,{state:"blocked",location:Ge,proceed(){xt(Oe,{state:"proceeding",proceed:void 0,reset:void 0,location:Ge}),Xe(se,oe)},reset(){let Le=new Map(E.blockers);Le.set(Oe,Id),W({blockers:Le})}});return}await ze(_e,Ge,{submission:ee,pendingError:He,preventScrollReset:U,replace:oe&&oe.replace,enableViewTransition:oe&&oe.viewTransition,flushSync:pe,callSiteDefaultShouldRevalidate:oe&&oe.defaultShouldRevalidate})}function tt(){be||(be=w3()),Be(),W({revalidation:"loading"});let se=be.promise;return E.navigation.state==="submitting"?se:E.navigation.state==="idle"?(ze(E.historyAction,E.location,{startUninterruptedRevalidation:!0}),se):(ze(M||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation,enableViewTransition:K===!0}),se)}async function ze(se,oe,we){D&&D.abort(),D=null,M=se,re=(we&&we.startUninterruptedRevalidation)===!0,ot(E.location,E.matches),H=(we&&we.preventScrollReset)===!0,K=(we&&we.enableViewTransition)===!0;let ge=u.activeRoutes,ee=we!=null&&we.initialHydration&&E.matches&&E.matches.length>0&&!j?E.matches:Na(ge,oe,f,!1,u.branches),He=(we&&we.flushSync)===!0;if(ee&&E.initialized&&!z&&IT(E.location,oe)&&!(we&&we.submission&&Yr(we.submission.formMethod))){he(oe,{matches:ee},{flushSync:He});return}let We=dt(ee,ge,oe.pathname);if(We.active&&We.matches&&(ee=We.matches),!ee){let{error:vt,notFoundMatches:jt,route:st}=Kt(oe.pathname);he(oe,{matches:jt,loaderData:{},errors:{[st.id]:vt}},{flushSync:He});return}let Ue=we&&we.overrideNavigation?{...we.overrideNavigation,matches:ee,historyAction:se}:void 0;D=new AbortController;let Ge=uu(e.history,oe,D.signal,we&&we.submission),me=e.getContext?await e.getContext():new Qb,_e;if(we&&we.pendingError)_e=[Di(ee).route.id,{type:"error",error:we.pendingError}];else if(we&&we.submission&&Yr(we.submission.formMethod)){let vt=await nt(Ge,oe,we.submission,ee,se,me,We.active,we&&we.initialHydration===!0,{replace:we.replace,flushSync:He});if(vt.shortCircuited)return;if(vt.pendingActionResult){let[jt,st]=vt.pendingActionResult;if(Is(st)&&x0(st.error)&&st.error.status===404){D=null,he(oe,{matches:vt.matches,loaderData:{},errors:{[jt]:st.error}});return}}ee=vt.matches||ee,_e=vt.pendingActionResult,Ue=og(oe,ee,se,we.submission),He=!1,We.active=!1,Ge=uu(e.history,Ge.url,Ge.signal)}let{shortCircuited:U,matches:pe,loaderData:Oe,errors:Le,workingFetchers:bt}=await ce(Ge,oe,ee,se,me,We.active,Ue,we&&we.submission,we&&we.fetcherSubmission,we&&we.replace,we&&we.initialHydration===!0,He,_e,we&&we.callSiteDefaultShouldRevalidate);U||(D=null,he(oe,{matches:pe||ee,...m3(_e),loaderData:Oe,errors:Le,...bt?{fetchers:bt}:{}}))}async function nt(se,oe,we,ge,ee,He,We,Ue,Ge={}){Be();let me=WT(oe,ge,ee,we);if(W({navigation:me},{flushSync:Ge.flushSync===!0}),We){let pe=await Gt(ge,oe.pathname,se.signal);if(pe.type==="aborted")return{shortCircuited:!0};if(pe.type==="error"){if(pe.partialMatches.length===0){let{matches:Le,route:bt}=P1(u.activeRoutes);return{matches:Le,pendingActionResult:[bt.id,{type:"error",error:pe.error}]}}let Oe=Di(pe.partialMatches).route.id;return{matches:pe.partialMatches,pendingActionResult:[Oe,{type:"error",error:pe.error}]}}else if(pe.matches)ge=pe.matches;else{let{notFoundMatches:Oe,error:Le,route:bt}=Kt(oe.pathname);return{matches:Oe,pendingActionResult:[bt.id,{type:"error",error:Le}]}}}let _e,U=lh(ge,oe);if(!U.route.action&&!U.route.lazy)_e={type:"error",error:aa(405,{method:se.method,pathname:oe.pathname,routeId:U.route.id})};else{let pe=ku(i,c,se,oe,ge,U,Ue?[]:r,He),Oe=await Se(se,oe,pe,He,null);if(_e=Oe[U.route.id],!_e){for(let Le of ge)if(Oe[Le.route.id]){_e=Oe[Le.route.id];break}}if(se.signal.aborted)return{shortCircuited:!0}}if(Vl(_e)){let pe;return Ge&&Ge.replace!=null?pe=Ge.replace:pe=d3(_e.response.headers.get("Location"),new URL(se.url),f,e.history)===E.location.pathname+E.location.search,await ye(se,_e,!0,{submission:we,replace:pe}),{shortCircuited:!0}}if(Is(_e)){let pe=Di(ge,U.route.id);return(Ge&&Ge.replace)!==!0&&(M="PUSH"),{matches:ge,pendingActionResult:[pe.route.id,_e,U.route.id]}}return{matches:ge,pendingActionResult:[U.route.id,_e]}}async function ce(se,oe,we,ge,ee,He,We,Ue,Ge,me,_e,U,pe,Oe){let Le=We||og(oe,we,ge,Ue),bt=Ue||Ge||v3(Le),vt=!re&&!_e;if(He){if(vt){let wn=ve(pe);W({navigation:Le,...wn!==void 0?{actionData:wn}:{}},{flushSync:U})}let Wt=await Gt(we,oe.pathname,se.signal);if(Wt.type==="aborted")return{shortCircuited:!0};if(Wt.type==="error"){if(Wt.partialMatches.length===0){let{matches:sn,route:In}=P1(u.activeRoutes);return{matches:sn,loaderData:{},errors:{[In.id]:Wt.error}}}let wn=Di(Wt.partialMatches).route.id;return{matches:Wt.partialMatches,loaderData:{},errors:{[wn]:Wt.error}}}else if(Wt.matches)we=Wt.matches;else{let{error:wn,notFoundMatches:sn,route:In}=Kt(oe.pathname);return{matches:sn,loaderData:{},errors:{[In.id]:wn}}}}let jt=u.activeRoutes,{dsMatches:st,revalidatingFetchers:$t}=o3(se,ee,i,c,e.history,E,we,bt,oe,_e?[]:r,_e===!0,z,F,le,ae,Y,jt,f,e.patchRoutesOnNavigation!=null,u.branches,pe,Oe);if(I=++V,!e.dataStrategy&&!st.some(Wt=>Wt.shouldLoad)&&!st.some(Wt=>Wt.route.middleware&&Wt.route.middleware.length>0)&&$t.length===0){let Wt=new Map(E.fetchers),wn=Fe(Wt);return he(oe,{matches:we,loaderData:{},errors:pe&&Is(pe[1])?{[pe[0]]:pe[1].error}:null,...m3(pe),...wn?{fetchers:Wt}:{}},{flushSync:U}),{shortCircuited:!0}}if(vt){let Wt={};if(!He){Wt.navigation=Le;let wn=ve(pe);wn!==void 0&&(Wt.actionData=wn)}$t.length>0&&(Wt.fetchers=Pe($t)),W(Wt,{flushSync:U})}$t.forEach(Wt=>{Ct(Wt.key),Wt.controller&&Q.set(Wt.key,Wt.controller)});let An=()=>$t.forEach(Wt=>Ct(Wt.key));D&&D.signal.addEventListener("abort",An);let{loaderResults:q,fetcherResults:fe}=await Ie(st,$t,se,oe,ee);if(se.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",An),$t.forEach(Wt=>Q.delete(Wt.key));let Ae=L1(q);if(Ae)return await ye(se,Ae.result,!0,{replace:me}),{shortCircuited:!0};if(Ae=L1(fe),Ae)return Y.add(Ae.key),await ye(se,Ae.result,!0,{replace:me}),{shortCircuited:!0};let Ye=new Map(E.fetchers),{loaderData:ft,errors:wt}=h3(E,we,q,pe,$t,fe,Ye);_e&&E.errors&&(wt={...E.errors,...wt});let Zt=Fe(Ye),Ht=mt(I,Ye),pn=Zt||Ht||$t.length>0;return{matches:we,loaderData:ft,errors:wt,...pn?{workingFetchers:Ye}:{}}}function ve(se){if(se&&!Is(se[1]))return{[se[0]]:se[1].data};if(E.actionData)return Object.keys(E.actionData).length===0?null:E.actionData}function Pe(se){let oe=new Map(E.fetchers);return se.forEach(we=>{let ge=oe.get(we.key),ee=Fd(void 0,ge?ge.data:void 0);oe.set(we.key,ee)}),oe}async function ue(se,oe,we,ge){Ct(se);let ee=(ge&&ge.flushSync)===!0,He=u.activeRoutes,We=E8(E.location,E.matches,f,we,oe,ge==null?void 0:ge.relative),Ue=Na(He,We,f,!1,u.branches),Ge=dt(Ue,He,We);if(Ge.active&&Ge.matches&&(Ue=Ge.matches),!Ue){Ze(se,oe,aa(404,{pathname:We}),{flushSync:ee});return}let{path:me,submission:_e,error:U}=a3(!0,We,ge);if(U){Ze(se,oe,U,{flushSync:ee});return}let pe=e.getContext?await e.getContext():new Qb,Oe=(ge&&ge.preventScrollReset)===!0;if(_e&&Yr(_e.formMethod)){await Ee(se,oe,me,Ue,pe,Ge.active,ee,Oe,_e,ge&&ge.defaultShouldRevalidate);return}ae.set(se,{routeId:oe,path:me}),await Ke(se,oe,me,Ue,pe,Ge.active,ee,Oe,_e)}async function Ee(se,oe,we,ge,ee,He,We,Ue,Ge,me){Be(),ae.delete(se);let _e=E.fetchers.get(se);Re(se,KT(Ge,_e),{flushSync:We});let U=new AbortController,pe=uu(e.history,we,U.signal,Ge);if(He){let Et=await Gt(ge,new URL(pe.url).pathname,pe.signal,se);if(Et.type==="aborted")return;if(Et.type==="error"){Ze(se,oe,Et.error,{flushSync:We});return}else if(Et.matches)ge=Et.matches;else{Ze(se,oe,aa(404,{pathname:we}),{flushSync:We});return}}let Oe=lh(ge,we);if(!Oe.route.action&&!Oe.route.lazy){let Et=aa(405,{method:Ge.formMethod,pathname:we,routeId:oe});Ze(se,oe,Et,{flushSync:We});return}Q.set(se,U);let Le=V,bt=ku(i,c,pe,we,ge,Oe,r,ee),vt=await Se(pe,we,bt,ee,se),jt=vt[Oe.route.id];if(!jt){for(let Et of bt)if(vt[Et.route.id]){jt=vt[Et.route.id];break}}if(pe.signal.aborted){Q.get(se)===U&&Q.delete(se);return}if(le.has(se)){if(Vl(jt)||Is(jt)){Re(se,to(void 0));return}}else{if(Vl(jt))if(Q.delete(se),I>Le){Re(se,to(void 0));return}else return Y.add(se),Re(se,Fd(Ge)),ye(pe,jt,!1,{fetcherSubmission:Ge,preventScrollReset:Ue});if(Is(jt)){Ze(se,oe,jt.error);return}}let st=E.navigation.location||E.location,$t=uu(e.history,st,U.signal),An=u.activeRoutes,q=E.navigation.state!=="idle"?Na(An,E.navigation.location,f,!1,u.branches):E.matches;rn(q,"Didn't find any matches after fetcher action");let fe=++V;B.set(se,fe);let{dsMatches:Ae,revalidatingFetchers:Ye}=o3($t,ee,i,c,e.history,E,q,Ge,st,r,!1,z,F,le,ae,Y,An,f,e.patchRoutesOnNavigation!=null,u.branches,[Oe.route.id,jt],me),ft=Fd(Ge,jt.data),wt=new Map(E.fetchers);wt.set(se,ft),Ye.filter(Et=>Et.key!==se).forEach(Et=>{let Hn=Et.key,Ot=wt.get(Hn),tn=Fd(void 0,Ot?Ot.data:void 0);wt.set(Hn,tn),Ct(Hn),Et.controller&&Q.set(Hn,Et.controller)}),W({fetchers:wt});let Zt=()=>Ye.forEach(Et=>Ct(Et.key));U.signal.addEventListener("abort",Zt);let{loaderResults:Ht,fetcherResults:pn}=await Ie(Ae,Ye,$t,st,ee);if(U.signal.aborted)return;U.signal.removeEventListener("abort",Zt),B.delete(se),Q.delete(se),Ye.forEach(Et=>Q.delete(Et.key));let Wt=E.fetchers.has(se),wn=Et=>{if(!Wt)return Et;let Hn=new Map(Et.fetchers);return Hn.set(se,to(jt.data)),{...Et,fetchers:Hn}},sn=L1(Ht);if(sn)return E=wn(E),ye($t,sn.result,!1,{preventScrollReset:Ue});if(sn=L1(pn),sn)return Y.add(sn.key),E=wn(E),ye($t,sn.result,!1,{preventScrollReset:Ue});let In=new Map(E.fetchers);Wt&&In.set(se,to(jt.data));let{loaderData:Dt,errors:On}=h3(E,q,Ht,void 0,Ye,pn,In);mt(fe,In),E.navigation.state==="loading"&&fe>I?(rn(M,"Expected pending action"),D&&D.abort(),he(E.navigation.location,{matches:q,loaderData:Dt,errors:On,fetchers:In})):(W({errors:On,loaderData:p3(E.loaderData,Dt,q,On),fetchers:In}),z=!1)}async function Ke(se,oe,we,ge,ee,He,We,Ue,Ge){let me=E.fetchers.get(se);Re(se,Fd(Ge,me?me.data:void 0),{flushSync:We});let _e=new AbortController,U=uu(e.history,we,_e.signal);if(He){let jt=await Gt(ge,new URL(U.url).pathname,U.signal,se);if(jt.type==="aborted")return;if(jt.type==="error"){Ze(se,oe,jt.error,{flushSync:We});return}else if(jt.matches)ge=jt.matches;else{Ze(se,oe,aa(404,{pathname:we}),{flushSync:We});return}}let pe=lh(ge,we);Q.set(se,_e);let Oe=V,Le=ku(i,c,U,we,ge,pe,r,ee),bt=await Se(U,we,Le,ee,se),vt=bt[pe.route.id];if(!vt){for(let jt of ge)if(bt[jt.route.id]){vt=bt[jt.route.id];break}}if(Q.get(se)===_e&&Q.delete(se),!U.signal.aborted){if(le.has(se)){Re(se,to(void 0));return}if(Vl(vt))if(I>Oe){Re(se,to(void 0));return}else{Y.add(se),await ye(U,vt,!1,{preventScrollReset:Ue});return}if(Is(vt)){Ze(se,oe,vt.error);return}Re(se,to(vt.data))}}async function ye(se,oe,we,{submission:ge,fetcherSubmission:ee,preventScrollReset:He,replace:We}={}){we||(L==null||L.resolve(),L=null),oe.response.headers.has("X-Remix-Revalidate")&&(z=!0);let Ue=oe.response.headers.get("Location");rn(Ue,"Expected a Location header on the redirect Response");let Ge=Ue,me=new URL(se.url);Ue=d3(Ue,me,f,e.history),xu(Ge,Ue,me,"allow-explicit");let _e=y0(E.location,Ue,{_isRedirect:!0});if(n){let vt=!1;if(oe.response.headers.has("X-Remix-Reload-Document"))vt=!0;else if(J6(Ue)){const jt=dS(t,Ue,!0);vt=jt.origin!==t.location.origin||zs(jt.pathname,f)==null}if(vt){We?t.location.replace(Ue):t.location.assign(Ue);return}}D=null;let U=We===!0||oe.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:pe,formAction:Oe,formEncType:Le}=E.navigation;!ge&&!ee&&pe&&Oe&&Le&&(ge=v3(E.navigation));let bt=ge||ee;if(bT.has(oe.response.status)&&bt&&Yr(bt.formMethod))await ze(U,_e,{submission:{...bt,formAction:Ue},preventScrollReset:He||H,enableViewTransition:we?K:void 0});else{let vt=og(_e,[],U,ge);await ze(U,_e,{overrideNavigation:vt,fetcherSubmission:ee,preventScrollReset:He||H,enableViewTransition:we?K:void 0})}}async function Se(se,oe,we,ge,ee){var Ue;let He,We={};try{He=await PT(h,se,oe,we,ee,ge,!1)}catch(Ge){return we.filter(me=>me.shouldLoad).forEach(me=>{We[me.route.id]={type:"error",error:Ge}}),We}if(se.signal.aborted)return We;if(!Yr(se.method))for(let Ge of we){if(((Ue=He[Ge.route.id])==null?void 0:Ue.type)==="error")break;!He.hasOwnProperty(Ge.route.id)&&!E.loaderData.hasOwnProperty(Ge.route.id)&&(!E.errors||!E.errors.hasOwnProperty(Ge.route.id))&&Ge.shouldCallHandler()&&(He[Ge.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Ge.route.id}`)})}for(let[Ge,me]of Object.entries(He))if(VT(me)){let _e=me.result;We[Ge]={type:"redirect",response:DT(_e,se,Ge,we,f)}}else We[Ge]=await $T(me);return We}async function Ie(se,oe,we,ge,ee){let He=Se(we,ge,se,ee,null),We=Promise.all(oe.map(async me=>{if(me.matches&&me.match&&me.request&&me.controller){let U=(await Se(me.request,me.path,me.matches,ee,me.key))[me.match.route.id];return{[me.key]:U}}else return Promise.resolve({[me.key]:{type:"error",error:aa(404,{pathname:me.path})}})})),Ue=await He,Ge=(await We).reduce((me,_e)=>Object.assign(me,_e),{});return{loaderResults:Ue,fetcherResults:Ge}}function Be(){z=!0,ae.forEach((se,oe)=>{Q.has(oe)&&F.add(oe),Ct(oe)})}function Re(se,oe,we={}){let ge=new Map(E.fetchers);ge.set(se,oe),W({fetchers:ge},{flushSync:(we&&we.flushSync)===!0})}function Ze(se,oe,we,ge={}){let ee=Di(E.matches,oe),He=new Map(E.fetchers);Lt(He,se),W({errors:{[ee.route.id]:we},fetchers:He},{flushSync:(ge&&ge.flushSync)===!0})}function Qe(se){return X.set(se,(X.get(se)||0)+1),le.has(se)&&le.delete(se),E.fetchers.get(se)||xT}function lt(se,oe){Ct(se,oe==null?void 0:oe.reason),Re(se,to(null))}function Lt(se,oe){let we=E.fetchers.get(oe);Q.has(oe)&&!(we&&we.state==="loading"&&B.has(oe))&&Ct(oe),ae.delete(oe),B.delete(oe),Y.delete(oe),le.delete(oe),F.delete(oe),se.delete(oe)}function Ut(se){let oe=(X.get(se)||0)-1;oe<=0?(X.delete(se),le.add(se)):X.set(se,oe),W({fetchers:new Map(E.fetchers)})}function Ct(se,oe){let we=Q.get(se);we&&(we.abort(oe),Q.delete(se))}function cn(se,oe){for(let we of se){let ge=oe.get(we);rn(ge,`Expected fetcher: ${we}`);let ee=to(ge.data);oe.set(we,ee)}}function Fe(se){let oe=[],we=!1;for(let ge of Y){let ee=se.get(ge);rn(ee,`Expected fetcher: ${ge}`),ee.state==="loading"&&(Y.delete(ge),oe.push(ge),we=!0)}return cn(oe,se),we}function mt(se,oe){let we=[];for(let[ge,ee]of B)if(ee<se){let He=oe.get(ge);rn(He,`Expected fetcher: ${ge}`),He.state==="loading"&&(Ct(ge),B.delete(ge),we.push(ge))}return cn(we,oe),we.length>0}function it(se,oe){let we=E.blockers.get(se)||Id;return ke.get(se)!==oe&&ke.set(se,oe),we}function St(se){E.blockers.delete(se),ke.delete(se)}function xt(se,oe){let we=E.blockers.get(se)||Id;rn(we.state==="unblocked"&&oe.state==="blocked"||we.state==="blocked"&&oe.state==="blocked"||we.state==="blocked"&&oe.state==="proceeding"||we.state==="blocked"&&oe.state==="unblocked"||we.state==="proceeding"&&oe.state==="unblocked",`Invalid blocker state transition: ${we.state} -> ${oe.state}`);let ge=new Map(E.blockers);ge.set(se,oe),W({blockers:ge})}function Nt({currentLocation:se,nextLocation:oe,historyAction:we}){if(ke.size===0)return;ke.size>1&&qn(!1,"A router only supports one blocker at a time");let ge=Array.from(ke.entries()),[ee,He]=ge[ge.length-1],We=E.blockers.get(ee);if(!(We&&We.state==="proceeding")&&He({currentLocation:se,nextLocation:oe,historyAction:we}))return ee}function Kt(se){let oe=aa(404,{pathname:se}),we=u.activeRoutes,{matches:ge,route:ee}=P1(we);return{notFoundMatches:ge,route:ee,error:oe}}function et(se,oe,we){if(y=se,k=oe,b=we||null,!S&&E.navigation===ag){S=!0;let ge=kn(E.location,E.matches);ge!=null&&W({restoreScrollPosition:ge})}return()=>{y=null,k=null,b=null}}function gt(se,oe){return b&&b(se,oe.map(ge=>hS(ge,E.loaderData)))||se.key}function ot(se,oe){if(y&&k){let we=gt(se,oe);y[we]=k()}}function kn(se,oe){if(y){let we=gt(se,oe),ge=y[we];if(typeof ge=="number")return ge}return null}function dt(se,oe,we){if(e.patchRoutesOnNavigation){let ge=u.branches;if(se){if(Object.keys(se[0].params).length>0)return{active:!0,matches:Na(oe,we,f,!0,ge)}}else return{active:!0,matches:Na(oe,we,f,!0,ge)||[]}}return{active:!1,matches:null}}async function Gt(se,oe,we,ge){if(!e.patchRoutesOnNavigation)return{type:"success",matches:se};let ee=se;for(;;){let He=c;try{await e.patchRoutesOnNavigation({signal:we,path:oe,matches:ee,fetcherKey:ge,patch:(me,_e)=>{we.aborted||i3(me,_e,u,He,i,!1)}})}catch(me){return{type:"error",error:me,partialMatches:ee}}if(we.aborted)return{type:"aborted"};let We=u.branches,Ue=Na(u.activeRoutes,oe,f,!1,We),Ge=null;if(Ue){if(Object.keys(Ue[0].params).length===0)return{type:"success",matches:Ue};if(Ge=Na(u.activeRoutes,oe,f,!0,We),!(Ge&&ee.length<Ge.length&&Ft(ee,Ge.slice(0,ee.length))))return{type:"success",matches:Ue}}if(Ge||(Ge=Na(u.activeRoutes,oe,f,!0,We)),!Ge||Ft(ee,Ge))return{type:"success",matches:null};ee=Ge}}function Ft(se,oe){return se.length===oe.length&&se.every((we,ge)=>we.route.id===oe[ge].route.id)}function en(se){c={},u.setHmrRoutes(b0(se,i,void 0,c))}function Jt(se,oe,we=!1){i3(se,oe,u,c,i,we),u.hasHMRRoutes||W({})}return R={get basename(){return f},get future(){return p},get state(){return E},get routes(){return u.stableRoutes},get branches(){return u.branches},get manifest(){return c},get window(){return t},initialize:G,subscribe:ne,enableScrollRestoration:et,navigate:Xe,fetch:ue,revalidate:tt,createHref:se=>e.history.createHref(se),createURL:se=>e.history.createURL(se),encodeLocation:se=>e.history.encodeLocation(se),getFetcher:Qe,resetFetcher:lt,deleteFetcher:Ut,dispose:J,getBlocker:it,deleteBlocker:St,patchRoutes:Jt,_internalFetchControllers:Q,_internalSetRoutes:en,_internalSetStateDoNotUseOrYouWillBreakYourApp(se){W(se)}},e.instrumentations&&(R=dT(R,e.instrumentations.map(se=>se.router).filter(Boolean))),R}function CT(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function E8(e,t,n,r,a,i){let c,u;if(a){c=[];for(let h of t)if(c.push(h),h.route.id===a){u=h;break}}else c=t,u=t[t.length-1];let f=U0(r||".",dp(c),zs(e.pathname,n)||e.pathname,i==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&u){let h=s4(f.search);if(u.route.index&&!h)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&h){let p=new URLSearchParams(f.search),m=p.getAll("index");p.delete("index"),m.filter(w=>w).forEach(w=>p.append("index",w));let v=p.toString();f.search=v?`?${v}`:""}}return n!=="/"&&(f.pathname=sT({basename:n,pathname:f.pathname})),ls(f)}function a3(e,t,n){if(!n||!CT(n))return{path:t};if(n.formMethod&&!UT(n.formMethod))return{path:t,error:aa(405,{method:n.formMethod})};let r=()=>({path:t,error:aa(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),c=$S(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Yr(i))return r();let m=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((v,[w,y])=>`${v}${w}=${y}
|
|
50
|
-
`,""):String(n.body);return{path:t,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:m}}}else if(n.formEncType==="application/json"){if(!Yr(i))return r();try{let m=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:m,text:void 0}}}catch{return r()}}}rn(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=A8(n.formData),f=n.formData;else if(n.body instanceof FormData)u=A8(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=f3(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=f3(u)}catch{return r()}let h={formMethod:i,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(Yr(h.formMethod))return{path:t,submission:h};let p=wo(t);return e&&p.search&&s4(p.search)&&u.append("index",""),p.search=`?${u}`,{path:ls(p),submission:h}}function o3(e,t,n,r,a,i,c,u,f,h,p,m,v,w,y,b,k,S,C,j,N,P){var re;let $=N?Is(N[1])?N[1].error:N[1].data:void 0,R=a.createURL(i.location),E=a.createURL(f),M;if(p&&i.errors){let z=Object.keys(i.errors)[0];M=c.findIndex(F=>F.route.id===z)}else if(N&&Is(N[1])){let z=N[0];M=c.findIndex(F=>F.route.id===z)-1}let L=N?N[1].statusCode:void 0,H=L&&L>=400,D={currentUrl:R,currentParams:((re=i.matches[0])==null?void 0:re.params)||{},nextUrl:E,nextParams:c[0].params,...u,actionResult:$,actionStatus:L},K=K0(c),O=c.map((z,F)=>{let{route:Q}=z,V=null;if(M!=null&&F>M)V=!1;else if(Q.lazy)V=!0;else if(!n4(Q))V=!1;else if(p){let{shouldLoad:ae}=AS(Q,i.loaderData,i.errors);V=ae}else jT(i.loaderData,i.matches[F],z)&&(V=!0);if(V!==null)return C8(n,r,e,f,K,z,h,t,V);let I=!1;typeof P=="boolean"?I=P:H?I=!1:(m||R.pathname+R.search===E.pathname+E.search||R.search!==E.search||AT(i.matches[F],z))&&(I=!0);let B={...D,defaultShouldRevalidate:I},Y=u0(z,B);return C8(n,r,e,f,K,z,h,t,Y,B,P)}),_=[];return y.forEach((z,F)=>{if(p||!c.some(le=>le.route.id===z.routeId)||w.has(F))return;let Q=i.fetchers.get(F),V=Q&&Q.state!=="idle"&&Q.data===void 0,I=Na(k,z.path,S??"/",!1,j);if(!I){if(C&&V)return;_.push({key:F,routeId:z.routeId,path:z.path,matches:null,match:null,request:null,controller:null});return}if(b.has(F))return;let B=lh(I,z.path),Y=new AbortController,ae=uu(a,z.path,Y.signal),X=null;if(v.has(F))v.delete(F),X=ku(n,r,ae,z.path,I,B,h,t);else if(V)m&&(X=ku(n,r,ae,z.path,I,B,h,t));else{let le;typeof P=="boolean"?le=P:H?le=!1:le=m;let ke={...D,defaultShouldRevalidate:le};u0(B,ke)&&(X=ku(n,r,ae,z.path,I,B,h,t,ke))}X&&_.push({key:F,routeId:z.routeId,path:z.path,matches:X,match:B,request:ae,controller:Y})}),{dsMatches:O,revalidatingFetchers:_}}function n4(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function AS(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!n4(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,a=n!=null&&n[e.id]!==void 0;if(!r&&a)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let i=!r&&!a;return{shouldLoad:i,renderFallback:i}}function jT(e,t,n){let r=!t||n.route.id!==t.route.id,a=!e.hasOwnProperty(n.route.id);return r||a}function AT(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function u0(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function i3(e,t,n,r,a,i){let c;if(e){let h=r[e];rn(h,`No route found to patch children into: routeId = ${e}`),h.children||(h.children=[]),c=h.children}else c=n.activeRoutes;let u=[],f=[];if(t.forEach(h=>{let p=c.find(m=>NS(h,m));p?f.push({existingRoute:p,newRoute:h}):u.push(h)}),u.length>0){let h=b0(u,a,[e||"_","patch",String((c==null?void 0:c.length)||"0")],r);c.push(...h)}if(i&&f.length>0)for(let h=0;h<f.length;h++){let{existingRoute:p,newRoute:m}=f[h],v=p,[w]=b0([m],a,[],{},!0);Object.assign(v,{element:w.element?w.element:v.element,errorElement:w.errorElement?w.errorElement:v.errorElement,hydrateFallbackElement:w.hydrateFallbackElement?w.hydrateFallbackElement:v.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function NS(e,t){var n;return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:((n=e.children)==null?void 0:n.every((r,a)=>{var i;return(i=t.children)==null?void 0:i.some(c=>NS(r,c))}))??!1:!1}var l3=new WeakMap,MS=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let a=n[t.id];if(rn(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let i=a.lazy[e];if(!i)return;let c=l3.get(a);c||(c={},l3.set(a,c));let u=c[e];if(u)return u;let f=(async()=>{let h=BL(e),m=a[e]!==void 0&&e!=="hasErrorBoundary";if(h)qn(!h,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(m)qn(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let v=await i();v!=null&&(Object.assign(a,{[e]:v}),Object.assign(a,r(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(v=>v===void 0)&&(a.lazy=void 0))})();return c[e]=f,f},c3=new WeakMap;function NT(e,t,n,r,a){let i=n[e.id];if(rn(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let p=c3.get(i);if(p)return{lazyRoutePromise:p,lazyHandlerPromise:p};let m=(async()=>{rn(typeof e.lazy=="function","No lazy route function found");let v=await e.lazy(),w={};for(let y in v){let b=v[y];if(b===void 0)continue;let k=WL(y),C=i[y]!==void 0&&y!=="hasErrorBoundary";k?qn(!k,"Route property "+y+" is not a supported property to be returned from a lazy route function. This property will be ignored."):C?qn(!C,`Route "${i.id}" has a static property "${y}" defined but its lazy function is also returning a value for this property. The lazy route property "${y}" will be ignored.`):w[y]=b}Object.assign(i,w),Object.assign(i,{...r(i),lazy:void 0})})();return c3.set(i,m),m.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:m}}let c=Object.keys(e.lazy),u=[],f;for(let p of c){if(a&&a.includes(p))continue;let m=MS({key:p,route:e,manifest:n,mapRouteProperties:r});m&&(u.push(m),p===t&&(f=m))}let h=u.length>0?Promise.all(u).then(()=>{}):void 0;return h==null||h.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:f}}async function u3(e){let t=e.matches.filter(a=>a.shouldLoad),n={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,i)=>{n[t[i].route.id]=a}),n}async function MT(e){return e.matches.some(t=>t.route.middleware)?RS(e,()=>u3(e)):u3(e)}function RS(e,t){return RT(e,t,r=>{if(BT(r))throw r;return r},_T,n);function n(r,a,i){if(i)return Promise.resolve(Object.assign(i.value,{[a]:{type:"error",result:r}}));{let{matches:c}=e,u=Math.min(Math.max(c.findIndex(h=>h.route.id===a),0),Math.max(c.findIndex(h=>h.shouldCallHandler()),0)),f=Di(c,c[u].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function RT(e,t,n,r,a){let{matches:i,...c}=e,u=i.flatMap(h=>h.route.middleware?h.route.middleware.map(p=>[h.route.id,p]):[]);return await PS(c,u,t,n,r,a)}async function PS(e,t,n,r,a,i,c=0){let{request:u}=e;if(u.signal.aborted)throw u.signal.reason??new Error(`Request aborted: ${u.method} ${u.url}`);let f=t[c];if(!f)return await n();let[h,p]=f,m,v=async()=>{if(m)throw new Error("You may only call `next()` once per middleware");try{return m={value:await PS(e,t,n,r,a,i,c+1)},m.value}catch(w){return m={value:await i(w,h,m)},m.value}};try{let w=await p(e,v),y=w!=null?r(w):void 0;return a(y)?y:m?y??m.value:(m={value:await v()},m.value)}catch(w){return await i(w,h,m)}}function LS(e,t,n,r,a){let i=MS({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=NT(r.route,Yr(n.method)?"action":"loader",t,e,a);return{middleware:i,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function C8(e,t,n,r,a,i,c,u,f,h=null,p){let m=!1,v=LS(e,t,n,i,c);return{...i,_lazyPromises:v,shouldLoad:f,shouldRevalidateArgs:h,shouldCallHandler(w){return m=!0,h?typeof p=="boolean"?u0(i,{...h,defaultShouldRevalidate:p}):typeof w=="boolean"?u0(i,{...h,defaultShouldRevalidate:w}):u0(i,h):f},resolve(w){let{lazy:y,loader:b,middleware:k}=i.route,S=m||f||w&&!Yr(n.method)&&(y||b),C=k&&k.length>0&&!b&&!y;return S&&(Yr(n.method)||!C)?LT({request:n,path:r,pattern:a,match:i,lazyHandlerPromise:v==null?void 0:v.handler,lazyRoutePromise:v==null?void 0:v.route,handlerOverride:w,scopedContext:u}):Promise.resolve({type:"data",result:void 0})}}}function ku(e,t,n,r,a,i,c,u,f=null){return a.map(h=>h.route.id!==i.route.id?{...h,shouldLoad:!1,shouldRevalidateArgs:f,shouldCallHandler:()=>!1,_lazyPromises:LS(e,t,n,h,c),resolve:()=>Promise.resolve({type:"data",result:void 0})}:C8(e,t,n,r,K0(a),h,c,u,!0,f))}async function PT(e,t,n,r,a,i,c){r.some(p=>{var m;return(m=p._lazyPromises)==null?void 0:m.middleware})&&await Promise.all(r.map(p=>{var m;return(m=p._lazyPromises)==null?void 0:m.middleware}));let u={request:t,url:TS(t,n),pattern:K0(r),params:r[0].params,context:i,matches:r},h=await e({...u,fetcherKey:a,runClientMiddleware:p=>{let m=u;return RS(m,()=>p({...m,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(p=>{var m,v;return[(m=p._lazyPromises)==null?void 0:m.handler,(v=p._lazyPromises)==null?void 0:v.route]}))}catch{}return h}async function LT({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:a,lazyRoutePromise:i,handlerOverride:c,scopedContext:u}){let f,h,p=Yr(e.method),m=p?"action":"loader",v=w=>{let y,b=new Promise((C,j)=>y=j);h=()=>y(),e.signal.addEventListener("abort",h);let k=C=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${r.route.id}]`)):w({request:e,url:TS(e,t),pattern:n,params:r.params,context:u},...C!==void 0?[C]:[]),S=(async()=>{try{return{type:"data",result:await(c?c(j=>k(j)):k())}}catch(C){return{type:"error",result:C}}})();return Promise.race([S,b])};try{let w=p?r.route.action:r.route.loader;if(a||i)if(w){let y,[b]=await Promise.all([v(w).catch(k=>{y=k}),a,i]);if(y!==void 0)throw y;f=b}else{await a;let y=p?r.route.action:r.route.loader;if(y)[f]=await Promise.all([v(y),i]);else if(m==="action"){let b=new URL(e.url),k=b.pathname+b.search;throw aa(405,{method:e.method,pathname:k,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(w)f=await v(w);else{let y=new URL(e.url),b=y.pathname+y.search;throw aa(404,{pathname:b})}}catch(w){return{type:"error",result:w}}finally{h&&e.signal.removeEventListener("abort",h)}return f}async function TT(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function $T(e){var r,a,i,c,u;let{result:t,type:n}=e;if(r4(t)){let f;try{f=await TT(t)}catch(h){return{type:"error",error:h}}return n==="error"?{type:"error",error:new W0(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:"data",data:f,statusCode:t.status,headers:t.headers}}return n==="error"?g3(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:FT(t),statusCode:x0(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:x0(t)?t.status:void 0}:g3(t)?{type:"data",data:t.data,statusCode:(c=t.init)==null?void 0:c.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function DT(e,t,n,r,a){let i=e.headers.get("Location");if(rn(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!J6(i)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);i=E8(new URL(t.url),c,a,i),e.headers.set("Location",i)}return e}var HT=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function j8(e){try{return HT.includes(new URL(e).protocol)}catch{return!1}}function d3(e,t,n,r){if(J6(e)){let a=e,i=up.test(a)?new URL(uS(a,t.protocol)):new URL(a);if(j8(i.toString()))throw new Error("Invalid redirect location");let c=zs(i.pathname,n)!=null;if(i.origin===t.origin&&c)return e4(i.pathname)+i.search+i.hash}try{let a=r.createURL(e);if(j8(a.toString()))throw new Error("Invalid redirect location")}catch{}return e}function uu(e,t,n,r){let a=e.createURL($S(t)).toString(),i={signal:n};if(r&&Yr(r.formMethod)){let{formMethod:c,formEncType:u}=r;i.method=c.toUpperCase(),u==="application/json"?(i.headers=new Headers({"Content-Type":u}),i.body=JSON.stringify(r.json)):u==="text/plain"?i.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?i.body=A8(r.formData):i.body=r.formData}return new Request(a,i)}function TS(e,t){let n=new URL(e.url),r=typeof t=="string"?wo(t):t;if(n.pathname=r.pathname||"/",r.search){let a=new URLSearchParams(r.search),i=a.getAll("index");a.delete("index");for(let c of i.filter(Boolean))a.append("index",c);n.search=a.size?`?${a.toString()}`:""}else n.search="";return n.hash=r.hash||"",n}function A8(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function f3(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function OT(e,t,n,r=!1,a=!1){let i={},c=null,u,f=!1,h={},p=n&&Is(n[1])?n[1].error:void 0;return e.forEach(m=>{if(!(m.route.id in t))return;let v=m.route.id,w=t[v];if(rn(!Vl(w),"Cannot handle redirect results in processLoaderData"),Is(w)){let y=w.error;if(p!==void 0&&(y=p,p=void 0),c=c||{},a)c[v]=y;else{let b=Di(e,v);c[b.route.id]==null&&(c[b.route.id]=y)}r||(i[v]=jS),f||(f=!0,u=x0(w.error)?w.error.status:500),w.headers&&(h[v]=w.headers)}else i[v]=w.data,w.statusCode&&w.statusCode!==200&&!f&&(u=w.statusCode),w.headers&&(h[v]=w.headers)}),p!==void 0&&n&&(c={[n[0]]:p},n[2]&&(i[n[2]]=void 0)),{loaderData:i,errors:c,statusCode:u||200,loaderHeaders:h}}function h3(e,t,n,r,a,i,c){let{loaderData:u,errors:f}=OT(t,n,r);return a.filter(h=>!h.matches||h.matches.some(p=>p.shouldLoad)).forEach(h=>{let{key:p,match:m,controller:v}=h;if(v&&v.signal.aborted)return;let w=i[p];if(rn(w,"Did not find corresponding fetcher result"),Is(w)){let y=Di(e.matches,m==null?void 0:m.route.id);f&&f[y.route.id]||(f={...f,[y.route.id]:w.error}),c.delete(p)}else if(Vl(w))rn(!1,"Unhandled fetcher revalidation redirect");else{let y=to(w.data);c.set(p,y)}}),{loaderData:u,errors:f}}function p3(e,t,n,r){let a=Object.entries(t).filter(([,i])=>i!==jS).reduce((i,[c,u])=>(i[c]=u,i),{});for(let i of n){let c=i.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&i.route.loader&&(a[c]=e[c]),r&&r.hasOwnProperty(c))break}return a}function m3(e){return e?Is(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Di(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function P1(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function aa(e,{pathname:t,routeId:n,method:r,type:a,message:i}={}){let c="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?u=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:a==="invalid-body"&&(u="Unable to encode submission body")):e===403?(c="Forbidden",u=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",u=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?u=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(u=`Invalid request method "${r.toUpperCase()}"`)),new W0(e||500,c,new Error(u),!0)}function L1(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,a]=t[n];if(Vl(a))return{key:r,result:a}}}function $S(e){let t=typeof e=="string"?wo(e):e;return ls({...t,hash:""})}function IT(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function FT(e){var t,n;return new W0(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function _T(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&ZT(n))}function ZT(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function VT(e){return r4(e.result)&&ES.has(e.result.status)}function Is(e){return e.type==="error"}function Vl(e){return(e&&e.type)==="redirect"}function g3(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function r4(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function zT(e){return ES.has(e)}function BT(e){return r4(e)&&zT(e.status)&&e.headers.has("Location")}function UT(e){return yT.has(e.toUpperCase())}function Yr(e){return vT.has(e.toUpperCase())}function s4(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function lh(e,t){let n=typeof t=="string"?wo(t).search:t.search;if(e[e.length-1].route.index&&s4(n||""))return e[e.length-1];let r=yS(e);return r[r.length-1]}function v3(e){let{formMethod:t,formAction:n,formEncType:r,text:a,formData:i,json:c}=e;if(!(!t||!n||!r)){if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:c,text:void 0}}}function og(e,t,n,r){return r?{state:"loading",location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:"loading",location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function WT(e,t,n,r){return{state:"submitting",location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Fd(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function KT(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function to(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function GT(e,t){try{let n=e.sessionStorage.getItem(CS);if(n){let r=JSON.parse(n);for(let[a,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(a,new Set(i||[]))}}catch{}}function YT(e,t){if(t.size>0){let n={};for(let[r,a]of t)n[r]=[...a];try{e.sessionStorage.setItem(CS,JSON.stringify(n))}catch(r){qn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function w3(){let e,t,n=new Promise((r,a)=>{e=async i=>{r(i);try{await n}catch{}},t=async i=>{a(i);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var cc=s.createContext(null);cc.displayName="DataRouter";var Ku=s.createContext(null);Ku.displayName="DataRouterState";var DS=s.createContext(!1);function HS(){return s.useContext(DS)}var a4=s.createContext({isTransitioning:!1});a4.displayName="ViewTransition";var OS=s.createContext(new Map);OS.displayName="Fetchers";var qT=s.createContext(null);qT.displayName="Await";var fs=s.createContext(null);fs.displayName="Navigation";var fp=s.createContext(null);fp.displayName="Location";var pa=s.createContext({outlet:null,matches:[],isDataRoute:!1});pa.displayName="Route";var o4=s.createContext(null);o4.displayName="RouteError";var IS="REACT_ROUTER_ERROR",XT="REDIRECT",QT="ROUTE_ERROR_RESPONSE";function JT(e){if(e.startsWith(`${IS}:${XT}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function e$(e){if(e.startsWith(`${IS}:${QT}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new W0(t.status,t.statusText,t.data)}catch{}}function t$(e,{relative:t}={}){rn(uc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=s.useContext(fs),{hash:a,pathname:i,search:c}=G0(e,{relative:t}),u=i;return n!=="/"&&(u=i==="/"?n:ua([n,i])),r.createHref({pathname:u,search:c,hash:a})}function uc(){return s.useContext(fp)!=null}function Zn(){return rn(uc(),"useLocation() may be used only in the context of a <Router> component."),s.useContext(fp).location}function un(e){rn(uc(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Zn();return s.useMemo(()=>Gi(e,wS(t)),[t,e])}var FS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function _S(e){s.useContext(fs).static||s.useLayoutEffect(e)}function Dn(){let{isDataRoute:e}=s.useContext(pa);return e?m$():n$()}function n$(){rn(uc(),"useNavigate() may be used only in the context of a <Router> component.");let e=s.useContext(cc),{basename:t,navigator:n}=s.useContext(fs),{matches:r}=s.useContext(pa),{pathname:a}=Zn(),i=JSON.stringify(dp(r)),c=s.useRef(!1);return _S(()=>{c.current=!0}),s.useCallback((f,h={})=>{if(qn(c.current,FS),!c.current)return;if(typeof f=="number"){n.go(f);return}let p=U0(f,JSON.parse(i),a,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:ua([t,p.pathname])),xu(typeof f=="string"?f:ls(f),n.createHref(p),t4(n),"reject"),(h.replace?n.replace:n.push)(p,h.state,h)},[t,n,i,a,e])}var ZS=s.createContext(null);function r$(){return s.useContext(ZS)}function s$(e){let t=s.useContext(pa).outlet;return s.useMemo(()=>t&&s.createElement(ZS.Provider,{value:e},t),[t,e])}function Bs(){let{matches:e}=s.useContext(pa),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function G0(e,{relative:t}={}){let{matches:n}=s.useContext(pa),{pathname:r}=Zn(),a=JSON.stringify(dp(n));return s.useMemo(()=>U0(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function a$(e,t,n){rn(uc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=s.useContext(fs),{matches:a}=s.useContext(pa),i=a[a.length-1],c=i?i.params:{},u=i?i.pathname:"/",f=i?i.pathnameBase:"/",h=i&&i.route;{let k=h&&h.path||"";US(u,!h||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
51
|
-
|
|
52
|
-
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let p=Zn(),m;m=p;let v=m.pathname||"/",w=v;if(f!=="/"){let k=f.replace(/^\//,"").split("/");w="/"+v.replace(/^\//,"").split("/").slice(k.length).join("/")}let y=n&&n.state.matches.length?n.state.matches.map(k=>Object.assign(k,{route:n.manifest[k.route.id]||k.route})):fS(e,{pathname:w});return qn(h||y!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),qn(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),u$(y&&y.map(k=>Object.assign({},k,{params:Object.assign({},c,k.params),pathname:ua([f,r.encodeLocation?r.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?f:ua([f,r.encodeLocation?r.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),a,n)}function o$(){let e=BS(),t=x0(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=s.createElement(s.Fragment,null,s.createElement("p",null,"💿 Hey developer 👋"),s.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",s.createElement("code",{style:i},"ErrorBoundary")," or"," ",s.createElement("code",{style:i},"errorElement")," prop on your route.")),s.createElement(s.Fragment,null,s.createElement("h2",null,"Unexpected Application Error!"),s.createElement("h3",{style:{fontStyle:"italic"}},t),n?s.createElement("pre",{style:a},n):null,c)}var i$=s.createElement(o$,null),VS=class extends s.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=e$(e.digest);n&&(e=n)}let t=e!==void 0?s.createElement(pa.Provider,{value:this.props.routeContext},s.createElement(o4.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?s.createElement(l$,{error:e},t):t}};VS.contextType=DS;var ig=new WeakMap;function l$({children:e,error:t}){let{basename:n,navigator:r}=s.useContext(fs);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=JT(t.digest);if(a){let i=ig.get(t);if(i)throw i;let c=xS(a.location,n),u=c.absoluteURL||c.to;if(xu(a.location,u,t4(r),"allow-explicit"),j8(u))throw new Error("Invalid redirect location");if(bS&&!ig.get(t))if(c.isExternal||a.reloadDocument)window.location.href=u;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:a.replace}));throw ig.set(t,f),f}return s.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u}`})}}return e}function c$({routeContext:e,match:t,children:n}){let r=s.useContext(cc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),s.createElement(pa.Provider,{value:e},n)}function u$(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,i=r==null?void 0:r.errors;if(i!=null){let p=a.findIndex(m=>m.route.id&&(i==null?void 0:i[m.route.id])!==void 0);rn(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,p+1))}let c=!1,u=-1;if(n&&r){c=r.renderFallback;for(let p=0;p<a.length;p++){let m=a[p];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(u=p),m.route.id){let{loaderData:v,errors:w}=r,y=m.route.loader&&!v.hasOwnProperty(m.route.id)&&(!w||w[m.route.id]===void 0);if(m.route.lazy||y){n.isStatic&&(c=!0),u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}}let f=n==null?void 0:n.onError,h=r&&f?(p,m)=>{var v,w;f(p,{location:r.location,params:((w=(v=r.matches)==null?void 0:v[0])==null?void 0:w.params)??{},pattern:K0(r.matches),errorInfo:m})}:void 0;return a.reduceRight((p,m,v)=>{let w,y=!1,b=null,k=null;r&&(w=i&&m.route.id?i[m.route.id]:void 0,b=m.route.errorElement||i$,c&&(u<0&&v===0?(US("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,k=null):u===v&&(y=!0,k=m.route.hydrateFallbackElement||null)));let S=t.concat(a.slice(0,v+1)),C=()=>{let j;return w?j=b:y?j=k:m.route.Component?j=s.createElement(m.route.Component,null):m.route.element?j=m.route.element:j=p,s.createElement(c$,{match:m,routeContext:{outlet:p,matches:S,isDataRoute:r!=null},children:j})};return r&&(m.route.ErrorBoundary||m.route.errorElement||v===0)?s.createElement(VS,{location:r.location,revalidation:r.revalidation,component:b,error:w,children:C(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:h}):C()},null)}function i4(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function d$(e){let t=s.useContext(cc);return rn(t,i4(e)),t}function l4(e){let t=s.useContext(Ku);return rn(t,i4(e)),t}function f$(e){let t=s.useContext(pa);return rn(t,i4(e)),t}function c4(e){let t=f$(e),n=t.matches[t.matches.length-1];return rn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function h$(){return c4("useRouteId")}function p$(){let e=l4("useNavigation");return s.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function zS(){let{matches:e,loaderData:t}=l4("useMatches");return s.useMemo(()=>e.map(n=>hS(n,t)),[e,t])}function BS(){var r;let e=s.useContext(o4),t=l4("useRouteError"),n=c4("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function m$(){let{router:e}=d$("useNavigate"),t=c4("useNavigate"),n=s.useRef(!1);return _S(()=>{n.current=!0}),s.useCallback(async(a,i={})=>{qn(n.current,FS),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var y3={};function US(e,t,n){!t&&!y3[e]&&(y3[e]=!0,qn(!1,n))}var b3={};function x3(e,t){!e&&!b3[t]&&(b3[t]=!0,console.warn(t))}var g$="useOptimistic",k3=lc[g$],v$=()=>{};function w$(e){return k3?k3(e):[e,v$]}function y$(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&qn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:s.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&qn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:s.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&qn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:s.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var b$=["HydrateFallback","hydrateFallbackElement"],x$=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function k$({router:e,flushSync:t,onError:n,useTransitions:r}){r=HS()||r;let[i,c]=s.useState(e.state),[u,f]=w$(i),[h,p]=s.useState(),[m,v]=s.useState({isTransitioning:!1}),[w,y]=s.useState(),[b,k]=s.useState(),[S,C]=s.useState(),j=s.useRef(new Map),N=s.useCallback((E,{deletedFetchers:M,newErrors:L,flushSync:H,viewTransitionOpts:D})=>{L&&n&&Object.values(L).forEach(O=>{var _;return n(O,{location:E.location,params:((_=E.matches[0])==null?void 0:_.params)??{},pattern:K0(E.matches)})}),E.fetchers.forEach((O,_)=>{O.data!==void 0&&j.current.set(_,O.data)}),M.forEach(O=>j.current.delete(O)),x3(H===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let K=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(x3(D==null||K,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!D||!K){t&&H?t(()=>c(E)):r===!1?c(E):s.startTransition(()=>{r===!0&&f(O=>S3(O,E)),c(E)});return}if(t&&H){t(()=>{b&&(w==null||w.resolve(),b.skipTransition()),v({isTransitioning:!0,flushSync:!0,currentLocation:D.currentLocation,nextLocation:D.nextLocation})});let O=e.window.document.startViewTransition(()=>{t(()=>c(E))});O.finished.finally(()=>{t(()=>{y(void 0),k(void 0),p(void 0),v({isTransitioning:!1})})}),t(()=>k(O));return}b?(w==null||w.resolve(),b.skipTransition(),C({state:E,currentLocation:D.currentLocation,nextLocation:D.nextLocation})):(p(E),v({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}))},[e.window,t,b,w,r,f,n]);s.useLayoutEffect(()=>e.subscribe(N),[e,N]),s.useEffect(()=>{m.isTransitioning&&!m.flushSync&&y(new x$)},[m]),s.useEffect(()=>{if(w&&h&&e.window){let E=h,M=w.promise,L=e.window.document.startViewTransition(async()=>{r===!1?c(E):s.startTransition(()=>{r===!0&&f(H=>S3(H,E)),c(E)}),await M});L.finished.finally(()=>{y(void 0),k(void 0),p(void 0),v({isTransitioning:!1})}),k(L)}},[h,w,e.window,r,f]),s.useEffect(()=>{w&&h&&u.location.key===h.location.key&&w.resolve()},[w,b,u.location,h]),s.useEffect(()=>{!m.isTransitioning&&S&&(p(S.state),v({isTransitioning:!0,flushSync:!1,currentLocation:S.currentLocation,nextLocation:S.nextLocation}),C(void 0))},[m.isTransitioning,S]);let P=s.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:E=>e.navigate(E),push:(E,M,L)=>e.navigate(E,{state:M,preventScrollReset:L==null?void 0:L.preventScrollReset}),replace:(E,M,L)=>e.navigate(E,{replace:!0,state:M,preventScrollReset:L==null?void 0:L.preventScrollReset})}),[e]),$=e.basename||"/",R=s.useMemo(()=>({router:e,navigator:P,static:!1,basename:$,onError:n}),[e,P,$,n]);return s.createElement(s.Fragment,null,s.createElement(cc.Provider,{value:R},s.createElement(Ku.Provider,{value:u},s.createElement(OS.Provider,{value:j.current},s.createElement(a4.Provider,{value:m},s.createElement(C$,{basename:$,location:u.location,navigationType:u.historyAction,navigator:P,useTransitions:r},s.createElement(S$,{routes:e.routes,manifest:e.manifest,future:e.future,state:u,isStatic:!1,onError:n})))))),null)}function S3(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var S$=s.memo(E$);function E$({routes:e,manifest:t,future:n,state:r,isStatic:a,onError:i}){return a$(e,void 0,{manifest:t,state:r,isStatic:a,onError:i})}function fo({to:e,replace:t,state:n,relative:r}){rn(uc(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a,navigator:i}=s.useContext(fs);qn(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:c}=s.useContext(pa),{pathname:u}=Zn(),f=Dn(),h=U0(e,dp(c),u,r==="path");xu(typeof e=="string"?e:ls(e),i.createHref(h),t4(i),"reject");let p=JSON.stringify(h);return s.useEffect(()=>{f(JSON.parse(p),{replace:t,state:n,relative:r})},[f,p,r,t,n]),null}function dc(e){return s$(e.context)}function C$({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:i=!1,useTransitions:c}){rn(!uc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),f=s.useMemo(()=>({basename:u,navigator:a,static:i,useTransitions:c,future:{}}),[u,a,i,c]);typeof n=="string"&&(n=wo(n));let{pathname:h="/",search:p="",hash:m="",state:v=null,key:w="default",mask:y}=n,b=s.useMemo(()=>{let k=zs(h,u);return k==null?null:{location:{pathname:k,search:p,hash:m,state:v,key:w,mask:y},navigationType:r}},[u,h,p,m,v,w,r,y]);return qn(b!=null,`<Router basename="${u}"> is not able to match the URL "${h}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:s.createElement(fs.Provider,{value:f},s.createElement(fp.Provider,{children:t,value:b}))}var ch="get",uh="application/x-www-form-urlencoded";function hp(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function j$(e){return hp(e)&&e.tagName.toLowerCase()==="button"}function A$(e){return hp(e)&&e.tagName.toLowerCase()==="form"}function N$(e){return hp(e)&&e.tagName.toLowerCase()==="input"}function M$(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function R$(e,t){return e.button===0&&(!t||t==="_self")&&!M$(e)}function N8(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function P$(e,t){let n=N8(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}var T1=null;function L$(){if(T1===null)try{new FormData(document.createElement("form"),0),T1=!1}catch{T1=!0}return T1}var T$=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function lg(e){return e!=null&&!T$.has(e)?(qn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${uh}"`),null):e}function $$(e,t){let n,r,a,i,c;if(A$(e)){let u=e.getAttribute("action");r=u?zs(u,t):null,n=e.getAttribute("method")||ch,a=lg(e.getAttribute("enctype"))||uh,i=new FormData(e)}else if(j$(e)||N$(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||u.getAttribute("action");if(r=f?zs(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||ch,a=lg(e.getAttribute("formenctype"))||lg(u.getAttribute("enctype"))||uh,i=new FormData(u,e),!L$()){let{name:h,type:p,value:m}=e;if(p==="image"){let v=h?`${h}.`:"";i.append(`${v}x`,"0"),i.append(`${v}y`,"0")}else h&&i.append(h,m)}}else{if(hp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=ch,r=null,a=uh,c=e}return i&&a==="text/plain"&&(c=i,i=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:i,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var D$={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},H$=/[&><\u2028\u2029]/g;function E3(e){return e.replace(H$,t=>D$[t])}function u4(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function WS(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&zs(a.pathname,t)==="/"?a.pathname=`${$u(t)}/_root.${r}`:a.pathname=`${$u(a.pathname)}.${r}`,a}async function O$(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function I$(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function F$(e,t,n){let r=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let c=await O$(i,n);return c.links?c.links():[]}return[]}));return z$(r.flat(1).filter(I$).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function C3(e,t,n,r,a,i){let c=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,u=(f,h)=>{var p;return n[h].pathname!==f.pathname||((p=n[h].route.path)==null?void 0:p.endsWith("*"))&&n[h].params["*"]!==f.params["*"]};return i==="assets"?t.filter((f,h)=>c(f,h)||u(f,h)):i==="data"?t.filter((f,h)=>{var m;let p=r.routes[f.route.id];if(!p||!p.hasLoader)return!1;if(c(f,h)||u(f,h))return!0;if(f.route.shouldRevalidate){let v=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function _$(e,t,{includeHydrateFallback:n}={}){return Z$(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let i=[a.module];return a.clientActionModule&&(i=i.concat(a.clientActionModule)),a.clientLoaderModule&&(i=i.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(i=i.concat(a.hydrateFallbackModule)),a.imports&&(i=i.concat(a.imports)),i}).flat(1))}function Z$(e){return[...new Set(e)]}function V$(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function z$(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let i=JSON.stringify(V$(a));return n.has(i)||(n.add(i),r.push({key:i,link:a})),r},[])}function d4(){let e=s.useContext(cc);return u4(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function B$(){let e=s.useContext(Ku);return u4(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var pp=s.createContext(void 0);pp.displayName="FrameworkContext";function mp(){let e=s.useContext(pp);return u4(e,"You must render this element inside a <HydratedRouter> element"),e}function U$(e,t){let n=s.useContext(pp),[r,a]=s.useState(!1),[i,c]=s.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:h,onMouseLeave:p,onTouchStart:m}=t,v=s.useRef(null);s.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let b=S=>{S.forEach(C=>{c(C.isIntersecting)})},k=new IntersectionObserver(b,{threshold:.5});return v.current&&k.observe(v.current),()=>{k.disconnect()}}},[e]),s.useEffect(()=>{if(r){let b=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(b)}}},[r]);let w=()=>{a(!0)},y=()=>{a(!1),c(!1)};return n?e!=="intent"?[i,v,{}]:[i,v,{onFocus:_d(u,w),onBlur:_d(f,y),onMouseEnter:_d(h,w),onMouseLeave:_d(p,y),onTouchStart:_d(m,w)}]:[!1,v,{}]}function _d(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function W$({page:e,...t}){let n=HS(),{nonce:r}=mp(),{router:a}=d4(),i=s.useMemo(()=>fS(a.routes,e,a.basename),[a.routes,e,a.basename]);return i?(t.nonce==null&&r&&(t={...t,nonce:r}),n?s.createElement(G$,{page:e,matches:i,...t}):s.createElement(Y$,{page:e,matches:i,...t})):null}function K$(e){let{manifest:t,routeModules:n}=mp(),[r,a]=s.useState([]);return s.useEffect(()=>{let i=!1;return F$(e,t,n).then(c=>{i||a(c)}),()=>{i=!0}},[e,t,n]),r}function G$({page:e,matches:t,...n}){let r=Zn(),{future:a}=mp(),{basename:i}=d4(),c=s.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let u=WS(e,i,a.v8_trailingSlashAwareDataRequests,"rsc"),f=!1,h=[];for(let p of t)typeof p.route.shouldRevalidate=="function"?f=!0:h.push(p.route.id);return f&&h.length>0&&u.searchParams.set("_routes",h.join(",")),[u.pathname+u.search]},[i,a.v8_trailingSlashAwareDataRequests,e,r,t]);return s.createElement(s.Fragment,null,c.map(u=>s.createElement("link",{key:u,rel:"prefetch",as:"fetch",href:u,...n})))}function Y$({page:e,matches:t,...n}){let r=Zn(),{future:a,manifest:i,routeModules:c}=mp(),{basename:u}=d4(),{loaderData:f,matches:h}=B$(),p=s.useMemo(()=>C3(e,t,h,i,r,"data"),[e,t,h,i,r]),m=s.useMemo(()=>C3(e,t,h,i,r,"assets"),[e,t,h,i,r]),v=s.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let b=new Set,k=!1;if(t.forEach(C=>{var N;let j=i.routes[C.route.id];!j||!j.hasLoader||(!p.some(P=>P.route.id===C.route.id)&&C.route.id in f&&((N=c[C.route.id])!=null&&N.shouldRevalidate)||j.hasClientLoader?k=!0:b.add(C.route.id))}),b.size===0)return[];let S=WS(e,u,a.v8_trailingSlashAwareDataRequests,"data");return k&&b.size>0&&S.searchParams.set("_routes",t.filter(C=>b.has(C.route.id)).map(C=>C.route.id).join(",")),[S.pathname+S.search]},[u,a.v8_trailingSlashAwareDataRequests,f,r,i,p,t,e,c]),w=s.useMemo(()=>_$(m,i),[m,i]),y=K$(m);return s.createElement(s.Fragment,null,v.map(b=>s.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),w.map(b=>s.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),y.map(({key:b,link:k})=>s.createElement("link",{key:b,nonce:n.nonce,...k,crossOrigin:k.crossOrigin??n.crossOrigin})))}function q$(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var X$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{X$&&(window.__reactRouterVersion="7.18.3")}catch{}function Q$(e,t){return ET({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:_L({window:t==null?void 0:t.window}),hydrationData:J$(),routes:e,mapRouteProperties:y$,hydrationRouteProperties:b$,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,instrumentations:t==null?void 0:t.instrumentations}).initialize()}function J$(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:eD(e.errors)}),e}function eD(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new W0(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(typeof a.__subType=="string"&&cT.includes(a.__subType)){let i=window[a.__subType];if(typeof i=="function")try{let c=new i(a.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let i=new Error(a.message);i.stack="",n[r]=i}}else n[r]=a;return n}var _n=s.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:i,replace:c,mask:u,state:f,target:h,to:p,preventScrollReset:m,viewTransition:v,defaultShouldRevalidate:w,...y},b){let{basename:k,navigator:S,useTransitions:C}=s.useContext(fs),j=typeof p=="string"&&cp.test(p),N=xS(p,k);p=N.to;let P=t$(p,{relative:a}),$=Zn(),R=null;if(u){let _=U0(u,[],$.mask?$.mask.pathname:"/",!0);k!=="/"&&(_.pathname=_.pathname==="/"?k:ua([k,_.pathname])),R=S.createHref(_)}let[E,M,L]=U$(r,y),H=sD(p,{replace:c,mask:u,state:f,target:h,preventScrollReset:m,relative:a,viewTransition:v,defaultShouldRevalidate:w,useTransitions:C});function D(_){t&&t(_),_.defaultPrevented||H(_)}let K=!(N.isExternal||i),O=s.createElement("a",{...y,...L,href:(K?R:void 0)||N.absoluteURL||P,onClick:K?D:t,ref:q$(b,M),target:h,"data-discover":!j&&n==="render"?"true":void 0});return E&&!j?s.createElement(s.Fragment,null,O,s.createElement(W$,{page:P})):O});_n.displayName="Link";var tD=s.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:i,to:c,viewTransition:u,children:f,...h},p){let m=G0(c,{relative:h.relative}),v=Zn(),w=s.useContext(Ku),{navigator:y,basename:b}=s.useContext(fs),k=w!=null&&dD(m)&&u===!0,S=y.encodeLocation?y.encodeLocation(m).pathname:m.pathname,C=v.pathname,j=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(C=C.toLowerCase(),j=j?j.toLowerCase():null,S=S.toLowerCase()),j&&b&&(j=zs(j,b)||j);const N=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let P=C===S||!a&&C.startsWith(S)&&C.charAt(N)==="/",$=j!=null&&(j===S||!a&&j.startsWith(S)&&j.charAt(S.length)==="/"),R={isActive:P,isPending:$,isTransitioning:k},E=P?t:void 0,M;typeof r=="function"?M=r(R):M=[r,P?"active":null,$?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let L=typeof i=="function"?i(R):i;return s.createElement(_n,{...h,"aria-current":E,className:M,ref:p,style:L,to:c,viewTransition:u},typeof f=="function"?f(R):f)});tD.displayName="NavLink";var nD=s.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:i,method:c=ch,action:u,onSubmit:f,relative:h,preventScrollReset:p,viewTransition:m,defaultShouldRevalidate:v,...w},y)=>{let{useTransitions:b}=s.useContext(fs),k=iD(),S=lD(u,{relative:h}),C=c.toLowerCase()==="get"?"get":"post",j=typeof u=="string"&&cp.test(u),N=P=>{if(f&&f(P),P.defaultPrevented)return;P.preventDefault();let $=P.nativeEvent.submitter,R=($==null?void 0:$.getAttribute("formmethod"))||c,E=()=>k($||P.currentTarget,{fetcherKey:t,method:R,navigate:n,replace:a,state:i,relative:h,preventScrollReset:p,viewTransition:m,defaultShouldRevalidate:v});b&&n!==!1?s.startTransition(()=>E()):E()};return s.createElement("form",{ref:y,method:C,action:S,onSubmit:r?f:N,...w,"data-discover":!j&&e==="render"?"true":void 0})});nD.displayName="Form";function KS({getKey:e,storageKey:t,...n}){let r=s.useContext(pp),{basename:a}=s.useContext(fs),i=Zn(),c=zS();cD({getKey:e,storageKey:t});let u=s.useMemo(()=>{if(!r||!e)return null;let h=R8(i,c,a,e);return h!==i.key?h:null},[]);if(!r||r.isSpaMode)return null;let f=((h,p)=>{if(!window.history.state||!window.history.state.key){let m=Math.random().toString(32).slice(2);window.history.replaceState({key:m},"")}try{let v=JSON.parse(sessionStorage.getItem(h)||"{}")[p||window.history.state.key];typeof v=="number"&&window.scrollTo(0,v)}catch(m){console.error(m),sessionStorage.removeItem(h)}}).toString();return n.nonce==null&&(r!=null&&r.nonce)&&(n.nonce=r.nonce),s.createElement("script",{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${f})(${E3(JSON.stringify(t||M8))}, ${E3(JSON.stringify(u))})`}})}KS.displayName="ScrollRestoration";function GS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function f4(e){let t=s.useContext(cc);return rn(t,GS(e)),t}function rD(e){let t=s.useContext(Ku);return rn(t,GS(e)),t}function sD(e,{target:t,replace:n,mask:r,state:a,preventScrollReset:i,relative:c,viewTransition:u,defaultShouldRevalidate:f,useTransitions:h}={}){let p=Dn(),m=Zn(),v=G0(e,{relative:c});return s.useCallback(w=>{if(R$(w,t)){w.preventDefault();let y=n!==void 0?n:ls(m)===ls(v),b=()=>p(e,{replace:y,mask:r,state:a,preventScrollReset:i,relative:c,viewTransition:u,defaultShouldRevalidate:f});h?s.startTransition(()=>b()):b()}},[m,p,v,n,r,a,t,e,i,c,u,f,h])}function tl(e){qn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=s.useRef(N8(e)),n=s.useRef(!1),r=Zn(),a=s.useMemo(()=>P$(r.search,n.current?null:t.current),[r.search]),i=Dn(),c=s.useCallback((u,f)=>{const h=N8(typeof u=="function"?u(new URLSearchParams(a)):u);n.current=!0,i("?"+h,f)},[i,a]);return[a,c]}var aD=0,oD=()=>`__${String(++aD)}__`;function iD(){let{router:e}=f4("useSubmit"),{basename:t}=s.useContext(fs),n=h$(),r=e.fetch,a=e.navigate;return s.useCallback(async(i,c={})=>{let{action:u,method:f,encType:h,formData:p,body:m}=$$(i,t);if(c.navigate===!1){let v=c.fetcherKey||oD();await r(v,n,c.action||u,{defaultShouldRevalidate:c.defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:p,body:m,formMethod:c.method||f,formEncType:c.encType||h,flushSync:c.flushSync})}else await a(c.action||u,{defaultShouldRevalidate:c.defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:p,body:m,formMethod:c.method||f,formEncType:c.encType||h,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[r,a,t,n])}function lD(e,{relative:t}={}){let{basename:n}=s.useContext(fs),r=s.useContext(pa);rn(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),i={...G0(e||".",{relative:t})},c=Zn();if(e==null){i.search=c.search;let u=new URLSearchParams(i.search),f=u.getAll("index");if(f.some(p=>p==="")){u.delete("index"),f.filter(m=>m).forEach(m=>u.append("index",m));let p=u.toString();i.search=p?`?${p}`:""}}return(!e||e===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:ua([n,i.pathname])),ls(i)}var M8="react-router-scroll-positions",$1={};function R8(e,t,n,r){let a=null;return r&&(n!=="/"?a=r({...e,pathname:zs(e.pathname,n)||e.pathname},t):a=r(e,t)),a==null&&(a=e.key),a}function cD({getKey:e,storageKey:t}={}){let{router:n}=f4("useScrollRestoration"),{restoreScrollPosition:r,preventScrollReset:a}=rD("useScrollRestoration"),{basename:i}=s.useContext(fs),c=Zn(),u=zS(),f=p$();s.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),uD(s.useCallback(()=>{if(f.state==="idle"){let h=R8(c,u,i,e);$1[h]=window.scrollY}try{sessionStorage.setItem(t||M8,JSON.stringify($1))}catch(h){qn(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${h}).`)}window.history.scrollRestoration="auto"},[f.state,e,i,c,u,t])),typeof document<"u"&&(s.useLayoutEffect(()=>{try{let h=sessionStorage.getItem(t||M8);h&&($1=JSON.parse(h))}catch{}},[t]),s.useLayoutEffect(()=>{let h=n==null?void 0:n.enableScrollRestoration($1,()=>window.scrollY,e?(p,m)=>R8(p,m,i,e):void 0);return()=>h&&h()},[n,i,e]),s.useLayoutEffect(()=>{if(r!==!1){if(typeof r=="number"){window.scrollTo(0,r);return}try{if(c.hash){let h=document.getElementById(decodeURIComponent(c.hash.slice(1)));if(h){h.scrollIntoView();return}}}catch{qn(!1,`"${c.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[c,r,a]))}function uD(e,t){let{capture:n}={};s.useEffect(()=>{let r=n!=null?{capture:n}:void 0;return window.addEventListener("pagehide",e,r),()=>{window.removeEventListener("pagehide",e,r)}},[e,n])}function dD(e,{relative:t}={}){let n=s.useContext(a4);rn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=f4("useViewTransitionState"),a=G0(e,{relative:t});if(!n.isTransitioning)return!1;let i=zs(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=zs(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Gi(a.pathname,c)!=null||Gi(a.pathname,i)!=null}var Rr=iS(),fD=Object.defineProperty,h4=(e,t)=>fD(e,"name",{value:t,configurable:!0});function P8(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}h4(P8,"setRef");function YS(...e){return t=>{let n=!1;const r=e.map(a=>{const i=P8(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():P8(e[a],null)}}}}h4(YS,"composeRefs");function an(...e){return s.useCallback(YS(...e),e)}h4(an,"useComposedRefs");var hD=Object.defineProperty,Ia=(e,t)=>hD(e,"name",{value:t,configurable:!0});function $a(e){const t=s.forwardRef((n,r)=>{let{children:a,...i}=n,c=null,u=!1;const f=[];L8(a)&&typeof D1=="function"&&(a=D1(a._payload)),s.Children.forEach(a,v=>{var w;if(JS(v)){u=!0;const y=v;let b="child"in y.props?y.props.child:y.props.children;L8(b)&&typeof D1=="function"&&(b=D1(b._payload)),c=pD(y,b),f.push((w=c==null?void 0:c.props)==null?void 0:w.children)}else f.push(v)}),c?c=s.cloneElement(c,void 0,f):!u&&s.Children.count(a)===1&&s.isValidElement(a)&&(c=a);const h=c?QS(c):void 0,p=an(r,h);if(!c){if(a||a===0)throw new Error(u?vD(e):gD(e));return a}const m=XS(i,c.props??{});return c.type!==s.Fragment&&(m.ref=r?p:h),s.cloneElement(c,m)});return t.displayName=`${e}.Slot`,t}Ia($a,"createSlot");var fc=$a("Slot"),qS=Symbol.for("radix.slottable");function p4(e){const t=Ia(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=qS,t}Ia(p4,"createSlottable");var gp=p4("Slottable"),pD=Ia((e,t)=>{if("child"in e.props){const n=e.props.child;return s.isValidElement(n)?s.cloneElement(n,void 0,e.props.children(n.props.children)):null}return s.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function XS(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{const f=i(...u);return a(...u),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}Ia(XS,"mergeProps");function QS(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ia(QS,"getElementRef");function JS(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qS}Ia(JS,"isSlottable");var mD=Symbol.for("react.lazy");function L8(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===mD&&"_payload"in e&&e9(e._payload)}Ia(L8,"isLazyComponent");function e9(e){return typeof e=="object"&&e!==null&&"then"in e}Ia(e9,"isPromiseLike");var gD=Ia(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),vD=Ia(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),D1=lc[" use ".trim().toString()],wD=Object.defineProperty,yD=(e,t)=>wD(e,"name",{value:t,configurable:!0}),bD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ln=bD.reduce((e,t)=>{const n=$a(`Primitive.${t}`),r=s.forwardRef((a,i)=>{const{asChild:c,...u}=a,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(f,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function m4(e,t){e&&Rr.flushSync(()=>e.dispatchEvent(t))}yD(m4,"dispatchDiscreteCustomEvent");var xD=Object.defineProperty,kD=(e,t)=>xD(e,"name",{value:t,configurable:!0}),t9=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),SD=s.forwardRef(kD(function(t,n){return o.jsx(ln.span,{...t,ref:n,style:{...t9,...t.style}})},"VisuallyHidden")),n9=SD,ED=Object.defineProperty,oa=(e,t)=>ED(e,"name",{value:t,configurable:!0});function CD(e,t){const n=s.createContext(t);n.displayName=e+"Context";const r=oa(i=>{const{children:c,...u}=i,f=s.useMemo(()=>u,Object.values(u));return o.jsx(n.Provider,{value:f,children:c})},"Provider");r.displayName=e+"Provider";function a(i,c={}){const{optional:u=!1}=c,f=s.useContext(n);if(f)return f;if(t!==void 0)return t;if(!u)throw new Error(`\`${i}\` must be used within \`${e}\``)}return oa(a,"useContext"),[r,a]}oa(CD,"createContext");function Ms(e,t=[]){let n=[];function r(i,c){const u=s.createContext(c);u.displayName=i+"Context";const f=n.length;n=[...n,c];const h=oa(m=>{var S;const{scope:v,children:w,...y}=m,b=((S=v==null?void 0:v[e])==null?void 0:S[f])||u,k=s.useMemo(()=>y,Object.values(y));return o.jsx(b.Provider,{value:k,children:w})},"Provider");h.displayName=i+"Provider";function p(m,v,w={}){var S;const{optional:y=!1}=w,b=((S=v==null?void 0:v[e])==null?void 0:S[f])||u,k=s.useContext(b);if(k)return k;if(c!==void 0)return c;if(!y)throw new Error(`\`${m}\` must be used within \`${i}\``)}return oa(p,"useContext"),[h,p]}oa(r,"createContext");const a=oa(()=>{const i=n.map(c=>s.createContext(c));return oa(function(u){const f=(u==null?void 0:u[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])},"useScope")},"createScope");return a.scopeName=e,[r,r9(a,...t)]}oa(Ms,"createContextScope");function r9(...e){const t=e[0];if(e.length===1)return t;const n=oa(()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return oa(function(i){const c=r.reduce((u,{useScope:f,scopeName:h})=>{const m=f(i)[`__scope${h}`];return{...u,...m}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}oa(r9,"composeContextScopes");var jD=Object.defineProperty,Nr=(e,t)=>jD(e,"name",{value:t,configurable:!0});function vp(e){const t=e+"CollectionProvider",[n,r]=Ms(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=Nr(b=>{const{scope:k,children:S}=b,C=s.useRef(null),j=s.useRef(new Map).current;return o.jsx(a,{scope:k,itemMap:j,collectionRef:C,children:S})},"CollectionProvider");c.displayName=t;const u=e+"CollectionSlot",f=$a(u),h=s.forwardRef((b,k)=>{const{scope:S,children:C}=b,j=i(u,S),N=an(k,j.collectionRef);return o.jsx(f,{ref:N,children:C})});h.displayName=u;const p=e+"CollectionItemSlot",m="data-radix-collection-item",v=$a(p),w=s.forwardRef((b,k)=>{const{scope:S,children:C,...j}=b,N=s.useRef(null),P=an(k,N),$=i(p,S);return s.useEffect(()=>($.itemMap.set(N,{ref:N,...j}),()=>void $.itemMap.delete(N))),o.jsx(v,{[m]:"",ref:P,children:C})});w.displayName=p;function y(b){const k=i(e+"CollectionConsumer",b);return s.useCallback(()=>{const C=k.collectionRef.current;if(!C)return[];const j=Array.from(C.querySelectorAll(`[${m}]`));return Array.from(k.itemMap.values()).sort(($,R)=>j.indexOf($.ref.current)-j.indexOf(R.ref.current))},[k.collectionRef,k.itemMap])}return Nr(y,"useCollection"),[{Provider:c,Slot:h,ItemSlot:w},y,r]}Nr(vp,"createCollection");var j3=new WeakMap,fr,Os,cg=(Os=class extends Map{constructor(n){super(n);Fb(this,fr);X2(this,fr,[...super.keys()]),j3.set(this,!0)}set(n,r){return j3.get(this)&&(this.has(n)?Kr(this,fr)[Kr(this,fr).indexOf(n)]=n:Kr(this,fr).push(n)),super.set(n,r),this}insert(n,r,a){const i=this.has(r),c=Kr(this,fr).length,u=g4(n);let f=u>=0?u:c+u;const h=f<0||f>=c?-1:f;if(h===this.size||i&&h===this.size-1||h===-1)return this.set(r,a),this;const p=this.size+(i?0:1);u<0&&f++;const m=[...Kr(this,fr)];let v,w=!1;for(let y=f;y<p;y++)if(f===y){let b=m[y];m[y]===r&&(b=m[y+1]),i&&this.delete(r),v=this.get(b),this.set(r,a)}else{!w&&m[y-1]===r&&(w=!0);const b=m[w?y:y-1],k=v;v=this.get(b),this.delete(b),this.set(b,k)}return this}with(n,r,a){const i=new Os(this);return i.insert(n,r,a),i}before(n){const r=Kr(this,fr).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,a){const i=Kr(this,fr).indexOf(n);return i===-1?this:this.insert(i,r,a)}after(n){let r=Kr(this,fr).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,a){const i=Kr(this,fr).indexOf(n);return i===-1?this:this.insert(i+1,r,a)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return X2(this,fr,[]),super.clear()}delete(n){const r=super.delete(n);return r&&Kr(this,fr).splice(Kr(this,fr).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=dh(Kr(this,fr),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=dh(Kr(this,fr),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return Kr(this,fr).indexOf(n)}keyAt(n){return dh(Kr(this,fr),n)}from(n,r){const a=this.indexOf(n);if(a===-1)return;let i=a+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const a=this.indexOf(n);if(a===-1)return;let i=a+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let a=0;for(const i of this){if(Reflect.apply(n,r,[i,a,this]))return i;a++}}findIndex(n,r){let a=0;for(const i of this){if(Reflect.apply(n,r,[i,a,this]))return a;a++}return-1}filter(n,r){const a=[];let i=0;for(const c of this)Reflect.apply(n,r,[c,i,this])&&a.push(c),i++;return new Os(a)}map(n,r){const a=[];let i=0;for(const c of this)a.push([c[0],Reflect.apply(n,r,[c,i,this])]),i++;return new Os(a)}reduce(...n){const[r,a]=n;let i=0,c=a??this.at(0);for(const u of this)i===0&&n.length===1?c=u:c=Reflect.apply(r,this,[c,u,i,this]),i++;return c}reduceRight(...n){const[r,a]=n;let i=a??this.at(-1);for(let c=this.size-1;c>=0;c--){const u=this.at(c);c===this.size-1&&n.length===1?i=u:i=Reflect.apply(r,this,[i,u,c,this])}return i}toSorted(n){const r=[...this.entries()].sort(n);return new Os(r)}toReversed(){const n=new Os;for(let r=this.size-1;r>=0;r--){const a=this.keyAt(r),i=this.get(a);n.set(a,i)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new Os(r)}slice(n,r){const a=new Os;let i=this.size-1;if(n===void 0)return a;n<0&&(n=n+this.size),r!==void 0&&r>0&&(i=r-1);for(let c=n;c<=i;c++){const u=this.keyAt(c),f=this.get(u);a.set(u,f)}return a}every(n,r){let a=0;for(const i of this){if(!Reflect.apply(n,r,[i,a,this]))return!1;a++}return!0}some(n,r){let a=0;for(const i of this){if(Reflect.apply(n,r,[i,a,this]))return!0;a++}return!1}},fr=new WeakMap,Nr(Os,"OrderedDict"),Os);function dh(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=s9(e,t);return n===-1?void 0:e[n]}Nr(dh,"at");function s9(e,t){const n=e.length,r=g4(t),a=r>=0?r:n+r;return a<0||a>=n?-1:a}Nr(s9,"toSafeIndex");function g4(e){return e!==e||e===0?0:Math.trunc(e)}Nr(g4,"toSafeInteger");function AD(e){const t=e+"CollectionProvider",[n,r]=Ms(t),[a,i]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new cg,setItemMap:Nr(()=>{},"setItemMap")}),c=Nr(({state:j,...N})=>j?o.jsx(f,{...N,state:j}):o.jsx(u,{...N}),"CollectionProvider");c.displayName=t;const u=Nr(j=>{const N=k();return o.jsx(f,{...j,state:N})},"CollectionInit");u.displayName=t+"Init";const f=Nr(j=>{const{scope:N,children:P,state:$}=j,R=s.useRef(null),[E,M]=s.useState(null),L=an(R,M),[H,D]=$;return s.useEffect(()=>{if(!E)return;const K=i9(()=>{});return K.observe(E,{childList:!0,subtree:!0}),()=>{K.disconnect()}},[E]),o.jsx(a,{scope:N,itemMap:H,setItemMap:D,collectionRef:L,collectionRefObject:R,collectionElement:E,children:P})},"CollectionProviderImpl");f.displayName=t+"Impl";const h=e+"CollectionSlot",p=$a(h),m=s.forwardRef((j,N)=>{const{scope:P,children:$}=j,R=i(h,P),E=an(N,R.collectionRef);return o.jsx(p,{ref:E,children:$})});m.displayName=h;const v=e+"CollectionItemSlot",w="data-radix-collection-item",y=$a(v),b=s.forwardRef((j,N)=>{const{scope:P,children:$,...R}=j,E=s.useRef(null),[M,L]=s.useState(null),H=an(N,E,L),D=i(v,P),{setItemMap:K}=D,O=s.useRef(R);a9(O.current,R)||(O.current=R);const _=O.current;return s.useEffect(()=>{const re=_;return K(z=>M?z.has(M)?z.set(M,{...re,element:M}).toSorted(T8):(z.set(M,{...re,element:M}),z.toSorted(T8)):z),()=>{K(z=>!M||!z.has(M)?z:(z.delete(M),new cg(z)))}},[M,_,K]),o.jsx(y,{[w]:"",ref:H,children:$})});b.displayName=v;function k(){return s.useState(new cg)}Nr(k,"useInitCollection");function S(j){const{itemMap:N}=i(e+"CollectionConsumer",j);return N}return Nr(S,"useCollection"),[{Provider:c,Slot:m,ItemSlot:b},{createCollectionScope:r,useCollection:S,useInitCollection:k}]}Nr(AD,"createCollection");function a9(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const a of n)if(!Object.prototype.hasOwnProperty.call(t,a)||e[a]!==t[a])return!1;return!0}Nr(a9,"shallowEqual");function o9(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Nr(o9,"isElementPreceding");function T8(e,t){return!e[1].element||!t[1].element?0:o9(e[1].element,t[1].element)?-1:1}Nr(T8,"sortByDocumentPosition");function i9(e){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){e();return}})}Nr(i9,"getChildListObserver");var ND=Object.defineProperty,Gu=(e,t)=>ND(e,"name",{value:t,configurable:!0}),l9=!!(typeof window<"u"&&window.document&&window.document.createElement);function yt(e,t,{checkForDefaultPrevented:n=!0}={}){return Gu(function(a){if(e==null||e(a),n===!1||!a||!a.defaultPrevented)return t==null?void 0:t(a)},"handleEvent")}Gu(yt,"composeEventHandlers");function MD(e){var t;if(!l9)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Gu(MD,"getOwnerWindow");function $8(e){if(!l9)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Gu($8,"getOwnerDocument");function c9(e,t=!1){const{activeElement:n}=$8(e);if(!(n!=null&&n.nodeName))return null;if(u9(n)&&n.contentDocument)return c9(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const a=$8(n).getElementById(r);if(a)return a}}return n}Gu(c9,"getActiveElement");function u9(e){return e.tagName==="IFRAME"}Gu(u9,"isFrame");var gr=globalThis!=null&&globalThis.document?s.useLayoutEffect:()=>{},RD=Object.defineProperty,PD=(e,t)=>RD(e,"name",{value:t,configurable:!0}),A3=lc[" useEffectEvent ".trim().toString()],N3=lc[" useInsertionEffect ".trim().toString()];function d9(e){if(typeof A3=="function")return A3(e);const t=s.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof N3=="function"?N3(()=>{t.current=e}):gr(()=>{t.current=e}),s.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}PD(d9,"useEffectEvent");var LD=Object.defineProperty,Y0=(e,t)=>LD(e,"name",{value:t,configurable:!0}),TD=lc[" useInsertionEffect ".trim().toString()]||gr;function Qo({prop:e,defaultProp:t,onChange:n=Y0(()=>{},"onChange"),caller:r}){const[a,i,c]=f9({defaultProp:t,onChange:n}),u=e!==void 0,f=u?e:a,h=s.useCallback(p=>{var m;if(u){const v=h9(p)?p(e):p;v!==e&&((m=c.current)==null||m.call(c,v))}else i(p)},[u,e,i,c]);return[f,h]}Y0(Qo,"useControllableState");function f9({defaultProp:e,onChange:t}){const[n,r]=s.useState(e),a=s.useRef(n),i=s.useRef(t);return TD(()=>{i.current=t},[t]),s.useEffect(()=>{var c;a.current!==n&&((c=i.current)==null||c.call(i,n),a.current=n)},[n,a]),[n,r,i]}Y0(f9,"useUncontrolledState");function h9(e){return typeof e=="function"}Y0(h9,"isFunction");var M3=Symbol("RADIX:SYNC_STATE");function $D(e,t,n,r){const{prop:a,defaultProp:i,onChange:c,caller:u}=t,f=a!==void 0,h=d9(c),p=[{...n,state:i}];r&&p.push(r);const[m,v]=s.useReducer((k,S)=>{if(S.type===M3)return{...k,state:S.state};const C=e(k,S);return f&&!Object.is(C.state,k.state)&&h(C.state),C},...p),w=m.state,y=s.useRef(w);s.useEffect(()=>{y.current!==w&&(y.current=w,f||h(w))},[w,y,f]);const b=s.useMemo(()=>a!==void 0?{...m,state:a}:m,[m,a]);return s.useEffect(()=>{f&&!Object.is(a,m.state)&&v({type:M3,state:a})},[a,m.state,f]),[b,v]}Y0($D,"useControllableStateReducer");var DD=Object.defineProperty,Jo=(e,t)=>DD(e,"name",{value:t,configurable:!0});function p9(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}Jo(p9,"useStateMachine");var es=Jo(e=>{const{present:t,children:n}=e,r=m9(t),a=typeof n=="function"?n({present:r.isPresent}):s.Children.only(n),i=g9(r.ref,v9(a));return typeof n=="function"||r.isPresent?s.cloneElement(a,{ref:i}):null},"Presence");function m9(e){const[t,n]=s.useState(),r=s.useRef(null),a=s.useRef(e),i=s.useRef("none"),c=s.useRef(void 0),u=e?"mounted":"unmounted",[f,h]=p9(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{f==="mounted"?(i.current=c.current??du(r.current),c.current=void 0):i.current="none"},[f]),gr(()=>{const p=r.current,m=a.current;if(m!==e){const w=i.current,y=du(p);e?(c.current=y,h("MOUNT")):y==="none"||(p==null?void 0:p.display)==="none"?h("UNMOUNT"):h(m&&w!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,h]),gr(()=>{if(t){let p;const m=t.ownerDocument.defaultView??window,v=Jo(y=>{const k=du(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&k&&(h("ANIMATION_END"),!a.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",p=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},"handleAnimationEnd"),w=Jo(y=>{y.target===t&&(i.current=du(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",w),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{m.clearTimeout(p),t.removeEventListener("animationstart",w),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:s.useCallback(p=>{if(p){const m=getComputedStyle(p);r.current=m,c.current=du(m)}else r.current=null;n(p)},[])}}Jo(m9,"usePresence");function D8(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Jo(D8,"setRef");function g9(...e){const t=s.useRef(e);return t.current=e,s.useCallback(n=>{const r=t.current;let a=!1;const i=r.map(c=>{const u=D8(c,n);return!a&&typeof u=="function"&&(a=!0),u});if(a)return()=>{for(let c=0;c<i.length;c++){const u=i[c];typeof u=="function"?u():D8(r[c],null)}}},[])}Jo(g9,"useStableComposedRefs");function du(e){return(e==null?void 0:e.animationName)||"none"}Jo(du,"getAnimationName");function v9(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Jo(v9,"getElementRef");var HD=Object.defineProperty,OD=(e,t)=>HD(e,"name",{value:t,configurable:!0}),ID=lc[" useId ".trim().toString()]||(()=>{}),FD=0;function da(e){const[t,n]=s.useState(ID());return gr(()=>{e||n(r=>r??String(FD++))},[e]),e||(t?`radix-${t}`:"")}OD(da,"useId");var _D=Object.defineProperty,w9=(e,t)=>_D(e,"name",{value:t,configurable:!0}),y9=s.createContext(void 0),ZD=w9(e=>{const{dir:t,children:n}=e;return o.jsx(y9.Provider,{value:t,children:n})},"DirectionProvider");function q0(e){const t=s.useContext(y9);return e||t||"ltr"}w9(q0,"useDirection");var VD=ZD,zD=Object.defineProperty,BD=(e,t)=>zD(e,"name",{value:t,configurable:!0});function pr(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}BD(pr,"useCallbackRef");var UD=Object.defineProperty,Ar=(e,t)=>UD(e,"name",{value:t,configurable:!0}),H8="dismissableLayer.update",WD="dismissableLayer.pointerDownOutside",KD="dismissableLayer.focusOutside",R3,b9=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),X0=s.forwardRef(Ar(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,onDismiss:h,...p}=t,m=s.useContext(b9),[v,w]=s.useState(null),y=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=s.useState({}),k=an(n,w),S=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),j=C?S.indexOf(C):-1,N=v?S.indexOf(v):-1,P=m.layersWithOutsidePointerEventsDisabled.size>0,$=N>=j,R=s.useRef(!1),E=k9(D=>{c==null||c(D),f==null||f(D),D.defaultPrevented||h==null||h()},{ownerDocument:y,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:R,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:s.useCallback(D=>{if(!(D instanceof Node))return!1;const K=[...m.branches].some(O=>O.contains(D));return $&&!K},[m.branches,$])}),M=S9(D=>{if(a&&R.current)return;const K=D.target;[...m.branches].some(_=>_.contains(K))||(u==null||u(D),f==null||f(D),D.defaultPrevented||h==null||h())},y),L=v?N===S.length-1:!1,H=pr(D=>{D.key==="Escape"&&(i==null||i(D),!D.defaultPrevented&&h&&(D.preventDefault(),h()))});return s.useEffect(()=>{if(L)return y.addEventListener("keydown",H,{capture:!0}),()=>y.removeEventListener("keydown",H,{capture:!0})},[y,L,H]),s.useEffect(()=>{if(v)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(R3=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(v)),m.layers.add(v),O8(),()=>{r&&(m.layersWithOutsidePointerEventsDisabled.delete(v),m.layersWithOutsidePointerEventsDisabled.size===0&&(y.body.style.pointerEvents=R3))}},[v,y,r,m]),s.useEffect(()=>()=>{v&&(m.layers.delete(v),m.layersWithOutsidePointerEventsDisabled.delete(v),O8())},[v,m]),s.useEffect(()=>{const D=Ar(()=>b({}),"handleUpdate");return document.addEventListener(H8,D),()=>document.removeEventListener(H8,D)},[]),o.jsx(ln.div,{...p,ref:k,style:{pointerEvents:P?$?"auto":"none":void 0,...t.style},onFocusCapture:yt(t.onFocusCapture,M.onFocusCapture),onBlurCapture:yt(t.onBlurCapture,M.onBlurCapture),onPointerDownCapture:yt(t.onPointerDownCapture,E.onPointerDownCapture)})},"DismissableLayer"));function x9(){const e=s.useContext(b9),[t,n]=s.useState(null);return s.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ar(x9,"useDismissableLayerSurface");var GD=Ar(()=>!0,"IS_TRUE");function k9(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:i,shouldHandlePointerDownOutside:c=GD}=t,u=pr(e),f=s.useRef(!1),h=s.useRef(!1),p=s.useRef(new Map),m=s.useRef(()=>{});return s.useEffect(()=>{function v(){h.current=!1,a.current=!1,p.current.clear()}Ar(v,"resetOutsideInteraction");function w(){return Array.from(p.current.values()).some(Boolean)}Ar(w,"isOutsideInteractionIntercepted");function y(j){if(!h.current)return;const N=j.target;N instanceof Node&&[...i].some($=>$.contains(N))||p.current.set(j.type,!0),j.type==="click"&&window.setTimeout(()=>{h.current&&m.current()},0)}Ar(y,"handleInteractionCapture");function b(j){h.current&&p.current.set(j.type,!1)}Ar(b,"handleInteractionBubble");const k=Ar(j=>{if(j.target&&!f.current){let N=function(){n.removeEventListener("click",m.current);const $=w();v(),$||v4(WD,u,P,{discrete:!0})};if(Ar(N,"handleAndDispatchPointerDownOutsideEvent"),!c(j.target)){n.removeEventListener("click",m.current),v(),f.current=!1;return}const P={originalEvent:j};h.current=!0,a.current=r&&j.button===0,p.current.clear(),!r||j.button!==0?N():(n.removeEventListener("click",m.current),m.current=N,n.addEventListener("click",m.current,{once:!0}))}else n.removeEventListener("click",m.current),v();f.current=!1},"handlePointerDown"),S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const j of S)n.addEventListener(j,y,!0),n.addEventListener(j,b);const C=window.setTimeout(()=>{n.addEventListener("pointerdown",k)},0);return()=>{window.clearTimeout(C),n.removeEventListener("pointerdown",k),n.removeEventListener("click",m.current);for(const j of S)n.removeEventListener(j,y,!0),n.removeEventListener(j,b)}},[n,u,r,a,i,c]),{onPointerDownCapture:Ar(()=>f.current=!0,"onPointerDownCapture")}}Ar(k9,"usePointerDownOutside");function S9(e,t=globalThis==null?void 0:globalThis.document){const n=pr(e),r=s.useRef(!1);return s.useEffect(()=>{const a=Ar(i=>{i.target&&!r.current&&v4(KD,n,{originalEvent:i},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:Ar(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Ar(()=>r.current=!1,"onBlurCapture")}}Ar(S9,"useFocusOutside");function O8(){const e=new CustomEvent(H8);document.dispatchEvent(e)}Ar(O8,"dispatchUpdate");function v4(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?m4(a,i):a.dispatchEvent(i)}Ar(v4,"handleAndDispatchCustomEvent");var YD=Object.defineProperty,os=(e,t)=>YD(e,"name",{value:t,configurable:!0}),ug="focusScope.autoFocusOnMount",dg="focusScope.autoFocusOnUnmount",P3={bubbles:!1,cancelable:!0},Yu=s.forwardRef(os(function(t,n){const{loop:r=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:c,...u}=t,[f,h]=s.useState(null),p=pr(i),m=pr(c),v=s.useRef(null),w=an(n,h),y=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(a){let k=function(N){if(y.paused||!f)return;const P=N.target;f.contains(P)?v.current=P:To(v.current,{select:!0})},S=function(N){if(y.paused||!f)return;const P=N.relatedTarget;P!==null&&(f.contains(P)||To(v.current,{select:!0}))},C=function(N){if(document.activeElement===document.body)for(const $ of N)$.removedNodes.length>0&&To(f)};os(k,"handleFocusIn"),os(S,"handleFocusOut"),os(C,"handleMutations"),document.addEventListener("focusin",k),document.addEventListener("focusout",S);const j=new MutationObserver(C);return f&&j.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",S),j.disconnect()}}},[a,f,y.paused]),s.useEffect(()=>{if(f){L3.add(y);const k=document.activeElement;if(!f.contains(k)){const C=new CustomEvent(ug,P3);f.addEventListener(ug,p),f.dispatchEvent(C),C.defaultPrevented||(E9(M9(w4(f)),{select:!0}),document.activeElement===k&&To(f))}return()=>{f.removeEventListener(ug,p),setTimeout(()=>{const C=new CustomEvent(dg,P3);f.addEventListener(dg,m),f.dispatchEvent(C),C.defaultPrevented||To(k??document.body,{select:!0}),f.removeEventListener(dg,m),L3.remove(y)},0)}}},[f,p,m,y]);const b=s.useCallback(k=>{if(!r&&!a||y.paused)return;const S=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,C=document.activeElement;if(S&&C){const j=k.currentTarget,[N,P]=C9(j);N&&P?!k.shiftKey&&C===P?(k.preventDefault(),r&&To(N,{select:!0})):k.shiftKey&&C===N&&(k.preventDefault(),r&&To(P,{select:!0})):C===j&&k.preventDefault()}},[r,a,y.paused]);return o.jsx(ln.div,{tabIndex:-1,...u,ref:w,onKeyDown:b})},"FocusScope"));function E9(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(To(r,{select:t}),document.activeElement!==n)return}os(E9,"focusFirst");function C9(e){const t=w4(e),n=I8(t,e),r=I8(t.reverse(),e);return[n,r]}os(C9,"getTabbableEdges");function w4(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:os(r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}os(w4,"getTabbableCandidates");function I8(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):j9(r,{upTo:t})))return r}os(I8,"findVisible");function j9(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}os(j9,"isHidden");function A9(e){return e instanceof HTMLInputElement&&"select"in e}os(A9,"isSelectableInput");function To(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&A9(e)&&t&&e.select()}}os(To,"focus");var L3=N9();function N9(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=F8(e,t),e.unshift(t)},remove(t){var n;e=F8(e,t),(n=e[0])==null||n.resume()}}}os(N9,"createFocusScopesStack");function F8(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}os(F8,"arrayRemove");function M9(e){return e.filter(t=>t.tagName!=="A")}os(M9,"removeLinks");var qD=Object.defineProperty,XD=(e,t)=>qD(e,"name",{value:t,configurable:!0}),Q0=s.forwardRef(XD(function(t,n){var f;const{container:r,...a}=t,[i,c]=s.useState(!1);gr(()=>c(!0),[]);const u=r||i&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return u?Rr.createPortal(o.jsx(ln.div,{...a,ref:n}),u):null},"Portal")),QD=Object.defineProperty,y4=(e,t)=>QD(e,"name",{value:t,configurable:!0}),H1=0,Qa=null;function JD(e){return qu(),e.children}y4(JD,"FocusGuards");function qu(){s.useEffect(()=>{Qa||(Qa={start:_8(),end:_8()});const{start:e,end:t}=Qa;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),H1++,()=>{H1===1&&(Qa==null||Qa.start.remove(),Qa==null||Qa.end.remove(),Qa=null),H1=Math.max(0,H1-1)}},[])}y4(qu,"useFocusGuards");function _8(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}y4(_8,"createFocusGuard");var no=function(){return no=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},no.apply(this,arguments)};function R9(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function eH(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var fh="right-scroll-bar-position",hh="width-before-scroll-bar",tH="with-scroll-bars-hidden",nH="--removed-body-scroll-bar-size";function fg(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function rH(e,t){var n=s.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var sH=typeof window<"u"?s.useLayoutEffect:s.useEffect,T3=new WeakMap;function aH(e,t){var n=rH(null,function(r){return e.forEach(function(a){return fg(a,r)})});return sH(function(){var r=T3.get(n);if(r){var a=new Set(r),i=new Set(e),c=n.current;a.forEach(function(u){i.has(u)||fg(u,null)}),i.forEach(function(u){a.has(u)||fg(u,c)})}T3.set(n,e)},[e]),n}function oH(e){return e}function iH(e,t){t===void 0&&(t=oH);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var c=t(i,r);return n.push(c),function(){n=n.filter(function(u){return u!==c})}},assignSyncMedium:function(i){for(r=!0;n.length;){var c=n;n=[],c.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){r=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(i),c=n}var f=function(){var p=c;c=[],p.forEach(i)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(p){c.push(p),h()},filter:function(p){return c=c.filter(p),n}}}};return a}function lH(e){e===void 0&&(e={});var t=iH(null);return t.options=no({async:!0,ssr:!1},e),t}var P9=function(e){var t=e.sideCar,n=R9(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return s.createElement(r,no({},n))};P9.isSideCarExport=!0;function cH(e,t){return e.useMedium(t),P9}var L9=lH(),hg=function(){},wp=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:hg,onWheelCapture:hg,onTouchMoveCapture:hg}),a=r[0],i=r[1],c=e.forwardProps,u=e.children,f=e.className,h=e.removeScrollBar,p=e.enabled,m=e.shards,v=e.sideCar,w=e.noRelative,y=e.noIsolation,b=e.inert,k=e.allowPinchZoom,S=e.as,C=S===void 0?"div":S,j=e.gapMode,N=R9(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=v,$=aH([n,t]),R=no(no({},N),a);return s.createElement(s.Fragment,null,p&&s.createElement(P,{sideCar:L9,removeScrollBar:h,shards:m,noRelative:w,noIsolation:y,inert:b,setCallbacks:i,allowPinchZoom:!!k,lockRef:n,gapMode:j}),c?s.cloneElement(s.Children.only(u),no(no({},R),{ref:$})):s.createElement(C,no({},R,{className:f,ref:$}),u))});wp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};wp.classNames={fullWidth:hh,zeroRight:fh};var uH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function dH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=uH();return t&&e.setAttribute("nonce",t),e}function fH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function hH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var pH=function(){var e=0,t=null;return{add:function(n){e==0&&(t=dH())&&(fH(t,n),hH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mH=function(){var e=pH();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},T9=function(){var e=mH(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},gH={left:0,top:0,right:0,gap:0},pg=function(e){return parseInt(e||"",10)||0},vH=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[pg(n),pg(r),pg(a)]},wH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return gH;var t=vH(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},yH=T9(),Su="data-scroll-locked",bH=function(e,t,n,r){var a=e.left,i=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
53
|
-
.`.concat(tH,` {
|
|
54
|
-
overflow: hidden `).concat(r,`;
|
|
55
|
-
padding-right: `).concat(u,"px ").concat(r,`;
|
|
56
|
-
}
|
|
57
|
-
body[`).concat(Su,`] {
|
|
58
|
-
overflow: hidden `).concat(r,`;
|
|
59
|
-
overscroll-behavior: contain;
|
|
60
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
61
|
-
padding-left: `.concat(a,`px;
|
|
62
|
-
padding-top: `).concat(i,`px;
|
|
63
|
-
padding-right: `).concat(c,`px;
|
|
64
|
-
margin-left:0;
|
|
65
|
-
margin-top:0;
|
|
66
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
67
|
-
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.`).concat(fh,` {
|
|
71
|
-
right: `).concat(u,"px ").concat(r,`;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.`).concat(hh,` {
|
|
75
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.`).concat(fh," .").concat(fh,` {
|
|
79
|
-
right: 0 `).concat(r,`;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.`).concat(hh," .").concat(hh,` {
|
|
83
|
-
margin-right: 0 `).concat(r,`;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
body[`).concat(Su,`] {
|
|
87
|
-
`).concat(nH,": ").concat(u,`px;
|
|
88
|
-
}
|
|
89
|
-
`)},$3=function(){var e=parseInt(document.body.getAttribute(Su)||"0",10);return isFinite(e)?e:0},xH=function(){s.useEffect(function(){return document.body.setAttribute(Su,($3()+1).toString()),function(){var e=$3()-1;e<=0?document.body.removeAttribute(Su):document.body.setAttribute(Su,e.toString())}},[])},kH=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;xH();var i=s.useMemo(function(){return wH(a)},[a]);return s.createElement(yH,{styles:bH(i,!t,a,n?"":"!important")})},Z8=!1;if(typeof window<"u")try{var O1=Object.defineProperty({},"passive",{get:function(){return Z8=!0,!0}});window.addEventListener("test",O1,O1),window.removeEventListener("test",O1,O1)}catch{Z8=!1}var Xc=Z8?{passive:!1}:!1,SH=function(e){return e.tagName==="TEXTAREA"},$9=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!SH(e)&&n[t]==="visible")},EH=function(e){return $9(e,"overflowY")},CH=function(e){return $9(e,"overflowX")},D3=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=D9(e,r);if(a){var i=H9(e,r),c=i[1],u=i[2];if(c>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},jH=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},AH=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},D9=function(e,t){return e==="v"?EH(t):CH(t)},H9=function(e,t){return e==="v"?jH(t):AH(t)},NH=function(e,t){return e==="h"&&t==="rtl"?-1:1},MH=function(e,t,n,r,a){var i=NH(e,window.getComputedStyle(t).direction),c=i*r,u=n.target,f=t.contains(u),h=!1,p=c>0,m=0,v=0;do{if(!u)break;var w=H9(e,u),y=w[0],b=w[1],k=w[2],S=b-k-i*y;(y||S)&&D9(e,u)&&(m+=S,v+=y);var C=u.parentNode;u=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(p&&Math.abs(m)<1||!p&&Math.abs(v)<1)&&(h=!0),h},I1=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},H3=function(e){return[e.deltaX,e.deltaY]},O3=function(e){return e&&"current"in e?e.current:e},RH=function(e,t){return e[0]===t[0]&&e[1]===t[1]},PH=function(e){return`
|
|
90
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
91
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
92
|
-
`)},LH=0,Qc=[];function TH(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),a=s.useState(LH++)[0],i=s.useState(T9)[0],c=s.useRef(e);s.useEffect(function(){c.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var b=eH([e.lockRef.current],(e.shards||[]).map(O3),!0).filter(Boolean);return b.forEach(function(k){return k.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=s.useCallback(function(b,k){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!c.current.allowPinchZoom;var S=I1(b),C=n.current,j="deltaX"in b?b.deltaX:C[0]-S[0],N="deltaY"in b?b.deltaY:C[1]-S[1],P,$=b.target,R=Math.abs(j)>Math.abs(N)?"h":"v";if("touches"in b&&R==="h"&&$.type==="range")return!1;var E=window.getSelection(),M=E&&E.anchorNode,L=M?M===$||M.contains($):!1;if(L)return!1;var H=D3(R,$);if(!H)return!0;if(H?P=R:(P=R==="v"?"h":"v",H=D3(R,$)),!H)return!1;if(!r.current&&"changedTouches"in b&&(j||N)&&(r.current=P),!P)return!0;var D=r.current||P;return MH(D,k,b,D==="h"?j:N)},[]),f=s.useCallback(function(b){var k=b;if(!(!Qc.length||Qc[Qc.length-1]!==i)){var S="deltaY"in k?H3(k):I1(k),C=t.current.filter(function(P){return P.name===k.type&&(P.target===k.target||k.target===P.shadowParent)&&RH(P.delta,S)})[0];if(C&&C.should){k.cancelable&&k.preventDefault();return}if(!C){var j=(c.current.shards||[]).map(O3).filter(Boolean).filter(function(P){return P.contains(k.target)}),N=j.length>0?u(k,j[0]):!c.current.noIsolation;N&&k.cancelable&&k.preventDefault()}}},[]),h=s.useCallback(function(b,k,S,C){var j={name:b,delta:k,target:S,should:C,shadowParent:$H(S)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(N){return N!==j})},1)},[]),p=s.useCallback(function(b){n.current=I1(b),r.current=void 0},[]),m=s.useCallback(function(b){h(b.type,H3(b),b.target,u(b,e.lockRef.current))},[]),v=s.useCallback(function(b){h(b.type,I1(b),b.target,u(b,e.lockRef.current))},[]);s.useEffect(function(){return Qc.push(i),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:v}),document.addEventListener("wheel",f,Xc),document.addEventListener("touchmove",f,Xc),document.addEventListener("touchstart",p,Xc),function(){Qc=Qc.filter(function(b){return b!==i}),document.removeEventListener("wheel",f,Xc),document.removeEventListener("touchmove",f,Xc),document.removeEventListener("touchstart",p,Xc)}},[]);var w=e.removeScrollBar,y=e.inert;return s.createElement(s.Fragment,null,y?s.createElement(i,{styles:PH(a)}):null,w?s.createElement(kH,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function $H(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const DH=cH(L9,TH);var J0=s.forwardRef(function(e,t){return s.createElement(wp,no({},e,{ref:t,sideCar:DH}))});J0.classNames=wp.classNames;var HH=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Jc=new WeakMap,F1=new WeakMap,_1={},mg=0,O9=function(e){return e&&(e.host||O9(e.parentNode))},OH=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=O9(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},IH=function(e,t,n,r){var a=OH(t,Array.isArray(e)?e:[e]);_1[n]||(_1[n]=new WeakMap);var i=_1[n],c=[],u=new Set,f=new Set(a),h=function(m){!m||u.has(m)||(u.add(m),h(m.parentNode))};a.forEach(h);var p=function(m){!m||f.has(m)||Array.prototype.forEach.call(m.children,function(v){if(u.has(v))p(v);else try{var w=v.getAttribute(r),y=w!==null&&w!=="false",b=(Jc.get(v)||0)+1,k=(i.get(v)||0)+1;Jc.set(v,b),i.set(v,k),c.push(v),b===1&&y&&F1.set(v,!0),k===1&&v.setAttribute(n,"true"),y||v.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",v,S)}})};return p(t),u.clear(),mg++,function(){c.forEach(function(m){var v=Jc.get(m)-1,w=i.get(m)-1;Jc.set(m,v),i.set(m,w),v||(F1.has(m)||m.removeAttribute(r),F1.delete(m)),w||m.removeAttribute(n)}),mg--,mg||(Jc=new WeakMap,Jc=new WeakMap,F1=new WeakMap,_1={})}},yp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=HH(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),IH(r,a,n,"aria-hidden")):function(){return null}},FH=Object.defineProperty,Us=(e,t)=>FH(e,"name",{value:t,configurable:!0}),b4="Dialog",[I9,F9]=Ms(b4),[_H,Fa]=I9(b4),hc=Us(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:c=!0}=e,u=s.useRef(null),f=s.useRef(null),[h,p]=Qo({prop:r,defaultProp:a??!1,onChange:i,caller:b4}),[m,v]=s.useState(0),[w,y]=s.useState(0);return o.jsx(_H,{scope:t,triggerRef:u,contentRef:f,contentId:da(),titleId:da(),descriptionId:da(),titlePresent:m>0,descriptionPresent:w>0,setTitleCount:v,setDescriptionCount:y,open:h,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(b=>!b),[p]),modal:c,children:n})},"Dialog"),ZH="DialogTrigger",x4=s.forwardRef(Us(function(t,n){const{__scopeDialog:r,...a}=t,i=Fa(ZH,r),c=an(n,i.triggerRef);return o.jsx(ln.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":xp(i.open),...a,ref:c,onClick:yt(t.onClick,i.onOpenToggle)})},"DialogTrigger")),_9="DialogPortal",[VH,Z9]=I9(_9,{forceMount:void 0}),pc=Us(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Fa(_9,t);return o.jsx(VH,{scope:t,forceMount:n,children:s.Children.map(r,c=>o.jsx(es,{present:n||i.open,children:o.jsx(Q0,{asChild:!0,container:a,children:c})}))})},"DialogPortal"),V8="DialogOverlay",mc=s.forwardRef(Us(function(t,n){const r=Z9(V8,t.__scopeDialog),{forceMount:a=r.forceMount,...i}=t,c=Fa(V8,t.__scopeDialog);return c.modal?o.jsx(es,{present:a||c.open,children:o.jsx(BH,{...i,ref:n})}):null},"DialogOverlay")),zH=$a("DialogOverlay.RemoveScroll"),BH=s.forwardRef(Us(function(t,n){const{__scopeDialog:r,...a}=t,i=Fa(V8,r),c=x9(),u=an(n,c);return o.jsx(J0,{as:zH,allowPinchZoom:!0,shards:[i.contentRef],children:o.jsx(ln.div,{"data-state":xp(i.open),...a,ref:u,style:{pointerEvents:"auto",...a.style}})})},"DialogOverlayImpl")),k0="DialogContent",gc=s.forwardRef(Us(function(t,n){const r=Z9(k0,t.__scopeDialog),{forceMount:a=r.forceMount,...i}=t,c=Fa(k0,t.__scopeDialog);return o.jsx(es,{present:a||c.open,children:c.modal?o.jsx(UH,{...i,ref:n}):o.jsx(WH,{...i,ref:n})})},"DialogContent")),UH=s.forwardRef(Us(function(t,n){const r=Fa(k0,t.__scopeDialog),a=s.useRef(null),i=an(n,r.contentRef,a);return s.useEffect(()=>{const c=a.current;if(c)return yp(c)},[]),o.jsx(V9,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:yt(t.onCloseAutoFocus,c=>{var u;c.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:yt(t.onPointerDownOutside,c=>{const u=c.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&c.preventDefault()}),onFocusOutside:yt(t.onFocusOutside,c=>c.preventDefault())})},"DialogContentModal")),WH=s.forwardRef(Us(function(t,n){const r=Fa(k0,t.__scopeDialog),a=s.useRef(!1),i=s.useRef(!1);return o.jsx(V9,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{var u,f;(u=t.onCloseAutoFocus)==null||u.call(t,c),c.defaultPrevented||(a.current||(f=r.triggerRef.current)==null||f.focus(),c.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:c=>{var h,p;(h=t.onInteractOutside)==null||h.call(t,c),c.defaultPrevented||(a.current=!0,c.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=c.target;((p=r.triggerRef.current)==null?void 0:p.contains(u))&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&i.current&&c.preventDefault()}})},"DialogContentNonModal")),V9=s.forwardRef(Us(function(t,n){const{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:c,...u}=t,f=Fa(k0,r);return qu(),o.jsx(o.Fragment,{children:o.jsx(Yu,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:c,children:o.jsx(X0,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionPresent?f.descriptionId:void 0,"aria-labelledby":f.titlePresent?f.titleId:void 0,"data-state":xp(f.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1)})})})},"DialogContentImpl")),KH="DialogTitle",vc=s.forwardRef(Us(function(t,n){const{__scopeDialog:r,...a}=t,i=Fa(KH,r),{setTitleCount:c}=i;return gr(()=>(c(u=>u+1),()=>c(u=>u-1)),[c]),o.jsx(ln.h2,{id:i.titleId,...a,ref:n})},"DialogTitle")),GH="DialogDescription",k4=s.forwardRef(Us(function(t,n){const{__scopeDialog:r,...a}=t,i=Fa(GH,r),{setDescriptionCount:c}=i;return gr(()=>(c(u=>u+1),()=>c(u=>u-1)),[c]),o.jsx(ln.p,{id:i.descriptionId,...a,ref:n})},"DialogDescription")),YH="DialogClose",bp=s.forwardRef(Us(function(t,n){const{__scopeDialog:r,...a}=t,i=Fa(YH,r);return o.jsx(ln.button,{type:"button",...a,ref:n,onClick:yt(t.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function xp(e){return e?"open":"closed"}Us(xp,"getState");var qH=Object.defineProperty,oi=(e,t)=>qH(e,"name",{value:t,configurable:!0}),XH="AlertDialog",[QH,Dle]=Ms(XH,[F9]),ii=F9(),JH=oi(e=>{const{__scopeAlertDialog:t,...n}=e,r=ii(t);return o.jsx(hc,{...r,...n,modal:!0})},"AlertDialog"),eO=s.forwardRef(oi(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=ii(r);return o.jsx(x4,{...i,...a,ref:n})},"AlertDialogTrigger")),tO=oi(e=>{const{__scopeAlertDialog:t,...n}=e,r=ii(t);return o.jsx(pc,{...r,...n})},"AlertDialogPortal"),nO=s.forwardRef(oi(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=ii(r);return o.jsx(mc,{...i,...a,ref:n})},"AlertDialogOverlay")),rO="AlertDialogContent",[sO,aO]=QH(rO),oO=s.forwardRef(oi(function(t,n){const{__scopeAlertDialog:r,children:a,...i}=t,c=ii(r),u=s.useRef(null),f=an(n,u),h=s.useRef(null);return o.jsx(sO,{scope:r,cancelRef:h,children:o.jsx(gc,{role:"alertdialog",...c,...i,ref:f,onOpenAutoFocus:yt(i.onOpenAutoFocus,p=>{var m;p.preventDefault(),(m=h.current)==null||m.focus({preventScroll:!0})}),onPointerDownOutside:p=>p.preventDefault(),onInteractOutside:p=>p.preventDefault(),children:a})})},"AlertDialogContent")),iO=s.forwardRef(oi(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=ii(r);return o.jsx(vc,{...i,...a,ref:n})},"AlertDialogTitle")),lO=s.forwardRef(oi(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=ii(r);return o.jsx(k4,{...i,...a,ref:n})},"AlertDialogDescription")),cO=s.forwardRef(oi(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=ii(r);return o.jsx(bp,{...i,...a,ref:n})},"AlertDialogAction")),uO="AlertDialogCancel",dO=s.forwardRef(oi(function(t,n){const{__scopeAlertDialog:r,...a}=t,{cancelRef:i}=aO(uO,r),c=ii(r),u=an(n,i);return o.jsx(bp,{...c,...a,ref:u})},"AlertDialogCancel")),fO=JH,hO=eO,pO=tO,mO=nO,gO=oO,vO=cO,wO=dO,yO=iO,bO=lO,xO=Object.defineProperty,kO=(e,t)=>xO(e,"name",{value:t,configurable:!0});function z9(e){const[t,n]=s.useState(void 0);return gr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let c,u;if("borderBoxSize"in i){const f=i.borderBoxSize,h=Array.isArray(f)?f[0]:f;c=h.inlineSize,u=h.blockSize}else c=e.offsetWidth,u=e.offsetHeight;n({width:c,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}kO(z9,"useSize");const SO=["top","right","bottom","left"],Yi=Math.min,Vo=Math.max,Ch=Math.round,Z1=Math.floor,zo=e=>({x:e,y:e}),EO={left:"right",right:"left",bottom:"top",top:"bottom"};function B9(e,t,n){return Vo(e,Yi(t,n))}function ei(e,t){return typeof e=="function"?e(t):e}function qi(e){return e.split("-")[0]}function Xu(e){return e.split("-")[1]}function S4(e){return e==="x"?"y":"x"}function E4(e){return e==="y"?"height":"width"}function so(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function C4(e){return S4(so(e))}function CO(e,t,n){n===void 0&&(n=!1);const r=Xu(e),a=C4(e),i=E4(a);let c=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(c=jh(c)),[c,jh(c)]}function jO(e){const t=jh(e);return[z8(e),t,z8(t)]}function z8(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const I3=["left","right"],F3=["right","left"],AO=["top","bottom"],NO=["bottom","top"];function MO(e,t,n){switch(e){case"top":case"bottom":return n?t?F3:I3:t?I3:F3;case"left":case"right":return t?AO:NO;default:return[]}}function RO(e,t,n,r){const a=Xu(e);let i=MO(qi(e),n==="start",r);return a&&(i=i.map(c=>c+"-"+a),t&&(i=i.concat(i.map(z8)))),i}function jh(e){const t=qi(e);return EO[t]+e.slice(t.length)}function PO(e){var t,n,r,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(a=e.left)!=null?a:0}}function U9(e){return typeof e!="number"?PO(e):{top:e,right:e,bottom:e,left:e}}function Ah(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function _3(e,t,n){let{reference:r,floating:a}=e;const i=so(t),c=C4(t),u=E4(c),f=qi(t),h=i==="y",p=r.x+r.width/2-a.width/2,m=r.y+r.height/2-a.height/2,v=r[u]/2-a[u]/2;let w;switch(f){case"top":w={x:p,y:r.y-a.height};break;case"bottom":w={x:p,y:r.y+r.height};break;case"right":w={x:r.x+r.width,y:m};break;case"left":w={x:r.x-a.width,y:m};break;default:w={x:r.x,y:r.y}}const y=Xu(t);return y&&(w[c]+=v*(y==="end"?1:-1)*(n&&h?-1:1)),w}async function LO(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:c,elements:u,strategy:f}=e,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:v=!1,padding:w=0}=ei(t,e),y=U9(w),k=u[v?m==="floating"?"reference":"floating":m],S=Ah(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(k)))==null||n?k:k.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:h,rootBoundary:p,strategy:f})),C=m==="floating"?{x:r,y:a,width:c.floating.width,height:c.floating.height}:c.reference,j=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),N=await(i.isElement==null?void 0:i.isElement(j))&&await(i.getScale==null?void 0:i.getScale(j))||{x:1,y:1},P=Ah(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:C,offsetParent:j,strategy:f}):C);return{top:(S.top-P.top+y.top)/N.y,bottom:(P.bottom-S.bottom+y.bottom)/N.y,left:(S.left-P.left+y.left)/N.x,right:(P.right-S.right+y.right)/N.x}}const TO=50,$O=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:c}=n,u=c.detectOverflow?c:{...c,detectOverflow:LO},f=await(c.isRTL==null?void 0:c.isRTL(t));let h=await c.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:m}=_3(h,r,f),v=r,w=0;const y={};for(let b=0;b<i.length;b++){const k=i[b];if(!k)continue;const{name:S,fn:C}=k,{x:j,y:N,data:P,reset:$}=await C({x:p,y:m,initialPlacement:r,placement:v,strategy:a,middlewareData:y,rects:h,platform:u,elements:{reference:e,floating:t}});p=j??p,m=N??m,y[S]={...y[S],...P},$&&w<TO&&(w++,typeof $=="object"&&($.placement&&(v=$.placement),$.rects&&(h=$.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:a}):$.rects),{x:p,y:m}=_3(h,v,f)),b=-1)}return{x:p,y:m,placement:v,strategy:a,middlewareData:y}},DO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:c,elements:u,middlewareData:f}=t,{element:h,padding:p=0}=ei(e,t)||{};if(h==null)return{};const m=U9(p),v={x:n,y:r},w=C4(a),y=E4(w),b=await c.getDimensions(h),k=w==="y",S=k?"top":"left",C=k?"bottom":"right",j=k?"clientHeight":"clientWidth",N=i.reference[y]+i.reference[w]-v[w]-i.floating[y],P=v[w]-i.reference[w],$=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h));let R=$?$[j]:0;(!R||!await(c.isElement==null?void 0:c.isElement($)))&&(R=u.floating[j]||i.floating[y]);const E=N/2-P/2,M=R/2-b[y]/2-1,L=Yi(m[S],M),H=Yi(m[C],M),D=R-b[y]-H,K=R/2-b[y]/2+E,O=B9(L,K,D),_=!f.arrow&&Xu(a)!=null&&K!==O&&i.reference[y]/2-(K<L?L:H)-b[y]/2<0,re=_?K<L?K-L:K-D:0;return{[w]:v[w]+re,data:{[w]:O,centerOffset:K-O-re,..._&&{alignmentOffset:re}},reset:_}}}),HO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:c,initialPlacement:u,platform:f,elements:h}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:v,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:b=!0,...k}=ei(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=qi(a),C=so(u),j=qi(u)===u,N=await(f.isRTL==null?void 0:f.isRTL(h.floating)),P=v||(j||!b?[jh(u)]:jO(u)),$=y!=="none";!v&&$&&P.push(...RO(u,b,y,N));const R=[u,...P],E=await f.detectOverflow(t,k),M=[];let L=((r=i.flip)==null?void 0:r.overflows)||[];if(p&&M.push(E[S]),m){const O=CO(a,c,N);M.push(E[O[0]],E[O[1]])}if(L=[...L,{placement:a,overflows:M}],!M.every(O=>O<=0)){var H,D;const O=(((H=i.flip)==null?void 0:H.index)||0)+1,_=R[O];if(_&&(!(m==="alignment"?C!==so(_):!1)||L.every(F=>so(F.placement)===C?F.overflows[0]>0:!0)))return{data:{index:O,overflows:L},reset:{placement:_}};let re=(D=L.filter(z=>z.overflows[0]<=0).sort((z,F)=>z.overflows[1]-F.overflows[1])[0])==null?void 0:D.placement;if(!re)switch(w){case"bestFit":{var K;const z=(K=L.filter(F=>{if($){const Q=so(F.placement);return Q===C||Q==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(Q=>Q>0).reduce((Q,V)=>Q+V,0)]).sort((F,Q)=>F[1]-Q[1])[0])==null?void 0:K[0];z&&(re=z);break}case"initialPlacement":re=u;break}if(a!==re)return{reset:{placement:re}}}return{}}}};function Z3(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function V3(e){return SO.some(t=>e[t]>=0)}const OO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=ei(e,t);switch(a){case"referenceHidden":{const c=await r.detectOverflow(t,{...i,elementContext:"reference"}),u=Z3(c,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:V3(u)}}}case"escaped":{const c=await r.detectOverflow(t,{...i,altBoundary:!0}),u=Z3(c,n.floating);return{data:{escapedOffsets:u,escaped:V3(u)}}}default:return{}}}}},W9=new Set(["left","top"]);async function IO(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),c=qi(n),u=Xu(n),f=so(n)==="y",h=W9.has(c)?-1:1,p=i&&f?-1:1,m=ei(t,e);let{mainAxis:v,crossAxis:w,alignmentAxis:y}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof y=="number"&&(w=u==="end"?y*-1:y),f?{x:w*p,y:v*h}:{x:v*h,y:w*p}}const FO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:c,middlewareData:u}=t,f=await IO(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:i+f.y,data:{...f,placement:c}}}}},_O=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:i}=t,{mainAxis:c=!0,crossAxis:u=!1,limiter:f={fn:C=>{let{x:j,y:N}=C;return{x:j,y:N}}},...h}=ei(e,t),p={x:n,y:r},m=await i.detectOverflow(t,h),v=so(a),w=S4(v);let y=p[w],b=p[v];const k=(C,j)=>B9(j+m[C==="y"?"top":"left"],j,j-m[C==="y"?"bottom":"right"]);c&&(y=k(w,y)),u&&(b=k(v,b));const S=f.fn({...t,[w]:y,[v]:b});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[w]:c,[v]:u}}}}}},ZO=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:a,y:i,placement:c,rects:u,middlewareData:f}=t,{offset:h=0,mainAxis:p=!0,crossAxis:m=!0}=ei(e,t),v={x:a,y:i},w=so(c),y=S4(w);let b=v[y],k=v[w];const S=ei(h,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(p){const P=y==="y"?"height":"width",$=u.reference[y]-u.floating[P]+C.mainAxis,R=u.reference[y]+u.reference[P]-C.mainAxis;b<$?b=$:b>R&&(b=R)}if(m){var j,N;const P=y==="y"?"width":"height",$=W9.has(qi(c)),R=u.reference[w]-u.floating[P]+($&&((j=f.offset)==null?void 0:j[w])||0)+($?0:C.crossAxis),E=u.reference[w]+u.reference[P]+($?0:((N=f.offset)==null?void 0:N[w])||0)-($?C.crossAxis:0);k<R?k=R:k>E&&(k=E)}return{[y]:b,[w]:k}}}},VO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:a,elements:i}=t,{apply:c=()=>{},...u}=ei(e,t),f=await a.detectOverflow(t,u),h=qi(n),p=Xu(n),m=so(n)==="y",{width:v,height:w}=r.floating;let y,b;h==="top"||h==="bottom"?(y=h,b=p===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(b=h,y=p==="end"?"top":"bottom");const k=w-f.top-f.bottom,S=v-f.left-f.right,C=Yi(w-f[y],k),j=Yi(v-f[b],S),N=t.middlewareData.shift,P=!N;let $=C,R=j;N!=null&&N.enabled.x&&(R=S),N!=null&&N.enabled.y&&($=k),P&&!p&&(m?R=v-2*Vo(f.left,f.right):$=w-2*Vo(f.top,f.bottom)),await c({...t,availableWidth:R,availableHeight:$});const E=await a.getDimensions(i.floating);return v!==E.width||w!==E.height?{reset:{rects:!0}}:{}}}};function kp(){return typeof window<"u"}function Qu(e){return K9(e)?(e.nodeName||"").toLowerCase():"#document"}function ks(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function li(e){var t;return(t=(K9(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function K9(e){return kp()?e instanceof Node||e instanceof ks(e).Node:!1}function ho(e){return kp()?e instanceof Element||e instanceof ks(e).Element:!1}function nl(e){return kp()?e instanceof HTMLElement||e instanceof ks(e).HTMLElement:!1}function z3(e){return!kp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ks(e).ShadowRoot}function Sp(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=po(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function zO(e){return/^(table|td|th)$/.test(Qu(e))}function Ep(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const BO=/transform|translate|scale|rotate|perspective|filter/,UO=/paint|layout|strict|content/,Al=e=>!!e&&e!=="none";let gg;function j4(e){const t=ho(e)?po(e):e;return Al(t.transform)||Al(t.translate)||Al(t.scale)||Al(t.rotate)||Al(t.perspective)||!A4()&&(Al(t.backdropFilter)||Al(t.filter))||BO.test(t.willChange||"")||UO.test(t.contain||"")}function WO(e){let t=ql(e);for(;nl(t)&&!S0(t);){if(j4(t))return t;if(Ep(t))return null;t=ql(t)}return null}function A4(){return gg==null&&(gg=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),gg}function S0(e){return/^(html|body|#document)$/.test(Qu(e))}function po(e){return ks(e).getComputedStyle(e)}function Cp(e){return ho(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ql(e){if(Qu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||z3(e)&&e.host||li(e);return z3(t)?t.host:t}function G9(e){const t=ql(e);return S0(t)?(e.ownerDocument||e).body:nl(t)&&Sp(t)?t:G9(t)}function E0(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=G9(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),c=ks(a);if(i){const u=B8(c);return t.concat(c,c.visualViewport||[],Sp(a)?a:[],u&&n?E0(u):[])}else return t.concat(a,E0(a,[],n))}function B8(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Y9(e){const t=po(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=nl(e),i=a?e.offsetWidth:n,c=a?e.offsetHeight:r,u=Ch(n)!==i||Ch(r)!==c;return u&&(n=i,r=c),{width:n,height:r,$:u}}function N4(e){return ho(e)?e:e.contextElement}function Eu(e){const t=N4(e);if(!nl(t))return zo(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=Y9(t);let c=(i?Ch(n.width):n.width)/r,u=(i?Ch(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const KO=zo(0);function q9(e){const t=ks(e);return!A4()||!t.visualViewport?KO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function GO(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ks(e)}function Xl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=N4(e);let c=zo(1);t&&(r?ho(r)&&(c=Eu(r)):c=Eu(e));const u=GO(i,n,r)?q9(i):zo(0);let f=(a.left+u.x)/c.x,h=(a.top+u.y)/c.y,p=a.width/c.x,m=a.height/c.y;if(i&&r){const v=ks(i),w=ho(r)?ks(r):r;let y=v,b=B8(y);for(;b&&w!==y;){const k=Eu(b),S=b.getBoundingClientRect(),C=po(b),j=S.left+(b.clientLeft+parseFloat(C.paddingLeft))*k.x,N=S.top+(b.clientTop+parseFloat(C.paddingTop))*k.y;f*=k.x,h*=k.y,p*=k.x,m*=k.y,f+=j,h+=N,y=ks(b),b=B8(y)}}return Ah({width:p,height:m,x:f,y:h})}function jp(e,t){const n=Cp(e).scrollLeft;return t?t.left+n:Xl(li(e)).left+n}function X9(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-jp(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function YO(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",c=li(r),u=t?Ep(t.floating):!1;if(r===c||u&&i)return n;let f={scrollLeft:0,scrollTop:0},h=zo(1);const p=zo(0),m=nl(r);if((m||!i)&&((Qu(r)!=="body"||Sp(c))&&(f=Cp(r)),m)){const w=Xl(r);h=Eu(r),p.x=w.x+r.clientLeft,p.y=w.y+r.clientTop}const v=c&&!m&&!i?X9(c,f):zo(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+p.x+v.x,y:n.y*h.y-f.scrollTop*h.y+p.y+v.y}}function qO(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function XO(e){const t=Cp(e),n=e.ownerDocument.body,r=Vo(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=Vo(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+jp(e);const c=-t.scrollTop;return po(n).direction==="rtl"&&(i+=Vo(e.clientWidth,n.clientWidth)-r),{width:r,height:a,x:i,y:c}}const QO=25;function JO(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",a=ks(e),i=li(e),c=a.visualViewport;let u=i.clientWidth,f=i.clientHeight,h=0,p=0;if(c){const v=!A4()||t==="fixed";r?v||(h=-c.offsetLeft,p=-c.offsetTop):(u=c.width,f=c.height,v&&(h=c.offsetLeft,p=c.offsetTop))}if(jp(i)<=0){const v=i.ownerDocument,w=v.body,y=getComputedStyle(w),b=v.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,k=Math.abs(i.clientWidth-w.clientWidth-b),S=getComputedStyle(i).scrollbarGutter==="stable both-edges"?k/2:k;S<=QO&&(u-=S)}return{width:u,height:f,x:h,y:p}}function eI(e,t){const n=Xl(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Eu(e),c=e.clientWidth*i.x,u=e.clientHeight*i.y,f=a*i.x,h=r*i.y;return{width:c,height:u,x:f,y:h}}function B3(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=JO(e,n,t);else if(t==="document")r=XO(li(e));else if(ho(t))r=eI(t,n);else{const a=q9(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Ah(r)}function tI(e,t){const n=t.get(e);if(n)return n;let r=E0(e,[],!1).filter(u=>ho(u)&&Qu(u)!=="body"),a=null;const i=po(e).position==="fixed";let c=i?ql(e):e;for(;ho(c)&&!S0(c);){const u=po(c),f=j4(c),h=a?a.position:i?"fixed":"";!f&&(h==="fixed"||h==="absolute"&&u.position==="static")?r=r.filter(m=>m!==c):a=u,c=ql(c)}return t.set(e,r),r}function nI(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const c=[...n==="clippingAncestors"?Ep(t)?[]:tI(t,this._c):[].concat(n),r],u=B3(t,c[0],a);let f=u.top,h=u.right,p=u.bottom,m=u.left;for(let v=1;v<c.length;v++){const w=B3(t,c[v],a);f=Vo(w.top,f),h=Yi(w.right,h),p=Yi(w.bottom,p),m=Vo(w.left,m)}return{width:h-m,height:p-f,x:m,y:f}}function rI(e){const{width:t,height:n}=Y9(e);return{width:t,height:n}}function sI(e,t,n){const r=nl(t),a=li(t),i=n==="fixed",c=Xl(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const f=zo(0);if((r||!i)&&((Qu(t)!=="body"||Sp(a))&&(u=Cp(t)),r)){const v=Xl(t,!0,i,t);f.x=v.x+t.clientLeft,f.y=v.y+t.clientTop}!r&&a&&(f.x=jp(a));const h=a&&!r&&!i?X9(a,u):zo(0),p=c.left+u.scrollLeft-f.x-h.x,m=c.top+u.scrollTop-f.y-h.y;return{x:p,y:m,width:c.width,height:c.height}}function vg(e){return po(e).position==="static"}function U3(e,t){if(!nl(e)||po(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return li(e)===n&&(n=n.ownerDocument.body),n}function Q9(e,t){const n=ks(e);if(Ep(e))return n;if(!nl(e)){let a=ql(e);for(;a&&!S0(a);){if(ho(a)&&!vg(a))return a;a=ql(a)}return n}let r=U3(e,t);for(;r&&zO(r)&&vg(r);)r=U3(r,t);return r&&S0(r)&&vg(r)&&!j4(r)?n:r||WO(e)||n}const aI=async function(e){const t=this.getOffsetParent||Q9,n=this.getDimensions,r=await n(e.floating);return{reference:sI(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function oI(e){return po(e).direction==="rtl"}const iI={convertOffsetParentRelativeRectToViewportRelativeRect:YO,getDocumentElement:li,getClippingRect:nI,getOffsetParent:Q9,getElementRects:aI,getClientRects:qO,getDimensions:rI,getScale:Eu,isElement:ho,isRTL:oI};function J9(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function lI(e,t,n){let r=null,a;const i=li(e);function c(){var p;clearTimeout(a),(p=r)==null||p.disconnect(),r=null}function u(p,m){p===void 0&&(p=!1),m===void 0&&(m=1),c();const v=e.getBoundingClientRect(),{left:w,top:y,width:b,height:k}=v;if(p||t(),!b||!k)return;const S=Z1(y),C=Z1(i.clientWidth-(w+b)),j=Z1(i.clientHeight-(y+k)),N=Z1(w),$={rootMargin:-S+"px "+-C+"px "+-j+"px "+-N+"px",threshold:Vo(0,Yi(1,m))||1};let R=!0;function E(M){const L=M[0].intersectionRatio;if(!J9(v,e.getBoundingClientRect()))return u();if(L!==m){if(!R)return u();L?u(!1,L):a=setTimeout(()=>{u(!1,1e-7)},1e3)}R=!1}try{r=new IntersectionObserver(E,{...$,root:i.ownerDocument})}catch{r=new IntersectionObserver(E,$)}r.observe(e)}const f=ks(e),h=()=>u(n);return f.addEventListener("resize",h),u(!0),()=>{f.removeEventListener("resize",h),c()}}function eE(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,h=N4(e),p=a||i?[...h?E0(h):[],...t?E0(t):[]]:[];p.forEach(S=>{a&&S.addEventListener("scroll",n),i&&S.addEventListener("resize",n)});const m=h&&u?lI(h,n,i):null;let v=-1,w=null;c&&(w=new ResizeObserver(S=>{let[C]=S;C&&C.target===h&&w&&t&&(w.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var j;(j=w)==null||j.observe(t)})),n()}),h&&!f&&w.observe(h),t&&w.observe(t));let y,b=f?Xl(e):null;f&&k();function k(){const S=Xl(e);b&&!J9(b,S)&&n(),b=S,y=requestAnimationFrame(k)}return n(),()=>{var S;p.forEach(C=>{a&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),m==null||m(),(S=w)==null||S.disconnect(),w=null,f&&cancelAnimationFrame(y)}}const tE=FO,nE=_O,rE=HO,cI=VO,uI=OO,U8=DO,dI=ZO,sE=(e,t,n)=>{const r=new Map,a=n??{},i={...iI,...a.platform,_c:r};return $O(e,t,{...a,platform:i})};var fI=typeof document<"u",hI=function(){},ph=fI?s.useLayoutEffect:hI;function Nh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Nh(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Nh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function aE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function W3(e,t){const n=aE(e);return Math.round(t*n)/n}function wg(e){const t=s.useRef(e);return ph(()=>{t.current=e}),t}function pI(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:c}={},transform:u=!0,whileElementsMounted:f,open:h}=e,[p,m]=s.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,w]=s.useState(r);Nh(v,r)||w(r);const[y,b]=s.useState(null),[k,S]=s.useState(null),C=s.useCallback(F=>{F!==$.current&&($.current=F,b(F))},[]),j=s.useCallback(F=>{F!==R.current&&(R.current=F,S(F))},[]),N=i||y,P=c||k,$=s.useRef(null),R=s.useRef(null),E=s.useRef(p),M=f!=null,L=wg(f),H=wg(a),D=wg(h),K=s.useCallback(()=>{if(!$.current||!R.current)return;const F={placement:t,strategy:n,middleware:v};H.current&&(F.platform=H.current),sE($.current,R.current,F).then(Q=>{const V={...Q,isPositioned:D.current!==!1};O.current&&!Nh(E.current,V)&&(E.current=V,Rr.flushSync(()=>{m(V)}))})},[v,t,n,H,D]);ph(()=>{h===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,m(F=>({...F,isPositioned:!1})))},[h]);const O=s.useRef(!1);ph(()=>(O.current=!0,()=>{O.current=!1}),[]),ph(()=>{if(N&&($.current=N),P&&(R.current=P),N&&P){if(L.current)return L.current(N,P,K);K()}},[N,P,K,L,M]);const _=s.useMemo(()=>({reference:$,floating:R,setReference:C,setFloating:j}),[C,j]),re=s.useMemo(()=>({reference:N,floating:P}),[N,P]),z=s.useMemo(()=>{const F={position:n,left:0,top:0};if(!re.floating)return F;const Q=W3(re.floating,p.x),V=W3(re.floating,p.y);return u?{...F,transform:"translate("+Q+"px, "+V+"px)",...aE(re.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:V}},[n,u,re.floating,p.x,p.y]);return s.useMemo(()=>({...p,update:K,refs:_,elements:re,floatingStyles:z}),[p,K,_,re,z])}const mI=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?U8({element:r.current,padding:a}).fn(n):{}:r?U8({element:r,padding:a}).fn(n):{}}}},gI=(e,t)=>{const n=tE(e);return{name:n.name,fn:n.fn,options:[e,t]}},vI=(e,t)=>{const n=nE(e);return{name:n.name,fn:n.fn,options:[e,t]}},wI=(e,t)=>({fn:dI(e).fn,options:[e,t]}),yI=(e,t)=>{const n=rE(e);return{name:n.name,fn:n.fn,options:[e,t]}},bI=(e,t)=>{const n=cI(e);return{name:n.name,fn:n.fn,options:[e,t]}},xI=(e,t)=>{const n=uI(e);return{name:n.name,fn:n.fn,options:[e,t]}},kI=(e,t)=>{const n=mI(e);return{name:n.name,fn:n.fn,options:[e,t]}};var SI=Object.defineProperty,EI=(e,t)=>SI(e,"name",{value:t,configurable:!0}),CI=s.forwardRef(EI(function(t,n){const{children:r,width:a=10,height:i=5,...c}=t;return o.jsx(ln.svg,{...c,ref:n,width:a,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:o.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),jI=CI,AI=Object.defineProperty,Bo=(e,t)=>AI(e,"name",{value:t,configurable:!0}),oE="Popper",[iE,rl]=Ms(oE),[NI,lE]=iE(oE),MI=Bo(e=>{const{__scopePopper:t,children:n}=e,[r,a]=s.useState(null),[i,c]=s.useState(void 0);return o.jsx(NI,{scope:t,anchor:r,onAnchorChange:a,placementState:i,setPlacementState:c,children:n})},"Popper"),RI="PopperAnchor",PI=s.forwardRef(Bo(function(t,n){const{__scopePopper:r,virtualRef:a,...i}=t,c=lE(RI,r),u=s.useRef(null),f=c.onAnchorChange,h=s.useCallback(b=>{u.current=b,b&&f(b)},[f]),p=an(n,h),m=s.useRef(null);s.useEffect(()=>{if(!a)return;const b=m.current;m.current=a.current,b!==m.current&&f(m.current)});const v=c.placementState&&Ap(c.placementState),w=v==null?void 0:v[0],y=v==null?void 0:v[1];return a?null:o.jsx(ln.div,{"data-radix-popper-side":w,"data-radix-popper-align":y,...i,ref:p})},"PopperAnchor")),cE="PopperContent",[LI,TI]=iE(cE),$I=s.forwardRef(Bo(function(t,n){var be,G,J,ne,W,he,Xe;const{__scopePopper:r,side:a="bottom",sideOffset:i=0,align:c="center",alignOffset:u=0,arrowPadding:f=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:m=0,sticky:v="partial",hideWhenDetached:w=!1,updatePositionStrategy:y="optimized",onPlaced:b,...k}=t,S=lE(cE,r),[C,j]=s.useState(null),N=an(n,j),[P,$]=s.useState(null),R=z9(P),E=(R==null?void 0:R.width)??0,M=(R==null?void 0:R.height)??0,L=a+(c!=="center"?"-"+c:""),H=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},D=Array.isArray(p)?p:[p],K=D.length>0,O={padding:H,boundary:D.filter(uE),altBoundary:K},{refs:_,floatingStyles:re,placement:z,isPositioned:F,middlewareData:Q}=pI({strategy:"fixed",placement:L,whileElementsMounted:Bo((...tt)=>eE(...tt,{animationFrame:y==="always"}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[gI({mainAxis:i+M,alignmentAxis:u}),h&&vI({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?wI():void 0,...O}),h&&yI({...O}),bI({...O,apply:Bo(({elements:tt,rects:ze,availableWidth:nt,availableHeight:ce})=>{const{width:ve,height:Pe}=ze.reference,ue=tt.floating.style;ue.setProperty("--radix-popper-available-width",`${nt}px`),ue.setProperty("--radix-popper-available-height",`${ce}px`),ue.setProperty("--radix-popper-anchor-width",`${ve}px`),ue.setProperty("--radix-popper-anchor-height",`${Pe}px`)},"apply")}),P&&kI({element:P,padding:f}),II({arrowWidth:E,arrowHeight:M}),w&&xI({strategy:"referenceHidden",...O,boundary:K?O.boundary:void 0})]}),V=S.setPlacementState;gr(()=>(V(z),()=>{V(void 0)}),[z,V]);const[I,B]=Ap(z),Y=pr(b);gr(()=>{F&&(Y==null||Y())},[F,Y]);const ae=(be=Q.arrow)==null?void 0:be.x,X=(G=Q.arrow)==null?void 0:G.y,le=((J=Q.arrow)==null?void 0:J.centerOffset)!==0,[ke,te]=s.useState();return gr(()=>{C&&te(window.getComputedStyle(C).zIndex)},[C]),o.jsx("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...re,transform:F?re.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ke,"--radix-popper-transform-origin":[(ne=Q.transformOrigin)==null?void 0:ne.x,(W=Q.transformOrigin)==null?void 0:W.y].join(" "),...((he=Q.hide)==null?void 0:he.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:o.jsx(LI,{scope:r,placedSide:I,placedAlign:B,onArrowChange:$,arrowX:ae,arrowY:X,shouldHideArrow:le,children:o.jsx(ln.div,{"data-side":I,"data-align":B,...k,ref:N,style:{...k.style,animation:F?(Xe=k.style)==null?void 0:Xe.animation:"none"}})})})},"PopperContent")),DI="PopperArrow",HI={top:"bottom",right:"left",bottom:"top",left:"right"},OI=s.forwardRef(Bo(function(t,n){const{__scopePopper:r,...a}=t,i=TI(DI,r),c=HI[i.placedSide];return o.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:o.jsx(jI,{...a,ref:n,style:{...a.style,display:"block"}})})},"PopperArrow"));function uE(e){return e!==null}Bo(uE,"isNotNull");var II=Bo(e=>({name:"transformOrigin",options:e,fn(t){var k,S,C;const{placement:n,rects:r,middlewareData:a}=t,c=((k=a.arrow)==null?void 0:k.centerOffset)!==0,u=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[h,p]=Ap(n),m={start:"0%",center:"50%",end:"100%"}[p],v=(((S=a.arrow)==null?void 0:S.x)??0)+u/2,w=(((C=a.arrow)==null?void 0:C.y)??0)+f/2;let y="",b="";return h==="bottom"?(y=c?m:`${v}px`,b=`${-f}px`):h==="top"?(y=c?m:`${v}px`,b=`${r.floating.height+f}px`):h==="right"?(y=`${-f}px`,b=c?m:`${w}px`):h==="left"&&(y=`${r.floating.width+f}px`,b=c?m:`${w}px`),{data:{x:y,y:b}}}}),"transformOrigin");function Ap(e){const[t,n="center"]=e.split("-");return[t,n]}Bo(Ap,"getSideAndAlignFromPlacement");var Np=MI,ef=PI,Mp=$I,FI=OI,_I=Object.defineProperty,M4=(e,t)=>_I(e,"name",{value:t,configurable:!0}),yg=!1;function dE(){const[e,t]=s.useState(yg);return s.useEffect(()=>{yg||(yg=!0,t(!0))},[]),e}M4(dE,"useIsHydrated");var fE=lc[" useSyncExternalStore ".trim().toString()];function hE(){return()=>{}}M4(hE,"subscribe");function pE(){return fE(hE,()=>!0,()=>!1)}M4(pE,"useIsHydratedModern");var ZI=typeof fE=="function"?pE:dE,VI=Object.defineProperty,wc=(e,t)=>VI(e,"name",{value:t,configurable:!0}),bg="rovingFocusGroup.onEntryFocus",zI={bubbles:!1,cancelable:!0},Rp="RovingFocusGroup",[W8,mE,BI]=vp(Rp),[UI,gE]=Ms(Rp,[BI]),[WI,KI]=UI(Rp),GI=s.forwardRef(wc(function(t,n){return o.jsx(W8.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(W8.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(YI,{...t,ref:n})})})},"RovingFocusGroup")),YI=s.forwardRef(wc(function(t,n){const{__scopeRovingFocusGroup:r,orientation:a,loop:i=!1,dir:c,currentTabStopId:u,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:h,onEntryFocus:p,preventScrollOnEntryFocus:m=!1,...v}=t,w=s.useRef(null),y=an(n,w),b=q0(c),[k,S]=Qo({prop:u,defaultProp:f??null,onChange:h,caller:Rp}),[C,j]=s.useState(!1),N=pr(p),P=mE(r),$=s.useRef(!1),[R,E]=s.useState(0);return s.useEffect(()=>{const M=w.current;if(M)return M.addEventListener(bg,N),()=>M.removeEventListener(bg,N)},[N]),o.jsx(WI,{scope:r,orientation:a,dir:b,loop:i,currentTabStopId:k,onItemFocus:s.useCallback(M=>S(M),[S]),onItemShiftTab:s.useCallback(()=>j(!0),[]),onFocusableItemAdd:s.useCallback(()=>E(M=>M+1),[]),onFocusableItemRemove:s.useCallback(()=>E(M=>M-1),[]),children:o.jsx(ln.div,{tabIndex:C||R===0?-1:0,"data-orientation":a,...v,ref:y,style:{outline:"none",...t.style},onMouseDown:yt(t.onMouseDown,()=>{$.current=!0}),onFocus:yt(t.onFocus,M=>{const L=!$.current;if(M.target===M.currentTarget&&L&&!C){const H=new CustomEvent(bg,zI);if(M.currentTarget.dispatchEvent(H),!H.defaultPrevented){const D=P().filter(z=>z.focusable),K=D.find(z=>z.active),O=D.find(z=>z.id===k),re=[K,O,...D].filter(Boolean).map(z=>z.ref.current);R4(re,m)}}$.current=!1}),onBlur:yt(t.onBlur,()=>j(!1))})})},"RovingFocusGroupImpl")),qI="RovingFocusGroupItem",XI=s.forwardRef(wc(function(t,n){const{__scopeRovingFocusGroup:r,focusable:a=!0,active:i=!1,tabStopId:c,children:u,...f}=t,h=da(),p=c||h,m=KI(qI,r),v=m.currentTabStopId===p,w=mE(r),{onFocusableItemAdd:y,onFocusableItemRemove:b,currentTabStopId:k}=m,S=ZI();return gr(()=>{if(!(!S||!a))return y(),()=>b()},[S,a,y,b]),s.useEffect(()=>{if(!(S||!a))return y(),()=>b()},[S,a,y,b]),o.jsx(W8.ItemSlot,{scope:r,id:p,focusable:a,active:i,children:o.jsx(ln.span,{tabIndex:v?0:-1,"data-orientation":m.orientation,...f,ref:n,onMouseDown:yt(t.onMouseDown,C=>{a?m.onItemFocus(p):C.preventDefault()}),onFocus:yt(t.onFocus,()=>m.onItemFocus(p)),onKeyDown:yt(t.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){m.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const j=wE(C,m.orientation,m.dir);if(j!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let P=w().filter($=>$.focusable).map($=>$.ref.current);if(j==="last")P.reverse();else if(j==="prev"||j==="next"){j==="prev"&&P.reverse();const $=P.indexOf(C.currentTarget);P=m.loop?yE(P,$+1):P.slice($+1)}setTimeout(()=>R4(P))}}),children:typeof u=="function"?u({isCurrentTabStop:v,hasTabStop:k!=null}):u})})},"RovingFocusGroupItem")),QI={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function vE(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}wc(vE,"getDirectionAwareKey");function wE(e,t,n){const r=vE(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return QI[r]}wc(wE,"getFocusIntent");function R4(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}wc(R4,"focusFirst");function yE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}wc(yE,"wrapArray");var JI=GI,eF=XI,tF=Object.defineProperty,En=(e,t)=>tF(e,"name",{value:t,configurable:!0}),K8=["Enter"," "],nF=["ArrowDown","PageUp","Home"],bE=["ArrowUp","PageDown","End"],rF=[...nF,...bE],sF={ltr:[...K8,"ArrowRight"],rtl:[...K8,"ArrowLeft"]},aF={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Pp="Menu",[C0,oF,iF]=vp(Pp),[yc,Lp]=Ms(Pp,[iF,rl,gE]),P4=rl(),xE=gE(),[lF,bc]=yc(Pp),[cF,tf]=yc(Pp),uF=En(e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:c=!0}=e,u=P4(t),[f,h]=s.useState(null),p=s.useRef(!1),m=pr(i),v=q0(a);return s.useEffect(()=>{const w=En(()=>{p.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},"handleKeyDown"),y=En(()=>p.current=!1,"handlePointer");return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),s.useEffect(()=>{if(!n)return;const w=En(()=>m(!1),"handleBlur");return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[n,m]),o.jsx(Np,{...u,children:o.jsx(lF,{scope:t,open:n,onOpenChange:m,content:f,onContentChange:h,children:o.jsx(cF,{scope:t,onClose:s.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:p,dir:v,modal:c,children:r})})})},"Menu"),kE=s.forwardRef(En(function(t,n){const{__scopeMenu:r,...a}=t,i=P4(r);return o.jsx(ef,{...i,...a,ref:n})},"MenuAnchor")),SE="MenuPortal",[dF,EE]=yc(SE,{forceMount:void 0}),fF=En(e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=bc(SE,t);return o.jsx(dF,{scope:t,forceMount:n,children:o.jsx(es,{present:n||i.open,children:o.jsx(Q0,{asChild:!0,container:a,children:r})})})},"MenuPortal"),La="MenuContent",[hF,L4]=yc(La),pF=s.forwardRef(En(function(t,n){const r=EE(La,t.__scopeMenu),{forceMount:a=r.forceMount,...i}=t,c=bc(La,t.__scopeMenu),u=tf(La,t.__scopeMenu);return o.jsx(C0.Provider,{scope:t.__scopeMenu,children:o.jsx(es,{present:a||c.open,children:o.jsx(C0.Slot,{scope:t.__scopeMenu,children:u.modal?o.jsx(mF,{...i,ref:n}):o.jsx(gF,{...i,ref:n})})})})},"MenuContent")),mF=s.forwardRef(En(function(t,n){const r=bc(La,t.__scopeMenu),a=s.useRef(null),i=an(n,a);return s.useEffect(()=>{const c=a.current;if(c)return yp(c)},[]),o.jsx(T4,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:yt(t.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),gF=s.forwardRef(En(function(t,n){const r=bc(La,t.__scopeMenu);return o.jsx(T4,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),vF=$a("MenuContent.ScrollLock"),T4=s.forwardRef(En(function(t,n){const{__scopeMenu:r,loop:a=!1,trapFocus:i,onOpenAutoFocus:c,onCloseAutoFocus:u,disableOutsidePointerEvents:f,onEntryFocus:h,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:v,onInteractOutside:w,onDismiss:y,disableOutsideScroll:b,...k}=t,S=bc(La,r),C=tf(La,r),j=P4(r),N=xE(r),P=oF(r),[$,R]=s.useState(null),E=s.useRef(null),M=an(n,E,S.onContentChange),L=s.useRef(0),H=s.useRef(""),D=s.useRef(0),K=s.useRef(null),O=s.useRef("right"),_=s.useRef(0),re=b?J0:s.Fragment,z=b?{as:vF,allowPinchZoom:!0}:void 0,F=En(V=>{var te,be;const I=H.current+V,B=P().filter(G=>!G.disabled),Y=document.activeElement,ae=(te=B.find(G=>G.ref.current===Y))==null?void 0:te.textValue,X=B.map(G=>G.textValue),le=LE(X,I,ae),ke=(be=B.find(G=>G.textValue===le))==null?void 0:be.ref.current;En((function G(J){H.current=J,window.clearTimeout(L.current),J!==""&&(L.current=window.setTimeout(()=>G(""),1e3))}),"updateSearch")(I),ke&&setTimeout(()=>ke.focus())},"handleTypeaheadSearch");s.useEffect(()=>()=>window.clearTimeout(L.current),[]),qu();const Q=s.useCallback(V=>{var B,Y;return O.current===((B=K.current)==null?void 0:B.side)&&$E(V,(Y=K.current)==null?void 0:Y.area)},[]);return o.jsx(hF,{scope:r,searchRef:H,onItemEnter:s.useCallback(V=>{Q(V)&&V.preventDefault()},[Q]),onItemLeave:s.useCallback(V=>{var I;Q(V)||((I=E.current)==null||I.focus(),R(null))},[Q]),onTriggerLeave:s.useCallback(V=>{Q(V)&&V.preventDefault()},[Q]),pointerGraceTimerRef:D,onPointerGraceIntentChange:s.useCallback(V=>{K.current=V},[]),children:o.jsx(re,{...z,children:o.jsx(Yu,{asChild:!0,trapped:i,onMountAutoFocus:yt(c,V=>{var I;V.preventDefault(),(I=E.current)==null||I.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:o.jsx(X0,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:v,onInteractOutside:w,onDismiss:y,children:o.jsx(JI,{asChild:!0,...N,dir:C.dir,orientation:"vertical",loop:a,currentTabStopId:$,onCurrentTabStopIdChange:R,onEntryFocus:yt(h,V=>{C.isUsingKeyboardRef.current||V.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Mp,{role:"menu","aria-orientation":"vertical","data-state":D4(S.open),"data-radix-menu-content":"",dir:C.dir,...j,...k,ref:M,style:{outline:"none",...k.style},onKeyDown:yt(k.onKeyDown,V=>{const B=V.target.closest("[data-radix-menu-content]")===V.currentTarget,Y=V.ctrlKey||V.altKey||V.metaKey,ae=V.key.length===1;B&&(V.key==="Tab"&&V.preventDefault(),!Y&&ae&&F(V.key));const X=E.current;if(V.target!==X||!rF.includes(V.key))return;V.preventDefault();const ke=P().filter(te=>!te.disabled).map(te=>te.ref.current);bE.includes(V.key)&&ke.reverse(),RE(ke)}),onBlur:yt(t.onBlur,V=>{V.currentTarget.contains(V.target)||(window.clearTimeout(L.current),H.current="")}),onPointerMove:yt(t.onPointerMove,Du(V=>{const I=V.target,B=_.current!==V.clientX;if(V.currentTarget.contains(I)&&B){const Y=V.clientX>_.current?"right":"left";O.current=Y,_.current=V.clientX}}))})})})})})})},"MenuContentImpl")),CE=s.forwardRef(En(function(t,n){const{__scopeMenu:r,...a}=t;return o.jsx(ln.div,{role:"group",...a,ref:n})},"MenuGroup")),wF=s.forwardRef(En(function(t,n){const{__scopeMenu:r,...a}=t;return o.jsx(ln.div,{...a,ref:n})},"MenuLabel")),G8="MenuItem",K3="menu.itemSelect",$4=s.forwardRef(En(function(t,n){const{disabled:r=!1,onSelect:a,...i}=t,c=s.useRef(null),u=tf(G8,t.__scopeMenu),f=L4(G8,t.__scopeMenu),h=an(n,c),p=s.useRef(!1),m=En(()=>{const v=c.current;if(!r&&v){const w=new CustomEvent(K3,{bubbles:!0,cancelable:!0});v.addEventListener(K3,y=>a==null?void 0:a(y),{once:!0}),m4(v,w),w.defaultPrevented?p.current=!1:u.onClose()}},"handleSelect");return o.jsx(jE,{...i,ref:h,disabled:r,onClick:yt(t.onClick,m),onPointerDown:v=>{var w;(w=t.onPointerDown)==null||w.call(t,v),p.current=!0},onPointerUp:yt(t.onPointerUp,v=>{var w;p.current||(w=v.currentTarget)==null||w.click()}),onKeyDown:yt(t.onKeyDown,v=>{r||v.target!==v.currentTarget||f.searchRef.current!==""&&v.key===" "||K8.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})},"MenuItem")),jE=s.forwardRef(En(function(t,n){const{__scopeMenu:r,disabled:a=!1,textValue:i,...c}=t,u=L4(G8,r),f=xE(r),h=s.useRef(null),p=an(n,h),[m,v]=s.useState(!1),[w,y]=s.useState("");return s.useEffect(()=>{const b=h.current;b&&y((b.textContent??"").trim())},[c.children]),o.jsx(C0.ItemSlot,{scope:r,disabled:a,textValue:i??w,children:o.jsx(eF,{asChild:!0,...f,focusable:!a,children:o.jsx(ln.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...c,ref:p,onPointerMove:yt(t.onPointerMove,Du(b=>{a?u.onItemLeave(b):(u.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:yt(t.onPointerLeave,Du(b=>u.onItemLeave(b))),onFocus:yt(t.onFocus,()=>v(!0)),onBlur:yt(t.onBlur,()=>v(!1))})})})},"MenuItemImpl")),yF=s.forwardRef(En(function(t,n){const{checked:r=!1,onCheckedChange:a,...i}=t;return o.jsx(NE,{scope:t.__scopeMenu,checked:r,children:o.jsx($4,{role:"menuitemcheckbox","aria-checked":j0(r)?"mixed":r,...i,ref:n,"data-state":Tp(r),onSelect:yt(i.onSelect,()=>a==null?void 0:a(j0(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),bF="MenuRadioGroup",[xF,kF]=yc(bF,{value:void 0,onValueChange:En(()=>{},"onValueChange")}),SF=s.forwardRef(En(function(t,n){const{value:r,onValueChange:a,...i}=t,c=pr(a);return o.jsx(xF,{scope:t.__scopeMenu,value:r,onValueChange:c,children:o.jsx(CE,{...i,ref:n})})},"MenuRadioGroup")),EF="MenuRadioItem",CF=s.forwardRef(En(function(t,n){const{value:r,...a}=t,i=kF(EF,t.__scopeMenu),c=r===i.value;return o.jsx(NE,{scope:t.__scopeMenu,checked:c,children:o.jsx($4,{role:"menuitemradio","aria-checked":c,...a,ref:n,"data-state":Tp(c),onSelect:yt(a.onSelect,()=>{var u;return(u=i.onValueChange)==null?void 0:u.call(i,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),AE="MenuItemIndicator",[NE,jF]=yc(AE,{checked:!1}),AF=s.forwardRef(En(function(t,n){const{__scopeMenu:r,forceMount:a,...i}=t,c=jF(AE,r);return o.jsx(es,{present:a||j0(c.checked)||c.checked===!0,children:o.jsx(ln.span,{...i,ref:n,"data-state":Tp(c.checked)})})},"MenuItemIndicator")),NF=s.forwardRef(En(function(t,n){const{__scopeMenu:r,...a}=t;return o.jsx(ln.div,{role:"separator","aria-orientation":"horizontal",...a,ref:n})},"MenuSeparator")),MF="MenuSub",[Hle,ME]=yc(MF),V1="MenuSubTrigger",RF=s.forwardRef(En(function(t,n){const r=bc(V1,t.__scopeMenu),a=tf(V1,t.__scopeMenu),i=ME(V1,t.__scopeMenu),c=L4(V1,t.__scopeMenu),u=s.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:h}=c,p={__scopeMenu:t.__scopeMenu},m=s.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);s.useEffect(()=>m,[m]),s.useEffect(()=>{const w=f.current;return()=>{window.clearTimeout(w),h(null)}},[f,h]);const v=an(n,i.onTriggerChange);return o.jsx(kE,{asChild:!0,...p,children:o.jsx(jE,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?i.contentId:void 0,"data-state":D4(r.open),...t,ref:v,onClick:w=>{var y;(y=t.onClick)==null||y.call(t,w),!(t.disabled||w.defaultPrevented)&&(w.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:yt(t.onPointerMove,Du(w=>{c.onItemEnter(w),!w.defaultPrevented&&!t.disabled&&!r.open&&!u.current&&(c.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{r.onOpenChange(!0),m()},100))})),onPointerLeave:yt(t.onPointerLeave,Du(w=>{var b,k;m();const y=(b=r.content)==null?void 0:b.getBoundingClientRect();if(y){const S=(k=r.content)==null?void 0:k.dataset.side,C=S==="right",j=C?-5:5,N=y[C?"left":"right"],P=y[C?"right":"left"];c.onPointerGraceIntentChange({area:[{x:w.clientX+j,y:w.clientY},{x:N,y:y.top},{x:P,y:y.top},{x:P,y:y.bottom},{x:N,y:y.bottom}],side:S}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(w),w.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:yt(t.onKeyDown,w=>{var b;t.disabled||w.target!==w.currentTarget||c.searchRef.current!==""&&w.key===" "||sF[a.dir].includes(w.key)&&(r.onOpenChange(!0),(b=r.content)==null||b.focus(),w.preventDefault())})})})},"MenuSubTrigger")),PF="MenuSubContent",LF=s.forwardRef(En(function(t,n){const r=EE(La,t.__scopeMenu),{forceMount:a=r.forceMount,align:i="start",...c}=t,u=bc(La,t.__scopeMenu),f=tf(La,t.__scopeMenu),h=ME(PF,t.__scopeMenu),p=s.useRef(null),m=an(n,p);return o.jsx(C0.Provider,{scope:t.__scopeMenu,children:o.jsx(es,{present:a||u.open,children:o.jsx(C0.Slot,{scope:t.__scopeMenu,children:o.jsx(T4,{id:h.contentId,"aria-labelledby":h.triggerId,...c,ref:m,align:i,side:f.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{var w;f.isUsingKeyboardRef.current&&((w=p.current)==null||w.focus()),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:yt(t.onFocusOutside,v=>{v.target!==h.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:yt(t.onEscapeKeyDown,v=>{f.onClose(),v.preventDefault()}),onKeyDown:yt(t.onKeyDown,v=>{var b;const w=v.currentTarget.contains(v.target),y=aF[f.dir].includes(v.key);w&&y&&(u.onOpenChange(!1),(b=h.trigger)==null||b.focus(),v.preventDefault())})})})})})},"MenuSubContent"));function D4(e){return e?"open":"closed"}En(D4,"getOpenState");function j0(e){return e==="indeterminate"}En(j0,"isIndeterminate");function Tp(e){return j0(e)?"indeterminate":e?"checked":"unchecked"}En(Tp,"getCheckedState");function RE(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}En(RE,"focusFirst");function PE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}En(PE,"wrapArray");function LE(e,t,n){const a=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let c=PE(e,Math.max(i,0));a.length===1&&(c=c.filter(h=>h!==n));const f=c.find(h=>h.toLowerCase().startsWith(a.toLowerCase()));return f!==n?f:void 0}En(LE,"getNextMatch");function TE(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,c=t.length-1;i<t.length;c=i++){const u=t[i],f=t[c],h=u.x,p=u.y,m=f.x,v=f.y;p>r!=v>r&&n<(m-h)*(r-p)/(v-p)+h&&(a=!a)}return a}En(TE,"isPointInPolygon");function $E(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return TE(n,t)}En($E,"isPointerInGraceArea");function Du(e){return t=>t.pointerType==="mouse"?e(t):void 0}En(Du,"whenMouse");var DE=uF,HE=kE,OE=fF,IE=pF,FE=CE,_E=wF,ZE=$4,VE=yF,zE=SF,BE=CF,UE=AF,WE=NF,KE=RF,GE=LF,TF=Object.defineProperty,Ir=(e,t)=>TF(e,"name",{value:t,configurable:!0}),H4="ContextMenu",[$F,Ole]=Ms(H4,[Lp]),Rs=Lp(),[DF,YE]=$F(H4),HF=Ir(e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:a,dir:i,modal:c=!0}=e,u=s.useRef(!1),[f,h]=Qo({prop:a,defaultProp:!1,onChange:r,caller:H4}),p=Rs(t);return o.jsx(DF,{scope:t,open:f,onOpenChange:h,modal:c,hasInteractedRef:u,children:o.jsx(DE,{...p,dir:i,open:f,onOpenChange:h,modal:c,children:n})})},"ContextMenu"),OF="ContextMenuTrigger",IF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,disabled:a=!1,...i}=t,c=YE(OF,r),u=Rs(r),[f,h]=s.useState({x:0,y:0}),p=s.useMemo(()=>({current:{getBoundingClientRect:Ir(()=>DOMRect.fromRect({width:0,height:0,...f}),"getBoundingClientRect")}}),[f]),m=s.useRef(0),v=s.useCallback(()=>window.clearTimeout(m.current),[]),w=Ir(y=>{c.hasInteractedRef.current=!0,h({x:y.clientX,y:y.clientY}),c.onOpenChange(!0)},"handleOpen");return s.useEffect(()=>v,[v]),s.useEffect(()=>void(a&&v()),[a,v]),o.jsxs(o.Fragment,{children:[o.jsx(HE,{...u,virtualRef:p}),o.jsx(ln.span,{"data-state":c.open?"open":"closed","data-disabled":a?"":void 0,...i,ref:n,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:a?t.onContextMenu:yt(t.onContextMenu,y=>{v(),w(y),y.preventDefault()}),onPointerDown:a?t.onPointerDown:yt(t.onPointerDown,t0(y=>{v(),c.open&&c.onOpenChange(!1),m.current=window.setTimeout(()=>w(y),700)})),onPointerMove:a?t.onPointerMove:yt(t.onPointerMove,t0(v)),onPointerCancel:a?t.onPointerCancel:yt(t.onPointerCancel,t0(v)),onPointerUp:a?t.onPointerUp:yt(t.onPointerUp,t0(v))})]})},"ContextMenuTrigger")),FF=Ir(e=>{const{__scopeContextMenu:t,...n}=e,r=Rs(t);return o.jsx(OE,{...r,...n})},"ContextMenuPortal"),_F="ContextMenuContent",ZF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=YE(_F,r),c=Rs(r),u=s.useRef(!1);return o.jsx(IE,{...c,...a,ref:n,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:f=>{var h;(h=t.onCloseAutoFocus)==null||h.call(t,f),!f.defaultPrevented&&u.current&&f.preventDefault(),u.current=!1},onInteractOutside:f=>{var h;(h=t.onInteractOutside)==null||h.call(t,f),!f.defaultPrevented&&!i.modal&&(u.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),VF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(FE,{...i,...a,ref:n})},"ContextMenuGroup")),zF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(_E,{...i,...a,ref:n})},"ContextMenuLabel")),BF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(ZE,{...i,...a,ref:n})},"ContextMenuItem")),UF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(VE,{...i,...a,ref:n})},"ContextMenuCheckboxItem")),WF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(zE,{...i,...a,ref:n})},"ContextMenuRadioGroup")),KF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(BE,{...i,...a,ref:n})},"ContextMenuRadioItem")),GF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(UE,{...i,...a,ref:n})},"ContextMenuItemIndicator")),YF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(WE,{...i,...a,ref:n})},"ContextMenuSeparator")),qF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(KE,{...i,...a,ref:n})},"ContextMenuSubTrigger")),XF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(GE,{...i,...a,ref:n,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuSubContent"));function t0(e){return t=>t.pointerType!=="mouse"?e(t):void 0}Ir(t0,"whenTouchOrPen");var QF=HF,JF=IF,qE=FF,e_=ZF,t_=VF,n_=zF,r_=BF,s_=UF,a_=WF,o_=KF,XE=GF,i_=YF,l_=qF,c_=XF,u_=Object.defineProperty,Ps=(e,t)=>u_(e,"name",{value:t,configurable:!0}),O4="DropdownMenu",[d_,Ile]=Ms(O4,[Lp]),Ls=Lp(),[f_,QE]=d_(O4),h_=Ps(e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:c,modal:u=!0}=e,f=Ls(t),h=s.useRef(null),[p,m]=Qo({prop:a,defaultProp:i??!1,onChange:c,caller:O4});return o.jsx(f_,{scope:t,triggerId:da(),triggerRef:h,contentId:da(),open:p,onOpenChange:m,onOpenToggle:s.useCallback(()=>m(v=>!v),[m]),modal:u,children:o.jsx(DE,{...f,open:p,onOpenChange:m,dir:r,modal:u,children:n})})},"DropdownMenu"),p_="DropdownMenuTrigger",m_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,disabled:a=!1,...i}=t,c=QE(p_,r),u=Ls(r),f=an(n,c.triggerRef);return o.jsx(HE,{asChild:!0,...u,children:o.jsx(ln.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...i,ref:f,onPointerDown:yt(t.onPointerDown,h=>{!a&&h.button===0&&h.ctrlKey===!1&&(c.onOpenToggle(),c.open||h.preventDefault())}),onKeyDown:yt(t.onKeyDown,h=>{a||(["Enter"," "].includes(h.key)&&c.onOpenToggle(),h.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(h.key)&&h.preventDefault())})})})},"DropdownMenuTrigger")),g_=Ps(e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ls(t);return o.jsx(OE,{...r,...n})},"DropdownMenuPortal"),v_="DropdownMenuContent",w_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=QE(v_,r),c=Ls(r),u=s.useRef(!1);return o.jsx(IE,{id:i.contentId,"aria-labelledby":i.triggerId,...c,...a,ref:n,onCloseAutoFocus:yt(t.onCloseAutoFocus,f=>{var h;u.current||(h=i.triggerRef.current)==null||h.focus(),u.current=!1,f.preventDefault()}),onInteractOutside:yt(t.onInteractOutside,f=>{const h=f.detail.originalEvent,p=h.button===0&&h.ctrlKey===!0,m=h.button===2||p;(!i.modal||m)&&(u.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),y_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(FE,{...i,...a,ref:n})},"DropdownMenuGroup")),b_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(_E,{...i,...a,ref:n})},"DropdownMenuLabel")),x_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(ZE,{...i,...a,ref:n})},"DropdownMenuItem")),k_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(VE,{...i,...a,ref:n})},"DropdownMenuCheckboxItem")),S_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(zE,{...i,...a,ref:n})},"DropdownMenuRadioGroup")),E_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(BE,{...i,...a,ref:n})},"DropdownMenuRadioItem")),C_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(UE,{...i,...a,ref:n})},"DropdownMenuItemIndicator")),j_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(WE,{...i,...a,ref:n})},"DropdownMenuSeparator")),A_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(KE,{...i,...a,ref:n})},"DropdownMenuSubTrigger")),N_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(GE,{...i,...a,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),M_=h_,R_=m_,JE=g_,P_=w_,L_=y_,T_=b_,$_=x_,D_=k_,H_=S_,O_=E_,e7=C_,I_=j_,F_=A_,__=N_,Z_=Object.defineProperty,V_=(e,t)=>Z_(e,"name",{value:t,configurable:!0});function t7(e){const t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}V_(t7,"usePrevious");var z_=Object.defineProperty,B_=(e,t)=>z_(e,"name",{value:t,configurable:!0});function Mh(e,[t,n]){return Math.min(n,Math.max(t,e))}B_(Mh,"clamp");var U_=Object.defineProperty,yo=(e,t)=>U_(e,"name",{value:t,configurable:!0}),I4="Popover",[n7,Fle]=Ms(I4,[rl]),$p=rl(),[W_,sl]=n7(I4),K_=yo(e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:c=!1}=e,u=$p(t),f=s.useRef(null),[h,p]=s.useState(!1),[m,v]=Qo({prop:r,defaultProp:a??!1,onChange:i,caller:I4});return o.jsx(Np,{...u,children:o.jsx(W_,{scope:t,contentId:da(),triggerRef:f,open:m,onOpenChange:v,onOpenToggle:s.useCallback(()=>v(w=>!w),[v]),hasCustomAnchor:h,onCustomAnchorAdd:s.useCallback(()=>p(!0),[]),onCustomAnchorRemove:s.useCallback(()=>p(!1),[]),modal:c,children:n})})},"Popover"),G_="PopoverAnchor",Y_=s.forwardRef(yo(function(t,n){const{__scopePopover:r,...a}=t,i=sl(G_,r),c=$p(r),{onCustomAnchorAdd:u,onCustomAnchorRemove:f}=i;return s.useEffect(()=>(u(),()=>f()),[u,f]),o.jsx(ef,{...c,...a,ref:n})},"PopoverAnchor")),q_="PopoverTrigger",X_=s.forwardRef(yo(function(t,n){const{__scopePopover:r,...a}=t,i=sl(q_,r),c=$p(r),u=an(n,i.triggerRef),f=o.jsx(ln.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":F4(i.open),...a,ref:u,onClick:yt(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?f:o.jsx(ef,{asChild:!0,...c,children:f})},"PopoverTrigger")),r7="PopoverPortal",[Q_,J_]=n7(r7,{forceMount:void 0}),eZ=yo(e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=sl(r7,t);return o.jsx(Q_,{scope:t,forceMount:n,children:o.jsx(es,{present:n||i.open,children:o.jsx(Q0,{asChild:!0,container:a,children:r})})})},"PopoverPortal"),A0="PopoverContent",tZ=s.forwardRef(yo(function(t,n){const r=J_(A0,t.__scopePopover),{forceMount:a=r.forceMount,...i}=t,c=sl(A0,t.__scopePopover);return o.jsx(es,{present:a||c.open,children:c.modal?o.jsx(rZ,{...i,ref:n}):o.jsx(sZ,{...i,ref:n})})},"PopoverContent")),nZ=$a("PopoverContent.RemoveScroll"),rZ=s.forwardRef(yo(function(t,n){const r=sl(A0,t.__scopePopover),a=s.useRef(null),i=an(n,a),c=s.useRef(!1);return s.useEffect(()=>{const u=a.current;if(u)return yp(u)},[]),o.jsx(J0,{as:nZ,allowPinchZoom:!0,children:o.jsx(s7,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yt(t.onCloseAutoFocus,u=>{var f;u.preventDefault(),c.current||(f=r.triggerRef.current)==null||f.focus()}),onPointerDownOutside:yt(t.onPointerDownOutside,u=>{const f=u.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,p=f.button===2||h;c.current=p},{checkForDefaultPrevented:!1}),onFocusOutside:yt(t.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),sZ=s.forwardRef(yo(function(t,n){const r=sl(A0,t.__scopePopover),a=s.useRef(!1),i=s.useRef(!1);return o.jsx(s7,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{var u,f;(u=t.onCloseAutoFocus)==null||u.call(t,c),c.defaultPrevented||(a.current||(f=r.triggerRef.current)==null||f.focus(),c.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:c=>{var h,p;(h=t.onInteractOutside)==null||h.call(t,c),c.defaultPrevented||(a.current=!0,c.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=c.target;((p=r.triggerRef.current)==null?void 0:p.contains(u))&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&i.current&&c.preventDefault()}})},"PopoverContentNonModal")),s7=s.forwardRef(yo(function(t,n){const{__scopePopover:r,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:m,...v}=t,w=sl(A0,r),y=$p(r);return qu(),o.jsx(Yu,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:c,children:o.jsx(X0,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:m,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onDismiss:()=>w.onOpenChange(!1),deferPointerDownOutside:!0,children:o.jsx(Mp,{"data-state":F4(w.open),role:"dialog",id:w.contentId,...y,...v,ref:n,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl")),aZ="PopoverClose",oZ=s.forwardRef(yo(function(t,n){const{__scopePopover:r,...a}=t,i=sl(aZ,r);return o.jsx(ln.button,{type:"button",...a,ref:n,onClick:yt(t.onClick,()=>i.onOpenChange(!1))})},"PopoverClose"));function F4(e){return e?"open":"closed"}yo(F4,"getState");var iZ=K_,lZ=Y_,cZ=X_,uZ=eZ,dZ=tZ,fZ=oZ,hZ=Object.defineProperty,vn=(e,t)=>hZ(e,"name",{value:t,configurable:!0});function a7(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}vn(a7,"useStateMachine");var o7="ScrollArea",[i7,_le]=Ms(o7),[pZ,ma]=i7(o7),mZ=s.forwardRef(vn(function(t,n){const{__scopeScrollArea:r,type:a="hover",dir:i,scrollHideDelay:c=600,...u}=t,[f,h]=s.useState(null),[p,m]=s.useState(null),[v,w]=s.useState(null),[y,b]=s.useState(null),[k,S]=s.useState(null),[C,j]=s.useState(0),[N,P]=s.useState(0),[$,R]=s.useState(!1),[E,M]=s.useState(!1),L=an(n,h),H=q0(i);return o.jsx(pZ,{scope:r,type:a,dir:H,scrollHideDelay:c,scrollArea:f,viewport:p,onViewportChange:m,content:v,onContentChange:w,scrollbarX:y,onScrollbarXChange:b,scrollbarXEnabled:$,onScrollbarXEnabledChange:R,scrollbarY:k,onScrollbarYChange:S,scrollbarYEnabled:E,onScrollbarYEnabledChange:M,onCornerWidthChange:j,onCornerHeightChange:P,children:o.jsx(ln.div,{dir:H,...u,ref:L,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":N+"px",...t.style}})})},"ScrollArea")),gZ="ScrollAreaViewport",vZ=s.forwardRef(vn(function(t,n){const{__scopeScrollArea:r,children:a,nonce:i,...c}=t,u=ma(gZ,r),f=s.useRef(null),h=an(n,f,u.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx(wZ,{nonce:i}),o.jsx(ln.div,{"data-radix-scroll-area-viewport":"",...c,ref:h,style:{overflowX:u.scrollbarXEnabled?"scroll":"hidden",overflowY:u.scrollbarYEnabled?"scroll":"hidden",...t.style},children:o.jsx("div",{ref:u.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})},"ScrollAreaViewport")),wZ=s.memo(vn(function({nonce:t}){return o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t})},"ScrollAreaViewportStyle"),(e,t)=>e.nonce===t.nonce),ci="ScrollAreaScrollbar",yZ=s.forwardRef(vn(function(t,n){const{forceMount:r,...a}=t,i=ma(ci,t.__scopeScrollArea),{onScrollbarXEnabledChange:c,onScrollbarYEnabledChange:u}=i,f=t.orientation==="horizontal";return s.useEffect(()=>(f?c(!0):u(!0),()=>{f?c(!1):u(!1)}),[f,c,u]),i.type==="hover"?o.jsx(bZ,{...a,ref:n,forceMount:r}):i.type==="scroll"?o.jsx(xZ,{...a,ref:n,forceMount:r}):i.type==="auto"?o.jsx(l7,{...a,ref:n,forceMount:r}):i.type==="always"?o.jsx(_4,{...a,ref:n,"data-state":"visible"}):null},"ScrollAreaScrollbar")),bZ=s.forwardRef(vn(function(t,n){const{forceMount:r,...a}=t,i=ma(ci,t.__scopeScrollArea),[c,u]=s.useState(!1);return s.useEffect(()=>{const f=i.scrollArea;let h=0;if(f){const p=vn(()=>{window.clearTimeout(h),u(!0)},"handlePointerEnter"),m=vn(()=>{h=window.setTimeout(()=>u(!1),i.scrollHideDelay)},"handlePointerLeave");return f.addEventListener("pointerenter",p),f.addEventListener("pointerleave",m),()=>{window.clearTimeout(h),f.removeEventListener("pointerenter",p),f.removeEventListener("pointerleave",m)}}},[i.scrollArea,i.scrollHideDelay]),o.jsx(es,{present:r||c,children:o.jsx(l7,{"data-state":c?"visible":"hidden",...a,ref:n})})},"ScrollAreaScrollbarHover")),xZ=s.forwardRef(vn(function(t,n){const{forceMount:r,...a}=t,i=ma(ci,t.__scopeScrollArea),c=t.orientation==="horizontal",u=rf(()=>h("SCROLL_END"),100),[f,h]=a7("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return s.useEffect(()=>{if(f==="idle"){const p=window.setTimeout(()=>h("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(p)}},[f,i.scrollHideDelay,h]),s.useEffect(()=>{const p=i.viewport,m=c?"scrollLeft":"scrollTop";if(p){let v=p[m];const w=vn(()=>{const y=p[m];v!==y&&(h("SCROLL"),u()),v=y},"handleScroll");return p.addEventListener("scroll",w),()=>p.removeEventListener("scroll",w)}},[i.viewport,c,h,u]),o.jsx(es,{present:r||f!=="hidden",children:o.jsx(_4,{"data-state":f==="hidden"?"hidden":"visible",...a,ref:n,onPointerEnter:yt(t.onPointerEnter,()=>h("POINTER_ENTER")),onPointerLeave:yt(t.onPointerLeave,()=>h("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),l7=s.forwardRef(vn(function(t,n){const r=ma(ci,t.__scopeScrollArea),{forceMount:a,...i}=t,[c,u]=s.useState(!1),f=t.orientation==="horizontal",h=rf(()=>{if(r.viewport){const p=r.viewport.offsetWidth<r.viewport.scrollWidth,m=r.viewport.offsetHeight<r.viewport.scrollHeight;u(f?p:m)}},10);return Ql(r.viewport,h),Ql(r.content,h),o.jsx(es,{present:a||c,children:o.jsx(_4,{"data-state":c?"visible":"hidden",...i,ref:n})})},"ScrollAreaScrollbarAuto")),_4=s.forwardRef(vn(function(t,n){const{orientation:r="vertical",...a}=t,i=ma(ci,t.__scopeScrollArea),c=s.useRef(null),u=s.useRef(0),[f,h]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=Z4(f.viewport,f.content),m={...a,sizes:f,onSizesChange:h,hasThumb:p>0&&p<1,onThumbChange:vn(w=>c.current=w,"onThumbChange"),onThumbPointerUp:vn(()=>u.current=0,"onThumbPointerUp"),onThumbPointerDown:vn(w=>u.current=w,"onThumbPointerDown")};function v(w,y){return f7(w,u.current,f,y)}return vn(v,"getScrollPosition"),r==="horizontal"?o.jsx(kZ,{...m,ref:n,onThumbPositionChange:()=>{if(i.viewport&&c.current){const w=i.viewport.scrollLeft,y=q8(w,f,i.dir);c.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:w=>{i.viewport&&(i.viewport.scrollLeft=w)},onDragScroll:w=>{i.viewport&&(i.viewport.scrollLeft=v(w,i.dir))}}):r==="vertical"?o.jsx(SZ,{...m,ref:n,onThumbPositionChange:()=>{if(i.viewport&&c.current){const w=i.viewport.scrollTop,y=q8(w,f);c.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:w=>{i.viewport&&(i.viewport.scrollTop=w)},onDragScroll:w=>{i.viewport&&(i.viewport.scrollTop=v(w))}}):null},"ScrollAreaScrollbarVisible")),kZ=s.forwardRef(vn(function(t,n){const{sizes:r,onSizesChange:a,...i}=t,c=ma(ci,t.__scopeScrollArea),[u,f]=s.useState(),h=s.useRef(null),p=an(n,h,c.onScrollbarXChange);return s.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),o.jsx(u7,{"data-orientation":"horizontal",...i,ref:p,sizes:r,style:{bottom:0,left:c.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:c.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":nf(r)+"px",...t.style},onThumbPointerDown:m=>t.onThumbPointerDown(m.x),onDragScroll:m=>t.onDragScroll(m.x),onWheelScroll:(m,v)=>{if(c.viewport){const w=c.viewport.scrollLeft+m.deltaX;t.onWheelScroll(w),z4(w,v)&&m.preventDefault()}},onResize:()=>{h.current&&c.viewport&&u&&a({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:N0(u.paddingLeft),paddingEnd:N0(u.paddingRight)}})}})},"ScrollAreaScrollbarX")),SZ=s.forwardRef(vn(function(t,n){const{sizes:r,onSizesChange:a,...i}=t,c=ma(ci,t.__scopeScrollArea),[u,f]=s.useState(),h=s.useRef(null),p=an(n,h,c.onScrollbarYChange);return s.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),o.jsx(u7,{"data-orientation":"vertical",...i,ref:p,sizes:r,style:{top:0,right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":nf(r)+"px",...t.style},onThumbPointerDown:m=>t.onThumbPointerDown(m.y),onDragScroll:m=>t.onDragScroll(m.y),onWheelScroll:(m,v)=>{if(c.viewport){const w=c.viewport.scrollTop+m.deltaY;t.onWheelScroll(w),z4(w,v)&&m.preventDefault()}},onResize:()=>{h.current&&c.viewport&&u&&a({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:N0(u.paddingTop),paddingEnd:N0(u.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[EZ,c7]=i7(ci),u7=s.forwardRef(vn(function(t,n){const{__scopeScrollArea:r,sizes:a,hasThumb:i,onThumbChange:c,onThumbPointerUp:u,onThumbPointerDown:f,onThumbPositionChange:h,onDragScroll:p,onWheelScroll:m,onResize:v,...w}=t,y=ma(ci,r),[b,k]=s.useState(null),S=an(n,k),C=s.useRef(null),j=s.useRef(""),N=y.viewport,P=a.content-a.viewport,$=pr(m),R=pr(h),E=rf(v,10);function M(L){if(C.current){const H=L.clientX-C.current.left,D=L.clientY-C.current.top;p({x:H,y:D})}}return vn(M,"handleDragScroll"),s.useEffect(()=>{const L=vn(H=>{const D=H.target;(b==null?void 0:b.contains(D))&&$(H,P)},"handleWheel");return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[N,b,P,$]),s.useEffect(R,[a,R]),Ql(b,E),Ql(y.content,E),o.jsx(EZ,{scope:r,scrollbar:b,hasThumb:i,onThumbChange:pr(c),onThumbPointerUp:pr(u),onThumbPositionChange:R,onThumbPointerDown:pr(f),children:o.jsx(ln.div,{...w,ref:S,style:{position:"absolute",...w.style},onPointerDown:yt(t.onPointerDown,L=>{L.button===0&&(L.target.setPointerCapture(L.pointerId),C.current=b.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),M(L))}),onPointerMove:yt(t.onPointerMove,M),onPointerUp:yt(t.onPointerUp,L=>{const H=L.target;H.hasPointerCapture(L.pointerId)&&H.releasePointerCapture(L.pointerId),document.body.style.webkitUserSelect=j.current,y.viewport&&(y.viewport.style.scrollBehavior=""),C.current=null})})})},"ScrollAreaScrollbarImpl")),Y8="ScrollAreaThumb",CZ=s.forwardRef(vn(function(t,n){const{forceMount:r,...a}=t,i=c7(Y8,t.__scopeScrollArea);return o.jsx(es,{present:r||i.hasThumb,children:o.jsx(jZ,{ref:n,...a})})},"ScrollAreaThumb")),jZ=s.forwardRef(vn(function(t,n){const{__scopeScrollArea:r,style:a,...i}=t,c=ma(Y8,r),u=c7(Y8,r),{onThumbPositionChange:f}=u,h=an(n,u.onThumbChange),p=s.useRef(void 0),m=rf(()=>{p.current&&(p.current(),p.current=void 0)},100);return s.useEffect(()=>{const v=c.viewport;if(v){const w=vn(()=>{if(m(),!p.current){const y=MZ(v,f);p.current=y,f()}},"handleScroll");return f(),v.addEventListener("scroll",w),()=>v.removeEventListener("scroll",w)}},[c.viewport,m,f]),o.jsx(ln.div,{"data-state":u.hasThumb?"visible":"hidden",...i,ref:h,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:yt(t.onPointerDownCapture,v=>{const y=v.target.getBoundingClientRect(),b=v.clientX-y.left,k=v.clientY-y.top;u.onThumbPointerDown({x:b,y:k})}),onPointerUp:yt(t.onPointerUp,u.onThumbPointerUp)})},"ScrollAreaThumbImpl")),d7="ScrollAreaCorner",AZ=s.forwardRef(vn(function(t,n){const r=ma(d7,t.__scopeScrollArea),a=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&a?o.jsx(NZ,{...t,ref:n}):null},"ScrollAreaCorner")),NZ=s.forwardRef(vn(function(t,n){const{__scopeScrollArea:r,...a}=t,i=ma(d7,r),[c,u]=s.useState(0),[f,h]=s.useState(0),p=!!(c&&f),{onCornerWidthChange:m,onCornerHeightChange:v}=i;return Ql(i.scrollbarX,()=>{var y;const w=((y=i.scrollbarX)==null?void 0:y.offsetHeight)||0;i.onCornerHeightChange(w),h(w)}),Ql(i.scrollbarY,()=>{var y;const w=((y=i.scrollbarY)==null?void 0:y.offsetWidth)||0;i.onCornerWidthChange(w),u(w)}),s.useEffect(()=>()=>{m(0),v(0)},[m,v]),p?o.jsx(ln.div,{...a,ref:n,style:{width:c,height:f,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null},"ScrollAreaCornerImpl"));function N0(e){return e?parseInt(e,10):0}vn(N0,"toInt");function Z4(e,t){const n=e/t;return isNaN(n)?0:n}vn(Z4,"getThumbRatio");function nf(e){const t=Z4(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}vn(nf,"getThumbSize");function f7(e,t,n,r="ltr"){const a=nf(n),i=a/2,c=t||i,u=a-c,f=n.scrollbar.paddingStart+c,h=n.scrollbar.size-n.scrollbar.paddingEnd-u,p=n.content-n.viewport,m=r==="ltr"?[0,p]:[p*-1,0];return V4([f,h],m)(e)}vn(f7,"getScrollPositionFromPointer");function q8(e,t,n="ltr"){const r=nf(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,c=t.content-t.viewport,u=i-r,f=n==="ltr"?[0,c]:[c*-1,0],h=Mh(e,f);return V4([0,c],[0,u])(h)}vn(q8,"getThumbOffsetFromScroll");function V4(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}vn(V4,"linearScale");function z4(e,t){return e>0&&e<t}vn(z4,"isScrollingWithinScrollbarBounds");var MZ=vn((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return vn((function a(){const i={left:e.scrollLeft,top:e.scrollTop},c=n.left!==i.left,u=n.top!==i.top;(c||u)&&t(),n=i,r=window.requestAnimationFrame(a)}),"loop")(),()=>window.cancelAnimationFrame(r)},"addUnlinkedScrollListener");function rf(e,t){const n=pr(e),r=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),s.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}vn(rf,"useDebounceCallback");function Ql(e,t){const n=pr(t);gr(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}vn(Ql,"useResizeObserver");var h7=mZ,p7=vZ,X8=yZ,Q8=CZ,RZ=AZ,PZ=Object.defineProperty,Ln=(e,t)=>PZ(e,"name",{value:t,configurable:!0}),LZ=[" ","Enter","ArrowUp","ArrowDown"],TZ=[" ","Enter"],Hu="Select",[Dp,B4,$Z]=vp(Hu),[xc,Zle]=Ms(Hu,[$Z,rl]),U4=rl(),[DZ,al]=xc(Hu),[HZ,OZ]=xc(Hu);function m7(e){const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:c,defaultValue:u,onValueChange:f,dir:h,name:p,autoComplete:m,disabled:v,required:w,form:y,internal_do_not_use_render:b}=e,k=U4(t),[S,C]=s.useState(null),[j,N]=s.useState(null),[P,$]=s.useState(!1),R=q0(h),[E,M]=Qo({prop:r,defaultProp:a??!1,onChange:i,caller:Hu}),[L,H]=Qo({prop:c,defaultProp:u,onChange:f,caller:Hu}),D=s.useRef(null),K=s.useRef(L);s.useEffect(()=>{const B=y?S==null?void 0:S.ownerDocument.getElementById(y):S==null?void 0:S.form;if(B instanceof HTMLFormElement){const Y=Ln(()=>H(K.current),"reset");return B.addEventListener("reset",Y),()=>B.removeEventListener("reset",Y)}},[y,S,H]);const O=S?!!y||!!S.closest("form"):!0,[_,re]=s.useState(new Set),z=da(),F=Array.from(_).map(B=>B.props.value).join(";"),Q=s.useCallback(B=>{re(Y=>new Set(Y).add(B))},[]),V=s.useCallback(B=>{re(Y=>{const ae=new Set(Y);return ae.delete(B),ae})},[]),I={required:w,trigger:S,onTriggerChange:C,valueNode:j,onValueNodeChange:N,valueNodeHasChildren:P,onValueNodeHasChildrenChange:$,contentId:z,value:L,onValueChange:H,open:E,onOpenChange:M,dir:R,triggerPointerDownPosRef:D,disabled:v,name:p,autoComplete:m,form:y,nativeOptions:_,nativeSelectKey:F,isFormControl:O};return o.jsx(Np,{...k,children:o.jsx(DZ,{scope:t,...I,children:o.jsx(Dp.Provider,{scope:t,children:o.jsx(HZ,{scope:t,onNativeOptionAdd:Q,onNativeOptionRemove:V,children:w7(b)?b(I):n})})})})}Ln(m7,"SelectProvider");var IZ=Ln(e=>{const{__scopeSelect:t,children:n,...r}=e;return o.jsx(m7,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:a})=>o.jsxs(o.Fragment,{children:[n,a?o.jsx(mV,{__scopeSelect:t}):null]})})},"Select"),FZ="SelectTrigger",_Z=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,disabled:a=!1,...i}=t,c=U4(r),u=al(FZ,r),f=u.disabled||a,h=an(n,u.onTriggerChange),p=B4(r),m=s.useRef("touch"),[v,w,y]=W4(k=>{const S=p().filter(N=>!N.disabled),C=S.find(N=>N.value===u.value),j=K4(S,k,C);j!==void 0&&u.onValueChange(j.value)}),b=Ln(k=>{f||(u.onOpenChange(!0),y()),k&&(u.triggerPointerDownPosRef.current={x:Math.round(k.pageX),y:Math.round(k.pageY)})},"handleOpen");return o.jsx(ef,{asChild:!0,...c,children:o.jsx(ln.button,{type:"button",role:"combobox","aria-controls":u.open?u.contentId:void 0,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":sf(u.value)?"":void 0,...i,ref:h,onClick:yt(i.onClick,k=>{k.currentTarget.focus(),m.current!=="mouse"&&b(k)}),onPointerDown:yt(i.onPointerDown,k=>{m.current=k.pointerType;const S=k.target;S.hasPointerCapture(k.pointerId)&&S.releasePointerCapture(k.pointerId),k.button===0&&k.ctrlKey===!1&&k.pointerType==="mouse"&&(b(k),k.preventDefault())}),onKeyDown:yt(i.onKeyDown,k=>{const S=v.current!=="";!(k.ctrlKey||k.altKey||k.metaKey)&&k.key.length===1&&w(k.key),!(S&&k.key===" ")&&LZ.includes(k.key)&&(b(),k.preventDefault())})})})},"SelectTrigger")),ZZ="SelectValue",VZ=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,className:a,style:i,children:c,placeholder:u="",...f}=t,h=al(ZZ,r),{onValueNodeHasChildrenChange:p}=h,m=c!==void 0,v=an(n,h.onValueNodeChange);gr(()=>{p(m)},[p,m]);const w=sf(h.value);return o.jsx(ln.span,{...f,asChild:w?!1:f.asChild,ref:v,style:{pointerEvents:"none"},children:o.jsx(s.Fragment,{children:w?u:c},w?"placeholder":"value")})},"SelectValue")),zZ=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,children:a,...i}=t;return o.jsx(ln.span,{"aria-hidden":!0,...i,ref:n,children:a||"▼"})},"SelectIcon")),BZ="SelectPortal",[UZ,WZ]=xc(BZ,{forceMount:void 0}),KZ=Ln(e=>{const{__scopeSelect:t,forceMount:n,...r}=e;return o.jsx(UZ,{scope:e.__scopeSelect,forceMount:n,children:o.jsx(Q0,{asChild:!0,...r})})},"SelectPortal"),Jl="SelectContent",GZ=s.forwardRef(Ln(function(t,n){const r=WZ(Jl,t.__scopeSelect),{forceMount:a=r.forceMount,...i}=t,c=al(Jl,t.__scopeSelect),[u,f]=s.useState();return gr(()=>{f(new DocumentFragment)},[]),o.jsx(es,{present:a||c.open,children:({present:h})=>h?o.jsx(XZ,{...i,ref:n}):o.jsx(YZ,{...i,fragment:u})})},"SelectContent")),YZ=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,children:a,fragment:i}=t;return i?Rr.createPortal(o.jsx(g7,{scope:r,children:o.jsx(Dp.Slot,{scope:r,children:o.jsx("div",{ref:n,children:a})})}),i):null},"SelectContentFragment")),Ma=10,[g7,Hp]=xc(Jl),qZ=$a("SelectContent.RemoveScroll"),XZ=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r}=t,{position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:c,onPointerDownOutside:u,side:f,sideOffset:h,align:p,alignOffset:m,arrowPadding:v,collisionBoundary:w,collisionPadding:y,sticky:b,hideWhenDetached:k,avoidCollisions:S,...C}=t,j=al(Jl,r),[N,P]=s.useState(null),[$,R]=s.useState(null),E=an(n,P),[M,L]=s.useState(null),[H,D]=s.useState(null),K=B4(r),[O,_]=s.useState(!1),re=s.useRef(!1);s.useEffect(()=>{if(N)return yp(N)},[N]),qu();const z=s.useCallback(te=>{const[be,...G]=K().map(W=>W.ref.current),[J]=G.slice(-1),ne=document.activeElement;for(const W of te)if(W===ne||(W==null||W.scrollIntoView({block:"nearest"}),W===be&&$&&($.scrollTop=0),W===J&&$&&($.scrollTop=$.scrollHeight),W==null||W.focus(),document.activeElement!==ne))return},[K,$]),F=s.useCallback(()=>z([M,N]),[z,M,N]);s.useEffect(()=>{O&&F()},[O,F]);const{onOpenChange:Q,triggerPointerDownPosRef:V}=j;s.useEffect(()=>{if(N){let te={x:0,y:0};const be=Ln(J=>{var ne,W;te={x:Math.abs(Math.round(J.pageX)-(((ne=V.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(J.pageY)-(((W=V.current)==null?void 0:W.y)??0))}},"handlePointerMove"),G=Ln(J=>{te.x<=10&&te.y<=10?J.preventDefault():J.composedPath().includes(N)||Q(!1),document.removeEventListener("pointermove",be),V.current=null},"handlePointerUp");return V.current!==null&&(document.addEventListener("pointermove",be),document.addEventListener("pointerup",G,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",G,{capture:!0})}}},[N,Q,V]),s.useEffect(()=>{const te=Ln(()=>Q(!1),"close");return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[Q]);const[I,B]=W4(te=>{const be=K().filter(ne=>!ne.disabled),G=be.find(ne=>ne.ref.current===document.activeElement),J=K4(be,te,G);J&&setTimeout(()=>{var ne;return(ne=J.ref.current)==null?void 0:ne.focus()})}),Y=s.useCallback((te,be,G)=>{const J=!re.current&&!G;(j.value!==void 0&&j.value===be||J)&&(L(te),J&&(re.current=!0))},[j.value]),ae=s.useCallback(()=>N==null?void 0:N.focus(),[N]),X=s.useCallback((te,be,G)=>{const J=!re.current&&!G;(j.value!==void 0&&j.value===be||J)&&D(te)},[j.value]),le=a==="popper"?G3:QZ,ke=le===G3?{side:f,sideOffset:h,align:p,alignOffset:m,arrowPadding:v,collisionBoundary:w,collisionPadding:y,sticky:b,hideWhenDetached:k,avoidCollisions:S}:{};return o.jsx(g7,{scope:r,content:N,viewport:$,onViewportChange:R,itemRefCallback:Y,selectedItem:M,onItemLeave:ae,itemTextRefCallback:X,focusSelectedItem:F,selectedItemText:H,position:a,isPositioned:O,searchRef:I,children:o.jsx(J0,{as:qZ,allowPinchZoom:!0,children:o.jsx(Yu,{asChild:!0,trapped:j.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:yt(i,te=>{var be;(be=j.trigger)==null||be.focus({preventScroll:!0}),te.preventDefault()}),children:o.jsx(X0,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:o.jsx(le,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:te=>te.preventDefault(),...C,...ke,onPlaced:()=>_(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:yt(C.onKeyDown,te=>{const be=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!be&&te.key.length===1&&B(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let J=K().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(te.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const ne=te.target,W=J.indexOf(ne);J=J.slice(W+1)}setTimeout(()=>z(J)),te.preventDefault()}})})})})})})},"SelectContentImpl")),QZ=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,onPlaced:a,...i}=t,c=al(Jl,r),u=Hp(Jl,r),[f,h]=s.useState(null),[p,m]=s.useState(null),v=an(n,m),w=B4(r),y=s.useRef(!1),b=s.useRef(!0),{viewport:k,selectedItem:S,selectedItemText:C,focusSelectedItem:j}=u,N=s.useCallback(()=>{if(c.trigger&&c.valueNode&&f&&p&&k&&S&&C){const E=c.trigger.getBoundingClientRect(),M=p.getBoundingClientRect(),L=c.valueNode.getBoundingClientRect(),H=C.getBoundingClientRect();if(c.dir!=="rtl"){const ne=H.left-M.left,W=L.left-ne,he=E.left-W,Xe=E.width+he,tt=Math.max(Xe,M.width),ze=window.innerWidth-Ma,nt=Mh(W,[Ma,Math.max(Ma,ze-tt)]);f.style.minWidth=Xe+"px",f.style.left=nt+"px"}else{const ne=M.right-H.right,W=window.innerWidth-L.right-ne,he=window.innerWidth-E.right-W,Xe=E.width+he,tt=Math.max(Xe,M.width),ze=window.innerWidth-Ma,nt=Mh(W,[Ma,Math.max(Ma,ze-tt)]);f.style.minWidth=Xe+"px",f.style.right=nt+"px"}const D=w(),K=window.innerHeight-Ma*2,O=k.scrollHeight,_=window.getComputedStyle(p),re=parseInt(_.borderTopWidth,10),z=parseInt(_.paddingTop,10),F=parseInt(_.borderBottomWidth,10),Q=parseInt(_.paddingBottom,10),V=re+z+O+Q+F,I=Math.min(S.offsetHeight*5,V),B=window.getComputedStyle(k),Y=parseInt(B.paddingTop,10),ae=parseInt(B.paddingBottom,10),X=E.top+E.height/2-Ma,le=K-X,ke=S.offsetHeight/2,te=S.offsetTop+ke,be=re+z+te,G=V-be;if(be<=X){const ne=D.length>0&&S===D[D.length-1].ref.current;f.style.bottom="0px";const W=p.clientHeight-k.offsetTop-k.offsetHeight,he=Math.max(le,ke+(ne?ae:0)+W+F),Xe=be+he;f.style.height=Xe+"px"}else{const ne=D.length>0&&S===D[0].ref.current;f.style.top="0px";const he=Math.max(X,re+k.offsetTop+(ne?Y:0)+ke)+G;f.style.height=he+"px",k.scrollTop=be-X+k.offsetTop}f.style.margin=`${Ma}px 0`,f.style.minHeight=I+"px",f.style.maxHeight=K+"px",a==null||a(),requestAnimationFrame(()=>y.current=!0)}},[w,c.trigger,c.valueNode,f,p,k,S,C,c.dir,a]);gr(()=>N(),[N]);const[P,$]=s.useState();gr(()=>{p&&$(window.getComputedStyle(p).zIndex)},[p]);const R=s.useCallback(E=>{E&&b.current===!0&&(N(),j==null||j(),b.current=!1)},[N,j]);return o.jsx(JZ,{scope:r,contentWrapper:f,shouldExpandOnScrollRef:y,onScrollButtonChange:R,children:o.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:o.jsx(ln.div,{...i,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})},"SelectItemAlignedPosition")),G3=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,align:a="start",collisionPadding:i=Ma,...c}=t,u=U4(r);return o.jsx(Mp,{...u,...c,ref:n,align:a,collisionPadding:i,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[JZ,eV]=xc(Jl,{}),Y3="SelectViewport",tV=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,nonce:a,...i}=t,c=Hp(Y3,r),u=eV(Y3,r),f=an(n,c.onViewportChange),h=s.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),o.jsx(Dp.Slot,{scope:r,children:o.jsx(ln.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:yt(i.onScroll,p=>{const m=p.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=u;if(w!=null&&w.current&&v){const y=Math.abs(h.current-m.scrollTop);if(y>0){const b=window.innerHeight-Ma*2,k=parseFloat(v.style.minHeight),S=parseFloat(v.style.height),C=Math.max(k,S);if(C<b){const j=C+y,N=Math.min(b,j),P=j-N;v.style.height=N+"px",v.style.bottom==="0px"&&(m.scrollTop=P>0?P:0,v.style.justifyContent="flex-end")}}}h.current=m.scrollTop})})})]})},"SelectViewport")),nV="SelectGroup",[rV,sV]=xc(nV),aV=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,...a}=t,i=da();return o.jsx(rV,{scope:r,id:i,children:o.jsx(ln.div,{role:"group","aria-labelledby":i,...a,ref:n})})},"SelectGroup")),oV="SelectLabel",iV=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,...a}=t,i=sV(oV,r);return o.jsx(ln.div,{id:i.id,...a,ref:n})},"SelectLabel")),J8="SelectItem",[lV,v7]=xc(J8),cV=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,value:a,disabled:i=!1,textValue:c,...u}=t,f=al(J8,r),h=Hp(J8,r),p=f.value===a,[m,v]=s.useState(c??""),[w,y]=s.useState(!1),b=pr(N=>{var P;return(P=h.itemRefCallback)==null?void 0:P.call(h,N,a,i)}),k=an(n,b),S=da(),C=s.useRef("touch"),j=Ln(()=>{i||(f.onValueChange(a),f.onOpenChange(!1))},"handleSelect");return o.jsx(lV,{scope:r,value:a,disabled:i,textId:S,isSelected:p,onItemTextChange:s.useCallback(N=>{v(P=>P||((N==null?void 0:N.textContent)??"").trim())},[]),children:o.jsx(Dp.ItemSlot,{scope:r,value:a,disabled:i,textValue:m,children:o.jsx(ln.div,{role:"option","aria-labelledby":S,"data-highlighted":w?"":void 0,"aria-selected":p&&w,"data-state":p?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...u,ref:k,onFocus:yt(u.onFocus,()=>y(!0)),onBlur:yt(u.onBlur,()=>y(!1)),onClick:yt(u.onClick,()=>{C.current!=="mouse"&&j()}),onPointerUp:yt(u.onPointerUp,()=>{C.current==="mouse"&&j()}),onPointerDown:yt(u.onPointerDown,N=>{C.current=N.pointerType}),onPointerMove:yt(u.onPointerMove,N=>{var P;C.current=N.pointerType,i?(P=h.onItemLeave)==null||P.call(h):C.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:yt(u.onPointerLeave,N=>{var P;N.currentTarget===document.activeElement&&((P=h.onItemLeave)==null||P.call(h))}),onKeyDown:yt(u.onKeyDown,N=>{var $;i||N.target!==N.currentTarget||(($=h.searchRef)==null?void 0:$.current)!==""&&N.key===" "||(TZ.includes(N.key)&&j(),N.key===" "&&N.preventDefault())})})})})},"SelectItem")),z1="SelectItemText",uV=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,className:a,style:i,...c}=t,u=al(z1,r),f=Hp(z1,r),h=v7(z1,r),p=OZ(z1,r),[m,v]=s.useState(null),w=pr(j=>{var N;return(N=f.itemTextRefCallback)==null?void 0:N.call(f,j,h.value,h.disabled)}),y=an(n,v,h.onItemTextChange,w),b=m==null?void 0:m.textContent,k=s.useMemo(()=>o.jsx("option",{value:h.value,disabled:h.disabled,children:b},h.value),[h.disabled,h.value,b]),{onNativeOptionAdd:S,onNativeOptionRemove:C}=p;return gr(()=>(S(k),()=>C(k)),[S,C,k]),o.jsxs(o.Fragment,{children:[o.jsx(ln.span,{id:h.textId,...c,ref:y}),h.isSelected&&u.valueNode&&!u.valueNodeHasChildren&&!sf(u.value)?Rr.createPortal(c.children,u.valueNode):null]})},"SelectItemText")),dV="SelectItemIndicator",fV=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,...a}=t;return v7(dV,r).isSelected?o.jsx(ln.span,{"aria-hidden":!0,...a,ref:n}):null},"SelectItemIndicator")),hV=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,...a}=t;return o.jsx(ln.div,{"aria-hidden":!0,...a,ref:n})},"SelectSeparator")),pV="SelectBubbleInput",mV=s.forwardRef(Ln(function({__scopeSelect:t,...n},r){const a=al(pV,t),{value:i,onValueChange:c,required:u,disabled:f,name:h,autoComplete:p,form:m}=a,{nativeOptions:v,nativeSelectKey:w}=a,y=s.useRef(null),b=an(r,y),k=i??"",S=t7(k),C=Array.from(v).some(j=>(j.props.value??"")==="");return s.useEffect(()=>{const j=y.current;if(!j)return;const N=window.HTMLSelectElement.prototype,$=Object.getOwnPropertyDescriptor(N,"value").set;if(S!==k&&$){const R=new Event("change",{bubbles:!0});$.call(j,k),j.dispatchEvent(R)}},[S,k]),o.jsxs(ln.select,{"aria-hidden":!0,required:u,tabIndex:-1,name:h,autoComplete:p,disabled:f,form:m,onChange:j=>c(j.target.value),...n,style:{...t9,...n.style},ref:b,defaultValue:k,children:[sf(i)&&!C?o.jsx("option",{value:""}):null,Array.from(v)]},w)},"SelectBubbleInput"));function w7(e){return typeof e=="function"}Ln(w7,"isFunction");function sf(e){return e===""||e===void 0}Ln(sf,"shouldShowPlaceholder");function W4(e){const t=pr(e),n=s.useRef(""),r=s.useRef(0),a=s.useCallback(c=>{const u=n.current+c;t(u),Ln((function f(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>f(""),1e3))}),"updateSearch")(u)},[t]),i=s.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}Ln(W4,"useTypeaheadSearch");function K4(e,t,n){const a=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let c=y7(e,Math.max(i,0));a.length===1&&(c=c.filter(h=>h!==n));const f=c.find(h=>h.textValue.toLowerCase().startsWith(a.toLowerCase()));return f!==n?f:void 0}Ln(K4,"findNextItem");function y7(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Ln(y7,"wrapArray");var gV=Object.defineProperty,kr=(e,t)=>gV(e,"name",{value:t,configurable:!0}),[G4,Vle]=Ms("Tooltip",[rl]),Op=rl(),vV="TooltipProvider",wV=700,e6="tooltip.open",[yV,Y4]=G4(vV),bV=kr(e=>{const{__scopeTooltip:t,delayDuration:n=wV,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,c=s.useRef(!0),u=s.useRef(!1),f=s.useRef(0);return s.useEffect(()=>{const h=f.current;return()=>window.clearTimeout(h)},[]),o.jsx(yV,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:s.useCallback(()=>{r<=0||(window.clearTimeout(f.current),c.current=!1)},[r]),onClose:s.useCallback(()=>{r<=0||(window.clearTimeout(f.current),f.current=window.setTimeout(()=>c.current=!0,r))},[r]),isPointerInTransitRef:u,onPointerInTransitChange:s.useCallback(h=>{u.current=h},[]),disableHoverableContent:a,children:i})},"TooltipProvider"),t6="Tooltip",[xV,af]=G4(t6),kV=kr(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:c,delayDuration:u}=e,f=Y4(t6,e.__scopeTooltip),h=Op(t),[p,m]=s.useState(null),[v,w]=s.useState(void 0),y=da(),b=s.useRef(0),k=c??f.disableHoverableContent,S=u??f.delayDuration,C=s.useRef(!1),[j,N]=Qo({prop:r,defaultProp:a??!1,onChange:kr(L=>{L?(f.onOpen(),document.dispatchEvent(new CustomEvent(e6))):f.onClose(),i==null||i(L)},"onChange"),caller:t6}),P=s.useMemo(()=>j?C.current?"delayed-open":"instant-open":"closed",[j]),$=s.useCallback(()=>{window.clearTimeout(b.current),b.current=0,C.current=!1,N(!0)},[N]),R=s.useCallback(()=>{window.clearTimeout(b.current),b.current=0,N(!1)},[N]),E=s.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{C.current=!0,N(!0),b.current=0},S)},[S,N]);s.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const M=v??y;return o.jsx(Np,{...h,children:o.jsx(xV,{scope:t,contentId:M,setContentId:w,open:j,stateAttribute:P,trigger:p,onTriggerChange:m,onTriggerEnter:s.useCallback(()=>{f.isOpenDelayedRef.current?E():$()},[f.isOpenDelayedRef,E,$]),onTriggerLeave:s.useCallback(()=>{k?R():(window.clearTimeout(b.current),b.current=0)},[R,k]),onOpen:$,onClose:R,disableHoverableContent:k,children:n})})},"Tooltip"),q3="TooltipTrigger",SV=s.forwardRef(kr(function(t,n){const{__scopeTooltip:r,...a}=t,i=af(q3,r),c=Y4(q3,r),u=Op(r),f=s.useRef(null),h=an(n,f,i.onTriggerChange),p=s.useRef(!1),m=s.useRef(!1),v=s.useCallback(()=>p.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),o.jsx(ef,{asChild:!0,...u,children:o.jsx(ln.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...a,ref:h,onPointerMove:yt(t.onPointerMove,w=>{w.pointerType!=="touch"&&!m.current&&!c.isPointerInTransitRef.current&&(i.onTriggerEnter(),m.current=!0)}),onPointerLeave:yt(t.onPointerLeave,()=>{i.onTriggerLeave(),m.current=!1}),onPointerDown:yt(t.onPointerDown,()=>{i.open&&i.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:yt(t.onFocus,()=>{p.current||i.onOpen()}),onBlur:yt(t.onBlur,i.onClose),onClick:yt(t.onClick,i.onClose)})})},"TooltipTrigger")),b7="TooltipPortal",[EV,CV]=G4(b7,{forceMount:void 0}),jV=kr(e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,i=af(b7,t);return o.jsx(EV,{scope:t,forceMount:n,children:o.jsx(es,{present:n||i.open,children:o.jsx(Q0,{asChild:!0,container:a,children:r})})})},"TooltipPortal"),M0="TooltipContent",AV=s.forwardRef(kr(function(t,n){const r=CV(M0,t.__scopeTooltip),{forceMount:a=r.forceMount,side:i="top",...c}=t,u=af(M0,t.__scopeTooltip);return o.jsx(es,{present:a||u.open,children:u.disableHoverableContent?o.jsx(x7,{side:i,...c,ref:n}):o.jsx(NV,{side:i,...c,ref:n})})},"TooltipContent")),NV=s.forwardRef(kr(function(t,n){const r=af(M0,t.__scopeTooltip),a=Y4(M0,t.__scopeTooltip),i=s.useRef(null),c=an(n,i),[u,f]=s.useState(null),{trigger:h,onClose:p}=r,m=i.current,{onPointerInTransitChange:v}=a,w=s.useCallback(()=>{f(null),v(!1)},[v]),y=s.useCallback((b,k)=>{const S=b.currentTarget,C={x:b.clientX,y:b.clientY},j=k7(C,S.getBoundingClientRect()),N=S7(C,j),P=E7(k.getBoundingClientRect()),$=j7([...N,...P]);f($),v(!0)},[v]);return s.useEffect(()=>()=>w(),[w]),s.useEffect(()=>{if(h&&m){const b=kr(S=>y(S,m),"handleTriggerLeave"),k=kr(S=>y(S,h),"handleContentLeave");return h.addEventListener("pointerleave",b),m.addEventListener("pointerleave",k),()=>{h.removeEventListener("pointerleave",b),m.removeEventListener("pointerleave",k)}}},[h,m,y,w]),s.useEffect(()=>{if(u){const b=kr(k=>{const S=k.target,C={x:k.clientX,y:k.clientY},j=(h==null?void 0:h.contains(S))||(m==null?void 0:m.contains(S)),N=!C7(C,u);j?w():N&&(w(),p())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[h,m,u,p,w]),o.jsx(x7,{...t,ref:c})},"TooltipContentHoverable")),MV=p4("TooltipContent"),x7=s.forwardRef(kr(function(t,n){const{__scopeTooltip:r,children:a,"aria-label":i,id:c,onEscapeKeyDown:u,onPointerDownOutside:f,...h}=t,p=af(M0,r),m=Op(r),{onClose:v}=p;s.useEffect(()=>(document.addEventListener(e6,v),()=>document.removeEventListener(e6,v)),[v]),s.useEffect(()=>{if(p.trigger){const y=kr(b=>{b.target instanceof Node&&b.target.contains(p.trigger)&&v()},"handleScroll");return window.addEventListener("scroll",y,{capture:!0}),()=>window.removeEventListener("scroll",y,{capture:!0})}},[p.trigger,v]);const{setContentId:w}=p;return gr(()=>(w(c),()=>{w(void 0)}),[c,w]),o.jsx(X0,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:y=>y.preventDefault(),onDismiss:v,children:o.jsxs(Mp,{"data-state":p.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:p.contentId,...m,...h,ref:n,style:{...h.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(MV,{children:a}),i?o.jsx(n9,{id:p.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl")),RV=s.forwardRef(kr(function(t,n){const{__scopeTooltip:r,...a}=t,i=Op(r);return o.jsx(FI,{...i,...a,ref:n})},"TooltipArrow"));function k7(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}kr(k7,"getExitSideFromRect");function S7(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}kr(S7,"getPaddedExitPoints");function E7(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}kr(E7,"getPointsFromRect");function C7(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,c=t.length-1;i<t.length;c=i++){const u=t[i],f=t[c],h=u.x,p=u.y,m=f.x,v=f.y;p>r!=v>r&&n<(m-h)*(r-p)/(v-p)+h&&(a=!a)}return a}kr(C7,"isPointInPolygon");function j7(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),A7(t)}kr(j7,"getHull");function A7(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const i=t[t.length-1],c=t[t.length-2];if((i.x-c.x)*(a.y-c.y)>=(i.y-c.y)*(a.x-c.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],c=n[n.length-2];if((i.x-c.x)*(a.y-c.y)>=(i.y-c.y)*(a.x-c.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}kr(A7,"getHullPresorted");var PV=bV,LV=kV,TV=SV,$V=jV,DV=AV,HV=RV,xg={exports:{}};/*!
|
|
93
|
-
Copyright (c) 2018 Jed Watson.
|
|
94
|
-
Licensed under the MIT License (MIT), see
|
|
95
|
-
http://jedwatson.github.io/classnames
|
|
96
|
-
*/var X3;function OV(){return X3||(X3=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",c=0;c<arguments.length;c++){var u=arguments[c];u&&(i=a(i,r(u)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var c="";for(var u in i)t.call(i,u)&&i[u]&&(c=a(c,u));return c}function a(i,c){return c?i?i+" "+c:i+c:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(xg)),xg.exports}var IV=OV();const _t=oS(IV),_a={asChild:{type:"boolean"}},lo={width:{type:"string",className:"rt-r-w",customProperties:["--width"],responsive:!0},minWidth:{type:"string",className:"rt-r-min-w",customProperties:["--min-width"],responsive:!0},maxWidth:{type:"string",className:"rt-r-max-w",customProperties:["--max-width"],responsive:!0}},q4={height:{type:"string",className:"rt-r-h",customProperties:["--height"],responsive:!0},minHeight:{type:"string",className:"rt-r-min-h",customProperties:["--min-height"],responsive:!0},maxHeight:{type:"string",className:"rt-r-max-h",customProperties:["--max-height"],responsive:!0}},FV=["1","2","3","4"],N7={..._a,align:{type:"enum",className:"rt-r-align",values:["start","center"],default:"center"},size:{type:"enum",className:"rt-r-size",values:FV,default:"3",responsive:!0},width:lo.width,minWidth:lo.minWidth,maxWidth:{...lo.maxWidth,default:"600px"},...q4},M7=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"],ol={color:{type:"enum",values:M7,default:void 0}},X4={color:{type:"enum",values:M7,default:""}},kc={highContrast:{type:"boolean",className:"rt-high-contrast",default:void 0}},_V=["normal","start","end","both"],R7={trim:{type:"enum",className:"rt-r-lt",values:_V,responsive:!0}},ZV=["left","center","right"],P7={align:{type:"enum",className:"rt-r-ta",values:ZV,responsive:!0}},VV=["wrap","nowrap","pretty","balance"],L7={wrap:{type:"enum",className:"rt-r-tw",values:VV,responsive:!0}},T7={truncate:{type:"boolean",className:"rt-truncate"}},zV=["light","regular","medium","bold"],$7={weight:{type:"enum",className:"rt-r-weight",values:zV,responsive:!0}},BV=["h1","h2","h3","h4","h5","h6"],UV=["1","2","3","4","5","6","7","8","9"],WV={as:{type:"enum",values:BV,default:"h1"},..._a,size:{type:"enum",className:"rt-r-size",values:UV,default:"6",responsive:!0},...$7,...P7,...R7,...T7,...L7,...ol,...kc},KV=["initial","xs","sm","md","lg","xl"],Q4=new Set(KV);function D7(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function d0(e){return typeof e=="object"&&e!==null&&Object.keys(e).some(t=>Q4.has(t))}function Pi({className:e,customProperties:t,...n}){const r=Rh({allowArbitraryValues:!0,className:e,...n}),a=GV({customProperties:t,...n});return[r,a]}function Rh({allowArbitraryValues:e,value:t,className:n,propValues:r,parseValue:a=i=>i}){const i=[];if(t){if(typeof t=="string"&&r.includes(t))return Q3(n,t,a);if(d0(t)){const c=t;for(const u in c){if(!D7(c,u)||!Q4.has(u))continue;const f=c[u];if(f!==void 0){if(r.includes(f)){const h=Q3(n,f,a),p=u==="initial"?h:`${u}:${h}`;i.push(p)}else if(e){const h=u==="initial"?n:`${u}:${n}`;i.push(h)}}}return i.join(" ")}if(e)return n}}function Q3(e,t,n){const r=e?"-":"",a=n(t),i=a==null?void 0:a.startsWith("-"),c=i?"-":"",u=i?a==null?void 0:a.substring(1):a;return`${c}${e}${r}${u}`}function GV({customProperties:e,value:t,propValues:n,parseValue:r=a=>a}){let a={};if(!(!t||typeof t=="string"&&n.includes(t))){if(typeof t=="string"&&(a=Object.fromEntries(e.map(i=>[i,t]))),d0(t)){const i=t;for(const c in i){if(!D7(i,c)||!Q4.has(c))continue;const u=i[c];if(!n.includes(u))for(const f of e)a={[c==="initial"?f:`${f}-${c}`]:u,...a}}}for(const i in a){const c=a[i];c!==void 0&&(a[i]=r(c))}return a}}function Ph(...e){let t={};for(const n of e)n&&(t={...t,...n});return Object.keys(t).length?t:void 0}function YV(...e){return Object.assign({},...e)}function vr(e,...t){let n,r;const a={...e},i=YV(...t);for(const c in i){let u=a[c];const f=i[c];if(f.default!==void 0&&u===void 0&&(u=f.default),f.type==="enum"&&![f.default,...f.values].includes(u)&&!d0(u)&&(u=f.default),a[c]=u,"className"in f&&f.className){delete a[c];const h="responsive"in f;if(!u||d0(u)&&!h)continue;if(d0(u)&&(f.default!==void 0&&u.initial===void 0&&(u.initial=f.default),f.type==="enum"&&([f.default,...f.values].includes(u.initial)||(u.initial=f.default))),f.type==="enum"){const p=Rh({allowArbitraryValues:!1,value:u,className:f.className,propValues:f.values,parseValue:f.parseValue});n=_t(n,p);continue}if(f.type==="string"||f.type==="enum | string"){const p=f.type==="string"?[]:f.values,[m,v]=Pi({className:f.className,customProperties:f.customProperties,propValues:p,parseValue:f.parseValue,value:u});r=Ph(r,v),n=_t(n,m);continue}if(f.type==="boolean"&&u){n=_t(n,f.className);continue}}}return a.className=_t(n,e.className),a.style=Ph(r,e.style),a}const Nl=["0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],bo={m:{type:"enum | string",values:Nl,responsive:!0,className:"rt-r-m",customProperties:["--m"]},mx:{type:"enum | string",values:Nl,responsive:!0,className:"rt-r-mx",customProperties:["--ml","--mr"]},my:{type:"enum | string",values:Nl,responsive:!0,className:"rt-r-my",customProperties:["--mt","--mb"]},mt:{type:"enum | string",values:Nl,responsive:!0,className:"rt-r-mt",customProperties:["--mt"]},mr:{type:"enum | string",values:Nl,responsive:!0,className:"rt-r-mr",customProperties:["--mr"]},mb:{type:"enum | string",values:Nl,responsive:!0,className:"rt-r-mb",customProperties:["--mb"]},ml:{type:"enum | string",values:Nl,responsive:!0,className:"rt-r-ml",customProperties:["--ml"]}},J4=s.forwardRef((e,t)=>{const{children:n,className:r,asChild:a,as:i="h1",color:c,...u}=vr(e,WV,bo);return s.createElement(fc,{"data-accent-color":c,...u,ref:t,className:_t("rt-Heading",r)},a?n:s.createElement(i,null,n))});J4.displayName="Heading";const qV=["span","div","label","p"],XV=["1","2","3","4","5","6","7","8","9"],QV={as:{type:"enum",values:qV,default:"span"},..._a,size:{type:"enum",className:"rt-r-size",values:XV,responsive:!0},...$7,...P7,...R7,...T7,...L7,...ol,...kc},ec=s.forwardRef((e,t)=>{const{children:n,className:r,asChild:a,as:i="span",color:c,...u}=vr(e,QV,bo);return s.createElement(fc,{"data-accent-color":c,...u,ref:t,className:_t("rt-Text",r)},a?n:s.createElement(i,null,n))});ec.displayName="Text";function JV(e){switch(e){case"tomato":case"red":case"ruby":case"crimson":case"pink":case"plum":case"purple":case"violet":return"mauve";case"iris":case"indigo":case"blue":case"sky":case"cyan":return"slate";case"teal":case"jade":case"mint":case"green":return"sage";case"grass":case"lime":return"olive";case"yellow":case"amber":case"orange":case"brown":case"gold":case"bronze":return"sand";case"gray":return"gray"}}const ez=["none","small","medium","large","full"],Ip={radius:{type:"enum",values:ez,default:void 0}},Fs={hasBackground:{default:!0},appearance:{default:"inherit"},accentColor:{default:"indigo"},grayColor:{default:"auto"},panelBackground:{default:"translucent"},radius:{default:"medium"},scaling:{default:"100%"}},eu=()=>{},Lh=s.createContext(void 0);function ev(){const e=s.useContext(Lh);if(e===void 0)throw new Error("`useThemeContext` must be used within a `Theme`");return e}const Za=s.forwardRef((e,t)=>s.useContext(Lh)===void 0?s.createElement(PV,{delayDuration:200},s.createElement(VD,{dir:"ltr"},s.createElement(H7,{...e,ref:t}))):s.createElement(tv,{...e,ref:t}));Za.displayName="Theme";const H7=s.forwardRef((e,t)=>{const{appearance:n=Fs.appearance.default,accentColor:r=Fs.accentColor.default,grayColor:a=Fs.grayColor.default,panelBackground:i=Fs.panelBackground.default,radius:c=Fs.radius.default,scaling:u=Fs.scaling.default,hasBackground:f=Fs.hasBackground.default,...h}=e,[p,m]=s.useState(n);s.useEffect(()=>m(n),[n]);const[v,w]=s.useState(r);s.useEffect(()=>w(r),[r]);const[y,b]=s.useState(a);s.useEffect(()=>b(a),[a]);const[k,S]=s.useState(i);s.useEffect(()=>S(i),[i]);const[C,j]=s.useState(c);s.useEffect(()=>j(c),[c]);const[N,P]=s.useState(u);return s.useEffect(()=>P(u),[u]),s.createElement(tv,{...h,ref:t,isRoot:!0,hasBackground:f,appearance:p,accentColor:v,grayColor:y,panelBackground:k,radius:C,scaling:N,onAppearanceChange:m,onAccentColorChange:w,onGrayColorChange:b,onPanelBackgroundChange:S,onRadiusChange:j,onScalingChange:P})});H7.displayName="ThemeRoot";const tv=s.forwardRef((e,t)=>{const n=s.useContext(Lh),{asChild:r,isRoot:a,hasBackground:i,appearance:c=(n==null?void 0:n.appearance)??Fs.appearance.default,accentColor:u=(n==null?void 0:n.accentColor)??Fs.accentColor.default,grayColor:f=(n==null?void 0:n.resolvedGrayColor)??Fs.grayColor.default,panelBackground:h=(n==null?void 0:n.panelBackground)??Fs.panelBackground.default,radius:p=(n==null?void 0:n.radius)??Fs.radius.default,scaling:m=(n==null?void 0:n.scaling)??Fs.scaling.default,onAppearanceChange:v=eu,onAccentColorChange:w=eu,onGrayColorChange:y=eu,onPanelBackgroundChange:b=eu,onRadiusChange:k=eu,onScalingChange:S=eu,...C}=e,j=r?fc:"div",N=f==="auto"?JV(u):f,P=e.appearance==="light"||e.appearance==="dark",$=i===void 0?a||P:i;return s.createElement(Lh.Provider,{value:s.useMemo(()=>({appearance:c,accentColor:u,grayColor:f,resolvedGrayColor:N,panelBackground:h,radius:p,scaling:m,onAppearanceChange:v,onAccentColorChange:w,onGrayColorChange:y,onPanelBackgroundChange:b,onRadiusChange:k,onScalingChange:S}),[c,u,f,N,h,p,m,v,w,y,b,k,S])},s.createElement(j,{"data-is-root-theme":a?"true":"false","data-accent-color":u,"data-gray-color":N,"data-has-background":$?"true":"false","data-panel-background":h,"data-radius":p,"data-scaling":m,ref:t,...C,className:_t("radix-themes",{light:c==="light",dark:c==="dark"},C.className)}))});tv.displayName="ThemeImpl";const ui=e=>{if(!s.isValidElement(e))throw Error(`Expected a single React Element child, but got: ${s.Children.toArray(e).map(t=>typeof t=="object"&&"type"in t&&typeof t.type=="string"?t.type:typeof t).join(", ")}`);return e},of=e=>s.createElement(fO,{...e});of.displayName="AlertDialog.Root";const O7=s.forwardRef(({children:e,...t},n)=>s.createElement(hO,{...t,ref:n,asChild:!0},ui(e)));O7.displayName="AlertDialog.Trigger";const lf=s.forwardRef(({align:e,...t},n)=>{const{align:r,...a}=N7,{className:i}=vr({align:e},{align:r}),{className:c,forceMount:u,container:f,...h}=vr(t,a);return s.createElement(pO,{container:f,forceMount:u},s.createElement(Za,{asChild:!0},s.createElement(mO,{className:"rt-BaseDialogOverlay rt-AlertDialogOverlay"},s.createElement("div",{className:"rt-BaseDialogScroll rt-AlertDialogScroll"},s.createElement("div",{className:`rt-BaseDialogScrollPadding rt-AlertDialogScrollPadding ${i}`},s.createElement(gO,{...h,ref:n,className:_t("rt-BaseDialogContent","rt-AlertDialogContent",c)}))))))});lf.displayName="AlertDialog.Content";const cf=s.forwardRef((e,t)=>s.createElement(yO,{asChild:!0},s.createElement(J4,{size:"5",mb:"3",trim:"start",...e,asChild:!1,ref:t})));cf.displayName="AlertDialog.Title";const uf=s.forwardRef((e,t)=>s.createElement(bO,{asChild:!0},s.createElement(ec,{as:"p",size:"3",...e,asChild:!1,ref:t})));uf.displayName="AlertDialog.Description";const df=s.forwardRef(({children:e,...t},n)=>s.createElement(vO,{...t,ref:n,asChild:!0},ui(e)));df.displayName="AlertDialog.Action";const ff=s.forwardRef(({children:e,...t},n)=>s.createElement(wO,{...t,ref:n,asChild:!0},ui(e)));ff.displayName="AlertDialog.Cancel";function tz(e,t){const{asChild:n,children:r}=e;if(!n)return typeof t=="function"?t(r):t;const a=s.Children.only(r);return s.cloneElement(a,{children:typeof t=="function"?t(a.props.children):t})}const nz=["1","2","3"],rz=["solid","soft","surface","outline"],sz={..._a,size:{type:"enum",className:"rt-r-size",values:nz,default:"1",responsive:!0},variant:{type:"enum",className:"rt-variant",values:rz,default:"soft"},...X4,...kc,...Ip},I7=s.forwardRef((e,t)=>{const{asChild:n,className:r,color:a,radius:i,...c}=vr(e,sz,bo),u=n?fc:"span";return s.createElement(u,{"data-accent-color":a,"data-radius":i,...c,ref:t,className:_t("rt-reset","rt-Badge",r)})});I7.displayName="Badge";const F7=fc,az=["div","span"],oz=["none","inline","inline-block","block","contents"],iz={as:{type:"enum",values:az,default:"div"},..._a,display:{type:"enum",className:"rt-r-display",values:oz,responsive:!0}},Ml=["0","1","2","3","4","5","6","7","8","9"],lz={p:{type:"enum | string",className:"rt-r-p",customProperties:["--p"],values:Ml,responsive:!0},px:{type:"enum | string",className:"rt-r-px",customProperties:["--pl","--pr"],values:Ml,responsive:!0},py:{type:"enum | string",className:"rt-r-py",customProperties:["--pt","--pb"],values:Ml,responsive:!0},pt:{type:"enum | string",className:"rt-r-pt",customProperties:["--pt"],values:Ml,responsive:!0},pr:{type:"enum | string",className:"rt-r-pr",customProperties:["--pr"],values:Ml,responsive:!0},pb:{type:"enum | string",className:"rt-r-pb",customProperties:["--pb"],values:Ml,responsive:!0},pl:{type:"enum | string",className:"rt-r-pl",customProperties:["--pl"],values:Ml,responsive:!0}},kg=["visible","hidden","clip","scroll","auto"],cz=["static","relative","absolute","fixed","sticky"],Zd=["0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],uz=["0","1"],dz=["0","1"],fz=["start","center","end","baseline","stretch"],hz=["start","center","end","baseline","stretch"],_7={...lz,...lo,...q4,position:{type:"enum",className:"rt-r-position",values:cz,responsive:!0},inset:{type:"enum | string",className:"rt-r-inset",customProperties:["--inset"],values:Zd,responsive:!0},top:{type:"enum | string",className:"rt-r-top",customProperties:["--top"],values:Zd,responsive:!0},right:{type:"enum | string",className:"rt-r-right",customProperties:["--right"],values:Zd,responsive:!0},bottom:{type:"enum | string",className:"rt-r-bottom",customProperties:["--bottom"],values:Zd,responsive:!0},left:{type:"enum | string",className:"rt-r-left",customProperties:["--left"],values:Zd,responsive:!0},overflow:{type:"enum",className:"rt-r-overflow",values:kg,responsive:!0},overflowX:{type:"enum",className:"rt-r-ox",values:kg,responsive:!0},overflowY:{type:"enum",className:"rt-r-oy",values:kg,responsive:!0},flexBasis:{type:"string",className:"rt-r-fb",customProperties:["--flex-basis"],responsive:!0},flexShrink:{type:"enum | string",className:"rt-r-fs",customProperties:["--flex-shrink"],values:uz,responsive:!0},flexGrow:{type:"enum | string",className:"rt-r-fg",customProperties:["--flex-grow"],values:dz,responsive:!0},gridArea:{type:"string",className:"rt-r-ga",customProperties:["--grid-area"],responsive:!0},gridColumn:{type:"string",className:"rt-r-gc",customProperties:["--grid-column"],responsive:!0},gridColumnStart:{type:"string",className:"rt-r-gcs",customProperties:["--grid-column-start"],responsive:!0},gridColumnEnd:{type:"string",className:"rt-r-gce",customProperties:["--grid-column-end"],responsive:!0},gridRow:{type:"string",className:"rt-r-gr",customProperties:["--grid-row"],responsive:!0},gridRowStart:{type:"string",className:"rt-r-grs",customProperties:["--grid-row-start"],responsive:!0},gridRowEnd:{type:"string",className:"rt-r-gre",customProperties:["--grid-row-end"],responsive:!0},alignSelf:{type:"enum",className:"rt-r-as",values:fz,responsive:!0},justifySelf:{type:"enum",className:"rt-r-js",values:hz,responsive:!0}},f0=s.forwardRef((e,t)=>{const{className:n,asChild:r,as:a="div",...i}=vr(e,iz,_7,bo);return s.createElement(r?F7:a,{...i,ref:t,className:_t("rt-Box",n)})});f0.displayName="Box";const pz=["1","2","3","4"],mz=["classic","solid","soft","surface","outline","ghost"],J3={..._a,size:{type:"enum",className:"rt-r-size",values:pz,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:mz,default:"solid"},...X4,...kc,...Ip,loading:{type:"boolean",className:"rt-loading",default:!1}},Sg=["0","1","2","3","4","5","6","7","8","9"],gz={gap:{type:"enum | string",className:"rt-r-gap",customProperties:["--gap"],values:Sg,responsive:!0},gapX:{type:"enum | string",className:"rt-r-cg",customProperties:["--column-gap"],values:Sg,responsive:!0},gapY:{type:"enum | string",className:"rt-r-rg",customProperties:["--row-gap"],values:Sg,responsive:!0}},vz=["div","span"],wz=["none","inline-flex","flex"],yz=["row","column","row-reverse","column-reverse"],bz=["start","center","end","baseline","stretch"],xz=["start","center","end","between"],kz=["nowrap","wrap","wrap-reverse"],Sz={as:{type:"enum",values:vz,default:"div"},..._a,display:{type:"enum",className:"rt-r-display",values:wz,responsive:!0},direction:{type:"enum",className:"rt-r-fd",values:yz,responsive:!0},align:{type:"enum",className:"rt-r-ai",values:bz,responsive:!0},justify:{type:"enum",className:"rt-r-jc",values:xz,parseValue:Ez,responsive:!0},wrap:{type:"enum",className:"rt-r-fw",values:kz,responsive:!0},...gz};function Ez(e){return e==="between"?"space-between":e}const js=s.forwardRef((e,t)=>{const{className:n,asChild:r,as:a="div",...i}=vr(e,Sz,_7,bo);return s.createElement(r?F7:a,{...i,ref:t,className:_t("rt-Flex",n)})});js.displayName="Flex";const Cz=["1","2","3"],jz={size:{type:"enum",className:"rt-r-size",values:Cz,default:"2",responsive:!0},loading:{type:"boolean",default:!0}},xr=s.forwardRef((e,t)=>{const{className:n,children:r,loading:a,...i}=vr(e,jz,bo);if(!a)return r;const c=s.createElement("span",{...i,ref:t,className:_t("rt-Spinner",n)},s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}));return r===void 0?c:s.createElement(js,{asChild:!0,position:"relative",align:"center",justify:"center"},s.createElement("span",null,s.createElement("span",{"aria-hidden":!0,style:{display:"contents",visibility:"hidden"},inert:void 0},r),s.createElement(js,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},s.createElement("span",null,c))))});xr.displayName="Spinner";const Az=n9;function Z7(e,t){if(e!==void 0)return typeof e=="string"?t(e):Object.fromEntries(Object.entries(e).map(([n,r])=>[n,t(r)]))}function Nz(e){return e==="3"?"3":"2"}function Mz(e){switch(e){case"1":return"1";case"2":case"3":return"2";case"4":return"3"}}const V7=s.forwardRef((e,t)=>{const{size:n=J3.size.default}=e,{className:r,children:a,asChild:i,color:c,radius:u,disabled:f=e.loading,...h}=vr(e,J3,bo),p=i?fc:"button";return s.createElement(p,{"data-disabled":f||void 0,"data-accent-color":c,"data-radius":u,...h,ref:t,className:_t("rt-reset","rt-BaseButton",r),disabled:f},e.loading?s.createElement(s.Fragment,null,s.createElement("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":!0},a),s.createElement(Az,null,a),s.createElement(js,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},s.createElement("span",null,s.createElement(xr,{size:Z7(n,Mz)})))):a)});V7.displayName="BaseButton";const ia=s.forwardRef(({className:e,...t},n)=>s.createElement(V7,{...t,ref:n,className:_t("rt-Button",e)}));ia.displayName="Button";const Rz=["1","2","3"],Pz=["soft","surface","outline"],ex={..._a,size:{type:"enum",className:"rt-r-size",values:Rz,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:Pz,default:"soft"},...X4,...kc},z7=s.createContext({}),n6=s.forwardRef((e,t)=>{const{size:n=ex.size.default}=e,{asChild:r,children:a,className:i,color:c,...u}=vr(e,ex,bo),f=r?fc:"div";return s.createElement(f,{"data-accent-color":c,...u,className:_t("rt-CalloutRoot",i),ref:t},s.createElement(z7.Provider,{value:s.useMemo(()=>({size:n}),[n])},a))});n6.displayName="Callout.Root";const Lz=s.forwardRef(({className:e,...t},n)=>s.createElement("div",{...t,className:_t("rt-CalloutIcon",e),ref:n}));Lz.displayName="Callout.Icon";const r6=s.forwardRef(({className:e,...t},n)=>{const{size:r}=s.useContext(z7);return s.createElement(ec,{as:"p",size:Z7(r,Nz),...t,asChild:!1,ref:n,className:_t("rt-CalloutText",e)})});r6.displayName="Callout.Text";const Tz=$n.forwardRef((e,t)=>$n.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},$n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z"})));Tz.displayName="ThickDividerHorizontalIcon";const Ju=$n.forwardRef((e,t)=>$n.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},$n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z"})));Ju.displayName="ThickCheckIcon";const B7=$n.forwardRef((e,t)=>$n.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},$n.createElement("path",{d:"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z"})));B7.displayName="ChevronDownIcon";const nv=$n.forwardRef((e,t)=>$n.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},$n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z"})));nv.displayName="ThickChevronRightIcon";const $z=["1","2","3"],Vd={..._a,size:{values:$z,default:"1"},...Ip,scrollbars:{default:"both"}};function Dz(e){const{m:t,mx:n,my:r,mt:a,mr:i,mb:c,ml:u,...f}=e;return{m:t,mx:n,my:r,mt:a,mr:i,mb:c,ml:u,rest:f}}const Rl=bo.m.values;function Hz(e){const[t,n]=Pi({className:"rt-r-m",customProperties:["--margin"],propValues:Rl,value:e.m}),[r,a]=Pi({className:"rt-r-mx",customProperties:["--margin-left","--margin-right"],propValues:Rl,value:e.mx}),[i,c]=Pi({className:"rt-r-my",customProperties:["--margin-top","--margin-bottom"],propValues:Rl,value:e.my}),[u,f]=Pi({className:"rt-r-mt",customProperties:["--margin-top"],propValues:Rl,value:e.mt}),[h,p]=Pi({className:"rt-r-mr",customProperties:["--margin-right"],propValues:Rl,value:e.mr}),[m,v]=Pi({className:"rt-r-mb",customProperties:["--margin-bottom"],propValues:Rl,value:e.mb}),[w,y]=Pi({className:"rt-r-ml",customProperties:["--margin-left"],propValues:Rl,value:e.ml});return[_t(t,r,i,u,h,m,w),Ph(n,a,c,f,p,v,y)]}const hf=s.forwardRef((e,t)=>{const{rest:n,...r}=Dz(e),[a,i]=Hz(r),{asChild:c,children:u,className:f,style:h,type:p,scrollHideDelay:m=p!=="scroll"?0:void 0,dir:v,size:w=Vd.size.default,radius:y=Vd.radius.default,scrollbars:b=Vd.scrollbars.default,...k}=n;return s.createElement(h7,{type:p,scrollHideDelay:m,className:_t("rt-ScrollAreaRoot",a,f),style:Ph(i,h),asChild:c},tz({asChild:c,children:u},S=>s.createElement(s.Fragment,null,s.createElement(p7,{...k,ref:t,className:"rt-ScrollAreaViewport"},S),s.createElement("div",{className:"rt-ScrollAreaViewportFocusRing"}),b!=="vertical"?s.createElement(X8,{"data-radius":y,orientation:"horizontal",className:_t("rt-ScrollAreaScrollbar",Rh({className:"rt-r-size",value:w,propValues:Vd.size.values}))},s.createElement(Q8,{className:"rt-ScrollAreaThumb"})):null,b!=="horizontal"?s.createElement(X8,{"data-radius":y,orientation:"vertical",className:_t("rt-ScrollAreaScrollbar",Rh({className:"rt-r-size",value:w,propValues:Vd.size.values}))},s.createElement(Q8,{className:"rt-ScrollAreaThumb"})):null,b==="both"?s.createElement(RZ,{className:"rt-ScrollAreaCorner"}):null)))});hf.displayName="ScrollArea";const Oz=["1","2"],Iz=["solid","soft"],ao={size:{type:"enum",className:"rt-r-size",values:Oz,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:Iz,default:"solid"},...ol,...kc},U7={..._a,...ol},W7={...ol},K7={...ol},pf=e=>s.createElement(QF,{...e});pf.displayName="ContextMenu.Root";const mf=s.forwardRef(({children:e,...t},n)=>s.createElement(JF,{...t,ref:n,asChild:!0},ui(e)));mf.displayName="ContextMenu.Trigger";const G7=s.createContext({}),gf=s.forwardRef((e,t)=>{const n=ev(),{size:r=ao.size.default,variant:a=ao.variant.default,highContrast:i=ao.highContrast.default}=e,{className:c,children:u,color:f,container:h,forceMount:p,...m}=vr(e,ao),v=f||n.accentColor;return s.createElement(qE,{container:h,forceMount:p},s.createElement(Za,{asChild:!0},s.createElement(e_,{"data-accent-color":v,alignOffset:-Number(r)*4,collisionPadding:10,...m,asChild:!1,ref:t,className:_t("rt-PopperContent","rt-BaseMenuContent","rt-ContextMenuContent",c)},s.createElement(hf,{type:"auto"},s.createElement("div",{className:_t("rt-BaseMenuViewport","rt-ContextMenuViewport")},s.createElement(G7.Provider,{value:s.useMemo(()=>({size:r,variant:a,color:v,highContrast:i}),[r,a,v,i])},u))))))});gf.displayName="ContextMenu.Content";const Fz=s.forwardRef(({className:e,...t},n)=>s.createElement(n_,{...t,asChild:!1,ref:n,className:_t("rt-BaseMenuLabel","rt-ContextMenuLabel",e)}));Fz.displayName="ContextMenu.Label";const vf=s.forwardRef((e,t)=>{const{className:n,children:r,color:a=U7.color.default,shortcut:i,...c}=e;return s.createElement(r_,{"data-accent-color":a,...c,ref:t,className:_t("rt-reset","rt-BaseMenuItem","rt-ContextMenuItem",n)},s.createElement(gp,null,r),i&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-ContextMenuShortcut"},i))});vf.displayName="ContextMenu.Item";const _z=s.forwardRef(({className:e,...t},n)=>s.createElement(t_,{...t,asChild:!1,ref:n,className:_t("rt-BaseMenuGroup","rt-ContextMenuGroup",e)}));_z.displayName="ContextMenu.Group";const Zz=s.forwardRef(({className:e,...t},n)=>s.createElement(a_,{...t,asChild:!1,ref:n,className:_t("rt-BaseMenuRadioGroup","rt-ContextMenuRadioGroup",e)}));Zz.displayName="ContextMenu.RadioGroup";const Vz=s.forwardRef((e,t)=>{const{children:n,className:r,color:a=K7.color.default,...i}=e;return s.createElement(o_,{...i,asChild:!1,ref:t,"data-accent-color":a,className:_t("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-ContextMenuItem","rt-ContextMenuRadioItem",r)},s.createElement(gp,null,n),s.createElement(XE,{className:"rt-BaseMenuItemIndicator rt-ContextMenuItemIndicator"},s.createElement(Ju,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})))});Vz.displayName="ContextMenu.RadioItem";const zz=s.forwardRef((e,t)=>{const{children:n,className:r,shortcut:a,color:i=W7.color.default,...c}=e;return s.createElement(s_,{...c,asChild:!1,ref:t,"data-accent-color":i,className:_t("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-ContextMenuItem","rt-ContextMenuCheckboxItem",r)},s.createElement(gp,null,n),s.createElement(XE,{className:"rt-BaseMenuItemIndicator rt-ContextMenuItemIndicator"},s.createElement(Ju,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})),a&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-ContextMenuShortcut"},a))});zz.displayName="ContextMenu.CheckboxItem";const Bz=s.forwardRef((e,t)=>{const{className:n,children:r,...a}=e;return s.createElement(l_,{...a,asChild:!1,ref:t,className:_t("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-ContextMenuItem","rt-ContextMenuSubTrigger",n)},r,s.createElement("div",{className:"rt-BaseMenuShortcut rt-ContextMenuShortcut"},s.createElement(nv,{className:"rt-BaseMenuSubTriggerIcon rt-ContextMenuSubTriggerIcon"})))});Bz.displayName="ContextMenu.SubTrigger";const Uz=s.forwardRef((e,t)=>{const{size:n,variant:r,color:a,highContrast:i}=s.useContext(G7),{className:c,children:u,container:f,forceMount:h,...p}=vr({size:n,variant:r,color:a,highContrast:i,...e},ao);return s.createElement(qE,{container:f,forceMount:h},s.createElement(Za,{asChild:!0},s.createElement(c_,{"data-accent-color":a,alignOffset:-Number(n)*4,sideOffset:1,collisionPadding:10,...p,asChild:!1,ref:t,className:_t("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-ContextMenuContent","rt-ContextMenuSubContent",c)},s.createElement(hf,{type:"auto"},s.createElement("div",{className:_t("rt-BaseMenuViewport","rt-ContextMenuViewport")},u)))))});Uz.displayName="ContextMenu.SubContent";const Fp=s.forwardRef(({className:e,...t},n)=>s.createElement(i_,{...t,asChild:!1,ref:n,className:_t("rt-BaseMenuSeparator","rt-ContextMenuSeparator",e)}));Fp.displayName="ContextMenu.Separator";const rv=e=>s.createElement(hc,{...e,modal:!0});rv.displayName="Dialog.Root";const Wz=s.forwardRef(({children:e,...t},n)=>s.createElement(x4,{...t,ref:n,asChild:!0},ui(e)));Wz.displayName="Dialog.Trigger";const sv=s.forwardRef(({align:e,...t},n)=>{const{align:r,...a}=N7,{className:i}=vr({align:e},{align:r}),{className:c,forceMount:u,container:f,...h}=vr(t,a);return s.createElement(pc,{container:f,forceMount:u},s.createElement(Za,{asChild:!0},s.createElement(mc,{className:"rt-BaseDialogOverlay rt-DialogOverlay"},s.createElement("div",{className:"rt-BaseDialogScroll rt-DialogScroll"},s.createElement("div",{className:`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${i}`},s.createElement(gc,{...h,ref:n,className:_t("rt-BaseDialogContent","rt-DialogContent",c)}))))))});sv.displayName="Dialog.Content";const av=s.forwardRef((e,t)=>s.createElement(vc,{asChild:!0},s.createElement(J4,{size:"5",mb:"3",trim:"start",...e,asChild:!1,ref:t})));av.displayName="Dialog.Title";const Kz=s.forwardRef((e,t)=>s.createElement(k4,{asChild:!0},s.createElement(ec,{as:"p",size:"3",...e,asChild:!1,ref:t})));Kz.displayName="Dialog.Description";const Gz=s.forwardRef(({children:e,...t},n)=>s.createElement(bp,{...t,ref:n,asChild:!0},ui(e)));Gz.displayName="Dialog.Close";const Ss=e=>s.createElement(M_,{...e});Ss.displayName="DropdownMenu.Root";const Es=s.forwardRef(({children:e,...t},n)=>s.createElement(R_,{...t,ref:n,asChild:!0},ui(e)));Es.displayName="DropdownMenu.Trigger";const Y7=s.createContext({}),Cs=s.forwardRef((e,t)=>{const n=ev(),{size:r=ao.size.default,variant:a=ao.variant.default,highContrast:i=ao.highContrast.default}=e,{className:c,children:u,color:f,container:h,forceMount:p,...m}=vr(e,ao),v=f||n.accentColor;return s.createElement(JE,{container:h,forceMount:p},s.createElement(Za,{asChild:!0},s.createElement(P_,{"data-accent-color":v,align:"start",sideOffset:4,collisionPadding:10,...m,asChild:!1,ref:t,className:_t("rt-PopperContent","rt-BaseMenuContent","rt-DropdownMenuContent",c)},s.createElement(hf,{type:"auto"},s.createElement("div",{className:_t("rt-BaseMenuViewport","rt-DropdownMenuViewport")},s.createElement(Y7.Provider,{value:s.useMemo(()=>({size:r,variant:a,color:v,highContrast:i}),[r,a,v,i])},u))))))});Cs.displayName="DropdownMenu.Content";const s6=s.forwardRef(({className:e,...t},n)=>s.createElement(T_,{...t,asChild:!1,ref:n,className:_t("rt-BaseMenuLabel","rt-DropdownMenuLabel",e)}));s6.displayName="DropdownMenu.Label";const tr=s.forwardRef((e,t)=>{const{className:n,children:r,color:a=U7.color.default,shortcut:i,...c}=e;return s.createElement($_,{"data-accent-color":a,...c,ref:t,className:_t("rt-reset","rt-BaseMenuItem","rt-DropdownMenuItem",n)},s.createElement(gp,null,r),i&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},i))});tr.displayName="DropdownMenu.Item";const Yz=s.forwardRef(({className:e,...t},n)=>s.createElement(L_,{...t,asChild:!1,ref:n,className:_t("rt-BaseMenuGroup","rt-DropdownMenuGroup",e)}));Yz.displayName="DropdownMenu.Group";const Th=s.forwardRef(({className:e,...t},n)=>s.createElement(H_,{...t,asChild:!1,ref:n,className:_t("rt-BaseMenuRadioGroup","rt-DropdownMenuRadioGroup",e)}));Th.displayName="DropdownMenu.RadioGroup";const vu=s.forwardRef((e,t)=>{const{children:n,className:r,color:a=K7.color.default,...i}=e;return s.createElement(O_,{...i,asChild:!1,ref:t,"data-accent-color":a,className:_t("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-DropdownMenuItem","rt-DropdownMenuRadioItem",r)},n,s.createElement(e7,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},s.createElement(Ju,{className:"rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon"})))});vu.displayName="DropdownMenu.RadioItem";const qz=s.forwardRef((e,t)=>{const{children:n,className:r,shortcut:a,color:i=W7.color.default,...c}=e;return s.createElement(D_,{...c,asChild:!1,ref:t,"data-accent-color":i,className:_t("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-DropdownMenuItem","rt-DropdownMenuCheckboxItem",r)},n,s.createElement(e7,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},s.createElement(Ju,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})),a&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},a))});qz.displayName="DropdownMenu.CheckboxItem";const Xz=s.forwardRef((e,t)=>{const{className:n,children:r,...a}=e;return s.createElement(F_,{...a,asChild:!1,ref:t,className:_t("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-DropdownMenuItem","rt-DropdownMenuSubTrigger",n)},r,s.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},s.createElement(nv,{className:"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubtriggerIcon"})))});Xz.displayName="DropdownMenu.SubTrigger";const Qz=s.forwardRef((e,t)=>{const{size:n,variant:r,color:a,highContrast:i}=s.useContext(Y7),{className:c,children:u,container:f,forceMount:h,...p}=vr({size:n,variant:r,color:a,highContrast:i,...e},ao);return s.createElement(JE,{container:f,forceMount:h},s.createElement(Za,{asChild:!0},s.createElement(__,{"data-accent-color":a,alignOffset:-Number(n)*4,sideOffset:1,collisionPadding:10,...p,asChild:!1,ref:t,className:_t("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-DropdownMenuContent","rt-DropdownMenuSubContent",c)},s.createElement(hf,{type:"auto"},s.createElement("div",{className:_t("rt-BaseMenuViewport","rt-DropdownMenuViewport")},u)))))});Qz.displayName="DropdownMenu.SubContent";const Ul=s.forwardRef(({className:e,...t},n)=>s.createElement(I_,{...t,asChild:!1,ref:n,className:_t("rt-BaseMenuSeparator","rt-DropdownMenuSeparator",e)}));Ul.displayName="DropdownMenu.Separator";const Jz=["1","2","3","4"],eB={..._a,size:{type:"enum",className:"rt-r-size",values:Jz,default:"2",responsive:!0},width:lo.width,minWidth:lo.minWidth,maxWidth:{...lo.maxWidth,default:"480px"},...q4},Ou=e=>s.createElement(iZ,{...e});Ou.displayName="Popover.Root";const Iu=s.forwardRef(({children:e,...t},n)=>s.createElement(cZ,{...t,ref:n,asChild:!0},ui(e)));Iu.displayName="Popover.Trigger";const Fu=s.forwardRef((e,t)=>{const{className:n,forceMount:r,container:a,...i}=vr(e,eB);return s.createElement(uZ,{container:a,forceMount:r},s.createElement(Za,{asChild:!0},s.createElement(dZ,{align:"start",sideOffset:8,collisionPadding:10,...i,ref:t,className:_t("rt-PopperContent","rt-PopoverContent",n)})))});Fu.displayName="Popover.Content";const tB=s.forwardRef(({children:e,...t},n)=>s.createElement(fZ,{...t,ref:n,asChild:!0},ui(e)));tB.displayName="Popover.Close";const nB=s.forwardRef(({children:e,...t},n)=>s.createElement(lZ,{...t,ref:n}));nB.displayName="Popover.Anchor";const rB=["1","2","3"],ov={size:{type:"enum",className:"rt-r-size",values:rB,default:"2",responsive:!0}},sB=["classic","surface","soft","ghost"],aB={variant:{type:"enum",className:"rt-variant",values:sB,default:"surface"},...ol,...Ip,placeholder:{type:"string"}},oB=["solid","soft"],iB={variant:{type:"enum",className:"rt-variant",values:oB,default:"solid"},...ol,...kc},iv=s.createContext({}),q7=e=>{const{children:t,size:n=ov.size.default,...r}=e;return s.createElement(IZ,{...r},s.createElement(iv.Provider,{value:s.useMemo(()=>({size:n}),[n])},t))};q7.displayName="Select.Root";const X7=s.forwardRef((e,t)=>{const n=s.useContext(iv),{children:r,className:a,color:i,radius:c,placeholder:u,...f}=vr({size:n==null?void 0:n.size,...e},{size:ov.size},aB,bo);return s.createElement(_Z,{asChild:!0},s.createElement("button",{"data-accent-color":i,"data-radius":c,...f,ref:t,className:_t("rt-reset","rt-SelectTrigger",a)},s.createElement("span",{className:"rt-SelectTriggerInner"},s.createElement(VZ,{placeholder:u},r)),s.createElement(zZ,{asChild:!0},s.createElement(B7,{className:"rt-SelectIcon"}))))});X7.displayName="Select.Trigger";const Q7=s.forwardRef((e,t)=>{const n=s.useContext(iv),{className:r,children:a,color:i,container:c,...u}=vr({size:n==null?void 0:n.size,...e},{size:ov.size},iB),f=ev(),h=i||f.accentColor;return s.createElement(KZ,{container:c},s.createElement(Za,{asChild:!0},s.createElement(GZ,{"data-accent-color":h,sideOffset:4,...u,asChild:!1,ref:t,className:_t({"rt-PopperContent":u.position==="popper"},"rt-SelectContent",r)},s.createElement(h7,{type:"auto",className:"rt-ScrollAreaRoot"},s.createElement(tV,{asChild:!0,className:"rt-SelectViewport"},s.createElement(p7,{className:"rt-ScrollAreaViewport",style:{overflowY:void 0}},a)),s.createElement(X8,{className:"rt-ScrollAreaScrollbar rt-r-size-1",orientation:"vertical"},s.createElement(Q8,{className:"rt-ScrollAreaThumb"}))))))});Q7.displayName="Select.Content";const J7=s.forwardRef((e,t)=>{const{className:n,children:r,...a}=e;return s.createElement(cV,{...a,asChild:!1,ref:t,className:_t("rt-SelectItem",n)},s.createElement(fV,{className:"rt-SelectItemIndicator"},s.createElement(Ju,{className:"rt-SelectItemIndicatorIcon"})),s.createElement(uV,null,r))});J7.displayName="Select.Item";const lB=s.forwardRef(({className:e,...t},n)=>s.createElement(aV,{...t,asChild:!1,ref:n,className:_t("rt-SelectGroup",e)}));lB.displayName="Select.Group";const cB=s.forwardRef(({className:e,...t},n)=>s.createElement(iV,{...t,asChild:!1,ref:n,className:_t("rt-SelectLabel",e)}));cB.displayName="Select.Label";const uB=s.forwardRef(({className:e,...t},n)=>s.createElement(hV,{...t,asChild:!1,ref:n,className:_t("rt-SelectSeparator",e)}));uB.displayName="Select.Separator";const dB={content:{type:"ReactNode",required:!0},width:lo.width,minWidth:lo.minWidth,maxWidth:{...lo.maxWidth,default:"360px"}},lv=s.forwardRef((e,t)=>{const{children:n,className:r,open:a,defaultOpen:i,onOpenChange:c,delayDuration:u,disableHoverableContent:f,content:h,container:p,forceMount:m,...v}=vr(e,dB),w={open:a,defaultOpen:i,onOpenChange:c,delayDuration:u,disableHoverableContent:f};return s.createElement(LV,{...w},s.createElement(TV,{asChild:!0},n),s.createElement($V,{container:p,forceMount:m},s.createElement(Za,{asChild:!0},s.createElement(DV,{sideOffset:4,collisionPadding:10,...v,asChild:!1,ref:t,className:_t("rt-TooltipContent",r)},s.createElement(ec,{as:"p",className:"rt-TooltipText",size:"1"},h),s.createElement(HV,{className:"rt-TooltipArrow"})))))});lv.displayName="Tooltip";const Dr={lastBrand:"scenri:last-brand",engine:"scenri:engine",quality:"scenri:quality",count:"scenri:count",format:"scenri:format",assetsOpen:"scenri:assets-open",ovlPanelW:"scenri:ovl-panel-w",pstudioRailW:"scenri:pstudio-rail-w",assetsExpanded:"scenri:assets-expanded",tileSize:"scenri:tile-size",wallDensity:"scenri:wall-density",feedSort:"scenri:feed-sort",feedCounts:"scenri:feed-counts"};function eC(e,t){try{const n=localStorage.getItem(e);return n===null?t:JSON.parse(n)}catch{return t}}const a6="scenri:pref-changed";function tC(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}try{window.dispatchEvent(new CustomEvent(a6,{detail:{key:e,value:t}}))}catch{}}function o6(e,t){try{const n=localStorage.getItem(e);return n===null?null:(localStorage.setItem(t,n),localStorage.removeItem(e),n)}catch{return null}}function fa(e,t){const[n,r]=s.useState(()=>eC(e,t)),a=s.useRef(n);return s.useEffect(()=>{Object.is(a.current,n)||(a.current=n,tC(e,n))},[e,n]),s.useEffect(()=>{const i=c=>{const u=c.detail;(u==null?void 0:u.key)===e&&r(f=>Object.is(f,u.value)?f:u.value)};return window.addEventListener(a6,i),()=>window.removeEventListener(a6,i)},[e]),[n,r]}function fB(e,t){const[n,r]=s.useState(()=>{try{const a=sessionStorage.getItem(e);return a===null?t:JSON.parse(a)}catch{return t}});return s.useEffect(()=>{try{sessionStorage.setItem(e,JSON.stringify(n))}catch{}},[e,n]),[n,r]}function Eg(e,t){const[n,r]=fa(e,t),[a,i]=s.useState(null);return[a??n,u=>{i(null),r(u)},i]}const hB=()=>eC(Dr.lastBrand,null),pB=e=>tC(Dr.lastBrand,e),i6="sc-theme",mB="bt-theme",gB=()=>window.matchMedia("(prefers-color-scheme: light)").matches,nC=s.createContext({choice:"system",mode:"dark",setChoice:()=>{},toggle:()=>{}}),vB=()=>s.useContext(nC);function wB(){const e=localStorage.getItem(i6)??o6(mB,i6);return e==="light"||e==="dark"||e==="system"?e:"system"}function yB({children:e}){const[t,n]=s.useState(wB),[r,a]=s.useState(()=>gB()?"light":"dark");s.useEffect(()=>{const u=window.matchMedia("(prefers-color-scheme: light)"),f=()=>a(u.matches?"light":"dark");return u.addEventListener("change",f),()=>u.removeEventListener("change",f)},[]);const i=t==="system"?r:t;s.useEffect(()=>{document.documentElement.dataset.theme=i,localStorage.setItem(i6,t)},[i,t]);const c=s.useMemo(()=>({choice:t,mode:i,setChoice:n,toggle:()=>n(i==="dark"?"light":"dark")}),[t,i]);return o.jsx(nC.Provider,{value:c,children:o.jsx(Za,{appearance:i,accentColor:"gray",grayColor:"gray",radius:"large",scaling:"100%",children:e})})}const bB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M204.41,51.63a108,108,0,1,0,0,152.74A107.38,107.38,0,0,0,204.41,51.63Zm-17,17A83.85,83.85,0,0,1,196.26,79L169,111.09l-23.3-65.21A83.52,83.52,0,0,1,187.43,68.6Zm-118.85,0a83.44,83.44,0,0,1,51.11-24.2l14.16,39.65L65.71,71.61C66.64,70.59,67.59,69.59,68.58,68.6ZM48,153.7a84.48,84.48,0,0,1,3.4-60.3L92.84,101Zm20.55,33.7A83.94,83.94,0,0,1,59.74,177L87,144.91l23.3,65.21A83.53,83.53,0,0,1,68.58,187.4Zm36.36-63.61,15.18-17.85,23.06,4.21,7.88,22.06-15.17,17.85-23.06-4.21Zm82.49,63.61a83.49,83.49,0,0,1-51.11,24.2L122.15,172l68.14,12.44C189.36,185.41,188.41,186.41,187.43,187.4ZM163.16,155,208,102.3a84.43,84.43,0,0,1-3.41,60.3Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M195.88,60.12a96,96,0,1,0,0,135.76A96,96,0,0,0,195.88,60.12Zm-55.34,103h0l-36.68-6.69h0L91.32,121.3l24.14-28.41h0l36.68,6.69,12.54,35.12Z",opacity:"0.2"}),s.createElement("path",{d:"M201.54,54.46A104,104,0,0,0,54.46,201.54,104,104,0,0,0,201.54,54.46ZM190.23,65.78a88.18,88.18,0,0,1,11,13.48L167.55,119,139.63,40.78A87.34,87.34,0,0,1,190.23,65.78ZM155.59,133l-18.16,21.37-27.59-5L100.41,123l18.16-21.37,27.59,5ZM65.77,65.78a87.34,87.34,0,0,1,56.66-25.59l17.51,49L58.3,74.32A88,88,0,0,1,65.77,65.78ZM46.65,161.54a88.41,88.41,0,0,1,2.53-72.62l51.21,9.35Zm19.12,28.68a88.18,88.18,0,0,1-11-13.48L88.45,137l27.92,78.18A87.34,87.34,0,0,1,65.77,190.22Zm124.46,0a87.34,87.34,0,0,1-56.66,25.59l-17.51-49,81.64,14.91A88,88,0,0,1,190.23,190.22Zm-34.62-32.49,53.74-63.27a88.41,88.41,0,0,1-2.53,72.62Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,128A104,104,0,0,0,54.46,54.46,104,104,0,0,0,128,232h.09A104,104,0,0,0,232,128ZM49.18,88.92l51.21,9.35L46.65,161.53A88.39,88.39,0,0,1,49.18,88.92Zm160.17,5.54a88.41,88.41,0,0,1-2.53,72.62l-51.21-9.35Zm-8.08-15.2L167.55,119,139.63,40.78a87.38,87.38,0,0,1,50.6,25A88.74,88.74,0,0,1,201.27,79.26ZM122.43,40.19l17.51,49L58.3,74.32a89.28,89.28,0,0,1,7.47-8.55A87.37,87.37,0,0,1,122.43,40.19ZM54.73,176.74,88.45,137l27.92,78.18a88,88,0,0,1-61.64-38.48Zm78.84,39.06-17.51-49L139.14,171h0l58.52,10.69a87.5,87.5,0,0,1-64.13,34.12Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200.12,55.88A102,102,0,0,0,55.87,200.12,102,102,0,1,0,200.12,55.88Zm-102,66.67,19.65-23.14,29.86,5.46,10.21,28.58-19.65,23.14-29.86-5.46ZM209.93,90.69a90.24,90.24,0,0,1-2,78.63l-56.14-10.24Zm-6.16-11.28-36.94,43.48L136.66,38.42a89.31,89.31,0,0,1,55,25.94A91.33,91.33,0,0,1,203.77,79.41Zm-139.41-15A89.37,89.37,0,0,1,123.81,38.1L143,91.82,54.75,75.71A91.2,91.2,0,0,1,64.36,64.36ZM48,86.68l56.14,10.24L46.07,165.31a90.24,90.24,0,0,1,2-78.63Zm4.21,89.91,36.94-43.48,30.17,84.47a89.31,89.31,0,0,1-55-25.94A91.33,91.33,0,0,1,52.23,176.59Zm139.41,15a89.32,89.32,0,0,1-59.45,26.26L113,164.18l88.24,16.11A91.2,91.2,0,0,1,191.64,191.64Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M201.54,54.46A104,104,0,0,0,54.46,201.54,104,104,0,0,0,201.54,54.46ZM190.23,65.78a88.18,88.18,0,0,1,11,13.48L167.55,119,139.63,40.78A87.34,87.34,0,0,1,190.23,65.78ZM155.59,133l-18.16,21.37-27.59-5L100.41,123l18.16-21.37,27.59,5ZM65.77,65.78a87.34,87.34,0,0,1,56.66-25.59l17.51,49L58.3,74.32A88,88,0,0,1,65.77,65.78ZM46.65,161.54a88.41,88.41,0,0,1,2.53-72.62l51.21,9.35Zm19.12,28.68a88.18,88.18,0,0,1-11-13.48L88.45,137l27.92,78.18A87.34,87.34,0,0,1,65.77,190.22Zm124.46,0a87.34,87.34,0,0,1-56.66,25.59l-17.51-49,81.64,14.91A88,88,0,0,1,190.23,190.22Zm-34.62-32.49,53.74-63.27a88.41,88.41,0,0,1-2.53,72.62Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M198.71,57.29A100,100,0,1,0,57.29,198.71,100,100,0,1,0,198.71,57.29Zm10.37,114.27-61-11.14L210.4,87a92.26,92.26,0,0,1-1.32,84.52ZM95.87,122.13,117,97.24l32.14,5.86,11,30.77L139,158.76l-32.14-5.86ZM206.24,79.58l-40.13,47.25L133.75,36.2a92.09,92.09,0,0,1,72.49,43.38ZM63,63a91.31,91.31,0,0,1,62.26-26.88L146,94.41,51.32,77.11A92.94,92.94,0,0,1,63,63Zm-16,21.49,61,11.14L45.6,169a92.26,92.26,0,0,1,1.32-84.52Zm2.84,92,40.13-47.25,32.36,90.63a92.09,92.09,0,0,1-72.49-43.38Zm143.29,16.63a91.31,91.31,0,0,1-62.26,26.88L110,161.59l94.72,17.3A92.94,92.94,0,0,1,193.05,193.05Z"}))]]),xB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,44H32A20,20,0,0,0,12,64V88a20,20,0,0,0,16,19.6V192a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V107.6A20,20,0,0,0,244,88V64A20,20,0,0,0,224,44ZM36,68H220V84H36ZM52,188V108H204v80Zm112-52a12,12,0,0,1-12,12H104a12,12,0,0,1,0-24h48A12,12,0,0,1,164,136Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,96v96a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V96Z",opacity:"0.2"}),s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V88a16,16,0,0,0,16,16v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V104a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM208,192H48V104H208ZM224,88H32V64H224V88ZM96,136a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,136Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V88a16,16,0,0,0,16,16v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V104a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm-72,96H104a8,8,0,0,1,0-16h48a8,8,0,0,1,0,16Zm72-56H32V64H224V88Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,50H32A14,14,0,0,0,18,64V88a14,14,0,0,0,14,14h2v90a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V102h2a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50ZM210,192a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V102H210ZM226,88a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H224a2,2,0,0,1,2,2ZM98,136a6,6,0,0,1,6-6h48a6,6,0,0,1,0,12H104A6,6,0,0,1,98,136Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V88a16,16,0,0,0,16,16v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V104a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM208,192H48V104H208ZM224,88H32V64H224V88ZM96,136a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,136Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,52H32A12,12,0,0,0,20,64V88a12,12,0,0,0,12,12h4v92a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V100h4a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52ZM212,192a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V100H212ZM228,88a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H224a4,4,0,0,1,4,4ZM100,136a4,4,0,0,1,4-4h48a4,4,0,0,1,0,8H104A4,4,0,0,1,100,136Z"}))]]),kB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm40.49-100.49a12,12,0,0,1-17,17L140,117v51a12,12,0,0,1-24,0V117l-11.51,11.52a12,12,0,0,1-17-17l32-32a12,12,0,0,1,17,0Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm37.66-101.66a8,8,0,0,1-11.32,11.32L136,107.31V168a8,8,0,0,1-16,0V107.31l-18.34,18.35a8,8,0,0,1-11.32-11.32l32-32a8,8,0,0,1,11.32,0Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,101.66a8,8,0,0,1-11.32,0L136,107.31V168a8,8,0,0,1-16,0V107.31l-18.34,18.35a8,8,0,0,1-11.32-11.32l32-32a8,8,0,0,1,11.32,0l32,32A8,8,0,0,1,165.66,125.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm36.24-102.24a6,6,0,1,1-8.48,8.48L134,102.49V168a6,6,0,0,1-12,0V102.49l-21.76,21.75a6,6,0,0,1-8.48-8.48l32-32a6,6,0,0,1,8.48,0Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm37.66-101.66a8,8,0,0,1-11.32,11.32L136,107.31V168a8,8,0,0,1-16,0V107.31l-18.34,18.35a8,8,0,0,1-11.32-11.32l32-32a8,8,0,0,1,11.32,0Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm34.83-102.83a4,4,0,0,1-5.66,5.66L132,97.66V168a4,4,0,0,1-8,0V97.66L98.83,122.83a4,4,0,0,1-5.66-5.66l32-32a4,4,0,0,1,5.66,0Z"}))]]),SB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),s.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z"}))]]),EB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),s.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]),CB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),s.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),jB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.49,143.51a12,12,0,0,1-17,17L140,109V224a12,12,0,0,1-24,0V109L64.49,160.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0ZM216,28H40a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,144H56l72-72Z",opacity:"0.2"}),s.createElement("path",{d:"M133.66,66.34a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,152h64v72a8,8,0,0,0,16,0V152h64a8,8,0,0,0,5.66-13.66ZM75.31,136,128,83.31,180.69,136ZM224,40a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M205.66,138.34A8,8,0,0,1,200,152H136v72a8,8,0,0,1-16,0V152H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0ZM216,32H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M204.24,139.76a6,6,0,1,1-8.48,8.48L134,86.49V224a6,6,0,0,1-12,0V86.49L60.24,148.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0ZM216,34H40a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M205.66,138.34a8,8,0,0,1-11.32,11.32L136,91.31V224a8,8,0,0,1-16,0V91.31L61.66,149.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0ZM216,32H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M202.83,141.17a4,4,0,0,1-5.66,5.66L132,81.66V224a4,4,0,0,1-8,0V81.66L58.83,146.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0ZM216,36H40a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8Z"}))]]),AB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128l-72,72V56Z",opacity:"0.2"}),s.createElement("path",{d:"M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z"}))]]),NB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,80V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H176A8,8,0,0,1,184,80Z",opacity:"0.2"}),s.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,136v72a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V80A16,16,0,0,1,48,64h72a8,8,0,0,1,0,16H48V208H176V136a8,8,0,0,1,16,0Zm32-96a8,8,0,0,0-8-8H152a8,8,0,0,0-5.66,13.66L172.69,72l-42.35,42.34a8,8,0,0,0,11.32,11.32L184,83.31l26.34,26.35A8,8,0,0,0,224,104Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,104a4,4,0,0,1-8,0V49.66l-73.16,73.17a4,4,0,0,1-5.66-5.66L206.34,44H152a4,4,0,0,1,0-8h64a4,4,0,0,1,4,4Zm-36,28a4,4,0,0,0-4,4v72a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4h72a4,4,0,0,0,0-8H48A12,12,0,0,0,36,80V208a12,12,0,0,0,12,12H176a12,12,0,0,0,12-12V136A4,4,0,0,0,184,132Z"}))]]),MB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),s.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]),RB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,48V96a12,12,0,0,1-12,12H168a12,12,0,0,1,0-24h19l-7.8-7.8a75.55,75.55,0,0,0-53.32-22.26h-.43A75.49,75.49,0,0,0,72.39,75.57,12,12,0,1,1,55.61,58.41a99.38,99.38,0,0,1,69.87-28.47H126A99.42,99.42,0,0,1,196.2,59.23L204,67V48a12,12,0,0,1,24,0ZM183.61,180.43a75.49,75.49,0,0,1-53.09,21.63h-.43A75.55,75.55,0,0,1,76.77,179.8L69,172H88a12,12,0,0,0,0-24H40a12,12,0,0,0-12,12v48a12,12,0,0,0,24,0V189l7.8,7.8A99.42,99.42,0,0,0,130,226.06h.56a99.38,99.38,0,0,0,69.87-28.47,12,12,0,0,0-16.78-17.16Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),s.createElement("path",{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1-5.66-13.66L180.65,72a79.48,79.48,0,0,0-54.72-22.09h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27,96,96,0,0,1,192,60.7l18.36-18.36A8,8,0,0,1,224,48ZM186.41,183.29A80,80,0,0,1,75.35,184l18.31-18.31A8,8,0,0,0,88,152H40a8,8,0,0,0-8,8v48a8,8,0,0,0,13.66,5.66L64,195.3a95.42,95.42,0,0,0,66,26.76h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,48V96a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h33.52L183.47,72a81.51,81.51,0,0,0-57.53-24h-.46A81.5,81.5,0,0,0,68.19,71.28a6,6,0,1,1-8.38-8.58,93.38,93.38,0,0,1,65.67-26.76H126a93.45,93.45,0,0,1,66,27.53l18,18V48a6,6,0,0,1,12,0ZM187.81,184.72a81.5,81.5,0,0,1-57.29,23.34h-.46a81.51,81.51,0,0,1-57.53-24L54.48,166H88a6,6,0,0,0,0-12H40a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V174.48l18,18.05a93.45,93.45,0,0,0,66,27.53h.52a93.38,93.38,0,0,0,65.67-26.76,6,6,0,1,0-8.38-8.58Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,48V96a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h38.34L184.89,70.54A84,84,0,0,0,66.8,69.85a4,4,0,1,1-5.6-5.72,92,92,0,0,1,129.34.76L212,86.34V48a4,4,0,0,1,8,0ZM189.2,186.15a83.44,83.44,0,0,1-58.68,23.91h-.47a83.52,83.52,0,0,1-58.94-24.6L49.66,164H88a4,4,0,0,0,0-8H40a4,4,0,0,0-4,4v48a4,4,0,0,0,8,0V169.66l21.46,21.45A91.43,91.43,0,0,0,130,218.06h.51a91.45,91.45,0,0,0,64.28-26.19,4,4,0,1,0-5.6-5.72Z"}))]]),PB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M120.49,167.51a12,12,0,0,1,0,17l-32,32a12,12,0,0,1-17,0l-32-32a12,12,0,1,1,17-17L68,179V48a12,12,0,0,1,24,0V179l11.51-11.52A12,12,0,0,1,120.49,167.51Zm96-96-32-32a12,12,0,0,0-17,0l-32,32a12,12,0,0,0,17,17L164,77V208a12,12,0,0,0,24,0V77l11.51,11.52a12,12,0,0,0,17-17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,48V208H80V48Z",opacity:"0.2"}),s.createElement("path",{d:"M117.66,170.34a8,8,0,0,1,0,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L72,188.69V48a8,8,0,0,1,16,0V188.69l18.34-18.35A8,8,0,0,1,117.66,170.34Zm96-96-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32L168,67.31V208a8,8,0,0,0,16,0V67.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M119.39,172.94a8,8,0,0,1-1.73,8.72l-32,32a8,8,0,0,1-11.32,0l-32-32A8,8,0,0,1,48,168H72V48a8,8,0,0,1,16,0V168h24A8,8,0,0,1,119.39,172.94Zm94.27-98.6-32-32a8,8,0,0,0-11.32,0l-32,32A8,8,0,0,0,144,88h24V208a8,8,0,0,0,16,0V88h24a8,8,0,0,0,5.66-13.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M116.24,171.76a6,6,0,0,1,0,8.48l-32,32a6,6,0,0,1-8.48,0l-32-32a6,6,0,0,1,8.48-8.48L74,193.51V48a6,6,0,0,1,12,0V193.51l21.76-21.75A6,6,0,0,1,116.24,171.76Zm96-96-32-32a6,6,0,0,0-8.48,0l-32,32a6,6,0,0,0,8.48,8.48L170,62.49V208a6,6,0,0,0,12,0V62.49l21.76,21.75a6,6,0,0,0,8.48-8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M117.66,170.34a8,8,0,0,1,0,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L72,188.69V48a8,8,0,0,1,16,0V188.69l18.34-18.35A8,8,0,0,1,117.66,170.34Zm96-96-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32L168,67.31V208a8,8,0,0,0,16,0V67.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M114.83,173.17a4,4,0,0,1,0,5.66l-32,32a4,4,0,0,1-5.66,0l-32-32a4,4,0,0,1,5.66-5.66L76,198.34V48a4,4,0,0,1,8,0V198.34l25.17-25.17A4,4,0,0,1,114.83,173.17Zm96-96-32-32a4,4,0,0,0-5.66,0l-32,32a4,4,0,0,0,5.66,5.66L172,57.66V208a4,4,0,0,0,8,0V57.66l25.17,25.17a4,4,0,1,0,5.66-5.66Z"}))]]),LB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.29,165.93C216.61,151,212,129.57,212,104a84,84,0,0,0-168,0c0,25.58-4.59,47-13.27,61.93A20.08,20.08,0,0,0,30.66,186,19.77,19.77,0,0,0,48,196H84.18a44,44,0,0,0,87.64,0H208a19.77,19.77,0,0,0,17.31-10A20.08,20.08,0,0,0,225.29,165.93ZM128,212a20,20,0,0,1-19.6-16h39.2A20,20,0,0,1,128,212ZM54.66,172C63.51,154,68,131.14,68,104a60,60,0,0,1,120,0c0,27.13,4.48,50,13.33,68Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,192H48a8,8,0,0,1-6.88-12C47.71,168.6,56,139.81,56,104a72,72,0,0,1,144,0c0,35.82,8.3,64.6,14.9,76A8,8,0,0,1,208,192Z",opacity:"0.2"}),s.createElement("path",{d:"M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216ZM48,184c7.7-13.24,16-43.92,16-80a64,64,0,1,1,128,0c0,36.05,8.28,66.73,16,80Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220.07,176.94C214.41,167.2,206,139.73,206,104a78,78,0,1,0-156,0c0,35.74-8.42,63.2-14.08,72.94A14,14,0,0,0,48,198H90.48a38,38,0,0,0,75,0H208a14,14,0,0,0,12.06-21.06ZM128,218a26,26,0,0,1-25.29-20h50.58A26,26,0,0,1,128,218Zm81.71-33a1.9,1.9,0,0,1-1.7,1H48a1.9,1.9,0,0,1-1.7-1,2,2,0,0,1,0-2C53.87,170,62,139.69,62,104a66,66,0,1,1,132,0c0,35.68,8.14,65.95,15.71,79A2,2,0,0,1,209.71,185Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216ZM48,184c7.7-13.24,16-43.92,16-80a64,64,0,1,1,128,0c0,36.05,8.28,66.73,16,80Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M218.35,178C212.58,168,204,140.13,204,104a76,76,0,1,0-152,0c0,36.13-8.59,64-14.36,73.95A12,12,0,0,0,48,196H92.23a36,36,0,0,0,71.54,0H208A12,12,0,0,0,218.35,178ZM128,220a28,28,0,0,1-27.71-24h55.42A28,28,0,0,1,128,220Zm83.45-34a3.91,3.91,0,0,1-3.44,2H48a3.91,3.91,0,0,1-3.44-2,4,4,0,0,1,0-4C52,169.17,60,139.32,60,104a68,68,0,1,1,136,0c0,35.31,8,65.17,15.44,78A4,4,0,0,1,211.45,186Z"}))]]),TB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),s.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),$B=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M160,48V208L80,128Z",opacity:"0.2"}),s.createElement("path",{d:"M163.06,40.61a8,8,0,0,0-8.72,1.73l-80,80a8,8,0,0,0,0,11.32l80,80A8,8,0,0,0,168,208V48A8,8,0,0,0,163.06,40.61ZM152,188.69,91.31,128,152,67.31Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168,48V208a8,8,0,0,1-13.66,5.66l-80-80a8,8,0,0,1,0-11.32l80-80A8,8,0,0,1,168,48Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164.24,203.76a6,6,0,1,1-8.48,8.48l-80-80a6,6,0,0,1,0-8.48l80-80a6,6,0,0,1,8.48,8.48L88.49,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M162.83,205.17a4,4,0,0,1-5.66,5.66l-80-80a4,4,0,0,1,0-5.66l80-80a4,4,0,1,1,5.66,5.66L85.66,128Z"}))]]),DB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),s.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]),HB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,160H48l80-80Z",opacity:"0.2"}),s.createElement("path",{d:"M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z"}))]]),OB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,196h-4V40a12,12,0,0,0-12-12H152a12,12,0,0,0-12,12V76H96A12,12,0,0,0,84,88v36H48a12,12,0,0,0-12,12v60H32a12,12,0,0,0,0,24H224a12,12,0,0,0,0-24ZM164,52h32V196H164Zm-56,48h32v96H108ZM60,148H84v48H60Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,40V208H152V40Z",opacity:"0.2"}),s.createElement("path",{d:"M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,208a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16h8V136a8,8,0,0,1,8-8H72a8,8,0,0,1,8,8v64H96V88a8,8,0,0,1,8-8h32a8,8,0,0,1,8,8V200h16V40a8,8,0,0,1,8-8h40a8,8,0,0,1,8,8V200h8A8,8,0,0,1,232,208Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,202H214V40a6,6,0,0,0-6-6H152a6,6,0,0,0-6,6V82H96a6,6,0,0,0-6,6v42H48a6,6,0,0,0-6,6v66H32a6,6,0,0,0,0,12H224a6,6,0,0,0,0-12ZM158,46h44V202H158ZM102,94h44V202H102ZM54,142H90v60H54Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,204H212V40a4,4,0,0,0-4-4H152a4,4,0,0,0-4,4V84H96a4,4,0,0,0-4,4v44H48a4,4,0,0,0-4,4v68H32a4,4,0,0,0,0,8H224a4,4,0,0,0,0-8ZM156,44h48V204H156ZM100,92h48V204H100ZM52,140H92v64H52Z"}))]]),IB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),s.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),FB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,128A104,104,0,1,1,128,24,104.13,104.13,0,0,1,232,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Z"}))]]),_B=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm12,24.87a83.53,83.53,0,0,1,24,7.25V203.88a83.53,83.53,0,0,1-24,7.25ZM44,128a84.12,84.12,0,0,1,72-83.13V211.13A84.12,84.12,0,0,1,44,128Zm144,58.71V69.29a83.81,83.81,0,0,1,0,117.42Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,0,1-96,96V32A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM40,128a88.11,88.11,0,0,1,80-87.63V215.63A88.11,88.11,0,0,1,40,128Zm96,87.63V40.37a88,88,0,0,1,0,175.26Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM40,128a88.1,88.1,0,0,1,88-88V216A88.1,88.1,0,0,1,40,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm6,12.2a89.86,89.86,0,0,1,20,3.63V214.17a89.86,89.86,0,0,1-20,3.63Zm32,8.23a90.48,90.48,0,0,1,20,12.81V196.76a90.48,90.48,0,0,1-20,12.81ZM38,128a90.12,90.12,0,0,1,84-89.8V217.8A90.12,90.12,0,0,1,38,128Zm160,56.5V71.5a89.81,89.81,0,0,1,0,113Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm8,16.37a86.4,86.4,0,0,1,16,3V212.67a86.4,86.4,0,0,1-16,3Zm32,9.26a87.81,87.81,0,0,1,16,10.54V195.83a87.81,87.81,0,0,1-16,10.54ZM40,128a88.11,88.11,0,0,1,80-87.63V215.63A88.11,88.11,0,0,1,40,128Zm160,50.54V77.46a87.82,87.82,0,0,1,0,101.08Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm4,8.09a91.58,91.58,0,0,1,24,4.27V215.64a91.58,91.58,0,0,1-24,4.27Zm32,7.25a92.21,92.21,0,0,1,24,15V197.69a92.21,92.21,0,0,1-24,15ZM36,128a92.11,92.11,0,0,1,88-91.91V219.91A92.11,92.11,0,0,1,36,128Zm160,61.9V66.1a91.83,91.83,0,0,1,0,123.8Z"}))]]),ZB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),s.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"}))]]),VB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M180,64H40A12,12,0,0,0,28,76V216a12,12,0,0,0,12,12H180a12,12,0,0,0,12-12V76A12,12,0,0,0,180,64ZM168,204H52V88H168ZM228,40V180a12,12,0,0,1-24,0V52H76a12,12,0,0,1,0-24H216A12,12,0,0,1,228,40Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,72V216H40V72Z",opacity:"0.2"}),s.createElement("path",{d:"M184,64H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V72A8,8,0,0,0,184,64Zm-8,144H48V80H176ZM224,40V184a8,8,0,0,1-16,0V48H72a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,72V216a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V72a8,8,0,0,1,8-8H184A8,8,0,0,1,192,72Zm24-40H72a8,8,0,0,0,0,16H208V184a8,8,0,0,0,16,0V40A8,8,0,0,0,216,32Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,66H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H184a6,6,0,0,0,6-6V72A6,6,0,0,0,184,66Zm-6,144H46V78H178ZM222,40V184a6,6,0,0,1-12,0V46H72a6,6,0,0,1,0-12H216A6,6,0,0,1,222,40Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,64H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V72A8,8,0,0,0,184,64Zm-8,144H48V80H176ZM224,40V184a8,8,0,0,1-16,0V48H72a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,68H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H184a4,4,0,0,0,4-4V72A4,4,0,0,0,184,68Zm-4,144H44V76H180ZM220,40V184a4,4,0,0,1-8,0V44H72a4,4,0,0,1,0-8H216A4,4,0,0,1,220,40Z"}))]]),zB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,12H80A28,28,0,0,0,52,40V216a28,28,0,0,0,28,28h96a28,28,0,0,0,28-28V40A28,28,0,0,0,176,12ZM76,76H180V180H76Zm4-40h96a4,4,0,0,1,4,4V52H76V40A4,4,0,0,1,80,36Zm96,184H80a4,4,0,0,1-4-4V204H180v12A4,4,0,0,1,176,220Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,56V200H64V56Z",opacity:"0.2"}),s.createElement("path",{d:"M176,16H80A24,24,0,0,0,56,40V216a24,24,0,0,0,24,24h96a24,24,0,0,0,24-24V40A24,24,0,0,0,176,16ZM72,64H184V192H72Zm8-32h96a8,8,0,0,1,8,8v8H72V40A8,8,0,0,1,80,32Zm96,192H80a8,8,0,0,1-8-8v-8H184v8A8,8,0,0,1,176,224Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,16H80A24,24,0,0,0,56,40V216a24,24,0,0,0,24,24h96a24,24,0,0,0,24-24V40A24,24,0,0,0,176,16ZM80,32h96a8,8,0,0,1,8,8v8H72V40A8,8,0,0,1,80,32Zm96,192H80a8,8,0,0,1-8-8v-8H184v8A8,8,0,0,1,176,224Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,18H80A22,22,0,0,0,58,40V216a22,22,0,0,0,22,22h96a22,22,0,0,0,22-22V40A22,22,0,0,0,176,18ZM70,62H186V194H70ZM80,30h96a10,10,0,0,1,10,10V50H70V40A10,10,0,0,1,80,30Zm96,196H80a10,10,0,0,1-10-10V206H186v10A10,10,0,0,1,176,226Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,16H80A24,24,0,0,0,56,40V216a24,24,0,0,0,24,24h96a24,24,0,0,0,24-24V40A24,24,0,0,0,176,16ZM72,64H184V192H72Zm8-32h96a8,8,0,0,1,8,8v8H72V40A8,8,0,0,1,80,32Zm96,192H80a8,8,0,0,1-8-8v-8H184v8A8,8,0,0,1,176,224Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,20H80A20,20,0,0,0,60,40V216a20,20,0,0,0,20,20h96a20,20,0,0,0,20-20V40A20,20,0,0,0,176,20ZM68,60H188V196H68ZM80,28h96a12,12,0,0,1,12,12V52H68V40A12,12,0,0,1,80,28Zm96,200H80a12,12,0,0,1-12-12V204H188v12A12,12,0,0,1,176,228Z"}))]]),BB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z",opacity:"0.2"}),s.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z"}))]]),UB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M112,60a16,16,0,1,1,16,16A16,16,0,0,1,112,60Zm16,52a16,16,0,1,0,16,16A16,16,0,0,0,128,112Zm0,68a16,16,0,1,0,16,16A16,16,0,0,0,128,180Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,32V224a16,16,0,0,1-16,16H96a16,16,0,0,1-16-16V32A16,16,0,0,1,96,16h64A16,16,0,0,1,176,32Z",opacity:"0.2"}),s.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128ZM128,72a12,12,0,1,0-12-12A12,12,0,0,0,128,72Zm0,112a12,12,0,1,0,12,12A12,12,0,0,0,128,184Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M160,16H96A16,16,0,0,0,80,32V224a16,16,0,0,0,16,16h64a16,16,0,0,0,16-16V32A16,16,0,0,0,160,16ZM128,208a12,12,0,1,1,12-12A12,12,0,0,1,128,208Zm0-68a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm0-68a12,12,0,1,1,12-12A12,12,0,0,1,128,72Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M118,60a10,10,0,1,1,10,10A10,10,0,0,1,118,60Zm10,58a10,10,0,1,0,10,10A10,10,0,0,0,128,118Zm0,68a10,10,0,1,0,10,10A10,10,0,0,0,128,186Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128ZM128,72a12,12,0,1,0-12-12A12,12,0,0,0,128,72Zm0,112a12,12,0,1,0,12,12A12,12,0,0,0,128,184Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M120,60a8,8,0,1,1,8,8A8,8,0,0,1,120,60Zm8,60a8,8,0,1,0,8,8A8,8,0,0,0,128,120Zm0,68a8,8,0,1,0,8,8A8,8,0,0,0,128,188Z"}))]]),WB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0Zm-108.49,8.49a12,12,0,0,0,17,0l40-40a12,12,0,0,0-17-17L140,115V32a12,12,0,0,0-24,0v83L96.49,95.51a12,12,0,0,0-17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z",opacity:"0.2"}),s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,168,96H136V32a8,8,0,0,0-16,0V96H88a8,8,0,0,0-5.66,13.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0Zm-98.24,4.24a6,6,0,0,0,8.48,0l40-40a6,6,0,0,0-8.48-8.48L134,129.51V32a6,6,0,0,0-12,0v97.51L92.24,99.76a6,6,0,0,0-8.48,8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0Zm-94.83,2.83a4,4,0,0,0,5.66,0l40-40a4,4,0,1,0-5.66-5.66L132,134.34V32a4,4,0,0,0-8,0V134.34L90.83,101.17a4,4,0,0,0-5.66,5.66Z"}))]]),KB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,100H132.92l78.14-20.63a12,12,0,0,0,8.52-14.75l-8.16-30a19.94,19.94,0,0,0-24.3-13.95L34.79,60.87a19.74,19.74,0,0,0-12.14,9.27,19.48,19.48,0,0,0-1.95,15L28,112v88a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V112A12,12,0,0,0,216,100ZM124.89,61.91l18.29,10.56-25.95,6.85L98.94,68.76Zm64.45-17,3.91,14.35-17.13,4.52L157.83,53.21ZM66,77.46,84.29,88l-35.4,9.35L45,83ZM204,196H52V124H204Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M67.71,64.59l47.79,27.6L40.43,112,32.27,82a7.76,7.76,0,0,1,5.58-9.52ZM199.84,37.76a7.9,7.9,0,0,0-9.66-5.49L126.61,49.05,174.4,76.64,208,67.77Z",opacity:"0.2"}),s.createElement("path",{d:"M216,104H102.09L210,75.51a8,8,0,0,0,5.68-9.84l-8.16-30a15.93,15.93,0,0,0-19.42-11.13L35.81,64.74a15.75,15.75,0,0,0-9.7,7.4,15.51,15.51,0,0,0-1.55,12L32,111.56c0,.14,0,.29,0,.44v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V112A8,8,0,0,0,216,104ZM192.16,40l6,22.07-22.62,6L147.42,51.83Zm-66.69,17.6,28.12,16.24-36.94,9.75L88.53,67.37Zm-79.4,44.62-6-22.08,26.5-7L94.69,89.4ZM208,200H48V120H208v80Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,104H102.09L210,75.51a8,8,0,0,0,5.68-9.84l-8.16-30a15.93,15.93,0,0,0-19.42-11.13L35.81,64.74a15.75,15.75,0,0,0-9.7,7.4,15.51,15.51,0,0,0-1.55,12L32,111.56c0,.14,0,.29,0,.44v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V112A8,8,0,0,0,216,104ZM192.16,40l6,22.07L164.57,71,136.44,54.72ZM77.55,70.27l28.12,16.24-59.6,15.73-6-22.08Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,106H86.68L209.53,73.57a6,6,0,0,0,4.26-7.38l-8.16-30a13.94,13.94,0,0,0-17-9.72L36.32,66.67a13.77,13.77,0,0,0-8.48,6.47,13.57,13.57,0,0,0-1.36,10.42L34,111.34c0,.22,0,.44,0,.66v88a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V112A6,6,0,0,0,216,106ZM125.75,55.48l33,19.07-42.43,11.2-33-19.07Zm66-17.41a1.92,1.92,0,0,1,2.34,1.26l6.57,24.18L175.26,70.2l-33-19.07ZM38.23,79.14a1.85,1.85,0,0,1,1.15-.87L66.86,71l33,19.08L44.66,104.68l-6.6-24.27A1.63,1.63,0,0,1,38.23,79.14ZM210,200a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V118H210Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,104H102.09L210,75.51a8,8,0,0,0,5.68-9.84l-8.16-30a15.93,15.93,0,0,0-19.42-11.13L35.81,64.74a15.75,15.75,0,0,0-9.7,7.4,15.51,15.51,0,0,0-1.55,12L32,111.56c0,.14,0,.29,0,.44v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V112A8,8,0,0,0,216,104ZM192.16,40l6,22.07-22.62,6L147.42,51.83Zm-66.69,17.6,28.12,16.24-36.94,9.75L88.53,67.37Zm-79.4,44.62-6-22.08,26.5-7L94.69,89.4ZM208,200H48V120H208v80Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,108H71.26L209,71.64a4,4,0,0,0,2.84-4.92l-8.16-30a11.92,11.92,0,0,0-14.54-8.31L36.83,68.61a11.78,11.78,0,0,0-7.26,5.53A11.59,11.59,0,0,0,28.41,83l7.67,28.19A3.87,3.87,0,0,0,36,112v88a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V112A4,4,0,0,0,216,108ZM126,53.33l38,21.92L116.08,87.9,78.12,66Zm65.16-17.2a4,4,0,0,1,1-.13A3.88,3.88,0,0,1,196,38.81l7.1,26.12L175,72.35,137,50.43Zm-154.7,42a3.86,3.86,0,0,1,2.37-1.8l28.27-7.46,38,21.91L43.25,107.12,36.13,80.94A3.66,3.66,0,0,1,36.5,78.14ZM212,200a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V116H212Z"}))]]),GB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,88V200.89A15.13,15.13,0,0,1,216.89,216H40a16,16,0,0,1-16-16V64A16,16,0,0,1,40,48H93.33a16.12,16.12,0,0,1,9.6,3.2L130.67,72H216A16,16,0,0,1,232,88Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4Z"}))]]),YB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84ZM104,132h48a12,12,0,0,1,0,24H104a12,12,0,0,1,0-24Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Zm-56-56a8,8,0,0,1-8,8H104a8,8,0,0,1,0-16h48A8,8,0,0,1,160,144Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm-64,80H104a8,8,0,0,1,0-16h48a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2ZM158,144a6,6,0,0,1-6,6H104a6,6,0,0,1,0-12h48A6,6,0,0,1,158,144Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Zm-56-56a8,8,0,0,1-8,8H104a8,8,0,0,1,0-16h48A8,8,0,0,1,160,144Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4ZM156,144a4,4,0,0,1-4,4H104a4,4,0,0,1,0-8h48A4,4,0,0,1,156,144Z"}))]]),qB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,88a12,12,0,0,1,12-12h32a12,12,0,0,1,12,12v32a12,12,0,0,1-24,0V100H152A12,12,0,0,1,140,88ZM72,180h32a12,12,0,0,0,0-24H84V136a12,12,0,0,0-24,0v32A12,12,0,0,0,72,180ZM236,56V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56Zm-24,4H44V196H212Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,56V200a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),s.createElement("path",{d:"M200,80v32a8,8,0,0,1-16,0V88H160a8,8,0,0,1,0-16h32A8,8,0,0,1,200,80ZM96,168H72V144a8,8,0,0,0-16,0v32a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16ZM232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM88,192H56a8,8,0,0,1-8-8V152a8,8,0,0,1,16,0v24H88a8,8,0,0,1,0,16Zm120-88a8,8,0,0,1-16,0V80H168a8,8,0,0,1,0-16h32a8,8,0,0,1,8,8Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M198,80v32a6,6,0,0,1-12,0V86H160a6,6,0,0,1,0-12h32A6,6,0,0,1,198,80ZM96,170H70V144a6,6,0,0,0-12,0v32a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12ZM230,56V200a14,14,0,0,1-14,14H40a14,14,0,0,1-14-14V56A14,14,0,0,1,40,42H216A14,14,0,0,1,230,56Zm-12,0a2,2,0,0,0-2-2H40a2,2,0,0,0-2,2V200a2,2,0,0,0,2,2H216a2,2,0,0,0,2-2Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,80v32a8,8,0,0,1-16,0V88H160a8,8,0,0,1,0-16h32A8,8,0,0,1,200,80ZM96,168H72V144a8,8,0,0,0-16,0v32a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16ZM232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M196,80v32a4,4,0,0,1-8,0V84H160a4,4,0,0,1,0-8h32A4,4,0,0,1,196,80ZM96,172H68V144a4,4,0,0,0-8,0v32a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8ZM228,56V200a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V56A12,12,0,0,1,40,44H216A12,12,0,0,1,228,56Zm-8,0a4,4,0,0,0-4-4H40a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H216a4,4,0,0,0,4-4Z"}))]]),XB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,76a52,52,0,1,0,52,52A52.06,52.06,0,0,0,128,76Zm0,80a28,28,0,1,1,28-28A28,28,0,0,1,128,156Zm113.86-49.57A12,12,0,0,0,236,98.34L208.21,82.49l-.11-31.31a12,12,0,0,0-4.25-9.12,116,116,0,0,0-38-21.41,12,12,0,0,0-9.68.89L128,37.27,99.83,21.53a12,12,0,0,0-9.7-.9,116.06,116.06,0,0,0-38,21.47,12,12,0,0,0-4.24,9.1l-.14,31.34L20,98.35a12,12,0,0,0-5.85,8.11,110.7,110.7,0,0,0,0,43.11A12,12,0,0,0,20,157.66l27.82,15.85.11,31.31a12,12,0,0,0,4.25,9.12,116,116,0,0,0,38,21.41,12,12,0,0,0,9.68-.89L128,218.73l28.14,15.74a12,12,0,0,0,9.7.9,116.06,116.06,0,0,0,38-21.47,12,12,0,0,0,4.24-9.1l.14-31.34,27.81-15.81a12,12,0,0,0,5.85-8.11A110.7,110.7,0,0,0,241.86,106.43Zm-22.63,33.18-26.88,15.28a11.94,11.94,0,0,0-4.55,4.59c-.54,1-1.11,1.93-1.7,2.88a12,12,0,0,0-1.83,6.31L184.13,199a91.83,91.83,0,0,1-21.07,11.87l-27.15-15.19a12,12,0,0,0-5.86-1.53h-.29c-1.14,0-2.3,0-3.44,0a12.08,12.08,0,0,0-6.14,1.51L93,210.82A92.27,92.27,0,0,1,71.88,199l-.11-30.24a12,12,0,0,0-1.83-6.32c-.58-.94-1.16-1.91-1.7-2.88A11.92,11.92,0,0,0,63.7,155L36.8,139.63a86.53,86.53,0,0,1,0-23.24l26.88-15.28a12,12,0,0,0,4.55-4.58c.54-1,1.11-1.94,1.7-2.89a12,12,0,0,0,1.83-6.31L71.87,57A91.83,91.83,0,0,1,92.94,45.17l27.15,15.19a11.92,11.92,0,0,0,6.15,1.52c1.14,0,2.3,0,3.44,0a12.08,12.08,0,0,0,6.14-1.51L163,45.18A92.27,92.27,0,0,1,184.12,57l.11,30.24a12,12,0,0,0,1.83,6.32c.58.94,1.16,1.91,1.7,2.88A11.92,11.92,0,0,0,192.3,101l26.9,15.33A86.53,86.53,0,0,1,219.23,139.61Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.1,108.76,198.25,90.62c-.64-1.16-1.31-2.29-2-3.41l-.12-36A104.61,104.61,0,0,0,162,32L130,49.89c-1.34,0-2.69,0-4,0L94,32A104.58,104.58,0,0,0,59.89,51.25l-.16,36c-.7,1.12-1.37,2.26-2,3.41l-31.84,18.1a99.15,99.15,0,0,0,0,38.46l31.85,18.14c.64,1.16,1.31,2.29,2,3.41l.12,36A104.61,104.61,0,0,0,94,224l32-17.87c1.34,0,2.69,0,4,0L162,224a104.58,104.58,0,0,0,34.08-19.25l.16-36c.7-1.12,1.37-2.26,2-3.41l31.84-18.1A99.15,99.15,0,0,0,230.1,108.76ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z",opacity:"0.2"}),s.createElement("path",{d:"M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm109.94-52.79a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A111.92,111.92,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.63a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21Zm-15,34.91-28.57,16.25a8,8,0,0,0-3,3c-.58,1-1.19,2.06-1.81,3.06a7.94,7.94,0,0,0-1.22,4.21l-.15,32.25a95.89,95.89,0,0,1-25.37,14.3L134,199.13a8,8,0,0,0-3.91-1h-.19c-1.21,0-2.43,0-3.64,0a8.1,8.1,0,0,0-4.1,1l-28.84,16.1A96,96,0,0,1,67.88,201l-.11-32.2a8,8,0,0,0-1.22-4.22c-.62-1-1.23-2-1.8-3.06a8.09,8.09,0,0,0-3-3.06l-28.6-16.29a90.49,90.49,0,0,1,0-28.26L61.67,97.63a8,8,0,0,0,3-3c.58-1,1.19-2.06,1.81-3.06a7.94,7.94,0,0,0,1.22-4.21l.15-32.25a95.89,95.89,0,0,1,25.37-14.3L122,56.87a8,8,0,0,0,4.1,1c1.21,0,2.43,0,3.64,0a8,8,0,0,0,4.1-1l28.84-16.1A96,96,0,0,1,188.12,55l.11,32.2a8,8,0,0,0,1.22,4.22c.62,1,1.23,2,1.8,3.06a8.09,8.09,0,0,0,3,3.06l28.6,16.29A90.49,90.49,0,0,1,222.9,142.12Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M237.94,107.21a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A111.92,111.92,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.63a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,82a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162Zm108-54.4a6,6,0,0,0-2.92-4L202.64,86.22l-.42-.71L202.1,51.2A6,6,0,0,0,200,46.64a110.12,110.12,0,0,0-36.07-20.31,6,6,0,0,0-4.84.45L128.46,43.86h-1L96.91,26.76a6,6,0,0,0-4.86-.44A109.92,109.92,0,0,0,56,46.68a6,6,0,0,0-2.12,4.55l-.16,34.34c-.14.23-.28.47-.41.71L22.91,103.57A6,6,0,0,0,20,107.62a104.81,104.81,0,0,0,0,40.78,6,6,0,0,0,2.92,4l30.42,17.33.42.71.12,34.31A6,6,0,0,0,56,209.36a110.12,110.12,0,0,0,36.07,20.31,6,6,0,0,0,4.84-.45l30.61-17.08h1l30.56,17.1A6.09,6.09,0,0,0,162,230a5.83,5.83,0,0,0,1.93-.32,109.92,109.92,0,0,0,36-20.36,6,6,0,0,0,2.12-4.55l.16-34.34c.14-.23.28-.47.41-.71l30.42-17.29a6,6,0,0,0,2.92-4.05A104.81,104.81,0,0,0,236,107.6Zm-11.25,35.79L195.32,160.1a6.07,6.07,0,0,0-2.28,2.3c-.59,1-1.21,2.11-1.86,3.14a6,6,0,0,0-.91,3.16l-.16,33.21a98.15,98.15,0,0,1-27.52,15.53L133,200.88a6,6,0,0,0-2.93-.77h-.14c-1.24,0-2.5,0-3.74,0a6,6,0,0,0-3.07.76L93.45,217.43a98,98,0,0,1-27.56-15.49l-.12-33.17a6,6,0,0,0-.91-3.16c-.64-1-1.27-2.08-1.86-3.14a6,6,0,0,0-2.27-2.3L31.3,143.4a93,93,0,0,1,0-30.79L60.68,95.9A6.07,6.07,0,0,0,63,93.6c.59-1,1.21-2.11,1.86-3.14a6,6,0,0,0,.91-3.16l.16-33.21A98.15,98.15,0,0,1,93.41,38.56L123,55.12a5.81,5.81,0,0,0,3.07.76c1.24,0,2.5,0,3.74,0a6,6,0,0,0,3.07-.76l29.65-16.56a98,98,0,0,1,27.56,15.49l.12,33.17a6,6,0,0,0,.91,3.16c.64,1,1.27,2.08,1.86,3.14a6,6,0,0,0,2.27,2.3L224.7,112.6A93,93,0,0,1,224.73,143.39Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm109.94-52.79a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A112.1,112.1,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.62a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21Zm-15,34.91-28.57,16.25a8,8,0,0,0-3,3c-.58,1-1.19,2.06-1.81,3.06a7.94,7.94,0,0,0-1.22,4.21l-.15,32.25a95.89,95.89,0,0,1-25.37,14.3L134,199.13a8,8,0,0,0-3.91-1h-.19c-1.21,0-2.43,0-3.64,0a8.08,8.08,0,0,0-4.1,1l-28.84,16.1A96,96,0,0,1,67.88,201l-.11-32.2a8,8,0,0,0-1.22-4.22c-.62-1-1.23-2-1.8-3.06a8.09,8.09,0,0,0-3-3.06l-28.6-16.29a90.49,90.49,0,0,1,0-28.26L61.67,97.63a8,8,0,0,0,3-3c.58-1,1.19-2.06,1.81-3.06a7.94,7.94,0,0,0,1.22-4.21l.15-32.25a95.89,95.89,0,0,1,25.37-14.3L122,56.87a8,8,0,0,0,4.1,1c1.21,0,2.43,0,3.64,0a8.08,8.08,0,0,0,4.1-1l28.84-16.1A96,96,0,0,1,188.12,55l.11,32.2a8,8,0,0,0,1.22,4.22c.62,1,1.23,2,1.8,3.06a8.09,8.09,0,0,0,3,3.06l28.6,16.29A90.49,90.49,0,0,1,222.9,142.12Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Zm106-56a4,4,0,0,0-2-2.7l-30.89-17.6q-.47-.82-1-1.62L200.1,51.2a3.94,3.94,0,0,0-1.42-3,107.8,107.8,0,0,0-35.41-19.94,4,4,0,0,0-3.23.29L129,45.87h-2l-31-17.36a4,4,0,0,0-3.23-.3,108.05,108.05,0,0,0-35.39,20,4,4,0,0,0-1.41,3l-.16,34.9-1,1.62L23.9,105.3A4,4,0,0,0,22,108a102.76,102.76,0,0,0,0,40,4,4,0,0,0,1.95,2.7l30.89,17.6q.47.83,1,1.62l.12,34.87a3.94,3.94,0,0,0,1.42,3,107.8,107.8,0,0,0,35.41,19.94,4,4,0,0,0,3.23-.29L127,210.13h2l31,17.36a4,4,0,0,0,3.23.3,108.05,108.05,0,0,0,35.39-20,4,4,0,0,0,1.41-3l.16-34.9,1-1.62L232.1,150.7a4,4,0,0,0,2-2.71A102.76,102.76,0,0,0,234,108Zm-7.48,36.67L196.3,161.84a4,4,0,0,0-1.51,1.53c-.61,1.09-1.25,2.17-1.91,3.24a3.92,3.92,0,0,0-.61,2.1l-.16,34.15a99.8,99.8,0,0,1-29.7,16.77l-30.4-17a4.06,4.06,0,0,0-2-.51H130c-1.28,0-2.57,0-3.84,0a4.1,4.1,0,0,0-2.05.51l-30.45,17A100.23,100.23,0,0,1,63.89,202.9l-.12-34.12a3.93,3.93,0,0,0-.61-2.11c-.66-1-1.3-2.14-1.91-3.23a4,4,0,0,0-1.51-1.53L29.49,144.68a94.78,94.78,0,0,1,0-33.34L59.7,94.16a4,4,0,0,0,1.51-1.53c.61-1.09,1.25-2.17,1.91-3.23a4,4,0,0,0,.61-2.11l.16-34.15a99.8,99.8,0,0,1,29.7-16.77l30.4,17a4.1,4.1,0,0,0,2.05.51c1.28,0,2.57,0,3.84,0a4,4,0,0,0,2.05-.51l30.45-17A100.23,100.23,0,0,1,192.11,53.1l.12,34.12a3.93,3.93,0,0,0,.61,2.11c.66,1,1.3,2.14,1.91,3.23a4,4,0,0,0,1.51,1.53l30.25,17.23A94.78,94.78,0,0,1,226.54,144.66Z"}))]]),QB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,68H190.06A33.82,33.82,0,0,0,196,49.69,36.62,36.62,0,0,0,158.31,12,33.44,33.44,0,0,0,134,23.25a54.65,54.65,0,0,0-6,8.3,54.65,54.65,0,0,0-6-8.3A33.44,33.44,0,0,0,97.69,12,36.62,36.62,0,0,0,60,49.69,33.82,33.82,0,0,0,65.94,68H40A20,20,0,0,0,20,88v32a20,20,0,0,0,16,19.6V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V139.6A20,20,0,0,0,236,120V88A20,20,0,0,0,216,68Zm-4,48H140V92h72ZM152,39.17A9.59,9.59,0,0,1,159,36h.35A12.62,12.62,0,0,1,172,49,9.59,9.59,0,0,1,168.83,56c-6.9,6.12-18.25,9.26-27.63,10.76C142.7,57.42,145.84,46.07,152,39.17ZM87.7,39.7A12.8,12.8,0,0,1,96.61,36H97A9.59,9.59,0,0,1,104,39.17c6.12,6.9,9.26,18.24,10.75,27.61C105.45,65.27,94,62.13,87.17,56A9.59,9.59,0,0,1,84,49,12.72,12.72,0,0,1,87.7,39.7ZM44,92h72v24H44Zm16,48h56v56H60Zm80,56V140h56v56Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,128v72a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V128Z",opacity:"0.2"}),s.createElement("path",{d:"M216,72H180.92c.39-.33.79-.65,1.17-1A29.53,29.53,0,0,0,192,49.57,32.62,32.62,0,0,0,158.44,16,29.53,29.53,0,0,0,137,25.91a54.94,54.94,0,0,0-9,14.48,54.94,54.94,0,0,0-9-14.48A29.53,29.53,0,0,0,97.56,16,32.62,32.62,0,0,0,64,49.57,29.53,29.53,0,0,0,73.91,71c.38.33.78.65,1.17,1H40A16,16,0,0,0,24,88v32a16,16,0,0,0,16,16v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V136a16,16,0,0,0,16-16V88A16,16,0,0,0,216,72ZM149,36.51a13.69,13.69,0,0,1,10-4.5h.49A16.62,16.62,0,0,1,176,49.08a13.69,13.69,0,0,1-4.5,10c-9.49,8.4-25.24,11.36-35,12.4C137.7,60.89,141,45.5,149,36.51Zm-64.09.36A16.63,16.63,0,0,1,96.59,32h.49a13.69,13.69,0,0,1,10,4.5c8.39,9.48,11.35,25.2,12.39,34.92-9.72-1-25.44-4-34.92-12.39a13.69,13.69,0,0,1-4.5-10A16.6,16.6,0,0,1,84.87,36.87ZM40,88h80v32H40Zm16,48h64v64H56Zm144,64H136V136h64Zm16-80H136V88h80v32Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H180.92c.39-.33.79-.65,1.17-1A29.53,29.53,0,0,0,192,49.57,32.62,32.62,0,0,0,158.44,16,29.53,29.53,0,0,0,137,25.91a54.94,54.94,0,0,0-9,14.48,54.94,54.94,0,0,0-9-14.48A29.53,29.53,0,0,0,97.56,16,32.62,32.62,0,0,0,64,49.57,29.53,29.53,0,0,0,73.91,71c.38.33.78.65,1.17,1H40A16,16,0,0,0,24,88v32a16,16,0,0,0,16,16v64a16,16,0,0,0,16,16h60a4,4,0,0,0,4-4V120H40V88h80v32h16V88h80v32H136v92a4,4,0,0,0,4,4h60a16,16,0,0,0,16-16V136a16,16,0,0,0,16-16V88A16,16,0,0,0,216,72ZM84.51,59a13.69,13.69,0,0,1-4.5-10A16.62,16.62,0,0,1,96.59,32h.49a13.69,13.69,0,0,1,10,4.5c8.39,9.48,11.35,25.2,12.39,34.92C109.71,70.39,94,67.43,84.51,59Zm87,0c-9.49,8.4-25.24,11.36-35,12.4C137.7,60.89,141,45.5,149,36.51a13.69,13.69,0,0,1,10-4.5h.49A16.62,16.62,0,0,1,176,49.08,13.69,13.69,0,0,1,171.49,59Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,74H174.74a46.41,46.41,0,0,0,6-4.48,27.56,27.56,0,0,0,9.22-20A30.63,30.63,0,0,0,158.5,18a27.56,27.56,0,0,0-20,9.22A57.1,57.1,0,0,0,128,45.76a57.1,57.1,0,0,0-10.48-18.53A27.56,27.56,0,0,0,97.5,18,30.63,30.63,0,0,0,66,49.51a27.56,27.56,0,0,0,9.22,20,45.74,45.74,0,0,0,6,4.48H40A14,14,0,0,0,26,88v32a14,14,0,0,0,14,14h2v66a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V134h2a14,14,0,0,0,14-14V88A14,14,0,0,0,216,74ZM135.77,63c2.25-12.12,6.29-21.75,11.69-27.85A15.68,15.68,0,0,1,158.86,30h.55A18.6,18.6,0,0,1,178,49.14a15.68,15.68,0,0,1-5.18,11.4C162.1,70,143.92,72.83,134.34,73.65,134.59,70.76,135,67.08,135.77,63ZM83.45,35.45A18.69,18.69,0,0,1,96.59,30h.55a15.68,15.68,0,0,1,11.4,5.18C118,45.9,120.83,64.08,121.65,73.66c-2.89-.25-6.57-.68-10.61-1.43C98.92,70,89.29,65.94,83.19,60.53A15.64,15.64,0,0,1,78,49.14,18.65,18.65,0,0,1,83.45,35.45ZM38,120V88a2,2,0,0,1,2-2h82v36H40A2,2,0,0,1,38,120Zm16,80V134h68v68H56A2,2,0,0,1,54,200Zm148,0a2,2,0,0,1-2,2H134V134h68Zm16-80a2,2,0,0,1-2,2H134V86h82a2,2,0,0,1,2,2Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H180.92c.39-.33.79-.65,1.17-1A29.53,29.53,0,0,0,192,49.57,32.62,32.62,0,0,0,158.44,16,29.53,29.53,0,0,0,137,25.91a54.94,54.94,0,0,0-9,14.48,54.94,54.94,0,0,0-9-14.48A29.53,29.53,0,0,0,97.56,16,32.62,32.62,0,0,0,64,49.57,29.53,29.53,0,0,0,73.91,71c.38.33.78.65,1.17,1H40A16,16,0,0,0,24,88v32a16,16,0,0,0,16,16v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V136a16,16,0,0,0,16-16V88A16,16,0,0,0,216,72ZM149,36.51a13.69,13.69,0,0,1,10-4.5h.49A16.62,16.62,0,0,1,176,49.08a13.69,13.69,0,0,1-4.5,10c-9.49,8.4-25.24,11.36-35,12.4C137.7,60.89,141,45.5,149,36.51Zm-64.09.36A16.63,16.63,0,0,1,96.59,32h.49a13.69,13.69,0,0,1,10,4.5c8.39,9.48,11.35,25.2,12.39,34.92-9.72-1-25.44-4-34.92-12.39a13.69,13.69,0,0,1-4.5-10A16.6,16.6,0,0,1,84.87,36.87ZM40,88h80v32H40Zm16,48h64v64H56Zm144,64H136V136h64Zm16-80H136V88h80v32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,76H166.81a50.54,50.54,0,0,0,12.63-8A25.53,25.53,0,0,0,188,49.44,28.62,28.62,0,0,0,158.56,20,25.53,25.53,0,0,0,140,28.56c-5.91,6.67-9.63,15.36-12,23.69-2.35-8.33-6.07-17-12-23.69A25.53,25.53,0,0,0,97.44,20,28.62,28.62,0,0,0,68,49.44,25.53,25.53,0,0,0,76.56,68a50.54,50.54,0,0,0,12.63,8H40A12,12,0,0,0,28,88v32a12,12,0,0,0,12,12h4v68a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V132h4a12,12,0,0,0,12-12V88A12,12,0,0,0,216,76ZM146,33.86A17.59,17.59,0,0,1,158.8,28h.61A20.62,20.62,0,0,1,180,49.2,17.6,17.6,0,0,1,174.14,62c-12.09,10.7-33.07,13.21-42,13.79C132.76,66.93,135.26,46,146,33.86ZM76,49.2A20.62,20.62,0,0,1,96.59,28h.61A17.59,17.59,0,0,1,110,33.86c10.71,12.09,13.21,33.07,13.79,42-8.89-.58-29.87-3.09-42-13.79A17.6,17.6,0,0,1,76,49.2ZM36,120V88a4,4,0,0,1,4-4h84v40H40A4,4,0,0,1,36,120Zm16,80V132h72v72H56A4,4,0,0,1,52,200Zm152,0a4,4,0,0,1-4,4H132V132h72Zm16-80a4,4,0,0,1-4,4H132V84h84a4,4,0,0,1,4,4Z"}))]]),JB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M212.62,75.17A63.7,63.7,0,0,0,206.39,26,12,12,0,0,0,196,20a63.71,63.71,0,0,0-50,24H126A63.71,63.71,0,0,0,76,20a12,12,0,0,0-10.39,6,63.7,63.7,0,0,0-6.23,49.17A61.5,61.5,0,0,0,52,104v8a60.1,60.1,0,0,0,45.76,58.28A43.66,43.66,0,0,0,92,192v4H76a20,20,0,0,1-20-20,44.05,44.05,0,0,0-44-44,12,12,0,0,0,0,24,20,20,0,0,1,20,20,44.05,44.05,0,0,0,44,44H92v12a12,12,0,0,0,24,0V192a20,20,0,0,1,40,0v40a12,12,0,0,0,24,0V192a43.66,43.66,0,0,0-5.76-21.72A60.1,60.1,0,0,0,220,112v-8A61.5,61.5,0,0,0,212.62,75.17ZM196,112a36,36,0,0,1-36,36H112a36,36,0,0,1-36-36v-8a37.87,37.87,0,0,1,6.13-20.12,11.65,11.65,0,0,0,1.58-11.49,39.9,39.9,0,0,1-.4-27.72,39.87,39.87,0,0,1,26.41,17.8A12,12,0,0,0,119.82,68h32.35a12,12,0,0,0,10.11-5.53,39.84,39.84,0,0,1,26.41-17.8,39.9,39.9,0,0,1-.4,27.72,12,12,0,0,0,1.61,11.53A37.85,37.85,0,0,1,196,104Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,104v8a48,48,0,0,1-48,48H136a32,32,0,0,1,32,32v40H104V192a32,32,0,0,1,32-32H112a48,48,0,0,1-48-48v-8a49.28,49.28,0,0,1,8.51-27.3A51.92,51.92,0,0,1,76,32a52,52,0,0,1,43.83,24h32.34A52,52,0,0,1,196,32a51.92,51.92,0,0,1,3.49,44.7A49.28,49.28,0,0,1,208,104Z",opacity:"0.2"}),s.createElement("path",{d:"M208.3,75.68A59.74,59.74,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58,58,0,0,0,208.3,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.76,41.76,0,0,1,200,104Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M206.13,75.92A57.79,57.79,0,0,0,201.2,29a6,6,0,0,0-5.2-3,57.77,57.77,0,0,0-47,24H123A57.77,57.77,0,0,0,76,26a6,6,0,0,0-5.2,3,57.79,57.79,0,0,0-4.93,46.92A55.88,55.88,0,0,0,58,104v8a54.06,54.06,0,0,0,50.45,53.87A37.85,37.85,0,0,0,98,192v10H72a26,26,0,0,1-26-26A38,38,0,0,0,8,138a6,6,0,0,0,0,12,26,26,0,0,1,26,26,38,38,0,0,0,38,38H98v18a6,6,0,0,0,12,0V192a26,26,0,0,1,52,0v40a6,6,0,0,0,12,0V192a37.85,37.85,0,0,0-10.45-26.13A54.06,54.06,0,0,0,214,112v-8A55.88,55.88,0,0,0,206.13,75.92ZM202,112a42,42,0,0,1-42,42H112a42,42,0,0,1-42-42v-8a43.86,43.86,0,0,1,7.3-23.69,6,6,0,0,0,.81-5.76,45.85,45.85,0,0,1,1.43-36.42,45.85,45.85,0,0,1,35.23,21.1A6,6,0,0,0,119.83,62h32.34a6,6,0,0,0,5.06-2.76,45.83,45.83,0,0,1,35.23-21.11,45.85,45.85,0,0,1,1.43,36.42,6,6,0,0,0,.79,5.74A43.78,43.78,0,0,1,202,104Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.31,75.68A59.78,59.78,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58.14,58.14,0,0,0,208.31,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.72,41.72,0,0,1,200,104Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M203.94,76.16A55.73,55.73,0,0,0,199.46,30,4,4,0,0,0,196,28a55.78,55.78,0,0,0-46,24H122A55.78,55.78,0,0,0,76,28a4,4,0,0,0-3.46,2,55.73,55.73,0,0,0-4.48,46.16A53.78,53.78,0,0,0,60,104v8a52.06,52.06,0,0,0,52,52h1.41A36,36,0,0,0,100,192v12H72a28,28,0,0,1-28-28A36,36,0,0,0,8,140a4,4,0,0,0,0,8,28,28,0,0,1,28,28,36,36,0,0,0,36,36h28v20a4,4,0,0,0,8,0V192a28,28,0,0,1,56,0v40a4,4,0,0,0,8,0V192a36,36,0,0,0-13.41-28H160a52.06,52.06,0,0,0,52-52v-8A53.78,53.78,0,0,0,203.94,76.16ZM204,112a44.05,44.05,0,0,1-44,44H112a44.05,44.05,0,0,1-44-44v-8a45.76,45.76,0,0,1,7.71-24.89,4,4,0,0,0,.53-3.84,47.82,47.82,0,0,1,2.1-39.21,47.8,47.8,0,0,1,38.12,22.1A4,4,0,0,0,119.83,60h32.34a4,4,0,0,0,3.37-1.84,47.8,47.8,0,0,1,38.12-22.1,47.82,47.82,0,0,1,2.1,39.21,4,4,0,0,0,.53,3.83A45.85,45.85,0,0,1,204,104Z"}))]]),eU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M249.8,85.49l-116-64a12,12,0,0,0-11.6,0l-116,64a12,12,0,0,0,0,21l21.8,12v47.76a19.89,19.89,0,0,0,5.09,13.32C46.63,194.7,77,220,128,220a136.88,136.88,0,0,0,40-5.75V240a12,12,0,0,0,24,0V204.12a119.53,119.53,0,0,0,30.91-24.51A19.89,19.89,0,0,0,228,166.29V118.53l21.8-12a12,12,0,0,0,0-21ZM128,45.71,219.16,96,186,114.3a1.88,1.88,0,0,1-.18-.12l-52-28.69a12,12,0,0,0-11.6,21l39,21.49L128,146.3,36.84,96ZM128,196c-40.42,0-64.65-19.07-76-31.27v-33l70.2,38.74a12,12,0,0,0,11.6,0L168,151.64v37.23A110.46,110.46,0,0,1,128,196Zm76-31.27a93.21,93.21,0,0,1-12,10.81V138.39l12-6.62Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,113.07v53.22a8,8,0,0,1-2,5.31c-11.3,12.59-38.9,36.4-86,36.4s-74.68-23.81-86-36.4a8,8,0,0,1-2-5.31V113.07L128,160Z",opacity:"0.2"}),s.createElement("path",{d:"M251.76,88.94l-120-64a8,8,0,0,0-7.52,0l-120,64a8,8,0,0,0,0,14.12L32,117.87v48.42a15.91,15.91,0,0,0,4.06,10.65C49.16,191.53,78.51,216,128,216a130,130,0,0,0,48-8.76V240a8,8,0,0,0,16,0V199.51a115.63,115.63,0,0,0,27.94-22.57A15.91,15.91,0,0,0,224,166.29V117.87l27.76-14.81a8,8,0,0,0,0-14.12ZM128,200c-43.27,0-68.72-21.14-80-33.71V126.4l76.24,40.66a8,8,0,0,0,7.52,0L176,143.47v46.34C163.4,195.69,147.52,200,128,200Zm80-33.75a97.83,97.83,0,0,1-16,14.25V134.93l16-8.53ZM188,118.94l-.22-.13-56-29.87a8,8,0,0,0-7.52,14.12L171,128l-43,22.93L25,96,128,41.07,231,96Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,207.24a119,119,0,0,0,16-7.73V240a8,8,0,0,1-16,0Zm11.76-88.43-56-29.87a8,8,0,0,0-7.52,14.12L171,128l17-9.06Zm64-29.87-120-64a8,8,0,0,0-7.52,0l-120,64a8,8,0,0,0,0,14.12L32,117.87v48.42a15.91,15.91,0,0,0,4.06,10.65C49.16,191.53,78.51,216,128,216a130,130,0,0,0,48-8.76V130.67L171,128l-43,22.93L43.83,106l0,0L25,96,128,41.07,231,96l-18.78,10-.06,0L188,118.94a8,8,0,0,1,4,6.93v73.64a115.63,115.63,0,0,0,27.94-22.57A15.91,15.91,0,0,0,224,166.29V117.87l27.76-14.81a8,8,0,0,0,0-14.12Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M250.82,90.71l-120-64a5.94,5.94,0,0,0-5.64,0l-120,64a6,6,0,0,0,0,10.58L34,116.67v49.62a14,14,0,0,0,3.55,9.32C50.42,189.94,79.29,214,128,214a127.21,127.21,0,0,0,50-9.73V240a6,6,0,0,0,12,0V198.35a113.18,113.18,0,0,0,28.45-22.75,13.91,13.91,0,0,0,3.55-9.31V116.67l28.82-15.38a6,6,0,0,0,0-10.58ZM128,202c-44,0-70-21.56-81.52-34.41a2,2,0,0,1-.48-1.3V123.07l79.18,42.22a6,6,0,0,0,5.64,0L178,140.13v51C165,197.35,148.45,202,128,202Zm82-35.71a2,2,0,0,1-.48,1.3A100.25,100.25,0,0,1,190,184.3V133.73l20-10.66Zm-22.15-45a6.27,6.27,0,0,0-1-.71l-56-29.86a6,6,0,0,0-5.64,10.58L175.25,128,128,153.2,20.75,96,128,38.8,235.25,96Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M251.76,88.94l-120-64a8,8,0,0,0-7.52,0l-120,64a8,8,0,0,0,0,14.12L32,117.87v48.42a15.91,15.91,0,0,0,4.06,10.65C49.16,191.53,78.51,216,128,216a130,130,0,0,0,48-8.76V240a8,8,0,0,0,16,0V199.51a115.63,115.63,0,0,0,27.94-22.57A15.91,15.91,0,0,0,224,166.29V117.87l27.76-14.81a8,8,0,0,0,0-14.12ZM128,200c-43.27,0-68.72-21.14-80-33.71V126.4l76.24,40.66a8,8,0,0,0,7.52,0L176,143.47v46.34C163.4,195.69,147.52,200,128,200Zm80-33.75a97.83,97.83,0,0,1-16,14.25V134.93l16-8.53ZM188,118.94l-.22-.13-56-29.87a8,8,0,0,0-7.52,14.12L171,128l-43,22.93L25,96,128,41.07,231,96Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M249.88,92.47l-120-64a4,4,0,0,0-3.76,0l-120,64a4,4,0,0,0,0,7.06L36,115.47v50.82a11.92,11.92,0,0,0,3,8c12.65,14.09,41,37.73,89,37.73,21,0,38.2-4.52,52-10.79V240a4,4,0,0,0,8,0V197.18a111.64,111.64,0,0,0,29-22.91,11.94,11.94,0,0,0,3-8V115.47l29.88-15.94a4,4,0,0,0,0-7.06ZM128,204c-44.83,0-71.25-22-83-35.08a3.92,3.92,0,0,1-1-2.63V119.73l82.12,43.8a4,4,0,0,0,3.76,0L180,136.8v55.53C166.58,199,149.39,204,128,204Zm84-37.71a4,4,0,0,1-1,2.64,103.32,103.32,0,0,1-23,19v-55.4l24-12.8Zm-24.59-42.51a4,4,0,0,0-1.53-1.44l-56-29.87a4,4,0,0,0-3.76,7.06L179.5,128,128,155.47,16.5,96,128,36.53,239.5,96Z"}))]]),tU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184.63,23.14a12,12,0,0,1,15-8A72.34,72.34,0,0,1,228.4,32a12,12,0,0,1-16.58,17.35,48.31,48.31,0,0,0-19.2-11.2A12,12,0,0,1,184.63,23.14ZM232.85,167.8A92,92,0,0,1,64.31,190l-40-69.32A32,32,0,0,1,36,77a31.72,31.72,0,0,1,7.54-3.14A32,32,0,0,1,88.65,32.45a32,32,0,0,1,53,3.55l14.53,25.17A32,32,0,0,1,206.35,68l17.31,30A91.38,91.38,0,0,1,232.85,167.8Zm-30-57.81L185.57,80a8,8,0,0,0-13.86,8h0l6.68,11.57a12,12,0,0,1-3.18,15.59,28,28,0,0,0-6.41,38.1,12,12,0,1,1-19.86,13.46,52.05,52.05,0,0,1,3.9-63.4L120.9,48A8,8,0,0,0,107,56l24.25,42a12,12,0,1,1-20.78,12L79.33,56a8,8,0,0,0-13.85,8L99,122a12,12,0,0,1-20.78,12L58.93,100.67a8,8,0,1,0-13.85,8L85.1,178a68,68,0,0,0,117.78-68ZM50.46,198a12,12,0,1,0-20.78,12,132.79,132.79,0,0,0,20,26.38,12,12,0,1,0,17.17-16.76A109.2,109.2,0,0,1,50.46,198Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,213.27A80,80,0,0,1,74.7,184l-40-69.32a20,20,0,0,1,34.64-20L55.08,70A20,20,0,0,1,89.73,50l6.92,12h0a20,20,0,0,1,34.64-20l30,52A20,20,0,0,1,196,74l17.31,30A80,80,0,0,1,184,213.27Z",opacity:"0.2"}),s.createElement("path",{d:"M220.17,100,202.86,70a28,28,0,0,0-38.24-10.25,27.69,27.69,0,0,0-9,8.34L138.2,38a28,28,0,0,0-48.48,0A28,28,0,0,0,48.15,74l1.59,2.76A27.67,27.67,0,0,0,38,80.41a28,28,0,0,0-10.24,38.25l40,69.32a87.47,87.47,0,0,0,53.43,41,88.56,88.56,0,0,0,22.92,3,88,88,0,0,0,76.06-132Zm-6.66,62.64A72,72,0,0,1,81.62,180l-40-69.32a12,12,0,0,1,20.78-12L81.63,132a8,8,0,1,0,13.85-8L62,66A12,12,0,1,1,82.78,54L114,108a8,8,0,1,0,13.85-8L103.57,58h0a12,12,0,1,1,20.78-12l33.42,57.9a48,48,0,0,0-5.54,60.6,8,8,0,0,0,13.24-9A32,32,0,0,1,172.78,112a8,8,0,0,0,2.13-10.4L168.23,90A12,12,0,1,1,189,78l17.31,30A71.56,71.56,0,0,1,213.51,162.62ZM184.25,31.71A8,8,0,0,1,194,26a59.62,59.62,0,0,1,36.53,28l.33.57a8,8,0,1,1-13.85,8l-.33-.57a43.67,43.67,0,0,0-26.8-20.5A8,8,0,0,1,184.25,31.71ZM80.89,237a8,8,0,0,1-11.23,1.33A119.56,119.56,0,0,1,40.06,204a8,8,0,0,1,13.86-8,103.67,103.67,0,0,0,25.64,29.72A8,8,0,0,1,80.89,237Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M219.31,98.46A88,88,0,1,1,67.08,186.77h0L26.15,115.88a16,16,0,0,1,27.69-16L72.4,132a8,8,0,0,0,13.86-8L47,56A16,16,0,0,1,74.69,40L114,108a8,8,0,1,0,13.85-8l-30-52a16,16,0,0,1,27.71-16L166,102.12A48.25,48.25,0,0,0,152,136a47.59,47.59,0,0,0,9.6,28.8,8,8,0,1,0,12.79-9.61A32,32,0,0,1,181,110.26a8,8,0,0,0,2.17-10.43L171.71,80a16,16,0,0,1,27.71-16l19.89,34.46Zm-29.37-57A43.74,43.74,0,0,1,216.74,62l.33.57a8,8,0,0,0,13.86-8L230.6,54a59.64,59.64,0,0,0-36.54-28,8,8,0,0,0-4.12,15.46ZM79.58,225.72A103.58,103.58,0,0,1,53.93,196a8,8,0,0,0-13.86,8,119.56,119.56,0,0,0,29.6,34.28,8,8,0,0,0,9.91-12.56Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M218.44,101,201.13,71a26,26,0,0,0-45.58,1L136.47,39a26,26,0,0,0-46.14,2.19A26,26,0,0,0,49.88,73l3.29,5.7a26,26,0,0,0-23.69,39L69.5,187a85.44,85.44,0,0,0,52.21,40.08,86.71,86.71,0,0,0,22.4,3,86,86,0,0,0,74.33-129Zm-3,62.16A74,74,0,0,1,79.89,181l-40-69.32a14,14,0,0,1,24.25-14L83.36,131a6,6,0,0,0,10.39-6L60.27,67A14,14,0,1,1,84.52,53l31.17,54a6,6,0,0,0,5.2,3,5.9,5.9,0,0,0,3-.81,6,6,0,0,0,2.2-8.2L101.83,59a14,14,0,0,1,24.25-14l34.2,59.23a46,46,0,0,0-6.4,59.13,6,6,0,0,0,9.94-6.73,34,34,0,0,1,7.76-46.26,6,6,0,0,0,1.6-7.8L166.49,91a14,14,0,1,1,24.25-14l17.31,30A73.53,73.53,0,0,1,215.44,163.14ZM186.18,32.22A6,6,0,0,1,193.52,28a57.59,57.59,0,0,1,35.32,27l.33.57a6,6,0,1,1-10.39,6l-.33-.57a45.69,45.69,0,0,0-28-21.43A6,6,0,0,1,186.18,32.22ZM79.32,235.71a6,6,0,0,1-8.42,1A117.79,117.79,0,0,1,41.79,203a6,6,0,0,1,10.4-6,105.48,105.48,0,0,0,26.14,30.29A6,6,0,0,1,79.32,235.71Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220.17,100,202.86,70a28,28,0,0,0-38.24-10.25,27.69,27.69,0,0,0-9,8.34L138.2,38a28,28,0,0,0-48.48,0A28,28,0,0,0,48.15,74l1.59,2.76A27.67,27.67,0,0,0,38,80.41a28,28,0,0,0-10.24,38.25l40,69.32a87.47,87.47,0,0,0,53.43,41,88.56,88.56,0,0,0,22.92,3,88,88,0,0,0,76.06-132Zm-6.66,62.64A72,72,0,0,1,81.62,180l-40-69.32a12,12,0,0,1,20.78-12L81.63,132a8,8,0,1,0,13.85-8L62,66A12,12,0,1,1,82.78,54L114,108a8,8,0,1,0,13.85-8L103.57,58h0a12,12,0,1,1,20.78-12l33.42,57.9a48,48,0,0,0-5.54,60.6,8,8,0,0,0,13.24-9A32,32,0,0,1,172.78,112a8,8,0,0,0,2.13-10.4L168.23,90A12,12,0,1,1,189,78l17.31,30A71.56,71.56,0,0,1,213.51,162.62ZM184.25,31.71A8,8,0,0,1,194,26a59.62,59.62,0,0,1,36.53,28l.33.57a8,8,0,1,1-13.85,8l-.33-.57a43.67,43.67,0,0,0-26.8-20.5A8,8,0,0,1,184.25,31.71ZM80.89,237a8,8,0,0,1-11.23,1.33A119.56,119.56,0,0,1,40.06,204a8,8,0,0,1,13.86-8,103.67,103.67,0,0,0,25.64,29.72A8,8,0,0,1,80.89,237Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.71,102,199.4,72a24,24,0,0,0-43.57,4.52L134.74,40a24,24,0,0,0-43.69,4.9A24,24,0,0,0,51.61,72l5.31,9.19a24,24,0,0,0-25.71,35.47l40,69.32a83.4,83.4,0,0,0,51,39.14,84.45,84.45,0,0,0,21.88,2.9,84,84,0,0,0,72.6-126Zm.67,61.67A76,76,0,0,1,78.16,182l-40-69.32a16,16,0,0,1,27.71-16L85.09,130A4,4,0,0,0,92,126L58.54,68A16,16,0,1,1,86.25,52l31.17,54a4,4,0,1,0,6.93-4L100.1,60a16,16,0,0,1,27.72-16l35,60.63a44,44,0,0,0-7.28,57.61,4,4,0,1,0,6.62-4.49,36,36,0,0,1,8.22-49,4,4,0,0,0,1.07-5.2L164.76,92a16,16,0,1,1,27.71-16l17.31,30A75.52,75.52,0,0,1,217.38,163.65ZM188.12,32.74A4,4,0,0,1,193,29.9,55.65,55.65,0,0,1,227.11,56l.33.58A4,4,0,0,1,226,62a4,4,0,0,1-5.47-1.46l-.33-.57A47.62,47.62,0,0,0,191,37.63,4,4,0,0,1,188.12,32.74ZM77.75,234.48A4,4,0,0,1,74.61,236a4,4,0,0,1-2.47-.86A115.55,115.55,0,0,1,43.53,202a4,4,0,1,1,6.92-4,107.72,107.72,0,0,0,26.64,30.86A4,4,0,0,1,77.75,234.48Z"}))]]),nU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222.14,105.85l-80-80a20,20,0,0,0-28.28,0l-80,80A19.86,19.86,0,0,0,28,120v96a12,12,0,0,0,12,12h64a12,12,0,0,0,12-12V164h24v52a12,12,0,0,0,12,12h64a12,12,0,0,0,12-12V120A19.86,19.86,0,0,0,222.14,105.85ZM204,204H164V152a12,12,0,0,0-12-12H104a12,12,0,0,0-12,12v52H52V121.65l76-76,76,76Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,120v96H152V152H104v64H40V120a8,8,0,0,1,2.34-5.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,216,120Z",opacity:"0.2"}),s.createElement("path",{d:"M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,120v96a8,8,0,0,1-8,8H160a8,8,0,0,1-8-8V164a4,4,0,0,0-4-4H108a4,4,0,0,0-4,4v52a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V120a16,16,0,0,1,4.69-11.31l80-80a16,16,0,0,1,22.62,0l80,80A16,16,0,0,1,224,120Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M217.9,110.1l-80-80a14,14,0,0,0-19.8,0l-80,80A13.92,13.92,0,0,0,34,120v96a6,6,0,0,0,6,6h64a6,6,0,0,0,6-6V158h36v58a6,6,0,0,0,6,6h64a6,6,0,0,0,6-6V120A13.92,13.92,0,0,0,217.9,110.1ZM210,210H158V152a6,6,0,0,0-6-6H104a6,6,0,0,0-6,6v58H46V120a2,2,0,0,1,.58-1.42l80-80a2,2,0,0,1,2.84,0l80,80A2,2,0,0,1,210,120Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.49,111.51l-80-80a12,12,0,0,0-17,0l-80,80A12,12,0,0,0,36,120v96a4,4,0,0,0,4,4h64a4,4,0,0,0,4-4V156h40v60a4,4,0,0,0,4,4h64a4,4,0,0,0,4-4V120A12,12,0,0,0,216.49,111.51ZM212,212H156V152a4,4,0,0,0-4-4H104a4,4,0,0,0-4,4v60H44V120a4,4,0,0,1,1.17-2.83l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,212,120Z"}))]]),rU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V40A20,20,0,0,0,200,20Zm-4,192H60V44H196ZM84,68A12,12,0,0,1,96,56h64a12,12,0,0,1,0,24H96A12,12,0,0,1,84,68Zm8.8,127.37a48,48,0,0,1,70.4,0,12,12,0,0,0,17.6-16.32,72,72,0,0,0-19.21-14.68,44,44,0,1,0-67.19,0,72.12,72.12,0,0,0-19.2,14.68,12,12,0,0,0,17.6,16.32ZM128,116a20,20,0,1,1-20,20A20,20,0,0,1,128,116Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,32H56a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H200a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32ZM128,168a32,32,0,1,1,32-32A32,32,0,0,1,128,168Z",opacity:"0.2"}),s.createElement("path",{d:"M75.19,198.4a8,8,0,0,0,11.21-1.6,52,52,0,0,1,83.2,0,8,8,0,1,0,12.8-9.6A67.88,67.88,0,0,0,155,165.51a40,40,0,1,0-53.94,0A67.88,67.88,0,0,0,73.6,187.2,8,8,0,0,0,75.19,198.4ZM128,112a24,24,0,1,1-24,24A24,24,0,0,1,128,112Zm72-88H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V40A16,16,0,0,0,200,24Zm0,192H56V40H200ZM88,64a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,64Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V40A16,16,0,0,0,200,24ZM96,48h64a8,8,0,0,1,0,16H96a8,8,0,0,1,0-16Zm84.81,150.4a8,8,0,0,1-11.21-1.6,52,52,0,0,0-83.2,0,8,8,0,1,1-12.8-9.6A67.88,67.88,0,0,1,101,165.51a40,40,0,1,1,53.94,0A67.88,67.88,0,0,1,182.4,187.2,8,8,0,0,1,180.81,198.4ZM152,136a24,24,0,1,1-24-24A24,24,0,0,1,152,136Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M151.11,166.13a38,38,0,1,0-46.22,0A65.75,65.75,0,0,0,75.2,188.4a6,6,0,0,0,9.6,7.2,54,54,0,0,1,86.4,0,6,6,0,0,0,9.6-7.2A65.75,65.75,0,0,0,151.11,166.13ZM128,110a26,26,0,1,1-26,26A26,26,0,0,1,128,110Zm72-84H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V40A14,14,0,0,0,200,26Zm2,190a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2ZM90,64a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H96A6,6,0,0,1,90,64Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M75.19,198.4a8,8,0,0,0,11.21-1.6,52,52,0,0,1,83.2,0,8,8,0,1,0,12.8-9.6A67.88,67.88,0,0,0,155,165.51a40,40,0,1,0-53.94,0A67.88,67.88,0,0,0,73.6,187.2,8,8,0,0,0,75.19,198.4ZM128,112a24,24,0,1,1-24,24A24,24,0,0,1,128,112Zm72-88H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V40A16,16,0,0,0,200,24Zm0,192H56V40H200ZM88,64a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,64Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M146.7,166.75a36,36,0,1,0-37.4,0A63.61,63.61,0,0,0,76.8,189.6a4,4,0,0,0,6.4,4.8,56,56,0,0,1,89.6,0,4,4,0,0,0,6.4-4.8A63.65,63.65,0,0,0,146.7,166.75ZM100,136a28,28,0,1,1,28,28A28,28,0,0,1,100,136ZM200,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V40A12,12,0,0,0,200,28Zm4,188a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4ZM92,64a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H96A4,4,0,0,1,92,64Z"}))]]),sU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,28H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V48A20,20,0,0,0,208,28Zm-4,24v63.72L186.14,97.86a20,20,0,0,0-28.28,0L52,203.72V52ZM85.66,204,172,117.66l32,32V204ZM76,96a20,20,0,1,1,20,20A20,20,0,0,1,76,96Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,40H48a8,8,0,0,0-8,8V208a8,8,0,0,0,8,8h8.69L166.34,106.34a8,8,0,0,1,11.32,0L216,144.69V48A8,8,0,0,0,208,40ZM96,112a16,16,0,1,1,16-16A16,16,0,0,1,96,112Z",opacity:"0.2"}),s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM48,48H208v77.38l-24.69-24.7a16,16,0,0,0-22.62,0L53.37,208H48ZM208,208H76l96-96,36,36v60ZM96,120A24,24,0,1,0,72,96,24,24,0,0,0,96,120Zm0-32a8,8,0,1,1-8,8A8,8,0,0,1,96,88Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM48,48H208v77.38l-24.69-24.7a16,16,0,0,0-22.62,0L53.37,208H48ZM80,96a16,16,0,1,1,16,16A16,16,0,0,1,80,96Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V48A14,14,0,0,0,208,34ZM46,208V48a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2v82.2l-28.1-28.1a14,14,0,0,0-19.8,0L54.2,210H48A2,2,0,0,1,46,208Zm162,2H71.17l99.41-99.41a2,2,0,0,1,2.83,0L210,147.17V208A2,2,0,0,1,208,210ZM96,118A22,22,0,1,0,74,96,22,22,0,0,0,96,118Zm0-32A10,10,0,1,1,86,96,10,10,0,0,1,96,86Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM48,48H208v77.38l-24.69-24.7a16,16,0,0,0-22.62,0L53.37,208H48ZM208,208H76l96-96,36,36v60ZM96,120A24,24,0,1,0,72,96,24,24,0,0,0,96,120Zm0-32a8,8,0,1,1-8,8A8,8,0,0,1,96,88Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36ZM44,208V48a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4v87l-31.51-31.52a12,12,0,0,0-17,0L55,212H48A4,4,0,0,1,44,208Zm164,4H66.34L169.17,109.17a4,4,0,0,1,5.66,0L212,146.34V208A4,4,0,0,1,208,212ZM96,116A20,20,0,1,0,76,96,20,20,0,0,0,96,116Zm0-32A12,12,0,1,1,84,96,12,12,0,0,1,96,84Z"}))]]),aU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M252,128a60,60,0,0,1-102.43,42.43l-.49-.53L89.22,102.31a36,36,0,1,0,0,51.38l3.08-3.48a12,12,0,1,1,18,15.91l-3.35,3.78-.49.53a60,60,0,1,1,0-84.86l.49.53,59.86,67.59a36,36,0,1,0,0-51.38l-3.08,3.48a12,12,0,1,1-18-15.91l3.35-3.78.49-.53A60,60,0,0,1,252,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.94,161.94a48,48,0,0,1-67.88,0L128,128l30.06-33.94a48,48,0,0,1,67.88,67.88ZM30.06,94.06a48,48,0,0,0,67.88,67.88L128,128,97.94,94.06A48,48,0,0,0,30.06,94.06Z",opacity:"0.2"}),s.createElement("path",{d:"M248,128a56,56,0,0,1-95.6,39.6l-.33-.35L92.12,99.55a40,40,0,1,0,0,56.9l8.52-9.62a8,8,0,1,1,12,10.61l-8.69,9.81-.33.35a56,56,0,1,1,0-79.2l.33.35,59.95,67.7a40,40,0,1,0,0-56.9l-8.52,9.62a8,8,0,1,1-12-10.61l8.69-9.81.33-.35A56,56,0,0,1,248,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM204.28,156.28a40,40,0,0,1-56.4.17L97.29,111.34,97,111A24,24,0,1,0,97,145c.36-.36.71-.73,1-1.1a8,8,0,1,1,12,10.6c-.55.62-1.13,1.23-1.71,1.81a40,40,0,1,1-.17-56.73l50.58,45.11.33.31A24,24,0,1,0,159,111c-.36.36-.7.72-1,1.1a8,8,0,0,1-12-10.59c.54-.62,1.12-1.24,1.71-1.82a40,40,0,0,1,56.57,56.56Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M246,128a54,54,0,0,1-92.18,38.18,3.07,3.07,0,0,1-.25-.26l-60-67.74a42,42,0,1,0,0,59.64l8.57-9.67a6,6,0,1,1,9,8l-8.69,9.81a3.07,3.07,0,0,1-.25.26,54,54,0,1,1,0-76.36,3.07,3.07,0,0,1,.25.26l60,67.74a42,42,0,1,0,0-59.64l-8.57,9.67a6,6,0,1,1-9-8l8.69-9.81a3.07,3.07,0,0,1,.25-.26A54,54,0,0,1,246,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M248,128a56,56,0,0,1-95.6,39.6l-.33-.35L92.12,99.55a40,40,0,1,0,0,56.9l8.52-9.62a8,8,0,1,1,12,10.61l-8.69,9.81-.33.35a56,56,0,1,1,0-79.2l.33.35,59.95,67.7a40,40,0,1,0,0-56.9l-8.52,9.62a8,8,0,1,1-12-10.61l8.69-9.81.33-.35A56,56,0,0,1,248,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M244,128a52,52,0,0,1-88.77,36.77l-.17-.18L95,96.8a44,44,0,1,0,0,62.4l8.6-9.72a4,4,0,0,1,6,5.3l-8.68,9.81-.17.18a52,52,0,1,1,0-73.54l.17.18,60,67.79a44,44,0,1,0,0-62.4l-8.6,9.72a4,4,0,0,1-6-5.3l8.68-9.81.17-.18A52,52,0,0,1,244,128Z"}))]]),oU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),iU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M196,76a16,16,0,1,1-16-16A16,16,0,0,1,196,76Zm48,22.74A84.3,84.3,0,0,1,160.11,180H160a83.52,83.52,0,0,1-23.65-3.38l-7.86,7.87A12,12,0,0,1,120,188H108v12a12,12,0,0,1-12,12H84v12a12,12,0,0,1-12,12H40a20,20,0,0,1-20-20V187.31a19.86,19.86,0,0,1,5.86-14.14l53.52-53.52A84,84,0,1,1,244,98.74ZM202.43,53.57A59.48,59.48,0,0,0,158,36c-32,1-58,27.89-58,59.89a59.69,59.69,0,0,0,4.2,22.19,12,12,0,0,1-2.55,13.21L44,189v23H60V200a12,12,0,0,1,12-12H84V176a12,12,0,0,1,12-12h19l9.65-9.65a12,12,0,0,1,13.22-2.55A59.58,59.58,0,0,0,160,156h.08c32,0,58.87-26.07,59.89-58A59.55,59.55,0,0,0,202.43,53.57Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,98.36C230.73,136.92,198.67,168,160.09,168a71.68,71.68,0,0,1-26.92-5.17h0L120,176H96v24H72v24H40a8,8,0,0,1-8-8V187.31a8,8,0,0,1,2.34-5.65l58.83-58.83h0A71.68,71.68,0,0,1,88,95.91c0-38.58,31.08-70.64,69.64-71.87A72,72,0,0,1,232,98.36Z",opacity:"0.2"}),s.createElement("path",{d:"M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM224,98.1c-1.09,34.09-29.75,61.86-63.89,61.9H160a63.7,63.7,0,0,1-23.65-4.51,8,8,0,0,0-8.84,1.68L116.69,168H96a8,8,0,0,0-8,8v16H72a8,8,0,0,0-8,8v16H40V187.31l58.83-58.82a8,8,0,0,0,1.68-8.84A63.72,63.72,0,0,1,96,95.92c0-34.14,27.81-62.8,61.9-63.89A64,64,0,0,1,224,98.1ZM192,76a12,12,0,1,1-12-12A12,12,0,0,1,192,76Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM180,92a16,16,0,1,1,16-16A16,16,0,0,1,180,92Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M215.15,40.85A78,78,0,0,0,86.2,121.31l-56.1,56.1a13.94,13.94,0,0,0-4.1,9.9V216a14,14,0,0,0,14,14H72a6,6,0,0,0,6-6V206H96a6,6,0,0,0,6-6V182h18a6,6,0,0,0,4.24-1.76l10.45-10.44A77.59,77.59,0,0,0,160,174h.1A78,78,0,0,0,215.15,40.85ZM226,98.16c-1.12,35.16-30.67,63.8-65.88,63.84a65.93,65.93,0,0,1-24.51-4.67,6,6,0,0,0-6.64,1.26L117.51,170H96a6,6,0,0,0-6,6v18H72a6,6,0,0,0-6,6v18H40a2,2,0,0,1-2-2V187.31a2,2,0,0,1,.58-1.41l58.83-58.83a6,6,0,0,0,1.26-6.64A65.61,65.61,0,0,1,94,95.92C94,60.71,122.68,31.16,157.83,30A66,66,0,0,1,226,98.16ZM190,76a10,10,0,1,1-10-10A10,10,0,0,1,190,76Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM224,98.1c-1.09,34.09-29.75,61.86-63.89,61.9H160a63.7,63.7,0,0,1-23.65-4.51,8,8,0,0,0-8.84,1.68L116.69,168H96a8,8,0,0,0-8,8v16H72a8,8,0,0,0-8,8v16H40V187.31l58.83-58.82a8,8,0,0,0,1.68-8.84A63.72,63.72,0,0,1,96,95.92c0-34.14,27.81-62.8,61.9-63.89A64,64,0,0,1,224,98.1ZM192,76a12,12,0,1,1-12-12A12,12,0,0,1,192,76Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.74,42.26A76,76,0,0,0,88.51,121.84l-57,57A11.93,11.93,0,0,0,28,187.31V216a12,12,0,0,0,12,12H72a4,4,0,0,0,4-4V204H96a4,4,0,0,0,4-4V180h20a4,4,0,0,0,2.83-1.17l11.33-11.34A75.72,75.72,0,0,0,160,172h.1A76,76,0,0,0,213.74,42.26Zm14.22,56c-1.15,36.22-31.6,65.72-67.87,65.77H160a67.52,67.52,0,0,1-25.21-4.83,4,4,0,0,0-4.45.83l-12,12H96a4,4,0,0,0-4,4v20H72a4,4,0,0,0-4,4v20H40a4,4,0,0,1-4-4V187.31a4.06,4.06,0,0,1,1.17-2.83L96,125.66a4,4,0,0,0,.83-4.45A67.51,67.51,0,0,1,92,95.91C92,59.64,121.55,29.19,157.77,28A68,68,0,0,1,228,98.23ZM188,76a8,8,0,1,1-8-8A8,8,0,0,1,188,76Z"}))]]),lU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,44H32A20,20,0,0,0,12,64V192a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V64A20,20,0,0,0,224,44Zm-4,144H36V68H220ZM52,128a12,12,0,0,1,12-12H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,128Zm0-36A12,12,0,0,1,64,80H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,92Zm0,72a12,12,0,0,1,12-12h8a12,12,0,0,1,0,24H64A12,12,0,0,1,52,164Zm108,0a12,12,0,0,1-12,12H108a12,12,0,0,1,0-24h40A12,12,0,0,1,160,164Zm44,0a12,12,0,0,1-12,12h-8a12,12,0,0,1,0-24h8A12,12,0,0,1,204,164Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,64V192a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H224A8,8,0,0,1,232,64Z",opacity:"0.2"}),s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM64,168H48a8,8,0,0,1,0-16H64a8,8,0,0,1,0,16Zm96,0H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm48,0H192a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50Zm2,142a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H224a2,2,0,0,1,2,2Zm-20-64a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,128Zm0-32a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,96ZM70,160a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12h8A6,6,0,0,1,70,160Zm96,0a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,160Zm40,0a6,6,0,0,1-6,6h-8a6,6,0,0,1,0-12h8A6,6,0,0,1,206,160Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,52H32A12,12,0,0,0,20,64V192a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52Zm4,140a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H224a4,4,0,0,1,4,4Zm-24-64a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,128Zm0-32a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,96ZM68,160a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8h8A4,4,0,0,1,68,160Zm96,0a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,160Zm40,0a4,4,0,0,1-4,4h-8a4,4,0,0,1,0-8h8A4,4,0,0,1,204,160Z"}))]]),cU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M219.71,117.38a12,12,0,0,0-7.25-8.52L161.28,88.39l10.59-70.61a12,12,0,0,0-20.64-10l-112,120a12,12,0,0,0,4.31,19.33l51.18,20.47L84.13,238.22a12,12,0,0,0,20.64,10l112-120A12,12,0,0,0,219.71,117.38ZM113.6,203.55l6.27-41.77a12,12,0,0,0-7.41-12.92L68.74,131.37,142.4,52.45l-6.27,41.77a12,12,0,0,0,7.41,12.92l43.72,17.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M96,240l16-80L48,136,160,16,144,96l64,24Z",opacity:"0.2"}),s.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.85,125.46l-112,120a8,8,0,0,1-13.69-7l14.66-73.33L45.19,143.49a8,8,0,0,1-3-13l112-120a8,8,0,0,1,13.69,7L153.18,90.9l57.63,21.61a8,8,0,0,1,3,12.95Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.84,118.63a6,6,0,0,0-3.73-4.25L150.88,92.17l15-75a6,6,0,0,0-10.27-5.27l-112,120a6,6,0,0,0,2.28,9.71l59.23,22.21-15,75a6,6,0,0,0,3.14,6.52A6.07,6.07,0,0,0,96,246a6,6,0,0,0,4.39-1.91l112-120A6,6,0,0,0,213.84,118.63ZM106,220.46l11.85-59.28a6,6,0,0,0-3.77-6.8l-55.6-20.85,91.46-98L138.12,94.82a6,6,0,0,0,3.77,6.8l55.6,20.85Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M211.89,119.09a4,4,0,0,0-2.49-2.84l-60.81-22.8,15.33-76.67a4,4,0,0,0-6.84-3.51l-112,120a4,4,0,0,0-1,3.64,4,4,0,0,0,2.49,2.84l60.81,22.8L92.08,239.22a4,4,0,0,0,6.84,3.51l112-120A4,4,0,0,0,211.89,119.09ZM102.68,227l13.24-66.2a4,4,0,0,0-2.52-4.53L55,134.36,153.32,29l-13.24,66.2a4,4,0,0,0,2.52,4.53L201,121.64Z"}))]]),uU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),s.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),dU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M252,120a52.06,52.06,0,0,0-52-52H160.32c-3.44-.21-52.6-4-99.46-43.3A20,20,0,0,0,28,40V200a19.8,19.8,0,0,0,11.54,18.12,19.86,19.86,0,0,0,21.32-2.81A192.92,192.92,0,0,1,144,174.47v26.2a20,20,0,0,0,8.9,16.64,11.35,11.35,0,0,0,1.39.8l14.44,7.06A20,20,0,0,0,198.37,213l11.09-41.82A52.07,52.07,0,0,0,252,120ZM52,191.63V48.4c36.17,28.07,72.17,38.1,92,41.66V150C124.17,153.52,88.17,163.55,52,191.63ZM176.39,202.2,168,198.1V172h16.4ZM200,148H168V92h32a28,28,0,1,1,0,56Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,120a40,40,0,0,1-40,40H160V80h40A40,40,0,0,1,240,120Z",opacity:"0.2"}),s.createElement("path",{d:"M248,120a48.05,48.05,0,0,0-48-48H160.2c-2.91-.17-53.62-3.74-101.91-44.24A16,16,0,0,0,32,40V200a16,16,0,0,0,26.29,12.25c37.77-31.68,77-40.76,93.71-43.3v31.72A16,16,0,0,0,159.12,214l11,7.33A16,16,0,0,0,194.5,212l11.77-44.36A48.07,48.07,0,0,0,248,120ZM48,199.93V40h0c42.81,35.91,86.63,45,104,47.24v65.48C134.65,155,90.84,164.07,48,199.93Zm131,8,0,.11-11-7.33V168h21.6ZM200,152H168V88h32a32,32,0,1,1,0,64Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,72H160.2c-2.91-.17-53.62-3.74-101.91-44.24A16,16,0,0,0,32,40V200a16,16,0,0,0,26.29,12.25c37.77-31.68,77-40.76,93.71-43.3v31.72A16,16,0,0,0,159.12,214l11,7.33A16,16,0,0,0,194.5,212l11.77-44.36A48,48,0,0,0,200,72ZM179,207.89l0,.11-11-7.33V168h21.6ZM200,152H168V88h32a32,32,0,1,1,0,64Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M246,120a46.05,46.05,0,0,0-46-46H160.15c-2.58-.15-54.1-3.57-103.15-44.71A14,14,0,0,0,34,40V200a13.85,13.85,0,0,0,8.07,12.68A14.16,14.16,0,0,0,48,214a13.9,13.9,0,0,0,9-3.3c40-33.52,81.57-42,97-44.07v34a14,14,0,0,0,6.23,11.65l11,7.33a14,14,0,0,0,21.32-8.17l12.13-45.71A46.07,46.07,0,0,0,246,120ZM49.29,201.52A2,2,0,0,1,46,200V40a1.9,1.9,0,0,1,1.15-1.8A2.08,2.08,0,0,1,48,38a1.91,1.91,0,0,1,1.26.48c44,36.92,89,45.19,104.71,47v69C138.29,156.33,93.3,164.61,49.29,201.52Zm131.64,7a2,2,0,0,1-3.05,1.18l-11-7.33a2,2,0,0,1-.89-1.67V166h26.2ZM200,154H166V86h34a34,34,0,1,1,0,68Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M248,120a48.05,48.05,0,0,0-48-48H160.2c-2.91-.17-53.62-3.74-101.91-44.24A16,16,0,0,0,32,40V200a16,16,0,0,0,26.29,12.25c37.77-31.68,77-40.76,93.71-43.3v31.72A16,16,0,0,0,159.12,214l11,7.33A16,16,0,0,0,194.5,212l11.77-44.36A48.07,48.07,0,0,0,248,120ZM48,199.93V40h0c42.81,35.91,86.63,45,104,47.24v65.48C134.65,155,90.84,164.07,48,199.93Zm131,8,0,.11-11-7.33V168h21.6ZM200,152H168V88h32a32,32,0,1,1,0,64Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,76H160.1c-2.19-.11-54.55-3.38-104.38-45.17A12,12,0,0,0,36,40V200a11.88,11.88,0,0,0,6.92,10.87A12.18,12.18,0,0,0,48,212a11.93,11.93,0,0,0,7.69-2.83c42.46-35.62,86.76-43.25,100.28-44.8v36.29a12,12,0,0,0,5.34,10l11,7.33a12,12,0,0,0,18.28-7l12.49-47.09A44,44,0,0,0,200,76Zm-44,80.3c-13.53,1.35-60,8.62-105.42,46.75A4,4,0,0,1,44,200V40a4,4,0,0,1,2.3-3.62A4.32,4.32,0,0,1,48.05,36a3.88,3.88,0,0,1,2.53,1C96,75.09,142.47,82.36,156,83.71ZM182.87,209a4,4,0,0,1-6.1,2.36l-11-7.33a4,4,0,0,1-1.78-3.33V164h30.8ZM200,156H164V84h36a36,36,0,0,1,0,72Z"}))]]),fU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H40a12,12,0,0,1,0-24H216A12,12,0,0,1,228,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H72a8,8,0,0,1,0-16H184a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H40a6,6,0,0,1,0-12H216A6,6,0,0,1,222,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H40a4,4,0,0,1,0-8H216A4,4,0,0,1,220,128Z"}))]]),hU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M160,80a32,32,0,1,0-32-32A32,32,0,0,0,160,80Zm0-40a8,8,0,1,1-8,8A8,8,0,0,1,160,40Zm94.32,153.88L199.76,101.8A19.85,19.85,0,0,0,182.55,92h0a19.83,19.83,0,0,0-17.2,9.8l-18.7,31.55-37.42-63.5a20,20,0,0,0-34.46,0L1.66,193.91A12,12,0,0,0,12,212H244a12,12,0,0,0,10.32-18.12ZM92,87.87,108.57,116H75.43ZM33,188l28.28-48h61.44L151,188Zm145.86,0L160.56,157l22-37.1L222.94,188Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M144,52a20,20,0,1,1,20,20A20,20,0,0,1,144,52Zm49.44,55.92a8,8,0,0,0-13.77,0l-33,55.75-21-35.67H50.35L8,200H248Z",opacity:"0.2"}),s.createElement("path",{d:"M164,80a28,28,0,1,0-28-28A28,28,0,0,0,164,80Zm0-40a12,12,0,1,1-12,12A12,12,0,0,1,164,40Zm90.88,155.92-54.56-92.08A15.87,15.87,0,0,0,186.55,96h0a15.85,15.85,0,0,0-13.76,7.84L146.63,148l-44.84-76.1a16,16,0,0,0-27.58,0L1.11,195.94A8,8,0,0,0,8,208H248a8,8,0,0,0,6.88-12.08ZM88,80l23.57,40H64.43ZM22,192l33-56h66l33,56Zm150.57,0-16.66-28.28L186.55,112,234,192Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M254.88,195.92l-54.56-92.08A15.87,15.87,0,0,0,186.55,96h0a15.85,15.85,0,0,0-13.76,7.84l-15.64,26.39a4,4,0,0,0,0,4.07l26.8,45.47a8.13,8.13,0,0,1-1.89,10.55,8,8,0,0,1-11.8-2.26L101.79,71.88a16,16,0,0,0-27.58,0L1.11,195.94a8,8,0,0,0,1,9.52A8.23,8.23,0,0,0,8.23,208H247.77a8.29,8.29,0,0,0,6.09-2.55A8,8,0,0,0,254.88,195.92ZM64.43,120,88,80l23.57,40ZM140,52a24,24,0,1,1,24,24A24,24,0,0,1,140,52Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164,78a26,26,0,1,0-26-26A26,26,0,0,0,164,78Zm0-40a14,14,0,1,1-14,14A14,14,0,0,1,164,38Zm89.16,158.94L198.6,104.86a13.9,13.9,0,0,0-12-6.86h0a13.88,13.88,0,0,0-12,6.86l-27.88,47.05-46.56-79a14,14,0,0,0-24.13,0L2.83,197A6,6,0,0,0,8,206H248a6,6,0,0,0,5.16-9.06ZM86.27,79a2,2,0,0,1,3.46,0l25.34,43H60.93ZM18.5,194l35.36-60h68.29l19.3,32.77,0,0,16,27.2Zm152.93,0-17.85-30.29L184.83,111a2,2,0,0,1,1.72-1,1.93,1.93,0,0,1,1.72,1l49.2,83Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164,80a28,28,0,1,0-28-28A28,28,0,0,0,164,80Zm0-40a12,12,0,1,1-12,12A12,12,0,0,1,164,40Zm90.88,155.92-54.56-92.08A15.87,15.87,0,0,0,186.55,96h0a15.85,15.85,0,0,0-13.76,7.84L146.63,148l-44.84-76.1a16,16,0,0,0-27.58,0L1.11,195.94A8,8,0,0,0,8,208H248a8,8,0,0,0,6.88-12.08ZM88,80l23.57,40H64.43ZM22,192l33-56h66l18.74,31.8,0,0L154,192Zm150.57,0-16.66-28.28L186.55,112,234,192Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164,76a24,24,0,1,0-24-24A24,24,0,0,0,164,76Zm0-40a16,16,0,1,1-16,16A16,16,0,0,1,164,36Zm87.44,162-54.56-92.08A11.91,11.91,0,0,0,186.55,100h0a11.89,11.89,0,0,0-10.32,5.88l-29.61,50L98.34,73.91a12,12,0,0,0-20.68,0L4.55,198A4,4,0,0,0,8,204H248a4,4,0,0,0,3.44-6ZM84.55,78a4,4,0,0,1,6.9,0l27.12,46H57.43ZM15,196l37.71-64h70.58L161,196Zm155.29,0-19-32.29L183.11,110a4,4,0,0,1,6.88,0l51,86Z"}))]]),pU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.6,62.64l-88-48.17a19.91,19.91,0,0,0-19.2,0l-88,48.17A20,20,0,0,0,20,80.19v95.62a20,20,0,0,0,10.4,17.55l88,48.17a19.89,19.89,0,0,0,19.2,0l88-48.17A20,20,0,0,0,236,175.81V80.19A20,20,0,0,0,225.6,62.64ZM128,36.57,200,76,178.57,87.73l-72-39.42Zm0,78.83L56,76,81.56,62l72,39.41ZM44,96.79l72,39.4v76.67L44,173.44Zm96,116.07V136.19l24-13.13V152a12,12,0,0,0,24,0V109.92l24-13.13v76.65Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,129.09V232a8,8,0,0,1-3.84-1l-88-48.18a8,8,0,0,1-4.16-7V80.18a8,8,0,0,1,.7-3.25Z",opacity:"0.2"}),s.createElement("path",{d:"M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32l80.34,44-29.77,16.3-80.35-44ZM128,120,47.66,76l33.9-18.56,80.34,44ZM40,90l80,43.78v85.79L40,175.82Zm176,85.78h0l-80,43.79V133.82l32-17.51V152a8,8,0,0,0,16,0V107.55L216,90v85.77Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32l80.35,44L178.57,92.29l-80.35-44Zm0,88L47.65,76,81.56,57.43l80.35,44Zm88,55.85h0l-80,43.79V133.83l32-17.51V152a8,8,0,0,0,16,0V107.56l32-17.51v85.76Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222.72,67.91l-88-48.18a13.9,13.9,0,0,0-13.44,0l-88,48.18A14,14,0,0,0,26,80.18v95.64a14,14,0,0,0,7.28,12.27l88,48.18a13.92,13.92,0,0,0,13.44,0l88-48.18A14,14,0,0,0,230,175.82V80.18A14,14,0,0,0,222.72,67.91ZM127,30.25a2,2,0,0,1,1.92,0L212.51,76,178.57,94.57,94.05,48.31ZM122,223,39,177.57a2,2,0,0,1-1-1.75V86.66l84,46ZM43.49,76,81.56,55.15l84.51,46.26L128,122.24ZM218,175.82a2,2,0,0,1-1,1.75h0L134,223V132.64l36-19.71V152a6,6,0,0,0,12,0V106.37l36-19.71Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32l80.34,44-29.77,16.3-80.35-44ZM128,120,47.66,76l33.9-18.56,80.34,44ZM40,90l80,43.78v85.79L40,175.82Zm176,85.78h0l-80,43.79V133.82l32-17.51V152a8,8,0,0,0,16,0V107.55L216,90v85.77Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.76,69.66l-88-48.18a12,12,0,0,0-11.52,0l-88,48.18A12,12,0,0,0,28,80.18v95.64a12,12,0,0,0,6.24,10.52l88,48.18a11.95,11.95,0,0,0,11.52,0l88-48.18A12,12,0,0,0,228,175.82V80.18A12,12,0,0,0,221.76,69.66ZM126.08,28.5a3.94,3.94,0,0,1,3.84,0L216.67,76,178.5,96.89a4,4,0,0,0-.58-.4l-88-48.18Zm1.92,96L39.33,76,81.56,52.87l88.67,48.54Zm-89.92,54.8a4,4,0,0,1-2.08-3.5V83.29l88,48.16v94.91Zm179.84,0h0l-85.92,47V131.45l40-21.89V152a4,4,0,0,0,8,0V105.18l40-21.89v92.53A4,4,0,0,1,217.92,179.32Z"}))]]),mU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M203.57,51A107.9,107.9,0,0,0,20,128c0,44.72,27.6,82.25,72,97.94A36,36,0,0,0,140,192a12,12,0,0,1,12-12h46.21a35.79,35.79,0,0,0,35.1-28A108.6,108.6,0,0,0,236,127.09,107.23,107.23,0,0,0,203.57,51Zm6.34,95.67a11.91,11.91,0,0,1-11.7,9.3H152a36,36,0,0,0-36,36,12,12,0,0,1-16,11.3c-16.65-5.88-30.65-15.76-40.48-28.56A76,76,0,0,1,44,128a84,84,0,0,1,83.13-84H128a84.35,84.35,0,0,1,84,83.29A84.72,84.72,0,0,1,209.91,146.71ZM144,76a16,16,0,1,1-16-16A16,16,0,0,1,144,76Zm-44,24A16,16,0,1,1,84,84,16,16,0,0,1,100,100Zm0,56a16,16,0,1,1-16-16A16,16,0,0,1,100,156Zm88-56a16,16,0,1,1-16-16A16,16,0,0,1,188,100Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,127.17a96.48,96.48,0,0,1-2.39,22.18A24,24,0,0,1,198.21,168H152a24,24,0,0,0-24,24,24,24,0,0,1-32,22.61C58.73,201.44,32,169.81,32,128a96,96,0,0,1,95-96C179.84,31.47,223.55,74.35,224,127.17Z",opacity:"0.2"}),s.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89ZM84,168a12,12,0,1,1,12-12A12,12,0,0,1,84,168Zm0-56a12,12,0,1,1,12-12A12,12,0,0,1,84,112Zm44-24a12,12,0,1,1,12-12A12,12,0,0,1,128,88Zm44,24a12,12,0,1,1,12-12A12,12,0,0,1,172,112Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M199.37,55.31A101.32,101.32,0,0,0,128,26h-1A102,102,0,0,0,26,128c0,42.09,26.07,77.44,68,92.26A30.21,30.21,0,0,0,104.11,222,30.06,30.06,0,0,0,134,192a18,18,0,0,1,18-18h46.21a29.82,29.82,0,0,0,29.25-23.31A102.71,102.71,0,0,0,230,127.11,101.25,101.25,0,0,0,199.37,55.31ZM215.76,148a17.89,17.89,0,0,1-17.55,14H152a30,30,0,0,0-30,30,18,18,0,0,1-24,17C61,195.86,38,164.85,38,128a90,90,0,0,1,89.07-90H128a90.34,90.34,0,0,1,90,89.22A90.46,90.46,0,0,1,215.76,148ZM138,76a10,10,0,1,1-10-10A10,10,0,0,1,138,76ZM94,100A10,10,0,1,1,84,90,10,10,0,0,1,94,100Zm0,56a10,10,0,1,1-10-10A10,10,0,0,1,94,156Zm88-56a10,10,0,1,1-10-10A10,10,0,0,1,182,100Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M198,56.74A99.31,99.31,0,0,0,128,28h-1A100,100,0,0,0,28,128c0,41.22,25.55,75.85,66.69,90.38a28.34,28.34,0,0,0,9.42,1.63A28,28,0,0,0,132,192a20,20,0,0,1,20-20h46.21a27.84,27.84,0,0,0,27.3-21.76,100.37,100.37,0,0,0,2.49-23.1A99.26,99.26,0,0,0,198,56.74Zm19.74,91.72A19.89,19.89,0,0,1,198.21,164H152a28,28,0,0,0-28,28,20,20,0,0,1-26.64,18.83C59.51,197.46,36,165.72,36,128a92,92,0,0,1,91.05-92H128a92,92,0,0,1,89.72,112.46ZM136,76a8,8,0,1,1-8-8A8,8,0,0,1,136,76ZM92,100a8,8,0,1,1-8-8A8,8,0,0,1,92,100Zm0,56a8,8,0,1,1-8-8A8,8,0,0,1,92,156Zm88-56a8,8,0,1,1-8-8A8,8,0,0,1,180,100Z"}))]]),gU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M212.48,136.49l-82.06,82a60,60,0,0,1-84.85-84.88l98.16-97.89a40,40,0,0,1,56.56,56.59l-.17.16-95.8,92.22a12,12,0,1,1-16.64-17.3l95.71-92.12a16,16,0,0,0-22.7-22.56L62.53,150.57a36,36,0,0,0,50.93,50.91l82.06-82a12,12,0,0,1,17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M180.75,104.75,204,128l-82.06,81.94a48,48,0,0,1-67.88-67.88L153.37,41.37a32,32,0,0,1,45.26,45.26Z",opacity:"0.2"}),s.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,50.34a8,8,0,0,0-11.32,0L87.09,143A24,24,0,1,0,121,177l49.32-50.32a8,8,0,1,1,11.42,11.2l-49.37,50.38a40,40,0,1,1-56.62-56.51L143,63.09A24,24,0,1,1,177,97L109.71,165.6a8,8,0,1,1-11.42-11.2L165.6,85.71a8,8,0,0,0,.06-11.37Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.25,123.76a6,6,0,0,1,0,8.49l-82.06,82a54,54,0,0,1-76.36-76.39L149.1,37.14a38,38,0,1,1,53.77,53.72L103.59,191.54a22,22,0,1,1-31.15-31.09l83.28-84.67a6,6,0,0,1,8.56,8.42L81,168.91a10,10,0,1,0,14.11,14.18L194.35,82.4a26,26,0,1,0-36.74-36.8L58.33,146.28a42,42,0,1,0,59.37,59.44l82.06-82A6,6,0,0,1,208.25,123.76Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M206.83,125.17a4,4,0,0,1,0,5.66l-82.06,82a52,52,0,0,1-73.54-73.55L150.52,38.55a36,36,0,1,1,50.94,50.9l-99.3,100.69a20,20,0,1,1-28.3-28.27l83.29-84.68a4,4,0,1,1,5.7,5.61L79.54,167.5a12,12,0,1,0,16.95,17L195.78,83.81A28,28,0,1,0,156.2,44.18L56.91,144.87a44,44,0,1,0,62.21,62.26l82-82A4,4,0,0,1,206.83,125.17Z"}))]]),vU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),s.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),wU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.15,70.54,185.46,25.86a20,20,0,0,0-28.28,0L33.86,149.17A19.86,19.86,0,0,0,28,163.31V208a20,20,0,0,0,20,20H216a12,12,0,0,0,0-24H125L230.15,98.83A20,20,0,0,0,230.15,70.54ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),s.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM48,163.31l88-88L180.69,120l-88,88H48Zm144-54.62L147.32,64l24-24L216,84.69Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM192,108.69,147.32,64l24-24L216,84.69Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.91,74.79,181.22,30.1a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H216a6,6,0,0,0,0-12H110.49L225.91,94.59A14,14,0,0,0,225.91,74.79ZM93.52,210H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.49,183.52,120ZM217.42,86.1,192,111.52,144.49,64,169.9,38.59a2,2,0,0,1,2.83,0l44.69,44.68A2,2,0,0,1,217.42,86.1Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.69,147.32,64l24-24L216,84.69Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L39.51,154.83A12,12,0,0,0,36,163.31V208a12,12,0,0,0,12,12H216a4,4,0,0,0,0-8H105.66L224.49,93.17A12,12,0,0,0,224.49,76.2ZM94.34,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.82L136,69.66,186.35,120ZM218.83,87.51,192,114.34,141.66,64l26.83-26.83a4,4,0,0,1,5.66,0l44.68,44.69A4,4,0,0,1,218.83,87.51Z"}))]]),yU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]),bU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm52-84a12,12,0,0,1-12,12H140v28a12,12,0,0,1-24,0V140H88a12,12,0,0,1,0-24h28V88a12,12,0,0,1,24,0v28h28A12,12,0,0,1,180,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32A8,8,0,0,1,176,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.13,104.13,0,0,0,128,24Zm40,112H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm46-90a6,6,0,0,1-6,6H134v34a6,6,0,0,1-12,0V134H88a6,6,0,0,1,0-12h34V88a6,6,0,0,1,12,0v34h34A6,6,0,0,1,174,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32A8,8,0,0,1,176,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm44-92a4,4,0,0,1-4,4H132v36a4,4,0,0,1-8,0V132H88a4,4,0,0,1,0-8h36V88a4,4,0,0,1,8,0v36h36A4,4,0,0,1,172,128Z"}))]]),xU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M116,128V48a12,12,0,0,1,24,0v80a12,12,0,0,1-24,0Zm66.55-82a12,12,0,0,0-13.1,20.1C191.41,80.37,204,103,204,128a76,76,0,0,1-152,0c0-25,12.59-47.63,34.55-61.95A12,12,0,0,0,73.45,46C44.56,64.78,28,94.69,28,128a100,100,0,0,0,200,0C228,94.69,211.44,64.78,182.55,46Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),s.createElement("path",{d:"M120,128V48a8,8,0,0,1,16,0v80a8,8,0,0,1-16,0Zm60.37-78.7a8,8,0,0,0-8.74,13.4C194.74,77.77,208,101.57,208,128a80,80,0,0,1-160,0c0-26.43,13.26-50.23,36.37-65.3a8,8,0,0,0-8.74-13.4C47.9,67.38,32,96.06,32,128a96,96,0,0,0,192,0C224,96.06,208.1,67.38,180.37,49.3Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104,104,0,0,0,128,24Zm-8,40a8,8,0,0,1,16,0v64a8,8,0,0,1-16,0Zm8,144A80,80,0,0,1,83.55,61.48a8,8,0,1,1,8.9,13.29,64,64,0,1,0,71.1,0,8,8,0,1,1,8.9-13.29A80,80,0,0,1,128,208Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M122,128V48a6,6,0,0,1,12,0v80a6,6,0,0,1-12,0Zm57.28-77A6,6,0,0,0,172.72,61C196.41,76.47,210,100.88,210,128a82,82,0,0,1-164,0c0-27.12,13.59-51.53,37.28-67A6,6,0,0,0,76.72,51C49.57,68.68,34,96.75,34,128a94,94,0,0,0,188,0C222,96.75,206.43,68.68,179.28,51Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M120,128V48a8,8,0,0,1,16,0v80a8,8,0,0,1-16,0Zm60.37-78.7a8,8,0,0,0-8.74,13.4C194.74,77.77,208,101.57,208,128a80,80,0,0,1-160,0c0-26.43,13.26-50.23,36.37-65.3a8,8,0,0,0-8.74-13.4C47.9,67.38,32,96.06,32,128a96,96,0,0,0,192,0C224,96.06,208.1,67.38,180.37,49.3Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M124,128V48a4,4,0,0,1,8,0v80a4,4,0,0,1-8,0Zm54.18-75.35a4,4,0,1,0-4.36,6.7C198.08,75.17,212,100.2,212,128a84,84,0,0,1-168,0c0-27.8,13.92-52.83,38.18-68.65a4,4,0,0,0-4.36-6.7C51.24,70,36,97.44,36,128a92,92,0,0,0,184,0C220,97.44,204.76,70,178.18,52.65Z"}))]]),kU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M144,180a16,16,0,1,1-16-16A16,16,0,0,1,144,180Zm92-52A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128ZM128,64c-24.26,0-44,17.94-44,40v4a12,12,0,0,0,24,0v-4c0-8.82,9-16,20-16s20,7.18,20,16-9,16-20,16a12,12,0,0,0-12,12v8a12,12,0,0,0,23.73,2.56C158.31,137.88,172,122.37,172,104,172,81.94,152.26,64,128,64Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,168a12,12,0,1,1,12-12A12,12,0,0,1,128,192Zm8-48.72V144a8,8,0,0,1-16,0v-8a8,8,0,0,1,8-8c13.23,0,24-9,24-20s-10.77-20-24-20-24,9-24,20v4a8,8,0,0,1-16,0v-4c0-19.85,17.94-36,40-36s40,16.15,40,36C168,125.38,154.24,139.93,136,143.28Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M138,180a10,10,0,1,1-10-10A10,10,0,0,1,138,180ZM128,74c-21,0-38,15.25-38,34v4a6,6,0,0,0,12,0v-4c0-12.13,11.66-22,26-22s26,9.87,26,22-11.66,22-26,22a6,6,0,0,0-6,6v8a6,6,0,0,0,12,0v-2.42c18.11-2.58,32-16.66,32-33.58C166,89.25,149,74,128,74Zm102,54A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M136,180a8,8,0,1,1-8-8A8,8,0,0,1,136,180ZM128,76c-19.85,0-36,14.36-36,32v4a4,4,0,0,0,8,0v-4c0-13.23,12.56-24,28-24s28,10.77,28,24-12.56,24-28,24a4,4,0,0,0-4,4v8a4,4,0,0,0,8,0v-4.2c18-1.77,32-15.36,32-31.8C164,90.36,147.85,76,128,76Zm100,52A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),SU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H88V56H216V200Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z"}))]]),EU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M40,92H70.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24H137.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24Zm64-24A12,12,0,1,1,92,80,12,12,0,0,1,104,68Zm112,96H201.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24h94.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24Zm-48,24a12,12,0,1,1,12-12A12,12,0,0,1,168,188Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,80a24,24,0,1,1-24-24A24,24,0,0,1,128,80Zm40,72a24,24,0,1,0,24,24A24,24,0,0,0,168,152Z",opacity:"0.2"}),s.createElement("path",{d:"M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M32,80a8,8,0,0,1,8-8H77.17a28,28,0,0,1,53.66,0H216a8,8,0,0,1,0,16H130.83a28,28,0,0,1-53.66,0H40A8,8,0,0,1,32,80Zm184,88H194.83a28,28,0,0,0-53.66,0H40a8,8,0,0,0,0,16H141.17a28,28,0,0,0,53.66,0H216a8,8,0,0,0,0-16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M40,86H74.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12H133.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12Zm64-24A18,18,0,1,1,86,80,18,18,0,0,1,104,62ZM216,170H197.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12h98.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12Zm-48,24a18,18,0,1,1,18-18A18,18,0,0,1,168,194Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M40,84H76.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8H131.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8Zm64-24A20,20,0,1,1,84,80,20,20,0,0,1,104,60ZM216,172H195.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8H140.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8Zm-48,24a20,20,0,1,1,20-20A20,20,0,0,1,168,196Z"}))]]),CU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M234.36,170A12,12,0,0,1,230,186.37l-96,56a12,12,0,0,1-12.1,0l-96-56a12,12,0,0,1,12.09-20.74l90,52.48L218,165.63A12,12,0,0,1,234.36,170ZM218,117.63,128,170.11,38.05,117.63A12,12,0,0,0,26,138.37l96,56a12,12,0,0,0,12.1,0l96-56A12,12,0,0,0,218,117.63ZM20,80a12,12,0,0,1,6-10.37l96-56a12.06,12.06,0,0,1,12.1,0l96,56a12,12,0,0,1,0,20.74l-96,56a12,12,0,0,1-12.1,0l-96-56A12,12,0,0,1,20,80Zm35.82,0L128,122.11,200.18,80,128,37.89Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,80l-96,56L32,80l96-56Z",opacity:"0.2"}),s.createElement("path",{d:"M230.91,172A8,8,0,0,1,228,182.91l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,36,169.09l92,53.65,92-53.65A8,8,0,0,1,230.91,172ZM220,121.09l-92,53.65L36,121.09A8,8,0,0,0,28,134.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,121.09ZM24,80a8,8,0,0,1,4-6.91l96-56a8,8,0,0,1,8.06,0l96,56a8,8,0,0,1,0,13.82l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,24,80Zm23.88,0L128,126.74,208.12,80,128,33.26Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,169.09l-92,53.65L36,169.09A8,8,0,0,0,28,182.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,169.09Z"}),s.createElement("path",{d:"M220,121.09l-92,53.65L36,121.09A8,8,0,0,0,28,134.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,121.09Z"}),s.createElement("path",{d:"M28,86.91l96,56a8,8,0,0,0,8.06,0l96-56a8,8,0,0,0,0-13.82l-96-56a8,8,0,0,0-8.06,0l-96,56a8,8,0,0,0,0,13.82Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.18,173a6,6,0,0,1-2.16,8.2l-96,56a6,6,0,0,1-6,0l-96-56a6,6,0,0,1,6-10.36l93,54.23,93-54.23A6,6,0,0,1,229.18,173ZM221,122.82l-93,54.23L35,122.82a6,6,0,0,0-6,10.36l96,56a6,6,0,0,0,6,0l96-56a6,6,0,0,0-6-10.36ZM26,80a6,6,0,0,1,3-5.18l96-56a6,6,0,0,1,6,0l96,56a6,6,0,0,1,0,10.36l-96,56a6,6,0,0,1-6,0l-96-56A6,6,0,0,1,26,80Zm17.91,0L128,129.05,212.09,80,128,31Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.91,172A8,8,0,0,1,228,182.91l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,36,169.09l92,53.65,92-53.65A8,8,0,0,1,230.91,172ZM220,121.09l-92,53.65L36,121.09A8,8,0,0,0,28,134.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,121.09ZM24,80a8,8,0,0,1,4-6.91l96-56a8,8,0,0,1,8.06,0l96,56a8,8,0,0,1,0,13.82l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,24,80Zm23.88,0L128,126.74,208.12,80,128,33.26Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.45,174a4,4,0,0,1-1.44,5.48l-96,56a4,4,0,0,1-4,0l-96-56a4,4,0,0,1,4-6.92l94,54.83,94-54.83A4,4,0,0,1,227.45,174ZM222,124.54l-94,54.83L34,124.54a4,4,0,0,0-4,6.92l96,56a4,4,0,0,0,4,0l96-56a4,4,0,0,0-4-6.92ZM28,80a4,4,0,0,1,2-3.46l96-56a4,4,0,0,1,4,0l96,56a4,4,0,0,1,0,6.92l-96,56a4,4,0,0,1-4,0l-96-56A4,4,0,0,1,28,80Zm11.94,0L128,131.37,216.06,80,128,28.63Z"}))]]),jU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M243,96a20.33,20.33,0,0,0-17.74-14l-56.59-4.57L146.83,24.62a20.36,20.36,0,0,0-37.66,0L87.35,77.44,30.76,82A20.45,20.45,0,0,0,19.1,117.88l43.18,37.24-13.2,55.7A20.37,20.37,0,0,0,79.57,233L128,203.19,176.43,233a20.39,20.39,0,0,0,30.49-22.15l-13.2-55.7,43.18-37.24A20.43,20.43,0,0,0,243,96ZM172.53,141.7a12,12,0,0,0-3.84,11.86L181.58,208l-47.29-29.08a12,12,0,0,0-12.58,0L74.42,208l12.89-54.4a12,12,0,0,0-3.84-11.86L41.2,105.24l55.4-4.47a12,12,0,0,0,10.13-7.38L128,41.89l21.27,51.5a12,12,0,0,0,10.13,7.38l55.4,4.47Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.06,108.79l-48.7,42,14.88,62.79a8.4,8.4,0,0,1-12.52,9.17L128,189.09,73.28,222.74a8.4,8.4,0,0,1-12.52-9.17l14.88-62.79-48.7-42A8.46,8.46,0,0,1,31.73,94L95.64,88.8l24.62-59.6a8.36,8.36,0,0,1,15.48,0l24.62,59.6L224.27,94A8.46,8.46,0,0,1,229.06,108.79Z",opacity:"0.2"}),s.createElement("path",{d:"M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M234.29,114.85l-45,38.83L203,211.75a16.4,16.4,0,0,1-24.5,17.82L128,198.49,77.47,229.57A16.4,16.4,0,0,1,53,211.75l13.76-58.07-45-38.83A16.46,16.46,0,0,1,31.08,86l59-4.76,22.76-55.08a16.36,16.36,0,0,1,30.27,0l22.75,55.08,59,4.76a16.46,16.46,0,0,1,9.37,28.86Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M237.28,97.87A14.18,14.18,0,0,0,224.76,88l-60.25-4.87-23.22-56.2a14.37,14.37,0,0,0-26.58,0L91.49,83.11,31.24,88a14.18,14.18,0,0,0-12.52,9.89A14.43,14.43,0,0,0,23,113.32L69,152.93l-14,59.25a14.4,14.4,0,0,0,5.59,15,14.1,14.1,0,0,0,15.91.6L128,196.12l51.58,31.71a14.1,14.1,0,0,0,15.91-.6,14.4,14.4,0,0,0,5.59-15l-14-59.25L233,113.32A14.43,14.43,0,0,0,237.28,97.87Zm-12.14,6.37-48.69,42a6,6,0,0,0-1.92,5.92l14.88,62.79a2.35,2.35,0,0,1-.95,2.57,2.24,2.24,0,0,1-2.6.1L131.14,184a6,6,0,0,0-6.28,0L70.14,217.61a2.24,2.24,0,0,1-2.6-.1,2.35,2.35,0,0,1-1-2.57l14.88-62.79a6,6,0,0,0-1.92-5.92l-48.69-42a2.37,2.37,0,0,1-.73-2.65,2.28,2.28,0,0,1,2.07-1.65l63.92-5.16a6,6,0,0,0,5.06-3.69l24.63-59.6a2.35,2.35,0,0,1,4.38,0l24.63,59.6a6,6,0,0,0,5.06,3.69l63.92,5.16a2.28,2.28,0,0,1,2.07,1.65A2.37,2.37,0,0,1,225.14,104.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M235.36,98.49A12.21,12.21,0,0,0,224.59,90l-61.47-5L139.44,27.67a12.37,12.37,0,0,0-22.88,0L92.88,85,31.41,90a12.45,12.45,0,0,0-7.07,21.84l46.85,40.41L56.87,212.64a12.35,12.35,0,0,0,18.51,13.49L128,193.77l52.62,32.36a12.12,12.12,0,0,0,13.69-.51,12.28,12.28,0,0,0,4.82-13l-14.32-60.42,46.85-40.41A12.29,12.29,0,0,0,235.36,98.49Zm-8.93,7.26-48.68,42a4,4,0,0,0-1.28,3.95l14.87,62.79a4.37,4.37,0,0,1-1.72,4.65,4.24,4.24,0,0,1-4.81.18L130.1,185.67a4,4,0,0,0-4.2,0L71.19,219.32a4.24,4.24,0,0,1-4.81-.18,4.37,4.37,0,0,1-1.72-4.65L79.53,151.7a4,4,0,0,0-1.28-3.95l-48.68-42A4.37,4.37,0,0,1,28.25,101a4.31,4.31,0,0,1,3.81-3L96,92.79a4,4,0,0,0,3.38-2.46L124,30.73a4.35,4.35,0,0,1,8.08,0l24.62,59.6A4,4,0,0,0,160,92.79l63.9,5.15a4.31,4.31,0,0,1,3.81,3A4.37,4.37,0,0,1,226.43,105.75Z"}))]]),AU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M236,96a12,12,0,0,0-.44-3.3L221.2,42.51A20.08,20.08,0,0,0,202,28H54A20.08,20.08,0,0,0,34.8,42.51L20.46,92.7A12,12,0,0,0,20,96h0v16a43.94,43.94,0,0,0,16,33.92V216a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V145.92A43.94,43.94,0,0,0,236,112V96ZM57.05,52H199l9.14,32H47.91Zm91,56v4a20,20,0,0,1-40,0v-4ZM53,128.71A20,20,0,0,1,44,112v-4H84v4a20,20,0,0,1-20,20,19.76,19.76,0,0,1-9.07-2.2A11.54,11.54,0,0,0,53,128.71ZM196,204H60V155.81c1.32.12,2.65.19,4,.19a43.86,43.86,0,0,0,32-13.85,43.89,43.89,0,0,0,64,0A43.86,43.86,0,0,0,192,156c1.35,0,2.68-.07,4-.19Zm16-92a20,20,0,0,1-9,16.71,11.66,11.66,0,0,0-1.88,1.09A20,20,0,0,1,172,112v-4h40Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,96v16a32,32,0,0,1-64,0V96H96v16a32,32,0,0,1-64,0V96L46.34,45.8A8,8,0,0,1,54,40H202a8,8,0,0,1,7.69,5.8Z",opacity:"0.2"}),s.createElement("path",{d:"M231.69,93.81,217.35,43.6A16.07,16.07,0,0,0,202,32H54A16.07,16.07,0,0,0,38.65,43.6L24.31,93.81A7.94,7.94,0,0,0,24,96v16a40,40,0,0,0,16,32v72a8,8,0,0,0,8,8H208a8,8,0,0,0,8-8V144a40,40,0,0,0,16-32V96A7.94,7.94,0,0,0,231.69,93.81ZM54,48H202l11.42,40H42.61Zm98,56v8a24,24,0,0,1-48,0v-8ZM51.06,132.2A24,24,0,0,1,40,112v-8H88v8a24,24,0,0,1-35.12,21.26A7.88,7.88,0,0,0,51.06,132.2ZM200,208H56V151.2a40.57,40.57,0,0,0,8,.8,40,40,0,0,0,32-16,40,40,0,0,0,64,0,40,40,0,0,0,32,16,40.57,40.57,0,0,0,8-.8Zm16-96a24,24,0,0,1-11.07,20.2,8.08,8.08,0,0,0-1.8,1.05A24,24,0,0,1,168,112v-8h48Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M231.69,93.81,217.35,43.6A16.07,16.07,0,0,0,202,32H54A16.07,16.07,0,0,0,38.65,43.6L24.31,93.81A7.94,7.94,0,0,0,24,96v16a40,40,0,0,0,16,32v72a8,8,0,0,0,8,8H208a8,8,0,0,0,8-8V144a40,40,0,0,0,16-32V96A7.94,7.94,0,0,0,231.69,93.81ZM88,112a24,24,0,0,1-35.12,21.26,7.88,7.88,0,0,0-1.82-1.06A24,24,0,0,1,40,112v-8H88Zm64,0a24,24,0,0,1-48,0v-8h48Zm64,0a24,24,0,0,1-11.07,20.2,8.08,8.08,0,0,0-1.8,1.05A24,24,0,0,1,168,112v-8h48Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M26.22,94.41A6,6,0,0,0,26,96v16A38,38,0,0,0,42,143V216a6,6,0,0,0,6,6H208a6,6,0,0,0,6-6V143A38,38,0,0,0,230,112V96a5.91,5.91,0,0,0-.23-1.64L215.43,44.15A14.07,14.07,0,0,0,202,34H54A14.07,14.07,0,0,0,40.57,44.15Zm25.89-47A2,2,0,0,1,54,46H202a2,2,0,0,1,1.92,1.45L216.05,90H40ZM102,102h52v10a26,26,0,0,1-52,0Zm-64,0H90v10a26,26,0,0,1-38.18,23,6,6,0,0,0-1.65-1A26,26,0,0,1,38,112ZM202,210H54V148.66a38,38,0,0,0,42-16.21,37.95,37.95,0,0,0,64,0,38,38,0,0,0,42,16.21Zm3.83-76a6,6,0,0,0-1.65,1A26,26,0,0,1,166,112V102h52v10A26,26,0,0,1,205.83,134Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,96a7.89,7.89,0,0,0-.3-2.2L217.35,43.6A16.07,16.07,0,0,0,202,32H54A16.07,16.07,0,0,0,38.65,43.6L24.31,93.8A7.89,7.89,0,0,0,24,96h0v16a40,40,0,0,0,16,32v72a8,8,0,0,0,8,8H208a8,8,0,0,0,8-8V144a40,40,0,0,0,16-32V96ZM54,48H202l11.42,40H42.61Zm50,56h48v8a24,24,0,0,1-48,0Zm-16,0v8a24,24,0,0,1-35.12,21.26,7.88,7.88,0,0,0-1.82-1.06A24,24,0,0,1,40,112v-8ZM200,208H56V151.2a40.57,40.57,0,0,0,8,.8,40,40,0,0,0,32-16,40,40,0,0,0,64,0,40,40,0,0,0,32,16,40.57,40.57,0,0,0,8-.8Zm4.93-75.8a8.08,8.08,0,0,0-1.8,1.05A24,24,0,0,1,168,112v-8h48v8A24,24,0,0,1,204.93,132.2Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M28.15,95A3.81,3.81,0,0,0,28,96v16a36,36,0,0,0,16,29.92V216a4,4,0,0,0,4,4H208a4,4,0,0,0,4-4V141.92A36,36,0,0,0,228,112V96a3.81,3.81,0,0,0-.17-1.08L213.5,44.7A12,12,0,0,0,202,36H54A12,12,0,0,0,42.5,44.7Zm22-48.08A4,4,0,0,1,54,44H202a4,4,0,0,1,3.84,2.9L218.7,92H37.3ZM100,100h56v12a28,28,0,0,1-56,0ZM36,112V100H92v12a28,28,0,0,1-41.37,24.59,4,4,0,0,0-1.31-.76A28,28,0,0,1,36,112ZM204,212H52V145.94a36,36,0,0,0,44-17.48,36,36,0,0,0,64,0,36,36,0,0,0,44,17.48Zm2.68-76.17a3.94,3.94,0,0,0-1.3.76A28,28,0,0,1,164,112V100h56v12A28,28,0,0,1,206.68,135.83Z"}))]]),NU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,148H203.89c.07-1.33.11-2.66.11-4a76,76,0,0,0-152,0c0,1.34,0,2.67.11,4H16a12,12,0,0,0,0,24H240a12,12,0,0,0,0-24ZM76,144a52,52,0,0,1,104,0c0,1.34-.07,2.67-.17,4H76.17C76.07,146.67,76,145.34,76,144Zm144,56a12,12,0,0,1-12,12H48a12,12,0,0,1,0-24H208A12,12,0,0,1,220,200ZM12.62,92.21a12,12,0,0,1,15.17-7.59l12,4a12,12,0,1,1-7.58,22.77l-12-4A12,12,0,0,1,12.62,92.21Zm56-48.41a12,12,0,1,1,22.76-7.59l4,12A12,12,0,1,1,72.62,55.8Zm140,60a12,12,0,0,1,7.59-15.18l12-4a12,12,0,0,1,7.58,22.77l-12,4a12,12,0,0,1-15.17-7.59Zm-48-55.59,4-12a12,12,0,1,1,22.76,7.59l-4,12a12,12,0,1,1-22.76-7.59Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,144a64.33,64.33,0,0,1-2,16H66a64,64,0,1,1,126-16Z",opacity:"0.2"}),s.createElement("path",{d:"M240,152H199.55a73.54,73.54,0,0,0,.45-8,72,72,0,0,0-144,0,73.54,73.54,0,0,0,.45,8H16a8,8,0,0,0,0,16H240a8,8,0,0,0,0-16ZM72,144a56,56,0,1,1,111.41,8H72.59A56.13,56.13,0,0,1,72,144Zm144,56a8,8,0,0,1-8,8H48a8,8,0,0,1,0-16H208A8,8,0,0,1,216,200ZM72.84,43.58a8,8,0,0,1,14.32-7.16l8,16a8,8,0,0,1-14.32,7.16Zm-56,48.84a8,8,0,0,1,10.74-3.57l16,8a8,8,0,0,1-7.16,14.31l-16-8A8,8,0,0,1,16.84,92.42Zm192,15.16a8,8,0,0,1,3.58-10.73l16-8a8,8,0,1,1,7.16,14.31l-16,8a8,8,0,0,1-10.74-3.58Zm-48-55.16,8-16a8,8,0,0,1,14.32,7.16l-8,16a8,8,0,1,1-14.32-7.16Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M248,160a8,8,0,0,1-8,8H16a8,8,0,0,1,0-16H56.45a73.54,73.54,0,0,1-.45-8,72,72,0,0,1,144,0,73.54,73.54,0,0,1-.45,8H240A8,8,0,0,1,248,160Zm-40,32H48a8,8,0,0,0,0,16H208a8,8,0,0,0,0-16ZM80.84,59.58a8,8,0,0,0,14.32-7.16l-8-16a8,8,0,0,0-14.32,7.16ZM20.42,103.16l16,8a8,8,0,1,0,7.16-14.31l-16-8a8,8,0,1,0-7.16,14.31ZM216,112a8,8,0,0,0,3.57-.84l16-8a8,8,0,1,0-7.16-14.31l-16,8A8,8,0,0,0,216,112ZM164.42,63.16a8,8,0,0,0,10.74-3.58l8-16a8,8,0,0,0-14.32-7.16l-8,16A8,8,0,0,0,164.42,63.16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,154H197.28a70.91,70.91,0,0,0,.72-10,70,70,0,0,0-140,0,70.91,70.91,0,0,0,.72,10H16a6,6,0,0,0,0,12H240a6,6,0,0,0,0-12ZM70,144a58,58,0,1,1,115.13,10H70.87A58.63,58.63,0,0,1,70,144Zm144,56a6,6,0,0,1-6,6H48a6,6,0,0,1,0-12H208A6,6,0,0,1,214,200ZM74.63,42.69a6,6,0,0,1,10.74-5.37l8,16a6,6,0,0,1-10.74,5.36Zm-56,50.63a6,6,0,0,1,8.05-2.69l16,8a6,6,0,0,1-5.36,10.74l-16-8A6,6,0,0,1,18.63,93.32Zm192,13.36a6,6,0,0,1,2.69-8.05l16-8a6,6,0,1,1,5.36,10.74l-16,8a6,6,0,0,1-8.05-2.69Zm-48-53.36,8-16a6,6,0,0,1,10.74,5.37l-8,16a6,6,0,1,1-10.74-5.36Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,152H199.55a73.54,73.54,0,0,0,.45-8,72,72,0,0,0-144,0,73.54,73.54,0,0,0,.45,8H16a8,8,0,0,0,0,16H240a8,8,0,0,0,0-16ZM72,144a56,56,0,1,1,111.41,8H72.59A56.13,56.13,0,0,1,72,144Zm144,56a8,8,0,0,1-8,8H48a8,8,0,0,1,0-16H208A8,8,0,0,1,216,200ZM72.84,43.58a8,8,0,0,1,14.32-7.16l8,16a8,8,0,0,1-14.32,7.16Zm-56,48.84a8,8,0,0,1,10.74-3.57l16,8a8,8,0,0,1-7.16,14.31l-16-8A8,8,0,0,1,16.84,92.42Zm192,15.16a8,8,0,0,1,3.58-10.73l16-8a8,8,0,1,1,7.16,14.31l-16,8a8,8,0,0,1-10.74-3.58Zm-48-55.16,8-16a8,8,0,0,1,14.32,7.16l-8,16a8,8,0,1,1-14.32-7.16Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,156H194.94A68,68,0,1,0,60,144a68.73,68.73,0,0,0,1.06,12H16a4,4,0,0,0,0,8H240a4,4,0,0,0,0-8ZM68,144a60,60,0,1,1,118.79,12H69.21A60.16,60.16,0,0,1,68,144Zm144,56a4,4,0,0,1-4,4H48a4,4,0,0,1,0-8H208A4,4,0,0,1,212,200ZM76.42,41.79a4,4,0,0,1,7.16-3.58l8,16a4,4,0,0,1-7.16,3.58Zm-56,52.42a4,4,0,0,1,5.37-1.79l16,8a4,4,0,0,1-3.58,7.16l-16-8A4,4,0,0,1,20.42,94.21Zm192,11.58a4,4,0,0,1,1.79-5.37l16-8a4,4,0,1,1,3.58,7.16l-16,8a4,4,0,0,1-5.37-1.79Zm-48-51.58,8-16a4,4,0,1,1,7.16,3.58l-8,16a4,4,0,0,1-7.16-3.58Z"}))]]),MU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),s.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),RU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM188,204H68V72H188ZM76,20A12,12,0,0,1,88,8h80a12,12,0,0,1,0,24H88A12,12,0,0,1,76,20Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),s.createElement("path",{d:"M216,48H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM192,208H64V64H192ZM80,24a8,8,0,0,1,8-8h80a8,8,0,0,1,0,16H88A8,8,0,0,1,80,24Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,56a8,8,0,0,1-8,8h-8V208a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V64H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,56ZM88,32h80a8,8,0,0,0,0-16H88a8,8,0,0,0,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM82,24a6,6,0,0,1,6-6h80a6,6,0,0,1,0,12H88A6,6,0,0,1,82,24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM192,208H64V64H192ZM80,24a8,8,0,0,1,8-8h80a8,8,0,0,1,0,16H88A8,8,0,0,1,80,24Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM84,24a4,4,0,0,1,4-4h80a4,4,0,0,1,0,8H88A4,4,0,0,1,84,24Z"}))]]),PU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0ZM96.49,80.49,116,61v83a12,12,0,0,0,24,0V61l19.51,19.52a12,12,0,1,0,17-17l-40-40a12,12,0,0,0-17,0l-40,40a12,12,0,1,0,17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z",opacity:"0.2"}),s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM93.66,77.66,120,51.31V144a8,8,0,0,0,16,0V51.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,77.66Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM88,80h32v64a8,8,0,0,0,16,0V80h32a8,8,0,0,0,5.66-13.66l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,88,80Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0ZM92.24,76.24,122,46.49V144a6,6,0,0,0,12,0V46.49l29.76,29.75a6,6,0,0,0,8.48-8.48l-40-40a6,6,0,0,0-8.48,0l-40,40a6,6,0,0,0,8.48,8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM93.66,77.66,120,51.31V144a8,8,0,0,0,16,0V51.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,77.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0ZM90.83,74.83,124,41.66V144a4,4,0,0,0,8,0V41.66l33.17,33.17a4,4,0,1,0,5.66-5.66l-40-40a4,4,0,0,0-5.66,0l-40,40a4,4,0,0,0,5.66,5.66Z"}))]]),LU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M234.38,210a123.36,123.36,0,0,0-60.78-53.23,76,76,0,1,0-91.2,0A123.36,123.36,0,0,0,21.62,210a12,12,0,1,0,20.77,12c18.12-31.32,50.12-50,85.61-50s67.49,18.69,85.61,50a12,12,0,0,0,20.77-12ZM76,96a52,52,0,1,1,52,52A52.06,52.06,0,0,1,76,96Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,96a64,64,0,1,1-64-64A64,64,0,0,1,192,96Z",opacity:"0.2"}),s.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.93,220a8,8,0,0,1-6.93,4H32a8,8,0,0,1-6.92-12c15.23-26.33,38.7-45.21,66.09-54.16a72,72,0,1,1,73.66,0c27.39,8.95,50.86,27.83,66.09,54.16A8,8,0,0,1,230.93,220Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.19,213c-15.81-27.32-40.63-46.49-69.47-54.62a70,70,0,1,0-63.44,0C67.44,166.5,42.62,185.67,26.81,213a6,6,0,1,0,10.38,6C56.4,185.81,90.34,166,128,166s71.6,19.81,90.81,53a6,6,0,1,0,10.38-6ZM70,96a58,58,0,1,1,58,58A58.07,58.07,0,0,1,70,96Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.46,214c-16.52-28.56-43-48.06-73.68-55.09a68,68,0,1,0-51.56,0c-30.64,7-57.16,26.53-73.68,55.09a4,4,0,0,0,6.92,4C55,184.19,89.62,164,128,164s73,20.19,92.54,54a4,4,0,0,0,3.46,2,3.93,3.93,0,0,0,2-.54A4,4,0,0,0,227.46,214ZM68,96a60,60,0,1,1,60,60A60.07,60.07,0,0,1,68,96Z"}))]]),TU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20ZM79.57,196.57a60,60,0,0,1,96.86,0,83.72,83.72,0,0,1-96.86,0ZM100,120a28,28,0,1,1,28,28A28,28,0,0,1,100,120ZM194,179.94a83.48,83.48,0,0,0-29-23.42,52,52,0,1,0-74,0,83.48,83.48,0,0,0-29,23.42,84,84,0,1,1,131.9,0Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a95.76,95.76,0,0,1-31.8,71.37A72,72,0,0,0,128,160a40,40,0,1,0-40-40,40,40,0,0,0,40,40,72,72,0,0,0-64.2,39.37h0A96,96,0,1,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM74.08,197.5a64,64,0,0,1,107.84,0,87.83,87.83,0,0,1-107.84,0ZM96,120a32,32,0,1,1,32,32A32,32,0,0,1,96,120Zm97.76,66.41a79.66,79.66,0,0,0-36.06-28.75,48,48,0,1,0-59.4,0,79.66,79.66,0,0,0-36.06,28.75,88,88,0,1,1,131.52,0Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M172,120a44,44,0,1,1-44-44A44.05,44.05,0,0,1,172,120Zm60,8A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88.09,88.09,0,0,0-91.47-87.93C77.43,41.89,39.87,81.12,40,128.25a87.65,87.65,0,0,0,22.24,58.16A79.71,79.71,0,0,1,84,165.1a4,4,0,0,1,4.83.32,59.83,59.83,0,0,0,78.28,0,4,4,0,0,1,4.83-.32,79.71,79.71,0,0,1,21.79,21.31A87.62,87.62,0,0,0,216,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26ZM71.44,198a66,66,0,0,1,113.12,0,89.8,89.8,0,0,1-113.12,0ZM94,120a34,34,0,1,1,34,34A34,34,0,0,1,94,120Zm99.51,69.64a77.53,77.53,0,0,0-40-31.38,46,46,0,1,0-51,0,77.53,77.53,0,0,0-40,31.38,90,90,0,1,1,131,0Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM74.08,197.5a64,64,0,0,1,107.84,0,87.83,87.83,0,0,1-107.84,0ZM96,120a32,32,0,1,1,32,32A32,32,0,0,1,96,120Zm97.76,66.41a79.66,79.66,0,0,0-36.06-28.75,48,48,0,1,0-59.4,0,79.66,79.66,0,0,0-36.06,28.75,88,88,0,1,1,131.52,0Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28ZM68.87,198.42a68,68,0,0,1,118.26,0,91.8,91.8,0,0,1-118.26,0Zm124.3-5.55a75.61,75.61,0,0,0-44.51-34,44,44,0,1,0-41.32,0,75.61,75.61,0,0,0-44.51,34,92,92,0,1,1,130.34,0ZM128,156a36,36,0,1,1,36-36A36,36,0,0,1,128,156Z"}))]]),$U=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M256,136a12,12,0,0,1-12,12h-8v8a12,12,0,0,1-24,0v-8h-8a12,12,0,0,1,0-24h8v-8a12,12,0,0,1,24,0v8h8A12,12,0,0,1,256,136Zm-54.81,56.28a12,12,0,1,1-18.38,15.44C169.12,191.42,145,172,108,172c-28.89,0-55.46,12.68-74.81,35.72a12,12,0,0,1-18.38-15.44A124.08,124.08,0,0,1,63.5,156.53a72,72,0,1,1,89,0A124,124,0,0,1,201.19,192.28ZM108,148a48,48,0,1,0-48-48A48.05,48.05,0,0,0,108,148Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z",opacity:"0.2"}),s.createElement("path",{d:"M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136ZM144,157.68a68,68,0,1,0-71.9,0c-20.65,6.76-39.23,19.39-54.17,37.17A8,8,0,0,0,24,208H192a8,8,0,0,0,6.13-13.15C183.18,177.07,164.6,164.44,144,157.68Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M254,136a6,6,0,0,1-6,6H230v18a6,6,0,0,1-12,0V142H200a6,6,0,0,1,0-12h18V112a6,6,0,0,1,12,0v18h18A6,6,0,0,1,254,136Zm-57.41,60.14a6,6,0,1,1-9.18,7.72C166.9,179.45,138.69,166,108,166s-58.89,13.45-79.41,37.86a6,6,0,0,1-9.18-7.72C35.14,177.41,55,164.48,77,158.25a66,66,0,1,1,62,0C161,164.48,180.86,177.41,196.59,196.14ZM108,154a54,54,0,1,0-54-54A54.06,54.06,0,0,0,108,154Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M252,136a4,4,0,0,1-4,4H228v20a4,4,0,0,1-8,0V140H200a4,4,0,0,1,0-8h20V112a4,4,0,0,1,8,0v20h20A4,4,0,0,1,252,136Zm-56.94,61.43a4,4,0,0,1-6.12,5.14C168,177.7,139.3,164,108,164s-60,13.7-80.94,38.57a4,4,0,1,1-6.12-5.14c16.71-19.9,38.13-33.13,61.89-38.59a64,64,0,1,1,50.34,0C156.93,164.3,178.35,177.53,195.06,197.43ZM108,156a56,56,0,1,0-56-56A56.06,56.06,0,0,0,108,156Z"}))]]),DU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z",opacity:"0.2"}),s.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"}))]]),HU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z"}))]]),OU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),s.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]),IU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168.49,104.49,145,128l23.52,23.51a12,12,0,0,1-17,17L128,145l-23.51,23.52a12,12,0,0,1-17-17L111,128,87.51,104.49a12,12,0,0,1,17-17L128,111l23.51-23.52a12,12,0,0,1,17,17ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,130.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164.24,100.24,136.48,128l27.76,27.76a6,6,0,1,1-8.48,8.48L128,136.48l-27.76,27.76a6,6,0,0,1-8.48-8.48L119.52,128,91.76,100.24a6,6,0,0,1,8.48-8.48L128,119.52l27.76-27.76a6,6,0,0,1,8.48,8.48ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M162.83,98.83,133.66,128l29.17,29.17a4,4,0,0,1-5.66,5.66L128,133.66,98.83,162.83a4,4,0,0,1-5.66-5.66L122.34,128,93.17,98.83a4,4,0,0,1,5.66-5.66L128,122.34l29.17-29.17a4,4,0,1,1,5.66,5.66ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),FU=s.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),kt=s.forwardRef((e,t)=>{const{alt:n,color:r,size:a,weight:i,mirrored:c,children:u,weights:f,...h}=e,{color:p="currentColor",size:m,weight:v="regular",mirrored:w=!1,...y}=s.useContext(FU);return s.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:a??m,height:a??m,fill:r??p,viewBox:"0 0 256 256",transform:c||w?"scale(-1, 1)":void 0,...y,...h},!!n&&s.createElement("title",null,n),u,f.get(i??v))});kt.displayName="IconBase";const rC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:bB}));rC.displayName="ApertureIcon";const sC=rC,aC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:xB}));aC.displayName="ArchiveIcon";const _p=aC,oC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:kB}));oC.displayName="ArrowCircleUpIcon";const iC=oC,lC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:SB}));lC.displayName="ArrowClockwiseIcon";const cC=lC,uC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:EB}));uC.displayName="ArrowCounterClockwiseIcon";const R0=uC,dC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:CB}));dC.displayName="ArrowLeftIcon";const cv=dC,fC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:jB}));fC.displayName="ArrowLineUpIcon";const _U=fC,hC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:AB}));hC.displayName="ArrowRightIcon";const Pa=hC,pC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:NB}));pC.displayName="ArrowSquareOutIcon";const wf=pC,mC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:MB}));mC.displayName="ArrowUpIcon";const gC=mC,vC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:RB}));vC.displayName="ArrowsClockwiseIcon";const $h=vC,wC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:PB}));wC.displayName="ArrowsDownUpIcon";const ZU=wC,yC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:LB}));yC.displayName="BellIcon";const Cg=yC,bC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:TB}));bC.displayName="CaretDownIcon";const Xi=bC,xC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:$B}));xC.displayName="CaretLeftIcon";const ga=xC,kC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:DB}));kC.displayName="CaretRightIcon";const il=kC,SC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:HB}));SC.displayName="CaretUpIcon";const VU=SC,EC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:OB}));EC.displayName="ChartBarIcon";const zU=EC,CC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:IB}));CC.displayName="CheckIcon";const Kn=CC,jC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:FB}));jC.displayName="CircleIcon";const BU=jC,AC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:_B}));AC.displayName="CircleHalfIcon";const UU=AC,NC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:ZB}));NC.displayName="CopyIcon";const Dh=NC,MC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:VB}));MC.displayName="CopySimpleIcon";const tx=MC,RC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:zB}));RC.displayName="DeviceMobileIcon";const WU=RC,PC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:BB}));PC.displayName="DotsThreeIcon";const LC=PC,TC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:UB}));TC.displayName="DotsThreeVerticalIcon";const $C=TC,DC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:WB}));DC.displayName="DownloadSimpleIcon";const HC=DC,OC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:KB}));OC.displayName="FilmSlateIcon";const Zp=OC,IC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:GB}));IC.displayName="FolderSimpleIcon";const uv=IC,FC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:YB}));FC.displayName="FolderSimpleMinusIcon";const _C=FC,ZC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:qB}));ZC.displayName="FrameCornersIcon";const VC=ZC,zC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:XB}));zC.displayName="GearSixIcon";const KU=zC,BC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:QB}));BC.displayName="GiftIcon";const GU=BC,UC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:JB}));UC.displayName="GithubLogoIcon";const YU=UC,WC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:eU}));WC.displayName="GraduationCapIcon";const qU=WC,KC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:tU}));KC.displayName="HandWavingIcon";const XU=KC,GC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:nU}));GC.displayName="HouseIcon";const QU=GC,YC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:rU}));YC.displayName="IdentificationBadgeIcon";const Vp=YC,qC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:sU}));qC.displayName="ImageSquareIcon";const Ws=qC,XC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:aU}));XC.displayName="InfinityIcon";const QC=XC,JC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:oU}));JC.displayName="InfoIcon";const zp=JC,ej=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:iU}));ej.displayName="KeyIcon";const tj=ej,nj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:lU}));nj.displayName="KeyboardIcon";const JU=nj,rj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:cU}));rj.displayName="LightningIcon";const P0=rj,sj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:uU}));sj.displayName="MagnifyingGlassIcon";const _u=sj,aj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:dU}));aj.displayName="MegaphoneIcon";const eW=aj,oj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:fU}));oj.displayName="MinusIcon";const tW=oj,ij=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:hU}));ij.displayName="MountainsIcon";const nW=ij,lj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:pU}));lj.displayName="PackageIcon";const Bp=lj,cj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:mU}));cj.displayName="PaletteIcon";const rW=cj,uj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:gU}));uj.displayName="PaperclipIcon";const sW=uj,dj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:vU}));dj.displayName="PencilSimpleIcon";const ed=dj,fj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:wU}));fj.displayName="PencilSimpleLineIcon";const aW=fj,hj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:yU}));hj.displayName="PlusIcon";const cr=hj,pj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:bU}));pj.displayName="PlusCircleIcon";const oW=pj,mj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:xU}));mj.displayName="PowerIcon";const iW=mj,gj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:kU}));gj.displayName="QuestionIcon";const lW=gj,vj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:SU}));vj.displayName="SidebarSimpleIcon";const cW=vj,wj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:EU}));wj.displayName="SlidersHorizontalIcon";const dv=wj,yj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:CU}));yj.displayName="StackIcon";const bj=yj,xj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:jU}));xj.displayName="StarIcon";const Da=xj,kj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:AU}));kj.displayName="StorefrontIcon";const Sj=kj,Ej=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:NU}));Ej.displayName="SunHorizonIcon";const Cj=Ej,jj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:MU}));jj.displayName="TrashIcon";const ll=jj,Aj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:RU}));Aj.displayName="TrashSimpleIcon";const Up=Aj,Nj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:PU}));Nj.displayName="UploadSimpleIcon";const fv=Nj,Mj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:LU}));Mj.displayName="UserIcon";const uW=Mj,Rj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:TU}));Rj.displayName="UserCircleIcon";const dW=Rj,Pj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:$U}));Pj.displayName="UserPlusIcon";const fW=Pj,Lj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:DU}));Lj.displayName="WarningIcon";const Wp=Lj,Tj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:HU}));Tj.displayName="WarningCircleIcon";const Sc=Tj,$j=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:OU}));$j.displayName="XIcon";const jn=$j,Dj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:IU}));Dj.displayName="XCircleIcon";const hW=Dj,Hj=s.createContext({push:()=>{}}),ir=()=>s.useContext(Hj),pW=3,mW=140,h0=e=>{var t;return!!(e.action||(t=e.actions)!=null&&t.length)},gW=e=>{var t;return((t=e.actions)!=null&&t.length?e.actions:e.action?[e.action]:[]).slice(0,2)};function jg(e){var a;if(e.kind==="error")return 1/0;const t=e.title.length+(((a=e.detail)==null?void 0:a.length)??0),n=h0(e)?9e3:4e3,r=h0(e)?14e3:8e3;return Math.min(n+Math.max(0,t-40)*45,r)}function vW(e,t,n){const r=n>1?` (${n} times)`:"";return`${e}${r}${t?` ${t}`:""}`}const wW=()=>typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function yW({kind:e}){if(e==="info")return null;const t=e==="success"?Kn:e==="warning"?Wp:Sc;return o.jsx(t,{className:"sc-toast-ic",size:16,weight:"regular","aria-hidden":"true"})}function bW({children:e}){const[t,n]=s.useState([]),r=s.useRef(1),a=s.useRef([]),i=s.useRef(new Map),c=s.useRef(null),u=s.useRef(null),f=s.useRef(null),h=s.useRef(new Map),p=s.useCallback(C=>{a.current=C,n(C)},[]),m=s.useCallback(C=>{const j=C.kind==="error"?u.current:c.current;if(!j)return;const N=vW(C.title,C.detail,C.count);j.textContent=N,window.setTimeout(()=>{j.textContent===N&&(j.textContent="")},1e3)},[]),v=s.useCallback(C=>{const j=i.current.get(C);(j==null?void 0:j.handle)!=null&&window.clearTimeout(j.handle),i.current.delete(C),p(a.current.map(N=>N.id===C&&!N.leaving?{...N,leaving:!0}:N)),window.setTimeout(()=>p(a.current.filter(N=>N.id!==C)),mW+40)},[p]),w=s.useCallback((C,j)=>{if(!Number.isFinite(j))return;const N=i.current.get(C)??{remaining:j,since:0,handle:null};N.handle!=null&&window.clearTimeout(N.handle),N.remaining=j,N.since=Date.now(),N.handle=window.setTimeout(()=>v(C),j),i.current.set(C,N)},[v]),y=s.useCallback(C=>{const j=i.current.get(C);!j||j.handle==null||(window.clearTimeout(j.handle),j.handle=null,j.remaining=Math.max(0,j.remaining-(Date.now()-j.since)))},[]),b=s.useCallback(C=>{const j=i.current.get(C);!j||j.handle!=null||w(C,j.remaining)},[w]);s.useEffect(()=>{const C=()=>{const j=[...i.current.keys()];document.hidden?j.forEach(y):j.forEach(b)};return document.addEventListener("visibilitychange",C),()=>document.removeEventListener("visibilitychange",C)},[y,b]),s.useLayoutEffect(()=>{const C=f.current;if(!C)return;const j=new Map,N=!wW();for(const P of C.querySelectorAll("[data-toast-id]")){const $=Number(P.dataset.toastId),R=P.getBoundingClientRect().top;j.set($,R);const E=h.current.get($);if(!N||E===void 0||P.hasAttribute("data-leaving"))continue;const M=E-R;M&&(P.style.transition="none",P.style.transform=`translateY(${M}px)`,P.getBoundingClientRect(),P.style.transition="transform 160ms cubic-bezier(.2, .7, .3, 1)",P.style.transform="")}h.current=j},[t]),s.useLayoutEffect(()=>{const C=f.current;if(!C)return;const j=()=>{const $=document.querySelector(".sc-canvas-dock");if(!$||!t.length){delete C.dataset.overDock;return}const R=C.getBoundingClientRect(),E=$.getBoundingClientRect();R.left<E.right&&E.left<R.right?(C.style.setProperty("--sc-toasts-over-dock",`${Math.round(window.innerHeight-E.top+10)}px`),C.dataset.overDock=""):delete C.dataset.overDock};j(),window.addEventListener("resize",j);const N=document.querySelector(".sc-canvas-dock"),P=typeof ResizeObserver>"u"||!N?null:new ResizeObserver(j);return P==null||P.observe(N),()=>{window.removeEventListener("resize",j),P==null||P.disconnect()}},[t]);const k=s.useCallback(C=>{const j=a.current.filter(E=>!E.leaving),N=h0(C)?void 0:j.find(E=>E.kind===C.kind&&E.title===C.title&&E.detail===C.detail&&!h0(E));if(N){const E={...N,count:N.count+1};p(a.current.map(L=>L.id===N.id?E:L));const M=i.current.get(N.id);M&&M.handle==null?M.remaining=jg(E):w(N.id,jg(E)),E.quiet||m(E);return}const P={...C,id:r.current++,count:1},$=[...a.current,P],R=E=>!E.leaving;for(;$.filter(R).length>pW;){let E=$.findIndex(H=>R(H)&&H.kind!=="error"&&!h0(H));E===-1&&(E=$.findIndex(H=>R(H)&&H.kind!=="error")),E===-1&&(E=$.findIndex(R));const M=$.splice(E,1)[0],L=i.current.get(M.id);(L==null?void 0:L.handle)!=null&&window.clearTimeout(L.handle),i.current.delete(M.id)}p($),w(P.id,jg(P)),P.quiet||m(P)},[m,w,p]),S=s.useMemo(()=>({push:k}),[k]);return s.useEffect(()=>{if(typeof localStorage<"u"&&localStorage.getItem("scenri:toast-probe"))return window.__scenriToast=k,()=>{delete window.__scenriToast}},[k]),o.jsxs(Hj.Provider,{value:S,children:[e,Rr.createPortal(o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:c,className:"sc-vh",role:"status","aria-live":"polite"}),o.jsx("div",{ref:u,className:"sc-vh","aria-live":"assertive","aria-atomic":"true"}),o.jsx("section",{className:"sc-toasts","aria-label":"Alerts",ref:f,onPointerDown:nx,onMouseDown:nx,children:t.map(C=>{const j=gW(C);return o.jsx("div",{className:"sc-toast-wrap","data-toast-id":C.id,"data-leaving":C.leaving||void 0,children:o.jsxs("article",{className:"sc-toast","data-kind":C.kind,onPointerEnter:()=>y(C.id),onPointerLeave:()=>b(C.id),onFocus:()=>y(C.id),onBlur:N=>{N.currentTarget.contains(N.relatedTarget)||b(C.id)},children:[o.jsx(yW,{kind:C.kind}),o.jsxs("div",{className:"sc-toast-body",children:[o.jsxs("div",{className:"sc-toast-top",children:[o.jsxs("div",{className:"sc-toast-txt",children:[o.jsxs("b",{children:[C.title,C.count>1?o.jsxs("span",{className:"sc-toast-n",children:["×",C.count]}):null]}),C.detail?o.jsx("small",{children:C.detail.slice(0,160)}):null]}),o.jsx("button",{type:"button",className:"sc-toast-x",onClick:()=>v(C.id),"aria-label":"Dismiss",children:o.jsx(jn,{size:14,weight:"regular"})})]}),j.length?o.jsx("div",{className:"sc-toast-acts",children:j.map(N=>o.jsx("button",{type:"button",className:"sc-toast-act",onClick:()=>{N.onClick(),v(C.id)},children:N.label},N.label))}):null]})]})},C.id)})})]}),document.body)]})}function nx(e){e.stopPropagation(),e.type==="mousedown"&&e.target instanceof Element&&e.target.closest("button")&&e.preventDefault()}async function qe(e,t,n,r,a){const i=await fetch(t,{method:e,signal:r,keepalive:a==null?void 0:a.keepalive,headers:n!==void 0?{"content-type":"application/json"}:void 0,body:n!==void 0?JSON.stringify(n):void 0});if(!i.ok){let c=`HTTP ${i.status}`;try{const u=await i.json();c=u.error??c,u.details&&(c+=`: ${u.details.join("; ")}`)}catch{}throw Object.assign(new Error(c),{status:i.status,method:e,url:t})}return i.json()}const xW=(e,t,n)=>qe("DELETE",`/api/brands/${e}/${t}/${n}`),l6=(e,t)=>xW(e,"products",t);async function Oj(e,t,n={}){const r=new FormData;n.role&&r.append("role",n.role),n.background&&r.append("background",n.background),r.append("file",t);const a=await fetch(`/api/brands/${e}/logos`,{method:"POST",body:r});if(!a.ok)throw new Error((await a.json().catch(()=>({}))).error??`HTTP ${a.status}`);return a.json()}const kW=e=>`/api/brands/${e}/export`;async function SW(e,t,n,r){const a=new FormData;a.append("file",n);const i=await fetch(`/api/brands/${e}/products/${t}/shots`,{method:"POST",body:a});if(!i.ok)throw new Error((await i.json().catch(()=>({}))).error??`HTTP ${i.status}`);return i.json()}async function L0(e){const t=new FormData;t.append("file",e);const n=await fetch("/api/images",{method:"POST",body:t});if(!n.ok)throw new Error((await n.json().catch(()=>({}))).error??`HTTP ${n.status}`);return(await n.json()).hash}function EW(e,t){try{return fetch(`/api/brands/${e}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({brand:t,keepAssets:!0}),keepalive:!0}).then(n=>n.ok?n.json():null).catch(()=>null)}catch{return Promise.resolve(null)}}const Mr=e=>`/api/images/${e}`,Fr=e=>e!=null&&e.startsWith("asset:")?Mr(e.slice(6)):null,Ij={tile:640,small:320,micro:160},dn=(e,t)=>`${Mr(e)}/thumb?w=${Ij[t]}`,Kp=(e,t)=>e!=null&&e.startsWith("asset:")?dn(e.slice(6),t):null,CW=/^\/api\/images\/([a-f0-9]{32})(?:\/thumb\?w=\d+)?$/,jW=/^(\/api\/(?:presenter-avatars|presenter-thumbnails|scene-thumbnails|demo-product-thumbnails|showcase-previews)\/[a-z0-9-]+\.jpg)(?:\?v=(\d+))?(?:[?&]w=\d+)?$/;function sr(e,t){if(!e)return e;const n=CW.exec(e);if(n)return t==="full"?Mr(n[1]):dn(n[1],t);const r=jW.exec(e);if(!r)return e;const a=r[2]?`${r[1]}?v=${r[2]}`:r[1];return t==="full"?a:`${a}${r[2]?"&":"?"}w=${Ij[t]}`}function rx(e){return e.every(t=>t.kind==="root")}let Fj=new Map;function AW(e){const t=new Map;for(const n of e)for(const r of n.legacyNames??[])r!==n.name&&t.set(r,n.name);Fj=t}function NW(e){var r;const t=e.promptHead??"",n=(r=/^\[([^\]]+)\]/.exec(t))==null?void 0:r[1];if(n)return Fj.get(n)??n;if(t.startsWith("Remove all overlaid marketing text")||t.startsWith("Remove ALL text"))return"Text lift"}function Sr(e){const t=NW(e);return t||(e.promptHead??"").trim().split(/\s+/).slice(0,6).join(" ")||(e.kind==="edit"?"Edit":"Generation")}const _j=[{id:"newest",label:"Newest first"},{id:"oldest",label:"Oldest first"},{id:"cost",label:"Highest cost"},{id:"keepers",label:"Keepers first"}];function MW(e){return _j.some(t=>t.id===e)}const Zj=[{id:"all",label:"All"},{id:"keepers",label:"Keepers"},{id:"archived",label:"Archived"}];function RW(e){return Zj.some(t=>t.id===e)}function PW(e){var r;const t=new URLSearchParams;e.lens&&e.lens!=="all"&&t.set("lens",e.lens),e.set&&t.set("set",e.set),e.ungrouped&&t.set("ungrouped","1"),e.lineage&&t.set("lineage",e.lineage),e.token&&t.set("token",e.token),(r=e.q)!=null&&r.trim()&&t.set("q",e.q.trim()),e.sort&&e.sort!=="newest"&&t.set("sort",e.sort),e.limit&&t.set("limit",String(e.limit)),e.cursor&&t.set("cursor",e.cursor);const n=t.toString();return n?`?${n}`:""}function c6(e,t){const n=e.findIndex(r=>r.id===t);return n<0?{at:n,prev:null,next:null}:{at:n,prev:e[n-1]??null,next:e[n+1]??null}}const wu=(e,t)=>t.createdAt.localeCompare(e.createdAt)||t.id.localeCompare(e.id),Me={brands:()=>qe("GET","/api/brands"),createBrand:e=>qe("POST","/api/brands",{brand:e}),brandFromUrl:e=>qe("POST","/api/brands/from-url",{url:e}),updateBrand:(e,t)=>qe("PUT",`/api/brands/${e}`,{brand:t,keepAssets:!0}),deleteBrand:e=>qe("DELETE",`/api/brands/${e}`),guide:()=>qe("GET","/api/guide"),guideIntent:e=>qe("POST","/api/guide",e,void 0,{keepalive:!0}),refreshBrandFromUrl:(e,t)=>qe("POST",`/api/brands/${e}/refresh-from-url`,t?{url:t}:{}),updateLogo:(e,t,n)=>qe("PATCH",`/api/brands/${e}/logos/${t}`,n),deleteLogo:(e,t)=>qe("DELETE",`/api/brands/${e}/logos/${t}`),projects:e=>qe("GET",`/api/projects?brandId=${encodeURIComponent(e)}`),createProject:(e,t)=>qe("POST","/api/projects",{brandId:e,name:t}),tree:e=>qe("GET",`/api/projects/${e}/tree`),activity:e=>qe("GET",`/api/brands/${e}/activity`),workspace:e=>qe("GET",`/api/brands/${e}/workspace`),feed:(e,t,n)=>qe("GET",`/api/brands/${e}/feed${PW(t)}`,void 0,n),node:e=>qe("GET",`/api/nodes/${e}`),lineage:e=>qe("GET",`/api/nodes/${e}/lineage`),usage:e=>qe("GET",`/api/brands/${e}/usage`),sets:e=>qe("GET",`/api/brands/${e}/sets`),createSet:(e,t)=>qe("POST",`/api/brands/${e}/sets`,{name:t}),renameSet:(e,t)=>qe("PATCH",`/api/sets/${e}`,{name:t}),deleteSet:e=>qe("DELETE",`/api/sets/${e}`),addToSet:(e,t)=>qe("POST",`/api/sets/${e}/nodes`,{nodeIds:t}),removeFromSet:(e,t)=>qe("POST",`/api/sets/${e}/nodes/remove`,{nodeIds:t}),engines:()=>qe("GET","/api/engines"),codexStatus:(e={})=>qe("GET",`/api/engines/codex/status${e.force?"?force=1":""}`),repairCodexEnv:e=>qe("POST","/api/engines/codex/repair-env",{keys:e}),restoreCodexEnv:()=>qe("POST","/api/engines/codex/restore-env"),installCodex:()=>qe("POST","/api/engines/codex/install"),loginCodex:()=>qe("POST","/api/engines/codex/login"),setCap:(e,t)=>qe("PUT","/api/caps",{engineId:e,capUsd:t}),addNode:e=>qe("POST","/api/nodes",e),cancelNode:e=>qe("POST",`/api/nodes/${e}/cancel`),retryNode:e=>qe("POST",`/api/nodes/${e}/retry`),scenes:()=>qe("GET","/api/scenes"),presenters:()=>qe("GET","/api/presenters"),presenterFrames:e=>qe("GET",`/api/presenter-previews/${e}`),demoProducts:()=>qe("GET","/api/demo-products"),demoProductFrames:e=>qe("GET",`/api/demo-product-previews/${e}`),showcase:()=>qe("GET","/api/showcase"),previewBrief:(e,t,n,r)=>qe("POST","/api/brief/preview",{brief:e,engineId:t,brandId:n,...r?{parentId:r}:{}}),keep:(e,t)=>qe("POST",`/api/nodes/${e}/keep`,{kept:t}),archiveNode:(e,t)=>qe("POST",`/api/nodes/${e}/archive`,{archived:t}),deleteNode:e=>qe("DELETE",`/api/nodes/${e}`),deleteNodesBatch:e=>qe("POST","/api/nodes/delete-batch",{nodeIds:e}),settings:()=>qe("GET","/api/settings"),saveSettings:e=>qe("PUT","/api/settings",e),costs:()=>qe("GET","/api/costs/summary"),home:()=>qe("GET","/api/home"),reveal:()=>qe("POST","/api/system/reveal"),version:()=>qe("GET","/api/version"),updateStatus:()=>qe("GET","/api/update/status"),updateCheck:()=>qe("POST","/api/update/check"),updateApply:()=>qe("POST","/api/update/apply"),updateRestart:()=>qe("POST","/api/update/restart"),desktop:()=>qe("GET","/api/desktop"),phone:(e=!1)=>qe("GET",e?"/api/phone?fresh=1":"/api/phone"),phoneNewCode:()=>qe("POST","/api/phone/code"),phoneHelp:()=>qe("GET","/api/phone/help"),phoneAllow:()=>qe("POST","/api/phone/allow"),desktopInstall:()=>qe("POST","/api/desktop/install"),quit:()=>qe("POST","/api/system/quit"),releaseNotes:()=>qe("GET","/api/release/notes"),releaseSeen:e=>qe("POST","/api/release/seen",{version:e}),sceneFrames:e=>qe("GET",`/api/scene-previews/${e}`),deleteData:e=>qe("DELETE",`/api/data?scope=${e}`),libraryProduct:(e,t)=>qe("GET",`/api/brands/${e}/products-library/${encodeURIComponent(t)}`),productsLibrary:e=>qe("GET",`/api/brands/${e}/products-library`),catalogImport:(e,t,n)=>qe("POST",`/api/brands/${e}/catalog/import`,n?{url:t,urls:n}:{url:t}),catalogScan:(e,t)=>qe("POST",`/api/brands/${e}/catalog/scan`,t?{url:t}:{}),catalogDetails:(e,t)=>qe("POST",`/api/brands/${e}/catalog/details`,{urls:t}),catalogScanState:(e,t,n)=>qe("GET",`/api/brands/${e}/catalog/scans/${t}`,void 0,n),cancelCatalogScan:(e,t)=>qe("POST",`/api/brands/${e}/catalog/scans/${t}/cancel`),catalogJob:(e,t)=>qe("GET",`/api/brands/${e}/catalog/jobs/${t}`),catalogJobs:e=>qe("GET",`/api/brands/${e}/catalog/jobs`),cancelCatalogJob:(e,t)=>qe("POST",`/api/brands/${e}/catalog/jobs/${t}/cancel`),deleteCatalogProduct:(e,t)=>qe("DELETE",`/api/brands/${e}/catalog/products/${t}`),updateProduct:(e,t,n)=>qe("PATCH",`/api/brands/${e}/products/${t}`,n),updateCatalogProduct:(e,t,n)=>qe("PATCH",`/api/brands/${e}/catalog/products/${t}`,n),productSize:(e,t)=>qe("GET",`/api/brands/${e}/products/${t}/size`),setProductSize:(e,t,n)=>qe("PUT",`/api/brands/${e}/products/${t}/size`,{size:n}),setProductShots:(e,t,n)=>qe("PUT",`/api/brands/${e}/products/${t}/shots`,{files:n}),assetBuildCapabilities:()=>qe("GET","/api/asset-builds/capabilities"),startAssetBuild:(e,t)=>qe("POST",`/api/brands/${e}/asset-builds`,t),assetBuild:(e,t)=>qe("GET",`/api/brands/${e}/asset-builds/${t}`),assetBuilds:e=>qe("GET",`/api/brands/${e}/asset-builds`),cancelAssetBuild:(e,t)=>qe("POST",`/api/brands/${e}/asset-builds/${t}/cancel`),deleteAssetBuild:(e,t)=>qe("DELETE",`/api/brands/${e}/asset-builds/${t}`),createProduct:(e,t)=>qe("POST",`/api/brands/${e}/products`,t),createPresenterDraft:(e,t)=>qe("POST",`/api/brands/${e}/presenter-drafts`,t),presenterDrafts:e=>qe("GET",`/api/brands/${e}/presenter-drafts`),presenterDraft:(e,t)=>qe("GET",`/api/brands/${e}/presenter-drafts/${t}`),updatePresenterDraft:(e,t,n)=>qe("PATCH",`/api/brands/${e}/presenter-drafts/${t}`,n),generateDraftView:(e,t,n,r={})=>qe("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/generate`,r),approveDraftView:(e,t,n)=>qe("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/approve`),redoDraftView:(e,t,n)=>qe("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/redo`),revertDraftView:(e,t,n)=>qe("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/revert`),stopDraft:(e,t)=>qe("POST",`/api/brands/${e}/presenter-drafts/${t}/stop`),restoreDraftView:(e,t,n,r)=>qe("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/restore`,{hash:r}),placeDraftPhoto:(e,t,n,r)=>qe("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/use-photo`,{hash:r}),savePresenterDraft:(e,t)=>qe("POST",`/api/brands/${e}/presenter-drafts/${t}/save`),deletePresenterDraft:(e,t)=>qe("DELETE",`/api/brands/${e}/presenter-drafts/${t}`),createPresenter:(e,t)=>qe("POST",`/api/brands/${e}/presenters`,t),updatePresenter:(e,t,n)=>qe("PATCH",`/api/brands/${e}/presenters/${t}`,n),deletePresenter:(e,t)=>qe("DELETE",`/api/brands/${e}/presenters/${t}`),duplicatePresenter:(e,t,n)=>qe("POST",`/api/brands/${e}/presenters/${t}/duplicate`,{name:n}),editPresenter:(e,t)=>qe("POST",`/api/brands/${e}/presenters/${t}/edit`),revertPresenter:(e,t)=>qe("POST",`/api/brands/${e}/presenters/${t}/revert`),createScene:(e,t)=>qe("POST",`/api/brands/${e}/scenes`,t),updateScene:(e,t,n)=>qe("PATCH",`/api/brands/${e}/scenes/${t}`,n),deleteScene:(e,t)=>qe("DELETE",`/api/brands/${e}/scenes/${t}`),sceneExamples:(e,t)=>qe("GET",`/api/brands/${e}/scenes/${t}/examples`),drawSceneExamples:(e,t,n)=>qe("POST",`/api/brands/${e}/scenes/${t}/examples`,n),stopSceneExamples:(e,t)=>qe("POST",`/api/brands/${e}/scenes/${t}/examples/stop`),removeSceneExample:(e,t,n)=>qe("DELETE",`/api/brands/${e}/scenes/${t}/examples/${n}`),generateScenePreview:(e,t)=>qe("POST",`/api/brands/${e}/scenes/${t}/preview`),rereadScene:(e,t,n)=>qe("POST",`/api/brands/${e}/scenes/${t}/reread`,{correction:n}),startSceneStudioJob:(e,t)=>qe("POST",`/api/brands/${e}/scene-studio/jobs`,t),sceneStudioJob:(e,t)=>qe("GET",`/api/brands/${e}/scene-studio/jobs/${t}`),cancelSceneStudioJob:(e,t)=>qe("POST",`/api/brands/${e}/scene-studio/jobs/${t}/cancel`),labelSceneStudioJob:(e,t,n)=>qe("POST",`/api/brands/${e}/scene-studio/jobs/${t}/label`,{label:n}),attachSceneStudioJob:(e,t,n)=>qe("POST",`/api/brands/${e}/scene-studio/jobs/${t}/attach`,{sceneId:n})},u6="scenri:guide-heading",LW=["first-shot","refine","product","presenter","scene","reuse"],TW=e=>LW.includes(e);function $W(){try{const e=typeof window>"u"?null:window.sessionStorage.getItem(u6);if(!e)return null;if(e.startsWith("{")){const t=JSON.parse(e);return typeof t.brandId=="string"&&TW(t.task)?{brandId:t.brandId,task:t.task}:null}return{brandId:e,task:"first-shot"}}catch{return null}}function Vj(e){try{e?window.sessionStorage.setItem(u6,JSON.stringify(e)):window.sessionStorage.removeItem(u6)}catch{}}const DW={loaded:!1,heading:null,eligible:!1,welcome:null,hidden:!0,done:{},lessons:{},progress:{},dismissed:[],active:null,activeNodes:[],activeDraftId:null,counts:null};let Ha={...DW,heading:$W()},sx=null,Ag=null,ax=!1;const d6=new Set;function Wl(e){Ha=e;for(const t of d6)t()}function zj(e){const t=e;return{...t,lessons:t.lessons??{},progress:t.progress??{},loaded:!0,heading:Ha.heading}}function Hh(){return Ag??(Ag=Me.guide().then(e=>Wl(zj(e))).catch(()=>{Ha.loaded||Wl({...Ha,loaded:!0})}).finally(()=>{Ag=null})),Ag}function HW(){return!ax&&typeof document<"u"&&(ax=!0,document.addEventListener("visibilitychange",()=>{!document.hidden&&Ha.loaded&&Hh()})),sx??(sx=Hh()),sx}function Ng(){return Hh()}function OW(e,t){var n,r;return"welcome"in t?{...e,welcome:t.welcome}:"hidden"in t?{...e,hidden:t.hidden}:"finish"in t?{...e,lessons:e.lessons[t.finish]?e.lessons:{...e.lessons,[t.finish]:new Date().toISOString()},...((n=e.active)==null?void 0:n.task)===t.finish?{active:null,activeNodes:[],activeDraftId:null}:{}}:"dismiss"in t?{...e,dismissed:e.dismissed.includes(t.dismiss)?e.dismissed:[...e.dismissed,t.dismiss],...((r=e.active)==null?void 0:r.task)===t.dismiss?{active:{...e.active,paused:!0}}:{}}:e}function $l(e){const t=Ha;return Wl(OW(Ha,e)),Me.guideIntent(e).then(n=>Wl(zj(n))).catch(()=>{Wl(t),Hh()})}function IW(e){return d6.add(e),()=>d6.delete(e)}const Bj=e=>`scenri:guide-via-bar:${e}`,f6=(e,t)=>t==="first-shot"||t==="reuse"?Bj(e):`scenri:guide-via:${e}:${t}`;function Uj(e,t){const n={brandId:e,task:t};Vj(n),Wl({...Ha,heading:n})}function h6(){Vj(null),Ha.heading&&Wl({...Ha,heading:null})}function mh(){return Ha}function hv(){return s.useSyncExternalStore(IW,mh)}const ut={root:"/",setup:"/setup",brand:"/:brandSlug",kit:"/:brandSlug/kit",products:"/:brandSlug/products",product:"/:brandSlug/products/:productId",scenes:"/:brandSlug/scenes",sceneStudio:"/:brandSlug/scenes/new/:convoId?",scene:"/:brandSlug/scenes/:sceneId",sceneEdit:"/:brandSlug/scenes/:sceneId/edit/:convoId?",presenters:"/:brandSlug/presenters",presenterStudio:"/:brandSlug/presenters/new/:draftId?",presenter:"/:brandSlug/presenters/:presenterId",presenterEdit:"/:brandSlug/presenters/:presenterId/edit",hub:"/:brandSlug/create",hubShot:"/:brandSlug/create/shots/:shotId",set:"/:brandSlug/sets/:setSlug",setShot:"/:brandSlug/sets/:setSlug/shots/:shotId",legacy:"/b/*",notFound:"*"},mo=e=>us(ut.brand,{brandSlug:e.slug}),Cu=e=>us(ut.products,{brandSlug:e.slug}),la=(e,t)=>us(ut.product,{brandSlug:e.slug,productId:t}),Kl=e=>us(ut.scenes,{brandSlug:e.slug}),_r=(e,t)=>us(ut.scene,{brandSlug:e.slug,sceneId:t}),Bi=(e,t)=>us(ut.sceneStudio,{brandSlug:e.slug,convoId:t??void 0}),pv=(e,t,n)=>us(ut.sceneEdit,{brandSlug:e.slug,sceneId:t,convoId:n??void 0}),Uo=e=>us(ut.presenters,{brandSlug:e.slug}),ha=(e,t)=>us(ut.presenter,{brandSlug:e.slug,presenterId:t}),Ui=(e,t)=>us(ut.presenterStudio,{brandSlug:e.slug,draftId:t??void 0}),Gp=(e,t)=>us(ut.presenterEdit,{brandSlug:e.slug,presenterId:t}),mr=e=>us(ut.hub,{brandSlug:e.slug}),n0=(e,t)=>us(ut.set,{brandSlug:e.slug,setSlug:t.slug}),Yp=(e,t,n)=>t?us(ut.setShot,{brandSlug:e.slug,setSlug:t.slug,shotId:n}):us(ut.hubShot,{brandSlug:e.slug,shotId:n});function FW(e,t=""){const[,,n,...r]=e.split("/");if(!n)return ut.root;const a=`/${n}${_W(r)}`;return t?a+t:a}function _W(e){const[t,n,r,a]=e;return t==="create"?r&&n==="n"?`/create/shots/${r}`:"/create":t==="s"&&n?a&&r==="n"?`/sets/${n}/shots/${a}`:`/sets/${n}`:t==="brand"?"/kit":t==="p"?"/create":t==="n"&&n?`/create/shots/${n}`:e.length?`/${e.join("/")}`:""}const Mg="Scenri",ox=" - ",ix=40,ZW=[["whatsnew","What's new"],["setup","Providers"],["settings","Settings"]],VW=[[ut.setup,"Set up",!1],[ut.hubShot,"Shot",!1],[ut.setShot,"Shot",!1],[ut.hub,"Create",!1],[ut.set,"Create",!0],[ut.kit,"Brand kit",!1],[ut.product,"Products",!0],[ut.products,"Products",!1],[ut.scene,"Scenes",!0],[ut.scenes,"Scenes",!1],[ut.presenter,"Presenters",!0],[ut.presenters,"Presenters",!1],[ut.brand,"Home",!1]];function zW(e){if(!e)return null;const t=e.replace(/[\u0000-\u001F\u007F-\u009F]/g," ").replace(/\s+/g," ").trim();return t?t.length>ix?`${t.slice(0,ix-1).trimEnd()}…`:t:null}function BW(e,t="",n=null){const r=new URLSearchParams(t);for(const[a,i]of ZW)if(r.has(a))return i+ox+Mg;for(const[a,i,c]of VW)if(Gi(a,e))return((c?zW(n):null)??i)+ox+Mg;return Mg}const Wj=s.createContext(null);function UW(){const{pathname:e,search:t}=Zn(),[n,r]=s.useState(null);return s.useEffect(()=>{document.title=BW(e,t,n)},[e,t,n]),r}function Ec(e){const t=s.useContext(Wj);s.useEffect(()=>{if(t)return t(e??null),()=>t(null)},[t,e])}const WW={scenes:[],collections:[],verticals:[],loaded:!1,error:!1};function KW(){const[e,t]=s.useState(WW),[n,r]=s.useState(0);s.useEffect(()=>{let i=!0;return Me.scenes().then(c=>{AW(c.scenes),i&&t({scenes:c.scenes,collections:c.collections,verticals:c.verticals,loaded:!0,error:!1})}).catch(()=>{i&&t(c=>({...c,loaded:!0,error:!0}))}),()=>{i=!1}},[n]);const a=s.useCallback(()=>{t(i=>({...i,loaded:!1,error:!1})),r(i=>i+1)},[]);return{...e,refetch:a}}const GW={presenters:[],categories:[],styles:[],loaded:!1,error:!1};function YW(){const[e,t]=s.useState(GW),[n,r]=s.useState(0);s.useEffect(()=>{let i=!0;return Me.presenters().then(c=>{i&&t({presenters:c.presenters,categories:c.categories,styles:c.styles,loaded:!0,error:!1})}).catch(()=>{i&&t(c=>({...c,loaded:!0,error:!0}))}),()=>{i=!1}},[n]);const a=s.useCallback(()=>{t(i=>({...i,loaded:!1,error:!1})),r(i=>i+1)},[]);return{...e,refetch:a}}const qW={demoProducts:[],categories:[],loaded:!1,error:!1};function XW(){const[e,t]=s.useState(qW),[n,r]=s.useState(0);s.useEffect(()=>{let i=!0;return Me.demoProducts().then(c=>{i&&t({demoProducts:c.demoProducts,categories:c.categories,loaded:!0,error:!1})}).catch(()=>{i&&t(c=>({...c,loaded:!0,error:!0}))}),()=>{i=!1}},[n]);const a=s.useCallback(()=>{t(i=>({...i,loaded:!1,error:!1})),r(i=>i+1)},[]);return{...e,refetch:a}}const QW={showcase:[],categories:[],loaded:!1,error:!1};function JW(){const[e,t]=s.useState(QW),[n,r]=s.useState(0);s.useEffect(()=>{let i=!0;return Me.showcase().then(c=>{i&&t({showcase:c.showcase,categories:c.categories,loaded:!0,error:!1})}).catch(()=>{i&&t(c=>({...c,loaded:!0,error:!0}))}),()=>{i=!1}},[n]);const a=s.useCallback(()=>{t(i=>({...i,loaded:!1,error:!1})),r(i=>i+1)},[]);return{...e,refetch:a}}const B1=[{id:"brand",label:"Brand kit",Icon:rW,scope:"brand",sub:e=>`What every shot for ${e} can draw on.`},{id:"usage",label:"Usage",Icon:zU,scope:"brand",sub:e=>`What ${e} has made, one square per day.`},{id:"engines",label:"Providers",Icon:P0,scope:"studio",sub:()=>"Where your images are made, and what each may spend."},{id:"appearance",label:"Appearance",Icon:UU,scope:"studio",sub:()=>"How Scenri looks on this device."},{id:"library",label:"Library",Icon:uv,scope:"studio",sub:()=>"Your work, as plain files on this computer. Back them up like anything else."},{id:"phone",label:"Local access",Icon:WU,scope:"studio",sub:()=>"Open Scenri on your phone, tablet or another computer, or from your desktop."},{id:"updates",label:"Updates",Icon:$h,scope:"studio",sub:()=>"How this copy of Scenri stays current."},{id:"about",label:"About",Icon:zp,scope:"studio",sub:()=>"The copy of Scenri you are running."},{id:"danger",label:"Danger zone",Icon:Up,scope:"apart",sub:()=>"These do not come back. Export from Library first if you are not certain."}],Kj={brand:"brand",usage:"usage",engines:"engines",budget:"engines",general:"appearance",appearance:"appearance",library:"library",phone:"phone",updates:"updates",about:"about",danger:"danger"},eK="index",Gj=e=>e!==null&&Object.prototype.hasOwnProperty.call(Kj,e),tK=e=>Gj(e)?Kj[e]:"brand",nK=e=>!Gj(e);function yf(){const{open:e}=Ns("settings");return s.useCallback(t=>e(t??eK),[e])}function rK(){const{open:e}=Ns("welcome");return s.useCallback(()=>e("1"),[e])}const p6={current:null};function Yj(){const{open:e}=Ns("learn");return s.useCallback((t="lessons")=>e(t),[e])}const lx="codex-cli";function Cc(){const{open:e}=Ns("setup");return s.useCallback((t=lx)=>{e(typeof t=="string"?t:lx)},[e])}function sK(e){var t;e.preventDefault(),(t=e.currentTarget)==null||t.focus({preventScroll:!0})}function qj({failure:e,density:t,onRetry:n,dismiss:r}){const a=yf(),i=Cc(),{remedy:c}=e,u=t==="tile",f=()=>{c&&(c.opens==="setup"?i("codex-cli"):a(c.opens))},h=n&&e.retryable,p=w=>u?`sc-s${w?" sc-s-primary":""}`:`sc-btn ${w?"sc-btn-primary":"sc-btn-ghost"}`,m=!u&&!!e.fix,v=!u&&!!e.raw;return o.jsxs("div",{className:"sc-fail","data-density":t,"data-kind":e.kind,"data-long":e.title.length>90||void 0,role:"alert",children:[o.jsx("span",{className:"sc-fail-ic","aria-hidden":!0,children:o.jsx(Sc,{size:u?15:21,weight:"fill"})}),o.jsxs("div",{className:"sc-fail-txt",children:[o.jsx("b",{children:e.title}),m&&o.jsx("small",{children:e.fix})]}),(c||h||r)&&o.jsxs("div",{className:"sc-fail-acts",children:[c&&o.jsx("button",{type:"button",className:p(!0),onClick:f,children:c.label}),h&&o.jsxs("button",{type:"button",className:p(!c),onClick:n,children:[o.jsx(R0,{size:u?12:14})," Try again"]}),r&&o.jsx("button",{type:"button",className:"sc-fail-alt",onClick:r.onClick,children:r.label})]}),v&&o.jsxs("details",{className:"sc-fail-raw",children:[o.jsx("summary",{children:"Details"}),o.jsx("pre",{children:e.raw})]})]})}function mv({failure:e,action:t,tone:n="error"}){return o.jsx("div",{className:"sc-failrow","data-tone":n,role:n==="error"?"alert":"status",children:o.jsxs("div",{className:"sc-banner","data-tone":n==="error"?"error":void 0,children:[o.jsx("span",{className:"sc-banner-ic",children:n==="error"?o.jsx(Sc,{size:16,weight:"fill"}):o.jsx(zp,{size:16,weight:"fill"})}),o.jsxs("span",{className:"sc-banner-txt",children:[o.jsx("b",{children:e.title}),e.fix&&o.jsx("small",{children:e.fix})]}),t]})})}function Xj(e){return{get(t){try{return e().getItem(t)}catch{return null}},set(t,n){try{e().setItem(t,n)}catch{}},del(t){try{e().removeItem(t)}catch{}},keys(t){try{const n=e(),r=[];for(let a=0;a<n.length;a++){const i=n.key(a);i!=null&&i.startsWith(t)&&r.push(i)}return r}catch{return[]}}}}const cs=Xj(()=>localStorage),bf=Xj(()=>sessionStorage),Qj=720*60*60*1e3;function Jj(e){return e?e.phase==="ready"?e.blockReason!=="dev"&&e.blockReason!=="unsupervised"&&e.blockReason!=="launcher-too-old":e.canApply:!1}function aK(e){return!!(e!=null&&e.available)&&e.blockReason!=="dev"}function oK(e){return e.phase==="staging"?{kind:"downloading"}:e.phase==="ready"?{kind:"ready",version:e.stagedVersion??e.latest??e.current}:e.phase==="error"&&e.available?{kind:"stage-error"}:{kind:"announce",oneClick:Jj(e)}}const iK=1800*1e3,cx=300*1e3,Rg=e=>new Promise(t=>setTimeout(t,e)),eA="scenri:update-dismissed",lK=()=>bf.get(eA),cK=e=>bf.set(eA,e),tA=s.createContext(null);function qp(){const e=s.useContext(tA);if(!e)throw new Error("useUpdateCenter must be used inside UpdateCenterProvider");return e}function uK({children:e}){const[t,n]=s.useState(null),[r,a]=s.useState(!1),[i,c]=s.useState(lK),u=s.useRef(void 0),[f,h]=s.useState(!1);s.useEffect(()=>{let M=!0;return Me.version().then(L=>M&&h(L.thisComputer===!0)).catch(()=>{}),()=>{M=!1}},[]),s.useEffect(()=>{let M=!0;const L=async()=>{if(M){if(!document.hidden)try{const D=await Me.updateStatus();M&&n(D)}catch{}M&&(u.current=window.setTimeout(L,iK))}};L();const H=()=>{document.hidden||!M||(window.clearTimeout(u.current),L())};return document.addEventListener("visibilitychange",H),window.addEventListener("focus",H),()=>{M=!1,window.clearTimeout(u.current),document.removeEventListener("visibilitychange",H),window.removeEventListener("focus",H)}},[]);const[p,m]=s.useState(null),v=s.useCallback(async()=>{a(!0);try{n(await Me.updateCheck()),m(null)}catch(M){m(String((M==null?void 0:M.message)??M))}finally{a(!1)}},[]),w=s.useCallback(()=>{const M=t==null?void 0:t.latest;M&&(cK(M),c(M))},[t]),y=(t==null?void 0:t.latest)!=null&&t.latest===i,[b,k]=s.useState("idle"),[S,C]=s.useState(null),j=s.useCallback(async M=>{k("restarting");try{await Me.updateRestart()}catch(H){if(typeof H.status=="number"){k("idle"),C(String((H==null?void 0:H.message)??H));return}}const L=Date.now()+3e4;for(;Date.now()<L;){await Rg(800);try{if((await Me.version()).version!==M){location.reload();return}}catch{}}k("idle"),C("The restart did not complete. Check the terminal Scenri runs in.")},[]),N=s.useCallback(async()=>{if(b!=="idle")return null;try{await Me.quit()}catch(M){if(typeof M.status=="number")return String((M==null?void 0:M.message)??M)}return window.close(),setTimeout(()=>{window.closed||location.replace("about:blank")},300),null},[b]),P=s.useCallback(async()=>{if(b!=="idle")return;C(null);const M=t==null?void 0:t.current;try{if((t==null?void 0:t.phase)!=="ready"){k("applying"),await Me.updateApply();const L=Date.now()+cx;let H=!1;for(;Date.now()<L;){await Rg(1500);const D=await Me.updateStatus();if(n(D),D.phase==="ready"){H=!0;break}if(D.phase==="error"){C(D.error??"The update could not be staged."),k("idle");return}}if(!H){C("Couldn't download the update. Try again."),k("idle");return}}await j(M)}catch(L){C(String((L==null?void 0:L.message)??L)),k("idle")}},[b,t,j]),$=s.useRef(!1);s.useEffect(()=>{if((t==null?void 0:t.phase)!=="staging"||b!=="idle"||$.current)return;$.current=!0;let M=!0;const L=Date.now()+cx;return(async()=>{for(;M&&Date.now()<L;){if(await Rg(1500),!M)return;try{const D=await Me.updateStatus();if(!M||(n(D),D.phase!=="staging"))return}catch{}}})().finally(()=>{$.current=!1}),()=>{M=!1}},[t==null?void 0:t.phase,b]);const{pathname:R}=Zn(),E=R===ut.setup;return o.jsxs(tA.Provider,{value:{status:t,checking:r,checkNow:v,checkError:p,dismissed:y,dismiss:w,apply:P,quit:N,thisComputer:f,busy:b,applyError:S},children:[e,b!=="restarting"&&f&&aK(t)&&!y&&!E&&o.jsx(hK,{}),b==="restarting"&&o.jsx(dK,{version:(t==null?void 0:t.stagedVersion)??(t==null?void 0:t.latest)??null})]})}function dK({version:e}){return o.jsxs(fK,{children:[o.jsx(iC,{size:22}),o.jsx("b",{children:e?`Updating to Scenri ${e}`:"Updating Scenri"}),o.jsx("small",{children:"Restarting. This page reconnects by itself."})]})}function fK({children:e,className:t}){return Rr.createPortal(o.jsx("div",{className:t?`sc-upd-overlay ${t}`:"sc-upd-overlay",role:"status","aria-live":"polite",children:o.jsx("div",{className:"sc-upd-overlay-card",children:e})}),document.body)}function hK(){const{status:e,dismiss:t,apply:n,busy:r,applyError:a}=qp(),i=yf();if(!e)return null;const c=oK(e),u=c.kind==="downloading"?"Downloading update…":c.kind==="ready"?`Scenri ${c.version} is ready`:c.kind==="stage-error"?"Couldn't download the update":"A new update is available",f=r==="applying"?"Updating…":c.kind==="stage-error"?"Try again":"Update",h=c.kind!=="announce"||c.oneClick;return o.jsxs("div",{className:"sc-upd-float",role:"status",children:[o.jsx(GU,{className:"sc-upd-float-dot",size:16,weight:"fill","aria-hidden":"true"}),o.jsxs("span",{className:"sc-upd-float-txt",children:[u,a&&c.kind!=="downloading"&&o.jsx("small",{children:a})]}),o.jsx("button",{type:"button",className:"sc-upd-float-later",onClick:t,children:c.kind==="ready"?"Later":"Not now"}),c.kind!=="downloading"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:r!=="idle",onClick:()=>h?void n():i("updates"),children:f})]})}function pK(e,t){return!e||t.updatedAt>=e.updatedAt}function mK(e,t){const n=e.findIndex(a=>a.id===t.id);if(n<0||e[n]===t||!pK(e[n],t))return e;const r=e.slice();return r[n]=t,r}function gK(e,t,n){if(!e)return t;const r=new Map(e.map(c=>[c.id,c]));let a=e.length===t.length;const i=t.map((c,u)=>{const f=r.get(c.id),h=f&&n.has(c.id)&&!(c.updatedAt>f.updatedAt)?f:c;return h!==e[u]&&(a=!1),h});return a?e:i}const gv=(e,t)=>`scenri:new-${e}-${t}`,vK=e=>bf.get(e),wK=(e,t)=>bf.set(e,t);function r0(e){bf.del(e),cs.del(e)}function Pg(e){var t,n,r;return!!((t=e.name)!=null&&t.trim())||!!((n=e.instruction)!=null&&n.trim())||!!((r=e.importUrl)!=null&&r.trim())||(e.facets??[]).length>0||(e.imageHashes??[]).length>0}const ux=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):[];function nA(e,t){const n=gv(e,t),r=vK(n);if(!r)return null;let a;try{a=JSON.parse(r)}catch{return r0(n),null}if(typeof a!="object"||a===null)return r0(n),null;const i=a;if(i.v!==1||i.brandId!==e||i.kind!==t)return r0(n),null;const c=Date.now()-Date.parse(i.updatedAt??"");return!Number.isFinite(c)||c>Qj?(r0(n),null):{v:1,brandId:e,kind:t,updatedAt:i.updatedAt,name:typeof i.name=="string"?i.name:"",instruction:typeof i.instruction=="string"?i.instruction:"",facets:ux(i.facets),imageHashes:ux(i.imageHashes),importUrl:typeof i.importUrl=="string"?i.importUrl:"",pending:typeof i.pending=="string"?i.pending:null}}function Lg(e,t,n){const r={v:1,brandId:e,kind:t,updatedAt:new Date().toISOString(),name:n.name??"",instruction:n.instruction??"",facets:n.facets??[],imageHashes:n.imageHashes??[],importUrl:n.importUrl??"",pending:n.pending??null};wK(gv(e,t),JSON.stringify(r))}function fu(e,t){r0(gv(e,t))}function yK(e,t,n){const r=nA(e,t);(r==null?void 0:r.pending)===n&&fu(e,t)}function bK(e,t){if(!e)return!1;if(e.pending===null)return!0;const n=t??"unknown";return n==="failed"||n==="cancelled"||n==="unknown"}const Xp=[{id:"portrait",tier:"core",gate:!0,from:[],strip:"Face",name:"face"},{id:"front",tier:"core",gate:!0,from:["portrait"],strip:"Full body",name:"full body"},{id:"three-quarter",tier:"core",from:["portrait","front"],strip:"Three-quarter",name:"three-quarter view"},{id:"back",tier:"supplementary",from:["portrait","front"],strip:"Back",name:"back view"},{id:"left",tier:"supplementary",from:["portrait","front"],strip:"Left",name:"left view"},{id:"right",tier:"supplementary",from:["portrait","front"],strip:"Right",name:"right view"}],xf=e=>Xp.filter(e).map(t=>t.id),rA=xf(()=>!0),xK=xf(e=>e.tier==="core"),kK=xf(e=>e.tier==="supplementary"),tc=Object.fromEntries(Xp.map(e=>[e.id,e.strip])),bn=Object.fromEntries(Xp.map(e=>[e.id,e.name])),Gl=e=>bn[e],sA=Object.fromEntries(Xp.map(e=>[e.id,e.from])),m6=new Set(xf(e=>e.gate===!0)),Do=e=>m6.has(e)?void 0:"auto",p0=4,dx=25*1024*1024,Wo=e=>xf(t=>{var n;return t.tier==="core"||!!e.extras||((n=e.views[t.id])==null?void 0:n.status)!=="empty"});function vv(e){return Wo(e).find(t=>e.views[t].status!=="approved")??null}const SK=e=>vv(e)===null,Ko=e=>e.views.portrait.status==="approved"||!!e.views.portrait.prior,nc=e=>e.stage!=="idle"||!!e.activeView;function aA(e){if(nc(e))return null;const t=vv(e);if(!t)return null;const n=e.views[t];return n.status!=="empty"&&n.status!=="stale"||n.error?null:sA[t].every(r=>e.views[r].status==="approved")?t:null}function oA(e,t){return t??(nc(e)?e.activeView:null)??vv(e)??"portrait"}function iA(e,t){return Wo(e).map(n=>{const r=e.views[n],a=n===t?"current":r.status==="approved"?"approved":r.status==="stale"?"stale":"todo";return{view:n,label:tc[n],state:a,hash:r.hash,photo:r.origin==="photo",drawing:e.activeView===n,approved:r.status==="approved",error:!!r.error}})}const EK={woman:"a woman",man:"a man",androgynous:"an androgynous person"},CK={woman:"her",man:"his",androgynous:"their"},Oh=/\b(wom[ae]n|m[ae]n|male|female|lady|ladies|girl|boy|guy|gentlem[ae]n|nonbinary|non-binary|androgynous|masculine|feminine|transgender|trans|mother|father|mum|mom|dad|sister|brother|daughter|son|grandmother|grandfather|she|he|her|his)\b/i,jK=/^(my|a|an|the|this|that|is|it|its|their|there|hey|hi|hello|yo|ok|okay|please|thanks|thank|you|your|dear|bro|bruh|dude|mate|sir|maam|madam|just|like|some)$/i;function AK(e){const t=e.trim().split(/[^\p{L}\p{N}']+/u).filter(Boolean);return t.some(n=>Oh.test(n))?t.every(n=>jK.test(n)||Oh.test(n)):!1}const wv=/\b(\d0s|\d{2}\s*(years|yo)|teen|twenties|thirties|forties|fifties|sixties|seventies|elderly|young|old(er)?|middle-aged|adult)\b/i,NK=120,MK=18;function RK(e){const t=e.match(/\d+/g);return t!=null&&t.length?t.every(n=>{const r=Number(n);return r>=MK&&r<=NK}):!1}const PK=/\b(hair|bald|shaved|buzz|blonde?|brunette|redhead|ginger|greying|silver|auburn|platinum)\b/i,LK=/\b(skin|complexion|fair|pale|light|olive|tan|tanned|brown|deep|dark|ebony|black|white|freckled|golden)\b/i,TK=/\b(wom[ae]n|m[ae]n|male|female|lady|ladies|girl|boy|guy|guys|gentlem[ae]n|nonbinary|non-binary|androgynous|masculine|feminine|transgender|trans|mother|father|mum|mom|dad|sister|brother|daughter|son|grandmother|grandfather|person|people|someone|somebody|model|teen|teenager|kid|child|adult|senior)\b/i,$K=/\b(hair|haired|curly|wavy|straight|braids?|bob|ponytail|bun|fringe|bangs|beard|beardless|moustache|mustache|stubble|goatee|clean-shaven|freckles?|glasses|spectacles|tattoos?|piercings?|eyes?|eyebrows?|brows|jaw|jawline|cheekbones|nose|lips|mouth|smile|smiling|face|features|forehead|dimples|scar|wrinkles|build|figure|frame|body|tall|short|slim|slender|athletic|average|fuller|curvy|broad|lean|muscular|petite|stocky|heavy|thin|plus.size|height|weight|presence|vibe|energy|look|looks|looking|calm|warm|confident|elegant|composed|friendly|serious|intense|soft|gentle|bright|energetic|quiet|poised|relaxed|playful|stern|kind|charming|handsome|beautiful|pretty|striking|rugged|graceful|sporty|nerdy|bookish|professional|corporate|casual|older|younger|taller|shorter|longer|slimmer|leaner|heavier|broader|bigger|smaller|thinner|thicker|softer|sharper|lighter|darker|natural|makeup|make-up|lipstick|jewelry|earrings)\b/i,DK=/\b(mediterranean|asian|indian|chinese|japanese|korean|african|nordic|scandinavian|latin[ao]?|hispanic|arab|arabic|middle eastern|european|caucasian|israeli|jewish|irish|italian|french|spanish|greek|turkish|persian|brazilian|mexican|american|british|german|dutch|russian|polish|thai|vietnamese|filipin[ao]|nigerian|ethiopian|moroccan|egyptian|australian|canadian|swedish|norwegian|danish|finnish|portuguese|indonesian|pakistani|iranian|lebanese|slavic|celtic|mixed|biracial)\b/i,ra=e=>TK.test(e)||wv.test(e)||PK.test(e)||LK.test(e)||$K.test(e)||DK.test(e);function HK(e,t){const n=t.trim();if(!n)return"";const r=[],a=e.steer&&!Oh.test(n)?EK[e.steer]:"";if(a&&r.push(a),e.age&&!wv.test(n)){const c=e.steer?CK[e.steer]:"their",u=e.age==="60+"?`in ${c} 60s or older`:`in ${c} ${e.age}`;r.push(a?u:`someone ${u}`)}const i=[];return i.length&&r.push(`with ${i.join(" and ")}`),r.length?`${r.join(" ")}, ${n}`:n}function OK(e,t){var r;const n=((r=e.analysis)==null?void 0:r.suitableCategories)??[];return!n.length||t.length?null:n}function lA(e){return rA.some(t=>{const n=e.views[t];return!!n.hash&&n.origin!=="photo"&&n.status!=="empty"})}function IK(e,t,n=!0){if(nc(e))return"Still drawing";const r=!n&&e.source==="photos"?["portrait"]:Wo(e);for(const a of r){const i=e.views[a];if(i.status==="candidate")return`Decide on the ${Gl(a)} first`;if(i.status==="stale")return`Redo the ${Gl(a)} first`;if(i.status!=="approved")return`Use the ${Gl(a)} first`}return t.trim()?null:"Give them a name"}const cA=/\b(hair|bald|fringe|bangs|beard|moustache|mustache|stubble|skin|freckles?|complexion|age|older|younger|\d0s|face|facial|jaw|chin|cheek(bone)?s?|nose|eyes?|brows?|eyebrows?|lips?|mouth|teeth|wrinkles?|build|weight|heavier|slimmer|thinner|leaner|broader|muscular|athletic|curvier|taller|shorter|height|gender|woman|man|feminine|masculine|glasses|tattoo|scar)\b/i;function uA(e,t,n){if(!e.trim())return{blocked:"Say what should change."};if(!Ko(n))return n.views.portrait.status!=="candidate"?{blocked:"Nothing to adjust yet."}:{view:"portrait",scope:"identity"};if(t==="portrait"||cA.test(e))return n.source==="photos"?{blocked:"Their photos define who they are. Change a drawn view instead."}:{view:"portrait",scope:"identity"};const a=n.views[t];return a.origin==="photo"?{blocked:"Your photo stands as it is. Pick a drawn view to change."}:a.status!=="approved"&&a.status!=="candidate"?{blocked:`Nothing drawn for the ${Gl(t)} yet.`}:{view:t,scope:"view"}}function fx(e,t){return Ko(t)?t.source==="photos"?"Changes this view only. Their photos define who they are.":e==="portrait"?"Changes the person. The other views are redrawn after you use it.":"Changes this view only. Hair, skin, age or build change the person.":"An adjustment keeps this person. Try again rolls a new one."}function FK(e,t,n){const r=e.trim(),a=uA(r||"this",t,n);if("blocked"in a)return r?{chip:null,hint:a.blocked,tone:"alert"}:{chip:null,hint:fx(t,n)};const i=Ko(n)?a.scope==="identity"?"Changing the person":`Refining the ${bn[a.view]}`:"Adjusting the face";return{chip:{view:a.view,label:i},hint:fx(t,n)}}const hx=e=>e.charAt(0).toUpperCase()+e.slice(1);function _K(e,t){var m,v,w,y;if(e.source!=="photos"||e.stage==="analyzing")return null;const n=(m=e.readError)==null?void 0:m.trim();if(n)return{text:`The photos could not be read: ${/[.!?]$/.test(n)?n:`${n}.`} Their face is drawn from them anyway.`,tone:"warn"};const r=(w=(v=e.analysis)==null?void 0:v.conflict)==null?void 0:w.trim();if(r)return{text:`These photos may show more than one person: ${r}`,tone:"warn"};const a=((y=e.analysis)==null?void 0:y.photos)??[];if(a.length&&a.every(b=>b.usable===!1))return null;const i=Wo(e),c=i.filter(b=>e.views[b].origin==="photo"),u=i.filter(b=>e.views[b].origin!=="photo"),f=b=>b.length<=2?b.map(Gl).join(" and "):`${b.slice(0,-1).map(Gl).join(", ")} and ${Gl(b[b.length-1])}`,h=c.length?`${hx(f(c))} from your ${c.length===1?"photo":"photos"}.`:"";if(!u.length)return{text:h};if(!t)return{text:[h||"The face is kept from your photo as it is.","The other views need an engine that can draw."].filter(Boolean).join(" ")};const p=u.length>=3&&c.length?"The rest are drawn from them.":`${hx(f(u))} ${u.length===1?"is":"are"} drawn from them.`;return{text:[h,p].filter(Boolean).join(" ")}}const dA=e=>{var t;return(e.activeView?(t=e.views[e.activeView])==null?void 0:t.startedAt:void 0)??e.updatedAt};function fA(e){var r;if(e.stage==="analyzing")return`Reading ${e.source==="photos"?"the photos":"the face"}`;const t=e.activeView;if(!t)return;const n=!!((r=e.views[t])!=null&&r.hash);return t==="portrait"?n?"Adjusting the face":"Drawing the face":`${n?"Redrawing":"Drawing"} the ${bn[t]}`}function yv(e,t){return hA(t).some(n=>!!e.views[n].hash)}function hA(e){const t=new Set;for(let n=!0;n;){n=!1;for(const r of rA)r===e||t.has(r)||sA[r].some(a=>a===e||t.has(a))&&(t.add(r),n=!0)}return[...t]}function ZK(e,t){const n=e.views[t].hash;return n?hA(t).some(r=>{const a=e.views[r];return!!a.hash&&!(a.conditionedOn??[]).includes(n)}):!1}function pA(e,t){const n=new Set,r=[];for(const a of e.results??[])a.view!==t||a.how==="restored"||n.has(a.hash)||(n.add(a.hash),r.push({n:r.length+1,hash:a.hash,current:e.views[t].hash===a.hash}));return r.length>1?r:[]}const VK=["hero","close","hands","angle","bold"],rc={hero:"Hero",close:"Close-up",hands:"Hands",angle:"Another angle",bold:"A bold one"},px={hero:"hero",close:"close-up",hands:"hands",angle:"other angle",bold:"bold one"},mA=(e,t)=>!!e&&e.status==="running"&&e.roles.includes(t)&&!e.done.includes(t)&&!e.failed.some(n=>n.role===t);function gA(e=[],t){const n=[];for(const r of VK){const a=e.find(c=>c.role===r);if(mA(t,r)||(t==null?void 0:t.status)==="running"&&t.done.includes(r)&&!a){n.push({role:r,state:"drawing",...a?{url:a.url,hash:a.hash}:{}});continue}if(a){n.push({role:r,state:"shown",url:a.url,hash:a.hash,earlier:a.earlier,...a.setup?{setup:a.setup}:{}});continue}const i=t==null?void 0:t.failed.find(c=>c.role===r);i&&n.push({role:r,state:"failed",error:i.error})}return n}function zK(e,t=[],n){return e.filter(r=>!t.some(a=>a.role===r)&&!mA(n,r))}function BK(e=[]){return e.filter(t=>t.earlier).map(t=>t.role)}function bv(e){if(e.status==="failed")return e.error??"The examples did not draw";if(e.status==="cancelled")return"Stopped";const t=e.total?` · ${e.done??0} of ${e.total}`:"";if(e.status==="running"){const n=e.step&&e.step in px?px[e.step]:null;return`${n?`Drawing the ${n}`:"Drawing examples"}${t}`}return e.done===1?"One example drawn":`${e.done??0} examples drawn`}const vA=50;function Io(e){return Date.parse(e.includes("T")?e:`${e.replace(" ","T")}Z`)}function Fi(e){return e.startedAt||e.createdAt}function sc(e,t=Date.now()){const n=Io(e);return Number.isNaN(n)?0:Math.max(0,Math.round((t-n)/1e3))}function xv(e,t=Date.now()){const n=sc(e,t);return n<20?"generating":n<60?"still generating":"taking longer than usual"}function ac(e,t=Date.now()){const n=sc(e,t),r=u=>String(u).padStart(2,"0"),a=Math.floor(n/3600),i=Math.floor(n%3600/60),c=n%60;return a>0?`${a}:${r(i)}:${r(c)}`:`${i}:${r(c)}`}function wA(e,t=Date.now()){const n=sc(e,t);if(n<45)return"just now";if(n<3600)return`${Math.round(n/60)}m ago`;if(n<86400)return`${Math.floor(n/3600)}h ago`;const r=Math.floor(n/86400);return r===1?"Yesterday":`${r}d ago`}function yA(e){if(!e)return 0;if(e.stage==="discovering")return e.discovered?15:8;if(e.stage==="fetching_products"){const t=Math.max(e.discovered,e.fetched,1);return 15+Math.min(45,Math.round(e.fetched/t*45))}if(e.stage==="processing_assets"){const t=Math.max(e.imagesTotal,1);return 60+Math.min(35,Math.round(e.imagesDone/t*35))}return e.stage==="completed"||e.stage==="no_catalog"?100:e.stage==="partial"?95:5}const bA=e=>e.setNames.length>0?`${e.setNames.join(", ")} · `:"";function g6(e,t,n=Date.now(),r=1){const a=bA(e),i=r>1?`${r} shots`:"ready",c=e.status==="running"?`${a}${xv(Fi(e),n)}`:e.status==="error"?`${a}${e.error??"failed"}`:e.status==="cancelled"?`${a}cancelled`:`${a}${i}`;return{id:`node:${e.id}`,kind:e.kind==="edit"?"edit":"generation",state:e.status,title:e.kind==="edit"?`Edit · ${Sr(e)}`:Sr(e),subtitle:c,thumb:e.images[0]??null,percent:null,startedAt:e.status==="running"?Fi(e):e.createdAt,href:Yp(t,null,e.id)}}function UK(e,t,n=Date.now()){var f,h;const r=[...e].sort((p,m)=>(p.batchIndex??0)-(m.batchIndex??0)),a=r[0];if(r.length===1)return g6(a,t,n);const i=r.filter(p=>p.status==="done"&&p.images.length>0),c=r.some(p=>p.status==="running")?"running":i.length?"done":r.some(p=>p.status==="error")?"error":"cancelled",u=g6({...a,status:c,images:((f=i[0])==null?void 0:f.images)??[],error:c==="error"?((h=r.find(p=>p.status==="error"))==null?void 0:h.error)??null:a.error},t,n,r.length);return c==="done"&&i.length<r.length?{...u,subtitle:`${bA(a)}${i.length} of ${r.length} shots`}:u}function WK(e){var t,n;return e.stage==="no_catalog"||e.stage==="failed"&&((n=(t=e.errors)==null?void 0:t[0])==null?void 0:n.code)==="empty_catalog"}function KK(e,t){const n=WK(e),r=n||e.stage==="completed"?"done":e.stage==="partial"?"partial":e.stage==="cancelled"?"cancelled":e.stage==="failed"?"error":"running";let a=e.url;try{a=new URL(e.url).hostname.replace(/^www\./,"")}catch{}const i=e.stage==="discovering"?e.discovered?`Found ${e.discovered.toLocaleString()} products`:"Looking for products":e.stage==="processing_assets"&&e.imagesTotal?`${e.imagesDone.toLocaleString()} of ${e.imagesTotal.toLocaleString()} pictures`:e.stage==="fetching_products"&&e.fetched>e.upserted&&e.discovered?`Reading ${e.fetched.toLocaleString()} of ${e.discovered.toLocaleString()} products`:e.discovered?`${e.upserted.toLocaleString()} of ${e.discovered.toLocaleString()} products`:`${e.upserted.toLocaleString()} products`;return{id:`catalog:${e.id}`,kind:"catalog",state:r,title:a,subtitle:n?"No shop on this site":r==="error"||r==="cancelled"||r==="partial"?e.message??"Import failed":i,thumb:null,percent:n?100:yA(e),startedAt:e.createdAt,href:Cu(t)}}function GK(e,t){const n=e.stage==="done"?"done":e.stage==="failed"?"error":e.stage==="cancelled"?"cancelled":"running",r=n==="error"?e.error??"failed":n==="cancelled"?"stopped":n==="done"?e.warnings[0]??e.coverage[0]??(e.kind==="presenter"?"Ready to cast":"Ready to use"):e.message??(e.kind==="presenter"?"Building the studio views":"Reading the references");return{id:`build:${e.id}`,kind:e.kind,state:n,title:e.name,subtitle:r,thumb:e.previewHash,percent:e.steps>0?Math.min(100,Math.round(e.step/e.steps*100)):null,startedAt:e.startedAt,href:e.assetId?e.kind==="presenter"?ha(t,e.assetId):_r(t,e.assetId):null}}function YK(e){if(e.kind==="examples")return bv(e);if(e.status==="failed")return e.error??"It did not finish";if(e.status==="cancelled")return"Stopped";if(e.kind==="scene")return e.status==="running"?e.step==="reading"?"Reading the place":e.step==="changing"?"Changing the words":"Drawing the picture":e.attachTo?"On its scene now":"The picture is drawn";const t=e.step&&e.step in bn?bn[e.step]:null;return e.status==="running"?t?`Drawing the ${t}`:"Reading the photos":e.awaiting&&t?`The ${t} is ready to look at`:e.total&&e.done===e.total?"Every view is drawn":e.total?`${e.done??0} of ${e.total} views`:"Drawn"}function qK(e,t){const n=e.status==="failed"?"error":e.status,r=e.kind==="examples"?e.sceneId?_r(t,e.sceneId):null:e.kind==="scene"?e.conversation?e.sceneId?pv(t,e.sceneId,e.conversation):Bi(t,e.conversation):e.attachTo?_r(t,e.attachTo):null:e.presenterId?Gp(t,e.presenterId):e.draftId?Ui(t,e.draftId):null;return{id:e.id,kind:e.kind==="examples"?"scene":e.kind,state:n,title:e.name.trim()||(e.kind==="presenter"?"New presenter":"New scene"),subtitle:YK(e),thumb:e.thumb,percent:e.kind!=="scene"&&e.total?Math.round((e.done??0)/e.total*100):null,startedAt:e.startedAt,href:r}}const mx=e=>e.startsWith("scene:")||e.startsWith("presenter:")||e.startsWith("examples:");function gx(e,t){return e?e.split("?")[0].replace(/\/$/,"")===t.replace(/\/$/,""):!1}function XK(e,t=12){const n=e.filter(a=>a.state==="running"),r=e.filter(a=>a.state!=="running").sort((a,i)=>Io(i.startedAt)-Io(a.startedAt)).slice(0,t);return n.sort((a,i)=>Io(a.startedAt)-Io(i.startedAt)),[...n,...r]}function QK(e,t,n=new Date){if(!e)return[];const r=[];for(const a of t){if(a.state==="running")continue;const i=e.get(a.id);i&&i.state!=="running"||r.push({id:a.id,kind:a.kind,state:a.state,title:a.title,subtitle:a.subtitle,thumb:a.thumb,at:n.toISOString(),href:a.href})}return r}function JK(e,t,n=vA){if(t.length===0)return e;const r=new Set(t.map(a=>a.id));return[...t,...e.filter(a=>!r.has(a.id))].sort((a,i)=>Io(i.at)-Io(a.at)).slice(0,n)}function eG(e,t){const n=e.filter(a=>!a.watched);if(!t)return n.length;const r=Io(t);return n.filter(a=>Io(a.at)>r).length}const xA=e=>`scenri:notifications-${e}`,kA=e=>`scenri:notifications-seen-${e}`,SA=e=>cs.get(e),EA=(e,t)=>cs.set(e,t);function vx(e){const t=SA(xA(e));if(!t)return[];try{const n=JSON.parse(t);return Array.isArray(n)?n:[]}catch{return[]}}const wx=(e,t)=>EA(xA(e),JSON.stringify(t.slice(0,vA))),yx=e=>SA(kA(e)),tG=(e,t)=>EA(kA(e),t);function Tg(e,t){return e===t?!0:e.length!==t.length?!1:JSON.stringify(e)===JSON.stringify(t)}const nG=1500,rG=5e3,CA=s.createContext(null);function Va(){const e=s.useContext(CA);if(!e)throw new Error("useTaskCenter must be used inside TaskCenterProvider");return e}function sG({brand:e,onActivity:t,children:n}){const r=Dn(),{push:a}=ir(),{refreshBrands:i}=Rn(),c=e.id,[u,f]=s.useState([]),[h,p]=s.useState([]),[m,v]=s.useState([]),w=s.useRef(e);w.current=e;const y=s.useRef([]);y.current=h;const[b,k]=s.useState(()=>vx(c)),[S,C]=s.useState(()=>yx(c)),[j,N]=s.useState(!1),P=s.useRef(null),$=s.useRef(new Set),R=s.useRef(0),E=s.useRef(new Set),M=s.useRef(i);M.current=i;const L=s.useRef(null),H=s.useRef(j);H.current=j;const D=s.useRef(r);D.current=r;const{pathname:K}=Zn(),O=s.useRef(!1);O.current=/\/(create|sets)(\/|$)/.test(K);const _=s.useRef(a);_.current=a;const re=s.useRef(t);re.current=t,s.useEffect(()=>{P.current=null,$.current=new Set,R.current=0,E.current=new Set,f([]),p([]),v([]),k(vx(c)),C(yx(c))},[c]);const z=s.useCallback(async()=>{var ne,W;let B,Y,ae;try{const[{nodes:he,jobs:Xe,studio:tt=[]},{builds:ze}]=await Promise.all([Me.activity(c),Me.assetBuilds(c)]);Y=ze,ae=tt,(ne=re.current)==null||ne.call(re,c,he);const nt=new Map,ce=[];for(const Pe of he)Pe.batchId?nt.set(Pe.batchId,[...nt.get(Pe.batchId)??[],Pe]):ce.push(Pe);const ve=Date.now();B=[...ce.map(Pe=>g6(Pe,w.current,ve)),...[...nt.values()].map(Pe=>UK(Pe,w.current,ve)),...Xe.map(Pe=>KK(Pe,w.current)),...ze.map(Pe=>GK(Pe,w.current)),...tt.map(Pe=>qK(Pe,w.current))]}catch{return}const X=Y.filter(he=>he.finished&&he.assetId&&!E.current.has(he.id)),le=new Set(Y.map(he=>he.id)),ke=y.current.some(he=>!he.finished&&!le.has(he.id)),te=ae.filter(he=>he.kind==="scene"&&he.status==="done"&&!!he.attachTo&&!E.current.has(he.id));for(const he of te)E.current.add(he.id);const be=ae.filter(he=>he.kind==="examples"&&(he.done??0)>0).map(he=>`${he.id}:${he.done}`).filter(he=>!E.current.has(he));for(const he of be)E.current.add(he);if(X.length||ke||te.length||be.length){for(const he of X)E.current.add(he.id),yK(c,he.kind,he.id);await M.current()}p(he=>Tg(he,Y)?he:Y),v(he=>Tg(he,ae)?he:ae);const G=QK(P.current,B);P.current=new Map(B.map(he=>[he.id,he])),R.current=B.filter(he=>he.state==="running").length;const J=XK(B);if(f(he=>Tg(he,J)?he:J),G.length!==0&&(k(he=>{const Xe=window.location.pathname,tt=G.map(nt=>mx(nt.id)&&gx(nt.href,Xe)?{...nt,watched:!0}:O.current&&nt.state!=="error"?{...nt,watched:!0}:nt),ze=JK(he,tt);return wx(c,ze),ze}),!H.current))for(const he of G){if($.current.has(he.id)||($.current.add(he.id),he.state==="cancelled"))continue;if(mx(he.id)){if(gx(he.href,window.location.pathname))continue;const ze=he.href,nt=ze?[{label:"Open",onClick:()=>D.current(ze)}]:void 0;if(he.state==="error"){_.current({kind:"error",title:`${he.title} did not finish`,detail:he.subtitle,actions:nt});continue}_.current({kind:"success",title:he.id.startsWith("examples:")?`${he.title} examples are ready`:`${he.title} is drawn`,detail:he.kind==="presenter"?he.subtitle:void 0,actions:nt});continue}if(he.state!=="error"&&O.current&&he.kind!=="presenter"&&he.kind!=="scene")continue;const Xe=he.href,tt=Xe?{label:"View",onClick:()=>D.current(Xe)}:void 0;if(he.state==="error"){const ze=O.current&&(he.kind==="generation"||he.kind==="edit");_.current({kind:"error",title:`${he.title} failed`,detail:he.subtitle,action:tt,quiet:ze});continue}if(he.kind==="presenter"||he.kind==="scene"){const ze=he.id.startsWith("build:")?((W=Y.find(nt=>`build:${nt.id}`===he.id))==null?void 0:W.assetId)??null:null;_.current({kind:"success",title:`${he.title} is ready`,detail:he.subtitle,actions:Xe?[{label:he.kind==="presenter"?"View presenter":"View scene",onClick:()=>D.current(Xe)},{label:"Use in a shot",onClick:()=>D.current(`${mr(w.current)}?${he.kind==="presenter"?"presenter":"scene"}=${ze}&compose=1`)}]:void 0});continue}if(he.kind==="catalog"&&he.state==="partial"){_.current({kind:"warning",title:"Some products did not import",detail:he.subtitle,action:tt});continue}_.current({kind:"success",title:he.kind==="catalog"?"Import finished":"Generation finished",detail:he.kind==="catalog"?he.title:void 0,action:tt})}},[c]);s.useEffect(()=>{let B=null,Y=!0;const ae=async()=>{if(!Y||(document.hidden||await z(),!Y))return;const le=!document.hidden&&R.current>0;B=setTimeout(ae,le?nG:rG)},X=()=>{B&&clearTimeout(B),B=null,document.hidden||ae()};return L.current=X,ae(),document.addEventListener("visibilitychange",X),window.addEventListener("focus",X),()=>{Y=!1,L.current=null,B&&clearTimeout(B),document.removeEventListener("visibilitychange",X),window.removeEventListener("focus",X)}},[z]);const F=s.useCallback(()=>{var B;return(B=L.current)==null?void 0:B.call(L)},[]),Q=s.useCallback(()=>{const B=new Date().toISOString();C(B),tG(c,B)},[c]),V=s.useCallback(()=>{k([]),wx(c,[]),Q()},[c,Q]),I=s.useMemo(()=>({tasks:u,running:u.filter(B=>B.state==="running").length,builds:h,studio:m,feed:b,unread:eG(b,S),markSeen:Q,clearFeed:V,panelOpen:j,setPanelOpen:N,poke:F}),[u,h,m,b,S,Q,V,j,F]);return o.jsx(CA.Provider,{value:I,children:n})}const jA=["primary","mark","wordmark","monochrome","alternate"],kv=["light","dark","any"],U1={primary:"Primary logo",mark:"Mark",wordmark:"Wordmark",monochrome:"Monochrome",alternate:"Alternate"},aG=/^[a-f0-9]{32}$/,oG=e=>{const t=String(e??"");if(!t.startsWith("asset:"))return null;const n=t.slice(6);return aG.test(n)?n:null},iG=e=>jA.includes(e)?e:"primary",lG=e=>kv.includes(e)?e:"any";function kf(e){return(Array.isArray(e==null?void 0:e.logos)?e.logos:[]).filter(n=>n&&String(n.file??"").trim()).map(n=>{const r=oG(n.file),a=String(n.clearSpace??"").trim();return{hash:r,file:String(n.file),role:iG(n.role),background:lG(n.background),...a?{clearSpace:a}:{},attachable:r!==null}})}function Sf(e){return kf(e).filter(t=>t.attachable)}function Qp(e){return e.find(t=>t.role==="primary")??e[0]??null}function cG(e){return Qp(kf(e))}function uG(e){const t=kf(e);return t.find(n=>n.role==="mark")??Qp(t)}function dG(e){const t=kf(e).filter(a=>a.hash),n=t.find(a=>a.role==="mark");if(n)return{mark:n,square:!0};const r=Qp(t);return!r||r.role==="wordmark"?null:{mark:r,square:!1}}const fG=1.6,hG=(e,t)=>t>0&&e/t<=fG;function pG(e,t){const n=(i,c)=>Math.min(c-1,Math.max(0,Math.round(i*(c-1))));return[[n(.5,e),n(.03,t)],[n(.5,e),n(1-.03,t)],[n(.03,e),n(.5,t)],[n(1-.03,e),n(.5,t)],[n(.12,e),n(.12,t)],[n(1-.12,e),n(.12,t)],[n(.12,e),n(1-.12,t)],[n(1-.12,e),n(1-.12,t)]]}const mG=e=>e.length>0&&e.every(t=>t>=200);function Jp(e,t){var a;const n={primary:"logo",mark:"mark",wordmark:"wordmark",monochrome:"monochrome logo",alternate:"alternate logo"},r=String(((a=e==null?void 0:e.meta)==null?void 0:a.name)??"").trim();return r?`${r} ${n[t.role]}`:`Brand ${n[t.role]}`}function Sv(e){const{brand:t}=on(),{pathname:n}=Zn(),r=!!un(ut.brand),a=!!un({path:ut.hub,end:!1}),i=!!un({path:ut.set,end:!1}),c=a||i,u=!!un({path:ut.products,end:!1}),f=!!un({path:ut.scenes,end:!1}),h=!!un({path:ut.presenters,end:!1}),p=m=>m?"fill":"regular";return[{key:"home",label:"Home",icon:o.jsx(QU,{size:e,weight:p(r)}),active:r,to:mo(t)},{key:"create",label:"Create",icon:o.jsx(oW,{size:e,weight:p(c)}),active:c,to:c?`${n}?compose=1`:`${mr(t)}?compose=1`},{key:"products",label:"Products",icon:o.jsx(Bp,{size:e,weight:p(u)}),active:u,to:Cu(t)},{key:"presenters",label:"Presenters",icon:o.jsx(Vp,{size:e,weight:p(h)}),active:h,to:Uo(t)},{key:"scenes",label:"Scenes",icon:o.jsx(Zp,{size:e,weight:p(f)}),active:f,to:Kl(t)}]}const ca=e=>{var t,n;return((n=(t=e.json)==null?void 0:t.meta)==null?void 0:n.name)??e.slug};function gG(e){return([...e.trim()].find(n=>new RegExp("\\p{L}|\\p{N}","u").test(n))??"?").toUpperCase()}function vG(e){const t=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!t)return"#ffffff";const[n,r,a]=[0,2,4].map(c=>Number.parseInt(t[1].slice(c,c+2),16)/255),i=c=>c<=.03928?c/12.92:((c+.055)/1.055)**2.4;return .2126*i(n)+.7152*i(r)+.0722*i(a)>.42?"#0a0a0a":"#ffffff"}const bx=new Map;function wG(e,t){const n=e.naturalWidth,r=e.naturalHeight,a=t||hG(n,r);let i=!1;try{const c=document.createElement("canvas");c.width=n,c.height=r;const u=c.getContext("2d",{willReadFrequently:!0});u&&(u.drawImage(e,0,0),i=mG(pG(n,r).map(([f,h])=>u.getImageData(f,h,1,1).data[3])))}catch{}return{fits:a,bleed:i}}function AA({brand:e,size:t=20,round:n=!1}){var h,p,m;const[,r]=s.useReducer(v=>v+1,0),a=dG(e.json),i=a?Kp(a.mark.file,"micro"):null,c=i?bx.get(i):void 0,u=i&&(c!=null&&c.fits)?i:null,f=((m=(p=(h=e.json)==null?void 0:h.palette)==null?void 0:p.primary)==null?void 0:m.hex)??"#6b6b6b";return o.jsxs("span",{className:"sc-brand-av","data-logo":u?"":void 0,"data-bleed":u&&(c!=null&&c.bleed)?"":void 0,"data-round":n||void 0,style:{width:t,height:t,fontSize:Math.round(t*.5),...u?{}:{background:f,color:vG(f)}},"aria-hidden":!0,children:[u?o.jsx("img",{src:u,alt:""}):gG(ca(e)),i&&!c&&o.jsx("img",{src:i,alt:"",hidden:!0,onLoad:v=>{bx.set(i,wG(v.currentTarget,!!(a!=null&&a.square))),r()}})]})}function yG(){const e=Sv(22);return o.jsx("nav",{className:"sc-tabbar","aria-label":"Main",children:o.jsx("ul",{children:e.map(t=>o.jsx("li",{children:o.jsxs(_n,{to:t.to,"data-on":t.active||void 0,"data-guide":`nav.${t.key}`,"aria-current":t.active?"page":void 0,children:[o.jsx("span",{className:"sc-tab-ic",children:t.icon}),o.jsx("span",{className:"sc-tab-lb",children:t.label})]})},t.key))})})}function bG({value:e,size:t,stroke:n=1.5,indeterminate:r=!1}){const a=(t-n)/2,i=2*Math.PI*a,c=Math.max(0,Math.min(1,e)),u=f=>o.jsx("circle",{className:"sc-ring-arc",cx:t/2,cy:t/2,r:a,fill:"none",strokeWidth:n,strokeLinecap:"round",strokeDasharray:f,strokeDashoffset:r?0:i*(1-c),transform:`rotate(-90 ${t/2} ${t/2})`});return o.jsxs("svg",{className:"sc-ring",width:t,height:t,viewBox:`0 0 ${t} ${t}`,"aria-hidden":"true",children:[!r&&o.jsx("circle",{className:"sc-ring-track",cx:t/2,cy:t/2,r:a,fill:"none",strokeWidth:n}),r?o.jsx("g",{className:"sc-ring-spin",children:u(`${i*.28} ${i}`)}):null,!r&&c>0?u(String(i)):null]})}function xG({mode:e,lead:t,running:n,unread:r,animate:a}){const i=kG(a);if(e==="busy"&&t){const c=t.percent!==null;return o.jsx("span",{className:"sc-act-face","data-swap":i||void 0,"aria-hidden":"true",children:o.jsxs("span",{className:"sc-act-ring","data-bare":t.thumb?void 0:"",children:[o.jsx(bG,{value:c?(t.percent??0)/100:0,indeterminate:!c,size:32}),t.thumb?o.jsx("img",{src:dn(t.thumb,"micro"),alt:"",loading:"lazy",decoding:"async"}):o.jsx(Cg,{size:16}),n>1&&o.jsx("span",{className:"sc-act-n",children:n})]})})}return e==="new"?o.jsx("span",{className:"sc-act-face","data-swap":i||void 0,"aria-hidden":"true",children:o.jsxs("span",{className:"sc-act-bell",children:[o.jsx(Cg,{size:18}),o.jsx("span",{className:"sc-act-n",children:r>9?"9+":r})]})}):o.jsx("span",{className:"sc-act-face","data-swap":i||void 0,"aria-hidden":"true",children:o.jsx(Cg,{size:18})})}function kG(e){return s.useRef(e).current}const NA="the engine",SG=[{re:/Codex plan's usage limit is used up/i,kind:"credit",title:()=>"",remedy:{label:"Use a provider key instead",opens:"engines"},retryable:!1},{re:/environment is overriding that sign-in/i,kind:"auth",title:()=>"An API key on this computer is overriding your Codex sign-in.",fix:"Tell Scenri to ignore it, then run this again.",remedy:{label:"Fix this",opens:"setup"},retryable:!0},{re:/codex.*(not logged in|login required|\b401\b|unauthorized|token.*expired)/i,kind:"auth",title:()=>"Codex is signed out on this machine.",fix:"Sign in with your ChatGPT account, then run this again.",remedy:{label:"Sign in",opens:"setup"},retryable:!1},{re:/HTTP 401\b|missing authentication|no auth credentials|invalid api key|unauthorized/i,kind:"auth",title:e=>`${Ja(e)} did not accept your API key.`,fix:"Add or replace the key, then run this again.",remedy:{label:"Add key",opens:"engines"},retryable:!1},{re:/HTTP 403\b|forbidden/i,kind:"auth",title:e=>`${Ja(e)} refused this key.`,fix:"It may not cover the model this shot asked for.",remedy:{label:"Check key",opens:"engines"},retryable:!1},{re:/spend cap for .*would exceed it|spend cap for/i,kind:"budget",title:e=>`This would go past your monthly cap for ${e}.`,fix:"Raise the cap, or wait for the month to roll over.",remedy:{label:"Open budget",opens:"budget"},retryable:!1},{re:/HTTP 402\b|insufficient (credit|funds|balance)|out of credit|billing|payment required/i,kind:"credit",title:e=>`${Ja(e)} is out of credit.`,fix:"Top up with the provider, then run this again.",retryable:!0},{re:/HTTP 429\b|rate.?limit|too many requests/i,kind:"rate",title:e=>`${Ja(e)} is rate limiting this key.`,fix:"Give it a minute, then try again.",retryable:!0},{re:/moderation|content policy|safety system|flagged|violat(es|ion)|blocked by/i,kind:"policy",title:e=>`${Ja(e)} declined this brief.`,fix:"Reword what you asked for and run it again.",retryable:!1},{re:/cannot carry enough reference images/i,kind:"references",title:()=>"",remedy:{label:"Choose engine",opens:"engines"},retryable:!1},{re:/no usable photo/i,kind:"references",title:()=>"",retryable:!1},{re:/cannot produce the requested aspect ratio|engine returned \d+x\d+ for a \d+x\d+ request/i,kind:"format",title:e=>`${Ja(e)} cannot make this shape.`,fix:"Pick another format, or an engine that can.",remedy:{label:"Choose engine",opens:"engines"},retryable:!1},{re:/HTTP 404\b|model not found|no endpoints found|no allowed providers/i,kind:"model",title:e=>`${Ja(e)} has no model for this shot.`,fix:"Pick another engine in the composer, or connect one in Providers.",remedy:{label:"Providers",opens:"engines"},retryable:!1},{re:/failed to spawn codex|codex.*enoent|command not found/i,kind:"setup",title:()=>"Codex is not installed on this machine.",fix:"Run setup once and this works from then on.",remedy:{label:"Set up Codex",opens:"setup"},retryable:!1},{re:/code-mode host/i,kind:"setup",title:()=>"Codex could not start its tool host.",fix:"A Windows setting is blocking it. Set SafeDllSearchMode to 1 and restart Windows.",retryable:!1},{re:/could not verify codex/i,kind:"setup",title:()=>"Scenri could not verify Codex.",fix:"Open setup and check again. If Codex was just installed, restart Scenri.",remedy:{label:"Check Codex",opens:"setup"},retryable:!0},{re:/codex cli .* is too old|Scenri needs \d+\.\d+\.\d+ or newer/i,kind:"setup",title:()=>"Codex CLI needs an update.",fix:"Update Codex, then run this again.",remedy:{label:"Update Codex",opens:"setup"},retryable:!1},{re:/\brun aborted\b/i,kind:"cancelled",title:()=>"You stopped this shot.",fix:"The prompt is kept. Run it again whenever.",retryable:!0},{re:/produced no output for \d+s/i,kind:"timeout",title:()=>"Codex never started answering.",fix:"Try again. If it keeps happening, run Codex once in a terminal to check it still works.",retryable:!0},{re:/Codex CLI timed out after/i,kind:"timeout",title:()=>"Codex ran out of time on this shot.",fix:"Try again. Fewer variants or fewer reference photos finish faster.",retryable:!0},{re:/generation timed out after \d+ minutes?/i,kind:"timeout",title:()=>"This run hit the overall time limit.",fix:"Try again, with fewer variants if it repeats.",retryable:!0},{re:/timed out|ETIMEDOUT/i,kind:"timeout",title:e=>`${Ja(e)} took too long to answer.`,fix:"Try again.",retryable:!0},{re:/ENOTFOUND|ECONNREFUSED|ECONNRESET|EAI_AGAIN|fetch failed|network error/i,kind:"network",title:e=>`Could not reach ${e}.`,fix:"Check your connection, then try again.",retryable:!0},{re:/interrupted\W+server restarted/i,kind:"restarted",title:()=>"Scenri restarted while this was rendering.",fix:"The shot was lost, not the brief. Run it again.",retryable:!0},{re:/HTTP 5\d\d\b|internal server error|bad gateway|service unavailable|overloaded|upstream/i,kind:"server",title:e=>`${Ja(e)} had a problem on its end.`,fix:"Nothing wrong with your brief. Try again shortly.",retryable:!0},{re:/produced no images|returned no image|no images returned|finished but produced no/i,kind:"empty",title:e=>`${Ja(e)} finished without making a picture.`,fix:"Run it again. This usually clears on a second try.",retryable:!0}];function Ja(e){return e===NA?"The engine":e}function Ef(e,t){const n=(e??"").trim(),r=(t??"").replace(/\s*\(BYOK\)\s*$/i,"").trim()||NA;if(!n)return{kind:"unknown",title:"This shot did not finish.",raw:"",retryable:!0};for(const a of SG){if(!a.re.test(n))continue;const i=a.title(r)||EG(n);return{kind:a.kind,title:i,fix:a.fix,raw:n,remedy:a.remedy,retryable:a.retryable}}return{kind:"unknown",title:"This shot did not finish.",raw:n,retryable:!0}}function MA(){return{kind:"cancelled",title:"You stopped this shot.",fix:"The prompt is kept. Run it again whenever.",raw:"",retryable:!0}}function nn(e,t,n){const r=e instanceof Error?e.message:typeof e=="string"?e:String((e==null?void 0:e.message)??e),a=Ef(r,n),i=a.kind==="unknown"?a.raw||void 0:[a.title,a.fix].filter(Boolean).join(" ");return{kind:"error",title:t,detail:i}}function EG(e){const t=e.trim();if(!t)return t;const n=t[0].toUpperCase()+t.slice(1);return/[.!?]$/.test(n)?n:`${n}.`}function xx({onClose:e,onSeen:t,onOpenDetail:n}){const{tasks:r,feed:a,unread:i,clearFeed:c}=Va(),u=r.filter(S=>S.state==="running"),{brand:f}=on(),{push:h}=ir(),p=AG(1e3),m=s.useRef(null),v=s.useRef(null),w=s.useRef(!1);s.useEffect(()=>{var S;!w.current||a.length>0||(w.current=!1,(S=m.current)==null||S.focus({preventScroll:!0}))},[a.length]);const y=()=>{w.current=!0,c()},b=S=>{var C;S.detail===0&&((C=v.current)==null||C.focus({preventScroll:!0})),t()},k=S=>{if(S.startsWith("node:")){Me.cancelNode(S.slice(5)).catch(C=>h(nn(C,"Could not cancel this shot")));return}if(S.startsWith("build:")){Me.cancelAssetBuild(f.id,S.slice(6)).catch(C=>h(nn(C,"Could not stop this build")));return}if(S.startsWith("scene:")){Me.cancelSceneStudioJob(f.id,S.slice(6)).catch(C=>h(nn(C,"Could not stop this scene")));return}if(S.startsWith("presenter:")){const C=S.split(":")[1]??"";Me.stopDraft(f.id,C).catch(j=>h(nn(j,"Could not stop this presenter")));return}S.startsWith("catalog:")&&Me.cancelCatalogJob(f.id,S.slice(8)).catch(C=>h(nn(C,"Could not stop this import")))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-menu-head",children:"Activity"}),u.length>0&&o.jsxs("section",{"aria-label":"In progress",children:[o.jsx("h3",{className:"sc-notif-label",children:"In progress"}),u.map(S=>o.jsx(CG,{task:S,now:p,onNavigate:e,onCancel:k,onOpenDetail:n},S.id))]}),a.length===0&&u.length===0?o.jsx("p",{ref:m,tabIndex:-1,className:"sc-notif-empty",children:"Work that finishes shows up here."}):o.jsxs("section",{"aria-label":"Notifications",children:[o.jsxs("div",{className:"sc-notif-label",children:[o.jsx("h3",{children:"Notifications"}),a.length>0&&o.jsxs("span",{className:"sc-notif-acts",children:[i>0&&o.jsx("button",{type:"button",className:"sc-notif-seen",onClick:b,children:"Mark all read"}),o.jsx("button",{ref:v,type:"button",className:"sc-notif-clear",onClick:y,children:"Clear all"})]})]}),a.length===0?o.jsx("p",{ref:m,tabIndex:-1,className:"sc-notif-empty",children:"Work that finishes shows up here."}):o.jsx("div",{className:"sc-notif-scroll",children:a.map(S=>o.jsx(jG,{item:S,now:p,onNavigate:e,onSeen:t},S.id))})]})]})}function RA({task:e}){return e.thumb?o.jsx("img",{src:dn(e.thumb,"micro"),alt:"",loading:"lazy",decoding:"async"}):e.state==="running"?o.jsx("span",{className:"sc-shimmer"}):e.state==="error"?o.jsx(Sc,{size:17,weight:"fill"}):e.state==="cancelled"?o.jsx(hW,{size:17,color:"var(--sc-fg3)"}):e.kind==="catalog"?o.jsx(Sj,{size:17}):e.kind==="presenter"?o.jsx(Vp,{size:17}):e.kind==="scene"?o.jsx(Zp,{size:17}):o.jsx(Ws,{size:17})}function CG({task:e,now:t,onNavigate:n,onCancel:r,onOpenDetail:a}){const i=e.state==="running",c=e.id.startsWith("node:")||e.id.startsWith("build:")||e.id.startsWith("catalog:"),u=i&&sc(e.startedAt,t)>=60,f=i&&e.id.startsWith("catalog:")?e.id.slice(8):null,h=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-notif-thumb",children:o.jsx(RA,{task:e})}),o.jsxs("span",{className:"sc-notif-txt",children:[o.jsx("b",{dir:"auto",children:e.title}),o.jsx("small",{dir:"auto",children:e.subtitle}),i&&e.percent!==null?o.jsx("span",{className:"sc-notif-meter",children:o.jsx("div",{style:{width:`${e.percent}%`}})}):null]}),o.jsx("span",{className:"sc-notif-time",children:i?ac(e.startedAt,t):wA(e.startedAt,t)})]});return o.jsxs("div",{className:"sc-notif-row-wrap",children:[f?o.jsx("button",{type:"button",className:"sc-notif-row","data-state":e.state,"data-running":i||void 0,onClick:()=>a(f),children:h}):e.href?o.jsx(_n,{className:"sc-notif-row","data-state":e.state,"data-running":i||void 0,to:e.href,onClick:n,children:h}):o.jsx("button",{type:"button",className:"sc-notif-row","data-state":e.state,"data-running":i||void 0,disabled:!0,children:h}),i&&c&&o.jsx("button",{type:"button",className:"sc-notif-row-cancel","data-urgent":u||void 0,onClick:p=>{p.stopPropagation(),r(e.id)},children:"Cancel"})]})}function jG({item:e,now:t,onNavigate:n,onSeen:r}){const a=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-notif-thumb",children:o.jsx(RA,{task:e})}),o.jsxs("span",{className:"sc-notif-txt",children:[o.jsx("b",{dir:"auto",children:e.title}),o.jsx("small",{dir:"auto",children:e.subtitle})]}),o.jsx("span",{className:"sc-notif-time",children:wA(e.at,t)})]});return e.href?o.jsx(_n,{className:"sc-notif-row","data-state":e.state,to:e.href,onClick:()=>{r(),n()},children:a}):o.jsx("button",{type:"button",className:"sc-notif-row","data-state":e.state,disabled:!0,children:a})}function AG(e){const[t,n]=s.useState(()=>Date.now());return s.useEffect(()=>{const r=setInterval(()=>n(Date.now()),e);return()=>clearInterval(r)},[e]),t}function td(e){const t=s.useRef(null),n=s.useRef(null),r=s.useRef(0),a=u=>{u.pointerType==="mouse"&&u.button!==0||(n.current={y:u.clientY,t:u.timeStamp},r.current=0,t.current&&(t.current.style.transition="none"),u.currentTarget.setPointerCapture(u.pointerId))},i=u=>{!n.current||!t.current||(r.current=Math.max(0,u.clientY-n.current.y),t.current.style.transform=`translateY(${r.current}px)`)},c=u=>{const f=n.current;if(n.current=null,!f||!t.current)return;t.current.style.transition="";const h=r.current/Math.max(1,u.timeStamp-f.t);if(r.current>96||h>.45){e();return}t.current.style.transform=""};return{sheet:t,grip:{onPointerDown:a,onPointerMove:i,onPointerUp:c,onPointerCancel:c}}}function PA({label:e,onClose:t,children:n}){const{sheet:r,grip:a}=td(t);return s.useEffect(()=>{const i=c=>{c.key==="Escape"&&t()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[t]),Rr.createPortal(o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-notif-scrim",onClick:t,"aria-hidden":!0}),o.jsxs("div",{ref:r,className:"sc-notif-sheet",role:"dialog","aria-modal":"true","aria-label":e,children:[o.jsx("div",{className:"sc-shotsheet-grip",...a,children:o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0})}),n]})]}),document.body)}function LA(e,t){const{pathname:n}=Zn(),r=s.useRef(t);r.current=t,s.useEffect(()=>{r.current()},[n]),s.useEffect(()=>{if(!e)return;const a=()=>r.current();return window.addEventListener("scenri:modal-open",a),()=>window.removeEventListener("scenri:modal-open",a)},[e])}const NG=new Set(["Shift","Control","Alt","AltGraph","Meta","CapsLock","Fn","FnLock","Hyper","Super","OS"]);let Ih=null;function kx(e){Ih!==e&&(Ih=e,document.documentElement.dataset.input=e)}function MG(){const e=n=>{n.isComposing||n.key==="Unidentified"||NG.has(n.key)||kx("keyboard")},t=()=>kx("pointer");return window.addEventListener("keydown",e,!0),window.addEventListener("pointerdown",t,!0),()=>{window.removeEventListener("keydown",e,!0),window.removeEventListener("pointerdown",t,!0)}}function RG(){return Ih}function em(e){return Ih!=="pointer"&&e.matches(":focus-visible")}function or({label:e,open:t,children:n}){return o.jsx(lv,{content:e,className:"sc-tip",maxWidth:"220px",...t?{open:!0}:{},children:$A(n)})}function TA(e,t,n){return n?t:o.jsx(or,{label:e,children:t})}function $A(e){const t=e.props.onFocus;return s.cloneElement(e,{onFocus:n=>{t==null||t(n),RG()==="pointer"&&n.preventDefault()}})}function Ts({open:e=!0,className:t,maxWidth:n,described:r,children:a,onDismiss:i,onOpenAutoFocus:c,onCloseAutoFocus:u,onPaste:f,tone:h}){const{sheet:p,grip:m}=td(i);s.useEffect(()=>{e&&window.dispatchEvent(new CustomEvent("scenri:modal-open"))},[e]);const v=c??sK,w=u;return o.jsx(hc,{open:e,onOpenChange:y=>!y&&i(),children:o.jsxs(pc,{children:[o.jsx(mc,{className:"sc-newdlg-scrim","data-tone":h}),o.jsx(gc,{className:"sc-newdlg-layer",...r?{}:{"aria-describedby":void 0},onOpenAutoFocus:v,onCloseAutoFocus:w,onPaste:f,onPointerDown:y=>{y.target===y.currentTarget&&i()},children:o.jsxs("div",{ref:p,className:["sc-newdlg",t].filter(Boolean).join(" "),style:n?{"--sc-newdlg-max":n}:void 0,children:[o.jsx("div",{className:"sc-shotsheet-grip",...m,children:o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0})}),a]})})]})})}function ds({className:e,children:t}){return o.jsx(vc,{className:e,children:t})}const As=s.forwardRef(function({children:t,...n},r){return o.jsx(bp,{asChild:!0,ref:r,...n,children:t})});function nd({className:e,children:t}){return o.jsx(k4,{className:e,children:t})}const Sx=300,PG={queued:"Waiting to start",discovering:"Looking through the site",fetching_products:"Reading products",processing_assets:"Saving pictures",completed:"Finished",partial:"Finished, with some gaps",no_catalog:"No shop on this site",cancelled:"Stopped",failed:"Could not finish"};function v6({brandId:e,jobId:t,onDismiss:n}){const[r,a]=s.useState(null),[i,c]=s.useState(!1);s.useEffect(()=>{let m=!1,v;const w=async()=>{try{const y=await Me.catalogJob(e,t);if(m)return;a(y),y.finishedAt||(v=setTimeout(w,Sx))}catch{m||(v=setTimeout(w,Sx*3))}};return w(),()=>{m=!0,v&&clearTimeout(v)}},[e,t]);const u=!!r&&!r.finishedAt,f=r?yA(r):0,h=(r==null?void 0:r.errors)??[],p=async()=>{c(!0);try{await Me.cancelCatalogJob(e,t)}catch{c(!1)}};return o.jsxs(Ts,{open:!0,className:"sc-imp",maxWidth:"440px",described:!0,onDismiss:n,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:"Importing products"}),o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]}),o.jsx(nd,{className:"sc-imp-sub",children:o.jsxs("span",{role:"status",children:[r?PG[r.stage]??"Working":"Getting the details",r!=null&&r.message?` · ${r.message}`:""]})}),u&&o.jsx("span",{className:"sc-imp-meter",role:"progressbar","aria-label":"Import progress","aria-valuenow":f,"aria-valuemin":0,"aria-valuemax":100,children:o.jsx("div",{style:{width:`${f}%`}})}),o.jsxs("ul",{className:"sc-imp-lines",children:[o.jsxs("li",{children:[o.jsx("span",{children:"Found on the site"}),o.jsx("b",{children:((r==null?void 0:r.discovered)??0).toLocaleString()})]}),o.jsxs("li",{children:[o.jsx("span",{children:"Read"}),o.jsx("b",{children:((r==null?void 0:r.fetched)??0).toLocaleString()})]}),o.jsxs("li",{children:[o.jsx("span",{children:"Saved"}),o.jsx("b",{children:((r==null?void 0:r.upserted)??0).toLocaleString()})]}),o.jsxs("li",{children:[o.jsx("span",{children:"Pictures"}),o.jsxs("b",{children:[((r==null?void 0:r.imagesDone)??0).toLocaleString(),r!=null&&r.imagesTotal?` of ${r.imagesTotal.toLocaleString()}`:""]})]})]}),h.length>0&&o.jsxs("details",{className:"sc-imp-errs",children:[o.jsx("summary",{children:h.length===1?"1 thing went wrong":`${h.length} things went wrong`}),o.jsx("ul",{children:h.slice(0,8).map((m,v)=>o.jsx("li",{children:m.message},v))})]}),o.jsxs("div",{className:"sc-imp-foot",children:[u?o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void p(),disabled:i,children:i?"Stopping":"Stop importing"}):o.jsx("span",{className:"sc-imp-done",children:(r==null?void 0:r.stage)==="cancelled"?"Stopped. What was already imported is kept.":"Nothing left to do."}),o.jsx("button",{type:"button",className:"sc-wiz-cta",onClick:n,children:u?"Leave it running":"Close"})]})]})}const Ks="(max-width: 767px)";function wr(e){const[t,n]=s.useState(()=>window.matchMedia(e).matches);return s.useEffect(()=>{const r=window.matchMedia(e),a=()=>n(r.matches);return a(),r.addEventListener("change",a),()=>r.removeEventListener("change",a)},[e]),t}const Ex=new Map;function LG(e){let t=Ex.get(e);if(!t){const n=window.matchMedia(e);t={mq:n,subscribe:r=>(n.addEventListener("change",r),()=>n.removeEventListener("change",r))},Ex.set(e,t)}return t}function Ev(){const e=LG("(hover: none)");return s.useSyncExternalStore(e.subscribe,()=>e.mq.matches,()=>!1)}function TG(){const{tasks:e,running:t,unread:n,panelOpen:r,setPanelOpen:a,markSeen:i}=Va(),{brand:c}=on(),u=wr(Ks),f=$G(),[h,p]=s.useState(null);s.useEffect(()=>p(null),[c.id]),LA(r,()=>a(!1));const m=e.find(k=>k.state==="running")??null,v=t>0?"busy":n>0?"new":"quiet",w="Activity"+(n?`, ${n} unread`:"")+(t?`, ${t} task${t===1?"":"s"} running`:""),y=v==="busy"&&m?`Rendering, ${ac(m.startedAt,Date.now())}`:"Activity",b=o.jsx(xG,{mode:v,lead:m,running:t,unread:n,animate:f});return u?o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"sc-act-btn sc-notif-btn","data-mode":v,"data-on":r||void 0,"aria-label":w,"aria-expanded":r,onClick:()=>a(!r),children:b}),r?o.jsx(PA,{label:"Activity",onClose:()=>a(!1),children:o.jsx(xx,{onClose:()=>a(!1),onSeen:i,onOpenDetail:p})}):null,h?o.jsx(v6,{brandId:c.id,jobId:h,onDismiss:()=>p(null)}):null]}):o.jsxs(o.Fragment,{children:[o.jsxs(Ou,{open:r,onOpenChange:a,children:[o.jsx(or,{label:y,children:o.jsx(Iu,{children:o.jsx("button",{type:"button",className:"sc-act-btn sc-notif-btn","data-mode":v,"aria-label":w,children:b})})}),o.jsx(Fu,{align:"end",sideOffset:20,className:"sc-notif-pop","aria-label":"Activity",children:o.jsx(xx,{onClose:()=>a(!1),onSeen:i,onOpenDetail:p})})]}),h?o.jsx(v6,{brandId:c.id,jobId:h,onDismiss:()=>p(null)}):null]})}function $G(){const[e,t]=s.useState(!1),n=s.useRef(!1);return s.useEffect(()=>{n.current||(n.current=!0,t(!0))},[]),e}function DG(){const e=Sv(16);return o.jsx("nav",{className:"sc-nav sc-desktop-only","aria-label":"Main",children:o.jsx("ul",{children:e.map(t=>o.jsx("li",{children:o.jsx(_n,{to:t.to,"data-active":t.active||void 0,"data-guide":`nav.${t.key}`,"aria-current":t.active?"page":void 0,children:t.label})},t.key))})})}const w6=s.createContext(null);function DA({label:e,className:t,offset:n=22,trigger:r,children:a}){const i=wr(Ks),[c,u]=s.useState(!1),f=s.useRef(null),h=()=>u(!1),p=s.useCallback(()=>{var m;return(m=f.current)==null?void 0:m.focus({preventScroll:!0})},[]);return LA(c,h),i?o.jsxs(o.Fragment,{children:[s.cloneElement(r,{ref:f,onClick:()=>u(!c),"aria-haspopup":"dialog","aria-expanded":c,"data-on":c||void 0}),c&&o.jsx(PA,{label:e,onClose:h,children:o.jsxs("div",{className:"sc-menu-sheet",children:[o.jsx("div",{className:"sc-menu-head",children:e}),o.jsx(w6.Provider,{value:{close:h,focusTrigger:p},children:a})]})})]}):o.jsxs(Ss,{open:c,onOpenChange:u,modal:!1,children:[o.jsx(Es,{children:s.cloneElement(r,{ref:f})}),o.jsxs(Cs,{align:"end",sideOffset:n,className:`sc-menu ${t??""}`,onPointerDownOutside:m=>{var v;(v=f.current)!=null&&v.contains(m.target)&&m.preventDefault()},onCloseAutoFocus:m=>{m.preventDefault();const v=document.activeElement;(!v||v===document.body)&&p()},children:[o.jsx("div",{className:"sc-menu-head",children:e}),o.jsx(w6.Provider,{value:{close:null,focusTrigger:p},children:a})]})]})}function ju({className:e="sc-menu-item",to:t,onSelect:n,disabled:r,children:a,...i}){const c=s.useContext(w6),u=c==null?void 0:c.close,f=n?()=>{c==null||c.focusTrigger(),setTimeout(()=>{c==null||c.focusTrigger(),n()},0)}:void 0;if(u){const h=()=>{u(),f==null||f()};return t?o.jsx(_n,{className:e,to:t,onClick:u,...i,children:a}):o.jsx("button",{type:"button",className:e,onClick:h,disabled:r,...i,children:a})}return t?o.jsx(tr,{asChild:!0,className:e,...i,children:o.jsx(_n,{to:t,children:a})}):o.jsx(tr,{className:e,onSelect:f,disabled:r,...i,children:a})}function HA(e,t){return[...e].sort((n,r)=>t(n).localeCompare(t(r),void 0,{sensitivity:"base"})||n.slug.localeCompare(r.slug))}function HG(e,t,n){const r=t.trim().toLowerCase(),a=r?e.filter(i=>n(i).toLowerCase().includes(r)||i.slug.toLowerCase().includes(r)):e;return HA(a,n)}function Wn({label:e,title:t,body:n,busy:r,onConfirm:a,fullWidth:i,open:c,onOpenChange:u,tone:f="red"}){const h=s.useRef(!1);s.useEffect(()=>{h.current=!1},[c]);const p=()=>{h.current||(h.current=!0,a())},m=s.useRef(null),v=c!==void 0;return o.jsxs(of,{open:c,onOpenChange:w=>{w&&(h.current=!1),u==null||u(w)},children:[c===void 0&&o.jsx(O7,{children:o.jsx("button",{type:"button",className:f==="red"?"sc-btn sc-btn-ghost sc-btn-red":"sc-btn sc-btn-ghost",disabled:r,style:i?{width:"100%"}:void 0,children:e})}),o.jsxs(lf,{maxWidth:"420px",onOpenAutoFocus:()=>{v&&(m.current=document.activeElement)},onCloseAutoFocus:w=>{var y;!v||!((y=m.current)!=null&&y.isConnected)||(w.preventDefault(),m.current.focus())},children:[o.jsx(cf,{children:t}),o.jsx(uf,{size:"2",children:n}),o.jsxs(js,{gap:"3",mt:"4",justify:"end",children:[o.jsx(ff,{children:o.jsx(ia,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(df,{children:o.jsx(ia,{color:"red",onClick:p,disabled:r,children:e})})]})]})]})}function OG(){const{brand:e}=on(),t=yf(),n=Dn(),r=qp(),{push:a}=ir(),[i,c]=s.useState(!1),u=async()=>{const f=await r.quit();f&&a({kind:"warning",title:"Scenri is still working",detail:f})};return o.jsxs(o.Fragment,{children:[o.jsxs(DA,{label:"Brands",className:"sc-menu-brand",trigger:o.jsx("button",{type:"button",className:"sc-org-btn","aria-label":`${ca(e)}, brand and settings`,children:o.jsx(AA,{brand:e,size:32,round:!0})}),children:[o.jsx(FG,{}),o.jsx("div",{className:"sc-menu-rule"}),o.jsxs(ju,{onSelect:()=>n("/setup"),children:[o.jsx(cr,{size:16,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Set up a brand"})]}),o.jsxs(ju,{onSelect:()=>t(),children:[o.jsx(KU,{size:16,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Settings"})]}),r.thisComputer&&o.jsxs(ju,{"data-quit":"",onSelect:()=>c(!0),children:[o.jsx(iW,{size:16,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Shut down Scenri"})]})]}),o.jsx(Wn,{open:i,onOpenChange:c,label:"Shut down Scenri",title:"Shut down Scenri?",body:"This stops the Scenri server on this machine. Every open tab loses the studio until you start it again, from your desktop icon or with npx scenri.",busy:r.busy!=="idle",onConfirm:()=>void u()})]})}const IG=7;function FG(){const{brands:e}=Rn(),{brand:t}=on(),n=Dn(),[r,a]=s.useState(""),i=v=>ca(v).trim().toLowerCase(),c=new Map;for(const v of e)c.set(i(v),(c.get(i(v))??0)+1);const u=e.length>=IG,f=r.trim(),h=u&&f?HG(e,f,ca):[],p=v=>{const w=v.id===t.id,y=(c.get(i(v))??0)>1;return o.jsxs(ju,{"data-current":w||void 0,"data-two-line":y||void 0,onSelect:w?void 0:()=>n(mo(v)),children:[o.jsx(AA,{brand:v,size:20,round:!0}),o.jsxs("span",{className:"sc-menu-brand-lb",children:[o.jsx("span",{dir:"auto",children:ca(v)}),y&&o.jsxs("span",{className:"sc-menu-brand-sub",children:["/",v.slug]})]}),w&&o.jsxs(o.Fragment,{children:[o.jsx(Kn,{size:14,className:"sc-menu-check","aria-hidden":"true"}),o.jsx("span",{className:"sc-vh",children:", current brand"})]})]},v.id)},m=HA(e.filter(v=>v.id!==t.id),ca);return u?o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:"sc-menu-find",children:[o.jsx(_u,{size:16,"aria-hidden":"true"}),o.jsx("input",{type:"search",value:r,placeholder:"Find a brand","aria-label":"Find a brand",onChange:v=>a(v.target.value),onKeyDown:v=>{const w=h.find(y=>y.id!==t.id);v.key!=="Enter"||!w||(v.preventDefault(),n(mo(w)))}})]}),o.jsx("div",{className:"sc-menu-brands",children:f?h.length>0?h.map(p):o.jsx("p",{className:"sc-menu-none",children:"No brand by that name."}):o.jsxs(o.Fragment,{children:[p(t),m.map(p)]})})]}):o.jsxs(o.Fragment,{children:[p(t),m.map(p)]})}function _G(){const e=wr("(min-width: 1024px)"),t=Yj(),[n]=tl();return e?o.jsx("button",{type:"button",className:"sc-learn-btn","aria-haspopup":"dialog","data-on":n.has("learn")||void 0,onClick:()=>t(),children:"Learn"}):null}function ti(e){var n;if(e.avatarUrl)return{src:e.avatarUrl};const t=e.previewUrl??((n=e.shots)==null?void 0:n[0])??null;return t?{src:t,crop:"top"}:{src:null}}function Cv(e){const t=Fr(e.avatar);if(t)return{src:t};const n=a=>{var i;return Array.isArray(a)?Fr((i=a[0])==null?void 0:i.file):null},r=Fr(e.preview)??n(e.shots)??n(e.sourceRefs);return r?{src:r,crop:"top"}:{src:null}}const ZG=["hero","close","hands","angle","bold"],y6=e=>Array.isArray(e)?e.map(t=>Fr(t==null?void 0:t.file)).filter(t=>!!t):[],jv=e=>{var t;return(((t=e==null?void 0:e.json)==null?void 0:t.characters)??[]).filter(n=>(n==null?void 0:n.origin)==="custom")};function T0(e){return e.length<2?[...e]:e.slice().reverse()}function OA(e){const t=e.filter(n=>n.origin!=="catalog");return t.length===e.length?T0(e):[...T0(t),...e.filter(n=>n.origin==="catalog")]}function Cf(e){return T0(jv(e).filter(t=>!t.supersededBy).map(IA))}function VG(e,t){const n=jv(e).find(r=>r.id===t);return n?IA(n):void 0}function Av(e,t){var i;const n=jv(e),r=new Set([t]);let a=t;for(;;){const c=(i=n.find(u=>u.id===a))==null?void 0:i.supersededBy;if(typeof c!="string"||!c||r.has(c)||!n.some(u=>u.id===c))return a;r.add(c),a=c}}function IA(e){var a;const t=y6(e.shots),n=y6(e.sourceRefs),r=Fr(e.preview)??t[0]??n[0]??null;return{id:String(e.id),name:String(e.name??""),promptName:e.promptName,presentation:e.presentation==="man"?"man":"woman",descriptor:String(e.descriptor??""),ageRange:String(e.ageRange??""),hair:String(e.hair??""),identityNotes:String(e.identityNotes??""),negativeConstraints:Array.isArray(e.negativeConstraints)?e.negativeConstraints.map(String):[],facial:String(e.facial??""),skin:String(e.skin??""),build:String(e.build??""),wardrobeDefault:"",suitableCategories:Array.isArray(e.suitableCategories)?e.suitableCategories.map(String):[],suitableStyles:[],width:1024,height:1280,previewUrl:r,avatarUrl:Fr(e.avatar),custom:!0,shots:t,sourceRefs:n,identityEdits:Array.isArray(e.identityEdits)?e.identityEdits.map(String):[],...e.revisionOf?{revisionOf:String(e.revisionOf)}:{},...e.supersededBy?{supersededBy:String(e.supersededBy)}:{},...e.source==="synthetic"||e.source==="photos"?{source:e.source}:{},...(a=e.likeness)!=null&&a.attestedAt?{likeness:{attestedAt:String(e.likeness.attestedAt),version:String(e.likeness.version??"v1")}}:{}}}function jc(e){var n;const t=((n=e==null?void 0:e.json)==null?void 0:n.scenes)??[];return T0(t.map(zG))}function Fh(e,t){return jc(e).find(n=>n.id===t)}function zG(e){const t=y6(e.refs);return{id:String(e.id),name:String(e.name??""),promptName:e.promptName,description:String(e.description??""),lighting:String(e.lighting??""),subject:e.subject==="product"||e.subject==="person"?e.subject:"either",collections:Array.isArray(e.collections)?e.collections.map(String):[],verticals:Array.isArray(e.verticals)?e.verticals.map(String):[],keywords:Array.isArray(e.keywords)?e.keywords.map(String):void 0,prompt:String(e.prompt??""),width:Number(e.width)||1024,height:Number(e.height)||1280,previewUrl:Fr(e.preview)??t[0]??null,previewColor:null,custom:!0,refs:t,instruction:e.instruction?String(e.instruction):void 0,camera:e.camera?String(e.camera):void 0,figure:e.figure?String(e.figure):void 0,figureTreatment:e.figureTreatment?String(e.figureTreatment):void 0,setups:Array.isArray(e.setups)?e.setups.filter(n=>(n==null?void 0:n.id)&&(n==null?void 0:n.label)&&(n==null?void 0:n.camera)).map(n=>({id:String(n.id),label:String(n.label),camera:String(n.camera)})):void 0,examples:Array.isArray(e.examples)?e.examples.filter(n=>ZG.includes(n==null?void 0:n.role)&&Fr(n==null?void 0:n.file)).map(n=>({role:n.role,url:Fr(n.file),hash:String(n.file).slice(6),earlier:n.from!==e.preview,with:n.presenter?"presenter":"product",...n.setup?{setup:String(n.setup)}:{}})):void 0}}function _h(e,t){const n=new Set(e.map(r=>r.id));return[...e,...t.filter(r=>!n.has(r.id))]}function b6(e,t){return t.map(n=>n.t==="character"&&n.id?{...n,id:Av(e,n.id)}:n)}function FA(){const{brand:e,products:t}=on(),{scenes:n,presenters:r,demoProducts:a,showcase:i}=Rn();return s.useMemo(()=>{const c={presenters:Cf(e),scenes:jc(e)},u=new Set,f=y=>!y||u.has(y)?null:(u.add(y),y),h=(y,b)=>{for(const k of y){const S=f(b(k));if(S)return sr(S,"tile")}return null},p=y=>h(i.filter(b=>{var k;return(((k=b.brief)==null?void 0:k.tokens)??[]).some(S=>(S==null?void 0:S.t)===y)}),b=>b.previewUrl),m=h([...t].reverse(),y=>{var b,k;return Fr((k=(b=y==null?void 0:y.shots)==null?void 0:b[0])==null?void 0:k.file)}),v=h(c.presenters,y=>y.previewUrl??ti(y).src),w=h(c.scenes,y=>y.previewUrl);return{product:{url:m??p("product")??h(a,y=>y.previewUrl)??null,count:t.length,own:!!m},presenter:{url:v??p("character")??h(r,y=>y.previewUrl??ti(y).src)??null,count:c.presenters.length,own:!!v},scene:{url:w??h(n,y=>y.previewUrl)??p("template")??null,count:c.scenes.length,own:!!w}}},[e,t,n,r,a,i])}const BG=[{kind:"product",label:"Product",line:"What you are photographing",noun:"product",icon:Bp},{kind:"presenter",label:"Presenter",line:"Who appears in the shot",noun:"presenter",icon:Vp},{kind:"scene",label:"Scene",line:"Where it takes place",noun:"scene",icon:Zp}],Cx=(e,t)=>e===0?"None yet":`${e} ${t}${e===1?"":"s"}`;function UG({suggest:e,onPick:t}){const n=s.useRef(null),{close:r}=Ns("new"),a=FA(),i=()=>{var c,u;(u=(c=n.current)==null?void 0:c.querySelector(e?`[data-kind="${e}"]`:"[data-kind]"))==null||u.focus()};return s.useEffect(i,[e]),o.jsxs(Ts,{className:"sc-newpick",maxWidth:"620px",onDismiss:r,onOpenAutoFocus:c=>{c.preventDefault(),i()},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:"Add to this brand"}),o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]}),o.jsx("p",{className:"sc-newdlg-sub",children:"The three things every shot is made from."}),o.jsx("div",{className:"sc-newdlg-body",children:o.jsx("div",{className:"sc-pickgrid",ref:n,children:BG.map(({kind:c,label:u,line:f,noun:h,icon:p})=>{const{url:m,count:v,own:w}=a[c];return o.jsxs("button",{type:"button",className:"sc-pick","data-kind":c,onClick:()=>t(c),"aria-label":`${u}. ${f}. ${Cx(v,h)}.`,children:[o.jsxs("span",{className:"sc-pick-media",children:[m?o.jsx("img",{src:m,alt:"",loading:"lazy"}):o.jsx("span",{className:"sc-pick-blank",children:o.jsx(p,{size:22})}),w&&o.jsx("span",{className:"sc-pick-mine",children:"Yours"})]}),o.jsxs("span",{className:"sc-pick-cap",children:[o.jsx("b",{children:u}),o.jsx("small",{children:f})]}),o.jsx("span",{className:"sc-pick-count",children:Cx(v,h)})]},c)})})})]})}function Nv({name:e}){const t={size:14,"aria-hidden":!0};switch(e){case"open":return o.jsx(VC,{...t});case"continue":return o.jsx(Pa,{...t});case"open-tab":return o.jsx(wf,{...t});case"refine":return o.jsx(QC,{...t});case"select":return o.jsx(Kn,{...t,weight:"bold"});case"keep":return o.jsx(Da,{...t});case"kept":return o.jsx(Da,{...t,weight:"fill"});case"unset":return o.jsx(_C,{...t});case"versions":return o.jsx(bj,{...t});case"archive":return o.jsx(_p,{...t});case"restore":return o.jsx(R0,{...t});case"delete":case"discard":return o.jsx(ll,{...t});case"use":return o.jsx(cr,{...t});case"duplicate":return o.jsx(Dh,{...t});case"rename":return o.jsx(aW,{...t});case"edit":return o.jsx(ed,{...t})}}function jx(e,t,n){return e.map(r=>o.jsxs("span",{style:{display:"contents"},children:[r.separated&&o.jsx(n,{}),o.jsxs(t,{color:r.danger?"red":void 0,onSelect:r.onSelect,children:[o.jsx(Nv,{name:r.icon}),r.label]})]},r.key))}function WG({id:e,previewUrl:t,pending:n,title:r,primary:a,secondary:i,useLabel:c,variant:u,onOpen:f,onUse:h,href:p,selected:m,onToggle:v,bookmarked:w,onBookmark:y,menu:b,fresh:k,size:S="grid",chosen:C,batching:j,onPick:N}){const[P,$]=s.useState(!1),[R,E]=s.useState(!1),M=s.useRef(null),L=Ev(),H=(X,le)=>TA(X,le,L),D=u==="use"&&!!f&&!!h&&!j,K=b??[],O=K.find(X=>X.key==="delete"),_=K.length>0,re=X=>{X.preventDefault(),X.stopPropagation(),N==null||N(e)};s.useEffect(()=>{if(!R)return;const X=le=>{var ke;(ke=M.current)!=null&&ke.contains(le.target)||E(!1)};return document.addEventListener("pointerdown",X),()=>document.removeEventListener("pointerdown",X)},[R]);const z=t&&!P?o.jsx("img",{src:sr(t,"tile"),alt:"",loading:"lazy",onError:()=>$(!0)}):n?o.jsx("span",{className:"sc-shimmer"}):o.jsx("span",{className:"sc-lookcard-blank",children:o.jsx(Ws,{size:20})}),F=X=>{X.preventDefault(),X.stopPropagation()},Q=_?o.jsxs(Ss,{children:[H("More",o.jsx(Es,{children:o.jsxs("button",{type:"button",className:"sc-cell-ctl sc-lookcard-more","aria-label":`More for ${a}`,onClick:X=>X.stopPropagation(),onContextMenu:X=>X.stopPropagation(),children:[o.jsx($C,{className:"sc-lookcard-more-vert",size:16,weight:"bold"}),o.jsx(LC,{className:"sc-lookcard-more-horiz",size:16,weight:"bold"})]})})),o.jsx(Cs,{side:"top",align:"end",sideOffset:4,collisionPadding:12,children:jx(K,tr,Ul)})]}):null,V=Q||O||y?o.jsxs("div",{className:"sc-corner",children:[Q,O&&H(O.label,o.jsx("button",{type:"button",className:"sc-cell-ctl sc-lookcard-remove sc-cell-danger","aria-label":O.label,onClick:X=>{F(X),O.onSelect()},children:o.jsx(ll,{size:15})})),y&&H(w?"Remove from Keepers":"Add to Keepers",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-lookcard-keep","data-on":w||void 0,"aria-pressed":!!w,"aria-label":w?`Remove ${a} from Keepers`:`Add ${a} to Keepers`,onClick:X=>{F(X),y(e)},children:o.jsx(Da,{size:15,weight:w?"fill":"regular"})}))]}):null,I=o.jsx("span",{className:"sc-lookcard-cap",title:r,children:o.jsxs("span",{className:"sc-lookcard-copy",children:[o.jsx("b",{dir:"auto",children:a}),i&&o.jsx("span",{children:i})]})});if(u==="select")return o.jsxs("button",{type:"button",className:"sc-lookcard","data-fb-id":e,"data-variant":"select","data-size":S,"data-on":m||void 0,"data-just-added":k||void 0,"aria-pressed":!!m,"aria-label":r,onClick:()=>v==null?void 0:v(e),children:[o.jsxs("span",{className:"sc-lookcard-media",children:[z,o.jsx("span",{className:"sc-lookcard-veil","aria-hidden":!0}),o.jsx("span",{className:"sc-lookcard-tick","aria-hidden":!0,children:o.jsx(Kn,{size:11,weight:"bold"})})]}),I]});const B=()=>{if(j&&N){N(e);return}if(D&&L){if(!R){E(!0);return}E(!1)}f?f(e):h==null||h(e)},Y=()=>{E(!1),h==null||h(e)},ae=o.jsxs("div",{ref:M,className:"sc-lookcard","data-fb":"catalog-card","data-fb-id":e,"data-variant":u,"data-size":S,"data-armed":R||void 0,"data-just-added":k||void 0,"data-picked":C||void 0,"data-batching":j||void 0,children:[o.jsxs("div",{className:"sc-lookcard-media",children:[p?o.jsxs(_n,{className:"sc-lookcard-open",to:p,"aria-label":j?`${C?"Deselect":"Select"} ${a}`:r,onClick:X=>{if(j&&N){re(X);return}if(D&&L){if(!R){X.preventDefault(),E(!0);return}E(!1)}},children:[z,!j&&o.jsx("span",{className:"sc-lookcard-veil","aria-hidden":!0})]}):o.jsxs("button",{type:"button",className:"sc-lookcard-open",onClick:B,"aria-label":j?`${C?"Deselect":"Select"} ${a}`:r,children:[z,!j&&o.jsx("span",{className:"sc-lookcard-veil","aria-hidden":!0})]}),D&&o.jsx("button",{type:"button",className:"sc-lookcard-use",onClick:Y,children:c}),N&&H(C?"Deselect":"Select",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-lookcard-pick","data-on":C||void 0,"aria-pressed":!!C,"aria-label":C?`Deselect ${a}`:`Select ${a}`,onClick:re,children:o.jsx(Kn,{size:13,weight:"bold"})}))]}),V,I]});return K.length===0||L?ae:o.jsxs(pf,{children:[o.jsx(mf,{children:ae}),o.jsx(gf,{children:jx(K,vf,Fp)})]})}function tm({size:e="grid",count:t=4,caption:n=!0}){return o.jsx(o.Fragment,{children:Array.from({length:t},(r,a)=>o.jsx("div",{className:"sc-lookcard","data-variant":"skeleton","data-size":e,"data-caption":n?void 0:"photo","aria-hidden":!0},a))})}const rd=s.memo(WG),KG=/^(p|product|products|item|items|dp|sku)$/i;function GG(e){let t="";try{const r=new URL(e).pathname.split("/").filter(Boolean);t=[...r].reverse().find(a=>!KG.test(a)&&!/^\d+$/.test(a))??r.at(-1)??""}catch{t=e}const n=decodeURIComponent(t).replace(/\.(html?|php|aspx?)$/i,"").replace(/[-_+]+/g," ").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):e}function YG(e,t){if(!t)return!0;const n=a=>a.toLowerCase().replace(/[^a-z0-9]+/g," "),r=n(e);return n(t).split(" ").filter(Boolean).every(a=>r.includes(a))}const $g=24,qG=12;function _A({brandId:e,scan:t,busy:n,error:r,onImport:a,onImportAll:i,onDismiss:c}){const u=s.useMemo(()=>t.candidateUrls.length?t.candidateUrls:(t.cards??[]).map(Y=>Y.url).filter(Boolean),[t.candidateUrls,t.cards]),[f,h]=s.useState(""),[p,m]=s.useState(()=>new Set(u)),[v,w]=s.useState($g),[y,b]=s.useState(()=>{const Y=new Map;for(const ae of t.cards??[])ae.url&&Y.set(ae.url,{externalKey:ae.externalKey,title:ae.title,url:ae.url,images:ae.image?[{url:ae.image}]:[]});for(const ae of t.candidates)ae.url&&Y.set(ae.url,ae);return Y}),k=s.useRef(new Set),S=s.useRef(y),C=s.useRef(!0),[j,N]=s.useState(0);s.useEffect(()=>(C.current=!0,()=>{C.current=!1}),[]);const[P,$]=s.useState(null),R=s.useRef(null),E=s.useMemo(()=>u.map(Y=>({url:Y,name:GG(Y)})),[u]),M=s.useMemo(()=>E.filter(Y=>YG(Y.name,f)),[E,f]),L=s.useMemo(()=>M.slice(0,v),[M,v]);s.useEffect(()=>w($g),[f]);const H=s.useRef([]),D=s.useRef(0),K=s.useRef(()=>{}),O=2,_=120,re=s.useCallback(()=>{for(;D.current<O&&H.current.length;){const Y=H.current.splice(Math.max(0,H.current.length-qG));if(!Y.length)return;D.current++,N(D.current),Me.catalogDetails(e,Y).then(({products:ae})=>{if(!C.current)return;const X=new Map(S.current);for(const le of ae)le.url&&X.set(le.url,le);for(let le=0;le<ae.length&&le<Y.length;le++)X.has(Y[le])||X.set(Y[le],ae[le]);S.current=X,b(X)}).catch(()=>{for(const ae of Y)k.current.delete(ae)}).finally(()=>{D.current=Math.max(0,D.current-1),C.current&&(N(D.current),K.current())})}},[e]);K.current=re,s.useEffect(()=>{const Y=R.current;if(!Y)return;const ae=new IntersectionObserver(X=>{let le=!1;for(const ke of X){if(!ke.isIntersecting)continue;const te=ke.target.dataset.fbId;if(ae.unobserve(ke.target),!(!te||S.current.has(te)||k.current.has(te))){for(k.current.add(te),H.current.push(te);H.current.length>_;){const be=H.current.shift();be&&k.current.delete(be)}le=!0}}le&&K.current()},{root:Y,rootMargin:"250% 0px"});for(const X of Y.querySelectorAll("[data-fb-id]"))ae.observe(X);return()=>ae.disconnect()},[v,f]),s.useEffect(()=>{if(!P||v>=M.length)return;const Y=P.closest(".sc-wizpick-grid"),ae=new IntersectionObserver(X=>{X.some(le=>le.isIntersecting)&&w(le=>le+$g)},{root:Y,rootMargin:"0px 0px 300% 0px"});return ae.observe(P),()=>ae.disconnect()},[P,v,M.length]);const z=s.useCallback(Y=>{m(ae=>{const X=new Set(ae);return X.delete(Y)||X.add(Y),X})},[]),F=M.length>0&&M.every(Y=>p.has(Y.url)),Q=p.size===u.length,V=()=>{m(Y=>{const ae=new Set(Y);for(const X of M)F?ae.delete(X.url):ae.add(X.url);return ae})},I=p.size,B=I===1?"1 product":`${I.toLocaleString()} products`;return o.jsxs(Ts,{open:!0,className:"sc-wizpick",maxWidth:"760px",described:!0,onDismiss:c,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:"Products on your site"}),o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]}),o.jsx(nd,{className:"sc-wizpick-sub",children:`${u.length.toLocaleString()} found. Everything is selected; untick what you do not want, or search for what you do.`}),o.jsxs("div",{className:"sc-wizpick-tools",children:[o.jsxs("span",{className:"sc-wizpick-search",children:[o.jsx(_u,{size:13}),o.jsx("input",{type:"search",value:f,onChange:Y=>h(Y.target.value),placeholder:`Search ${u.length.toLocaleString()} products`,"aria-label":"Search products"})]}),o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:V,disabled:!M.length,children:F?"Select none":f?`Select these ${M.length.toLocaleString()}`:"Select all"}),o.jsxs("span",{className:"sc-wizpick-count",children:[I.toLocaleString()," selected"]})]}),o.jsxs("div",{className:"sc-wizpick-grid",ref:R,children:[L.map(Y=>{var X,le;const ae=y.get(Y.url);return o.jsx(rd,{id:Y.url,previewUrl:((le=(X=ae==null?void 0:ae.images)==null?void 0:X[0])==null?void 0:le.url)??null,pending:!ae,title:(ae==null?void 0:ae.title)??Y.name,primary:(ae==null?void 0:ae.title)??Y.name,secondary:(ae==null?void 0:ae.price)!=null?`${ae.currency??""} ${ae.price}`.trim():(ae==null?void 0:ae.category)??"",useLabel:"Import",variant:"select",selected:p.has(Y.url),onToggle:z,size:"grid"},Y.url)}),v<M.length&&o.jsx("div",{className:"sc-wizpick-end",ref:$,"aria-hidden":!0}),!M.length&&o.jsxs("p",{className:"sc-wizpick-empty",children:["Nothing here matches “",f,"”."]})]}),o.jsxs("div",{className:"sc-wizpick-foot",children:[o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:c,children:"Not now"}),r?o.jsx("span",{className:"sc-wizpick-error",role:"alert",children:r}):j>0&&o.jsx("span",{className:"sc-wizpick-loading",children:"Loading products"}),o.jsx("button",{type:"button",className:"sc-wiz-cta",disabled:!I||n||y.size===0&&j>0,onClick:()=>Q?i():a([...p]),children:n?"Importing":`Import ${B}`})]})]})}const Dg=700,XG=45e3,QG=3e3;function ZA(e,t){const[n,r]=s.useState(null),[a,i]=s.useState(!1),[c,u]=s.useState(!1),[f,h]=s.useState(null),[p,m]=s.useState(0),v=s.useRef(!0);s.useEffect(()=>(v.current=!0,()=>{v.current=!1}),[]),s.useEffect(()=>{if(!e)return;let b=!1,k,S=null;i(!0),u(!1),r(null),h(null);const C=(N,P)=>{r(N),h(P),i(!1),u(!0)};return(async()=>{try{const{scanId:N}=await Me.catalogScan(e,t);if(S=N,b||!v.current){Me.cancelCatalogScan(e,N).catch(()=>{});return}const P=Date.now()+XG,$=async()=>{if(!(b||!v.current)){if(Date.now()>P){C(null,{kind:"timeout"});return}try{const R=await Me.catalogScanState(e,N,AbortSignal.timeout(QG));if(b||!v.current)return;if(R.status==="running"){k=setTimeout($,Dg);return}R.result?C(R.result,null):C(null,{kind:"error",reason:R.error??"The look for a shop did not finish."})}catch(R){if(b||!v.current)return;if((R==null?void 0:R.status)===404){C(null,{kind:"error",reason:"The look for a shop was interrupted."});return}k=setTimeout($,Dg)}}};k=setTimeout($,Dg)}catch{b||C(null,{kind:"error",reason:"The look for a shop could not start."})}})(),()=>{b=!0,k&&clearTimeout(k),S&&Me.cancelCatalogScan(e,S).catch(()=>{})}},[e,t,p]);const w=s.useCallback(()=>m(b=>b+1),[]);return{scan:n,scanning:a,settled:c,outcome:a?{kind:"scanning"}:f||(n?{kind:"result",scan:n}:{kind:"idle"}),retry:w}}const $0=[{key:"fragrance",label:"Fragrance",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"footwear",label:"Footwear",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"lateral-side",label:"Lateral side"},{key:"medial-side",label:"Medial side"}]},{key:"apparel",label:"Apparel",angles:[{key:"front",label:"Front"},{key:"back",label:"Back"},{key:"detail-fabric",label:"Detail / fabric"}]},{key:"furniture",label:"Furniture",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"beauty",label:"Beauty / skincare",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"label",label:"Label"}]},{key:"electronics",label:"Electronics",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"back",label:"Back"}]},{key:"jewelry",label:"Jewelry",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"clasp-detail",label:"Clasp detail"}]},{key:"accessories",label:"Accessories",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"detail",label:"Detail"}]},{key:"beverage",label:"Beverage",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"label",label:"Label"}]},{key:"food",label:"Food",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"packaging-label",label:"Packaging label"}]},{key:"other",label:"Other",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]}],Mv=new Map($0.map(e=>[e.key,e]));Mv.get("other");function D0(e){var t;return e?((t=Mv.get(e))==null?void 0:t.label)??e:null}function JG(e,t){const n=[e??"",...t??[]].join(" ").toLowerCase();if(!n.trim())return;const r=[["fragrance",["fragrance","perfume","eau de","cologne"]],["footwear",["shoe","sneaker","boot","sandal","footwear"]],["apparel",["shirt","dress","jacket","pant","apparel","clothing","hoodie"]],["furniture",["chair","table","sofa","furniture","shelf","desk"]],["beauty",["skincare","serum","cream","lotion","cosmetic","makeup","beauty"]],["electronics",["electronic","headphone","speaker","charger","device","gadget"]],["jewelry",["jewelry","jewellery","necklace","bracelet","earring","ring"]],["accessories",["bag","handbag","wallet","watch","accessory","accessories"]],["beverage",["drink","beverage","soda","juice","coffee","tea"]],["food",["food","snack","grocery","sauce","spice","pantry"]]];for(const[a,i]of r)if(i.some(c=>n.includes(c)))return a}function Rv(e){return e.category&&Mv.has(e.category)?e.category:JG(e.productType,e.tags)??null}function eY({title:e,sub:t,error:n,footnote:r,primaryLabel:a,ready:i,blocked:c,busy:u,width:f="440px",onBack:h,onPrimary:p,onPasteFiles:m,children:v}){const{close:w}=Ns("new");return o.jsxs(Ts,{maxWidth:f,onDismiss:w,onPaste:y=>{var k;if(!m)return;const b=Array.from(((k=y.clipboardData)==null?void 0:k.files)??[]).filter(S=>S.type.startsWith("image/"));b.length&&(y.preventDefault(),m(b))},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[h&&o.jsx("button",{type:"button",className:"sc-newdlg-back",onClick:h,"aria-label":"Back",children:o.jsx(ga,{size:15})}),o.jsx(ds,{className:"sc-newdlg-title",children:e}),o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]}),t&&o.jsx("p",{className:"sc-newdlg-sub",children:t}),o.jsx("div",{className:"sc-newdlg-body",children:v}),o.jsxs("div",{className:"sc-newdlg-foot",children:[n&&o.jsx("p",{className:"sc-newdlg-err",role:"alert",children:n}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary sc-dlg-go","aria-disabled":!i||u||void 0,title:c,onClick:()=>{i&&!u&&p()},children:[u?o.jsx(xr,{size:"1"}):null,a]}),r&&o.jsx("p",{className:"sc-dlg-foot",children:r})]})]})}function VA({onFiles:e,onReject:t,disabled:n}){const r=s.useRef(0),[a,i]=s.useState(!1),c=s.useCallback(()=>{r.current=0,i(!1)},[]);return{dragOver:a,dropProps:{"data-drag-over":a||void 0,onDragEnter:f=>{n||!Array.from(f.dataTransfer.types).includes("Files")||(f.preventDefault(),r.current++,i(!0))},onDragOver:f=>{n||f.preventDefault()},onDragLeave:()=>{r.current=Math.max(0,r.current-1),r.current===0&&i(!1)},onDrop:f=>{if(n)return;f.preventDefault(),c();const h=Array.from(f.dataTransfer.files).filter(p=>p.type.startsWith("image/"));h.length?e(h):t==null||t()}}}}function Ax({label:e,hint:t,busy:n,disabled:r,multiple:a=!0,accept:i="image/*",onFiles:c,onReject:u,children:f}){const h=s.useRef(null),{dropProps:p}=VA({onFiles:c,onReject:u,disabled:r||n});return o.jsxs("button",{type:"button",className:"sc-dropzone",disabled:r||n,onClick:()=>{var m;return(m=h.current)==null?void 0:m.click()},...p,children:[o.jsx("input",{ref:h,type:"file",accept:i,multiple:a,hidden:!0,onChange:m=>{const v=Array.from(m.target.files??[]);m.target.value="",v.length&&c(v)}}),n?o.jsx(xr,{}):f,o.jsx("span",{className:"sc-dropzone-label",children:e}),t&&o.jsx("small",{children:t})]})}function zA({hashes:e,max:t,label:n,hint:r,busy:a,onAdd:i,onRemove:c,onReject:u}){if(e.length===0)return o.jsx("div",{className:"sc-assetwell",children:o.jsx(Ax,{label:n,hint:r,busy:a,onFiles:i,onReject:u,children:o.jsx(cr,{size:18})})});const f=t-e.length;return o.jsxs("div",{className:"sc-assetform-refs",children:[e.map((h,p)=>o.jsxs("span",{className:"sc-assetform-ref",children:[o.jsx("img",{src:dn(h,"micro"),alt:`Reference ${p+1}`,loading:"lazy",decoding:"async"}),o.jsx("button",{type:"button",className:"sc-assetform-drop","aria-label":`Remove reference ${p+1}`,onClick:()=>c(h),children:o.jsx(jn,{size:11,weight:"bold"})})]},h)),f>0&&o.jsx(Ax,{label:`${f} more`,busy:a,onFiles:i,onReject:u,children:o.jsx(cr,{size:15})})]})}let s0=null;const BA=(e,t)=>`${e}:${t}`;function tY(e,t,n){s0={key:BA(e,t),fields:n}}function nY(e,t){if(!s0||s0.key!==BA(e,t))return null;const{fields:n}=s0;return s0=null,n}const Nx={name:"",instruction:"",facets:[],imageHashes:[],importUrl:""};function rY(e,t,n){const r=n.restore??!1,[a,i]=s.useState(Nx),[c,u]=s.useState(!1),[f,h]=s.useState(null),p=s.useRef(null),m=s.useRef(null),v=s.useRef(n.pendingState);v.current=n.pendingState;const w=s.useRef(n.exists);w.current=n.exists;const y=s.useRef(n.onDiscarded);y.current=n.onDiscarded;const b=s.useRef(a);b.current=a,s.useEffect(()=>{var M;if(r){const L=nY(e,t);if(L){i(L);return}}const R=nA(e,t),E=R!=null&&R.pending?v.current(R.pending):null;if(R!=null&&R.pending&&E==="unknown"&&((M=w.current)!=null&&M.call(w,R.name))){fu(e,t);return}if(R&&!R.pending){fu(e,t);return}R&&bK(R,E)&&(m.current=R.pending,i({name:R.name,instruction:R.instruction,facets:R.facets,imageHashes:R.imageHashes,importUrl:R.importUrl}))},[e,t,r]);const k=s.useCallback(R=>{p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m.current&&Pg(R)?Lg(e,t,{...R,pending:m.current}):fu(e,t)},400)},[e,t]),S=s.useCallback(R=>{i(E=>{const M={...E,...typeof R=="function"?R(E):R};return k(M),M})},[k]),C=s.useCallback(()=>{var E;p.current&&clearTimeout(p.current);const R=b.current;if(m.current&&Pg(R)){Lg(e,t,{...R,pending:m.current});return}fu(e,t),Pg(R)&&(tY(e,t,R),(E=y.current)==null||E.call(y))},[e,t]);s.useEffect(()=>(window.addEventListener("beforeunload",C),()=>{window.removeEventListener("beforeunload",C),C()}),[C]);const j=s.useCallback(async R=>{u(!0),h(null);try{const E=n.max-b.current.imageHashes.length,M=[];for(const L of R.slice(0,E))M.push(await L0(L));S(L=>({imageHashes:[...new Set([...L.imageHashes,...M])].slice(0,n.max)}))}catch(E){h(String(E.message??E))}finally{u(!1)}},[n.max,S]),N=s.useCallback(R=>S(E=>({imageHashes:E.imageHashes.filter(M=>M!==R)})),[S]),P=s.useCallback(R=>S(E=>({facets:E.facets.includes(R)?E.facets.filter(M=>M!==R):[...E.facets,R]})),[S]),$=s.useCallback(R=>{if(p.current&&clearTimeout(p.current),!R){fu(e,t),m.current=null,i(Nx);return}m.current=R,i(E=>(Lg(e,t,{...E,pending:R}),E))},[e,t]);return{fields:a,set:S,uploading:c,err:f,setErr:h,addFiles:j,removeHash:N,toggleFacet:P,submitted:$}}const Mx=6,sY=3;function aY({onBack:e,onStarted:t,restore:n,onDiscarded:r}){var E,M;const{brand:a}=on(),{applyBrand:i}=Rn(),[c,u]=s.useState(!1),[f,h]=s.useState(!1),[p,m]=s.useState(!1),v=rY(a.id,"product",{max:Mx,pendingState:()=>"unknown",restore:n,onDiscarded:r}),w=v.fields.imageHashes.length>0,y=w?void 0:"Add at least one photo",b=async()=>{u(!0),v.setErr(null);try{const{productId:L,...H}=await Me.createProduct(a.id,{name:v.fields.name.trim(),imageHashes:v.fields.imageHashes,category:v.fields.facets[0]});i(H);const D=v.fields.name.trim()||"Product";v.submitted(null),t({kind:"product",id:L,name:D})}catch(L){v.setErr(String(L.message??L))}finally{u(!1)}},[k,S]=s.useState(null),{scan:C,scanning:j,settled:N}=ZA(k?a.id:null,k??void 0),P=async L=>{const H=k??v.fields.importUrl.trim()??"";h(!0),v.setErr(null);try{await Me.catalogImport(a.id,H,L),v.set({importUrl:""}),S(null),t({kind:"product",id:"",name:H})}catch(D){v.setErr(String(D.message??D))}finally{h(!1)}},$=()=>{var H,D;const L=v.fields.importUrl.trim()||(((D=(H=a.json)==null?void 0:H.meta)==null?void 0:D.website)??"");L&&(v.setErr(null),S(L))};s.useEffect(()=>{!k||!N||C&&C.verdict==="found"&&C.candidates.length||P()},[C,N,k]);const R=L=>{L.key==="Enter"&&(L.preventDefault(),w&&!c&&b())};return o.jsxs(eY,{title:"New product",error:v.err,footnote:"Added to this brand. No preview.",primaryLabel:"Add product",ready:w,blocked:y,busy:c,onBack:e,onPrimary:()=>void b(),onPasteFiles:L=>void v.addFiles(L),children:[o.jsxs("div",{className:"sc-assetform",children:[o.jsx(zA,{hashes:v.fields.imageHashes,max:Mx,label:"Add packshots",hint:`Straight, well-lit packshots. The first ${sY} are the ones a shot attaches.`,busy:v.uploading,onAdd:L=>void v.addFiles(L),onRemove:v.removeHash,onReject:()=>v.setErr("Drop an image file.")}),o.jsx("div",{className:"sc-assetform-fields",children:o.jsxs("div",{className:"sc-assetform-field",children:[o.jsx("label",{className:"sc-newdlg-seclabel",htmlFor:"sc-product-name",children:"Name"}),o.jsx("input",{id:"sc-product-name",className:"sc-in",type:"text",placeholder:"Name this product",value:v.fields.name,onChange:L=>v.set({name:L.target.value}),onKeyDown:R})]})}),o.jsxs("fieldset",{className:"sc-assetform-facets",children:[o.jsx("legend",{children:"Category"}),o.jsx("div",{className:"sc-assetform-facets-chips",children:$0.map(L=>o.jsx("button",{type:"button",className:"sc-chip","data-on":v.fields.facets[0]===L.key||void 0,"aria-pressed":v.fields.facets[0]===L.key,onClick:()=>v.set({facets:v.fields.facets[0]===L.key?[]:[L.key]}),children:L.label},L.key))})]})]}),o.jsx("div",{className:"sc-newdlg-secondary",children:p?o.jsxs(o.Fragment,{children:[o.jsx("label",{className:"sc-newdlg-seclabel",htmlFor:"sc-import-url",children:"Your store's address"}),o.jsxs("div",{className:"sc-newdlg-secrow",children:[o.jsx("input",{id:"sc-import-url",className:"sc-in",type:"url",placeholder:((M=(E=a.json)==null?void 0:E.meta)==null?void 0:M.website)??"https://yourstore.com",value:v.fields.importUrl,onChange:L=>v.set({importUrl:L.target.value}),onKeyDown:L=>{L.key==="Enter"&&$()}}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:f||j,onClick:$,children:j?"Looking…":f?"Starting…":"Import"})]})]}):o.jsx("button",{type:"button",className:"sc-newdlg-secmore",onClick:()=>m(!0),children:"Import a catalog from a store URL"})}),C&&C.verdict==="found"&&C.candidates.length>0&&o.jsx(_A,{brandId:a.id,scan:C,busy:f,onImport:L=>void P(L),onImportAll:()=>void P(),onDismiss:()=>S(null)})]})}const Hg="1",oY={product:"Product",presenter:"Presenter",scene:"Scene"},iY=["product","presenter","scene"],lY=e=>!!e&&iY.includes(e),UA=s.createContext(null);function WA(){const e=s.useContext(UA);if(!e)throw new Error("useCreateAsset must be used inside AssetCreateHost");return e}function cl(){return WA().open}function KA(){const e=!!un({path:ut.products,end:!1}),t=!!un({path:ut.presenters,end:!1}),n=!!un({path:ut.scenes,end:!1});return e?"product":t?"presenter":n?"scene":null}function Pv(){const{announce:e,caps:t}=WA();return{announce:e,caps:t}}function cY({children:e}){const{brand:t}=on(),n=Dn(),r=Zn(),{push:a}=ir(),{refreshBrands:i}=Rn(),{builds:c,poke:u}=Va(),f=Ns("new"),h=f.value,p=KA(),m=!!un({path:ut.presenterStudio}),v=!!un({path:ut.presenterEdit}),w=!!un({path:ut.sceneStudio}),y=!!un({path:ut.sceneEdit}),[b,k]=s.useState(null),[S,C]=s.useState(!1),[j,N]=s.useState(!1),P=s.useRef(null),$=s.useRef(null),R=f.open,E=f.set,M=f.close,L=s.useCallback((V,I)=>{if(P.current=V==="choose"||!(I!=null&&I.onCreated)?null:{kind:V,fn:I.onCreated},V==="presenter"){n(Ui(t));return}if(V==="scene"){n(Bi(t),{state:{from:r.pathname+r.search}});return}$.current=document.activeElement instanceof HTMLElement?document.activeElement:null,C(V==="choose"),N(!1),R(V==="choose"?Hg:V)},[R,n,t,r.pathname,r.search]);s.useEffect(()=>{h==="presenter"&&n(Ui(t),{replace:!0}),h==="scene"&&n(Bi(t),{replace:!0})},[h,n,t]);const H=s.useCallback(()=>{P.current=null,C(!1),M()},[M]),D=s.useCallback(V=>{a({kind:"success",title:`${oY[V]} discarded`,detail:"Nothing was saved.",action:{label:"Undo",onClick:()=>{N(!0),C(!1),R(V)}}})},[R,a]);s.useEffect(()=>{h===null&&N(!1)},[h]),s.useEffect(()=>{if(h!==null)return;const V=$.current;$.current=null,V!=null&&V.isConnected&&V.focus()},[h]);const K=h!==null||m||v||w||y;s.useEffect(()=>{if(!K)return;let V=!0,I=null;const B=Y=>Me.assetBuildCapabilities().then(ae=>V&&k(ae)).catch(()=>{V&&Y&&(I=setTimeout(()=>B(!1),600))});return B(!0),()=>{V=!1,I&&clearTimeout(I)}},[K]);const O=s.useCallback(V=>{const I=c.find(B=>B.id===V);return I?I.stage==="failed"?"failed":I.stage==="cancelled"?"cancelled":I.stage==="done"?"done":"running":"unknown"},[c]),_=s.useCallback(V=>{var Y;const I=P.current;if(P.current=null,u(),V.kind==="product"){if(!V.id){a({kind:"info",title:"Importing your catalog",detail:V.name});return}(I==null?void 0:I.kind)==="product"&&I.fn(V),a({kind:"success",title:`${V.name} added`,actions:[{label:"Add details",onClick:()=>n(la(t,V.id))},{label:"Use in a shot",onClick:()=>n(`${mr(t)}?product=${V.id}&compose=1`)}]});return}if(V.kind==="presenter"){(I==null?void 0:I.kind)==="presenter"&&I.fn(V),a({kind:"success",title:`${V.name} added`,actions:[{label:"Use in a shot",onClick:()=>n(`${mr(t)}?presenter=${V.id}&compose=1`)}]});return}i(),(I==null?void 0:I.kind)==="scene"&&I.fn(V);const B=(Y=V.verticals)!=null&&Y.length?`Filed under ${V.verticals.join(" and ")}.`:void 0;a({kind:"success",title:V.how==="updated"?`${V.name} changed`:`${V.name} saved`,detail:B,actions:[{label:"Open",onClick:()=>n(_r(t,V.id))},{label:"Use in a shot",onClick:()=>n(`${mr(t)}?scene=${V.id}&compose=1`)}]})},[t,n,u,a,i]),re=s.useCallback(V=>{_(V),H()},[H,_]),z=s.useMemo(()=>({open:L,announce:_,caps:b}),[L,_,b]),F=lY(h)?h:null,Q={onBack:S?()=>E(Hg):void 0,onStarted:re,caps:b,pendingState:O,restore:j,onDiscarded:()=>F&&D(F)};return o.jsxs(UA.Provider,{value:z,children:[e,h===Hg&&o.jsx(UG,{suggest:p,onPick:V=>{if(V==="presenter"){n(Ui(t),{replace:!0});return}if(V==="scene"){n(Bi(t),{replace:!0});return}C(!0),E(V)}}),F==="product"&&o.jsx(aY,{...Q},"product")]})}const uY=[{kind:"product",label:"Product",line:"What you are photographing",noun:"product",icon:Bp},{kind:"presenter",label:"Presenter",line:"Who appears in the shot",noun:"presenter",icon:Vp},{kind:"scene",label:"Scene",line:"The place and its light",noun:"scene",icon:Zp}],dY={product:"New product",presenter:"New presenter",scene:"New scene"};function fY(){var f;const e=cl(),t=KA(),n=FA(),{showcase:r}=Rn(),a=((f=r.find(h=>h.previewUrl))==null?void 0:f.previewUrl)??null,i=Sv(16).find(h=>h.key==="create"),c=i?`${i.to}&attach=all`:"",u=t?dY[t]:"New";return o.jsxs("div",{className:"sc-new",children:[t?o.jsxs("button",{type:"button",className:"sc-new-go","aria-label":u,"data-guide":"library.new",onClick:()=>e(t),children:[o.jsx(cr,{size:14,weight:"bold",className:"sc-new-plus","aria-hidden":"true"}),o.jsxs("span",{className:"sc-new-lb",children:[o.jsx("span",{className:"sc-new-verb",children:"New "}),o.jsx("span",{className:"sc-new-kind",children:t})]})]}):o.jsxs(_n,{className:"sc-new-go",to:c,"aria-label":"New shot","data-attach-opener":"",children:[o.jsx(cr,{size:14,weight:"bold",className:"sc-new-plus","aria-hidden":"true"}),o.jsx("span",{className:"sc-new-lb",children:"New"})]}),o.jsx("span",{className:"sc-new-split","aria-hidden":"true"}),o.jsxs(DA,{label:"New",className:"sc-menu-start",trigger:o.jsx("button",{type:"button",className:"sc-new-more","aria-label":"Other ways to start",children:o.jsx(Xi,{size:12,weight:"bold",className:"sc-new-caret","aria-hidden":"true"})}),children:[o.jsxs(ju,{className:"sc-menu-item sc-start-row","data-lead":"",to:c,children:[o.jsx("span",{className:"sc-start-pic",children:a?o.jsx("img",{src:sr(a,"tile"),alt:"",loading:"lazy",decoding:"async"}):o.jsx("span",{className:"sc-start-glyph",children:o.jsx(sC,{size:22})})}),o.jsxs("span",{className:"sc-start-txt",children:[o.jsx("b",{children:"New shot"}),o.jsx("small",{children:"Write a brief, get a shot"})]})]}),o.jsx("div",{className:"sc-menu-label",children:"Add to this brand"}),uY.map(h=>{const{url:p,count:m}=n[h.kind];return o.jsxs(ju,{className:"sc-menu-item sc-start-row",onSelect:()=>e(h.kind),children:[o.jsx("span",{className:"sc-start-pic",children:p?o.jsx("img",{src:p,alt:"",loading:"lazy",decoding:"async"}):o.jsx("span",{className:"sc-start-glyph",children:o.jsx(h.icon,{size:22})})}),o.jsxs("span",{className:"sc-start-txt",children:[o.jsx("b",{children:h.label}),o.jsx("small",{children:h.line})]}),o.jsxs("span",{className:"sc-start-n",children:[m===0?"None yet":m,o.jsx("span",{className:"sc-vh",children:` ${h.noun}${m===1?"":"s"} so far`})]})]},h.kind)})]})]})}const hY=24,pY=8;function mY(){const e=wr(Ks),{pathname:t}=Zn();s.useEffect(()=>{const n=document.querySelector(".sc-shell");if(!n||(delete n.dataset.condensed,e))return;let r=0;const a=i=>{const c=i.target;!(c!=null&&c.dataset)||!("pageScroll"in c.dataset)||r||(r=requestAnimationFrame(()=>{r=0;const u=n.dataset.condensed!==void 0,f=c.scrollTop;(u?f<=pY:f>hY)&&(u?delete n.dataset.condensed:n.dataset.condensed="")}))};return n.addEventListener("scroll",a,{capture:!0,passive:!0}),()=>{r&&cancelAnimationFrame(r),n.removeEventListener("scroll",a,{capture:!0}),delete n.dataset.condensed}},[e,t])}const GA=["M64 18.71V38.8L51.38 51.39V12.62H57.9C61.27 12.62 64 15.35 64 18.72V18.71Z","M12.62 12.62V51.39H6.1C2.73 51.39 0 48.66 0 45.29V25.2L12.62 12.61V12.62Z","M51.38 51.38L38.79 64H18.7C15.33 64 12.6 61.27 12.6 57.9V51.38H51.37H51.38Z","M12.62 12.62L25.2 0H45.29C48.66 0 51.39 2.73 51.39 6.1V12.62H12.62Z"],gY=["M100.99 28.93L91.76 27.8C88.5 27.41 87.19 26.58 87.19 25.1C87.19 23.45 89.98 22.49 94.29 22.49C99.38 22.49 102.43 23.36 104.17 26.58L111.61 24.27C108.65 17.87 102.08 16 94.98 16C85.1 16 78.7 19.31 78.7 25.97C78.7 31.02 82.49 33.81 90.28 34.76L98.68 35.8C102.29 36.24 103.3 37.19 103.3 38.5C103.3 40.24 100.64 41.46 95.59 41.46C89.41 41.46 87.01 40.2 85.31 37.02L77.52 39.33C80.31 45.77 86.92 47.95 95.07 47.95C105.17 47.95 111.88 44.55 111.88 37.72C111.88 32.84 108.53 29.84 101 28.93H100.99Z","M132.73 22.66C137 22.66 140.87 24.01 142.7 28.54L150.49 26.67C148.79 20.66 142.3 16.05 132.6 16.05C121.41 16.05 113.44 22.23 113.44 31.98C113.44 41.73 121.41 48 132.6 48C142.31 48 148.8 43.3 150.49 37.29L142.7 35.42C140.87 39.95 137 41.3 132.73 41.3C126.94 41.3 122.24 38.38 122.24 32.42V31.55C122.24 25.59 126.94 22.67 132.73 22.67V22.66Z","M161.51 34.89H179.58V28.71H161.51V22.97H181.54V16.52H152.8V47.43H181.84V40.99H161.51V34.89Z","M208.71 33.85H208.67L193.86 16.52H184.94V47.43H193.04V27.49H193.08L210.15 47.43H216.81V16.52H208.71V33.85Z","M252.25 26.8C252.25 20.14 248.07 16.52 239.84 16.52H220.77V47.43H229.48V37.5H236.62L242.63 47.43H252.56L245.55 36.37C249.9 34.8 252.25 31.62 252.25 26.79V26.8ZM243.54 27.32C243.54 29.98 242.06 31.28 239.06 31.28H229.48V22.96H239.06C242.06 22.96 243.54 24.27 243.54 26.88V27.32Z","M263.79 16.52H255.08V47.43H263.79V16.52Z"];function vY(e){return o.jsx("svg",{viewBox:"0 0 263.79 64",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:[...GA,...gY].map(t=>o.jsx("path",{d:t},t))})}function wY(e){return o.jsx("svg",{viewBox:"0 0 64 64",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:GA.map(t=>o.jsx("path",{d:t},t))})}function yY(){const{brand:e}=on();return mY(),o.jsxs("header",{className:"sc-topbar",children:[o.jsx("a",{className:"sc-skip",href:"#main",children:"Skip to content"}),o.jsx("div",{className:"sc-topbar-lead",children:o.jsx(_n,{className:"sc-wordmark","aria-label":"Scenri home",to:mo(e),children:o.jsx(vY,{"aria-hidden":"true"})})}),o.jsx(DG,{}),o.jsxs("div",{className:"sc-topbar-end",children:[o.jsx(_G,{}),o.jsx(TG,{}),o.jsx(fY,{}),o.jsx(OG,{})]})]})}const bY=60;function xY(){s.useEffect(()=>{const e=window.visualViewport;if(!e)return;const t=document.documentElement,n=()=>{const r=window.innerHeight-e.height-e.offsetTop;t.style.setProperty("--sc-kb",r>bY?`${Math.round(r)}px`:"0px")};return n(),e.addEventListener("resize",n),e.addEventListener("scroll",n),()=>{e.removeEventListener("resize",n),e.removeEventListener("scroll",n),t.style.removeProperty("--sc-kb")}},[])}const YA=s.createContext(null);function qA(){return s.useContext(YA)}function kY({brand:e,children:t}){const n=e.id,[r,a]=s.useState({products:[],loaded:!1}),i=s.useRef(null),{tasks:c}=Va(),u=c.filter(w=>w.kind==="catalog").map(w=>`${w.id}:${w.state}`).join("|"),f=c.some(w=>w.kind==="catalog"&&w.state==="running"),h=s.useRef(0),p=s.useRef(n);p.current=n;const m=s.useCallback(async()=>{const w=++h.current;try{const y=await Me.productsLibrary(n);if(w!==h.current||p.current!==n)return;const b=JSON.stringify(y.products);if(i.current===b)return;i.current=b,a({products:y.products,loaded:!0})}catch{if(w!==h.current||p.current!==n)return;a(y=>({products:y.products,loaded:!0}))}},[n]);s.useEffect(()=>{i.current=null,a({products:[],loaded:!1})},[n]),s.useEffect(()=>{m()},[m,e.updatedAt,u]),s.useEffect(()=>{if(!f)return;const w=setInterval(()=>void m(),2e3);return()=>clearInterval(w)},[f,m]);const v=s.useMemo(()=>({products:r.products,productsLoaded:r.loaded,importing:f,refreshProducts:m}),[r.products,r.loaded,f,m]);return o.jsx(YA.Provider,{value:v,children:t})}function Qr({title:e,sub:t,children:n}){return o.jsxs("section",{className:"sc-set-sec",children:[(e||t)&&o.jsxs("div",{className:"sc-set-sech",children:[e&&o.jsx("h3",{children:e}),t&&o.jsx("p",{children:t})]}),o.jsx("div",{className:"sc-set-card",children:n})]})}const SY={npx:"run with npx",global:"installed with npm",managed:"managed install",dev:"running from source",unknown:"local studio"};function EY({version:e}){return o.jsxs(Qr,{children:[o.jsx("div",{className:"sc-set-row",children:o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Scenri"}),o.jsxs("small",{children:[e?`v${e.version}`:""," · ",SY[(e==null?void 0:e.installKind)??"unknown"]]})]})}),o.jsx("div",{className:"sc-set-row",children:o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"License"}),o.jsx("small",{children:"AGPL-3.0 for the app · Apache-2.0 for the .brand format"})]})}),o.jsx("div",{className:"sc-set-row",children:o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Open source"}),o.jsxs("small",{children:["Built by Tony Gorb ·"," ",o.jsx("a",{href:"https://github.com/tonygorb/scenri",target:"_blank",rel:"noreferrer",children:"GitHub"})]})]})})]})}function x6({w:e,h:t,slot:n,box:r}){const a=r/Math.max(e,t);return o.jsx("span",{className:"sc-ratio-slot",style:{width:n,height:n},"aria-hidden":!0,children:o.jsx("span",{className:"sc-ratio",style:{width:Math.round(e*a),height:Math.round(t*a)}})})}const Rx=()=>o.jsx("span",{className:"sc-setpop-tick","aria-hidden":!0,children:o.jsx(Kn,{size:12,weight:"bold"})});function Fo({label:e,value:t,ids:n,unavailable:r=[],onChange:a,className:i,children:c}){const u=s.useRef(null),f=n.filter(p=>!r.includes(p)),h=p=>{var y,b;const m=p.key==="ArrowDown"||p.key==="ArrowRight"?1:p.key==="ArrowUp"||p.key==="ArrowLeft"?-1:p.key==="Home"?"first":p.key==="End"?"last":null;if(m===null||!f.length)return;p.preventDefault();const v=f.indexOf(t),w=m==="first"?f[0]:m==="last"?f[f.length-1]:m===1?f[v<0||v===f.length-1?0:v+1]:f[v<=0?f.length-1:v-1];a(w),(b=(y=u.current)==null?void 0:y.querySelector(`[data-id="${w}"]`))==null||b.focus()};return o.jsx("div",{className:i,role:"radiogroup","aria-label":e,ref:u,tabIndex:-1,onKeyDown:h,children:c})}const _o=s.forwardRef(function({id:t,on:n,unavailable:r,label:a,onPick:i,className:c,children:u,...f},h){return o.jsx("button",{...f,ref:h,type:"button",role:"radio","data-id":t,className:c,"aria-checked":n,"aria-label":a,"aria-disabled":r||void 0,"data-on":n||void 0,tabIndex:n?0:-1,onClick:p=>{var m;(m=f.onClick)==null||m.call(f,p),r||i()},children:u})}),CY=({children:e})=>o.jsx("p",{className:"sc-setpop-foot",children:e}),Px=[{id:"light",label:"Light"},{id:"dark",label:"Dark"},{id:"system",label:"System"}];function jY(){const{choice:e,setChoice:t}=vB();return o.jsx(Qr,{children:o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Theme"}),o.jsx("small",{children:"Follows your system unless you pick a side."})]}),o.jsx(Fo,{label:"Theme",className:"sc-seg",value:e,ids:Px.map(n=>n.id),onChange:n=>t(n),children:Px.map(n=>o.jsx(_o,{id:n.id,className:"sc-seg-o",on:e===n.id,label:n.label,onPick:()=>t(n.id),children:n.label},n.id))})]})})}function AY({value:e,onChange:t,placeholder:n,label:r,suggestions:a,max:i=24,maxLength:c=200}){const[u,f]=s.useState(""),h=e.length>=i,p=v=>{const w=v.trim().slice(0,c);f(""),!(!w||h)&&(e.some(y=>y.toLowerCase()===w.toLowerCase())||t([...e,w]))},m=!h&&a&&a.length>0?o.jsx("div",{className:"sc-chips-sugg",children:a.map(v=>o.jsx("button",{type:"button",className:"sc-chip",onClick:()=>p(v),"aria-label":`Never show ${v}`,children:v},v))}):null;return o.jsxs(o.Fragment,{children:[e.length===0&&m,o.jsxs("div",{className:"sc-chips",children:[e.map((v,w)=>o.jsxs("span",{className:"sc-chips-item",children:[o.jsx("span",{dir:"auto",children:v}),o.jsx("button",{type:"button",onClick:()=>t(e.filter((y,b)=>b!==w)),"aria-label":`Remove ${v}`,children:o.jsx(jn,{size:10,weight:"bold"})})]},v)),o.jsx("input",{className:"sc-chips-in",value:u,"aria-label":r,placeholder:h?void 0:e.length?"Add another…":n??"Add one…",disabled:h,dir:"auto",onChange:v=>{const w=v.target.value;if(w.includes(",")){const y=w.split(",");for(const b of y.slice(0,-1))p(b);f(y[y.length-1]);return}f(w.slice(0,c))},onKeyDown:v=>{v.key==="Enter"?(v.preventDefault(),p(u)):v.key==="Backspace"&&!u&&e.length&&t(e.slice(0,-1))},onBlur:()=>p(u)})]}),e.length>0&&m]})}const NY=["competitor logos in frame","visible text or wordmarks on clothing","alcohol","children","visible clutter or mess","heavy skin retouching","neon or harsh colour","pure white studio backgrounds"],Lx=e=>e.trim().toLowerCase();function MY(e){const t=new Set((e??[]).map(Lx));return NY.filter(n=>!t.has(Lx(n)))}function RY({doc:e}){var a;const t=((a=e.json)==null?void 0:a.rules)??{},n=t.never??[],r=i=>{const c={...t};i.length?c.never=i:delete c.never,e.patch({rules:c})};return o.jsx("div",{className:"sc-nv",children:o.jsx(AY,{label:"Things this brand never shows",value:n,placeholder:"Or type your own",suggestions:MY(n),max:24,onChange:r})})}function PY({brand:e,doc:t}){const{push:n}=ir(),[r,a]=s.useState(!1),i=t.json??{},c=i.meta??{},u=c.name??e.slug,f=kf(i),h=Qp(f)??void 0,p=f.filter(b=>b!==h),m=b=>{const k={...c};for(const[S,C]of Object.entries(b)){const j=C.trim();j?k[S]=j:delete k[S]}k.name||(k.name=c.name),t.patch({meta:k})},v=async(b,k)=>{a(!0);try{await t.flush(),t.applyRow(await k())}catch(S){n(nn(S,b))}finally{a(!1)}},w=b=>void v("Could not upload that mark",async()=>{const k=await Oj(e.id,b[0]),S=k.logoEdge;return S&&S<512&&n({kind:"warning",title:"Logo added, but it is small",detail:`Only ${S}px across. Fine lettering may not survive generation. Export it larger, or as SVG.`}),k}),{dropProps:y}=VA({onFiles:w,onReject:()=>n({kind:"warning",title:"That is not an image",detail:"Drop a PNG, SVG or JPG."}),disabled:r});return o.jsxs("div",{className:"sc-ident",...y,children:[o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Logo"}),o.jsx("small",{children:"Drop an image, or tap to add."})]}),o.jsxs("div",{className:"sc-set-controls",children:[o.jsx(LY,{mark:h,name:u,busy:r,onUpload:w}),(h==null?void 0:h.attachable)&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:r,onClick:()=>void v("Could not remove that mark",()=>Me.deleteLogo(e.id,h.hash??"")),children:"Remove"})]})]}),h&&o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Sits on"}),o.jsx("small",{children:"So a dark mark is not shown on a dark ground."})]}),o.jsx("select",{className:"sc-in",value:h.background,disabled:r||!h.attachable,onChange:b=>void v("Could not update that mark",()=>Me.updateLogo(e.id,h.hash??"",{background:b.target.value})),"aria-label":"Sits on",children:kv.map(b=>o.jsx("option",{value:b,children:b==="any"?"Any background":`On ${b}`},b))})]}),o.jsx(Tx,{label:"Name",value:c.name??"",placeholder:e.slug,maxLength:120,onCommit:b=>m({name:b})}),o.jsx(Tx,{label:"Tagline",value:c.tagline??"",placeholder:"Add a tagline",maxLength:200,onCommit:b=>m({tagline:b})}),p.map(b=>o.jsx(TY,{mark:b,busy:r,onRole:k=>void v("Could not retag that mark",()=>Me.updateLogo(e.id,b.hash??"",{role:k})),onBackground:k=>void v("Could not update that mark",()=>Me.updateLogo(e.id,b.hash??"",{background:k})),onRemove:()=>void v("Could not remove that mark",()=>Me.deleteLogo(e.id,b.hash??""))},b.hash??b.file)),h&&o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Variant"}),o.jsx("small",{children:"A second mark for dark or light grounds."})]}),o.jsxs("label",{className:"sc-btn sc-btn-ghost",children:[o.jsx(cr,{size:12}),"Add",o.jsx("input",{type:"file",accept:"image/*",hidden:!0,disabled:r,onChange:b=>{const k=Array.from(b.target.files??[]);b.target.value="",k.length&&w(k)}})]})]})]})}function Tx({label:e,value:t,placeholder:n,maxLength:r,onCommit:a}){const[i,c]=s.useState(t);return s.useEffect(()=>c(t),[t]),o.jsxs("div",{className:"sc-set-row",children:[o.jsx("span",{className:"txt",children:o.jsx("b",{children:e})}),o.jsx("input",{className:"sc-in",value:i,placeholder:n,"aria-label":e,maxLength:r,dir:"auto",onChange:u=>c(u.target.value),onBlur:()=>{const u=i.trim();u!==t&&a(u),c(u)},onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),u.currentTarget.blur()),u.key==="Escape"&&(c(t),u.currentTarget.blur())}})]})}function LY({mark:e,name:t,busy:n,onUpload:r}){const[a,i]=s.useState(null);if(e){const c=e.hash?Mr(e.hash):e.file;return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-well","data-bg":e.background,children:o.jsx("img",{src:c,alt:`${t} logo`,onLoad:u=>{const f=u.currentTarget,h=Math.max(f.naturalWidth,f.naturalHeight);i(h>0&&h<512?h:null)}})}),a!==null&&o.jsxs("small",{className:"sc-mark-small",children:["Only ",a,"px across. Fine lettering may not survive generation."]})]})}return o.jsxs("label",{className:"sc-well","data-empty":"","aria-label":"Add logo",children:[o.jsx(fv,{size:16}),o.jsx("input",{type:"file",accept:"image/*",hidden:!0,disabled:n,onChange:c=>{const u=Array.from(c.target.files??[]);c.target.value="",u.length&&r(u)}})]})}function TY({mark:e,busy:t,onRole:n,onBackground:r,onRemove:a}){const i=e.hash?Mr(e.hash):e.file;return o.jsxs("div",{className:"sc-set-row",children:[o.jsx("span",{className:"txt",children:o.jsx("b",{children:U1[e.role]})}),o.jsxs("div",{className:"sc-set-controls",children:[o.jsx("span",{className:"sc-well","data-bg":e.background,children:o.jsx("img",{src:i,alt:U1[e.role]})}),o.jsx("select",{className:"sc-in",value:e.role,disabled:t||!e.attachable,onChange:c=>n(c.target.value),"aria-label":"Mark role",children:jA.map(c=>o.jsx("option",{value:c,children:U1[c]},c))}),o.jsx("select",{className:"sc-in",value:e.background,disabled:t||!e.attachable,onChange:c=>r(c.target.value),"aria-label":"Sits on",children:kv.map(c=>o.jsx("option",{value:c,children:c==="any"?"Any background":`On ${c}`},c))}),e.attachable&&o.jsx("button",{type:"button",disabled:t,onClick:a,"aria-label":`Remove ${U1[e.role]}`,children:o.jsx(Up,{size:13})})]})]})}const $x={primary:"Primary",secondary:"Secondary",accent:"Accent",neutral:"Neutral"},$Y=(e,t)=>t<=1?$x[e]:`${$x[e]} ${t}`;function DY(e){return/^(Primary|Secondary|Accent|Neutral)( [2-9]\d*)?$/.test(String(e??"").trim())}const HY=/^#[0-9A-F]{6}$/;function nr(e){const t=String(e??"").trim(),n=(t.startsWith("#")?t.slice(1):t).toUpperCase();if(/^[0-9A-F]{3}$/.test(n)){const[a,i,c]=n;return`#${a}${a}${i}${i}${c}${c}`}const r=`#${n}`;return HY.test(r)?r:null}const OY=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;function IY(e){const t=String(e??"").trim();return OY.test(t)?nr(t):null}function Zs(e){const t=[],n={primary:0,secondary:0,accent:0,neutral:0},r=(a,i)=>{const c=nr(String((a==null?void 0:a.hex)??""));if(!c)return;n[i]+=1;const u=String((a==null?void 0:a.name)??"").trim();t.push({hex:c,name:u||$Y(i,n[i]),slot:i})};r(e==null?void 0:e.primary,"primary"),r(e==null?void 0:e.secondary,"secondary");for(const a of Array.isArray(e==null?void 0:e.accent)?e.accent:[])r(a,"accent");for(const a of Array.isArray(e==null?void 0:e.neutrals)?e.neutrals:[])r(a,"neutral");return t}function Lv(e,t){const n={},r=[],a=[],i=p=>{const m=p.name.trim();return m&&!DY(m)?{hex:p.hex,name:m}:{hex:p.hex}};for(const p of e){const m=nr(p.hex);if(!m)continue;const v=i({...p,hex:m});p.slot==="neutral"?a.push(v):r.push(v)}const[c,u,...f]=r;c&&(n.primary=c),u&&(n.secondary=u),f.length&&(n.accent=f),a.length&&(n.neutrals=a);const h=String((t==null?void 0:t.usage)??"").trim();return h&&(n.usage=h),n}const Dx=e=>e.slot!=="neutral";function nm(e){var c;const t=(c=e[e.length-1])==null?void 0:c.hex;if(!t)return"#808080";const n=Number.parseInt(t.slice(1),16),[r,a,i]=[n>>16&255,n>>8&255,n&255];return`#${[i,r,a].map(u=>u.toString(16).padStart(2,"0")).join("").toUpperCase()}`}function XA(e,t){const n=nr(t);if(!n)return{palette:e,added:!1,swatch:null};const r=Zs(e),a=r.find(f=>f.hex===n);if(a)return{palette:e,added:!1,swatch:a};const i=[...r,{hex:n,name:"",slot:r.length?"accent":"primary"}],c=Lv(i,e),u=Zs(c).find(f=>f.hex===n)??null;return{palette:c,added:!0,swatch:u}}function FY(e,t){const n=nr(t);if(!n)return{palette:e,removed:!1};const r=Zs(e),a=r.filter(i=>i.hex!==n);return a.length===r.length?{palette:e,removed:!1}:{palette:Lv(a,e),removed:!0}}function rm(){return(rm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function QA(e,t){if(e==null)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(a[n]=e[n]);return a}function m0(e){var t=s.useRef(e),n=s.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var H0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},g0=function(e){return"touches"in e},k6=function(e){return e&&e.ownerDocument.defaultView||self},Hx=function(e,t,n){var r=e.getBoundingClientRect(),a=g0(t)?(function(i,c){for(var u=0;u<i.length;u++)if(i[u].identifier===c)return i[u];return i[0]})(t.touches,n):t;return{left:H0((a.pageX-(r.left+k6(e).pageXOffset))/r.width),top:H0((a.pageY-(r.top+k6(e).pageYOffset))/r.height)}},Ox=function(e){!g0(e)&&e.preventDefault()},JA=$n.memo(function(e){var t=e.onMove,n=e.onKey,r=e.onEnd,a=QA(e,["onMove","onKey","onEnd"]),i=s.useRef(null),c=m0(t),u=m0(n),f=m0(r),h=s.useRef(null),p=s.useRef(!1),m=s.useMemo(function(){var k=function(j){Ox(j),(g0(j)?j.touches.length>0:j.buttons>0)&&i.current?c(Hx(i.current,j,h.current)):(C(!1),f())},S=function(){C(!1),f()};function C(j){var N=p.current,P=k6(i.current),$=j?P.addEventListener:P.removeEventListener;$(N?"touchmove":"mousemove",k),$(N?"touchend":"mouseup",S)}return[function(j){var N=j.nativeEvent,P=i.current;if(P&&(Ox(N),!(function(R,E){return E&&!g0(R)})(N,p.current)&&P)){if(g0(N)){p.current=!0;var $=N.changedTouches||[];$.length&&(h.current=$[0].identifier)}P.focus(),c(Hx(P,N,h.current)),C(!0)}},function(j){var N=j.which||j.keyCode;N<37||N>40||(j.preventDefault(),u({left:N===39?.05:N===37?-.05:0,top:N===40?.05:N===38?-.05:0}))},function(j){var N=j.which||j.keyCode;N>=37&&N<=40&&f()},C]},[u,c,f]),v=m[0],w=m[1],y=m[2],b=m[3];return s.useEffect(function(){return b},[b]),$n.createElement("div",rm({},a,{onTouchStart:v,onMouseDown:v,className:"react-colorful__interactive",ref:i,onKeyDown:w,onKeyUp:y,tabIndex:0,role:"slider"}))}),Tv=function(e){return e.filter(Boolean).join(" ")},eN=function(e){var t=e.color,n=e.left,r=e.top,a=r===void 0?.5:r,i=Tv(["react-colorful__pointer",e.className]);return $n.createElement("div",{className:i,style:{top:100*a+"%",left:100*n+"%"}},$n.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Hr=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},_Y=function(e){return UY(S6(e))},S6=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Hr(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?Hr(parseInt(e.substring(6,8),16)/255,2):1}},ZY=function(e){return BY(zY(e))},VY=function(e){var t=e.s,n=e.v,r=e.a,a=(200-t)*n/100;return{h:Hr(e.h),s:Hr(a>0&&a<200?t*n/100/(a<=100?a:200-a)*100:0),l:Hr(a/2),a:Hr(r,2)}},E6=function(e){var t=VY(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},zY=function(e){var t=e.h,n=e.s,r=e.v,a=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),c=r*(1-n),u=r*(1-(t-i)*n),f=r*(1-(1-t+i)*n),h=i%6;return{r:Hr(255*[r,u,c,c,f,r][h]),g:Hr(255*[f,r,r,u,c,c][h]),b:Hr(255*[c,c,f,r,r,u][h]),a:Hr(a,2)}},W1=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},BY=function(e){var t=e.r,n=e.g,r=e.b,a=e.a,i=a<1?W1(Hr(255*a)):"";return"#"+W1(t)+W1(n)+W1(r)+i},UY=function(e){var t=e.r,n=e.g,r=e.b,a=e.a,i=Math.max(t,n,r),c=i-Math.min(t,n,r),u=c?i===t?(n-r)/c:i===n?2+(r-t)/c:4+(t-n)/c:0;return{h:Hr(60*(u<0?u+6:u)),s:Hr(i?c/i*100:0),v:Hr(i/255*100),a}},WY=$n.memo(function(e){var t=e.hue,n=e.onChange,r=e.onChangeEnd,a=Tv(["react-colorful__hue",e.className]);return $n.createElement("div",{className:a},$n.createElement(JA,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:H0(t+360*i.left,0,360)})},onEnd:r,"aria-label":"Hue","aria-valuenow":Hr(t),"aria-valuemax":"360","aria-valuemin":"0"},$n.createElement(eN,{className:"react-colorful__hue-pointer",left:t/360,color:E6({h:t,s:100,v:100,a:1})})))}),KY=$n.memo(function(e){var t=e.hsva,n=e.onChange,r=e.onChangeEnd,a={backgroundColor:E6({h:t.h,s:100,v:100,a:1})};return $n.createElement("div",{className:"react-colorful__saturation",style:a},$n.createElement(JA,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:H0(t.s+100*i.left,0,100),v:H0(t.v-100*i.top,0,100)})},onEnd:r,"aria-label":"Color","aria-valuetext":"Saturation "+Hr(t.s)+"%, Brightness "+Hr(t.v)+"%"},$n.createElement(eN,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:E6(t)})))}),tN=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},GY=function(e,t){return e.toLowerCase()===t.toLowerCase()||tN(S6(e),S6(t))};function YY(e,t,n,r){var a=m0(n),i=m0(r),c=s.useState(function(){return e.toHsva(t)}),u=c[0],f=c[1],h=s.useRef({color:t,hsva:u}),p=s.useRef(!1);s.useEffect(function(){if(!e.equal(t,h.current.color)){var w=e.toHsva(t);h.current={hsva:w,color:t},f(w),p.current=!1}},[t,e]),s.useEffect(function(){var w;tN(u,h.current.hsva)||e.equal(w=e.fromHsva(u),h.current.color)||(h.current={hsva:u,color:w},a(w),p.current=!0)},[u,e,a]);var m=s.useCallback(function(w){f(function(y){return Object.assign({},y,w)})},[]),v=s.useCallback(function(){p.current&&(p.current=!1,i(h.current.color))},[i]);return[u,m,v]}var qY=typeof window<"u"?s.useLayoutEffect:s.useEffect,XY=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Ix=new WeakMap,QY=function(e){qY(function(){var t=e.current;if(typeof document<"u"&&t){var n=t.getRootNode?t.getRootNode():t.ownerDocument,r=n&&("head"in n||"host"in n)?n:t.ownerDocument;if(!Ix.has(r)){var a="head"in r?r.head:r,i=(a.ownerDocument||document).createElement("style");i.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`;var c=XY();c&&i.setAttribute("nonce",c),Ix.set(r,i),a.appendChild(i)}}},[])},JY=function(e){var t=e.className,n=e.colorModel,r=e.color,a=r===void 0?n.defaultColor:r,i=e.onChange,c=e.onChangeEnd,u=QA(e,["className","colorModel","color","onChange","onChangeEnd"]),f=s.useRef(null);QY(f);var h=YY(n,a,i,c),p=h[0],m=h[1],v=h[2],w=Tv(["react-colorful",t]);return $n.createElement("div",rm({},u,{ref:f,className:w}),$n.createElement(KY,{hsva:p,onChange:m,onChangeEnd:v}),$n.createElement(WY,{hue:p.h,onChange:m,onChangeEnd:v,className:"react-colorful__last-control"}))},eq={defaultColor:"000",toHsva:_Y,fromHsva:function(e){return ZY({h:e.h,s:e.s,v:e.v,a:1})},equal:GY},tq=function(e){return $n.createElement(JY,rm({},e,{colorModel:eq}))};function Zu({value:e,onChange:t,label:n,presets:r,className:a,triggerStyle:i,triggerProps:c,tip:u,commitMode:f="live",align:h="start",children:p}){const m=nr(e)??"#000000",[v,w]=s.useState(m),[y,b]=s.useState(!1);s.useEffect(()=>{y||w(m)},[m,y]);const k=P=>{const $=nr(P);$&&(w($),f==="live"&&t($))},S=P=>{const $=nr(P);$&&(w($),t($),f==="close"&&b(!1))},C=P=>{if(b(P),P||f!=="close")return;const $=nr(v);$&&$!==m&&t($)},j=[...new Set((r??[]).map(P=>nr(P)).filter(P=>!!P))],N=o.jsx(Iu,{children:o.jsx("button",{type:"button",className:a??"sc-cp-trigger",style:{background:m,...i},"aria-label":n,...c,children:p})});return o.jsxs(Ou,{open:y,onOpenChange:C,children:[u?o.jsx(or,{label:n,children:N}):N,o.jsxs(Fu,{className:"sc-cp",align:h,sideOffset:6,width:"232px",children:[o.jsx(tq,{color:v,onChange:k}),o.jsxs("div",{className:"sc-cp-foot",children:[o.jsx("span",{className:"sc-cp-preview",style:{background:v},"aria-hidden":!0}),o.jsx("input",{className:"sc-cp-hex",value:v,spellCheck:!1,maxLength:7,"aria-label":"Hex value",onChange:P=>{w(P.target.value);const $=nr(P.target.value);$&&f==="live"&&t($)},onBlur:()=>w(nr(v)??m),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),f==="close"?S(v):b(!1))}})]}),j.length>0&&o.jsx("div",{className:"sc-cp-presets",children:j.map(P=>o.jsx("button",{type:"button",style:{background:P},"data-on":P===v||void 0,title:P,"aria-label":P,onClick:()=>f==="close"?S(P):k(P)},P))})]})]})}function nq({doc:e,suggestions:t}){var w;const n=(w=e.json)==null?void 0:w.palette,[r,a]=s.useState(()=>Zs(n)),i=JSON.stringify(n??{});s.useEffect(()=>{a(Zs(n))},[i]);const c=(y,b=0)=>{a(y),e.patch({palette:Lv(y,n)},{debounce:b})},u=(y,b,k=0)=>c(r.map((S,C)=>C===y?{...S,...b}:S),k),f=()=>c([...r,{hex:nm(r),name:"",slot:r.length?"accent":"primary"}]),h=(t??[]).filter(y=>{const b=nr(y.hex);return b&&!r.some(k=>k.hex===b)}),p=(y,b)=>o.jsx(rq,{swatch:y,presets:r.map(k=>k.hex),onHex:k=>u(b,{hex:k},300),onRemove:()=>c(r.filter((k,S)=>S!==b))},`${y.slot}-${b}`),m=r.map((y,b)=>[y,b]),v=m.filter(([y])=>!Dx(y));return o.jsxs("div",{className:"sc-pal",children:[r.length===0&&o.jsx("p",{className:"sc-pal-empty",children:"No colours yet. Add one and it becomes a chip you can drop into any shot."}),m.filter(([y])=>Dx(y)).map(([y,b])=>p(y,b)),v.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sc-pal-group",children:"Neutrals"}),v.map(([y,b])=>p(y,b))]}),o.jsxs("div",{className:"sc-pal-foot",children:[o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:f,children:[o.jsx(cr,{size:12}),"Add colour"]}),h.length>0&&o.jsxs("span",{className:"sc-pal-sugg",children:[o.jsx("small",{children:"From the website"}),h.map(y=>{const b=nr(y.hex);return o.jsx("button",{type:"button",className:"sc-pal-sugg-chip",style:{background:b},title:`Add ${b}`,"aria-label":`Add ${b}`,onClick:()=>c([...r,{hex:b,name:"",slot:"accent"}])},b)})]})]})]})}function rq({swatch:e,presets:t,onHex:n,onRemove:r}){const[a,i]=s.useState(e.hex);s.useEffect(()=>i(e.hex),[e.hex]);const c=()=>{const u=nr(a);u&&n(u),i(u??e.hex)};return o.jsxs("div",{className:"sc-pal-row",children:[o.jsx(Zu,{value:e.hex,onChange:n,label:`${e.name} color`,presets:t,className:"sc-pal-chip"}),o.jsx("span",{className:"sc-pal-name",children:e.name}),o.jsx("input",{className:"sc-in sc-pal-hex",value:a,spellCheck:!1,maxLength:7,"aria-label":`${e.name} hex`,onChange:u=>i(u.target.value),onBlur:c,onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),u.currentTarget.blur())}}),o.jsx("button",{type:"button",className:"sc-pal-act","data-danger":"",onClick:r,"aria-label":`Remove ${e.name}`,title:"Remove",children:o.jsx(Up,{size:13})})]})}function sq(){const{brand:e}=on(),{applyBrand:t}=Rn(),{push:n}=ir(),[r,a]=s.useState({}),[i,c]=s.useState("idle"),u=s.useRef(r);u.current=r;const f=s.useRef(e);f.current=e;const h=s.useRef(null),p=s.useRef(!1),m=s.useRef(!1),v=s.useCallback(()=>({...f.current.json??{},...u.current}),[]),w=s.useCallback(async()=>{if(!Object.keys(u.current).length)return;if(p.current){m.current=!0;return}p.current=!0,c("saving");const C=u.current;try{const j=await Me.updateBrand(f.current.id,v());t(j),a(N=>{const P={...N};for(const $ of Object.keys(C))N[$]===C[$]&&delete P[$];return P}),c(m.current?"pending":"idle")}catch(j){c("error"),n({...nn(j,"Could not save the brand"),action:{label:"Retry",onClick:()=>void w()}})}finally{p.current=!1,m.current&&(m.current=!1,w())}},[t,v,n]),y=s.useCallback((C,j)=>{h.current&&(clearTimeout(h.current),h.current=null);const N={...u.current,...C};u.current=N,a(N),c("pending");const P=(j==null?void 0:j.debounce)??0;P>0?h.current=setTimeout(()=>void w(),P):w()},[w]),b=s.useCallback(async()=>{h.current&&(clearTimeout(h.current),h.current=null),await w()},[w]),k=s.useCallback(C=>{a({}),u.current={},t(C),c("idle")},[t]),S=e.id;return s.useEffect(()=>{a({}),u.current={},c("idle")},[S]),s.useEffect(()=>{const C=()=>{Object.keys(u.current).length&&EW(f.current.id,v()).then(j=>{j&&t(j)})};return window.addEventListener("beforeunload",C),()=>{window.removeEventListener("beforeunload",C),h.current&&clearTimeout(h.current),C()}},[v,t]),{json:v(),state:i,patch:y,flush:b,applyRow:k}}function aq(e){return e==="saving"?"Saving…":e==="pending"?"Unsaved changes":e==="error"?"Not saved":"Saved"}function oq({onSaveState:e}){var w,y;const{brand:t}=on(),{push:n}=ir(),r=sq();s.useEffect(()=>e(r.state),[r.state,e]);const[a,i]=s.useState(!1),[c,u]=s.useState([]),f=((y=(w=r.json)==null?void 0:w.meta)==null?void 0:y.website)??"",[h,p]=s.useState(f);s.useEffect(()=>p(f),[f]);const m=()=>{var C;const b=h.trim(),k=b&&!/^https?:\/\//i.test(b)?`https://${b}`:b;p(k);const S={...((C=r.json)==null?void 0:C.meta)??{}};k?S.website=k:delete S.website,r.patch({meta:S})},v=async()=>{var b,k,S;i(!0);try{await r.flush();const C=await Me.refreshBrandFromUrl(t.id);r.applyRow(C),u(((b=C.suggestions)==null?void 0:b.palette)??[]),n({kind:(k=C.warnings)!=null&&k.length?"warning":"success",title:"Read the website again",detail:(S=C.warnings)!=null&&S.length?C.warnings.join(" "):"Your edits were kept."})}catch(C){n(nn(C,"Could not read that website"))}finally{i(!1)}};return o.jsxs(o.Fragment,{children:[o.jsx(Qr,{title:"Identity",sub:"The name and the mark.",children:o.jsx(PY,{brand:t,doc:r})}),o.jsx(Qr,{title:"Palette",sub:"Favoured on a shot that asks for the kit.",children:o.jsx("div",{className:"sc-set-block",children:o.jsx(nq,{doc:r,suggestions:c})})}),o.jsx(Qr,{title:"We never",sub:"Held on every shot, whether the kit is asked for or not.",children:o.jsx("div",{className:"sc-set-block",children:o.jsx(RY,{doc:r})})}),o.jsxs(Qr,{title:"Website and file",sub:"The kit is a file, not a lock-in.",children:[o.jsxs("div",{className:"sc-set-row","data-stack":"",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Website"}),o.jsx("small",{children:"Reads colours and marks from the site again. Edits are kept; new colours are offered, not applied."})]}),o.jsxs("div",{className:"sc-set-controls",children:[o.jsx("input",{className:"sc-in",value:h,type:"url",inputMode:"url",placeholder:"acme.coffee","aria-label":"Brand website",onChange:b=>p(b.target.value),onBlur:m,onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),b.currentTarget.blur())}}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:!f||a,onClick:()=>void v(),children:[a?o.jsx(xr,{size:"1"}):o.jsx(cC,{size:13})," Refresh"]})]})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Export .brand"}),o.jsx("small",{"data-prose":"",children:"A zip holding brand.json and every image it references: the form any tool can read."})]}),o.jsx("a",{className:"sc-btn sc-btn-ghost",href:kW(t.id),download:!0,onClick:()=>void r.flush(),children:"Export"})]})]})]})}const Wi=e=>e.replace(/\s*\(BYOK\)\s*$/i,""),O0="codex-cli";function iq(e,t){var n;return e.some(r=>r.id===t)?t:((n=e[0])==null?void 0:n.id)??O0}const lq=e=>e.toFixed(3).replace(/0+$/,"").replace(/\.$/,"");function cq(e){return e.free?e.localOnly?"Runs on your ChatGPT plan":"No cost per image":`$${lq(e.perGeneration)} / image`}function uq(e,t){if(t)return e.available?"Manage":"Connect";if(e.available)return e.id===O0?"Manage":null;switch(e.code){case"update-needed":return"Update";case"env-conflict":return"Fix";case"not-installed":case"not-authenticated":case"unverified":return"Set up";default:return null}}function dq({engines:e,onSaved:t,thisComputer:n}){const r=e.filter(u=>!u.free),[a,i]=s.useState({});s.useEffect(()=>{i(Object.fromEntries(r.map(u=>[u.id,u.cap===null?"":String(u.cap)])))},[e]);const c=async u=>{const f=(a[u]??"").trim(),h=f===""?null:Number(f);h!==null&&(Number.isNaN(h)||h<0)||(await Me.setCap(u,h),t())};return r.length?o.jsx(Qr,{title:"Monthly caps",sub:n?"Your own API budget. Generation stops before a cap is crossed, so a runaway loop cannot spend your month.":"Your own API budget. Generation stops before a cap is crossed. Caps are set on the computer running Scenri.",children:r.map(u=>{const f=u.generationsLeft,h=u.generationsTotal,p=h&&h>0?Math.min(100,Math.round((h-(f??0))/h*100)):0,m=`$${u.monthlySpend.toFixed(2)} this month`;return o.jsxs("div",{className:"sc-cap",children:[o.jsxs("div",{className:"sc-cap-top",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:Wi(u.displayName)}),o.jsx("small",{children:f===null?m:`${m} · ${f} left`})]}),o.jsxs("div",{className:"sc-cap-in",children:[o.jsx("span",{className:"sc-cap-dollar",children:"$"}),o.jsx("input",{className:"sc-in",inputMode:"decimal",placeholder:"None",value:a[u.id]??"",onChange:v=>i(w=>({...w,[u.id]:v.target.value})),onBlur:()=>void c(u.id),disabled:!n,"aria-label":`${Wi(u.displayName)} monthly cap in dollars`})]})]}),h!==null&&o.jsx("div",{className:"sc-meter",children:o.jsx("i",{style:{width:`${p}%`}})})]},u.id)})}):o.jsx(Qr,{title:"Monthly caps",sub:"Nothing to cap yet. Caps apply to engines you pay for per image. Codex usage counts against your ChatGPT plan, which OpenAI meters, not Scenri.",children:o.jsx("p",{className:"sc-set-empty",children:"Add a paid engine key and its cap appears here."})})}function fq({onDone:e,thisComputer:t}){const{brand:n,resetShots:r}=on(),{refresh:a}=Rn(),i=Dn(),[c,u]=s.useState(!1),f=s.useCallback(async h=>{u(!0);try{await Me.deleteData(h),e(),h==="shots"&&r(),h==="all"&&window.location.replace("/")}finally{u(!1)}},[e,r]);return o.jsxs(o.Fragment,{children:[o.jsx(Qr,{title:"This brand",children:o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Delete this brand"}),o.jsxs("small",{"data-prose":"",children:["Removes ",ca(n),", its sets and every shot. Other brands stay."]})]}),o.jsx(Wn,{label:"Delete brand",title:`Delete ${ca(n)}?`,body:"The kit, its sets and every shot go with it. Exports you already downloaded stay yours.",busy:c,onConfirm:()=>{u(!0),Me.deleteBrand(n.id).then(()=>a()).then(()=>i("/",{replace:!0})).finally(()=>u(!1))}})]})}),t&&o.jsxs(Qr,{title:"Every brand",children:[o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Delete generated shots"}),o.jsx("small",{"data-prose":"",children:"Removes every set and every generated shot, in every brand. Brands, cast and scenes stay."})]}),o.jsx(Wn,{label:"Delete shots",title:"Delete every generated shot?",body:"Brands, cast and scenes stay. Every set and every generated shot goes.",busy:c,onConfirm:()=>void f("shots")})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Delete all local data"}),o.jsx("small",{"data-prose":"",children:"Brands, cast, sets, shots and saved keys, in one go."})]}),o.jsx(Wn,{label:"Delete everything",title:"Delete everything on this machine?",body:"The whole library folder is removed: brands, cast, sets, shots and your saved keys. There is no undo.",busy:c,onConfirm:()=>void f("all")})]})]})]})}function hq(e,t){return t?{body:t,action:"retry"}:e?e.installKind==="dev"?{body:"Running from source; nothing to put on a desktop.",action:null}:e.supported?e.installed?{body:"Scenri is on your desktop.",action:"recreate"}:{body:"Open Scenri without a terminal.",action:"add"}:{body:"Desktop shortcuts are not available on this system yet.",action:null}:{body:"Checking this machine.",action:null}}function pq({status:e,onStatus:t}){const[n,r]=s.useState(null),[a,i]=s.useState(!1),[c,u]=s.useState(!1),f=s.useRef(null);s.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const h=async()=>{if(!a){i(!0),r(null);try{await Me.desktopInstall(),u(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>u(!1),1600),t(await Me.desktop())}catch(m){r(String((m==null?void 0:m.message)??m))}finally{i(!1)}}},p=hq(e,n);return o.jsx(Qr,{title:"This computer",children:o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Desktop shortcut"}),o.jsx("small",{"data-prose":"",children:p.body})]}),p.action&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:a,onClick:()=>void h(),children:c?"Added":a?"Adding…":p.action==="add"?"Add to desktop":p.action==="recreate"?"Recreate":"Try again"})]})})}function nN(e){return o.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:o.jsx("path",{d:"M22.282 9.821a6 6 0 0 0-.516-4.91a6.05 6.05 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a6 6 0 0 0-3.998 2.9a6.05 6.05 0 0 0 .743 7.097a5.98 5.98 0 0 0 .51 4.911a6.05 6.05 0 0 0 6.515 2.9A6 6 0 0 0 13.26 24a6.06 6.06 0 0 0 5.772-4.206a6 6 0 0 0 3.997-2.9a6.06 6.06 0 0 0-.747-7.073M13.26 22.43a4.48 4.48 0 0 1-2.876-1.04l.141-.081l4.779-2.758a.8.8 0 0 0 .392-.681v-6.737l2.02 1.168a.07.07 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494M3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085l4.783 2.759a.77.77 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646M2.34 7.896a4.5 4.5 0 0 1 2.366-1.973V11.6a.77.77 0 0 0 .388.677l5.815 3.354l-2.02 1.168a.08.08 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855l-5.833-3.387L15.119 7.2a.08.08 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667m2.01-3.023l-.141-.085l-4.774-2.782a.78.78 0 0 0-.785 0L9.409 9.23V6.897a.07.07 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135l-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.8.8 0 0 0-.393.681zm1.097-2.365l2.602-1.5l2.607 1.5v2.999l-2.597 1.5l-2.607-1.5Z"})})}function mq(e){return o.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:o.jsx("path",{d:"M16.778 1.844v1.919q-.569-.026-1.138-.032-.708-.008-1.415.037c-1.93.126-4.023.728-6.149 2.237-2.911 2.066-2.731 1.95-4.14 2.75-.396.223-1.342.574-2.185.798-.841.225-1.753.333-1.751.333v4.229s.768.108 1.61.333c.842.224 1.789.575 2.185.799 1.41.798 1.228.683 4.14 2.75 2.126 1.509 4.22 2.11 6.148 2.236.88.058 1.716.041 2.555.005v1.918l7.222-4.168-7.222-4.17v2.176c-.86.038-1.611.065-2.278.021-1.364-.09-2.417-.357-3.979-1.465-2.244-1.593-2.866-2.027-3.68-2.508.889-.518 1.449-.906 3.822-2.59 1.56-1.109 2.614-1.377 3.978-1.466.667-.044 1.418-.017 2.278.02v2.176L24 6.014Z"})})}function gq(e){return o.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:o.jsx("path",{d:"M24 10.262v2.712h-9.518V24h-3.034V10.262zm0-5.131v2.717H8.755V24H5.722V5.131zM24 0v2.717H3.034V24H0V0z"})})}const vq=[{engineId:"openrouter",settingKey:"openrouter_api_key",hint:"sk-or-...",keysUrl:"https://openrouter.ai/keys"},{engineId:"replicate",settingKey:"replicate_api_token",hint:"r8_...",keysUrl:"https://replicate.com/account/api-tokens"},{engineId:"fal",settingKey:"fal_key",hint:"fal_...",keysUrl:"https://fal.ai/dashboard/keys"}],rN=e=>vq.find(t=>t.engineId===e),sN={"codex-cli":{Mark:nN,size:16,plate:"#FFFFFF",ink:"#000000"},openrouter:{Mark:mq,size:18,plate:"#FFFFFF",ink:"#7624F4"},replicate:{Mark:gq,size:15,plate:"#E42022",ink:"#FFFFFF"}},aN=e=>{const t=sN[e];return t?{plate:t.plate,ink:t.ink}:void 0},wq={demo:BU};function oN({engineId:e,scale:t=1}){const n=sN[e];if(n){const a=Math.round(n.size*t);return o.jsx(n.Mark,{width:a,height:a})}const r=wq[e]??P0;return o.jsx(r,{size:Math.round(15*t)})}const yq=e=>[...e].sort((t,n)=>+(n.id===O0)-+(t.id===O0));function bq({engines:e}){const t=Cc(),r=e.filter(a=>a.available).length===0;return o.jsx(Qr,{children:yq(e).map(a=>{const i=rN(a.id),c=Wi(a.displayName),u=uq(a,!!i),f=a.available?"Connected":null,h=!f&&a.reason&&(!u||a.code==="unverified"),p=aN(a.id);return o.jsxs("div",{className:"sc-eng","data-connected":a.available?"":void 0,children:[o.jsx("span",{className:"sc-eng-ic","data-brand":p?"":void 0,style:p?{"--sc-plate":p.plate,"--sc-ink":p.ink}:void 0,children:o.jsx(oN,{engineId:a.id})}),o.jsxs("span",{className:"sc-eng-name",children:[o.jsx("b",{children:c}),o.jsx("small",{children:cq(a)})]}),f&&o.jsxs("span",{className:"sc-stat",children:[o.jsx("span",{className:"d"}),f]}),h&&o.jsx("span",{className:"sc-stat sc-stat-why",children:a.reason}),u&&o.jsx("button",{type:"button",className:`sc-btn ${r&&!i?"sc-btn-primary":"sc-btn-ghost"} sc-eng-act`,onClick:()=>t(a.id),"aria-label":`${u} ${c}`,children:u})]},a.id)})})}const xq=e=>e>1e9?`${(e/1e9).toFixed(1)} GB`:e>1e6?`${Math.round(e/1e6)} MB`:`${Math.round(e/1e3)} KB`,Og=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function kq(e){return e===0?0:e<3?1:e<6?2:e<12?3:4}function Fx(e,t){const n=t*7,r=new Date,a=new Date(r);a.setDate(r.getDate()-(n-1)-r.getDay());const i=[],c=[];let u=-1,f=0;for(let h=0;h<n;h++){const p=new Date(a);p.setDate(a.getDate()+h);const m=p.toISOString().slice(0,10),v=e.get(m)??0;if(f+=v,i.push({key:m,level:kq(v),title:v?`${v} run${v===1?"":"s"} on ${p.getDate()} ${Og[p.getMonth()]}`:`nothing on ${p.getDate()} ${Og[p.getMonth()]}`}),p.getDay()===0){const w=p.getMonth()!==u&&p.getDate()<=7;w&&(u=p.getMonth()),c.push({key:m,label:w?Og[p.getMonth()]:""})}}return{cells:i,months:c,sum:f}}function Sq({info:e,thisComputer:t}){return o.jsxs(Qr,{children:[o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Library folder"}),o.jsx("small",{children:e?[e.dir,`${xq(e.bytes)} across ${e.images} images`].filter(Boolean).join(" · "):"…"})]}),t&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void Me.reveal(),children:"Reveal"})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Export everything"}),o.jsx("small",{children:"One zip: brands, cast, prompts, shots. Never keys."})]}),o.jsx("a",{className:"sc-btn sc-btn-ghost",href:"/api/export/all",download:!0,children:"Export"})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Telemetry"}),o.jsx("small",{children:"There is none. This row exists to say so."})]}),o.jsx("span",{className:"sc-tag",children:"off, permanently"})]})]})}async function Eq(e,t){if(window.isSecureContext&&navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}const n=document.activeElement,r=document.createElement("textarea");r.value=e,r.readOnly=!0,r.setAttribute("aria-hidden","true"),r.style.cssText="position:fixed;top:0;left:0;width:1px;height:1px;opacity:0;",(t??document.body).appendChild(r);try{return r.focus(),r.select(),r.setSelectionRange(0,e.length),document.execCommand("copy")}catch{return!1}finally{r.remove(),n==null||n.focus()}}const sd=function(e,t){let a=e;const i=a0[t];let c=null,u=0,f=null;const h=[],p={},m=function(R,E){u=a*4+17,c=(function(M){const L=new Array(M);for(let H=0;H<M;H+=1){L[H]=new Array(M);for(let D=0;D<M;D+=1)L[H][D]=null}return L})(u),v(0,0),v(u-7,0),v(0,u-7),b(),y(),S(R,E),a>=7&&k(R),f==null&&(f=N(a,i,h)),C(f,E)},v=function(R,E){for(let M=-1;M<=7;M+=1)if(!(R+M<=-1||u<=R+M))for(let L=-1;L<=7;L+=1)E+L<=-1||u<=E+L||(0<=M&&M<=6&&(L==0||L==6)||0<=L&&L<=6&&(M==0||M==6)||2<=M&&M<=4&&2<=L&&L<=4?c[R+M][E+L]=!0:c[R+M][E+L]=!1)},w=function(){let R=0,E=0;for(let M=0;M<8;M+=1){m(!0,M);const L=Mi.getLostPoint(p);(M==0||R>L)&&(R=L,E=M)}return E},y=function(){for(let R=8;R<u-8;R+=1)c[R][6]==null&&(c[R][6]=R%2==0);for(let R=8;R<u-8;R+=1)c[6][R]==null&&(c[6][R]=R%2==0)},b=function(){const R=Mi.getPatternPosition(a);for(let E=0;E<R.length;E+=1)for(let M=0;M<R.length;M+=1){const L=R[E],H=R[M];if(c[L][H]==null)for(let D=-2;D<=2;D+=1)for(let K=-2;K<=2;K+=1)D==-2||D==2||K==-2||K==2||D==0&&K==0?c[L+D][H+K]=!0:c[L+D][H+K]=!1}},k=function(R){const E=Mi.getBCHTypeNumber(a);for(let M=0;M<18;M+=1){const L=!R&&(E>>M&1)==1;c[Math.floor(M/3)][M%3+u-8-3]=L}for(let M=0;M<18;M+=1){const L=!R&&(E>>M&1)==1;c[M%3+u-8-3][Math.floor(M/3)]=L}},S=function(R,E){const M=i<<3|E,L=Mi.getBCHTypeInfo(M);for(let H=0;H<15;H+=1){const D=!R&&(L>>H&1)==1;H<6?c[H][8]=D:H<8?c[H+1][8]=D:c[u-15+H][8]=D}for(let H=0;H<15;H+=1){const D=!R&&(L>>H&1)==1;H<8?c[8][u-H-1]=D:H<9?c[8][15-H-1+1]=D:c[8][15-H-1]=D}c[u-8][8]=!R},C=function(R,E){let M=-1,L=u-1,H=7,D=0;const K=Mi.getMaskFunction(E);for(let O=u-1;O>0;O-=2)for(O==6&&(O-=1);;){for(let _=0;_<2;_+=1)if(c[L][O-_]==null){let re=!1;D<R.length&&(re=(R[D]>>>H&1)==1),K(L,O-_)&&(re=!re),c[L][O-_]=re,H-=1,H==-1&&(D+=1,H=7)}if(L+=M,L<0||u<=L){L-=M,M=-M;break}}},j=function(R,E){let M=0,L=0,H=0;const D=new Array(E.length),K=new Array(E.length);for(let z=0;z<E.length;z+=1){const F=E[z].dataCount,Q=E[z].totalCount-F;L=Math.max(L,F),H=Math.max(H,Q),D[z]=new Array(F);for(let Y=0;Y<D[z].length;Y+=1)D[z][Y]=255&R.getBuffer()[Y+M];M+=F;const V=Mi.getErrorCorrectPolynomial(Q),B=I0(D[z],V.getLength()-1).mod(V);K[z]=new Array(V.getLength()-1);for(let Y=0;Y<K[z].length;Y+=1){const ae=Y+B.getLength()-K[z].length;K[z][Y]=ae>=0?B.getAt(ae):0}}let O=0;for(let z=0;z<E.length;z+=1)O+=E[z].totalCount;const _=new Array(O);let re=0;for(let z=0;z<L;z+=1)for(let F=0;F<E.length;F+=1)z<D[F].length&&(_[re]=D[F][z],re+=1);for(let z=0;z<H;z+=1)for(let F=0;F<E.length;F+=1)z<K[F].length&&(_[re]=K[F][z],re+=1);return _},N=function(R,E,M){const L=_x.getRSBlocks(R,E),H=Zx();for(let K=0;K<M.length;K+=1){const O=M[K];H.put(O.getMode(),4),H.put(O.getLength(),Mi.getLengthInBits(O.getMode(),R)),O.write(H)}let D=0;for(let K=0;K<L.length;K+=1)D+=L[K].dataCount;if(H.getLengthInBits()>D*8)throw"code length overflow. ("+H.getLengthInBits()+">"+D*8+")";for(H.getLengthInBits()+4<=D*8&&H.put(0,4);H.getLengthInBits()%8!=0;)H.putBit(!1);for(;!(H.getLengthInBits()>=D*8||(H.put(236,8),H.getLengthInBits()>=D*8));)H.put(17,8);return j(H,L)};p.addData=function(R,E){E=E||"Byte";let M=null;switch(E){case"Numeric":M=Cq(R);break;case"Alphanumeric":M=jq(R);break;case"Byte":M=Aq(R);break;case"Kanji":M=Nq(R);break;default:throw"mode:"+E}h.push(M),f=null},p.isDark=function(R,E){if(R<0||u<=R||E<0||u<=E)throw R+","+E;return c[R][E]},p.getModuleCount=function(){return u},p.make=function(){if(a<1){let R=1;for(;R<40;R++){const E=_x.getRSBlocks(R,i),M=Zx();for(let H=0;H<h.length;H++){const D=h[H];M.put(D.getMode(),4),M.put(D.getLength(),Mi.getLengthInBits(D.getMode(),R)),D.write(M)}let L=0;for(let H=0;H<E.length;H++)L+=E[H].dataCount;if(M.getLengthInBits()<=L*8)break}a=R}m(!1,w())},p.createTableTag=function(R,E){R=R||2,E=typeof E>"u"?R*4:E;let M="";M+='<table style="',M+=" border-width: 0px; border-style: none;",M+=" border-collapse: collapse;",M+=" padding: 0px; margin: "+E+"px;",M+='">',M+="<tbody>";for(let L=0;L<p.getModuleCount();L+=1){M+="<tr>";for(let H=0;H<p.getModuleCount();H+=1)M+='<td style="',M+=" border-width: 0px; border-style: none;",M+=" border-collapse: collapse;",M+=" padding: 0px; margin: 0px;",M+=" width: "+R+"px;",M+=" height: "+R+"px;",M+=" background-color: ",M+=p.isDark(L,H)?"#000000":"#ffffff",M+=";",M+='"/>';M+="</tr>"}return M+="</tbody>",M+="</table>",M},p.createSvgTag=function(R,E,M,L){let H={};typeof arguments[0]=="object"&&(H=arguments[0],R=H.cellSize,E=H.margin,M=H.alt,L=H.title),R=R||2,E=typeof E>"u"?R*4:E,M=typeof M=="string"?{text:M}:M||{},M.text=M.text||null,M.id=M.text?M.id||"qrcode-description":null,L=typeof L=="string"?{text:L}:L||{},L.text=L.text||null,L.id=L.text?L.id||"qrcode-title":null;const D=p.getModuleCount()*R+E*2;let K,O,_,re,z="",F;for(F="l"+R+",0 0,"+R+" -"+R+",0 0,-"+R+"z ",z+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',z+=H.scalable?"":' width="'+D+'px" height="'+D+'px"',z+=' viewBox="0 0 '+D+" "+D+'" ',z+=' preserveAspectRatio="xMinYMin meet"',z+=L.text||M.text?' role="img" aria-labelledby="'+P([L.id,M.id].join(" ").trim())+'"':"",z+=">",z+=L.text?'<title id="'+P(L.id)+'">'+P(L.text)+"</title>":"",z+=M.text?'<description id="'+P(M.id)+'">'+P(M.text)+"</description>":"",z+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',z+='<path d="',_=0;_<p.getModuleCount();_+=1)for(re=_*R+E,K=0;K<p.getModuleCount();K+=1)p.isDark(_,K)&&(O=K*R+E,z+="M"+O+","+re+F);return z+='" stroke="transparent" fill="black"/>',z+="</svg>",z},p.createDataURL=function(R,E){R=R||2,E=typeof E>"u"?R*4:E;const M=p.getModuleCount()*R+E*2,L=E,H=M-E;return Lq(M,M,function(D,K){if(L<=D&&D<H&&L<=K&&K<H){const O=Math.floor((D-L)/R),_=Math.floor((K-L)/R);return p.isDark(_,O)?0:1}else return 1})},p.createImgTag=function(R,E,M){R=R||2,E=typeof E>"u"?R*4:E;const L=p.getModuleCount()*R+E*2;let H="";return H+="<img",H+=' src="',H+=p.createDataURL(R,E),H+='"',H+=' width="',H+=L,H+='"',H+=' height="',H+=L,H+='"',M&&(H+=' alt="',H+=P(M),H+='"'),H+="/>",H};const P=function(R){let E="";for(let M=0;M<R.length;M+=1){const L=R.charAt(M);switch(L){case"<":E+="<";break;case">":E+=">";break;case"&":E+="&";break;case'"':E+=""";break;default:E+=L;break}}return E},$=function(R){R=typeof R>"u"?2:R;const M=p.getModuleCount()*1+R*2,L=R,H=M-R;let D,K,O,_,re;const z={"██":"█","█ ":"▀"," █":"▄"," ":" "},F={"██":"▀","█ ":"▀"," █":" "," ":" "};let Q="";for(D=0;D<M;D+=2){for(O=Math.floor((D-L)/1),_=Math.floor((D+1-L)/1),K=0;K<M;K+=1)re="█",L<=K&&K<H&&L<=D&&D<H&&p.isDark(O,Math.floor((K-L)/1))&&(re=" "),L<=K&&K<H&&L<=D+1&&D+1<H&&p.isDark(_,Math.floor((K-L)/1))?re+=" ":re+="█",Q+=R<1&&D+1>=H?F[re]:z[re];Q+=`
|
|
97
|
-
`}return M%2&&R>0?Q.substring(0,Q.length-M-1)+Array(M+1).join("▀"):Q.substring(0,Q.length-1)};return p.createASCII=function(R,E){if(R=R||1,R<2)return $(E);R-=1,E=typeof E>"u"?R*2:E;const M=p.getModuleCount()*R+E*2,L=E,H=M-E;let D,K,O,_;const re=Array(R+1).join("██"),z=Array(R+1).join(" ");let F="",Q="";for(D=0;D<M;D+=1){for(O=Math.floor((D-L)/R),Q="",K=0;K<M;K+=1)_=1,L<=K&&K<H&&L<=D&&D<H&&p.isDark(O,Math.floor((K-L)/R))&&(_=0),Q+=_?re:z;for(O=0;O<R;O+=1)F+=Q+`
|
|
98
|
-
`}return F.substring(0,F.length-1)},p.renderTo2dContext=function(R,E){E=E||2;const M=p.getModuleCount();for(let L=0;L<M;L++)for(let H=0;H<M;H++)R.fillStyle=p.isDark(L,H)?"black":"white",R.fillRect(H*E,L*E,E,E)},p};sd.stringToBytes=function(e){const t=[];for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n);t.push(r&255)}return t};sd.createStringToBytes=function(e,t){const n=(function(){const a=Rq(e),i=function(){const f=a.read();if(f==-1)throw"eof";return f};let c=0;const u={};for(;;){const f=a.read();if(f==-1)break;const h=i(),p=i(),m=i(),v=String.fromCharCode(f<<8|h),w=p<<8|m;u[v]=w,c+=1}if(c!=t)throw c+" != "+t;return u})(),r=63;return function(a){const i=[];for(let c=0;c<a.length;c+=1){const u=a.charCodeAt(c);if(u<128)i.push(u);else{const f=n[a.charAt(c)];typeof f=="number"?(f&255)==f?i.push(f):(i.push(f>>>8),i.push(f&255)):i.push(r)}}return i}};const Gr={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},a0={L:1,M:0,Q:3,H:2},Ni={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Mi=(function(){const e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t=1335,n=7973,r=21522,a={},i=function(c){let u=0;for(;c!=0;)u+=1,c>>>=1;return u};return a.getBCHTypeInfo=function(c){let u=c<<10;for(;i(u)-i(t)>=0;)u^=t<<i(u)-i(t);return(c<<10|u)^r},a.getBCHTypeNumber=function(c){let u=c<<12;for(;i(u)-i(n)>=0;)u^=n<<i(u)-i(n);return c<<12|u},a.getPatternPosition=function(c){return e[c-1]},a.getMaskFunction=function(c){switch(c){case Ni.PATTERN000:return function(u,f){return(u+f)%2==0};case Ni.PATTERN001:return function(u,f){return u%2==0};case Ni.PATTERN010:return function(u,f){return f%3==0};case Ni.PATTERN011:return function(u,f){return(u+f)%3==0};case Ni.PATTERN100:return function(u,f){return(Math.floor(u/2)+Math.floor(f/3))%2==0};case Ni.PATTERN101:return function(u,f){return u*f%2+u*f%3==0};case Ni.PATTERN110:return function(u,f){return(u*f%2+u*f%3)%2==0};case Ni.PATTERN111:return function(u,f){return(u*f%3+(u+f)%2)%2==0};default:throw"bad maskPattern:"+c}},a.getErrorCorrectPolynomial=function(c){let u=I0([1],0);for(let f=0;f<c;f+=1)u=u.multiply(I0([1,Li.gexp(f)],0));return u},a.getLengthInBits=function(c,u){if(1<=u&&u<10)switch(c){case Gr.MODE_NUMBER:return 10;case Gr.MODE_ALPHA_NUM:return 9;case Gr.MODE_8BIT_BYTE:return 8;case Gr.MODE_KANJI:return 8;default:throw"mode:"+c}else if(u<27)switch(c){case Gr.MODE_NUMBER:return 12;case Gr.MODE_ALPHA_NUM:return 11;case Gr.MODE_8BIT_BYTE:return 16;case Gr.MODE_KANJI:return 10;default:throw"mode:"+c}else if(u<41)switch(c){case Gr.MODE_NUMBER:return 14;case Gr.MODE_ALPHA_NUM:return 13;case Gr.MODE_8BIT_BYTE:return 16;case Gr.MODE_KANJI:return 12;default:throw"mode:"+c}else throw"type:"+u},a.getLostPoint=function(c){const u=c.getModuleCount();let f=0;for(let m=0;m<u;m+=1)for(let v=0;v<u;v+=1){let w=0;const y=c.isDark(m,v);for(let b=-1;b<=1;b+=1)if(!(m+b<0||u<=m+b))for(let k=-1;k<=1;k+=1)v+k<0||u<=v+k||b==0&&k==0||y==c.isDark(m+b,v+k)&&(w+=1);w>5&&(f+=3+w-5)}for(let m=0;m<u-1;m+=1)for(let v=0;v<u-1;v+=1){let w=0;c.isDark(m,v)&&(w+=1),c.isDark(m+1,v)&&(w+=1),c.isDark(m,v+1)&&(w+=1),c.isDark(m+1,v+1)&&(w+=1),(w==0||w==4)&&(f+=3)}for(let m=0;m<u;m+=1)for(let v=0;v<u-6;v+=1)c.isDark(m,v)&&!c.isDark(m,v+1)&&c.isDark(m,v+2)&&c.isDark(m,v+3)&&c.isDark(m,v+4)&&!c.isDark(m,v+5)&&c.isDark(m,v+6)&&(f+=40);for(let m=0;m<u;m+=1)for(let v=0;v<u-6;v+=1)c.isDark(v,m)&&!c.isDark(v+1,m)&&c.isDark(v+2,m)&&c.isDark(v+3,m)&&c.isDark(v+4,m)&&!c.isDark(v+5,m)&&c.isDark(v+6,m)&&(f+=40);let h=0;for(let m=0;m<u;m+=1)for(let v=0;v<u;v+=1)c.isDark(v,m)&&(h+=1);const p=Math.abs(100*h/u/u-50)/5;return f+=p*10,f},a})(),Li=(function(){const e=new Array(256),t=new Array(256);for(let r=0;r<8;r+=1)e[r]=1<<r;for(let r=8;r<256;r+=1)e[r]=e[r-4]^e[r-5]^e[r-6]^e[r-8];for(let r=0;r<255;r+=1)t[e[r]]=r;const n={};return n.glog=function(r){if(r<1)throw"glog("+r+")";return t[r]},n.gexp=function(r){for(;r<0;)r+=255;for(;r>=256;)r-=255;return e[r]},n})(),I0=function(e,t){if(typeof e.length>"u")throw e.length+"/"+t;const n=(function(){let a=0;for(;a<e.length&&e[a]==0;)a+=1;const i=new Array(e.length-a+t);for(let c=0;c<e.length-a;c+=1)i[c]=e[c+a];return i})(),r={};return r.getAt=function(a){return n[a]},r.getLength=function(){return n.length},r.multiply=function(a){const i=new Array(r.getLength()+a.getLength()-1);for(let c=0;c<r.getLength();c+=1)for(let u=0;u<a.getLength();u+=1)i[c+u]^=Li.gexp(Li.glog(r.getAt(c))+Li.glog(a.getAt(u)));return I0(i,0)},r.mod=function(a){if(r.getLength()-a.getLength()<0)return r;const i=Li.glog(r.getAt(0))-Li.glog(a.getAt(0)),c=new Array(r.getLength());for(let u=0;u<r.getLength();u+=1)c[u]=r.getAt(u);for(let u=0;u<a.getLength();u+=1)c[u]^=Li.gexp(Li.glog(a.getAt(u))+i);return I0(c,0).mod(a)},r},_x=(function(){const e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(a,i){const c={};return c.totalCount=a,c.dataCount=i,c},n={},r=function(a,i){switch(i){case a0.L:return e[(a-1)*4+0];case a0.M:return e[(a-1)*4+1];case a0.Q:return e[(a-1)*4+2];case a0.H:return e[(a-1)*4+3];default:return}};return n.getRSBlocks=function(a,i){const c=r(a,i);if(typeof c>"u")throw"bad rs block @ typeNumber:"+a+"/errorCorrectionLevel:"+i;const u=c.length/3,f=[];for(let h=0;h<u;h+=1){const p=c[h*3+0],m=c[h*3+1],v=c[h*3+2];for(let w=0;w<p;w+=1)f.push(t(m,v))}return f},n})(),Zx=function(){const e=[];let t=0;const n={};return n.getBuffer=function(){return e},n.getAt=function(r){const a=Math.floor(r/8);return(e[a]>>>7-r%8&1)==1},n.put=function(r,a){for(let i=0;i<a;i+=1)n.putBit((r>>>a-i-1&1)==1)},n.getLengthInBits=function(){return t},n.putBit=function(r){const a=Math.floor(t/8);e.length<=a&&e.push(0),r&&(e[a]|=128>>>t%8),t+=1},n},Cq=function(e){const t=Gr.MODE_NUMBER,n=e,r={};r.getMode=function(){return t},r.getLength=function(c){return n.length},r.write=function(c){const u=n;let f=0;for(;f+2<u.length;)c.put(a(u.substring(f,f+3)),10),f+=3;f<u.length&&(u.length-f==1?c.put(a(u.substring(f,f+1)),4):u.length-f==2&&c.put(a(u.substring(f,f+2)),7))};const a=function(c){let u=0;for(let f=0;f<c.length;f+=1)u=u*10+i(c.charAt(f));return u},i=function(c){if("0"<=c&&c<="9")return c.charCodeAt(0)-48;throw"illegal char :"+c};return r},jq=function(e){const t=Gr.MODE_ALPHA_NUM,n=e,r={};r.getMode=function(){return t},r.getLength=function(i){return n.length},r.write=function(i){const c=n;let u=0;for(;u+1<c.length;)i.put(a(c.charAt(u))*45+a(c.charAt(u+1)),11),u+=2;u<c.length&&i.put(a(c.charAt(u)),6)};const a=function(i){if("0"<=i&&i<="9")return i.charCodeAt(0)-48;if("A"<=i&&i<="Z")return i.charCodeAt(0)-65+10;switch(i){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+i}};return r},Aq=function(e){const t=Gr.MODE_8BIT_BYTE,n=sd.stringToBytes(e),r={};return r.getMode=function(){return t},r.getLength=function(a){return n.length},r.write=function(a){for(let i=0;i<n.length;i+=1)a.put(n[i],8)},r},Nq=function(e){const t=Gr.MODE_KANJI,n=sd.stringToBytes;(function(i,c){const u=n(i);if(u.length!=2||(u[0]<<8|u[1])!=c)throw"sjis not supported."})("友",38726);const r=n(e),a={};return a.getMode=function(){return t},a.getLength=function(i){return~~(r.length/2)},a.write=function(i){const c=r;let u=0;for(;u+1<c.length;){let f=(255&c[u])<<8|255&c[u+1];if(33088<=f&&f<=40956)f-=33088;else if(57408<=f&&f<=60351)f-=49472;else throw"illegal char at "+(u+1)+"/"+f;f=(f>>>8&255)*192+(f&255),i.put(f,13),u+=2}if(u<c.length)throw"illegal char at "+(u+1)},a},iN=function(){const e=[],t={};return t.writeByte=function(n){e.push(n&255)},t.writeShort=function(n){t.writeByte(n),t.writeByte(n>>>8)},t.writeBytes=function(n,r,a){r=r||0,a=a||n.length;for(let i=0;i<a;i+=1)t.writeByte(n[i+r])},t.writeString=function(n){for(let r=0;r<n.length;r+=1)t.writeByte(n.charCodeAt(r))},t.toByteArray=function(){return e},t.toString=function(){let n="";n+="[";for(let r=0;r<e.length;r+=1)r>0&&(n+=","),n+=e[r];return n+="]",n},t},Mq=function(){let e=0,t=0,n=0,r="";const a={},i=function(u){r+=String.fromCharCode(c(u&63))},c=function(u){if(u<0)throw"n:"+u;if(u<26)return 65+u;if(u<52)return 97+(u-26);if(u<62)return 48+(u-52);if(u==62)return 43;if(u==63)return 47;throw"n:"+u};return a.writeByte=function(u){for(e=e<<8|u&255,t+=8,n+=1;t>=6;)i(e>>>t-6),t-=6},a.flush=function(){if(t>0&&(i(e<<6-t),e=0,t=0),n%3!=0){const u=3-n%3;for(let f=0;f<u;f+=1)r+="="}},a.toString=function(){return r},a},Rq=function(e){const t=e;let n=0,r=0,a=0;const i={};i.read=function(){for(;a<8;){if(n>=t.length){if(a==0)return-1;throw"unexpected end of file./"+a}const f=t.charAt(n);if(n+=1,f=="=")return a=0,-1;if(f.match(/^\s$/))continue;r=r<<6|c(f.charCodeAt(0)),a+=6}const u=r>>>a-8&255;return a-=8,u};const c=function(u){if(65<=u&&u<=90)return u-65;if(97<=u&&u<=122)return u-97+26;if(48<=u&&u<=57)return u-48+52;if(u==43)return 62;if(u==47)return 63;throw"c:"+u};return i},Pq=function(e,t){const n=e,r=t,a=new Array(e*t),i={};i.setPixel=function(h,p,m){a[p*n+h]=m},i.write=function(h){h.writeString("GIF87a"),h.writeShort(n),h.writeShort(r),h.writeByte(128),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(255),h.writeByte(255),h.writeByte(255),h.writeString(","),h.writeShort(0),h.writeShort(0),h.writeShort(n),h.writeShort(r),h.writeByte(0);const p=2,m=u(p);h.writeByte(p);let v=0;for(;m.length-v>255;)h.writeByte(255),h.writeBytes(m,v,255),v+=255;h.writeByte(m.length-v),h.writeBytes(m,v,m.length-v),h.writeByte(0),h.writeString(";")};const c=function(h){const p=h;let m=0,v=0;const w={};return w.write=function(y,b){if(y>>>b)throw"length over";for(;m+b>=8;)p.writeByte(255&(y<<m|v)),b-=8-m,y>>>=8-m,v=0,m=0;v=y<<m|v,m=m+b},w.flush=function(){m>0&&p.writeByte(v)},w},u=function(h){const p=1<<h,m=(1<<h)+1;let v=h+1;const w=f();for(let C=0;C<p;C+=1)w.add(String.fromCharCode(C));w.add(String.fromCharCode(p)),w.add(String.fromCharCode(m));const y=iN(),b=c(y);b.write(p,v);let k=0,S=String.fromCharCode(a[k]);for(k+=1;k<a.length;){const C=String.fromCharCode(a[k]);k+=1,w.contains(S+C)?S=S+C:(b.write(w.indexOf(S),v),w.size()<4095&&(w.size()==1<<v&&(v+=1),w.add(S+C)),S=C)}return b.write(w.indexOf(S),v),b.write(m,v),b.flush(),y.toByteArray()},f=function(){const h={};let p=0;const m={};return m.add=function(v){if(m.contains(v))throw"dup key:"+v;h[v]=p,p+=1},m.size=function(){return p},m.indexOf=function(v){return h[v]},m.contains=function(v){return typeof h[v]<"u"},m};return i},Lq=function(e,t,n){const r=Pq(e,t);for(let u=0;u<t;u+=1)for(let f=0;f<e;f+=1)r.setPixel(f,u,n(f,u));const a=iN();r.write(a);const i=Mq(),c=a.toByteArray();for(let u=0;u<c.length;u+=1)i.writeByte(c[u]);return i.flush(),"data:image/gif;base64,"+i};sd.stringToBytes;const Ig=4;function Tq({value:e,label:t,size:n=200}){const{side:r,path:a}=s.useMemo(()=>{const i=sd(0,"M");i.addData(e),i.make();const c=i.getModuleCount();let u="";for(let f=0;f<c;f++)for(let h=0;h<c;h++)i.isDark(f,h)&&(u+=`M${h+Ig} ${f+Ig}h1v1h-1z`);return{side:c+Ig*2,path:u}},[e]);return o.jsxs("svg",{className:"sc-qr",viewBox:`0 0 ${r} ${r}`,width:n,height:n,role:"img","aria-label":t,shapeRendering:"crispEdges",children:[o.jsx("rect",{className:"sc-qr-plate",width:r,height:r}),o.jsx("path",{className:"sc-qr-ink",d:a})]})}const $q=3e4,Dq=5*6e4;function Hq(e,t=!1){return t?{sentence:"Could not read this computer's network.",action:"check"}:e?e.reach==="this-computer"?{sentence:"Scenri was started for this computer only. Start it without SCENRI_HOST to open it on your phone.",action:null}:e.problem==="no-network"?{sentence:"Connect this computer to Wi-Fi, then check again.",action:"check"}:e.problem==="blocked"||!e.url?{sentence:"Another app is holding this address, so phones cannot open Scenri yet.",action:"check"}:{sentence:"Point your phone's camera at the code, or copy the link for another computer.",action:"copy"}:{sentence:"Checking this computer's network.",action:null}}const Oq=e=>e.url,Iq=e=>`${e.slice(0,3)} ${e.slice(3)}`;function Fq(e,t,n){return e.lastVisit&&e.lastVisit.at>=t-Dq?"connected":n-t>=$q?"stuck":"waiting"}function _q(e,t){var n;return e==="connected"?`Connected. Scenri opened on your ${((n=t.lastVisit)==null?void 0:n.device)??"device"}.`:e==="stuck"?"No phone has opened it yet.":"Waiting for your phone…"}function Zq(e,t){return e==="blocked"&&t==="darwin"?{text:"Your Mac's firewall is blocking Scenri, so your phone cannot open it yet.",canAllow:!0}:e==="blocked"&&t==="win32"?{text:"Windows Firewall is blocking Scenri on this network, so your phone cannot open it yet.",canAllow:!0}:e==="blocks-all"?{text:"Your Mac's firewall blocks every incoming connection. To open Scenri on your phone, turn off Block all incoming connections in System Settings, Network, Firewall, Options.",canAllow:!1}:null}function Vq(e,t){const n=t==="darwin";switch(e){case"asking":return n?"Enter your Mac password to allow Scenri.":"Choose Yes when Windows asks to allow Scenri.";case"done":return"Allowed. Scan the code again.";case"cancelled":return"Nothing changed. Press Allow Scenri to try again.";case"failed":case"unsupported":return n?"Could not change the firewall. Open System Settings, Network, Firewall, Options, and set node to allow incoming connections.":"Could not change the firewall. Open Windows Security, Firewall and network protection, Allow an app through firewall, and tick Node.js for Private and Public.";default:return null}}function zq(e,t){const n=["Your phone has to be on the same Wi-Fi as this computer. Guest networks keep devices apart."];return e!=="blocked"&&e!=="blocks-all"&&e!=="ok"&&n.push("If this computer asks whether node may accept incoming connections, allow it."),n.push("If your phone's browser asks to find devices on your local network, allow it."),t.others.length&&n.push(`Or try ${t.others.join(" or ")}.`),n}const Bq=2e3;function Uq(){const[e,t]=s.useState(null),[n,r]=s.useState(!1),[a,i]=s.useState(null),[c,u]=s.useState(()=>Date.now()),[f,h]=s.useState(!1),[p,m]=s.useState(null),[v,w]=s.useState("idle"),[y,b]=s.useState(!1),k=s.useRef(null),S=s.useRef(null),{push:C}=ir(),j=s.useCallback(async(_=!1)=>{try{t(await Me.phone(_)),r(!1)}catch{r(!0)}},[]),[N,P]=s.useState(!1),$=async()=>{P(!0);try{t(await Me.phoneNewCode()),i(Date.now())}catch{C({kind:"warning",title:"Could not make a new code"})}finally{P(!1)}};s.useEffect(()=>{j();const _=setInterval(()=>{u(Date.now()),j()},Bq);return()=>{clearInterval(_),k.current&&clearTimeout(k.current)}},[j]);const R=e?Oq(e):null;s.useEffect(()=>{R&&a===null&&i(Date.now())},[R,a]);const E=e&&R&&a!==null?Fq(e,a,c):null;s.useEffect(()=>{E==="stuck"&&h(!0)},[E]);const M=!!R&&!!(e!=null&&e.thisComputer);s.useEffect(()=>{if(!M)return;let _=!0;return Me.phoneHelp().then(re=>_&&m(re.firewall)).catch(()=>_&&m("unknown")),()=>{_=!1}},[M]);const L=Hq(e,n),H=e?Zq(p,e.platform):null,D=e?Vq(v,e.platform):null,K=async()=>{R&&(await Eq(R,S.current)?(b(!0),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>b(!1),1600)):C({kind:"warning",title:"Could not copy the link",detail:R}))},O=async()=>{w("asking");try{const _=await Me.phoneAllow();m(_.firewall),w(_.result)}catch{w("failed")}};return o.jsxs(Qr,{title:"Other devices",children:[o.jsxs("div",{className:"sc-set-row",ref:S,children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Open on your phone"}),o.jsx("small",{"data-prose":"",children:L.sentence})]}),L.action==="copy"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void K(),children:o.jsx("span",{"aria-live":"polite",children:y?"Copied":"Copy link"})}),L.action==="check"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void j(!0),children:"Check again"})]}),e&&R&&o.jsxs("div",{className:"sc-phone",children:[o.jsx(Tq,{value:R,label:`QR code for ${e.address}`}),o.jsxs("div",{className:"sc-phone-how",children:[o.jsxs("p",{children:["No camera? Go to ",o.jsx("b",{className:"sc-phone-key",children:e.address})," in any browser on the same Wi-Fi, then enter ",o.jsx("b",{className:"sc-phone-key",children:Iq(e.code)}),"."]}),e.thisComputer&&H&&o.jsxs("div",{className:"sc-phone-fw",role:"status",children:[o.jsx("p",{children:H.text}),H.canAllow&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:v==="asking",onClick:()=>void O(),children:v==="asking"?"Waiting for your permission…":"Allow Scenri"})]}),e.thisComputer&&D&&o.jsx("p",{className:"sc-phone-allow","data-state":v,"aria-live":"polite",children:D}),e.thisComputer&&E&&o.jsx("p",{className:"sc-phone-arrival","data-state":E,"aria-live":"polite",children:_q(E,e)}),e.thisComputer&&o.jsxs("details",{className:"sc-phone-help",open:f,onToggle:_=>h(_.currentTarget.open),children:[o.jsx("summary",{children:"Not opening?"}),o.jsx("ul",{children:zq(p,e).map(_=>o.jsx("li",{children:_},_))})]})]})]}),(e==null?void 0:e.thisComputer)&&R&&o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"New code"}),o.jsx("small",{"data-prose":"",children:"Signs out every phone and tablet. They scan the new code to open Scenri again."})]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:N,onClick:()=>void $(),children:N?"Making…":"New code"})]})]})}function Wq(e){switch(e){case"npx":return"npx scenri update";case"global":case"managed":return"scenri update";default:return"npx scenri@latest"}}function Kq({version:e}){var b;const t=qp(),n=cm(),r=t.status,[a,i]=s.useState(null),[c,u]=s.useState(!1);s.useEffect(()=>{Me.settings().then(k=>i(!!k.updateCheck)).catch(()=>{})},[]);const f=async()=>{if(a===null)return;const k=!a;i(k);try{await Me.saveSettings({updateCheck:k})}catch{i(!k)}},h=s.useRef(null);s.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const p=Wq(e==null?void 0:e.installKind),m=async()=>{try{await navigator.clipboard.writeText(p),u(!0),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>u(!1),1600)}catch{}},v=t.checking?o.jsx("span",{className:"sc-tag",children:"checking…"}):r!=null&&r.available?o.jsxs("span",{className:"sc-tag sc-tag-gold",children:[r.latest," available"]}):t.checkError||r!=null&&r.error?o.jsx("span",{className:"sc-tag",children:"couldn't check for updates"}):r!=null&&r.checkedAt?o.jsx("span",{className:"sc-tag",children:"up to date"}):null;let w,y;return r!=null&&r.available?(e==null?void 0:e.installKind)==="dev"?(w="Running from source. Pull and rebuild when you're ready; nothing here touches your checkout.",y=null):(e==null?void 0:e.thisComputer)!==!0?(w="Updates are installed on the computer running Scenri.",y=null):Jj(r)?r.phase==="ready"?(w=t.applyError??`${r.stagedVersion} is downloaded and verified. Restarting finishes it.`,y="restart"):r.phase==="staging"?(w="Downloading in the background. Nothing interrupts your work.",y="downloading"):r.phase==="error"?(w=t.applyError??r.error??"Couldn't download the update. Try again.",y="update"):(w=`You are on ${r.current}.`,y="update"):(w=o.jsxs(o.Fragment,{children:["Run ",o.jsx("code",{children:p})," in a terminal, then start Scenri again. Your library is not part of the app and stays put."]}),y="copy"):(w=r&&!r.enabled?"Automatic checks are off. Checking here still works.":"New versions announce themselves here.",y="check"),o.jsxs(Qr,{children:[o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Updates"}),o.jsxs("small",{"data-prose":"",children:[w,(r==null?void 0:r.available)&&r.phase!=="ready"&&r.notesUrl&&o.jsxs(o.Fragment,{children:[" ",o.jsxs("a",{href:r.notesUrl,target:"_blank",rel:"noreferrer",children:["See what's in ",r.latest]})]})]})]}),v,y==="check"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:t.checking,onClick:()=>void t.checkNow(),children:"Check for updates"}),(y==="update"||y==="restart")&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:t.busy!=="idle",onClick:()=>void t.apply(),children:t.busy!=="idle"?"Updating…":(r==null?void 0:r.phase)==="error"?"Try again":"Update"}),y==="downloading"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:!0,children:"Downloading…"}),y==="copy"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void m(),children:c?"Copied":"Copy command"})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Automatic updates"}),o.jsx("small",{"data-prose":"",children:"A version check every six hours; new versions download in the background, and restarting is always your call. Off means Scenri never calls anywhere by itself."})]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:a===null,onClick:()=>void f(),children:a===null?"…":a?"Turn off":"Turn on"})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"What's new"}),o.jsx("small",{children:((b=n.entry)==null?void 0:b.title)??`What changed in ${n.version?`v${n.version}`:"this version"}.`})]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>n.open(),children:"Show"})]})]})}function Vx({weeks:e,months:t,cells:n}){return o.jsxs("div",{className:"sc-heat-range","data-weeks":e,children:[o.jsx("div",{className:"sc-heat-months",children:t.map(r=>o.jsx("span",{children:r.label},r.key))}),o.jsx("div",{className:"sc-heat-grid",children:n.map(r=>o.jsx("i",{"data-l":r.level||void 0,title:r.title},r.key))})]})}function Gq({brandId:e}){const[t,n]=s.useState(null);s.useEffect(()=>{let u=!0;return n(null),Me.usage(e).then(f=>u&&n(f.days)).catch(()=>u&&n([])),()=>{u=!1}},[e]);const{year:r,quarter:a,total:i,byKind:c}=s.useMemo(()=>{const u=new Map,f={generation:0,edit:0};for(const m of t??[])u.set(m.day,(u.get(m.day)??0)+m.generations+m.edits),f.generation+=m.generations,f.edit+=m.edits;const h=Fx(u,53),p=Fx(u,13);return{year:h,quarter:p,total:h.sum,byKind:f}},[t]);return o.jsx(Qr,{sub:t===null?"Counting your runs…":i?`${i.toLocaleString()} runs in the last year: ${c.generation.toLocaleString()} generations, ${c.edit.toLocaleString()} edits.`:"Nothing made yet this year. The first shot lands here.",children:o.jsxs("div",{className:"sc-heat",children:[o.jsx(Vx,{weeks:53,months:r.months,cells:r.cells}),o.jsx(Vx,{weeks:13,months:a.months,cells:a.cells})]})})}function Yq({engines:e,brandId:t,onSaved:n}){const r=Ns("settings"),a=r.value!==null,[i,c]=s.useState(null);s.useEffect(()=>{if(!a||i)return;let y=!0;return Me.version().then(b=>y&&c(b)).catch(()=>{}),()=>{y=!1}},[a,i]);const[u,f]=s.useState(null);s.useEffect(()=>{if(!a)return;let y=!0;return Me.home().then(b=>y&&f(b)).catch(()=>{}),()=>{y=!1}},[a]);const[h,p]=s.useState(null),m=(i==null?void 0:i.thisComputer)===!0;s.useEffect(()=>{if(!a||!m)return;let y=!0;return Me.desktop().then(b=>y&&p(b)).catch(()=>{}),()=>{y=!1}},[a,m]);const[v,w]=s.useState("idle");return o.jsx(Ts,{open:a,className:"sc-set",maxWidth:"880px",onDismiss:r.close,children:o.jsx(qq,{value:r.value,onPick:r.set,saved:o.jsx(Xq,{state:v}),page:y=>o.jsx(Qq,{page:y,engines:e,brandId:t,onSaved:n,onKitState:w,version:i,home:u,desktop:h,onDesktop:p})})})}function qq({value:e,onPick:t,saved:n,page:r}){const a=wr(Ks),{brand:i}=on(),c=tK(e),[u,f]=s.useState(()=>nK(e)),h=s.useRef(new Map),p=s.useRef(!1);s.useEffect(()=>{var y;!a||!u||!p.current||(p.current=!1,(y=h.current.get(c))==null||y.focus({preventScroll:!0}))},[a,u,c]);const m=y=>{t(y),f(!1)},v=B1.find(y=>y.id===c);if(a&&!u)return o.jsxs("div",{className:"sc-set-level",children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx("button",{type:"button",className:"sc-newdlg-back",onClick:()=>{p.current=!0,f(!0)},"aria-label":"Settings",children:o.jsx(ga,{size:15})}),o.jsx(ds,{className:"sc-newdlg-title",children:v.label}),c==="brand"&&n,o.jsx(zx,{})]}),o.jsx("div",{className:"sc-newdlg-body sc-set-body",children:o.jsxs("div",{className:"sc-set-scroll",children:[o.jsx("p",{className:"sc-set-lede",children:v.sub(ca(i))}),r(c)]})})]},`page-${c}`);const w=y=>o.jsx("li",{children:o.jsxs("button",{type:"button",className:"sc-set-item","data-danger":y.scope==="apart"?"":void 0,"aria-current":!a&&c===y.id?"page":void 0,ref:b=>{b?h.current.set(y.id,b):h.current.delete(y.id)},onClick:()=>m(y.id),children:[o.jsx(y.Icon,{size:16,className:"sc-set-item-ic"}),o.jsx("span",{className:"sc-set-item-lb",children:y.label}),a&&o.jsx(il,{size:14,className:"sc-set-item-go"})]})},y.id);return o.jsxs("div",{className:"sc-set-level",children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:"Settings"}),o.jsx(zx,{})]}),o.jsxs("div",{className:"sc-newdlg-body sc-set-body",children:[o.jsxs("nav",{className:"sc-set-rail","aria-label":"Settings",children:[o.jsx("p",{className:"sc-set-group",children:"This brand"}),o.jsx("ul",{children:B1.filter(y=>y.scope==="brand").map(w)}),o.jsx("p",{className:"sc-set-group",children:"Studio"}),o.jsx("ul",{children:B1.filter(y=>y.scope==="studio").map(w)}),o.jsx("p",{className:"sc-set-group",children:"Delete"}),o.jsx("ul",{className:"sc-set-apart",children:B1.filter(y=>y.scope==="apart").map(w)})]}),!a&&o.jsxs("div",{className:"sc-set-scroll",children:[o.jsxs("header",{className:"sc-set-head",children:[o.jsxs("span",{className:"sc-set-head-say",children:[o.jsx("h2",{children:v.label}),o.jsx("p",{children:v.sub(ca(i))})]}),c==="brand"&&n]}),r(c)]},c)]})]},"index")}function Xq({state:e}){const[t,n]=s.useState(!1),r=s.useRef(e);return s.useEffect(()=>{const a=r.current;if(r.current=e,e!=="idle"){n(!0);return}if(a==="idle")return;const i=setTimeout(()=>n(!1),1600);return()=>clearTimeout(i)},[e]),o.jsxs("span",{className:"sc-set-saved","data-on":t?"":void 0,"data-state":e,"aria-live":"polite",children:[e==="idle"&&o.jsx(Kn,{size:12,weight:"bold"}),aq(e)]})}function Qq({page:e,engines:t,brandId:n,onSaved:r,onKitState:a,version:i,home:c,desktop:u,onDesktop:f}){const h=(i==null?void 0:i.thisComputer)===!0;switch(e){case"brand":return o.jsx(oq,{onSaveState:a});case"usage":return o.jsx(Gq,{brandId:n});case"engines":return o.jsxs(o.Fragment,{children:[o.jsx(bq,{engines:t}),o.jsx(dq,{engines:t,onSaved:r,thisComputer:h})]});case"appearance":return o.jsx(jY,{});case"library":return o.jsx(Sq,{info:c,thisComputer:h});case"phone":return o.jsxs(o.Fragment,{children:[o.jsx(Uq,{}),h&&o.jsx(pq,{status:u,onStatus:f})]});case"updates":return o.jsx(Kq,{version:i});case"about":return o.jsx(EY,{version:i});case"danger":return o.jsx(fq,{onDone:r,thisComputer:h})}}function zx(){return o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})}const Jq=["January","February","March","April","May","June","July","August","September","October","November","December"];function eX(e){const t=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!t)return e;const n=Jq[Number(t[2])-1];return n?`${Number(t[3])} ${n} ${t[1]}`:e}function tX(){const e=Ns("whatsnew"),{status:t,version:n,entry:r,changelogUrl:a,releasesUrl:i,markSeen:c}=cm(),u=e.value!==null,f=()=>{c(),e.close()},h=s.useRef(u);s.useEffect(()=>{h.current&&!u&&c(),h.current=u},[u,c]);const p=t==="ready"&&!r&&!a,m=r!==null&&r.sections.length>1,v=t==="loading"?"Reading the release notes.":t==="failed"?"Scenri could not read its release notes. If you are running a development server, it may predate this feature; restart it and try again.":p?"You are running a development build. What changed in a version appears here once that version is published.":r?"Maintenance only. Nothing here changes how Scenri works for you.":"This version went out without a written summary.",w=r?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-vh",children:"Version "}),o.jsx("span",{className:"sc-wn-ver",children:r.version}),o.jsx("span",{"aria-hidden":"true",children:" · "}),eX(r.date)]}):t==="failed"?"Release notes unavailable":t==="loading"?"Loading":p?"Development build":o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-vh",children:"Version "}),o.jsx("span",{className:"sc-wn-ver",children:n})]});return o.jsxs(Ts,{open:u,className:"sc-wn",maxWidth:"420px",described:!0,onDismiss:f,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:"What's new"}),o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]}),o.jsx(nd,{className:"sc-wn-sub",children:w}),o.jsxs("div",{className:"sc-newdlg-body",children:[(r==null?void 0:r.title)&&o.jsx("p",{className:"sc-wn-lede sc-accent",children:r.title}),r&&r.sections.length>0?r.sections.map(y=>o.jsxs("section",{className:"sc-wn-sec",children:[m&&o.jsx("h3",{className:"sc-wn-head",children:y.heading}),o.jsx("p",{className:"sc-wn-txt",children:y.body})]},y.heading)):o.jsx("p",{className:"sc-wn-txt",children:v})]}),o.jsxs("div",{className:"sc-newdlg-foot sc-wn-foot",children:[i&&o.jsxs("a",{className:"sc-wn-link",href:i,target:"_blank",rel:"noreferrer",children:["All releases",o.jsx(wf,{size:13})]}),o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",children:"Got it"})})]})]})}function nX(e){return{installed:e==="not-authenticated"||e==="signing-in"||e==="update-needed"||e==="env-conflict"||e==="repairing"||e==="ready",signedIn:e==="env-conflict"||e==="repairing"||e==="ready",connected:e==="ready",now:e==="not-installed"||e==="installing"?"install":e==="not-authenticated"||e==="signing-in"?"signin":e==="env-conflict"||e==="repairing"?"connect":null}}function lN(e){return e.length===0?"that key":e.length===1?`the ${e[0]} variable`:`the ${e.slice(0,-1).join(", ")} and ${e[e.length-1]} variables`}function rX(e){return`Scenri will start Codex without ${lN(e)}. Nothing on your computer changes, and you can undo this here later.`}function sX(e){return`Scenri is starting Codex without ${lN(e)} on this computer.`}const aX=2e3,oX=5*6e4;function iX({engines:e,onSaved:t}){const n=Ns("setup"),r=n.close,a=n.value,i=a?rN(a):void 0,u=!!i||a==="codex-cli",f=e.find(m=>m.id===a),[h,p]=s.useState(!0);return s.useEffect(()=>{let m=!0;return Me.version().then(v=>m&&p(v.thisComputer!==!1)).catch(()=>{}),()=>{m=!1}},[]),o.jsx(Ts,{open:u,className:"sc-setup",maxWidth:"520px",onDismiss:r,onOpenAutoFocus:i&&h?m=>{var v;m.preventDefault(),(v=m.target.querySelector(".sc-setup-key input"))==null||v.focus()}:void 0,children:i?o.jsx(lX,{provider:i,name:f?Wi(f.displayName):i.engineId,connected:!!(f!=null&&f.available),thisComputer:h,onSaved:t,onDone:r}):o.jsx(cX,{engines:e,onSaved:t,onDone:r})})}function cN({title:e}){return o.jsxs("div",{className:"sc-newdlg-head sc-setup-head",children:[o.jsx(ds,{className:"sc-newdlg-title sc-setup-title",children:e}),o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]})}function lX({provider:e,name:t,connected:n,thisComputer:r,onSaved:a,onDone:i}){const[c,u]=s.useState(""),[f,h]=s.useState(!1),[p,m]=s.useState(null),[v,w]=s.useState(!1),y=async()=>{const k=c.trim();if(k){h(!0),m(null);try{await Me.saveSettings({[e.settingKey]:k}),u(""),a(),i()}catch(S){m(S.message)}finally{h(!1)}}},b=async()=>{h(!0),m(null);try{await Me.saveSettings({[e.settingKey]:""});const k=await Me.settings();if(a(),k[e.settingKey]){w(!0);return}i()}catch(k){m(k.message)}finally{h(!1)}};return o.jsxs(o.Fragment,{children:[o.jsx(cN,{title:n?`${t} key`:`Connect ${t}`}),o.jsxs("div",{className:"sc-setup-body",children:[o.jsxs("div",{className:"sc-setup-intro",children:[o.jsx(uN,{engineId:e.engineId,name:t,state:n?"Connected":"Not connected",ready:n}),o.jsx("p",{className:"sc-setup-lead",children:r?n?`A key is saved for ${t}. Paste a new one to replace it, or disconnect to remove it from this computer.`:`Paste a key from ${t}. It is stored in your library folder on this computer, sent only to ${t}, and never shown again.`:"Keys are added on the computer running Scenri."})]}),r&&o.jsxs("form",{className:"sc-setup-key",onSubmit:k=>{k.preventDefault(),y()},children:[o.jsx("input",{className:"sc-in",type:"password",placeholder:e.hint,value:c,onChange:k=>u(k.target.value),autoComplete:"off",name:e.settingKey,"aria-label":`${t} key`}),o.jsxs("div",{className:"sc-setup-acts",children:[o.jsxs("button",{type:"submit",className:"sc-btn sc-btn-primary",disabled:f||!c.trim(),children:[f?o.jsx(xr,{size:"1"}):o.jsx(tj,{size:15}),n?"Replace key":"Connect"]}),o.jsxs("a",{className:"sc-setup-alt",href:e.keysUrl,target:"_blank",rel:"noreferrer",children:["Get a key ",o.jsx(wf,{size:13})]})]})]}),r&&n&&o.jsx("div",{className:"sc-setup-cut",children:o.jsx(Wn,{label:"Disconnect",title:`Disconnect ${t}?`,body:"The key is deleted from this computer. Nothing you have already generated changes, and you can paste a new key at any time.",busy:f,onConfirm:()=>void b()})}),v&&o.jsxs("p",{className:"sc-setup-note",children:["The stored key is gone, but ",t," is still connected through the ",e.settingKey.toUpperCase()," ","environment variable on this computer. Remove it from your shell to disconnect fully."]}),p&&o.jsx("div",{className:"sc-setup-problem",children:o.jsxs("p",{"data-detail":"",children:[o.jsx(Wp,{size:15})," ",p]})})]})]})}function cX({engines:e,onSaved:t,onDone:n}){const r=Cc(),[a,i]=s.useState("checking"),[c,u]=s.useState(null),[f,h]=s.useState(!1),[p,m]=s.useState("mac"),[v,w]=s.useState(null),[y,b]=s.useState([]),[k,S]=s.useState([]),C=s.useRef(null),j=s.useCallback(()=>{C.current!==null&&(window.clearInterval(C.current),C.current=null)},[]),N=s.useCallback(async(re=!1)=>{const{state:z,reason:F,platform:Q,conflictKeys:V,ignoredKeys:I}=await Me.codexStatus({force:re});return Q&&m(Q),w(F??null),b(V??[]),S(I??[]),i(z),z},[]);s.useEffect(()=>(u(null),i("checking"),N().catch(()=>i("unverified")),j),[N,j]);const P=s.useCallback(()=>{u(null),i("checking"),N(!0).catch(()=>i("unverified"))},[N]),$=async()=>{u(null),i("repairing");try{const{state:re,conflictKeys:z,ignoredKeys:F,reason:Q}=await Me.repairCodexEnv(y);b(z??[]),S(F??[]),w(Q??null),i(re)}catch(re){u({detail:re.message}),i("env-conflict")}},R=async()=>{u(null),i("checking");try{const{state:re,conflictKeys:z,ignoredKeys:F}=await Me.restoreCodexEnv();b(z??[]),S(F??[]),i(re)}catch{N().catch(()=>i("unverified"))}};s.useEffect(()=>{a==="ready"&&t()},[a,t]);const E=async()=>{u(null),i("installing");try{const re=await Me.installCodex();if(re.ok||re.state!=="not-installed"){i(re.state);return}u({detail:re.detail,command:re.fallbackCommand,docsUrl:re.docsUrl}),i(re.state)}catch(re){u({detail:re.message,command:"npm install -g @openai/codex"}),i("not-installed")}},M=async()=>{u(null),i("signing-in");const re=Date.now();j(),C.current=window.setInterval(()=>{if(Date.now()-re>oX){j(),i("not-authenticated"),u({detail:"Sign-in did not finish. Try again, or use the command below.",command:"codex login"});return}Me.codexStatus().then(({state:z})=>{z==="ready"&&(j(),i("ready"))}).catch(()=>{})},aX);try{const z=await Me.loginCodex();if(j(),z.ok||z.state==="ready"){i(z.state);return}u({detail:z.detail,command:z.fallbackCommand}),i(z.state)}catch(z){j(),u({detail:z.message,command:"codex login --device-auth"}),i("not-authenticated")}},L=s.useRef(null);s.useEffect(()=>()=>{L.current&&window.clearTimeout(L.current)},[]);const H=re=>{var z;(z=navigator.clipboard)==null||z.writeText(re).then(()=>{h(!0),L.current&&window.clearTimeout(L.current),L.current=window.setTimeout(()=>h(!1),1600)})},D=e.filter(re=>re.available&&re.id!=="codex-cli"&&!re.localOnly),K=a==="checking"||a==="installing"||a==="signing-in"||a==="repairing",O=a==="not-installed"||a==="installing"?{step:0,label:"Install Codex CLI",verb:a==="installing"?"Installing":"Install",busy:a==="installing",run:E}:a==="not-authenticated"||a==="signing-in"?{step:1,label:"Sign in with ChatGPT",verb:a==="signing-in"?"Waiting for your browser":"Sign in",busy:a==="signing-in",run:M}:a==="env-conflict"||a==="repairing"?{step:2,label:"Ignore that key",verb:a==="repairing"?"Ignoring":"Ignore that key",busy:a==="repairing",run:$}:null,_=a==="not-installed"||a==="installing"||a==="not-authenticated"||a==="signing-in";return o.jsxs(o.Fragment,{children:[o.jsx(cN,{title:"Set up image generation"}),o.jsxs("div",{className:"sc-setup-body",children:[o.jsxs("div",{className:"sc-setup-intro",children:[o.jsx(uN,{engineId:"codex-cli",name:"Codex CLI",state:uX[a],ready:a==="ready",busy:K}),o.jsx("p",{className:"sc-setup-lead",children:dX[a](v)}),a==="no-plan"&&o.jsx("p",{className:"sc-setup-lead",children:"You can use your own key from an image provider instead. You pay that provider directly, per image, and the key stays in your library folder on this computer."})]}),a!=="no-plan"&&o.jsx(fX,{phase:a,act:O}),a==="signing-in"&&o.jsx("p",{className:"sc-setup-note",children:"Finish in the browser tab that just opened. This screen updates itself."}),(a==="env-conflict"||a==="repairing")&&o.jsx("p",{className:"sc-setup-note",children:rX(y)}),a==="ready"&&k.length>0&&o.jsxs("p",{className:"sc-setup-note",children:[sX(k)," ",o.jsx("button",{type:"button",className:"sc-setup-alt",onClick:R,children:"Use it again"})]}),a==="unverified"&&o.jsx("p",{className:"sc-setup-note",children:"If you just installed Codex, quit and reopen Scenri so it can see the new command."}),a==="update-needed"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"sc-setup-cmd",children:[o.jsx("code",{children:"npm install -g @openai/codex@latest"}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>H("npm install -g @openai/codex@latest"),children:[f?o.jsx(Kn,{size:14}):o.jsx(Dh,{size:14}),f?"Copied":"Copy"]})]}),p==="windows"&&o.jsxs("p",{className:"sc-setup-note",children:["Installed with the standalone installer instead? Update it in PowerShell:"," ",o.jsx("code",{children:"irm https://chatgpt.com/codex/install.ps1 | iex"})]})]}),a==="no-plan"&&D.length>0&&o.jsxs("p",{className:"sc-setup-note",children:[D.map(re=>Wi(re.displayName)).join(", ")," is already connected, so you can generate now."]}),c&&o.jsxs("div",{className:"sc-setup-problem",children:[o.jsxs("p",{"data-detail":"",children:[o.jsx(Wp,{size:15})," ",c.detail??"That did not work."]}),c.command&&o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"sc-setup-note",children:["Run this in ",p==="windows"?"PowerShell":"Terminal",", then reopen this window:"]}),o.jsxs("div",{className:"sc-setup-cmd",children:[o.jsx("code",{children:c.command}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>H(c.command),children:[f?o.jsx(Kn,{size:14}):o.jsx(Dh,{size:14}),f?"Copied":"Copy"]})]})]}),c.docsUrl&&o.jsxs("a",{className:"sc-setup-alt",href:c.docsUrl,target:"_blank",rel:"noreferrer",children:["Installation help ",o.jsx(wf,{size:13})]})]}),a==="ready"&&o.jsxs("div",{className:"sc-setup-acts",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:n,children:"Start creating"}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:P,children:[o.jsx($h,{size:14})," Check again"]})]}),(a==="unverified"||a==="update-needed")&&o.jsxs("div",{className:"sc-setup-acts",children:[o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:P,children:[o.jsx($h,{size:15})," Check again"]}),a==="unverified"&&o.jsx("button",{type:"button",className:"sc-setup-alt",onClick:()=>i("no-plan"),children:"I do not have ChatGPT"})]}),a==="no-plan"&&o.jsxs("div",{className:"sc-setup-acts",children:[o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>r("openrouter"),children:[o.jsx(tj,{size:15})," Add a provider key"]}),o.jsx("button",{type:"button",className:"sc-setup-alt",onClick:()=>void N(),children:"Back to Codex setup"})]}),_&&o.jsx("div",{className:"sc-setup-acts",children:o.jsx("button",{type:"button",className:"sc-setup-alt",onClick:()=>i("no-plan"),children:"I do not have ChatGPT"})})]})]})}const uX={checking:"Checking","not-installed":"Not installed",installing:"Installing","not-authenticated":"Not signed in","signing-in":"Waiting for your browser",ready:"Ready","env-conflict":"An old key is in the way",repairing:"Setting that key aside",unverified:"Could not verify","update-needed":"Needs an update","no-plan":"Needs a ChatGPT plan"},dX={checking:()=>"Checking that Codex can actually reach OpenAI from this computer.","not-installed":()=>"Scenri generates with Codex CLI, a small official helper from OpenAI that runs on this computer and uses your own ChatGPT plan. It needs to be installed once.",installing:()=>"Scenri generates with Codex CLI, a small official helper from OpenAI that runs on this computer and uses your own ChatGPT plan. It needs to be installed once.","not-authenticated":()=>"Codex CLI is installed. Sign in with the ChatGPT account whose plan should cover your images. This opens your browser, and Scenri never sees your password or token.","signing-in":()=>"Codex CLI is installed. Sign in with the ChatGPT account whose plan should cover your images. This opens your browser, and Scenri never sees your password or token.",ready:()=>"Codex CLI is ready. Your images run on your own ChatGPT plan, and Scenri adds nothing to the bill.","env-conflict":()=>"Codex is signed in, but an old OpenAI API key on this computer is being used instead of your ChatGPT plan, and OpenAI turned it down.",repairing:()=>"Codex is signed in, but an old OpenAI API key on this computer is being used instead of your ChatGPT plan, and OpenAI turned it down.",unverified:()=>"Scenri could not verify Codex on this computer. Something answered too slowly or not at all, so nothing is assumed to work.","update-needed":e=>`${e??"Codex CLI on this computer is too old for Scenri."} Update it once, then check again.`,"no-plan":()=>"Codex CLI draws on a ChatGPT plan, so without one there is nothing behind it to generate your images."};function uN({engineId:e,name:t,state:n,ready:r,busy:a}){const i=aN(e);return o.jsxs("div",{className:"sc-setup-subject",children:[o.jsx("span",{className:"sc-eng-ic","data-brand":i?"":void 0,style:i?{"--sc-plate":i.plate,"--sc-ink":i.ink}:void 0,children:o.jsx(oN,{engineId:e})}),o.jsxs("span",{className:"sc-setup-say",children:[o.jsx("b",{className:"sc-setup-name",children:t}),o.jsxs("span",{className:"sc-setup-state",children:[a?o.jsx(xr,{size:"1"}):r?o.jsx("span",{className:"d"}):null,n]})]})]})}function fX({phase:e,act:t}){const{installed:n,signedIn:r,connected:a}=nX(e),i=[n,r,a],c=["Install Codex CLI","Sign in with ChatGPT","Connect to Scenri"];return o.jsx("ol",{className:"sc-learn-steps sc-setup-steps",children:c.map((u,f)=>{const h=(t==null?void 0:t.step)===f,p=i[f]?"done":h?"active":"todo",m=o.jsx("span",{className:"sc-learn-n","aria-hidden":"true",children:i[f]?o.jsx(Kn,{size:14,weight:"bold"}):f+1}),v=h&&t.busy;return o.jsx("li",{"data-on":i[f]?"":void 0,"data-now":h?"":void 0,children:h?o.jsxs("button",{type:"button",className:"sc-learn-step","data-state":p,"aria-label":t.label,disabled:v,onClick:t.run,children:[m,o.jsx("span",{className:"sc-learn-step-name",children:u}),o.jsxs("span",{className:"sc-learn-go","aria-hidden":"true",children:[v?o.jsx(xr,{size:"1"}):null,t.verb,v?null:o.jsx(Pa,{size:12,weight:"bold"})]})]}):o.jsxs("div",{className:"sc-learn-step","data-state":p,children:[m,o.jsx("span",{className:"sc-learn-step-name",children:u}),i[f]&&o.jsx("span",{className:"sc-vh",children:", done"})]})},u)})})}function hX(){const{brands:e}=Rn(),t=dN(e);return t?o.jsx(fo,{to:mo(t),replace:!0}):o.jsx(fo,{to:"/setup",replace:!0})}function dN(e){const t=hB();return e.find(n=>n.id===t)??e[0]??null}const pX=48;function mX(e,t,n=pX){let r=null;for(const a of t){if(a.kind==="root")continue;const i=(r??e).findIndex(h=>h.id===a.id),c=a.status==="done"&&a.images.length>0&&!a.archived;if(i>=0){if((r??e)[i]===a)continue;r??(r=[...e]),c?r[i]=a:r.splice(i,1);continue}if(!c)continue;const u=r??e;if(u.length>=n&&wu(u[u.length-1],a)<0)continue;r??(r=[...e]);let f=0;for(;f<r.length&&wu(r[f],a)<=0;)f++;r.splice(f,0,a),r.length>n&&(r.length=n)}return r??e}const fN='[data-guide="library.new"]',ad=(e,t)=>({id:"go",voice:"ask",point:`[data-guide="nav.${e}"]`,side:"bottom",soft:!0,...t}),gX='[data-guide="compose"] .sc-attachpanel',vX='[data-guide="compose"] .sc-attachpanel .sc-ap-body',Zh='[data-guide="compose"] .sc-promptcard',wX='[data-guide="compose.add"]',hN='[data-guide="compose"] .sc-brief-line',Vh='[data-guide="compose.send"]',pN='[data-guide="compose.engine"]',Au=".sc-pstudio",C6=`${Au} .sc-convo-card`,yX=".sc-newdlg-layer",Nu=".sc-ovl",gn={go:{title:"Shots are made in Create",body:"A shot is built from what you sell, who shows it and where. Open Create, and we'll make your first one together."},intro:{title:"This is Create, where shots are made",body:"A shot is built from three things Scenri keeps for you: what you sell, who shows it, and where it happens. Add them, say how to shoot it, and Scenri makes the picture in about a minute."},engine:{title:"Connect image generation",body:"Scenri needs an image engine before it can make anything. Setting one up takes about a minute."},product:{title:"Choose a product",body:"A product is the thing you are selling. Scenri keeps its real photos, so it looks the same in every shot you make."},presenter:{title:"Choose a presenter",body:"A presenter is a person Scenri keeps. Pick one and the same face shows your product in every shot."},scene:{title:"Choose a scene",body:"A scene is a place and its light. It decides where the shot happens and how it feels."},make:{title:"Say how to shoot it, then make it",body:"A few words about the moment, the light or the framing. Generate then puts your ingredients and your words together into a picture."},waiting:{title:"Scenri is making it",body:"This takes a moment. Your ingredients are kept, so you can change one thing later without starting over."},result:{title:"Your first shot",body:"The product, the presenter and the scene you chose are kept, so your next shot starts from them. Open it to change one thing."},failed:{title:"That one didn't work",body:"The tile says why. Put the shot together again and Scenri will try it again."},reuseProduct:{title:"Add the product you saved",body:"Yours sits in the shelf with ours. Putting it in again costs nothing: it is the same product, in a new shot."},reuseScene:{title:"Put it somewhere else",body:"A different place and light, so the two shots share the product and little else."},reuseResult:{title:"The same product, twice",body:"Two shots, one thing you added once. Anything Scenri keeps works this way: products, presenters and scenes."},refineAsk:{title:"Change one thing",body:"Say what to change, like warmer light or a closer crop. The rest of the shot stays."},refineResult:{title:"Here is the change",body:"The original stays one step back in the history, so nothing is lost."},refineFailed:{title:"That change didn't work",body:"Say the change again and Scenri will try it once more."},refineChoose:{title:"Choose a shot to change",body:"Open one from what you have made. You can also use Refine on its card."},refineGo:{title:"Your shots live in Create",body:"Refining starts from a picture you already have. Open Create to find one."},productGo:{title:"Your products live here",body:"Each one you add is kept, so it looks the same in every shot. Open Products to add yours."},productNew:{title:"Start a new product",body:"Add its real photos, or bring in your catalog from your store. Either way it is yours to reuse."},sceneGo:{title:"Your scenes live here",body:"A scene is a place and its light, saved to shoot in again. Open Scenes to make one."},sceneNew:{title:"Start a new scene",body:"Describe the place in a sentence, start from pictures of it, or let it guide you."},presenterGo:{title:"Your presenters live here",body:"A presenter is a person Scenri keeps, the same face in every shot. Open Presenters to make one."},presenterNew:{title:"Start a new presenter",body:"Describe someone, or add photos of a real person. The studio takes it from there."},presenterEngine:{title:"Set up image generation",body:"Drawing a face needs an engine. Setting one up takes about a minute, and the answers so far are kept."},presenterStart:{title:"Describe someone, or start from photos",body:"Photos keep a real face. Describing invents one, question by question."},presenterFace:{title:"Decide the face",body:"Every shot with this presenter uses this face, so take the one you want."},presenterSave:{title:"Save your presenter",body:"Once saved they are in your ingredients, ready for every shot."},sceneStart:{title:"Describe the place, or start from pictures",body:"A scene is the place and its light around your shot. Pictures are read for you; guided, it asks one thing at a time."},sceneWords:{title:"These words are the scene",body:"Every shot made in this scene is told exactly this. Draw it to see it, or say what to add."},productMake:{title:"Add your product",body:"Its real photos keep it the same in every shot. Add a few, or bring in your catalog from your store."}},Ki=e=>`.sc-feed .sc-cell[data-fb-node="${e}"]`,$v=e=>e.status==="done"&&e.images>0,Dv=e=>e.status==="error"||e.status==="cancelled"||e.status==="done"&&e.images===0,j6=e=>e.products+e.presenters+(e.scene?1:0)+e.others,Bx={product:"Products",presenter:"Presenters",scene:"Scenes"};function mN(e){if(!e.here)return e.heading?ad("create",gn.go):null;const t=e.composer,n=e.nodes.find($v);if(n)return{id:"result",voice:"note",point:Ki(n.id),side:"bottom",...gn.result,done:!0};const r=e.nodes.find(u=>u.status==="running");if(r)return{id:"waiting",voice:"note",point:Ki(r.id),side:"bottom",...gn.waiting};if(t!=null&&t.busy)return{id:"sending",voice:"quiet"};if(!t||t.refining)return null;const a=t.pickerOpen||j6(t)>0||t.words,i=e.nodes.find(Dv);if(i&&!a)return{id:"failed",voice:"note",point:Ki(i.id),side:"bottom",...gn.failed};if(t.engine!=="ready")return{id:"engine",voice:"ask",point:pN,side:"top",...gn.engine};if(!e.begun&&j6(t)===0&&!t.words)return{id:"intro",voice:"ask",live:[],start:!0,...gn.intro};const c=vN(t);return c?A6(c,t.pickerOpen):{id:"make",voice:"ask",point:Vh,live:[hN,Vh],side:"top",...gn.make}}function gN(e){if(!e.here)return e.heading?ad("create",gn.go):null;const t=e.composer,n=e.nodes.find($v);if(n)return{id:"again",voice:"note",point:Ki(n.id),side:"bottom",...gn.reuseResult,done:!0};const r=e.nodes.find(c=>c.status==="running");if(r)return{id:"waiting",voice:"note",point:Ki(r.id),side:"bottom",...gn.waiting};if(t!=null&&t.busy)return{id:"sending",voice:"quiet"};if(!t||t.refining)return null;const a=t.pickerOpen||j6(t)>0||t.words,i=e.nodes.find(Dv);return i&&!a?{id:"failed",voice:"note",point:Ki(i.id),side:"bottom",...gn.failed}:t.engine!=="ready"?{id:"engine",voice:"ask",point:pN,side:"top",...gn.engine}:t.products===0?A6("product",t.pickerOpen,gn.reuseProduct):t.scene?{id:"make",voice:"ask",point:Vh,live:[hN,Vh],side:"top",...gn.make}:A6("scene",t.pickerOpen,gn.reuseScene)}function vN(e){return e.products===0?"product":e.presenters===0?"presenter":e.scene?null:"scene"}function A6(e,t,n){const r=n??gn[e];return t?{id:e,voice:"ask",point:gX,live:[vX],lit:[Zh],beside:!0,side:"right",...r}:{id:e,voice:"ask",point:wX,side:"top",...r}}const wN=`${Nu} .sc-promptcard`,bX=`${Nu} .sc-stage-img`,Ux=`${Nu} .sc-trail`,Wx=".sc-feed";function xX(e){if(e.heading)return ad("create",gn.refineGo);if(!e.here)return null;if(!e.open&&!e.armed)return{id:"choose",voice:"ask",point:Wx,live:[Wx],beside:!0,side:"left",...gn.refineChoose};const t=e.nodes.find($v);if(t)return e.open?{id:"refined",voice:"note",shell:Nu,point:Ux,side:"top",...gn.refineResult,done:!0}:{id:"refined",voice:"note",point:Ki(t.id),side:"bottom",...gn.refineResult,done:!0};if(e.nodes.some(r=>r.status==="running"))return{id:"refining",voice:"quiet"};const n=e.nodes.find(Dv);return n&&!e.asking?e.open?{id:"refine-failed",voice:"note",shell:Nu,point:Ux,side:"top",...gn.refineFailed}:{id:"refine-failed",voice:"note",point:Ki(n.id),side:"bottom",...gn.refineFailed}:e.open?{id:"ask",voice:"ask",shell:Nu,point:wN,also:[bX],beside:!0,side:"left",...gn.refineAsk}:{id:"ask",voice:"ask",point:Zh,live:[Zh],beside:!0,side:"top",...gn.refineAsk}}function yN(e){if(e.heading)return ad("presenters",gn.presenterGo);const t=e.studio;if(t){const n=`${Au} [data-turn="q:${t.open}"]`,r=(a,i,c=[],u)=>({id:a,voice:"ask",shell:Au,point:`${n} .sc-convo-ask`,live:[n],also:c,...u?{lit:u}:{},beside:!0,side:"left",...i});switch(t.open){case"source":return r("start",gn.presenterStart,[C6]);case"noengine":return r("engine",gn.presenterEngine);case"identity":case"revision":return r("face",gn.presenterFace,[".sc-pstudio-well",C6],[`${Au} [data-turn]:has(+ [data-turn="q:${t.open}"])`]);case"save":case"blind":return r("save",gn.presenterSave);default:return{id:"studio",voice:"quiet"}}}return e.onPage?{id:"new",voice:"ask",point:fN,side:"bottom",...gn.presenterNew}:null}function kX(e,t){return{id:e,voice:"ask",shell:yX,point:".sc-newdlg",beside:!0,side:"left",...t}}function bN(e){return{id:"new",voice:"ask",point:fN,side:"bottom",...e}}function SX(e){var n,r;if(e.heading)return ad("scenes",gn.sceneGo);const t=e.studio;if(t){const a=`${Au} [data-turn="q:${t.open}"]`,i=(c,u)=>({id:c,voice:"ask",shell:Au,point:`${a} .sc-convo-ask`,live:[a],also:[C6],beside:!0,side:"left",...u});return t.open==="source"?i("start",gn.sceneStart):(n=t.open)!=null&&n.startsWith("agree-")?i("words",gn.sceneWords):(r=t.open)!=null&&r.startsWith("decide-")?{id:"use",voice:"quiet"}:{id:"studio",voice:"quiet"}}return e.onPage?bN(gn.sceneNew):null}function EX(e){return e.heading?ad("products",gn.productGo):e.dialogOpen?kX("product",gn.productMake):e.onPage?bN(gn.productNew):null}function xN(e,t){if(e==="first-shot"){if(t==="presenter")return"product";if(t==="scene")return"presenter";if(t==="make")return"scene"}if(e==="reuse"){if(t==="scene")return"product";if(t==="make")return"scene"}return null}function CX(e,t,n){return e?xN(e,t)||n&&(t==="new"||t==="choose"||(e==="first-shot"||e==="reuse")&&t==="product")||e==="presenter"&&(t==="start"||t==="face"||t==="save")||(e==="product"||e==="scene")&&t===e?!0:e==="refine"&&t==="ask":!1}function jX(e,t){const n=e.active;return n?n.task==="presenter"?t.presenters>n.baseline.presenters:n.task==="scene"?t.scenes>n.baseline.scenes:n.task==="product"?t.products>n.baseline.products:!1:!1}const AX={"first-shot":"shot",reuse:"shot",refine:"refine",product:"product",presenter:"presenter",scene:"scene"};function K1(e,t){return!(!t.eligible||t.hidden||t.active&&(t.active.task===e||t.active.task==="first-shot")||t.done[AX[e]]||t.dismissed.includes(e)||e==="refine"&&!t.done.shot)}function NX(e){return e.onMainPage&&e.eligible&&e.welcome===null&&e.ready&&e.visible&&!e.blocked&&!e.busy}const yu={lede:"Scenri makes product shots for your brand. You choose the product, who shows it and where, and it makes the picture.",take:"Make your first shot",notNow:"Not now",again:"Welcome to Scenri",note:e=>e.engineReady?e.ownsProducts?"We'll make your first one together, a step at a time, with one of your products.":"We'll make your first one together, a step at a time. You can start with one of our products.":"First a short setup for image generation, then your first shot together, a step at a time."};function MX(e){const t=e.filter(a=>a.previewUrl),n=(a,i)=>{var c,u;return(u=(((c=a.brief)==null?void 0:c.tokens)??[]).find(f=>(f==null?void 0:f.t)===i))==null?void 0:u.id},r=new Map;for(const a of t){const i=n(a,"product");i&&r.set(i,[...r.get(i)??[],a])}for(const a of r.values()){const i=new Map;for(const c of a){const u=n(c,"template");u&&!i.has(u)&&i.set(u,c)}if(i.size>=3)return[...i.values()].slice(0,3)}for(const a of r.values())if(a.length>=3)return a.slice(0,3);return t.slice(0,3)}function RX(e,t,n,r){const a=new Map(e.map(c=>[c.id,c]));let i=!1;for(const c of t){if(c.kind!==r||c.createdAt<n)continue;const u={id:c.id,kind:c.kind,status:c.status,images:Array.isArray(c.images)?c.images.length:0,createdAt:c.createdAt},f=a.get(c.id);f&&f.status===u.status&&f.images===u.images||(a.set(c.id,u),i=!0)}return i?[...a.values()].sort((c,u)=>c.createdAt<u.createdAt?1:c.createdAt>u.createdAt?-1:0):e}const PX="https://github.com/tonygorb/scenri";function LX(){var w,y;const e=un(ut.hub),t=un(ut.set),n=!!e||!!t,r=cm(),a=qp(),i=!!((w=a.status)!=null&&w.available),c=i&&!a.dismissed||r.unread,u=yf(),f=Cc(),h=Yj(),p=rK(),{engines:m}=Rn(),v=!m.some(b=>b.available);return o.jsx("div",{className:"sc-help-float",children:o.jsxs(Ss,{children:[o.jsx(or,{label:"Help",children:o.jsx(Es,{children:o.jsxs("button",{type:"button",className:"sc-icon-btn sc-help-btn","aria-label":"Help",children:[o.jsx(lW,{size:16}),c&&o.jsx("span",{className:"sc-upd-dot","aria-hidden":"true"})]})})}),o.jsxs(Cs,{align:"end",side:"top",sideOffset:8,className:"sc-menu sc-help-menu",children:[i&&o.jsxs(tr,{className:"sc-menu-item","data-update":"",onSelect:()=>u("updates"),children:[o.jsx(iC,{size:18,className:"sc-menu-ic"}),o.jsxs("span",{className:"sc-menu-lb",children:["Update available · ",(y=a.status)==null?void 0:y.latest]})]}),o.jsxs(o.Fragment,{children:[o.jsxs(tr,{className:"sc-menu-item",onSelect:()=>{p6.current="help",h()},children:[o.jsx(qU,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Learn"})]}),o.jsxs(tr,{className:"sc-menu-item",onSelect:()=>p(),children:[o.jsx(XU,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:yu.again})]})]}),n&&o.jsxs(tr,{className:"sc-menu-item",onSelect:()=>window.dispatchEvent(new Event("scenri:shortcuts")),children:[o.jsx(JU,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Keyboard shortcuts"})]}),o.jsxs(tr,{className:"sc-menu-item",onSelect:()=>r.open(),children:[o.jsx(eW,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"What's new"}),r.unread&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-menu-new","aria-hidden":"true"}),o.jsx("span",{className:"sc-vh",children:", not read yet"})]})]}),v&&o.jsxs(tr,{className:"sc-menu-item",onSelect:()=>f(),children:[o.jsx(P0,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Set up image generation"})]}),o.jsx("div",{className:"sc-menu-sep"}),o.jsxs(tr,{className:"sc-menu-item",onSelect:()=>u("about"),children:[o.jsx(zp,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"About Scenri"})]}),o.jsx(tr,{className:"sc-menu-item",asChild:!0,children:o.jsxs("a",{href:PX,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(YU,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Scenri on GitHub"})]})})]})]})})}function TX(){return o.jsx(LX,{})}const $X={composer:null,overlay:null,studio:null,showing:!1};let Oa=$X;const N6=new Set;function sm(e){Oa=e;for(const t of N6)t()}const Hv=(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t);function Kx(e){Hv(Oa.composer,e)||sm({...Oa,composer:e})}function Gx(e){Hv(Oa.overlay,e)||sm({...Oa,overlay:e})}function zh(e){Hv(Oa.studio,e)||sm({...Oa,studio:e})}function Yx(e){Oa.showing!==e&&sm({...Oa,showing:e})}function kN(e){return N6.add(e),()=>N6.delete(e)}function DX(){return Oa}function SN(){return s.useSyncExternalStore(kN,DX)}function HX(){return s.useSyncExternalStore(kN,()=>Oa.showing)}function EN(e){return e.milestones.map(t=>t.label)}const Hi=[{id:"first-shot",title:"Make your first shot",summary:"A shot is three things Scenri keeps for you, put together and directed: what you sell, who shows it, and where it happens. Start with ours to see the shape of it, then swap in your own.",milestones:[{label:"Open Create",moments:["go"]},{label:"Choose a product",moments:["product"]},{label:"Choose a presenter",moments:["presenter"]},{label:"Choose a scene",moments:["scene"]},{label:"Say how to shoot it, then make it",moments:["make","sending","waiting","failed"]},{label:"Open your shot",moments:["result"]}]},{id:"product",title:"Add your product",summary:"Your own product, added once from its packshots or straight from your store, and exact in every shot you make from then on. Nothing is drawn here and nothing is spent.",milestones:[{label:"Find where your products live",moments:["go"]},{label:"Start a new one",moments:["new"]},{label:"Add its photos, or bring in your store",moments:["product"]}]},{id:"reuse",title:"Use it again",summary:"The same saved product in a different world. This is the whole point of keeping ingredients: one thing you added once, shot again and again without describing it twice.",milestones:[{label:"Open Create",moments:["go"]},{label:"Add the product you saved",moments:["product"]},{label:"Put it somewhere else",moments:["scene"]},{label:"Say how to shoot it, then make it",moments:["make","sending","waiting","failed"]},{label:"See the same product in both",moments:["again"]}],needs:"product"},{id:"presenter",title:"Create a presenter",summary:"One person Scenri keeps, invented question by question or built from photos of someone real, who stays the same face across every shot you put them in.",milestones:[{label:"Find where your presenters live",moments:["go"]},{label:"Start a new one",moments:["new"]},{label:"Describe someone, or add photos",moments:["start"]},{label:"Decide the face",moments:["face"]},{label:"Save them to the brand",moments:["save"]}]},{id:"scene",title:"Build a scene",summary:"A place and its light, saved to shoot in again, from pictures of it or a few questions.",milestones:[{label:"Find where your scenes live",moments:["go"]},{label:"Start a new one",moments:["new"]},{label:"Describe the place, or add pictures",moments:["start"]},{label:"Read what your shots are told",moments:["words"]},{label:"Use it",moments:["use"]}]},{id:"refine",title:"Refine a shot",summary:"Change one thing about a shot you already have and keep everything else, including the original. This is how a shot gets good: one change at a time, never a fresh start.",milestones:[{label:"Find the shots you have made",moments:["go"]},{label:"Choose a shot to change",moments:["choose"]},{label:"Say the one thing to change",moments:["ask","refine-failed"]},{label:"See the change on the trail",moments:["refining","refined"]}],needs:"shot"}],M6={shot:{note:"Refining starts from a shot you have made.",action:"Make a shot first",status:"Needs a shot"},product:{note:"Using one again starts with a product of your own.",action:"Add a product first",status:"Needs a product"}};function OX(e){return Hi.find(t=>t.id===e)??null}function IX(e,t,n,r){var a,i,c;return((i=(a=t.progress)==null?void 0:a[e])==null?void 0:i.brandId)===n&&r>0?"active":(c=t.lessons)!=null&&c[e]?"done":"new"}function FX(e,t){return e.find(n=>t(n)!=="done")??null}const Ov=Object.fromEntries(Hi.map(e=>[e.id,Object.fromEntries(e.milestones.flatMap((t,n)=>t.moments.map(r=>[r,n])))]));function CN(e,t){let n=0;for(const r of t){const a=Ov[e][r];a!==void 0&&a>n&&(n=a)}return n}function _X(e,t){return CN(e,t)>0}function ZX(e,t){var a;const n=Ov[e][t],r=((a=Hi.find(i=>i.id===e))==null?void 0:a.milestones.length)??0;return n===void 0||!r?null:{at:n+1,of:r}}const Fg=e=>e.status==="done"&&e.images>0;function qx(e,t,n){const r=CN(e,t);return n?Math.max(VX(e,n),r):r}function VX(e,t){const n=t.moment?Ov[e][t.moment]:void 0;if(n!==void 0)return n;switch(e){case"first-shot":return t.nodes.some(Fg)?5:t.nodes.length>0?4:0;case"reuse":return t.nodes.some(Fg)?4:t.nodes.length>0?3:0;case"presenter":return t.draft?3:0;case"refine":return t.nodes.some(Fg)||t.nodes.some(r=>r.status==="running")?3:0;default:return 0}}const R6={"first-shot":{square:new URL("/assets/first-shot-square-hTczF9bl.webp",import.meta.url).href,wide:new URL("/assets/first-shot-wide-BSpJwjNx.webp",import.meta.url).href},product:{square:new URL("/assets/product-square-DPR77tr0.webp",import.meta.url).href,wide:new URL("/assets/product-wide-DLSsO8IK.webp",import.meta.url).href},reuse:{square:new URL("/assets/reuse-square-CMLhjEwt.webp",import.meta.url).href,wide:new URL("/assets/reuse-wide-DbbTeKsL.webp",import.meta.url).href},presenter:{square:new URL("/assets/presenter-square-BpqHv8Aq.webp",import.meta.url).href,wide:new URL("/assets/presenter-wide-ecc4y7eJ.webp",import.meta.url).href},scene:{square:new URL("/assets/scene-square-CQBwEfXy.webp",import.meta.url).href,wide:new URL("/assets/scene-wide-CJ9ENIrh.webp",import.meta.url).href},refine:{square:new URL("/assets/refine-square-CietHTPe.webp",import.meta.url).href,wide:new URL("/assets/refine-wide-BM5sVq6w.webp",import.meta.url).href}};function zX({open:e,pictures:t,note:n,onTake:r,onDecline:a}){return o.jsxs(Ts,{open:e,className:"sc-welcome",maxWidth:"440px",described:!0,tone:"guide",onDismiss:a,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsxs(ds,{className:"sc-newdlg-title",children:["Welcome to ",o.jsx("span",{className:"sc-accent",children:"Scenri"})]}),o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":yu.notNow,children:o.jsx(jn,{size:16})})})]}),o.jsx(nd,{className:"sc-welcome-lede",children:yu.lede}),t.length>0&&o.jsx("div",{className:"sc-welcome-pics","aria-hidden":"true",children:t.map((i,c)=>o.jsx("img",{src:i,alt:"",style:{animationDelay:`${120+c*60}ms`}},i))}),o.jsxs("div",{className:"sc-newdlg-foot sc-welcome-foot",children:[o.jsx("p",{className:"sc-welcome-note",children:n}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:a,children:yu.notNow}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:r,children:yu.take})]})]})}const Xx=e=>e.t!=="format",Ho=()=>[{t:"text",v:""}],Ta=e=>e.t==="product"?`p:${e.id}`:e.t==="template"?`t:${e.id}`:e.t==="ref"?`r:${e.imageHash}`:am(e);function BX(e,t){const n=new Set,r=c=>{const u=Ta(c);return u?n.has(u)?!1:(n.add(u),!0):!0},a=e.filter(Xx).filter(r),i=t.filter(Xx).filter(r);return{own:a,carried:i}}function Iv(e){const{own:t,carried:n}=BX(e.tokens??[],e.inherited??[]),r=[...t,...n],a=r.length?r:Ho(),i=a.some(c=>c.t==="template");return e.templateId&&!i?[{t:"template",id:e.templateId},...a]:a}const Ol="sc-token",jf=`.${Ol}`,am=e=>e.t==="template"?`t:${e.id}${e.setup?`|${e.setup}`:""}`:e.t==="product"?`p:${e.id}${e.angle?`|${e.angle}`:""}`:e.t==="character"?`h:${e.id}`:e.t==="color"?`c:${e.hex}|${e.name??""}`:e.t==="ref"?`r:${e.imageHash}${e.label?`|${e.label}`:""}`:e.t==="mark"?`m:${e.imageHash}`:"",as=e=>{const t=e.slice(0,1),n=e.slice(2);if(t==="t"){const[r,a]=n.split("|");return r?{t:"template",id:r,...a?{setup:a}:{}}:null}if(t==="p"){const[r,a]=n.split("|");return r?{t:"product",id:r,...a?{angle:a}:{}}:null}if(t==="h")return n?{t:"character",id:n}:null;if(t==="r"){const r=n.indexOf("|"),a=r<0?n:n.slice(0,r),i=r<0?"":n.slice(r+1);return a?{t:"ref",imageHash:a,...i?{label:i}:{}}:null}if(t==="m")return n?{t:"mark",imageHash:n}:null;if(t==="c"){const[r,a]=n.split("|");return r?{t:"color",hex:r,name:a||void 0}:null}return null},Go="\uFEFF",ul=//g,Yl=e=>!!e&&e.nodeType===Node.TEXT_NODE&&e.textContent===Go,jN=e=>{var t;return e.length-(((t=e.match(ul))==null?void 0:t.length)??0)};function $o(e){const t=typeof window>"u"?null:window.getSelection();if(!e||!t||t.rangeCount===0)return null;const n=t.getRangeAt(0);return e.contains(n.startContainer)?Uh(e,n.startContainer,n.startOffset):null}function Ra(e,t){if(!e)return;let n=0;for(const r of Array.from(e.childNodes)){const a=Vu(r);if(r.nodeType===Node.TEXT_NODE){if(t<=n+a){co(e,r,Bh(r,t-n));return}}else if(t<=n+a){const i=r.nextSibling;if((i==null?void 0:i.nodeType)===Node.TEXT_NODE){co(e,i,Bh(i,0));return}break}n+=a}Il(e)}function Bh(e,t){const n=e.textContent??"";if(n===Go)return 1;let r=0,a=0;for(;a<n.length&&r<t;)n[a]!==Go&&(r+=1),a+=1;return a}function Il(e){if(!e)return;e.focus({preventScroll:!0});const t=e.lastChild;if((t==null?void 0:t.nodeType)===Node.TEXT_NODE){co(e,t,t.length);return}const n=window.getSelection(),r=document.createRange();r.selectNodeContents(e),r.collapse(!1),n==null||n.removeAllRanges(),n==null||n.addRange(r)}function UX(e){if(!e)return!1;const t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed)return!1;const n=t.getRangeAt(0);return e.contains(n.startContainer)&&e.contains(n.endContainer)}function co(e,t,n){const r=window.getSelection(),a=document.createRange();a.setStart(t,Math.max(0,Math.min(n,t.length))),a.collapse(!0),r==null||r.removeAllRanges(),r==null||r.addRange(a)}const Vu=e=>e.nodeType===Node.TEXT_NODE?jN(e.textContent??""):1;function Uh(e,t,n){if(t===e){let a=0;for(let i=0;i<n&&i<e.childNodes.length;i++)a+=Vu(e.childNodes[i]);return a}let r=0;for(const a of Array.from(e.childNodes)){if(a===t)return r+jN((a.textContent??"").slice(0,n));if(a.contains(t))return r+1;r+=Vu(a)}return r}function ro(e){var n,r;if(!e)return;const t=$o(e);e.normalize();for(const a of Array.from(e.childNodes)){if(a.nodeType!==Node.TEXT_NODE)continue;const i=a.textContent??"",c=i.replace(ul,""),u=c.length?c:i.length?Go:"";u!==i&&(a.textContent=u),u||a.remove()}for(const a of Array.from(e.childNodes))Yl(a)&&!Vs(a.previousSibling)&&!Vs(a.nextSibling)&&a.remove();for(const a of Array.from(e.childNodes))Vs(a)&&(((n=a.previousSibling)==null?void 0:n.nodeType)!==Node.TEXT_NODE&&e.insertBefore(document.createTextNode(Go),a),((r=a.nextSibling)==null?void 0:r.nodeType)!==Node.TEXT_NODE&&e.insertBefore(document.createTextNode(Go),a.nextSibling));o0(e)||t!==null&&Ra(e,t)}function WX(e){var n,r,a;if(!e)return!0;const t=e.childNodes;for(let i=0;i<t.length;i++){const c=t[i];if(Vs(c)){if(((n=c.previousSibling)==null?void 0:n.nodeType)!==Node.TEXT_NODE||((r=c.nextSibling)==null?void 0:r.nodeType)!==Node.TEXT_NODE)return!1;continue}if(c.nodeType!==Node.TEXT_NODE)continue;const u=c.textContent??"";if(!u||((a=t[i+1])==null?void 0:a.nodeType)===Node.TEXT_NODE||u.includes(Go)&&(u!==Go||!Vs(c.previousSibling)&&!Vs(c.nextSibling)))return!1}return!0}function KX(e){return e.querySelector(jf)?!1:!(e.textContent??"").replace(/[ ]/g,"").trim()}function o0(e){if(!e)return!1;const t=KX(e);return t&&e.firstChild&&e.replaceChildren(),e.toggleAttribute("data-empty",t),t}const Vs=e=>!!e&&e.nodeType===Node.ELEMENT_NODE&&e.classList.contains(Ol);function Fv(e){if(!e)return null;const t=typeof window>"u"?null:window.getSelection();if(!t||t.rangeCount===0||!t.getRangeAt(0).collapsed)return null;const n=t.getRangeAt(0),r=n.startContainer;return r.nodeType!==Node.TEXT_NODE||r.parentNode!==e?null:{text:r,at:n.startOffset}}function Qx(e){var a;if(!e)return Ho();const t=[];let n="";const r=()=>{n&&(t.push({t:"text",v:n}),n="")};for(const i of Array.from(e.childNodes)){if(i.nodeType===Node.TEXT_NODE){n+=(i.textContent??"").replace(ul,"");continue}const c=i,u=(a=c.dataset)==null?void 0:a.tok;if(u){const f=as(u);if(f){r(),t.push(f);continue}}if(c.tagName==="BR"){n+=`
|
|
99
|
-
`;continue}n+=c.textContent??""}return r(),t.some(i=>i.t==="text")||t.push({t:"text",v:""}),t}function Jx(e,t,n){if(e){e.textContent="";for(const r of GX(t)){if(r.t==="text"){r.v&&e.appendChild(document.createTextNode(r.v));continue}e.appendChild(n(r))}ro(e)}}function GX(e){const t=n=>n>=0&&n<e.length&&e[n].t!=="text";return e.filter((n,r)=>{if(n.t!=="text"||!/^\s+$/.test(n.v))return!0;const a=r===0||t(r-1),i=r===e.length-1||t(r+1);return!(a&&i)})}function YX(e,t){var u,f;const n=Fv(e);if(!n||!e)return!1;const{text:r,at:a}=n,i=Yl(r);if(t==="right"){if(!Vs(r.nextSibling)||!i&&a!==r.length)return!1;const h=(u=r.nextSibling)==null?void 0:u.nextSibling;return(h==null?void 0:h.nodeType)!==Node.TEXT_NODE?!1:(co(e,h,Yl(h)?1:0),!0)}if(!Vs(r.previousSibling)||!i&&a!==0)return!1;const c=(f=r.previousSibling)==null?void 0:f.previousSibling;return(c==null?void 0:c.nodeType)!==Node.TEXT_NODE?!1:(co(e,c,Yl(c)?1:c.length),!0)}function ek(e,t){const n=Fv(e);if(!n)return null;const{text:r,at:a}=n,i=Yl(r);return t==="Backspace"?Vs(r.previousSibling)&&(i||a===0)?r.previousSibling:null:Vs(r.nextSibling)&&(i||a===r.length)?r.nextSibling:null}function tk(e,t){const n=Fv(e);return!n||!Yl(n.text)?!1:t==="Backspace"?!n.text.previousSibling:!n.text.nextSibling}function _g(e,t){for(const n of Array.from(e.querySelectorAll(jf))){const r=as(n.dataset.tok??"");if(r&&Ta(r)===t)return n}return null}function AN(e){const t=typeof window>"u"?null:window.getSelection();if(!e||!t||t.rangeCount===0)return"";const n=t.getRangeAt(0);if(n.startContainer.nodeType!==Node.TEXT_NODE||!e.contains(n.startContainer))return"";let r=(n.startContainer.textContent??"").slice(0,n.startOffset);for(let a=n.startContainer.previousSibling;a&&a.nodeType===Node.TEXT_NODE;a=a.previousSibling)r=(a.textContent??"")+r;return r}function NN(){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const t=e.getRangeAt(0).cloneRange(),n=t.getBoundingClientRect();if(n.width||n.height)return n;const r=document.createElement("span");r.textContent="",t.insertNode(r);const a=r.getBoundingClientRect(),i=r.parentNode;return r.remove(),i==null||i.normalize(),a}function zl(e,t,n){if(!e||!t)return;const r=n==="after"?t.nextSibling:t.previousSibling;if((r==null?void 0:r.nodeType)!==Node.TEXT_NODE)return;const a=r;co(e,a,Yl(a)?1:n==="after"?0:a.length)}const Wh=9;function MN(e){if(!e.firstChild)return[];const t=document.createRange();return t.selectNodeContents(e),Array.from(t.getClientRects()).filter(n=>n.height>0)}function RN(e,t){let n=null,r=1/0;for(const a of e){const i=t<a.top?a.top-t:t>a.bottom?t-a.bottom:0;i<r&&(r=i,n=a)}return n}function nk(e,t,n){if(!e)return!1;const r=MN(e),a=RN(r,n);if(!a)return!1;const i=a.top+a.height/2;for(const u of Array.from(e.querySelectorAll(jf))){const f=u.getBoundingClientRect();if(!(f.bottom<a.top||f.top>a.bottom)&&!(t<f.left-Wh||t>f.right+Wh))return zl(e,u,t<f.left+f.width/2?"before":"after"),!0}if(n>=a.top&&n<=a.bottom)return!1;const c=PN(t,i);return!c||!e.contains(c.node)||c.node.nodeType!==Node.TEXT_NODE?!1:(co(e,c.node,c.offset),!0)}function qX(e,t,n){if(!e)return null;const r=RN(MN(e),n);if(!r)return null;const a=r.top+r.height/2;for(const c of Array.from(e.querySelectorAll(jf))){const u=c.getBoundingClientRect();if(!(u.bottom<r.top||u.top>r.bottom)&&!(t<u.left-Wh||t>u.right+Wh))return{beside:c,side:t<u.left+u.width/2?"before":"after"}}const i=PN(t,a);return!i||!e.contains(i.node)?null:{node:i.node,offset:i.offset}}function PN(e,t){var i,c;const n=document,r=(i=n.caretRangeFromPoint)==null?void 0:i.call(n,e,t);if(r)return{node:r.startContainer,offset:r.startOffset};const a=(c=n.caretPositionFromPoint)==null?void 0:c.call(n,e,t);return a?{node:a.offsetNode,offset:a.offset}:null}function XX(e,t,n={}){if(!e)return;const r=window.getSelection();let a=null;if(r&&r.rangeCount>0&&e.contains(r.getRangeAt(0).startContainer))a=r.getRangeAt(0);else if(n.fallbackUnits!=null){Ra(e,n.fallbackUnits);const c=window.getSelection();c&&c.rangeCount>0&&e.contains(c.getRangeAt(0).startContainer)&&(a=c.getRangeAt(0))}a||(a=document.createRange(),a.selectNodeContents(e),a.collapse(!1)),a.deleteContents();const i=a.startContainer;if(i.nodeType===Node.TEXT_NODE&&i.parentNode===e){const c=i,u=c.textContent??"";let f=u.slice(0,a.startOffset);const h=u.slice(a.startOffset);n.eatQuery&&(f=tQ(c,f)),c.textContent=f,e.insertBefore(t,c.nextSibling),h&&e.insertBefore(document.createTextNode(h),t.nextSibling)}else{const c=i===e?a.startOffset:e.childNodes.length;e.insertBefore(t,e.childNodes[c]??null)}ro(e),Ra(e,ni(e,t)+1)}const QX=["$","/","@","#"],JX=e=>QX.includes(e),Kh=e=>e===" "||e===`
|
|
100
|
-
`||e===" "||e===Go;function eQ(e){const t=AN(e);for(let n=t.length-1;n>=0;n--){const r=t[n];if(Kh(r))return null;if(JX(r))return n===0||Kh(t[n-1])?{sigil:r,query:t.slice(n+1)}:null}return null}function tQ(e,t){const n=i=>Math.max(i.lastIndexOf("$"),i.lastIndexOf("/"),i.lastIndexOf("@"),i.lastIndexOf("#")),r=n(t);if(r>=0)return t.slice(0,r);const a=[];for(let i=e.previousSibling;i&&i.nodeType===Node.TEXT_NODE;i=i.previousSibling){const c=i.textContent??"",u=n(c);if(u>=0){i.textContent=c.slice(0,u);for(const f of a)f.remove();return""}a.push(i)}return t}function Zg(e,t){if(!e||!t)return;e.normalize();const n=ni(e,t);t.remove(),ro(e),Ra(e,n)}function ni(e,t){let n=0;for(const r of Array.from(e.childNodes)){if(r===t)break;n+=Vu(r)}return n}const Mu=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");function nQ(e){let t="",n="",r=!1;const a=i=>{var f;if(i.nodeType===Node.TEXT_NODE){const h=(i.textContent??"").replace(ul,"");if(!h)return;t+=h,n+=Mu(h),r=!1;return}const c=i,u=(f=c.dataset)==null?void 0:f.tok;if(u){const h=Oo(c);t+=(r?" ":"")+h,r=!0,n+=`<span data-sc-tok="${Mu(u)}">${Mu(h)}</span>`;return}i.childNodes.forEach(a)};return e.cloneContents().childNodes.forEach(a),{text:t,html:`<span data-sc-brief="1">${n}</span>`}}function rQ(e,t){const n=[],r=[];for(const a of e){if(a.t==="text"){const c=a.v.trim();if(!c)continue;n.push(c),r.push(Mu(c));continue}const i=t(a);n.push(i),r.push(`<span data-sc-tok="${Mu(am(a))}">${Mu(i)}</span>`)}return{text:n.join(" "),html:`<span data-sc-brief="1">${r.join(" ")}</span>`}}function Oo(e){var t;return(((t=e.querySelector(".sc-token-label"))==null?void 0:t.textContent)??"").trim()}function sQ(e){if(!e.includes("data-sc-brief")&&!e.includes("data-bt-brief"))return null;const n=new DOMParser().parseFromString(e,"text/html").querySelector("[data-sc-brief], [data-bt-brief]");if(!n)return null;const r=[],a=i=>{var h,p;if(i.nodeType===Node.TEXT_NODE){const m=(i.textContent??"").replace(ul,"");m&&r.push(m);return}const c=i,u=((h=c.dataset)==null?void 0:h.scTok)??((p=c.dataset)==null?void 0:p.btTok);if(u===void 0){i.childNodes.forEach(a);return}const f=as(u);r.push(f??c.textContent??"")};return n.childNodes.forEach(a),r.length?r:null}function LN(e){const t=new Set([0]);let n=0;for(const i of e){if(i.t!=="text"){t.add(n),n+=1,t.add(n);continue}for(let c=0;c<i.v.length;c++)(i.v[c]===" "||i.v[c]===`
|
|
101
|
-
`)&&t.add(n+c+1);n+=i.v.length}t.add(n);const r=[...t].sort((i,c)=>i-c),a=Af(e);return r.filter((i,c)=>c===r.length-1||!/^[ \n]*$/.test(a.slice(i,r[c+1])))}const Af=e=>e.map(t=>t.t==="text"?t.v:"").join(""),_v=(e,t,n)=>{const r=n<=t?e.slice(n,t):e.slice(t+1,n);return/^[ \n]*$/.test(r)};function aQ(e,t){const n=Af(e);return LN(e).filter(r=>!_v(n,t,r))}function oQ(e,t){return e.find(n=>n>=t)??(e.length?e[e.length-1]:null)}function iQ(e,t){let n=null,r=1/0;for(const a of e){const i=Math.abs(a-t);i<r&&(r=i,n=a)}return n}function TN(e,t,n){if(!e||!t.parentNode)return!1;const r=ni(e,t);if(_v(Af(om(e)),r,n))return!1;let a=null,i=0;for(const c of Array.from(e.childNodes)){const u=Vu(c);if(n<=i+u){if(c.nodeType===Node.TEXT_NODE){const f=n-i;f<=0?a=c:f>=u?a=c.nextSibling:a=c.splitText(Bh(c,f))}else a=n===i?c:c.nextSibling;break}i+=u}return a===t?!1:(t.remove(),e.insertBefore(t,a),ro(e),!0)}function rk(e,t,n){if(!e)return!1;const r=ni(e,t),a=aQ(om(e),r),i=n===-1?[...a].reverse().find(c=>c<r):a.find(c=>c>r+1);return i===void 0?!1:TN(e,t,i)}function lQ(e,t){if(!e)return t;const n=Af(om(e));let r=t;for(;r>0&&(n[r-1]===" "||n[r-1]===`
|
|
102
|
-
`);)r-=1;return r}function sk(e,t,n,r){if(!e)return null;const a=qX(e,n,r);if(!a)return null;const i=om(e),c=ni(e,t),u=LN(i),f="beside"in a?ni(e,a.beside)+(a.side==="before"?0:1):a.node.nodeType===Node.TEXT_NODE||a.node===e?Uh(e,a.node,a.offset):null;if(f===null)return null;const h="beside"in a&&a.side==="after"?oQ(u,f):iQ(u,f);return h===null?null:{units:h,noop:_v(Af(i),c,h)}}function P6(e,t){const n=Oo(t)||"the chip",r=cQ(t);if(r)return`Moved ${n} before ${r}.`;const a=uQ(t);return a?`Moved ${n} after ${a}.`:ni(e,t)===0?`Moved ${n} to the start of the brief.`:`Moved ${n} to the end of the brief.`}const $N=3;function cQ(e){for(let t=e.nextSibling;t;t=t.nextSibling){if(Vs(t))return Oo(t)||null;const n=(t.textContent??"").replace(ul,"").trim();if(n)return`"${n.split(/\s+/).slice(0,$N).join(" ")}"`}return null}function uQ(e){for(let t=e.previousSibling;t;t=t.previousSibling){if(Vs(t))return Oo(t)||null;const n=(t.textContent??"").replace(ul,"").trim();if(n)return`"${n.split(/\s+/).slice(-$N).join(" ")}"`}return null}function om(e){const t=[];let n="";for(const r of Array.from(e.childNodes)){if(r.nodeType===Node.TEXT_NODE){n+=(r.textContent??"").replace(ul,"");continue}n&&(t.push({t:"text",v:n}),n=""),t.push({t:"ref",imageHash:""})}return n&&t.push({t:"text",v:n}),t}function L6(e){var n;const t=e.target;(n=t==null?void 0:t.closest)!=null&&n.call(t,'input, textarea, select, [contenteditable=""], [contenteditable="true"]')||e.preventDefault()}const zd=e=>(e==null?void 0:e.querySelector('[data-kind="template"]'))??null,Ti=e=>{var t;return((t=e==null?void 0:e.closest)==null?void 0:t.call(e,jf))??null};function Vg(e,t,n={}){var a;if(!e)return!1;let r=!1;for(let i=0;i<32;i++){const c=fQ(e,!!n.commit);if(!c)break;const u={t:"color",hex:c.hex,name:(a=n.nameFor)==null?void 0:a.call(n,c.hex)};mQ(e,c.node,c.start,c.end,t(u)),r=!0}return r&&ro(e),r}function dQ(e,t){var i;e.dataset.kind="color",e.dataset.tok=am(t);const n=t.name??t.hex,r=e.querySelector(".sc-token-swatch");r&&(r.style.background=t.hex);const a=e.querySelector(".sc-token-label");a&&(a.textContent=n),e.getAttribute("role")==="button"&&e.setAttribute("aria-label",`colour: ${n}. Change or remove.`),(i=e.querySelector('[data-role="remove"]'))==null||i.setAttribute("aria-label",`Remove ${n}`)}function fQ(e,t){for(let n=e.childNodes.length-1;n>=0;n--){const r=e.childNodes[n];if(r.nodeType!==Node.TEXT_NODE)continue;const a=r,i=pQ(a.textContent??"",t,(u,f)=>hQ(a,f,u)),c=i[i.length-1];if(c)return{node:a,...c}}return null}function hQ(e,t,n){if(n>0)return Kh(t[n-1]);const r=e.previousSibling;if(!r||Vs(r))return!0;if(r.nodeType===Node.TEXT_NODE){const a=r.textContent??"";return!a.length||Kh(a[a.length-1]??"")}return!0}function pQ(e,t,n){const r=[];for(let a=0;a<e.length;a++){if(e[a]!=="#"||!n(a,e))continue;let i=a+1;for(;i<e.length&&/[0-9A-Fa-f]/.test(e[i]??"");)i++;const c=e.slice(a,i),u=IY(c);if(!u)continue;if(i-a-1===3){const h=e[i];if(h===void 0?!t:/[0-9A-Za-z]/.test(h))continue}r.push({start:a,end:i,hex:u})}return r}function mQ(e,t,n,r,a){const i=t.textContent??"",c=i.slice(0,n),u=i.slice(r),f=typeof window>"u"?null:window.getSelection();let h=null;f&&f.rangeCount>0&&f.getRangeAt(0).startContainer===t&&(h=f.getRangeAt(0).startOffset);const p=t.parentNode;if(p&&(t.textContent=u.length?u:" ",p.insertBefore(a,t),c&&p.insertBefore(document.createTextNode(c),a),h!=null)){if(h<=n){const m=a.previousSibling;(m==null?void 0:m.nodeType)===Node.TEXT_NODE&&co(e,m,Math.min(h,(m.textContent??"").length));return}if(h<=r||!u.length){co(e,t,t.length);return}co(e,t,Math.min(h-r,t.length))}}function Ru(e){if(!e||!/^#[0-9a-f]{6}$/i.test(e))return;const t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,a=Math.max(t,n,r),i=Math.min(t,n,r),c=a-i;if(c<.02)return;let u;return a===t?u=((n-r)/c+(n<r?6:0))*60%360:a===n?u=((r-t)/c+2)*60:u=((t-n)/c+4)*60,`hsl(${Math.round(u)} 55% 55%)`}function gQ(){const e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.setAttribute("width","9"),t.setAttribute("height","9"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2.4");const n=document.createElementNS(e,"path");return n.setAttribute("d","m6 6 12 12M18 6 6 18"),t.appendChild(n),t}const Bd="data-sc-coach-inert",vQ=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function wQ(e=document.body){let t=new Set;const n=a=>{a.hasAttribute("inert")&&!a.hasAttribute(Bd)||(a.setAttribute(Bd,""),a.setAttribute("inert",""))},r=a=>{a.hasAttribute(Bd)&&(a.removeAttribute(Bd),a.removeAttribute("inert"))};return{set(a){const i=new Set(a.filter(h=>h.isConnected&&e.contains(h)&&h!==e)),c=new Set;for(const h of i)for(let p=h.parentElement;p&&p!==e;p=p.parentElement)c.add(p);const u=new Set,f=h=>{for(const p of Array.from(h.children))i.has(p)||vQ.has(p.tagName)||(c.has(p)?f(p):u.add(p))};f(e);for(const h of t)u.has(h)||r(h);for(const h of u)t.has(h)||n(h);t=new Set([...u].filter(h=>h.hasAttribute(Bd)))},release(){for(const a of t)r(a);t=new Set}}}const gh=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom}),Yo=e=>e.right-e.left,oo=e=>e.bottom-e.top;function DN(e,t){return{left:Math.min(e.left,t.left),top:Math.min(e.top,t.top),right:Math.max(e.right,t.right),bottom:Math.max(e.bottom,t.bottom)}}function Ud(e,t){return{left:e.left-t,top:e.top-t,right:e.right+t,bottom:e.bottom+t}}function ak(e,t=0,n=4,r=14,a=0,i=0,c=0){if(e>=4)return e+n;const u=i===0||a===0||a<=i+16;return t>=4&&u&&c<=1?t+n:r}function HN(e,t){return e.left<t.right&&t.left<e.right&&e.top<t.bottom&&t.top<e.bottom}function ok(e,t){let n=e;for(const r of t)n={left:Math.max(n.left,r.left),top:Math.max(n.top,r.top),right:Math.min(n.right,r.right),bottom:Math.min(n.bottom,r.bottom)};return Yo(n)>0&&oo(n)>0?n:null}function ik(e,t){let{top:n,bottom:r}=e;const a=(e.top+e.bottom)/2;for(const i of t)HN(i,e)&&(i.bottom<=a?n=Math.max(n,i.bottom):r=Math.min(r,i.top));return r>n?{...e,top:n,bottom:r}:null}const yQ=e=>e==="top"||e==="bottom";function bQ(e,t,n){return t?yQ(n)?{left:e.left,right:e.right,top:t.top,bottom:t.bottom}:{left:t.left,right:t.right,top:e.top,bottom:e.bottom}:e}const lk=e=>e==="top"?"bottom":e==="bottom"?"top":e==="left"?"right":"left",xs=e=>Math.round(e*2)/2;function xQ(e,t,n){const r=xs(t),a=xs(n),i=e.map(u=>{const f=Math.max(0,xs(Yo(u))),h=Math.max(0,xs(oo(u))),p=xs(Math.max(0,Math.min(u.radius,f/2,h/2)));return`<rect x='${xs(u.left)}' y='${xs(u.top)}' width='${f}' height='${h}' rx='${p}' fill='black'/>`}).join(""),c=`<svg xmlns='http://www.w3.org/2000/svg' width='${r}' height='${a}'><defs><mask id='m' maskUnits='userSpaceOnUse' x='0' y='0' width='${r}' height='${a}'><rect width='${r}' height='${a}' fill='white'/>${i}</mask></defs><rect width='${r}' height='${a}' fill='black' mask='url(#m)'/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(c)}")`}function kQ(e,t,n,r){const a=xs(t),i=xs(n),c=e.map(p=>{const m=Math.max(0,xs(Yo(p))),v=Math.max(0,xs(oo(p))),w=xs(Math.max(0,Math.min(p.radius,m/2,v/2)));return{x:xs(p.left),y:xs(p.top),ww:m,hh:v,k:w}}),u=c.map(p=>`<rect x='${p.x}' y='${p.y}' width='${p.ww}' height='${p.hh}' rx='${p.k}' fill='black'/>`),f=c.map(p=>`<rect x='${p.x}' y='${p.y}' width='${p.ww}' height='${p.hh}' rx='${p.k}' fill='none' stroke='${r}' stroke-width='2'/>`),h=`<svg xmlns='http://www.w3.org/2000/svg' width='${a}' height='${i}'><defs><mask id='o' maskUnits='userSpaceOnUse' x='0' y='0' width='${a}' height='${i}'><rect width='${a}' height='${i}' fill='white'/>${u.join("")}</mask></defs><g mask='url(#o)'>${f.join("")}</g></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(h)}")`}function SQ(e,t,n){const r={left:Math.max(0,e.left),top:Math.max(0,e.top),right:Math.min(t,e.right),bottom:Math.min(n,e.bottom)};return[{left:0,top:0,right:t,bottom:r.top},{left:0,top:r.bottom,right:t,bottom:n},{left:0,top:r.top,right:r.left,bottom:r.bottom},{left:r.right,top:r.top,right:t,bottom:r.bottom}].filter(a=>Yo(a)>0&&oo(a)>0)}const ck=0,EQ=10,zg=14,Wd=4,Bg="data-guide-stage",CQ="rgba(255,255,255,0.05)",T6="[data-guide-shape]",uk=[],jQ="[data-radix-popper-content-wrapper], .sc-setpop, .sc-morepop, .sc-shotsheet, .sc-note-pop",dk='input, textarea, [contenteditable]:not([contenteditable="false"])',AQ=17,G1=12,NQ=20,MQ=450,RQ=768,fk=90,PQ=8,hk=12,LQ=2e3,TQ=".sc-topbar, .sc-tabbar, .sc-filterbar, .sc-canvas-dock, .sc-help-float, .sc-pstudio-head, .sc-newdlg-head",$Q=120,DQ="[aria-live], .sc-toasts, .sc-upd-float, .sc-upd-overlay, [data-radix-popper-content-wrapper], .sc-chip-preview, .sc-swap, .sc-shotsheet, .sc-shotsheet-scrim, .sc-cmd",Ug=e=>({id:e.id,title:e.title,body:e.body,canBack:e.canBack,action:e.action,count:e.at&&e.of?`${e.at} of ${e.of}`:void 0});function HQ(e){const{id:t,voice:n,target:r,live:a,side:i,container:c,onShown:u}=e,f=e.lit??uk,h=e.also??uk,p=n==="ask",m=!r,v=!!(e.title||e.body),w=s.useId(),y=s.useId(),b=s.useRef(null),k=s.useRef(null),S=s.useRef(null),C=s.useRef(null),j=s.useRef(null),N=s.useRef(null),P=s.useRef(null),$=s.useRef(null),R=s.useRef(null),E=s.useRef(null),[M,L]=s.useState("moving"),[H]=s.useState(VQ),[D,K]=s.useState(()=>Ug(e)),O=s.useRef(e);O.current=e;const _=s.useRef(!1),re=s.useRef(null),z=s.useRef([]),F=M==="shown"&&D.id===t?Ug(e):D,Q=Wg(a),V=Wg(h),I=Wg(f);s.useEffect(()=>{if(p)return E.current=wQ(c),()=>{var Y;(Y=E.current)==null||Y.release(),E.current=null;for(const ae of z.current)ae.removeAttribute(Bg);z.current=[]}},[p,c]),s.useLayoutEffect(()=>{var cn,Fe,mt;const Y=b.current,ae=k.current,X=S.current,le=C.current,ke=j.current,te=N.current;if(p&&(!X||!le||!ke||!te)||v&&(!Y||!ae))return;let be=!0,G=0,J=0,ne=!1,W=!1,he="",Xe=0,tt=0,ze=0,nt=null,ce=null,ve=null;const Pe=window.matchMedia("(prefers-reduced-motion: reduce)").matches,ue=a[0]??r??c;let Ee="",Ke=r?Y1(r):null;L("moving");const ye=()=>{var it;return(it=E.current)==null?void 0:it.set([...Y?[Y]:[],...X?[X]:[],...le?[le]:[],...ke?[ke]:[],...te?[te]:[],...a,...h,...[...document.querySelectorAll(DQ)].filter(St=>![...a,...h].some(xt=>St.contains(xt)))])},Se=()=>{var it,St;(it=E.current)==null||it.release(),W=!1,L("away"),(St=r??a[0])!=null&&St.isConnected&&Re()};if(p&&E.current&&_.current){ye(),W=!0;const it=a.find(xt=>xt.matches(dk)),St=document.activeElement;it&&!a.some(xt=>xt.contains(St))&&pk(it)}const Ie=async()=>{const it=++G;if(r&&!r.isConnected||a.some(se=>!se.isConnected))return Se(),O.current.onLost();const St=window.innerWidth,xt=window.innerHeight,Nt=window.visualViewport,Kt=[{left:0,top:0,right:St,bottom:xt},...Nt?[{left:Nt.offsetLeft,top:Nt.offsetTop,right:Nt.offsetLeft+Nt.width,bottom:Nt.offsetTop+Nt.height}]:[]],et=se=>{const oe=se===r?Ke:Y1(se);return oe?[...Kt,gh(oe.getBoundingClientRect())]:Kt},gt=OQ(ue,c),ot=gt.filter(se=>Yo(se)>St/3),kn=r?ok(gh(r.getBoundingClientRect()),et(r)):null,dt=kn&&ik(kn,ot);if(r&&!dt)return!ne&&ze<hk&&(ze++,Ke=Y1(r),Kg(r,Ke,Pe).then(()=>be&&Ze())),Se();const Gt=[],Ft=[];for(const se of[...r?[r]:[],...a,...h,...f,...mk()]){const oe=gk(se);Ft.includes(oe)||Ft.push(oe)}const en=new Set([...r?[r]:[],...a,...f,...mk()].map(gk));let Jt=null;for(const se of Ft){const oe=ok(gh(se.getBoundingClientRect()),et(se)),we=oe&&ik(oe,ot);if(!we)continue;const ge=vh(se);Gt.push(ge>=4||se.matches("img, video, canvas")?{...Ud(we,ck),radius:ge+ck}:{...Ud(we,EQ),radius:zg}),en.has(se)&&(Jt=Jt?DN(Jt,we):we)}if(!m&&!dt&&!Jt)return Se();if(W&&(a.some(se=>se.closest("[inert]"))||Y!=null&&Y.closest("[inert]"))&&(W=!1),p&&X&&le&&ke&&te){if(!Gt.length&&dt){const we=r,ge=vk(we);Gt.push({...Ud(dt,Wd),radius:ak(vh(we),ge.radius,Wd,zg,oo(dt),ge.height,ge.count)})}for(const we of z.current)Ft.includes(we)||we.removeAttribute(Bg);for(const we of Ft)we.setAttribute(Bg,"");z.current=Ft;const oe=`${Gt.map(we=>[we.left,we.top,we.right,we.bottom,we.radius].map(Math.round).join(",")).join("|")}@${St}x${xt}`;if(oe!==Ee&&(Ee=oe,ZQ(X,le,te,Gt,H)),r&&dt){const we=WQ(r),ge=vk(r),ee=we??Ud(dt,Wd);Object.assign(ke.style,{left:`${ee.left}px`,top:`${ee.top}px`,width:`${Yo(ee)}px`,height:`${oo(ee)}px`,borderRadius:`${we?UQ:ak(vh(r),ge.radius,Wd,zg,oo(dt),ge.height,ge.count)}px`}),ke.hidden=!1}else ke.hidden=!0}if(Y&&document.documentElement.style.setProperty("--sc-coach-h",`${Math.round(Y.offsetHeight)}px`),Y&&m&&(Y.style.right="",Y.style.left=`${Math.round((St-Y.offsetWidth)/2)}px`,Y.style.top=`${Math.round((xt-Y.offsetHeight)/2)}px`,Y.dataset.side="centre",ae&&(ae.hidden=!0)),Y&&ae&&r&&dt){Y.style.right="";const se={top:G1+IQ(gt,xt),bottom:G1+FQ(gt,xt),left:G1,right:G1},oe=St>=RQ;ce!==oe&&(ce!==null&&r&&(Ke=Y1(r),Kg(r,Ke,Pe)),nt=null,ce=oe);const we=i==="left"||i==="right"?"top":i,ge=!oe&&Yo(dt)>St*.6,ee=oe?i:ge?`${we}-start`:we,He=(jt,st)=>sE(_Q(jt,r),Y,{strategy:"fixed",placement:nt??ee,middleware:[tE(AQ),rE({padding:se,fallbackPlacements:st}),nE({padding:se}),U8({element:ae,padding:NQ})]}),We=!oe&&Jt?{...dt,top:Jt.top,bottom:Jt.bottom}:dt,Ue=(jt,st)=>HN({left:jt,top:st,right:jt+Y.offsetWidth,bottom:st+Y.offsetHeight},Ud(We,Wd)),_e=oe&&(i==="left"||i==="right")?[lk(i),"top","bottom"]:oe?void 0:ge?["bottom-start","top-start"]:["bottom","top"],U=!p&&oo(dt)>xt*.6,pe=oe&&(e.beside||a.length>1),Oe=U?{...dt,top:dt.bottom-1}:pe?bQ(dt,Jt,i):We;let Le=await He(Oe,U?["top"]:_e);if(!be||it!==G||!U&&Ue(Le.x,Le.y)&&(Le=await He(We,void 0),!be||it!==G))return;if(!U&&Ue(Le.x,Le.y))return L("stowed");nt=Le.placement;const bt=Le.placement.split("-")[0];Y.style.left=`${Math.round(Le.x)}px`,Y.style.top=`${Math.round(Le.y)}px`,Y.dataset.side=bt;const vt=Le.middlewareData.arrow;ae.dataset.edge=lk(bt),ae.style.left=(vt==null?void 0:vt.x)!=null?`${vt.x}px`:"",ae.style.top=(vt==null?void 0:vt.y)!=null?`${vt.y}px`:"",ae.hidden=!vt||Math.abs(vt.centerOffset)>1}if(p&&!W&&(ye(),W=!0),!ne){if(KQ([...r?[r]:[],...a])&&++tt<hk){window.setTimeout(Ze,fk);return}const se=[...r?[r]:[],...a,...h,...f].map(oe=>{const we=oe.getBoundingClientRect();return[we.left,we.top,we.right,we.bottom].map(Math.round).join(",")}).join("|");if(se!==he&&(he=se,Xe=0),++Xe<2&&Xe<PQ){window.setTimeout(Ze,fk);return}}L("shown"),ne||(ne=!0,Qe(),Re())};let Be=0;const Re=()=>{const it=r??a[0];if(!it)return;cancelAnimationFrame(Be);let St=it.getBoundingClientRect();const xt=performance.now()+LQ,Nt=()=>{if(!be)return;const Kt=it.getBoundingClientRect();(Kt.top!==St.top||Kt.left!==St.left||Kt.height!==St.height)&&(St=Kt,Ze()),performance.now()<xt&&(Be=requestAnimationFrame(Nt))};Be=requestAnimationFrame(Nt)},Ze=()=>{cancelAnimationFrame(J),J=requestAnimationFrame(()=>void Ie())},Qe=()=>{_.current=!0;let it=!1;if(p&&Y){const St=Kt=>!!Kt&&a.some(et=>et.contains(Kt)),xt=document.activeElement,Nt=a.find(Kt=>Kt.matches(dk))??null;R.current&&St(xt)?R.current=null:R.current?(((R.current==="back"?P.current:null)??$.current??Y).focus({preventScroll:!0}),R.current=null):Nt&&!St(xt)?pk(Nt):(!xt||xt===document.body||xt.closest("[inert]"))&&(Y.focus({preventScroll:!0}),it=!0)}u(t,it)},lt=_.current&&!Pe&&v&&re.current!==t?$Q:0;re.current=t,zQ(lt).then(()=>{if(be)return Rr.flushSync(()=>K(Ug(O.current))),r?Kg(r,Ke,Pe):void 0}).then(()=>{be&&(ve=eE(ue,Y??X??ue,Ze))});const Lt=new ResizeObserver(Ze);for(const it of a)Lt.observe(it);r&&Lt.observe(r),Y&&Lt.observe(Y);for(const it of[...r?[r]:[],...a]){const St=(cn=it==null?void 0:it.closest)==null?void 0:cn.call(it,T6);St&&Lt.observe(St)}(Fe=window.visualViewport)==null||Fe.addEventListener("resize",Ze),(mt=window.visualViewport)==null||mt.addEventListener("scroll",Ze);let Ut=0;const Ct=p?new MutationObserver(()=>{W&&(cancelAnimationFrame(Ut),Ut=requestAnimationFrame(ye))}):null;return Ct==null||Ct.observe(c,{childList:!0,subtree:!0}),()=>{var it,St;be=!1,document.documentElement.style.removeProperty("--sc-coach-h"),cancelAnimationFrame(J),cancelAnimationFrame(Be),cancelAnimationFrame(Ut),Ct==null||Ct.disconnect(),ve==null||ve(),Lt.disconnect(),(it=window.visualViewport)==null||it.removeEventListener("resize",Ze),(St=window.visualViewport)==null||St.removeEventListener("scroll",Ze)}},[t,p,v,r,Q,V,I,i,c,u,H]),s.useEffect(()=>{if(!v||!r||!BQ(r))return;const Y=(r.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);if(!Y.includes(y))return r.setAttribute("aria-describedby",[...Y,y].join(" ")),()=>{const ae=(r.getAttribute("aria-describedby")??"").split(/\s+/).filter(X=>X&&X!==y);ae.length?r.setAttribute("aria-describedby",ae.join(" ")):r.removeAttribute("aria-describedby")}},[v,r,y]);const{onEscape:B}=e;return s.useEffect(()=>{if(!p)return;const Y=be=>!!be&&a.some(G=>G.contains(be)),ae=be=>{var he;const G=b.current,J=be.target instanceof Node?be.target:null,ne=Y(J),W=document.activeElement;if(be.key==="Escape"){if(be.defaultPrevented||W!=null&&W.closest('[role="dialog"]:not(.sc-coach):not(.sc-attachpanel)')||ne&&(W!=null&&W.closest('input, textarea, select, [contenteditable="true"], [role="menu"], [role="listbox"]')))return;be.preventDefault(),be.stopPropagation(),B(t);return}ne||(!J||J===document.body||J===document.documentElement||G!=null&&G.contains(J)||(he=C.current)!=null&&he.contains(J))&&be.stopPropagation()};let X=0,le=!1;const ke=be=>{le=be.target instanceof Node&&Y(be.target)},te=be=>{be.relatedTarget||le||!b.current||(cancelAnimationFrame(X),X=requestAnimationFrame(()=>{var J;if(!document.hasFocus())return;const G=document.activeElement;(!G||G===document.body||G.closest("[inert]"))&&((J=b.current)==null||J.focus({preventScroll:!0}))}))};return window.addEventListener("keydown",ae,!0),window.addEventListener("pointerdown",ke,!0),document.addEventListener("focusout",te,!0),()=>{cancelAnimationFrame(X),window.removeEventListener("keydown",ae,!0),window.removeEventListener("pointerdown",ke,!0),document.removeEventListener("focusout",te,!0)}},[t,p,Q,B]),Rr.createPortal(o.jsxs(o.Fragment,{children:[p&&o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:S,className:"sc-coach-veil","data-veil":H?"mask":"panels","data-soft":e.soft||void 0,"data-state":M,"aria-hidden":"true",children:yk.map(Y=>o.jsx("div",{className:"sc-coach-panel"},Y))}),o.jsx("div",{ref:C,className:"sc-coach-catch","data-guide":"catch","data-state":M,"aria-hidden":"true",onMouseDown:Y=>Y.preventDefault(),children:yk.map(Y=>o.jsx("div",{className:"sc-coach-catch-part"},Y))}),o.jsx("div",{ref:N,className:"sc-coach-rim","data-state":M,"aria-hidden":"true"}),o.jsx("div",{ref:j,className:"sc-coach-ring","data-state":M,"aria-hidden":"true",hidden:!0})]}),v&&o.jsxs("div",{ref:b,className:"sc-coach","data-guide":"card","data-voice":p?"coach":"card","data-beside":e.beside||void 0,...p?{role:"dialog","aria-labelledby":F.title?w:void 0}:{role:"note"},"aria-describedby":y,tabIndex:-1,"data-state":M,children:[o.jsx("div",{ref:k,className:"sc-coach-arrow","aria-hidden":"true",hidden:!0}),o.jsxs("div",{className:"sc-coach-head",children:[F.title?o.jsx("h2",{id:w,className:"sc-coach-title",children:F.title}):o.jsx("p",{id:y,className:"sc-coach-body","data-lead":"",children:F.body}),F.count&&o.jsxs("p",{className:"sc-coach-count",children:[o.jsx("span",{className:"sc-vh",children:"Step "}),F.count]}),o.jsx(or,{label:e.closeLabel,children:o.jsx("button",{type:"button",className:"sc-coach-x","aria-label":e.closeLabel,onClick:()=>e.onClose(t),children:o.jsx(jn,{size:16})})})]}),F.title&&F.body&&o.jsx("p",{id:y,className:"sc-coach-body",children:F.body}),(F.canBack||F.action)&&o.jsxs("div",{className:"sc-coach-foot",children:[F.canBack&&o.jsx("button",{ref:P,type:"button",className:"sc-coach-back",onClick:()=>{R.current="back",e.onBack(t)},children:"Back"}),F.action&&o.jsx("button",{ref:$,type:"button",className:"sc-btn sc-btn-primary sc-coach-next",onClick:()=>{R.current="action",e.onAction(t)},children:F.action.label})]})]})]}),c)}function pk(e){var t,n;if(e.focus({preventScroll:!0}),!e.isContentEditable){const r=e,a=((t=r.value)==null?void 0:t.length)??0;(n=r.setSelectionRange)==null||n.call(r,a,a);return}Il(e)}function mk(){return[...document.querySelectorAll(jQ)].filter(e=>e.getClientRects().length>0)}function Wg(e){const t=s.useRef(e);return(t.current.length!==e.length||t.current.some((n,r)=>n!==e[r]))&&(t.current=e),t.current}function OQ(e,t){const n=[];for(const r of document.querySelectorAll(TQ))t.contains(r)&&(r.contains(e)||e.contains(r)||r.getClientRects().length===0||n.push(gh(r.getBoundingClientRect())));return n}function IQ(e,t){return Math.max(0,...e.filter(n=>n.top<=0&&n.bottom<t/3).map(n=>n.bottom))}function FQ(e,t){return Math.max(0,...e.filter(n=>n.bottom>=t&&n.top>t*2/3).map(n=>t-n.top))}function _Q(e,t){const n={x:e.left,y:e.top,left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:Yo(e),height:oo(e)};return{getBoundingClientRect:()=>n,contextElement:t}}function ZQ(e,t,n,r,a){const i=window.innerWidth,c=window.innerHeight,u=r.reduce((h,p)=>h?DN(h,p):p,null),f=u?SQ(u,i,c):[];if(a){const h=xQ(r,i,c),p=e.style;p.maskImage=h,p.webkitMaskImage=h,n.style.backgroundImage=kQ(r,i,c,CQ)}else wk(e,f);wk(t,f)}function vh(e){return Number.parseFloat(getComputedStyle(e).borderTopLeftRadius)||0}function gk(e){return e.closest(T6)??e.querySelector(T6)??e}function vk(e){let t=0,n=0,r=0;for(const a of e.querySelectorAll("button, a[href], .sc-chip, .sc-btn"))a.getClientRects().length&&(r+=1,t=Math.max(t,vh(a)),n=Math.max(n,a.getBoundingClientRect().height));return{radius:t,height:n,count:r}}function wk(e,t){Array.from(e.children).forEach((n,r)=>{const a=t[r],i=n.style;if(!a){i.display="none";return}Object.assign(i,{display:"block",left:`${a.left}px`,top:`${a.top}px`,width:`${Yo(a)}px`,height:`${oo(a)}px`})})}const yk=[0,1,2,3];function VQ(){return typeof CSS>"u"?!1:CSS.supports("mask-image",'url("x.svg")')||CSS.supports("-webkit-mask-image",'url("x.svg")')}function Y1(e){for(let t=e.parentElement;t&&t!==document.body;t=t.parentElement){const n=getComputedStyle(t).overflowY;if((n==="auto"||n==="scroll")&&t.scrollHeight>t.clientHeight)return t}return null}function Kg(e,t,n){if(!t)return Promise.resolve();const r=e.getBoundingClientRect(),a=t.getBoundingClientRect();if(Math.max(0,Math.min(r.bottom,a.bottom,window.innerHeight)-Math.max(r.top,a.top,0))>=Math.min(120,r.height*.4))return Promise.resolve();const u=r.height>a.height*.8?r.top-a.top-16:(r.top+r.bottom)/2-(a.top+a.bottom)/2;return t.scrollBy({top:u,behavior:n?"auto":"smooth"}),n?Promise.resolve():new Promise(f=>{let h=!1;const p=()=>{h||(h=!0,t.removeEventListener("scrollend",p),f())};t.addEventListener("scrollend",p),window.setTimeout(p,MQ)})}function zQ(e){return e>0?new Promise(t=>window.setTimeout(t,e)):Promise.resolve()}function BQ(e){return e.matches('button, a[href], input, select, textarea, [tabindex], [contenteditable="true"]')}const UQ=10;function WQ(e){if(!e.matches("a[href], button")||e.getBoundingClientRect().height<=48)return null;const t=document.createRange();t.selectNodeContents(e);const n=t.getBoundingClientRect();return n.width?{left:n.left-12,top:n.top-7,right:n.right+12,bottom:n.bottom+7}:null}function KQ(e){return document.getAnimations().some(t=>{var r,a;const n=(r=t.effect)==null?void 0:r.target;return!(n instanceof Element)||t.playState!=="running"||((a=t.effect)==null?void 0:a.getTiming().iterations)===Number.POSITIVE_INFINITY?!1:e.some(i=>n.contains(i))})}const er=e=>e.kind==="question"?`q:${e.question.id}`:`${e.kind}:${e.id}`,Nf=320,Zv=180,GQ=28,YQ=700;function im(e){const t=e.split(/(\s+)/).filter(a=>a.length>0),n=t.filter(a=>!/^\s+$/.test(a)).length,r=Math.min(GQ,Math.floor(YQ/Math.max(1,n)));return{words:t,step:r,total:Nf+Zv+r*n+160}}function Gg(e,t){return e.every(n=>!!t[n.id])}function qQ(e,t,n={}){const r=e.trim().toLowerCase();if(!r||r.split(/\s+/).length>6)return null;for(const i of t){const c=i.label.toLowerCase();if(r===c||r===i.id.toLowerCase())return i.id}for(const i of t){const c=n[i.id];if(c!=null&&c.test(r))return i.id}return null}function XQ(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}const QQ=/^(hi|hello|hey|heya|hiya|yo|hola|shalom|sup|good (morning|afternoon|evening)|thanks|thank you|thx|cheers)\b/i,JQ=/^(ok|okay|k|kk|sure|fine|yes|yeah|yep|yup|no|nope|nah|cool|nice|great|alright|right|hmm+|hm+|uh+|um+|oh|ah|wow|haha+|hehe+|lol|lmao|omg|meh|really|seriously|interesting|whatever)[\s!.,?]*$/i,eJ=/^(how|what|what's|whats|who|who's|whos|why|where|when|which|can|could|do|does|did|are|is|will|would|should|may|have|has|am|isn't|aren't|don't|doesn't)\b/i,tJ=/^(start over|start again|restart|reset|cancel|stop|quit|exit|go back|back|undo|never ?mind|forget it|close)\b/i,nJ=/^(skip|next|continue|go|go on|proceed|generate|draw|render|build|show me|show|try|do it|let'?s go|begin|start)\b/i,bk=/^(help|help me|how does this work|what do i do|what should i (write|say|type)|instructions|\?+)[\s!.,?]*$/i,rJ=/\b(presenters?|avatars?|characters?|Scenri|create|creating|generate|generating|images?|pictures?|shoot|campaign|brand|product)\b/i,sJ=/^(test|testing|blah|lorem|ipsum|foo|bar|baz|dummy|sample|placeholder|xxx+|abc|asdf\w*|qwer\w*|zxcv\w*|hjkl|jkl|sdfg?|dfgh?|fghj?|bull\w*|shit\w*|crap|fuck\w*|damn|wtf|stfu|bs|rofl|lol+|lmao+|haha\w*|hehe\w*|meh|idk|nvm)$/i,aJ=/^[b-df-hj-np-tv-xz]{3,}$/i,oJ=/(.)\1{3,}/,iJ=/\b(like|as|resembling|resembles|similar to|looks? like|looking like)\s+([A-Z][a-z]+)(?:\s+[A-Z][a-z]+)*\b/,lJ=/^(mediterranean|asian|east|south|southeast|indian|chinese|japanese|korean|african|black|white|nordic|scandinavian|latin|latina|latino|hispanic|arab|arabic|middle|eastern|european|caucasian|israeli|jewish|irish|italian|french|spanish|greek|turkish|persian|brazilian|mexican|american|british|german|dutch|russian|polish|thai|vietnamese|filipino|filipina|nigerian|ethiopian|moroccan|egyptian|australian|canadian|swedish|norwegian|danish|finnish|portuguese|indonesian|pakistani|iranian|lebanese|slavic|celtic|west|north|central)$/i;function Zo(e,t){const n=e.trim();if(!n)return null;const r=iJ.exec(n);if(r&&!lJ.test(r[2]))return"likeness";if(t(n))return null;if(!new RegExp("\\p{L}","u").test(n))return bk.test(n)?"help":"nonsense";const a=n.split(/\s+/).filter(Boolean),i=a.length;if(bk.test(n))return"help";if(QQ.test(n)&&i<=4)return"greeting";if(JQ.test(n))return"ack";const c=u=>u.replace(/[^a-z]/gi,"");return i<=8&&a.some(u=>sJ.test(c(u))||aJ.test(c(u))||oJ.test(c(u)||u))?"nonsense":eJ.test(n)||/\?\s*$/.test(n)?"question":tJ.test(n)&&i<=4?"nav":rJ.test(n)&&i<=10?"intent":nJ.test(n)&&i<=4?"go":i===1&&/^[A-Z][a-z]+$/.test(n)?null:i<=2?"vague":null}const cJ=e=>`aside-said-${e}`,xk=e=>e.startsWith("aside-said-")?e.slice(11):null,ri=(e,t=!1,n=!1)=>[...n?[]:[{kind:"you",id:cJ(e.at),text:e.said,editable:!0,editing:t||void 0}],{kind:"scenri",id:`aside-reply-${e.at}${e.rev?`-${e.rev}`:""}`,text:e.reply}],Gh=e=>(e.kind==="you"||e.kind==="scenri")&&e.id.startsWith("aside-");function ON(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="question")return n.question.id;if(!Gh(n))return null}return null}const Yh=()=>new Date().toISOString();function uJ({options:e,picked:t,onPick:n}){return o.jsx("div",{className:"sc-convo-grid",children:e.map(r=>o.jsxs("button",{type:"button",className:"sc-convo-plate","aria-label":r.label,"aria-pressed":t===r.id,"data-on":t===r.id||void 0,onClick:()=>n(r.id),children:[o.jsx("span",{className:"sc-convo-plate-in","data-card":r.card}),o.jsx("span",{className:"sc-convo-plate-lb",children:r.label})]},r.id))})}function dJ({step:e,children:t}){const n=s.useRef(null),[r,a]=s.useState({back:!1,on:!0}),i=s.useCallback(()=>{const h=n.current;if(!h)return;const p=h.scrollWidth-h.clientWidth;a({back:h.scrollLeft>2,on:h.scrollLeft<p-2})},[]);s.useEffect(()=>{const h=n.current;if(!h)return;i(),h.addEventListener("scroll",i,{passive:!0});const p=new ResizeObserver(i);return p.observe(h),()=>{h.removeEventListener("scroll",i),p.disconnect()}},[i]);const c=h=>{const p=n.current;if(!p)return;const m=p.firstElementChild,v=Number.parseFloat(getComputedStyle(p).columnGap)||0,w=m?m.offsetWidth+v:e,y=!window.matchMedia("(prefers-reduced-motion: reduce)").matches;p.scrollBy({left:h*w,behavior:y?"smooth":"auto"})},u=r.back&&r.on?"both":r.back?"back":r.on?"on":void 0,f=r.back||r.on;return o.jsxs("div",{className:"sc-convo-strip","data-fade":u,children:[f&&o.jsx(kk,{dir:-1,live:r.back,onGo:c}),o.jsx("div",{className:"sc-convo-plates",ref:n,children:t}),f&&o.jsx(kk,{dir:1,live:r.on,onGo:c})]})}function kk({dir:e,live:t,onGo:n}){const r=e<0;return o.jsx("button",{type:"button",className:"sc-convo-strip-go","data-dir":r?"back":"on","data-spent":!t||void 0,"aria-label":r?"Show earlier":"Show more","aria-disabled":!t||void 0,tabIndex:-1,onClick:a=>{a.currentTarget.blur(),t&&n(e)},children:r?o.jsx(ga,{size:14,weight:"bold"}):o.jsx(il,{size:14,weight:"bold"})})}const fJ=106;function Sk({options:e,picked:t,onPick:n}){return o.jsx(dJ,{step:fJ,children:e.map(r=>o.jsxs("button",{type:"button",className:"sc-convo-plate","aria-label":r.label,"aria-pressed":t===r.id,"data-on":t===r.id||void 0,onClick:()=>n(r.id),children:[o.jsx("span",{className:"sc-convo-plate-in","data-card":r.card}),o.jsx("span",{className:"sc-convo-plate-lb",children:r.label})]},r.id))})}const IN=6e4,hJ=60*IN,Yg=e=>e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),pJ=e=>e.toLocaleDateString([],{day:"numeric",month:"short"});function mJ(e,t){const n=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),r=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return Math.round((r-n)/864e5)}function gJ(e,t=Date.now()){const n=Math.max(0,t-e);if(n<45e3)return"just now";if(n<hJ)return`${Math.max(1,Math.round(n/IN))} min ago`;const r=new Date(e),a=mJ(r,new Date(t));return a===0?Yg(r):a===1?`Yesterday ${Yg(r)}`:`${pJ(r)} ${Yg(r)}`}const vJ=e=>new Date(e).toLocaleString([],{dateStyle:"medium",timeStyle:"short"});function wJ({text:e,tone:t,at:n,now:r,reveal:a,eyebrow:i=!0,delay:c=0,leave:u,turnId:f,dim:h,thumb:p,label:m,view:v,current:w,restore:y,onRestore:b,retry:k,onRetry:S,onShow:C}){const[j]=s.useState(c),N=zv(u,j),{playing:P,thinking:$}=zN(a,e,j,N==="true");return o.jsxs("div",{className:"sc-convo-turn","data-guide-shape":"","data-who":"scenri","data-arrive":P||void 0,"data-leave":N,"data-turn":f,"data-dim":h||void 0,style:P?{...FN(j),"--sc-convo-after":`${im(e).total}ms`}:void 0,children:[i&&o.jsx(Vv,{thinking:$,at:n,now:r}),o.jsxs("p",{className:"sc-convo-say","data-tone":t,"data-reveal":P||void 0,children:[$&&o.jsx(ZN,{}),o.jsx(VN,{text:e,playing:P})]}),p&&o.jsxs("span",{className:"sc-convo-shot","data-reveal":P||void 0,"data-current":w||void 0,children:[v&&C?o.jsx("button",{type:"button",className:"sc-convo-shot-pick","aria-label":m?`Show ${m} on the stage`:"Show this on the stage",onClick:()=>C(v),children:o.jsx(Ek,{thumb:p,label:m,current:w})}):o.jsx(Ek,{thumb:p,label:m,current:w}),y&&b?o.jsx("button",{type:"button",className:"sc-convo-shot-do sc-convo-restore",onClick:()=>b(y.view,y.hash),children:"Put back"}):k&&S?o.jsx("button",{type:"button",className:"sc-convo-shot-do sc-convo-restore",onClick:()=>S(k),children:"Try again"}):w&&o.jsx("span",{className:"sc-convo-shot-do",children:"Active"})]})]})}const FN=e=>({"--sc-convo-start":`${e}ms`,"--sc-convo-think":`${Nf}ms`});function Vv({thinking:e,at:t,now:n}){return o.jsxs("span",{className:"sc-convo-who","data-thinking":e||void 0,children:[o.jsx(wY,{className:"sc-convo-mark"}),"Scenri",t?o.jsx(_N,{at:t,now:n}):null]})}function _N({at:e,now:t}){return o.jsx("time",{className:"sc-convo-time",dateTime:new Date(e).toISOString(),title:vJ(e),children:gJ(e,t)})}function yJ({what:e="Thinking"}){return o.jsxs("div",{className:"sc-convo-turn","data-who":"scenri","data-working":"true",children:[o.jsx(Vv,{thinking:!0}),o.jsx("p",{className:"sc-convo-say",role:"status",children:o.jsxs("span",{className:"sc-convo-work",children:[e,o.jsx(bJ,{})]})})]})}function bJ(){return o.jsxs("span",{className:"sc-convo-ell","aria-hidden":"true",children:[o.jsx("i",{children:"."}),o.jsx("i",{children:"."}),o.jsx("i",{children:"."})]})}function ZN(){return o.jsxs("span",{className:"sc-convo-dots","aria-hidden":"true",children:[o.jsx("i",{}),o.jsx("i",{}),o.jsx("i",{})]})}function VN({text:e,playing:t}){if(!t)return o.jsx(o.Fragment,{children:e});const{words:n,step:r}=im(e);let a=0,i=0;return o.jsx(o.Fragment,{children:n.map(c=>{const u=i;if(i+=c.length,/^\s+$/.test(c))return c;const f=a++;return o.jsx("span",{className:"sc-convo-w",style:{"--sc-convo-word-delay":`${f*r}ms`},children:c},`${u}:${c}`)})})}function zN(e,t,n=0,r=!1){const[a,i]=s.useState(!!e),[c,u]=s.useState(!!e),f=s.useRef(!!e);return s.useEffect(()=>{e&&!f.current&&(i(!0),u(!0)),f.current=!!e},[e]),s.useEffect(()=>{if(!a)return;const h=setTimeout(()=>{u(!1),i(!1)},n+im(t).total),p=setTimeout(()=>u(!1),n+Nf);return()=>{clearTimeout(h),clearTimeout(p)}},[a,t,n]),{playing:a&&!r,thinking:a&&c&&!r}}function zv(e,t,n=Nf+Zv){const r=s.useRef(performance.now());if(e)return performance.now()-r.current<t+n?"early":"true"}function Ek({thumb:e,label:t,current:n}){return o.jsx("img",{src:dn(e,"micro"),srcSet:`${dn(e,"micro")} 160w, ${dn(e,"small")} 320w, ${dn(e,"tile")} 640w`,sizes:"(max-width: 767px) 248px, 128px",alt:n&&t?`${t}, active`:t??""})}const xJ=300,kJ=e=>typeof e=="string"?e:null,SJ=e=>Array.isArray(e)?e:[],EJ=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{};function CJ({question:e,reveal:t,busy:n,eyebrow:r=!0,delay:a=0,leave:i,spent:c,turnId:u,dim:f,at:h,now:p,onAnswer:m,onPick:v,onStarter:w,onDescribe:y,onAttachFiles:b,onCancel:k}){var te,be,G,J,ne;const[S]=s.useState(a),C=zv(i,S),{playing:j,thinking:N}=zN(t,e.prompt,S,C==="true"),P="given"in e?e.given:void 0,[$,R]=s.useState(()=>EJ(P)),[E,M]=s.useState(null),[L,H]=s.useState(()=>new Set(SJ(P))),D=!!c||!!n,K=s.useRef(!1);s.useEffect(()=>{K.current&&!D&&M(null),K.current=D},[D]);const O=(W,he)=>{E||(M(W),v==null||v(e.id,{picked:W,picks:$}),m(he))},_=E??kJ(P),re=s.useRef(null),z=s.useRef(null),F=s.useRef(()=>{});F.current=()=>{e.kind==="pick"&&e.more&&!e.loading&&m({kind:"pick",action:{type:"more"}})};const Q=e.kind==="pick"?e.items.length:0,V=e.kind==="pick"&&!!e.more;s.useEffect(()=>{const W=z.current,he=re.current;if(!W||!he||!V||typeof IntersectionObserver>"u")return;const Xe=new IntersectionObserver(tt=>tt.some(ze=>ze.isIntersecting)&&F.current(),{root:he,rootMargin:"0px 0px 240px 0px"});return Xe.observe(W),()=>Xe.disconnect()},[Q,V]);const I=Q>0;s.useLayoutEffect(()=>{const W=re.current;if(!W||!I||typeof ResizeObserver>"u")return;const he=()=>{const tt=W.querySelector(".sc-convo-plate");tt&&W.style.setProperty("--sc-pick-row",`${tt.getBoundingClientRect().height}px`)};he();const Xe=new ResizeObserver(he);return Xe.observe(W),()=>Xe.disconnect()},[I]);const B=e.kind==="pick"?(te=e.search)==null?void 0:te.value:void 0;s.useEffect(()=>{re.current&&(re.current.scrollTop=0)},[B]);const Y=im(e.prompt),ae=`sc-convo-q-${e.id}`,X=s.useRef(null),le=e.reopened&&k&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost sc-convo-cancel",onClick:k,children:"Cancel"}),ke="attach"in e&&e.attach&&b&&o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass",onClick:()=>{var W;return(W=X.current)==null?void 0:W.click()},children:[o.jsx(sW,{size:14,weight:"bold"}),e.attach]}),o.jsx("input",{ref:X,type:"file",accept:"image/*",hidden:!0,"aria-label":e.attach,onChange:W=>{const he=Array.from(W.target.files??[]).filter(Xe=>Xe.type.startsWith("image/"));W.target.value="",he.length&&b(he)}})]});return o.jsxs("div",{className:"sc-convo-turn","data-who":"scenri","data-arrive":j||void 0,"data-leave":C,"data-turn":u,"data-dim":f||void 0,"data-reopened":e.reopened||void 0,style:j?{...FN(S),"--sc-convo-after":`${Y.total}ms`}:void 0,children:[!e.reopened&&r&&o.jsx(Vv,{thinking:N,at:h,now:p}),!e.reopened&&o.jsxs("p",{className:"sc-convo-say",id:ae,"data-tone":e.tone,"data-reveal":j||void 0,children:[N&&o.jsx(ZN,{}),o.jsx(VN,{text:e.prompt,playing:j})]}),e.reopened&&o.jsx("span",{id:ae,hidden:!0,children:e.prompt}),!e.reopened&&e.hint&&o.jsx("p",{className:"sc-convo-hint","data-reveal":j||void 0,children:e.hint}),o.jsxs("fieldset",{className:"sc-convo-q","aria-labelledby":ae,hidden:e.kind==="text"&&!((be=e.starters)!=null&&be.length)&&!e.cost&&!e.note?!0:void 0,tabIndex:-1,"data-kind":e.kind,"data-reveal":j||void 0,"data-picked":!!E||void 0,disabled:n||void 0,children:[e.starters&&e.starters.length>0&&o.jsx("div",{className:"sc-convo-starters",children:e.starters.map(W=>o.jsx(or,{label:W.text,children:o.jsx("button",{type:"button",className:"sc-convo-starter",onClick:()=>w==null?void 0:w(W.text),children:W.label})},W.text))}),e.kind==="choice"&&((G=e.options)==null?void 0:G.some(W=>W.card))&&o.jsx(Sk,{options:e.options,picked:_,onPick:W=>O(W,{kind:"choice",id:W})}),e.kind==="choice"&&e.options&&!e.groups&&!e.options.some(W=>W.card)&&o.jsx("div",{className:"sc-convo-choices sc-convo-ask","data-guide-shape":"",children:e.options.map(W=>o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice","aria-pressed":e.multi?L.has(W.id):void 0,"data-on":(e.multi?L.has(W.id):_===W.id)||void 0,onClick:()=>e.multi?H(he=>{const Xe=new Set(he);return Xe.delete(W.id)||Xe.add(W.id),Xe}):O(W.id,{kind:"choice",id:W.id}),children:W.label},W.id))}),e.kind==="choice"&&(e.describe||e.attach||e.skip)&&o.jsxs("div",{className:"sc-convo-ways sc-convo-ask","data-guide-shape":"",children:[e.skip&&!e.multi&&!e.groups&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","data-on":E==="skip"||!E&&e.skipped||void 0,onClick:()=>O("skip",{kind:"skip"}),children:e.skip}),e.describe&&y&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","aria-pressed":e.saying===void 0?void 0:e.saying,"data-on":e.saying||void 0,onClick:y,children:e.describe}),ke,!e.multi&&le]}),e.kind==="choice"&&!e.groups&&!e.multi&&!e.describe&&!e.attach&&le&&o.jsx("div",{className:"sc-convo-ways sc-convo-ask","data-guide-shape":"",children:le}),e.kind==="choice"&&e.multi&&o.jsxs("div",{className:"sc-convo-decide sc-convo-ask","data-guide-shape":"",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","data-on":E==="submit"||void 0,onClick:()=>O("submit",{kind:"choices",picks:Object.fromEntries([...L].map(W=>[W,"on"]))}),children:e.submit??"Continue"}),e.skip&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","data-on":E==="skip"||!E&&e.skipped||void 0,onClick:()=>O("skip",{kind:"skip"}),children:e.skip}),le]}),e.kind==="choice"&&e.groups&&o.jsxs("div",{className:"sc-convo-groups",children:[e.groups.map(W=>o.jsxs("div",{className:"sc-convo-group",children:[o.jsx("span",{className:"sc-convo-group-lb",id:`sc-convo-g-${e.id}-${W.id}`,children:W.label}),o.jsx(Fo,{label:W.label,value:$[W.id]??"",ids:W.options.map(he=>he.id),onChange:he=>R(Xe=>({...Xe,[W.id]:he})),className:"sc-convo-choices",children:W.options.map(he=>o.jsx(_o,{id:he.id,on:$[W.id]===he.id,label:he.label,className:"sc-chip sc-convo-choice",onPick:()=>R(Xe=>({...Xe,[W.id]:he.id})),children:he.label},he.id))})]},W.id)),o.jsxs("div",{className:"sc-convo-decide sc-convo-ask","data-guide-shape":"",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","aria-disabled":!Gg(e.groups,$)||void 0,title:Gg(e.groups,$)?void 0:"Pick one in each row, or skip.","data-on":E==="submit"||void 0,onClick:()=>{Gg(e.groups??[],$)&&O("submit",{kind:"choices",picks:$})},children:e.submit??"Continue"}),e.skip&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","data-on":E==="skip"||!E&&e.skipped||void 0,onClick:()=>O("skip",{kind:"skip"}),children:e.skip}),le]})]}),e.kind==="swatches"&&o.jsxs("div",{className:"sc-convo-look",children:[e.row.options.some(W=>W.card)?e.layout==="grid"?o.jsx(uJ,{options:e.row.options,picked:_,onPick:W=>O(W,{kind:"swatches",picks:{[e.row.id]:W}})}):o.jsx(Sk,{options:e.row.options,picked:_,onPick:W=>O(W,{kind:"swatches",picks:{[e.row.id]:W}})}):o.jsx("div",{className:"sc-convo-swatches",children:e.row.options.map(W=>o.jsx(or,{label:W.label,children:o.jsx("button",{type:"button",className:W.color?"sc-convo-swatch":"sc-chip sc-convo-choice",style:W.color?{"--sc-swatch":W.color}:void 0,"aria-label":W.label,"aria-pressed":_===W.id,"data-on":_===W.id||void 0,onClick:()=>O(W.id,{kind:"swatches",picks:{[e.row.id]:W.id}}),children:W.color?null:W.label})},W.id))}),(e.skip||e.describe||le)&&o.jsxs("div",{className:"sc-convo-ways sc-convo-ask","data-guide-shape":"",children:[e.skip&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","aria-pressed":E==="skip"||!E&&e.skipped,"data-on":E==="skip"||!E&&e.skipped||void 0,onClick:()=>O("skip",{kind:"skip"}),children:e.skip}),e.describe&&y&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","aria-pressed":e.saying===void 0?void 0:e.saying,"data-on":e.saying||void 0,onClick:y,children:e.describe}),le]})]}),e.kind==="photos"&&o.jsxs("div",{className:"sc-convo-photos-q",children:[o.jsx(zA,{hashes:e.hashes,max:e.max,label:((J=e.drop)==null?void 0:J.label)??"Add a photo of their face",hint:((ne=e.drop)==null?void 0:ne.hint)??"Drop it here, or choose a file",busy:e.busy,onAdd:W=>m({kind:"photos",action:{type:"add",files:W}}),onRemove:W=>m({kind:"photos",action:{type:"remove",hash:W}}),onReject:()=>m({kind:"photos",action:{type:"reject"}})}),e.instead&&o.jsx("button",{type:"button",className:"sc-convo-other","data-on":E==="instead"||void 0,"data-waiting":e.insteadWaiting||void 0,"aria-hidden":e.insteadWaiting||void 0,tabIndex:e.insteadWaiting?-1:void 0,disabled:e.insteadWaiting||void 0,onClick:()=>O("instead",{kind:"photos",action:{type:"instead"}}),children:e.instead}),e.attest&&o.jsxs("label",{className:"sc-convo-attest",children:[o.jsx("input",{type:"checkbox",checked:e.attest.checked,onChange:W=>m({kind:"photos",action:{type:"attest",checked:W.target.checked}})}),o.jsx("span",{children:e.attest.text})]}),o.jsxs("div",{className:"sc-convo-decide sc-convo-ask","data-guide-shape":"",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","aria-disabled":!!qg(e)||void 0,title:qg(e)??void 0,"data-on":E==="submit"||void 0,onClick:()=>{qg(e)||O("submit",{kind:"photos",action:{type:"submit"}})},children:e.submit}),e.back&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","data-on":E==="back"||void 0,onClick:()=>O("back",{kind:"photos",action:{type:"back"}}),children:e.back}),le]})]}),e.kind==="pick"&&o.jsxs("div",{className:"sc-convo-pick",children:[e.search&&o.jsx("input",{type:"search",className:"sc-convo-pick-q",value:e.search.value,placeholder:e.search.label,"aria-label":e.search.label,onChange:W=>m({kind:"pick",action:{type:"query",text:W.target.value}}),onKeyDown:W=>{var he;W.key!=="Escape"||!((he=e.search)!=null&&he.value)||(W.preventDefault(),m({kind:"pick",action:{type:"query",text:""}}))}}),o.jsxs("fieldset",{ref:re,className:"sc-convo-pick-scroll","aria-labelledby":ae,"aria-busy":e.loading||void 0,children:[e.items.length===0&&e.loading&&o.jsx("div",{className:"sc-convo-grid sc-convo-pick-grid","aria-hidden":!0,children:Array.from({length:8},(W,he)=>o.jsx("span",{className:"sc-convo-plate sc-convo-pick-wait",children:o.jsx("span",{className:"sc-convo-plate-in"})},he))}),e.items.length>0&&o.jsx("div",{className:"sc-convo-grid sc-convo-pick-grid",children:e.items.map(W=>o.jsx("button",{type:"button",className:"sc-convo-plate","aria-label":W.alt,"aria-pressed":_===W.id,"data-on":_===W.id||void 0,onClick:()=>O(W.id,{kind:"pick",action:{type:"pick",id:W.id}}),children:o.jsx("span",{className:"sc-convo-plate-in",style:{backgroundImage:`url("${dn(W.hash,"small")}")`}})},W.id))}),e.items.length===0&&!e.loading&&e.empty&&o.jsx("p",{className:"sc-convo-pick-empty",children:e.empty}),e.more&&o.jsx("div",{ref:z,className:"sc-convo-pick-end","aria-hidden":!0})]}),o.jsx("p",{className:"sc-vh",role:"status",children:e.loading?"":e.status??""}),(e.back||le)&&o.jsxs("div",{className:"sc-convo-ways sc-convo-ask","data-guide-shape":"",children:[e.back&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","data-on":E==="back"||void 0,onClick:()=>O("back",{kind:"pick",action:{type:"back"}}),children:e.back}),le]})]}),e.kind==="confirm"&&e.quote&&o.jsx(jJ,{text:e.quote,label:e.quoteLabel}),e.kind==="confirm"&&o.jsxs("div",{className:"sc-convo-decide sc-convo-ask","data-guide-shape":"",children:[e.options.map((W,he)=>o.jsx("button",{type:"button",className:`sc-btn ${he===0&&!e.quiet?"sc-btn-primary":"sc-btn-ghost"}`,"data-on":E===W.id||void 0,onClick:()=>O(W.id,{kind:"confirm",id:W.id}),children:W.label},W.id)),e.describe&&y&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","aria-pressed":e.saying===void 0?void 0:e.saying,"data-on":e.saying||void 0,onClick:y,children:e.describe}),ke,le]}),e.cost&&o.jsx("p",{className:"sc-convo-note","data-cost":!0,children:e.cost}),e.note&&o.jsx("p",{className:"sc-convo-note",children:e.note})]})]})}function jJ({text:e,label:t="The brief"}){const[n,r]=s.useState(!1);return s.useEffect(()=>{if(!n)return;const a=setTimeout(()=>r(!1),1600);return()=>clearTimeout(a)},[n]),o.jsxs("figure",{className:"sc-convo-brief",children:[o.jsxs("figcaption",{className:"sc-convo-brief-head",children:[o.jsx("span",{className:"sc-convo-brief-lb",children:t}),o.jsxs("button",{type:"button",className:"sc-convo-brief-copy","data-took":n||void 0,onClick:()=>{var a;(a=navigator.clipboard)==null||a.writeText(e).then(()=>r(!0),()=>{})},children:[n?o.jsx(Kn,{size:13,weight:"bold"}):o.jsx(Dh,{size:13,weight:"bold"}),n?"Copied":"Copy"]})]}),o.jsx("p",{className:"sc-convo-brief-text",children:e})]})}function qg(e){return e.busy?"Still uploading.":e.hashes.length===0?"Add at least one photo.":e.attest&&!e.attest.checked?"Confirm you have permission to use their likeness.":null}function AJ({text:e,photos:t,at:n,now:r,editable:a,editing:i,arrive:c,leave:u,delay:f=0,turnId:h,dim:p,onEdit:m,onSave:v,onCancel:w}){const[y]=s.useState(!!c),[b]=s.useState(f),k=zv(u,y?b:0,y?240:0);return o.jsxs("div",{className:"sc-convo-turn","data-guide-shape":"","data-who":"you","data-arrive":y||void 0,"data-leave":k,"data-turn":h,"data-dim":p||void 0,style:y?{"--sc-convo-start":`${b}ms`}:void 0,children:[n?o.jsx(_N,{at:n,now:r}):null,i&&v&&w?o.jsx(NJ,{text:e,onSave:v,onCancel:w}):o.jsxs("div",{className:"sc-convo-bubble",children:[a&&m&&o.jsx(or,{label:"Change this answer",children:o.jsx("button",{type:"button",className:"sc-convo-edit","aria-label":"Change this answer",onClick:m,children:o.jsx(ed,{size:13})})}),o.jsx("p",{children:e}),t&&t.length>0&&o.jsx("div",{className:"sc-convo-photos",children:t.map((S,C)=>o.jsx("img",{src:dn(S,"micro"),alt:`Yours, ${C+1} of ${t.length}`},S))})]})]})}function NJ({text:e,onSave:t,onCancel:n}){const[r,a]=s.useState(e),i=s.useRef(null);s.useEffect(()=>{const u=i.current;u&&(u.focus(),u.setSelectionRange(u.value.length,u.value.length))},[]);const c=()=>{const u=r.trim();u&&t(u)};return o.jsxs("div",{className:"sc-convo-bubble","data-editing":"true",children:[o.jsx("textarea",{ref:i,className:"sc-convo-rewrite","aria-label":"Your answer",rows:Math.min(6,Math.max(1,r.split(`
|
|
103
|
-
`).length)),value:r,onChange:u=>a(u.target.value),onKeyDown:u=>{u.key==="Escape"&&(u.preventDefault(),n()),u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),c())}}),o.jsxs("div",{className:"sc-convo-rewrite-do",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:n,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","aria-disabled":!r.trim()||void 0,onClick:c,children:"Save"})]})]})}const MJ=180,Ck=3e3,BN=460,RJ="cubic-bezier(0.22, 1, 0.36, 1)",PJ=220,LJ=450,TJ=48;function $J({turns:e,busy:t,working:n,memoryKey:r,resumed:a,onAnswer:i,onEdit:c,onSaveEdit:u,onCancelEdit:f,onStarter:h,onDescribe:p,onAttachFiles:m,onRestore:v,onRetry:w,onShow:y}){var Pe;const b=s.useRef(null),k=s.useRef(!0),S=s.useRef(!!a),C=s.useRef(performance.now());S.current&&performance.now()-C.current>Ck&&(S.current=!1),s.useEffect(()=>{if(!S.current)return;const ue=()=>{S.current=!1},Ee=window.setTimeout(ue,Ck);return window.addEventListener("pointerdown",ue,{capture:!0}),window.addEventListener("keydown",ue,{capture:!0}),()=>{window.clearTimeout(Ee),window.removeEventListener("pointerdown",ue,{capture:!0}),window.removeEventListener("keydown",ue,{capture:!0})}},[]);const j=XQ(),N=s.useRef(e),P=s.useRef(null),$=s.useRef(null),R=s.useRef(null),E=s.useRef(null),M=s.useRef(null),L=s.useRef([]),[,H]=s.useState(0),D=s.useRef(new Map),K=s.useRef(0),O=performance.now(),_=s.useRef(!1),re=OJ(e);if(re!==P.current){P.current=re,_.current=!0;const ue=E.current&&O<E.current.until?E.current:null,Ee=ue?jk(N.current,ue):N.current,Ke=new Set(e.map(er)),ye=Nk(e),Se=Nk(Ee),Ie=Be=>Be.startsWith("you:")&&ye.has(q1(Be))||Be.startsWith("q:")&&Se.has(Be)&&Ke.has(q1(Be));if(L.current=Ee.map(er).filter(Be=>!Ke.has(Be)&&!Ie(Be)),ye.size&&!Se.size){const Be=q1([...ye][0]),Re=Ee.find(Ze=>er(Ze)===Be);R.current=(Re==null?void 0:Re.kind)==="you"?{key:Be,text:Re.text}:null}if(Se.size>0&&ye.size===0){const Be=R.current;R.current=null;const Re=Be?e.find(lt=>er(lt)===Be.key):void 0,Ze=!!Be&&((Re==null?void 0:Re.kind)!=="you"||Re.text!==Be.text),Qe=e[e.length-1];$.current=Ze&&(Qe==null?void 0:Qe.kind)==="question"?er(Qe):null}if(!j&&L.current.length){const Be=L.current.some(Qe=>!(ue!=null&&ue.gone.has(Qe))),Re=ue!=null&&ue.look&&L.current.includes(`q:${ue.look.qid}`)?ue.look:null,Ze=M.current??Re;E.current={from:Ee,gone:new Set(L.current),look:Ze,until:Be?O+(M.current?xJ:MJ):(ue==null?void 0:ue.until)??O}}else E.current=null;M.current=null,N.current=e}const z=E.current&&O<E.current.until?E.current:null;z||(E.current=null),s.useEffect(()=>{if(!z)return;const ue=window.setTimeout(()=>H(Ee=>Ee+1),Math.max(0,z.until-performance.now()));return()=>window.clearTimeout(ue)},[z]);const F=(ue,Ee)=>{M.current={qid:ue,look:Ee}},Q=z?jk(e,z):e,V=s.useRef(null);if(V.current===null){const ue=r?_J(r):null;V.current=ue??new Set(a||e.length>2?e.map(er):[])}const I=s.useRef(null);I.current===null&&(I.current=(r?IJ(r):null)??new Map);const[B,Y]=s.useState(()=>Date.now()),ae=Math.max(0,...I.current.values()),X=B-ae<36e5;s.useEffect(()=>{if(!X)return;const ue=window.setInterval(()=>Y(Date.now()),3e4);return()=>window.clearInterval(ue)},[X]),$.current&&(V.current.delete($.current),$.current=null);const le=new Set;for(const ue of Q){const Ee=er(ue);ue.kind==="question"&&ue.question.reopened||V.current.has(Ee)||le.add(Ee)}if(a&&S.current&&le.size){for(const ue of le)V.current.add(ue);le.clear()}const ke=[];let te=Number.POSITIVE_INFINITY;{const ue=new Set(Q.map(er));for(const Ee of[...D.current.keys()])ue.has(Ee)||D.current.delete(Ee);for(const Ee of Q){const Ke=er(Ee);if(!le.has(Ke)){ke.push(Ee);continue}let ye=D.current.get(Ke);if(ye===void 0){const Se=Ee.kind==="you"||Ee.kind==="scenri"&&!!Ee.quiet;ye=Math.max(O,Se?0:K.current,(z==null?void 0:z.until)??0),D.current.set(Ke,ye),K.current=Math.max(K.current,ye+(Se?PJ:Nf+Zv))}ye<=O?ke.push(Ee):te=Math.min(te,ye-O)}}s.useEffect(()=>{if(te===Number.POSITIVE_INFINITY)return;const ue=window.setTimeout(()=>H(Ee=>Ee+1),te);return()=>window.clearTimeout(ue)},[te]),s.useEffect(()=>{const ue=V.current;if(ue){for(const Ee of L.current)ue.delete(Ee);for(const Ee of ke){if(Ee.kind==="question"&&Ee.question.reopened)continue;const Ke=er(Ee);z!=null&&z.gone.has(Ke)||ue.add(Ke)}r&&ZJ(r,ue),r&&I.current&&FJ(r,I.current)}});const be=s.useRef(null),G=s.useCallback(()=>{const ue=b.current;if(!ue)return null;const Ee=be.current;return Ee!=null&&Ee.isConnected&&Ee.scrollHeight>Ee.clientHeight?Ee:(be.current=$6(ue),be.current)},[]);s.useEffect(()=>{const ue=()=>{const Ee=G();Ee&&(k.current=Ee.scrollHeight-Ee.scrollTop-Ee.clientHeight<24)};return document.addEventListener("scroll",ue,{passive:!0,capture:!0}),()=>document.removeEventListener("scroll",ue,{capture:!0})},[G]);const J=(()=>{const ue=e.find(Ke=>Ke.kind==="question"&&Ke.question.reopened);if(ue)return er(ue);const Ee=e.find(Ke=>Ke.kind==="you"&&Ke.editing);return Ee?er(Ee):null})();s.useLayoutEffect(()=>{var Ke;if(!k.current||J)return;const ue=document.activeElement;if(ue instanceof HTMLInputElement&&ue.type==="search"&&((Ke=b.current)!=null&&Ke.contains(ue)))return;const Ee=G();Ee&&(Ee.scrollTop=Ee.scrollHeight)});const ne=s.useRef(null);s.useLayoutEffect(()=>{var Ie,Be,Re,Ze;if(J===ne.current)return;const ue=ne.current;ne.current=J;const Ee=b.current;if(!Ee)return;const Ke=document.activeElement;if(!(!Ke||Ke===document.body||Ee.contains(Ke)))return;if(J){if(k.current=!1,J.startsWith("you:"))return;(Be=(Ie=Kd(Ee,J))==null?void 0:Ie.querySelector(".sc-convo-q"))==null||Be.focus({preventScroll:!0});return}if(!ue)return;const Se=ue.startsWith("q:")?q1(ue):ue;(Ze=(Re=Kd(Ee,Se))==null?void 0:Re.querySelector(".sc-convo-edit"))==null||Ze.focus({preventScroll:!0})}),s.useEffect(()=>{if(!J)return;const ue=window.setTimeout(()=>{const Ee=Kd(b.current,J),Ke=b.current&&$6(b.current);if(!Ee||!Ke)return;const ye=Ee.getBoundingClientRect(),Se=Ke.getBoundingClientRect();ye.bottom-Se.bottom>TJ&&Ak(Ee,j)},BN);return()=>window.clearTimeout(ue)},[J,j]);const W=e.length&&e[e.length-1].kind==="question"?er(e[e.length-1]):null,he=s.useRef(W);s.useLayoutEffect(()=>{var Ie,Be;const ue=b.current;if(J||!ue||W===he.current)return;const Ee=document.activeElement,Ke=(Ie=Ee==null?void 0:Ee.closest(".sc-convo-turn"))==null?void 0:Ie.getAttribute("data-turn"),ye=!Ee||Ee===document.body||Ee!==ue&&Ee.contains(ue)||!!Ke&&Ke.startsWith("q:")&&Ke!==W;if(!W||!ye){he.current=W;return}const Se=(Be=Kd(ue,W))==null?void 0:Be.querySelector(".sc-convo-q:not([hidden])");Se&&(he.current=W,Se.focus({preventScroll:!0}))});const Xe=s.useRef(W),tt=s.useRef(null);s.useEffect(()=>{if(W===Xe.current)return;if(!W){J&&(tt.current=Xe.current),Xe.current=null;return}const ue=Kd(b.current,W);if(!ue)return;Xe.current=W;const Ee=tt.current!==null,Ke=tt.current===W;if(tt.current=null,k.current||Ee&&Ke)return;const ye=()=>{HJ(ue,b.current)||Ak(ue,j)};if(!Ee){ye();return}const Se=window.setTimeout(ye,LJ);return()=>window.clearTimeout(Se)},[W,J,j]);const ze=s.useRef(new Map);s.useLayoutEffect(()=>{const ue=b.current;if(!ue)return;const Ee=new Map,Ke=_.current;_.current=!1;for(const ye of ue.querySelectorAll(".sc-convo-turn")){const Se=ye.dataset.turn??"",Ie=ye.offsetTop;Ee.set(Se,Ie);const Be=ze.current.get(Se);!Ke||j||Be===void 0||Math.abs(Be-Ie)<1||DJ(ye,Be-Ie)}ze.current=Ee});const nt=new Set;if(J){nt.add(J);const ue=J.slice(J.indexOf(":")+1);nt.add(`scenri:asked-${ue}`);const Ee=ke.findIndex(Ke=>er(Ke)===J);if(Ee>=0){for(let Ke=Ee+1;Ke<ke.length&&Gh(ke[Ke]);Ke++)nt.add(er(ke[Ke]));for(let Ke=Ee-1;Ke>=0&&Gh(ke[Ke]);Ke--)nt.add(er(ke[Ke]))}}for(const ue of ke){const Ee=er(ue);I.current.has(Ee)||I.current.set(Ee,Date.now())}let ce=!1;const ve=[];for(const ue of ke){const Ee=er(ue),Ke=!!J&&!nt.has(Ee),ye=I.current.get(Ee),Se=!!(z!=null&&z.gone.has(Ee)),Ie=Se&&ue.kind==="question"&&((Pe=z==null?void 0:z.look)==null?void 0:Pe.qid)===ue.question.id,Be=ue.kind==="scenri"&&!!ue.quiet,Re=!j&&!Se&&le.has(Ee)&&!Be,Ze=0,Qe=ce;Se||(ce=ue.kind==="scenri"||ue.kind==="question"&&!ue.question.reopened),ue.kind==="you"?ve.push(o.jsx(AJ,{text:ue.text,photos:ue.photos,editable:ue.editable,editing:ue.editing,arrive:Re,leave:Se,delay:Ze,turnId:Ee,dim:Ke,at:ye,now:B,onEdit:ue.editable&&c?()=>c(ue.id):void 0,onSave:u?lt=>u(ue.id,lt):void 0,onCancel:f},Ee)):ue.kind==="scenri"?ve.push(o.jsx(wJ,{text:ue.text,tone:ue.tone,reveal:Re,leave:Se,eyebrow:!Qe,delay:Ze,turnId:Ee,dim:Ke,at:ye,now:B,thumb:ue.thumb,label:ue.label,current:ue.current,restore:ue.restore,onRestore:v,retry:ue.retry,onRetry:w,onShow:y},Ee)):ve.push(o.jsx(CJ,{question:ue.question,reveal:Re,leave:Se&&!Ie,spent:Se,delay:Ze,turnId:Ee,dim:Ke,busy:t||Ke,eyebrow:!Qe,at:ye,now:B,onAnswer:lt=>i(ue.question.id,lt),onPick:F,onStarter:h,onDescribe:p,onAttachFiles:m,onCancel:f},Ee))}return o.jsx("div",{ref:b,className:"sc-convo-log",role:"log","aria-live":"polite","aria-relevant":"additions","data-changing":J?"true":void 0,children:o.jsxs("div",{className:"sc-convo-turns",children:[ve,n&&o.jsx(yJ,{what:n===!0?void 0:n})]})})}function jk(e,t){const n=[],r=new Set(e.map(er));let a=0;for(const i of t.from){const c=er(i);if(t.gone.has(c)){r.has(c)||n.push(i);continue}for(;a<e.length&&er(e[a])!==c;)n.push(e[a++]);a<e.length&&n.push(e[a++])}for(;a<e.length;)n.push(e[a++]);return n}function DJ(e,t){for(const a of e.getAnimations())a.id==="slide"&&a.cancel();const n=`translateY(${t}px)`;e.style.transform=n;const r=e.animate([{transform:n},{transform:"translateY(0)"}],{duration:BN,easing:RJ,fill:"both"});r.id="slide",r.onfinish=()=>{e.style.transform="",r.cancel()}}function HJ(e,t){if(!t)return!1;const n=$6(t),r=e.getBoundingClientRect(),a=n.getBoundingClientRect();return r.top>=a.top&&r.top<=a.bottom-24}function Ak(e,t){var n;(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest",behavior:t?"auto":"smooth"})}function Kd(e,t){if(!e)return null;for(const n of e.querySelectorAll(".sc-convo-turn"))if(n.dataset.turn===t)return n;return null}function OJ(e){const t=[];for(const n of e){const r=er(n);if(n.kind==="question"){const u=n.question,f="options"in u&&Array.isArray(u.options)?u.options.map(h=>h.id).join(","):"";t.push(`${r}~${u.reopened?1:0}~${u.prompt}~${u.hint??""}~${f}`);continue}const a="photos"in n&&Array.isArray(n.photos)?n.photos.length:0,i="thumb"in n?n.thumb??"":"",c="editing"in n&&n.editing?1:0;t.push(`${r}~${n.text??""}~${i}~${a}~${c}`)}return t.join("")}function Nk(e){const t=new Set;for(const n of e)n.kind==="question"&&n.question.reopened&&t.add(er(n));return t}function q1(e){return e.startsWith("you:")?`q:${e.slice(4)}`:e.startsWith("q:")?`you:${e.slice(2)}`:""}function $6(e){let t=e;for(;t;){const{overflowY:n}=getComputedStyle(t);if((n==="auto"||n==="scroll")&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return e}const Bv=e=>`scenri:convo-said:${e}`;function _i(e){try{sessionStorage.removeItem(Bv(e)),sessionStorage.removeItem(Uv(e))}catch{}}const Uv=e=>`scenri:convo-at:${e}`;function IJ(e){try{const t=sessionStorage.getItem(Uv(e));return t?new Map(Object.entries(JSON.parse(t))):null}catch{return null}}function FJ(e,t){try{sessionStorage.setItem(Uv(e),JSON.stringify(Object.fromEntries(t)))}catch{}}function _J(e){try{const t=sessionStorage.getItem(Bv(e));return t?new Set(JSON.parse(t)):null}catch{return null}}function ZJ(e,t){try{sessionStorage.setItem(Bv(e),JSON.stringify([...t]))}catch{}}function Mk(e){return`${["No","One","Two","Three","Four","Five"][e]??String(e)} picture${e===1?"":"s"}`}function Rk(e){const[t,...n]=e,r=[t,...n.map(a=>a.toLowerCase())];return r.length>1?`${r.slice(0,-1).join(", ")} and ${r[r.length-1]}`:r[0]??""}const Ne={title:"Create scene",editTitle:"Edit scene",intent:"Create a scene",source:"Where are we shooting? Describe the place, or start from pictures of one.",addPictures:"Add pictures",guideMe:"Guide me",photos:"Add one to four pictures of the place. The more they share, the better it reads.",photosDrop:{label:"Add pictures of the place",hint:"Drop them here, or choose files"},fromShot:"Or start from one of your shots",fromShotAnswer:"Start from one of my shots",shot:"Which shot? I'll read the place in it and leave the product and people out.",shotSearch:"Find a shot",shotNone:"No shots to start from yet.",shotNotFound:e=>`No shot matches "${e}".`,shotsFailed:"The shots could not be read just now. Try the search again.",shotCount:(e,t)=>t?`${e} shots so far, more as you scroll`:`${e} ${e===1?"shot":"shots"}`,shotAnswer:"This shot",backToPictures:"Back to pictures",shotOff:"Choose a shot above.",madeIn:e=>`This shot was made in ${e}.`,takeScene:e=>`Use ${e}`,readNew:"Read a new scene from it",reuseOff:"Choose above.",anotherShot:"Choose another shot",stopped:"That was stopped. Nothing here was changed.",stoppedRead:"Stopped before the place was read. Read it again, or say it differently.",stoppedDraw:"Stopped. Nothing was drawn.",stoppedChange:"Stopped before the picture changed. The new words are kept: draw them, or put back the last picture.",readThem:"Read them",guideInstead:"Guide me instead",skip:"Skip",describeInstead:"Describe instead",worldHint:"Choose a starting world. You'll personalise it next.",worldLightPrompt:e=>`This world is already lit ${e}. Keep it, or choose another.`,keepWorldLight:"Keep it",keepWorldSurface:"Keep the world's own",suggestOne:"Suggest one",followWorld:"You have the feel of it. What kind of place is it?",followLight:"You have the place. What light is it in?",leaveToReading:"Leave it to the reading",worldIsAStart:"Treat this as a starting direction, not a picture to reproduce: keep the material language and the character of the light, and invent a specific original arrangement.",emptyLead:"The place appears here",emptyHint:"Describe it, or add pictures of it",sourcePlaceholder:"Describe the place, or choose above",nothingSaidPlaceholder:"Tell me where we are, in your own words",rowPlaceholder:e=>`Tap one above, or describe the ${e} in your own words`,photosOff:"Add the pictures above, then read them.",addPlaceholder:"Anything to add or leave out?",keepPlaceholder:"Anything to keep or ignore in them?",keepShotPlaceholder:"Anything to keep or ignore in it?",changePlaceholder:"Say what to change. The rest stays.",namePlaceholder:"Its name",nameIt:"Name this scene",attachLabel:"Add pictures of the place",send:"Send",lineLabel:"Your answer",change:"Change",reading:"Writing what your shots are told",readingPhotos:"Reading your pictures",changing:"Changing the words",drawing:"Drawing the scene",stillReading:"Still writing what your shots are told",readingHead:"What your shots are told",placeLabel:"The place",lightLabel:"Light",cameraLabel:"Camera",figureLabel:"Built around",agree:"Here is the place, in full. Ready to draw?",agreePhotos:"Here is the place I read in your pictures. Ready to draw?",agreeShot:"Here is the place I read in your shot. Ready to draw?",agreeChanged:"Here it is with that. Ready to draw?",agreeBlind:"Here is the place, in full. Nothing here can draw yet, so it is saved as words.",readAgain:"I read the place again.",draw:"Draw the scene",saveWords:"Save scene",here:"Here is the scene.",again:"Here it is again.",changed:"Here it is, changed.",decide:e=>`Here is ${e}. Use it, or change something.`,decideEdit:e=>`Here is ${e}. Save it, or change something.`,use:"Use this scene",saveChanges:"Save changes",tryAgain:"Try again",changeSomething:"Change something",name:"While it draws: what should we call it?",editOpen:e=>`Here is ${e}, as it is saved. Change something, or draw it again.`,failed:"That did not work. Nothing standing was touched.",failedFirst:e=>`That did not go through: ${e}. Nothing was drawn.`,lost:"That work is gone: the server restarted while it ran. Try it again.",offline:"Lost touch with Scenri. Still trying.",retry:"Try again",version:e=>`Version ${e}`,saved:"Saved.",savedQuiet:"Saved. Nothing is drawn until you ask.",showInUse:(e,t)=>`Show it in use? ${Mk(t.length)} with a Scenri demo ${e} in the place: ${Rk(t.map(n=>n.toLowerCase()))}.`,staleSet:e=>`${Mk(e)} here show${e===1?"s":""} the place as it was before. Draw ${e===1?"it":"them"} again?`,drawThem:"Draw them",drawThemAgain:"Draw them again",inUse:e=>`Saved. Now it is shown in use, with a Scenri demo ${e}. Shots are told the words, never handed these pictures.`,noLibrary:"Saved. Scenri's library has not downloaded yet, so it cannot be shown in use for now.",exampleHere:{hero:"Here is the hero.",close:"Here is a close-up.",hands:"Here it is in hands.",angle:"Here is another angle.",bold:"Here is a bold one."},exampleFailed:(e,t)=>`The ${e.toLowerCase()} did not draw: ${t.replace(/[.\s]+$/,"")}.`,more:e=>`Add ${["no","one","two","three"][e.length]??e.length} more? ${Rk(e)}.`,addThem:"Add them",notNow:"Not now",ready:e=>`${e} is ready.`,readyUndrawn:e=>`${e} is ready. It can be shown in use any time, from its page.`,readyMissing:e=>`${e} is ready. Some did not draw.`,openScene:"Open scene",useInAShot:"Use in a shot",notAPlace:"That did not read as a place. Try a few words about it, like 'a quiet concrete gallery at dusk'.",greet:"Hello. Describe the place, or choose above.",greetRow:"Tap one above, or say it in a few words.",askHelp:"Describe the place in a few words, or tap one above. Everything can be changed later.",goFirst:"Choose above, or describe the place first.",startOverIsUp:"Start over is at the top of this panel.",notInAScene:"A scene holds the place and its light. Add presenters and products in Create.",usePutBack:"Step back through the versions on the picture, and Put back the one you want.",sayAChange:"Say what to change about the place, and the rest stays as it is.",renamed:e=>`Called it ${e}.`,changeIt:"Change it",changeTitle:"Change this answer?",changeBody:"The picture was drawn from the answers as they are. Changing one asks again from there, and the pictures so far go. To keep the picture and change one thing, say it in the line instead.",onlyPictures:"Only pictures can show a place.",fourPictures:"Four pictures is the most a scene is read from.",leaveTitle:"Leave this scene?",leaveBody:"Nothing has been read yet, so the answers here go.",leave:"Leave",discardTitle:"Discard the changes?",discardBody:"The scene stays as it was saved. What was drawn here is let go.",discard:"Discard changes",startOver:"Start over",startOverTitle:"Start over?",startOverBody:"This conversation begins again from the first question. Nothing here is saved yet."},VJ="part of the place itself, never a separate object that competes with the subject, and leaving the subject a clear place to stand",UN={water:{surface:[{key:"basalt",label:"Wet basalt",words:"a ledge of wet black basalt, glossy where the sea has just left it"},{key:"sand",label:"White sand",words:"rippled white sand under a few centimetres of clear water"},{key:"pebbles",label:"Sea pebbles",words:"a bed of smooth sea-worn pebbles, wet and gleaming"},{key:"awash",label:"Rock awash",words:"a flat rock just awash, a thin sheet of clear water sliding over it"}],light:[{key:"caustics",label:"Water caustics",words:"a live net of water caustics sliding across every surface"},{key:"sunset",label:"Low sun on water",words:"low sun skimming the water, long glittering reflections"},{key:"silver",label:"Silver overcast",words:"soft silver overcast light, the sea flat and pale"},{key:"backlit",label:"Backlit spray",words:"the sun behind the surf, the spray lit up like glass"}],signature:[{key:"wave",label:"Frozen wave",words:"a wave frozen mid-break behind the rock, its crest in glassy detail"},{key:"foam",label:"Foam lace",words:"a lace of sea foam drawn across the wet rock"},{key:"kelp",label:"Kelp ribbons",words:"glossy olive-gold ribbons of kelp draped over the rocks"},{key:"pool",label:"Mirror pool",words:"a still rock pool mirroring the sky"}]},stone:{surface:[{key:"travertine",label:"Travertine",words:"honed cream travertine up close, its pores and soft veins readable"},{key:"limestone",label:"Rough limestone",words:"a rough-cut block of warm limestone, chisel marks in its face"},{key:"terracotta",label:"Terracotta tile",words:"sun-baked terracotta floor tiles, worn at the edges"},{key:"marble",label:"Weathered marble",words:"weathered pale marble, its polish worn soft by years of sun"}],light:[{key:"shadow",label:"One long shadow",words:"one high hard light throwing a single long, precise shadow across the stone"},{key:"olive",label:"Olive-leaf dapple",words:"sun broken into moving dapples through olive leaves"},{key:"golden",label:"Low golden sun",words:"low golden sun raking almost flat across the stone, long warm shadows"},{key:"shade",label:"Cool shade",words:"the niche in open shade, cool bounced light and a bright sunlit world beyond"}],signature:[{key:"vines",label:"Vines taking over",words:"a vine growing down the stone, claiming its edges"},{key:"basin",label:"Water in the stone",words:"water trickling into a basin carved in the stone, glinting"},{key:"dust",label:"Dust in the sun",words:"fine dust hanging in one bright shaft of sun"},{key:"sphere",label:"A giant stone sphere",words:"one oversized stone sphere resting in the space, impossible in scale"}]},colour:{surface:[{key:"lacquer",label:"Glossy lacquer",words:"a glossy lacquered floor the same colour as the sweep, mirroring it"},{key:"paper",label:"Matte paper",words:"matte coloured paper, its fibres and one soft crease readable"},{key:"acrylic",label:"Frosted acrylic",words:"a sheet of frosted acrylic glowing softly with the colour behind it"},{key:"velvet",label:"Flocked velvet",words:"flocked velvet in the same colour, soaking up the light"}],light:[{key:"gobo",label:"Cut spotlight",words:"a hard spotlight cut into one graphic shape across the colour"},{key:"split",label:"Two-colour gels",words:"two coloured gels splitting the light, one warm and one cool edge"},{key:"wrap",label:"Soft studio wrap",words:"soft wrapping studio light, a gentle gradient across the sweep"},{key:"rim",label:"Neon rim",words:"one neon rim tracing the edges, the rest of the colour dimmed"}],signature:[{key:"shapes",label:"Floating shapes",words:"a few simple geometric shapes floating in the colour, frozen in place"},{key:"planes",label:"Cut-paper planes",words:"sharp-angled planes of cut paper converging in the colour"},{key:"block",label:"Colour-block shadow",words:"a hard shadow cut into a block of a second colour"},{key:"giant",label:"Surreal scale",words:"one oversized sphere or arch in the colour, impossible in scale"}]},citrus:{surface:[{key:"halves",label:"Cut citrus",words:"a bed of halved citrus, the flesh glistening with juice"},{key:"tile",label:"Glazed tile",words:"sun-bleached glazed tiles in white and cobalt"},{key:"ice",label:"Crushed ice",words:"crushed ice melting over the fruit"},{key:"cloth",label:"Crisp linen",words:"a crisp white linen cloth spread under the fruit"}],light:[{key:"glow",label:"Sun through fruit",words:"the sun behind the fruit, the flesh glowing like stained glass"},{key:"leaves",label:"Leaf shade",words:"sun broken into dapples through citrus leaves"},{key:"golden",label:"Late golden sun",words:"late golden sun, the sky deepening, long warm shadows"},{key:"flash",label:"Hard flash",words:"hard direct flash against the blue sky, crisp and saturated"}],signature:[{key:"blossom",label:"Blossom and leaves",words:"citrus blossom and glossy leaves threaded through the fruit"},{key:"melting",label:"Ice melting",words:"ice melting over the fruit, beads of water running down"},{key:"peel",label:"Peel spirals",words:"long spirals of peel curling across the mound"},{key:"giant",label:"Giant fruit",words:"one citrus fruit at an impossible, monumental scale on the horizon"}]},volcanic:{surface:[{key:"crust",label:"Lava crust",words:"a crust of cooled black lava, ropey and cracked"},{key:"sand",label:"Black sand",words:"fine black volcanic sand, wind-rippled"},{key:"pumice",label:"Pumice",words:"porous grey pumice, sharp and light"},{key:"obsidian",label:"Obsidian",words:"a slab of glassy black obsidian with conchoidal edges"}],light:[{key:"fissures",label:"Glow from below",words:"incandescent orange fissures lighting the rock from below"},{key:"raking",label:"Sun through haze",words:"a hard low sun raking through the orange haze"},{key:"ember",label:"Ember glow",words:"a deep ember glow, everything else falling into dark"},{key:"moon",label:"Blue moonlight",words:"cold blue moonlight on the black rock, the haze gone silver"}],signature:[{key:"lava",label:"Lava still moving",words:"lava still glowing in the cracks of the crust, cooling as it goes"},{key:"ash",label:"Ash in the air",words:"fine ash drifting through the haze"},{key:"steam",label:"Steam vents",words:"white steam rising from vents in the rock"},{key:"floating",label:"Floating rocks",words:"a few rocks hanging weightless in the haze, impossible and still"}]},dark:{surface:[{key:"mirror",label:"Black mirror",words:"black mirror glass, every reflection crisp"},{key:"steel",label:"Brushed steel",words:"brushed stainless steel with a fine directional grain"},{key:"marble",label:"Black marble",words:"polished black marble with thin white veins"},{key:"water",label:"Black water",words:"still black water, one faint ripple"}],light:[{key:"gobo",label:"Cut spotlight",words:"a hard spotlight cut into one graphic shape across the dark"},{key:"pool",label:"Pool of light",words:"one pool of light from above, the rest falling to true black"},{key:"neon",label:"Neon edge",words:"one line of coloured neon reflected in the black surface"},{key:"rim",label:"Thin rim",words:"a thin bright rim of light along every edge, nothing else lit"}],signature:[{key:"wax",label:"Wax cascading",words:"dark wax cascading down a wall into the mirror, glossy and still setting"},{key:"ripples",label:"Ripples",words:"slow concentric ripples crossing the black surface"},{key:"smoke",label:"Smoke curl",words:"one curl of smoke drifting through the light"},{key:"sphere",label:"Floating sphere",words:"a perfect sphere floating above the mirror, impossible and still"}]},plaster:{surface:[{key:"limewash",label:"Limewash floor",words:"a limewashed plaster floor, soft and chalky"},{key:"oak",label:"Pale oak",words:"pale oak boards, their grain soft in the light"},{key:"terrazzo",label:"Terrazzo",words:"pale terrazzo with small flecks of stone"},{key:"silk",label:"Silk drape",words:"a length of silk pooling on the floor in soft folds"}],light:[{key:"shadow",label:"Window shadow",words:"hard sun through the tall window, its shape laid long across the room"},{key:"leaves",label:"Leaf shadows",words:"soft moving leaf shadows thrown across the plaster"},{key:"golden",label:"Low golden sun",words:"low golden sun raking across the plaster, long warm shadows"},{key:"dusk",label:"Blue dusk",words:"cool blue dusk in the window, the room dim and quiet"}],signature:[{key:"curtain",label:"Curtain in the wind",words:"a sheer curtain lifted into the room by the wind"},{key:"plants",label:"Plants growing in",words:"green plants growing up the plaster walls, claiming the corners"},{key:"arch",label:"Arch shadow",words:"the hard shadow of an arch cut across the wall"},{key:"stair",label:"Surreal stair",words:"a plaster stair rising into the wall and going nowhere"}]},linen:{surface:[{key:"linen",label:"Raw linen",words:"raw undyed linen, its slub weave readable"},{key:"satin",label:"Silk satin",words:"heavy silk satin in deep folds, its sheen catching the light"},{key:"boucle",label:"Wool bouclé",words:"nubbly wool bouclé, soft and textured"},{key:"paper",label:"Crumpled paper",words:"large sheets of crumpled paper folded like cloth"}],light:[{key:"leaves",label:"Leaf dapple",words:"sun broken into soft dapples through leaves"},{key:"slice",label:"Slice of sun",words:"one hard slice of sun across the folds"},{key:"golden",label:"Low golden sun",words:"low golden sun raking across the folds, deep warm shadows"},{key:"through",label:"Light through cloth",words:"light glowing through the cloth from behind"}],signature:[{key:"wind",label:"Lifted by wind",words:"the cloth lifted by a gust and frozen mid-billow"},{key:"dried",label:"Dried flowers",words:"a few dried flowers and grasses caught in the folds"},{key:"thread",label:"One red thread",words:"a single red thread running through the folds"},{key:"landscape",label:"Folds as dunes",words:"the folds made vast, like a landscape of dunes"}]}};function Wv(e,t){const n=e?UN[e]:void 0;return n?n[t].map((r,a)=>({id:`${e}-${r.key}`,label:r.label,words:r.words,card:`scene-${e}-${t}-${a+1}`})):null}function zJ(e){return Object.keys(UN).flatMap(t=>Wv(t,e)??[])}const BJ=["water","stone","colour","citrus","volcanic","dark","plaster","linen"],Mf=["world","surface","light","signature"],na=(e,t)=>`scene-${e}-${t}`,Qi={world:{prompt:"What world?",options:[{id:"water",label:"Rock and water",words:"a shoreline of wet dark rock and shallow turquoise water",light:"in hard midday sun",card:na("world",1),cues:["water","sea","ocean","shore","shoreline","beach","wet","pool","underwater"]},{id:"stone",label:"Sunlit stone",words:"a niche of warm limestone and rough plaster",light:"in hard afternoon sun",card:na("world",2),cues:["stone","limestone","wall","niche","arch","terracotta","mediterranean","sunlit"]},{id:"colour",label:"Colour field",words:"a seamless studio sweep in one saturated colour",light:"in flat hard poster light",card:na("world",3),cues:["studio","sweep","seamless","backdrop","colour","color","paper","poster","graphic","flat"]},{id:"citrus",label:"Fruit and sky",words:"a mound of cut citrus under an open blue sky",light:"in bright direct sun",card:na("world",4),cues:["fruit","citrus","orange","lemon","sky","outdoors","outdoor","summer","juice"]},{id:"volcanic",label:"Volcanic haze",words:"dark volcanic rock in a deep orange haze",light:"with one hard low light raking across it",card:na("world",5),cues:["volcanic","lava","rock","ash","dust","haze","smoke","desert","mars"]},{id:"dark",label:"Dark mirror",words:"a near-black polished surface like a still pool",light:"in low-key light, with one bright edge",card:na("world",6),cues:["mirror","reflection","polished","still pool"]},{id:"plaster",label:"Soft plaster",words:"a bare plaster room with one tall soft window",light:"in soft overcast daylight",card:na("world",7),cues:["plaster","concrete","microcement","minimal","interior","room","window","raw","architectural","overcast"]},{id:"linen",label:"Linen fold",words:"a length of raw undyed linen folded in soft loose drapes",light:"in soft window light",card:na("world",8),cues:["linen","fabric","textile","cloth","drape","fold","woven","cotton","soft fabric"]}]},surface:{prompt:"What is it made of, up close?",options:[{id:"travertine",label:"Travertine",words:"honed cream travertine up close, its pores and soft veins readable",cues:["travertine"]},{id:"steel",label:"Brushed steel",words:"brushed stainless steel with a fine directional grain",cues:["steel","stainless","brushed metal","aluminium","aluminum"]},{id:"clay",label:"Cracked clay",words:"sun-dried terracotta clay cracked into deep fissures",cues:["clay","terracotta","cracked earth"]},{id:"silk",label:"Silk folds",words:"heavy silk gathered into deep sculptural folds",cues:["silk","satin"]},{id:"sand",label:"Wet sand",words:"rippled wet sand, glossy where the water has just drawn back",cues:["sand","wet sand"]},{id:"moss",label:"Moss and roots",words:"damp moss over exposed roots, dense and living",cues:["moss","mossy","roots"]},{id:"ice",label:"Ice",words:"clear ice with trapped bubbles and a cold blue depth",cues:["ice","icy","glacial"]},{id:"concrete",label:"Raw concrete",words:"raw board-formed concrete with timber grain printed into it",cues:["board-formed","cement"]}]},light:{prompt:"What does the light do?",options:[{id:"shadow",label:"One long shadow",words:"one high hard light throwing a single long, precise shadow across the place",cues:["long shadow","skylight","shaft of light","single shadow"]},{id:"dapple",label:"Dappled leaves",words:"sun broken into soft moving dapples through leaves",cues:["dappled","dapple","through leaves","leaf shadows","canopy"]},{id:"caustics",label:"Water caustics",words:"a live net of water caustics sliding across every surface",cues:["caustics","caustic","rippling light","underwater light"]},{id:"gobo",label:"Cut spotlight",words:"a hard spotlight cut into one graphic shape across the set",cues:["gobo","spotlight","cut light","shaped light"]},{id:"window",label:"Soft window",words:"soft daylight from one large window, falling open and shadowless on the far side",card:na("light",7),cues:["window light","side light","from a window","sidelit","window","soft","daylight","overcast","diffused"]},{id:"golden",label:"Low golden sun",words:"low golden sun raking almost flat across it, long warm shadows",card:na("light",2),cues:["golden","golden hour","sunset","sunrise","dusk","warm"]},{id:"neon",label:"Neon glow",words:"coloured neon streaking its light across glossy surfaces at night",card:na("light",4),cues:["neon","night","nocturnal","after dark"]},{id:"lowkey",label:"Pool of light",words:"one pool of light with a bright edge, the rest falling to true black",card:na("light",6),cues:["low key","lowkey","dramatic","shadowy","chiaroscuro","rim light"]}]},signature:{prompt:"What makes it unforgettable?",options:[{id:"air",label:"Mist, snow or wind",words:"the air of the place alive, such as mist lying low, snow drifting down or wind moving through fabric or grass: one, chosen for this place",cues:["mist","misty","fog","foggy","snow","snowing","wind","windswept","haze"]},{id:"change",label:"Caught mid-change",words:"the place's own material caught mid-change, such as wax cascading down a wall, sugar pulled glassy across the surface or ice melting at its edge: one, chosen for this place",cues:["melting","molten","dripping","wax","resin","mid-change"]},{id:"graphic",label:"Graphic light and shadow",words:"one bold graphic device of light and shadow shaping the set, such as a cut shadow or a hard slice of colour",cues:["graphic","geometric","cut shadow","colour block","color block"]},{id:"nature",label:"Nature taking over",words:"nature growing through the set, such as moss, blooms or roots claiming its edges: one, chosen for this place",cues:["overgrown","blooms","flowers","vines","growing"]},{id:"water",label:"Glass and water",words:"water and reflection in the place, such as a still reflecting pool or rain-beaded glass: one, chosen for this place",cues:["reflection","reflecting","rain","puddle","rain glass"]},{id:"scale",label:"Surreal scale",words:"one surreal touch of scale, an oversized natural or architectural form that makes the place feel impossible",cues:["surreal","giant","oversized","impossible","dreamlike"]}]}},UJ=new Set([...Qi.world.options.map(e=>e.card),...Qi.light.options.filter(e=>e.card).map(e=>e.card),...BJ.flatMap(e=>["surface","light","signature"].flatMap(t=>(Wv(e,t)??[]).map(n=>n.card)))]);function WJ(e,t){return e==="world"?Qi.world.options:Wv(t,e)??Qi[e].options}function KJ(e,t){const n=WJ(e,t),r=n.every(a=>!!a.card&&UJ.has(a.card));return{id:e,label:Qi[e].prompt,options:n.map(a=>({id:a.id,label:a.label,...r?{card:a.card}:{}}))}}const GJ={world:"place",surface:"surface",light:"light",signature:"idea"},Pk=e=>GJ[e],uo=(e,t)=>{if(!t)return;const n=Qi[e].options.find(r=>r.id===t);return n||e==="world"?n:zJ(e).find(r=>r.id===t)},YJ="one signature idea that makes this place unforgettable, invented for it and never generic";function qJ(e){const t=` ${e.toLowerCase().replace(/[^a-z0-9]+/g," ")} `,n={};for(const r of Mf){let a=null;for(const i of Qi[r].options)for(const c of i.cues??[]){const u=` ${c.replace(/[^a-z0-9]+/g," ")} `;t.includes(u)&&(!a||c.length>a.len)&&(a={id:i.id,len:c.length})}a&&(n[r]=a.id)}return n}const XJ=["studio","cyclorama","cyc","seamless","sweep","backdrop","set","room","interior","exterior","beach","shore","shoreline","coast","sea","ocean","lake","river","water","pool","forest","woods","woodland","jungle","garden","park","field","meadow","desert","dune","dunes","mountain","mountains","cliff","cave","canyon","street","city","urban","rooftop","loft","warehouse","gallery","museum","hotel","lobby","kitchen","bathroom","bedroom","living room","cafe","café","bar","restaurant","shop","store","boutique","market","library","courtyard","terrace","balcony","corridor","hallway","tunnel","bridge","station","greenhouse","spa","chapel","ruin","ruins","architecture","landscape","outdoors","indoors","sky"],D6=["stone","rock","rocks","marble","travertine","limestone","granite","basalt","concrete","plaster","terrazzo","tile","tiles","wood","wooden","oak","walnut","linen","fabric","velvet","silk","satin","glass","metal","steel","chrome","brass","mirror","sand","moss","ferns","foliage","flowers","paper","colour field","color field","colour block","color block","pastel","brutalist","minimal","wall","walls","clay","terracotta","ice","aluminium","aluminum","stainless","leather","felt","slate","onyx","salt"],WN=["splash","splashing","mid air","frozen","falling","petals","confetti","smoke","mist","fog","steam","dust","drifting","bubbles","melting","molten","dripping","wax","resin","pouring","overgrown","blooms","flowers","vines","reflection","reflections","reflecting","rain","puddle","ripples","surreal","giant","oversized","levitating","impossible","dreamlike","cut shadow","gobo"],KN=["light","lit","lighting","flash","strobe","strobes","sun","sunny","sunlight","sunlit","sunshine","daylight","golden hour","sunset","sunrise","dusk","dawn","twilight","blue hour","night","neon","moonlight","moonlit","candle","candlelight","candlelit","lamp","lamplight","spotlight","spotlit","softbox","overcast","shadow","shadows","shadowless","backlit","backlight","rim light","glow","glowing","noon","midday","low key","high key","chiaroscuro","hard sun","window light"],GN=["plinth","pedestal","podium","platform","block","cube","table","tabletop","counter","countertop","shelf","ledge","tray","on the floor","on the ground","in hand","in hands","hand","hands","held","holding","resting","rests","floating","floats","suspended","hanging","leaning","propped","nestled","nested","half buried","emerging","balanced","stacked","scattered"],YN=["top down","overhead","flat lay","flatlay","birds eye","bird s eye","aerial","from above","from below","low angle","high angle","eye level","worms eye","close up","closeup","macro","wide angle","wide shot","wide","telephoto","35mm","50mm","85mm","lens","shot from","framed","framing","straight on","profile"],qN={world:[...XJ,...D6],surface:D6,light:KN,signature:WN,stage:GN,camera:YN},QJ=e=>` ${e.toLowerCase().replace(/[^a-z0-9é]+/g," ").trim()} `,JJ=(e,t)=>e.includes(` ${t.replace(/[^a-z0-9é]+/g," ")} `);function XN(e){const t=QJ(e),n=r=>r.some(a=>JJ(t,a));return{world:n(qN.world),surface:n(D6),light:n(KN),signature:n(WN),stage:n(GN),camera:n(YN)}}const eee=e=>Object.keys(qN).filter(t=>e[t]);function tee(e){const t=["world","surface","light"].filter(r=>!e[r]),n=eee(e).length>=3?t.filter(r=>r==="world"):t.slice(0,2);return e.signature?n:[...n,"signature"]}const qo="__passed",i0=e=>{var t;return(t=e.source)==null?void 0:t.door},nee=e=>{var t;return i0(e)==="words"?tee(XN(((t=e.source)==null?void 0:t.text)??"")):[]},lm=[{id:"source",applies:()=>!0},{id:"photos",applies:e=>i0(e)==="photos"},{id:"shot",applies:e=>i0(e)==="shot"},{id:"reuse",applies:e=>{var t;return i0(e)==="shot"&&!!((t=e.shot)!=null&&t.scene)}},...Mf.map(e=>({id:e,applies:t=>i0(t)==="guided"||nee(t).includes(e)}))],wh=lm.map(e=>e.id),qh=e=>Mf.includes(e),Lk=e=>wh.includes(e),ree=e=>{var t;return!!e&&(!!e.pick||!!((t=e.words)!=null&&t.trim()))};function Kv(e,t){var n;return e==="source"?!!t.source:e==="photos"?!!((n=t.photos)!=null&&n.done)&&t.photos.hashes.length>0:e==="shot"?!!t.shot:e==="reuse"?t.reuse==="read":ree(t[e])}const see=e=>lm.filter(t=>t.applies(e)&&Kv(t.id,e)).map(t=>t.id);function QN(e){var t;return((t=lm.find(n=>n.applies(e)&&!Kv(n.id,e)))==null?void 0:t.id)??null}const JN=e=>{var t,n,r,a,i;return((t=e.source)==null?void 0:t.door)==="words"?!!((n=e.source.text)!=null&&n.trim()):((r=e.source)==null?void 0:r.door)==="photos"?(((a=e.photos)==null?void 0:a.hashes.length)??0)>0:((i=e.source)==null?void 0:i.door)==="shot"?!!e.shot:Mf.some(c=>$i(c,e[c])!==null)},Tk=e=>!!e.source&&QN(e)===null&&JN(e),H6=(e,t)=>JSON.stringify(e)!==JSON.stringify(t);function Gv(e,t){const n={...e},r=[];for(const[a,i]of Object.entries(t))H6(e[a],i)&&(i===void 0?delete n[a]:n[a]=i,r.push(a));if(r.length){const a=Math.min(...r.map(i=>wh.indexOf(i)));for(const i of wh)wh.indexOf(i)<=a||i in t||delete n[i]}for(const a of lm)n[a.id]!==void 0&&!a.applies(n)&&delete n[a.id];return n}function aee(e,t,n){var r,a;if(e==="source")return t.kind!=="choice"?null:t.id==="photos"?{source:{door:"photos"},photos:{hashes:((r=n.photos)==null?void 0:r.hashes)??[],done:!1}}:t.id==="guided"?{source:{door:"guided"}}:null;if(e==="reuse")return t.kind==="choice"&&t.id==="read"?{reuse:"read"}:null;if(qh(e)){const i=(a=n[e])==null?void 0:a.words,c=t.kind==="swatches"?t.picks[e]??Object.values(t.picks)[0]:t.kind==="choice"?t.id:void 0;if(c)return{[e]:{pick:c,...i?{words:i}:{}}};if(t.kind==="skip")return{[e]:{pick:qo,...i?{words:i}:{}}}}return null}function $k(e){var t;return(e==null?void 0:e.pick)===qo?[YJ,(t=e.words)==null?void 0:t.trim()].filter(Boolean).join(", "):$i("signature",e)}function $i(e,t){var a,i;if(!t)return null;const n=t.pick&&t.pick!==qo?(a=uo(e,t.pick))==null?void 0:a.words:void 0,r=(i=t.words)==null?void 0:i.trim();return n&&r?`${n}, ${r}`:n??r??null}const Dk=e=>e?`, ${VJ}`:"";function oee(e){var c,u,f,h,p,m,v;if(((c=e.source)==null?void 0:c.door)==="words"){const w=(e.source.text??"").trim(),y=$i("world",e.world),b=$i("light",e.light)??(XN(w).light?null:((f=uo("world",(u=e.world)==null?void 0:u.pick))==null?void 0:f.light)??null),k=$k(e.signature),S=[y,$i("surface",e.surface),b,k].filter(Boolean);return S.length?`${w.replace(/[.\s]+$/,"")}, ${S.join(", ")}${Dk(k)}.`:w}if(((h=e.source)==null?void 0:h.door)!=="guided")return"";const t=$i("world",e.world),n=$i("light",e.light)??((m=uo("world",(p=e.world)==null?void 0:p.pick))==null?void 0:m.light)??null,r=$k(e.signature),i=`${[t??"a place",$i("surface",e.surface),n,r].filter(Boolean).join(", ").replace(/^./,w=>w.toUpperCase())}${Dk(r)}.`;return(v=e.world)!=null&&v.pick?`${i.slice(0,-1)}. ${Ne.worldIsAStart}`:i}function iee(e){var t,n,r;return((t=e.source)==null?void 0:t.door)==="shot"?e.shot?[e.shot.hash]:[]:((n=e.source)==null?void 0:n.door)==="photos"&&((r=e.photos)!=null&&r.done)?e.photos.hashes:[]}const lee={answers:{},revision:0,editing:null,held:null,asides:[]};function cee(e,t){var n;switch(t.type){case"answer":{const r=Gv(e.answers,t.patch);return H6(r,e.answers)?{...e,answers:r,revision:e.revision+1,editing:null,held:null}:{...e,editing:null,held:null}}case"photos":{if(((n=e.answers.source)==null?void 0:n.door)!=="photos")return e;const r=[...new Set(t.hashes)].slice(0,4),a=e.editing==="photos";return{...e,answers:{...e.answers,photos:{hashes:r,done:a}},revision:e.revision+1}}case"edit":return Kv(t.id,e.answers)?{...e,editing:t.id,held:e.answers}:e;case"cancel-edit":return!e.held||!H6(e.held,e.answers)?{...e,editing:null,held:null}:{...e,answers:e.held,revision:e.revision+1,editing:null,held:null};case"aside":return{...e,asides:[...e.asides,t.aside].slice(-40)}}}const uee=e=>({answers:e.answers,revision:e.revision,asides:e.asides}),dee=/^[a-f0-9]{32}$/,Hk=/^[\w.:-]{1,80}$/;function fee(e){const t=e;if(!t||typeof t!="object"||typeof t.answers!="object"||!t.answers)return null;const n={},r=t.answers.source;r&&["photos","shot","guided","words"].includes(r.door)&&(n.source={door:r.door,...typeof r.text=="string"?{text:r.text.slice(0,400)}:{}});const a=t.answers.photos;a&&Array.isArray(a.hashes)&&(n.photos={hashes:a.hashes.filter(u=>typeof u=="string").slice(0,4),done:!!a.done});const i=t.answers.shot;if(i&&typeof i.id=="string"&&Hk.test(i.id)&&typeof i.hash=="string"&&dee.test(i.hash)){const u=i.scene,f=u&&typeof u.id=="string"&&Hk.test(u.id)&&typeof u.name=="string"?{id:u.id,name:u.name.slice(0,120)}:void 0;n.shot={id:i.id,hash:i.hash,...f?{scene:f}:{}}}t.answers.reuse==="read"&&(n.reuse="read");for(const u of Mf){const f=t.answers[u];if(!f||typeof f!="object")continue;const h=typeof f.pick=="string"&&(f.pick===qo||uo(u,f.pick))?f.pick:void 0,p=typeof f.words=="string"?f.words.slice(0,200):void 0;(h||p)&&(n[u]={...h?{pick:h}:{},...p?{words:p}:{}})}const c=Array.isArray(t.asides)?t.asides.filter(u=>u&&typeof u.said=="string"&&typeof u.reply=="string"&&typeof u.at=="string").map(u=>({said:u.said,reply:u.reply,at:u.at,q:typeof u.q=="string"?u.q:null})):[];return{answers:Gv({},n),revision:Number(t.revision)||0,editing:null,held:null,asides:c}}const eM=4,tM=800,Yv=60,nM={place:"",pictures:[],inputsRev:0,readRev:null,readTried:null,versions:[],current:-1,name:"",named:!1,job:null,error:null,saved:null,moreDeclined:!1,moreAsked:!1,setDrawn:!1,setDeclined:!1};function hee(e){return{...nM,place:e.place,pictures:e.pictures,readRev:0,versions:[{reading:e.reading,hash:e.hash,coverage:[],how:"read"}],current:0,name:e.name,named:!0}}const Or=e=>e.versions[e.current]??null,Ok=e=>e.versions.some(t=>!!t.hash);function pee(e,t){return!t||e.job||e.inputsRev===0||e.readRev!==null&&e.readRev===e.inputsRev||e.readTried===e.inputsRev?null:e.inputsRev}const rM=e=>e.readRev!==null&&e.readRev!==e.inputsRev;function mee(e,t){var n,r,a;switch(t.type){case"inputs":{const i=t.place.slice(0,tM),c=[...new Set(t.pictures)].slice(0,eM);return i===e.place&&c.join()===e.pictures.join()?e:{...e,place:i,pictures:c,inputsRev:e.inputsRev+1}}case"name":return{...e,name:t.text.slice(0,Yv),named:!0};case"started":return e.job?e:{...e,job:{id:t.id,kind:t.kind,ask:t.ask,inputsRev:e.inputsRev,pending:null,coverage:[],phase:t.kind==="again"?"drawing":t.kind==="change"?"changing":"reading",since:t.since},readTried:t.kind==="make"?e.inputsRev:e.readTried,error:null};case"stopping":return!e.job||e.job.id!==t.id||e.job.stopping?e:{...e,job:{...e.job,stopping:!0}};case"progress":{if(!e.job||e.job.id!==t.job.id)return e;const i={...e.job,pending:t.job.reading??e.job.pending,coverage:t.job.coverage??e.job.coverage,phase:t.job.phase,since:t.job.phaseAt??e.job.since};return Ik({...e,job:i},i.pending)}case"finished":{if(!e.job||e.job.id!==t.job.id)return e;const i=e.job,c=t.job,u={...e,job:null};if(i.kind==="make"&&i.inputsRev!==e.inputsRev)return u;const f=c.reading??(i.kind==="again"?((n=Or(e))==null?void 0:n.reading)??null:null),h=c.status==="failed"?c.error??Ne.failed:null;if(c.status==="cancelled"){if(!f)return{...u,error:i.kind==="make"?Ne.stoppedRead:Ne.stopped};if(i.kind==="again"&&!c.hash)return{...u,error:Ne.stoppedDraw}}const p=c.status==="cancelled"&&i.kind==="change"&&!c.hash;if(!f||i.kind==="again"&&!c.hash)return{...u,error:h};const m=i.kind==="make"?"read":i.kind==="change"?"change":e.versions.some(S=>S.hash)?"again":"draw",v={reading:f,hash:c.hash,ask:i.kind==="change"?i.ask:void 0,coverage:(r=c.coverage)!=null&&r.length?c.coverage:i.kind==="again"?((a=Or(e))==null?void 0:a.coverage)??[]:[],how:m},w=Or(e),y=i.kind==="make"&&!c.hash&&w&&!w.hash&&w.how==="read",b=y?e.versions.map((S,C)=>C===e.current?v:S):[...e.versions,v],k={...u,versions:b,current:y?e.current:b.length-1,readRev:i.kind==="make"?i.inputsRev:e.readRev,error:p?Ne.stoppedChange:h};return Ik(k,f)}case"lost":return!e.job||e.job.id!==t.id?e:{...e,job:null,error:t.error};case"put-back":return e.job||!e.versions[t.index]?e:{...e,current:t.index};case"forget-record":return e.job||!e.versions.length?e:{...e,versions:[],current:-1,error:null};case"edit-words":{const i=Or(e);if(e.job||!i||!t.reading.prompt.trim()||JSON.stringify(t.reading)===JSON.stringify(i.reading))return e;const c=[...e.versions,{reading:t.reading,hash:i.hash,coverage:i.coverage,how:"edit"}];return{...e,versions:c,current:c.length-1}}case"error":return{...e,error:t.text};case"saved":return{...e,saved:t.id,error:null};case"decline-more":return{...e,moreDeclined:!0};case"ask-more":return{...e,moreAsked:!0};case"set-drawn":return{...e,setDrawn:!0,setDeclined:!1};case"set-declined":return{...e,setDeclined:!0}}}function Ik(e,t){return e.named||!(t!=null&&t.name)?e:{...e,name:t.name.slice(0,Yv)}}function gee(e){var n;const t=e.job?e.job.phase==="drawing"?e.job.pending:null:((n=Or(e))==null?void 0:n.reading)??null;return t?!e.job&&rM(e)?{can:!1,why:Ne.stillReading,words:t}:e.name.trim()?{can:!0,why:null,words:t}:{can:!1,why:Ne.nameIt,words:t}:{can:!1,why:e.job?Ne.stillReading:null,words:null}}const Xg=e=>e.job?e.job.phase==="changing"?Ne.changing:e.job.phase==="drawing"?Ne.drawing:e.pictures.length?Ne.readingPhotos:Ne.reading:void 0;function vee(e){var r;const t=new Map;e.versions.forEach((a,i)=>{a.hash&&t.set(a.hash,i)});const n=((r=Or(e))==null?void 0:r.hash)??null;return[...t.entries()].sort((a,i)=>a[1]-i[1]).map(([a],i)=>({n:i+1,hash:a,current:a===n}))}const wee=(e,t)=>e.versions.slice(0,t+1).filter(n=>!!n.hash).length,yee=(e,t)=>e.versions.map(n=>n.hash).lastIndexOf(t);function bee(e){const t=[{label:Ne.placeLabel,text:e.prompt}];return e.lighting&&t.push({label:Ne.lightLabel,text:e.lighting}),e.camera&&t.push({label:Ne.cameraLabel,text:e.camera}),e.figure&&t.push({label:Ne.figureLabel,text:e.figureTreatment?`${Fk(e.figure)}, ${Fk(e.figureTreatment)}.`:e.figure}),t}const Fk=e=>e.replace(/[.\s]+$/,""),xee=/\b(presenters?|models?|influencers?|celebrit(y|ies)|actors?|actress(es)?)\b/i,kee=/\b(my|our|the|a|an)\s+(\w+\s+)?(products?|bottles?|serum|perfume|shoes?|bag|jar|packaging|package|logos?|brand|brand name|wordmark)\b/i,See=/\b(add|put|place|include|show|feature|with|holding|wearing|sitting|standing)\b/i,Eee=/\b(no|without|remove|removing|empty|nobody|none|take out|get rid of|less)\b/i,Cee=/^\s*(undo|go back|revert|back to|previous|the (first|last|previous|old|earlier) (one|version))\b/i,jee=/^\s*(hi|hello|hey|thanks|thank you|ok|okay|cool|nice|great|good|wow|yes|no)\b[\s!.]*$/i,Aee=/^(?:please\s+)?(?:(?:call|name)\s+(?:it|this|the\s+scene)|rename(?:\s+(?:it|this|the\s+scene))?)\s+(?:to\s+|as\s+)?["'\u201c\u2018]?(.+?)["'\u201d\u2019]?[.!]?$/i,sM=e=>{var t,n;return((n=(t=Aee.exec(e.trim()))==null?void 0:t[1])==null?void 0:n.trim())||null};function Nee(e){const t=e.trim(),n=sM(t);return n?{kind:"rename",name:n}:Cee.test(t)?{kind:"navigate",say:Ne.usePutBack}:jee.test(t)||/\?\s*$/.test(t)&&!/\b(make|can you|could you|try)\b/i.test(t)?{kind:"chatter",say:Ne.sayAChange}:(xee.test(t)||kee.test(t))&&See.test(t)&&!Eee.test(t)?{kind:"refuse",say:Ne.notInAScene}:{kind:"change"}}const Mee=(e,t)=>{var n;return!!((n=Or(e))!=null&&n.ask)&&Or(e).ask.trim().toLowerCase()===t.trim().toLowerCase()},aM=e=>!e.saved&&(e.versions.length>0||!!e.job||!!e.error),Ree=(e,t)=>e.saved?!1:t?e.versions.length>t.versions.length||e.current!==t.current||e.place!==t.place||e.pictures.join()!==t.pictures.join()||e.name!==t.name||!!e.job:!!(e.place.trim()||e.pictures.length||e.versions.length||e.job),oM=1;function Pee(e){return JSON.stringify({v:oM,...e})}function Lee(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||t.v!==oM)return null;const n=u=>Array.isArray(u)?u.filter(f=>typeof f=="string"):[],r=u=>!!u&&typeof u.prompt=="string"&&typeof u.name=="string",a=Array.isArray(t.versions)?t.versions.filter(u=>u&&r(u.reading)).map(u=>({reading:u.reading,hash:typeof u.hash=="string"?u.hash:null,ask:typeof u.ask=="string"?u.ask:void 0,coverage:n(u.coverage),how:["read","draw","again","change","edit"].includes(u.how)?u.how:u.hash?"draw":"read"})):[],i=t.job&&typeof t.job.id=="string"&&["make","again","change"].includes(t.job.kind)?{id:t.job.id,kind:t.job.kind,ask:typeof t.job.ask=="string"?t.job.ask:void 0,inputsRev:Number(t.job.inputsRev)||0,pending:r(t.job.pending)?t.job.pending:null,coverage:n(t.job.coverage),phase:["reading","changing","drawing"].includes(t.job.phase)?t.job.phase:null,since:typeof t.job.since=="string"?t.job.since:null,...t.job.stopping===!0?{stopping:!0}:{}}:null,c=Number.isInteger(t.current)&&t.current>=-1&&t.current<a.length?t.current:a.length-1;return{place:typeof t.place=="string"?t.place.slice(0,tM):"",pictures:n(t.pictures).slice(0,eM),inputsRev:Number(t.inputsRev)||0,readRev:t.readRev===null||t.readRev===void 0?null:Number(t.readRev),readTried:t.readTried===null||t.readTried===void 0?null:Number(t.readTried),versions:a,current:c,name:typeof t.name=="string"?t.name.slice(0,Yv):"",named:!!t.named,job:i,error:typeof t.error=="string"?t.error:null,saved:typeof t.saved=="string"&&t.saved?t.saved:null,moreDeclined:t.moreDeclined===!0,moreAsked:t.moreAsked===!0,setDrawn:t.setDrawn===!0,setDeclined:t.setDeclined===!0}}function Tee(e){if(!e||e.loading)return"";const t=e.items.length;return t?Ne.shotCount(t,e.more):e.error?Ne.shotsFailed:e.query.trim()?Ne.shotNotFound(e.query.trim()):Ne.shotNone}function _k(e){var n;const t=(n=e==null?void 0:e.tokens)==null?void 0:n.find(r=>(r==null?void 0:r.t)==="template");return typeof(t==null?void 0:t.id)=="string"&&t.id?t.id:typeof(e==null?void 0:e.templateId)=="string"&&e.templateId?e.templateId:null}function $ee(e){return bee(e).map(t=>t.label===Ne.placeLabel?t.text:`${t.label}: ${t.text.replace(/[.\s]+$/,"")}.`).join(" ")}const Dee=new Set([Ne.stopped,Ne.stoppedRead,Ne.stoppedDraw,Ne.stoppedChange,Ne.lost]),Zk=e=>Dee.has(e)?e:Ne.failedFirst(e.replace(/[.\s]+$/,""));function Vk(e,t,n,r,a){var y,b,k,S,C,j,N,P,$,R,E,M,L,H;const i=t.answers,c=n?{reopened:!0}:{};if(e==="source")return{id:e,kind:"choice",prompt:Ne.source,options:[{id:"photos",label:Ne.addPictures},{id:"guided",label:Ne.guideMe}],given:((y=i.source)==null?void 0:y.door)==="words"?void 0:((b=i.source)==null?void 0:b.door)==="shot"?"photos":(k=i.source)==null?void 0:k.door,note:((S=i.source)==null?void 0:S.door)==="words"?i.source.text:void 0,...c};if(e==="photos")return{id:e,kind:"photos",prompt:Ne.photos,hashes:((C=i.photos)==null?void 0:C.hashes)??[],max:4,busy:r>0,submit:Ne.readThem,back:Ne.guideInstead,drop:Ne.photosDrop,...c,...a&&a.any!==!1&&!((j=i.photos)!=null&&j.hashes.length)&&r===0&&!n?{instead:Ne.fromShot,...a.any===null?{insteadWaiting:!0}:{}}:{}};if(e==="shot"){const D=(a==null?void 0:a.query.trim())??"";return{id:e,kind:"pick",prompt:Ne.shot,items:(a==null?void 0:a.items)??[],given:(N=i.shot)==null?void 0:N.id,search:{label:Ne.shotSearch,value:(a==null?void 0:a.query)??""},more:(a==null?void 0:a.more)??!1,loading:(a==null?void 0:a.loading)??!1,empty:a!=null&&a.error?Ne.shotsFailed:D?Ne.shotNotFound(D):Ne.shotNone,status:Tee(a),back:n?void 0:Ne.backToPictures,...c}}if(e==="reuse"){const D=(($=(P=i.shot)==null?void 0:P.scene)==null?void 0:$.name)??"";return{id:e,kind:"choice",prompt:Ne.madeIn(D),options:[{id:"use",label:Ne.takeScene(D)},{id:"read",label:Ne.readNew}],given:i.reuse,...c}}const u=i[e],f=e==="light"?(E=uo("world",(R=i.world)==null?void 0:R.pick))==null?void 0:E.light:void 0,h=e==="surface"&&!!uo("world",(M=i.world)==null?void 0:M.pick),p=(u==null?void 0:u.pick)===qo||u==null?void 0:u.pick,m=(u==null?void 0:u.pick)===qo,v=u==null?void 0:u.words,w=((L=i.source)==null?void 0:L.door)==="words";return{id:e,kind:"swatches",prompt:iM(e,i),row:KJ(e,(H=i.world)==null?void 0:H.pick),layout:e==="world"?"grid":void 0,hint:e==="world"&&!w?Ne.worldHint:void 0,skip:f?Ne.keepWorldLight:h?Ne.keepWorldSurface:e==="signature"&&!w?Ne.suggestOne:w?Ne.leaveToReading:Ne.skip,describe:Ne.describeInstead,given:p,skipped:m,note:v,...c}}function iM(e,t){var r,a,i;const n=e==="light"?(a=uo("world",(r=t.world)==null?void 0:r.pick))==null?void 0:a.light:void 0;if(n)return Ne.worldLightPrompt(n);if(((i=t.source)==null?void 0:i.door)==="words"){if(e==="world")return Ne.followWorld;if(e==="light")return Ne.followLight}return Qi[e].prompt}function Hee(e,t){var n,r;return e==="source"?Ne.source:e==="photos"?Ne.photos:e==="shot"?Ne.shot:e==="reuse"?Ne.madeIn(((r=(n=t.shot)==null?void 0:n.scene)==null?void 0:r.name)??""):iM(e,t)}function Oee(e,t){var f,h,p,m,v,w,y,b,k,S,C;if(e==="source")return((f=t.source)==null?void 0:f.door)==="words"?{text:t.source.text??""}:((h=t.source)==null?void 0:h.door)==="shot"?{text:Ne.fromShotAnswer}:{text:((p=t.source)==null?void 0:p.door)==="photos"?Ne.addPictures:Ne.guideMe};if(e==="shot")return{text:Ne.shotAnswer,photos:t.shot?[t.shot.hash]:[]};if(e==="reuse")return{text:Ne.readNew};if(e==="photos"){const j=((m=t.photos)==null?void 0:m.hashes.length)??0;return{text:`${j} ${j===1?"picture":"pictures"}`,photos:(v=t.photos)==null?void 0:v.hashes}}const n=t[e],r=e==="light"&&(n==null?void 0:n.pick)===qo&&((y=uo("world",(w=t.world)==null?void 0:w.pick))==null?void 0:y.light),a=e==="surface"&&(n==null?void 0:n.pick)===qo&&!!uo("world",(b=t.world)==null?void 0:b.pick),i=r?Ne.keepWorldLight:a?Ne.keepWorldSurface:((k=t.source)==null?void 0:k.door)==="words"?Ne.leaveToReading:e==="signature"?Ne.suggestOne:Ne.skip,c=(n==null?void 0:n.pick)===qo?i:(S=uo(e,n==null?void 0:n.pick))==null?void 0:S.label,u=(C=n==null?void 0:n.words)==null?void 0:C.trim();return{text:c&&u?`${c}, ${u}`:u??c??""}}const zk=(e,t)=>e.at<t.at?-1:e.at>t.at?1:0,Iee=e=>{const t=Or(e);return t?`${t.hash?"decide":"agree"}-${e.current}`:null};function Fee(e){var v,w,y,b;const{setup:t,studio:n,edit:r}=e,a=t.answers,i=[],c=new Set,u=k=>{for(const S of t.asides.filter(C=>C.q===k&&!c.has(C)).sort(zk))c.add(S),i.push(...ri(S))};r?i.push({kind:"scenri",id:"edit-open",text:Ne.editOpen(r.name)}):i.push({kind:"you",id:"intent",text:Ne.intent});const f=r?null:QN(a);if(!r)for(const k of see(a)){if(i.push({kind:"scenri",id:`asked-${k}`,text:Hee(k,a),quiet:!0}),u(k),t.editing===k){i.push({kind:"question",question:Vk(k,t,!0,e.uploading,e.shots)});continue}const S=Oee(k,a);i.push({kind:"you",id:k,text:S.text,photos:S.photos,editable:!n.job&&!n.saved})}const h=n.versions.findIndex(k=>!!k.hash);n.versions.forEach((k,S)=>{if(k.how==="read"&&S>0&&i.push({kind:"scenri",id:`reread-${S}`,text:Ne.readAgain}),k.how==="change"&&i.push({kind:"you",id:`ask-${S}`,text:k.ask??""}),k.hash&&(k.how==="draw"&&i.push({kind:"you",id:`draw-${S}`,text:Ne.draw}),k.how==="again"&&i.push({kind:"you",id:`again-${S}`,text:Ne.tryAgain}),S===h&&!r&&Bk(i,e),i.push({kind:"scenri",id:`pic-${S}`,text:k.how==="change"?Ne.changed:k.how==="again"?Ne.again:Ne.here,thumb:k.hash,label:Ne.version(wee(n,S)),view:"scene",current:S===n.current,restore:S===n.current||n.saved?void 0:{view:"scene",hash:k.hash}})),S===n.current)for(const[C,j]of k.coverage.entries())i.push({kind:"scenri",id:`cover-${S}-${C}`,text:j});u(`agree-${S}`),u(`decide-${S}`)});const p=n.job;(p==null?void 0:p.kind)==="again"&&i.push({kind:"you",id:`pending-${p.id}`,text:h<0?Ne.draw:Ne.tryAgain}),(p==null?void 0:p.kind)==="change"&&i.push({kind:"you",id:`pending-${p.id}`,text:p.ask??""}),(p==null?void 0:p.kind)==="again"&&h<0&&!r&&Bk(i,e),n.saved&&_ee(i,e);let m=null;if(f)m=Vk(f,t,!1,e.uploading,e.shots);else if(p){if(p.kind==="again"&&h<0&&!n.named&&!e.editingName){const k=((w=p.pending??((v=Or(n))==null?void 0:v.reading))==null?void 0:w.name)??n.name;m={id:"name",kind:"text",prompt:Ne.name,starters:k?[{label:k,text:k}]:void 0}}}else if(n.saved)m=Zee(e);else{const k=Or(n);if(e.stale&&!r)n.error&&(m={id:"retry",kind:"confirm",tone:"alert",prompt:Zk(n.error),options:[{id:"retry",label:Ne.retry}]});else if(!k&&n.error)m={id:"retry",kind:"confirm",tone:"alert",prompt:Zk(n.error),options:[{id:"retry",label:Ne.retry}]};else if(k){n.error&&i.push({kind:"scenri",id:`error-${n.versions.length}`,text:n.error,tone:"alert"});const S=$ee(k.reading);if(k.hash)m={id:`decide-${n.current}`,kind:"confirm",prompt:(r?Ne.decideEdit:Ne.decide)(n.name.trim()||k.reading.name),quote:S,quoteLabel:Ne.readingHead,options:[{id:"use",label:r?Ne.saveChanges:Ne.use},...e.canDraw?[{id:"again",label:Ne.tryAgain}]:[]],describe:Ne.changeSomething};else{const C=!r&&((y=a.source)==null?void 0:y.door)==="photos",j=!r&&((b=a.source)==null?void 0:b.door)==="shot",N=j?[{id:"another-shot",label:Ne.anotherShot}]:[];m={id:`agree-${n.current}`,kind:"confirm",prompt:e.canDraw?k.how==="change"?Ne.agreeChanged:C?Ne.agreePhotos:j?Ne.agreeShot:Ne.agree:Ne.agreeBlind,quote:S,quoteLabel:Ne.readingHead,options:[...e.canDraw?[{id:"draw",label:Ne.draw}]:[{id:"use",label:r?Ne.saveChanges:Ne.saveWords}],...N]}}}}for(const k of t.asides.filter(S=>!c.has(S)).sort(zk))i.push(...ri(k));return e.note&&i.push({kind:"scenri",id:`note-${e.note.length}-${e.note.slice(0,12)}`,text:e.note}),m&&i.push({kind:"question",question:m}),i}function _ee(e,t){const{studio:n,edit:r,set:a,canDraw:i}=t;if(e.push({kind:"you",id:"use",text:r?Ne.saveChanges:i?Ne.use:Ne.saveWords}),!a)return;const c=a.tiles.length>0||a.running;e.push({kind:"scenri",id:"saved",text:c?Ne.inUse(a.who):a.read&&a.noSubject&&i?Ne.noLibrary:a.read&&i&&a.first.length?Ne.savedQuiet:Ne.saved}),(n.setDrawn||n.setDeclined)&&e.push({kind:"you",id:"set-start",text:n.setDrawn?a.stale?Ne.drawThemAgain:Ne.drawThem:Ne.notNow});const u=n.moreAsked?Ne.addThem:n.moreDeclined?Ne.notNow:null;let f=!1;const h=()=>{!u||f||(f=!0,e.push({kind:"you",id:"more",text:u}))};for(const p of a.tiles)p.role!=="hero"&&p.role!=="close"&&h(),p.state==="shown"&&p.hash?e.push({kind:"scenri",id:`ex-${p.role}-${p.hash}`,text:Ne.exampleHere[p.role],thumb:p.hash,label:rc[p.role],view:p.role,...a.running||n.job?{}:{retry:p.role}}):p.state==="failed"&&e.push({kind:"scenri",id:`ex-failed-${p.role}`,text:Ne.exampleFailed(rc[p.role],p.error??Ne.failed),tone:"alert"});h()}function Zee(e){var c;const{set:t,studio:n}=e,r=n.name.trim()||((c=Or(n))==null?void 0:c.reading.name)||"The scene";if(!t||t.running||!t.read)return null;if(e.canDraw&&t.first.length&&!n.setDrawn&&!n.setDeclined)return{id:"set-start",kind:"confirm",prompt:t.stale?Ne.staleSet(t.first.length):Ne.showInUse(t.who,t.first.map(u=>rc[u])),options:[{id:"draw-set",label:t.stale?Ne.drawThemAgain:Ne.drawThem},{id:"not-now",label:Ne.notNow}]};const a=t.tiles.some(u=>u.role==="hero"&&u.state==="shown");if(e.canDraw&&a&&t.missing.length&&!n.moreDeclined&&!n.moreAsked)return{id:"set-more",kind:"confirm",prompt:Ne.more(t.missing.map(u=>rc[u])),options:[{id:"more",label:Ne.addThem},{id:"not-now",label:Ne.notNow}]};const i=t.tiles.filter(u=>u.state==="failed");return{id:"set-done",kind:"confirm",prompt:i.length?Ne.readyMissing(r):t.tiles.length?Ne.ready(r):Ne.readyUndrawn(r),options:[...i.length&&e.canDraw?[{id:"retry-failed",label:Ne.tryAgain}]:[],{id:"done",label:t.finish}]}}function Bk(e,t){if(!t.studio.named&&!t.editingName)return;e.push({kind:"scenri",id:"asked-name",text:Ne.name,quiet:!0});const n=!t.studio.saved;e.push({kind:"you",id:"name",text:t.studio.name,editable:n,editing:t.editingName||void 0})}function Vee(e,t){var c,u,f;const{setup:n,studio:r}=e,a=(h,p=!1)=>({target:{kind:"off",why:h},placeholder:"",label:Ne.lineLabel,action:Ne.send,working:p,attach:!1});if(r.saved)return a("",!!r.job||!!((c=e.set)!=null&&c.running));const i=n.editing;return i==="source"?Lo({kind:"source"},Ne.sourcePlaceholder,!0):i&&qh(i)?Lo({kind:"row",id:i},Ne.rowPlaceholder(Pk(i))):i==="photos"?a(Ne.photosOff):i==="shot"?a(Ne.shotOff):i==="reuse"?a(Ne.reuseOff):!t&&!r.job&&n.answers.source&&!JN(n.answers)?Lo({kind:"source"},Ne.nothingSaidPlaceholder,!0):t?t.id==="source"?Lo({kind:"source"},Ne.sourcePlaceholder,!0):t.id==="photos"?{...a(Ne.photosOff),attach:!0}:t.id==="shot"?a(Ne.shotOff):t.id==="reuse"?a(Ne.reuseOff):qh(t.id)?Lo({kind:"row",id:t.id},Ne.rowPlaceholder(Pk(t.id))):t.id==="name"?Lo({kind:"name"},Ne.namePlaceholder):t.id==="retry"?Lo({kind:"source"},Ne.nothingSaidPlaceholder,!0):t.id.startsWith("agree-")?e.canDraw?Lo({kind:"add"},e.edit?Ne.addPlaceholder:((u=n.answers.source)==null?void 0:u.door)==="photos"?Ne.keepPlaceholder:((f=n.answers.source)==null?void 0:f.door)==="shot"?Ne.keepShotPlaceholder:Ne.addPlaceholder):a(""):t.id.startsWith("decide-")?{...Lo({kind:"change"},Ne.changePlaceholder),action:Ne.change}:a(""):r.job?a("",!0):a("")}function Lo(e,t,n=!1){return{target:e,placeholder:t,label:t,action:Ne.send,working:!1,attach:n}}const zee=/\b(studio|room|lobby|hall|beach|forest|desert|street|city|kitchen|bathroom|bedroom|office|garden|park|field|mountain|shore|sea|ocean|lake|river|cave|rooftop|roof|terrace|warehouse|loft|gallery|museum|church|hotel|restaurant|caf[eé]|bar|shop|store|market|set|stage|backdrop|wall|floor|marble|concrete|wood|stone|light|dusk|dawn|night|sun|neon|fog|rain|snow|sand|water|glass|metal|plaster|fabric|interior|outdoors?|indoors?|landscape|pool|library|station|tunnel|bridge|corridor|courtyard|balcony|window|sky|cyclorama|cyc|seamless|brutalist|minimal)\b/i,lM=e=>zee.test(e)||e.trim().split(/\s+/).length>=5&&!/\?\s*$/.test(e);function Uk(e,t){switch(e){case"greeting":case"ack":return t==="source"?Ne.greet:Ne.greetRow;case"question":case"help":return Ne.askHelp;case"nav":return Ne.startOverIsUp;case"go":return t==="source"?Ne.goFirst:Ne.greetRow;default:return Ne.notAPlace}}function Wk(e,t){if(t==="source"){const r=Zo(e,lM);return r==="vague"?null:r}const n=Zo(e,()=>!1);return n==="vague"||n==="intent"||n==="likeness"?null:n}const cM=2;function Bee(e,t){return JSON.stringify({v:cM,setup:uee(e),studio:Pee(t)})}function uM(e){if(!e)return null;try{const t=JSON.parse(e);return(t==null?void 0:t.v)!==cM?null:{setup:fee(t.setup),studio:Lee(typeof t.studio=="string"?t.studio:null)}}catch{return null}}const dM=e=>`scenri:scene-studio:${e}:`;function Uee(e,t){var f,h,p;if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(n!=null&&n.sceneId)return null;const r=uM(typeof(n==null?void 0:n.session)=="string"?n.session:null),a=r==null?void 0:r.studio;if(!a||!aM(a))return null;const i=[a.versions[a.current],...[...a.versions].reverse()].find(m=>m==null?void 0:m.hash),c=Or(a),u=a.place.trim().split(/\s+/).slice(0,5).join(" ");return{convo:e,name:a.name.trim()||(c==null?void 0:c.reading.name)||((h=(f=a.job)==null?void 0:f.pending)==null?void 0:h.name)||u,hash:(i==null?void 0:i.hash)??null,drawing:!!a.job,failed:!a.job&&!!a.error,read:a.versions.length>0,jobId:((p=a.job)==null?void 0:p.id)??null,at:Number(n.at)||0}}function Wee(e,t){const n=new Map(t.filter(i=>i.kind==="scene").map(i=>[i.id.slice(6),i])),r=e.map(i=>{const c=i.jobId?n.get(i.jobId):void 0;return c?i.drawing?{...i,name:i.name||c.name,hash:c.status==="done"&&c.thumb?c.thumb:i.hash,drawing:c.status==="running",failed:c.status==="failed"}:i:{...i,drawing:!1}}),a=new Set(e.map(i=>i.convo));for(const i of t)i.kind!=="scene"||i.status!=="running"||!i.conversation||i.sceneId||a.has(i.conversation)||(a.add(i.conversation),r.push({convo:i.conversation,name:i.name,hash:null,drawing:!0,failed:!1,read:!1,jobId:i.id.slice(6),at:Date.parse(i.startedAt)||0}));return r.filter(i=>i.drawing||i.hash||i.failed||i.read).sort((i,c)=>c.at-i.at)}function Kee(e){return e.drawing?"Drawing":e.failed?"Did not finish":e.hash?"Drawn, not used yet":"Not drawn yet"}function yh(e){const t=dM(e);return cs.keys(t).map(n=>Uee(n.slice(t.length),cs.get(n))).filter(n=>!!n)}function Gee(e,t){const n=`${dM(e)}${t}`;cs.del(n),_i(n)}function Yee(e,t,n,r){const a=_X(e,n)||e==="presenter"&&!!r;switch(e){case"first-shot":case"reuse":return t.onHub?{kind:"stay"}:a?{kind:"hub"}:{kind:"head"};case"refine":return t.onShot||t.onHub?{kind:"stay"}:a?{kind:"hub"}:{kind:"head"};case"presenter":return r||n.some(i=>i==="start"||i==="face"||i==="save")?t.onStudio?{kind:"stay"}:{kind:"studio"}:t.onStudio||t.onPresenters?{kind:"stay"}:a?{kind:"presenters"}:{kind:"head"};case"product":return a&&n.includes("product")?{kind:"dialog",asset:"product"}:t.onProducts?{kind:"stay"}:a?{kind:"products"}:{kind:"head"};case"scene":return a&&n.some(i=>i==="start"||i==="words"||i==="use")?t.onSceneStudio?{kind:"stay"}:{kind:"sceneStudio"}:t.onSceneStudio||t.onScenes?{kind:"stay"}:a?{kind:"scenes"}:{kind:"head"}}}function fM(){const{brand:e,recent:t,products:n}=on(),r=Dn(),a=cl(),i=!!un(ut.hub),c=!!un(ut.hubShot),u=!!un(ut.products),f=!!un(ut.scenes),h=!!un(ut.presenters),p=!!un(ut.presenterStudio),m=!!un(ut.sceneStudio);return s.useCallback(async v=>{var j,N;const w=t.find(P=>P.kind!=="root"&&P.status==="done"&&P.images.length>0),y=v==="refine"&&!w?"first-shot":v==="reuse"&&n.length===0?"product":v,b=mh().active;(b==null?void 0:b.task)===y&&b.brandId===e.id&&!b.paused||await $l({start:{task:y,brandId:e.id}});const k=((N=(j=mh().progress)==null?void 0:j[y])==null?void 0:N.reached)??[],S=mh().activeDraftId,C=Yee(y,{onHub:i,onShot:c,onProducts:u,onScenes:f,onPresenters:h,onStudio:p,onSceneStudio:m},k,S);switch(C.kind!=="head"&&h6(),C.kind){case"stay":try{window.localStorage.removeItem(f6(e.id,y)),(y==="first-shot"||y==="reuse")&&window.localStorage.removeItem(Bj(e.id))}catch{}return(y==="first-shot"||y==="reuse")&&i?r(mr(e)):void 0;case"head":return Uj(e.id,y);case"hub":return r(mr(e));case"products":return r(Cu(e));case"scenes":return r(Kl(e));case"presenters":return r(Uo(e));case"studio":return r(Ui(e,S));case"sceneStudio":{const P=yh(e.id).sort(($,R)=>R.at-$.at)[0];return r(Bi(e,(P==null?void 0:P.convo)??null))}case"dialog":return a(C.asset)}},[e,t,n,r,a,i,c,u,f,h,p,m])}const qee=Number(window.localStorage.getItem("scenri:welcome-settle-ms")??900),Xee='[role="dialog"]:not(.sc-coach):not(.sc-attachpanel):not(.sc-swap), [role="alertdialog"], .sc-lightbox',Qee=["settings","setup","new","whatsnew","learn","welcome"],Jee='[data-guide="compose"] .sc-attachpanel';function ete(){var ee,He,We,Ue,Ge,me,_e;const e=hv(),t=SN(),n=Rn(),{brand:r,recent:a,subscribeActivity:i,products:c,importing:u}=on(),{tasks:f,builds:h}=Va(),{push:p}=ir(),m=fM(),v=Dn(),[w]=tl(),y=Ns("new"),b=!!un(ut.brand),k=!!un(ut.hub),S=((ee=un(ut.hubShot))==null?void 0:ee.params.shotId)??null,C=!!un(ut.presenterStudio),j=!!un(ut.sceneStudio),N=!!un(ut.products),P=!!un(ut.scenes),$=!!un(ut.presenters),R=e.active,E=R&&R.brandId===r.id?R.task:null,M=E&&!(R!=null&&R.paused)?E:null,L=M==="first-shot"||M==="reuse"?"generation":M==="refine"?"edit":null,H=e.loaded&&e.eligible&&e.welcome===null,[D,K]=s.useState(e.activeNodes);s.useEffect(()=>K(e.activeNodes),[e.activeNodes]),s.useEffect(()=>{if(!(!L||!R))return i(U=>K(pe=>RX(pe,U,R.since,L)))},[L,R,i]);const O=!!((He=t.composer)!=null&&He.busy),_=s.useRef(!1),[re,z]=s.useState(!1);s.useEffect(()=>{_.current&&!O&&L&&(z(!0),Ng().finally(()=>z(!1))),_.current=O},[O,L]);const[,F]=s.useState(0),Q=s.useRef(0),V=s.useCallback(()=>{cancelAnimationFrame(Q.current),Q.current=requestAnimationFrame(()=>F(U=>U+1))},[]);s.useEffect(()=>{if(!M&&!H)return;const U=new MutationObserver(V);return U.observe(document.body,{childList:!0,subtree:H}),window.addEventListener("resize",V),()=>{cancelAnimationFrame(Q.current),U.disconnect(),window.removeEventListener("resize",V)}},[M,H,V]);const[I,B]=s.useState(()=>!document.hidden);s.useEffect(()=>{const U=()=>B(!document.hidden);return document.addEventListener("visibilitychange",U),()=>document.removeEventListener("visibilitychange",U)},[]);const Y=!!M||H,ae=Qee.some(U=>w.has(U)),X=Y&&(ae||[...document.querySelectorAll(Xee)].some(U=>!U.closest("[data-radix-popper-content-wrapper], .sc-shotsheet"))),le=w.get("new"),ke=M?`scenri:guide-begun:${r.id}:${M}`:null,[te,be]=s.useState(!1);s.useEffect(()=>{be(!!ke&&window.localStorage.getItem(ke)==="1")},[ke]);const G=s.useCallback(()=>{if(ke)try{window.localStorage.setItem(ke,"1")}catch{}be(!0)},[ke]),J=e.heading,ne=U=>!!U&&(J==null?void 0:J.brandId)===r.id&&J.task===U&&!X,W=U=>U==="first-shot"||U==="reuse"||U==="refine"?k:U==="product"?N:U==="scene"?P:U==="presenter"?$||C:!1,[he,Xe]=s.useState(!1);s.useEffect(()=>{let U=!1;try{U=!!M&&window.localStorage.getItem(f6(r.id,M))==="1"}catch{}Xe(U)},[M,r.id,J]),s.useEffect(()=>{if(!(!J||J.brandId!==r.id)&&W(J.task)){try{window.localStorage.setItem(f6(r.id,J.task),"1")}catch{}Xe(!0),(J.task==="first-shot"||J.task==="reuse")&&G(),h6()}},[J,k,N,P,$,C,r.id,G]);const tt=s.useRef(null);s.useEffect(()=>{const U=tt.current;!U||W(U)||(tt.current=null,Uj(r.id,U))},[k,N,P,$,C,r.id]),s.useEffect(()=>{e.loaded&&!E&&J&&h6()},[e.loaded,E,J]);let ze=null;if(M==="first-shot"||M==="reuse"){const U=((We=t.composer)==null?void 0:We.brandId)===r.id?t.composer:null,pe=k&&ne(M),Oe={here:k&&!X,heading:ne(M)&&!k,composer:U&&re?{...U,busy:!0}:U,nodes:D,begun:te||pe||D.length>0};ze=M==="reuse"?gN(Oe):mN(Oe)}else if(M==="refine"){const U=((Ue=t.composer)==null?void 0:Ue.brandId)===r.id?t.composer:null,pe=!!S;ze=xX({here:pe||k&&!X,heading:ne(M)&&!k&&!pe,open:pe,armed:k&&!!(U!=null&&U.refining),nodes:D,asking:pe?!!Pl(wN):!!Pl(Zh)})}else M==="presenter"?ze=yN({heading:ne(M)&&!$&&!C,onPage:$&&!C&&!X,studio:C?t.studio:null}):M==="scene"?ze=SX({heading:ne(M)&&!P&&!j,onPage:P&&!j&&!X,studio:j?t.studio:null}):M==="product"&&(ze=EX({heading:ne(M)&&!N,onPage:N&&!X&&le!=="product",dialogOpen:le==="product"}));const nt=((Ge=t.composer)==null?void 0:Ge.brandId)===r.id?t.composer:null,ce=M==="first-shot"&&nt?vN(nt):M==="reuse"&&nt?nt.products===0?"product":nt.scene?null:"scene":null,ve=!!((me=t.composer)!=null&&me.pickerOpen);s.useEffect(()=>{ve&&(M==="first-shot"&&!ce?window.dispatchEvent(new Event("scenri:guide-close-picker")):ce&&window.dispatchEvent(new CustomEvent("scenri:guide-picker",{detail:{tab:Bx[ce]}})))},[M,ve,ce]),s.useEffect(()=>{M==="first-shot"&&!ce&&window.dispatchEvent(new CustomEvent("scenri:guide-picker",{detail:{tab:null}}))},[M,ce]),s.useEffect(()=>{if(M)return document.documentElement.dataset.guideTask=M,()=>{delete document.documentElement.dataset.guideTask}},[M]);const Pe=(ze==null?void 0:ze.point)===Jee&&window.innerWidth<1024;if(s.useEffect(()=>{if(Pe)return document.documentElement.dataset.guidePicker="",()=>{delete document.documentElement.dataset.guidePicker}},[Pe]),M&&ze&&ze.voice!=="quiet"){const U=ZX(M,ze.id);U&&(ze={...ze,...U})}const ue=M&&ze&&ze.voice!=="quiet"?ze.id:null,Ee=s.useRef("");s.useEffect(()=>{var pe,Oe;if(!M||!ue)return;const U=`${M}:${ue}`;Ee.current!==U&&(Ee.current=U,!((Oe=(pe=e.progress)==null?void 0:pe[M])!=null&&Oe.reached.includes(ue))&&$l({reached:{task:M,moment:ue}}))},[M,ue,e.progress]);const Ke=ze,ye=s.useRef(new Set),Se=s.useCallback(U=>{ye.current.add(U),$l({finish:U})},[]),Ie=s.useCallback(U=>{$l({dismiss:U}),p({kind:"info",title:"Guide closed",detail:"Continue it any time from Learn."})},[p]);s.useEffect(()=>{M==="first-shot"&&S&&D.some(U=>U.id===S&&U.status==="done"&&U.images>0)&&Se("first-shot")},[M,S,D,Se]),s.useEffect(()=>{M==="refine"&&S&&Ng()},[M,S]);const Be=s.useRef(!1);s.useEffect(()=>{if(M!=="refine"){Be.current=!1;return}S?Be.current=!0:Be.current&&(Be.current=!1,Se("refine"))},[M,S,Se]);const Re=E==="presenter"||E==="scene"||E==="product",Ze=h.filter(U=>!U.finished).length;s.useEffect(()=>{Re&&Ng()},[Re,r,c.length,Ze,u]),s.useEffect(()=>{Re&&e.counts&&jX(e,e.counts)&&Se(R==null?void 0:R.task)},[Re,e,R,Se]);const Qe=!!((_e=t.overlay)!=null&&_e.engaged);s.useEffect(()=>{if(!e.loaded||!e.eligible)return;const U={eligible:e.eligible,hidden:e.hidden,done:e.done,dismissed:e.dismissed,active:R},Oe=!!S&&Qe&&a.some(Le=>Le.id===S&&Le.status==="done")&&K1("refine",U)?"refine":j&&K1("scene",U)?"scene":le==="product"&&K1("product",U)?"product":C&&K1("presenter",U)?"presenter":null;!Oe||ye.current.has(Oe)||(ye.current.add(Oe),$l({start:{task:Oe,brandId:r.id}}))},[e,R,S,Qe,a,le,C,j,r.id]);const[lt,Lt]=s.useState(""),Ut=s.useRef(Ke);Ut.current=Ke;const Ct=s.useCallback((U,pe)=>{if(Lt(""),pe)return;const Oe=Ut.current,Le=Oe?[Oe.title,Oe.body].filter(Boolean).join(". "):"";Le&&requestAnimationFrame(()=>Lt(Le))},[]),[cn,Fe]=s.useState(!1),mt=Ns("welcome"),it=mt.value!==null,St=b&&n.showcaseLoaded||k,xt=h.some(U=>!U.finished)||f.some(U=>U.state==="running"&&U.kind!=="catalog"),Nt=NX({onMainPage:b||k,eligible:e.eligible,welcome:e.welcome,ready:St&&!document.querySelector('[data-variant="skeleton"]'),visible:I,blocked:X,busy:xt});s.useEffect(()=>{if(!Nt)return;const U=window.setTimeout(()=>Fe(!0),qee);return()=>window.clearTimeout(U)},[Nt]);const Kt=s.useMemo(()=>MX(n.showcase).map(U=>tte(U.previewUrl)),[n.showcase]),et=n.engines.some(U=>U.available),gt=c.length>0,ot=Ke&&(Ke.voice==="ask"||Ke.voice==="note")?Ke:null,kn=ot!=null&&ot.shell?Pl(ot.shell):document.body,dt=ot!=null&&ot.point?Pl(ot.point):null,Gt=(ot==null?void 0:ot.live)??(ot!=null&&ot.point?[ot.point]:[]),Ft=Gt.map(U=>Pl(U)).filter(U=>!!U),en=((ot==null?void 0:ot.also)??[]).map(U=>Pl(U)).filter(U=>!!U),Jt=((ot==null?void 0:ot.lit)??[]).map(U=>Pl(U)).filter(U=>!!U),se=!!ot&&!!kn&&(!ot.point||!!dt)&&Ft.length===Gt.length,oe=ot&&!se?ot:null,we=cn||se;s.useEffect(()=>Yx(we),[we]),s.useEffect(()=>()=>Yx(!1),[]),s.useEffect(()=>{if(!oe)return;const U=(oe.shell?document.querySelector(oe.shell):null)??document.querySelector(".sc-feed")??document.body,pe=new MutationObserver(V);return pe.observe(U,{childList:!0,subtree:!0}),()=>pe.disconnect()},[oe==null?void 0:oe.id,oe==null?void 0:oe.shell,V]);const ge=U=>{M&&(U.done?Se(M):Ie(M))};return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-vh",role:"status","aria-live":"polite",children:lt}),ot&&se&&o.jsx(HQ,{id:ot.id,voice:ot.voice,target:dt,live:Ft,also:en,lit:Jt,side:ot.side??"top",beside:ot.beside,soft:ot.soft,container:kn,title:ot.title,body:ot.body,at:ot.at,of:ot.of,canBack:CX(M,ot.id,he||!!(k&&ne(M))),action:ot.start?{label:"Start"}:ot.done?{label:"Done"}:null,closeLabel:ot.done?"Close":"Close guide",onBack:()=>{const U=M?xN(M,ot.id):null;if(U){window.dispatchEvent(new CustomEvent("scenri:guide-take-back",{detail:{kind:U}})),window.dispatchEvent(new CustomEvent("scenri:guide-picker",{detail:{tab:Bx[U]}}));return}if(M==="presenter"&&(ot.id==="start"||ot.id==="face"||ot.id==="save"))return v(Uo(r),{replace:!0});if((M==="product"||M==="scene")&&ot.id===M)return y.close();if(M==="refine"&&ot.id==="ask"){if(S)return v(mr(r),{replace:!0});window.dispatchEvent(new Event("scenri:guide-clear-refine"));return}if(he&&M&&(ot.id==="new"||ot.id==="choose"||ot.id==="product"))return window.dispatchEvent(new Event("scenri:guide-close-picker")),tt.current=M,v(mo(r))},onAction:()=>{if(ot.start)return G();ot.done&&M&&Se(M)},onClose:()=>ge(ot),onEscape:()=>ge(ot),onShown:Ct,onLost:V}),o.jsx(zX,{open:cn||it,pictures:Kt,note:yu.note({engineReady:et,ownsProducts:gt}),onTake:()=>{const U=cn;Fe(!1),it&&mt.close(),U?$l({welcome:"taken"}).then(()=>m("first-shot")):window.setTimeout(()=>void m("first-shot"),0)},onDecline:()=>{const U=cn;Fe(!1),it&&mt.close(),U&&$l({welcome:"declined"})}})]})}function Pl(e){for(const t of document.querySelectorAll(e))if(t.getClientRects().length>0)return t;return null}function tte(e){return`${e}${e.includes("?")?"&":"?"}w=320`}const nte="lessons";function rte(){var z;const e=Ns("learn"),t=e.value!==null,n=OX(e.value),r=wr(Ks),a=hv(),i=SN(),{brand:c,recent:u,products:f}=on(),h=fM(),[p,m]=s.useState(null);s.useEffect(()=>{t||!p||(m(null),h(p))},[t,p,h]);const v=s.useRef(!1),w=F=>{v.current=!0,m(F),e.close()},y=s.useRef(null);s.useEffect(()=>{t&&(y.current=p6.current,p6.current=null)},[t]);const b=()=>{const F=v.current;if(v.current=!1,F)return;const Q=y.current==="help";requestAnimationFrame(()=>{var B;if(document.activeElement!==document.body)return;const V=Q?".sc-help-btn":".sc-learn-btn",I=Q?".sc-learn-btn":".sc-help-btn";(B=document.querySelector(V)??document.querySelector(I))==null||B.focus()})},k=!!un(ut.hub),S=!!un(ut.presenterStudio),C=!!un(ut.presenters),j=F=>{var Q;return((Q=a.heading)==null?void 0:Q.brandId)===c.id&&a.heading.task===F},N=((z=a.active)==null?void 0:z.brandId)===c.id&&!a.active.paused?a.active.task:null,P=u.some(F=>F.kind!=="root"&&F.status==="done"&&F.images.length>0),$=F=>F.needs==="shot"&&!P||F.needs==="product"&&f.length===0?F.needs??null:null,R=F=>{var Y,ae,X,le,ke,te;const Q=((ae=(Y=a.progress)==null?void 0:Y[F.id])==null?void 0:ae.reached)??[];if(N!==F.id)return qx(F.id,Q,null);const V=((X=i.composer)==null?void 0:X.brandId)===c.id?i.composer:null,I={here:k,heading:j(F.id),composer:k?V:null,nodes:a.activeNodes,begun:!0},B=F.id==="first-shot"?((le=mN(I))==null?void 0:le.id)??null:F.id==="reuse"?((ke=gN(I))==null?void 0:ke.id)??null:F.id==="presenter"?((te=yN({heading:j("presenter"),onPage:C&&!S,studio:S?i.studio:null}))==null?void 0:te.id)??null:null;return qx(F.id,Q,{moment:B,nodes:a.activeNodes,draft:!!a.activeDraftId})},E=F=>IX(F.id,a,c.id,R(F)),M=FX(Hi,E),L=n??M??Hi[0],H=Hi.filter(F=>E(F)==="done").length;s.useEffect(()=>{if(t)for(const F of Object.values(R6))new Image().src=F.wide},[t]);const D=s.useRef(null),K=s.useRef(new Map),O=s.useRef(null),_=s.useRef(!1);s.useEffect(()=>{var V;const F=t&&!_.current;if(_.current=t,!t)return;const Q=()=>{var I,B;(I=D.current)==null||I.focus({preventScroll:!0}),(B=D.current)==null||B.scrollIntoView({block:"nearest"})};r&&n?(O.current=n.id,Q()):r&&O.current?(V=K.current.get(O.current))==null||V.focus({preventScroll:!0}):F&&Q()},[t,r,n]);const re=(F,Q)=>o.jsx(ste,{lesson:F,state:E(F),at:R(F),blocked:$(F),describe:Q,actionRef:D,onBegin:()=>w(F.id)});return o.jsx(Ts,{open:t,className:"sc-learn",maxWidth:"880px",described:!0,onDismiss:e.close,onCloseAutoFocus:b,children:r&&n?o.jsxs("div",{className:"sc-learn-level",children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx("button",{type:"button",className:"sc-newdlg-back",onClick:()=>e.set(nte),"aria-label":"All lessons",children:o.jsx(ga,{size:15})}),o.jsx(ds,{className:"sc-newdlg-title",children:n.title}),o.jsx(Kk,{})]}),o.jsx("div",{className:"sc-newdlg-body sc-learn-body",children:re(n,!0)})]},`one-${n.id}`):o.jsxs("div",{className:"sc-learn-level",children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:"Learn"}),o.jsxs("span",{className:"sc-learn-count",children:[H," of ",Hi.length," done"]}),o.jsx(Kk,{})]}),o.jsx(nd,{className:"sc-vh",children:"Each one walks you through one real thing, a step at a time."}),o.jsxs("div",{className:"sc-newdlg-body sc-learn-body",children:[o.jsx("ul",{className:"sc-learn-list",children:Hi.map(F=>o.jsx("li",{children:o.jsxs("button",{type:"button",className:"sc-learn-row","data-state":E(F),"aria-current":!r&&L.id===F.id?"true":void 0,ref:Q=>{Q?K.current.set(F.id,Q):K.current.delete(F.id)},onClick:()=>e.set(F.id),children:[o.jsx("span",{className:"sc-learn-thumb",children:o.jsx("img",{src:R6[F.id].square,alt:"",decoding:"async"})}),o.jsxs("span",{className:"sc-learn-say",children:[o.jsx("span",{className:"sc-learn-name",children:F.title}),o.jsx(hM,{lesson:F,state:E(F),at:R(F),blocked:$(F)})]}),(M==null?void 0:M.id)===F.id&&o.jsx("span",{className:"sc-learn-next",children:"Next"})]})},F.id))}),!r&&re(L,!1)]})]},"all")})}function ste({lesson:e,state:t,at:n,blocked:r,describe:a,actionRef:i,onBegin:c}){const u=r?M6[r].action:t==="active"?"Continue":t==="done"?"Start again":"Start",f=t==="active"?n:0,h=m=>t==="done"?"done":t==="active"?m<n?"done":m===n?"active":"todo":m===0?"active":"todo",p=a?o.jsx(nd,{className:"sc-learn-summary",children:e.summary}):o.jsx("p",{className:"sc-learn-summary",children:e.summary});return o.jsxs("section",{className:"sc-learn-lesson","aria-label":e.title,children:[o.jsx("span",{className:"sc-learn-hero",children:o.jsx("img",{src:R6[e.id].wide,alt:"",decoding:"async"})}),o.jsxs("div",{className:"sc-learn-copy",children:[o.jsx("div",{className:"sc-learn-kicker",children:o.jsx(hM,{lesson:e,state:t,at:n,blocked:r})}),o.jsx("h3",{className:"sc-learn-title",children:e.title}),p,o.jsxs("div",{className:"sc-learn-do",children:[o.jsx("ol",{className:"sc-learn-steps",children:EN(e).map((m,v)=>{const w=h(v),y=o.jsx("span",{className:"sc-learn-n","aria-hidden":"true",children:w==="done"?o.jsx(Kn,{size:14,weight:"bold"}):v+1}),b=t==="active"&&v===n?"step":void 0,k=o.jsx("span",{className:"sc-learn-step-name",children:m});return o.jsx("li",{children:v===f?o.jsxs("button",{ref:i,type:"button",className:"sc-learn-step","data-state":w,"data-here":"","aria-current":b,"aria-label":`${u}: ${m}`,onClick:c,children:[y,k,o.jsxs("span",{className:"sc-learn-go","aria-hidden":"true",children:[u," ",o.jsx(Pa,{size:12,weight:"bold"})]})]}):o.jsxs("div",{className:"sc-learn-step","data-state":w,"aria-current":b,children:[y,k,w==="done"&&o.jsx("span",{className:"sc-vh",children:", done"})]})},m)})}),r&&o.jsx("p",{className:"sc-learn-note",children:M6[r].note})]})]})]})}function hM({lesson:e,state:t,at:n,blocked:r}){const a=EN(e).length;return t==="done"?o.jsxs("span",{className:"sc-learn-status","data-state":"done",children:[o.jsx("span",{className:"sc-learn-tick","aria-hidden":"true",children:o.jsx(Kn,{size:9,weight:"bold"})}),"Done"]}):t==="active"?o.jsxs("span",{className:"sc-learn-status","data-state":"active",children:["Step ",Math.min(n+1,a)," of ",a]}):r?o.jsx("span",{className:"sc-learn-status",children:M6[r].status}):o.jsxs("span",{className:"sc-learn-status",children:[a," step",a===1?"":"s"]})}function Kk(){return o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})}const pM=s.createContext(null),ate={products:[],productsLoaded:!1,importing:!1,refreshProducts:async()=>{}};function on(){const e=s.useContext(pM),t=qA()??ate;if(!e)throw new Error("useBrand must be used inside BrandLayout");return s.useMemo(()=>({...e,...t}),[e,t])}const mM=s.createContext(null);function ote(){const e=s.useContext(mM);if(!e)throw new Error("useAssetsPanel must be used inside BrandLayout");return e}function ite(){const{brandSlug:e}=Bs(),{pathname:t,search:n}=Zn(),r=un({path:ut.brand,end:!1}),{brands:a,engines:i,refresh:c}=Rn(),[u,f]=s.useState(null),[h,p]=s.useState(null),[m,v]=s.useState([]),[w,y]=s.useState([]),[b,k]=s.useState({}),[S,C]=s.useState(!1),[j,N]=s.useState(0),P=s.useCallback(()=>N(te=>te+1),[]),$=Dn(),[R,E]=fa(Dr.assetsOpen,window.innerWidth>=1280),M=s.useCallback(()=>E(te=>!te),[]),L=s.useMemo(()=>({open:R,toggle:M,setOpen:E}),[R,M]);xY();const H=s.useRef(null),D=a.find(te=>te.slug===e)??a.find(te=>te.id===e)??a.find(te=>te.id===H.current)??null;D&&(H.current=D.id);const K=s.useRef(D==null?void 0:D.id);K.current=D==null?void 0:D.id;const O=s.useCallback(async()=>{if(!D)return;const te=D.id,be=await Me.workspace(te);K.current===te&&(f(be.project),p(be.root),v(be.recent),y(be.sets),k(be.membership),C(!0))},[D==null?void 0:D.id]),_=s.useRef(new Set),re=s.useCallback(te=>(_.current.add(te),()=>{_.current.delete(te)}),[]),z=s.useCallback(te=>{if(te.length){v(be=>mX(be,te));for(const be of _.current)be(te)}},[]),F=s.useCallback((te,be)=>{!D||te!==D.id||z(be)},[D==null?void 0:D.id,z]),Q=s.useCallback(te=>y(be=>be.map(G=>G.id===te.id?te:G)),[]),V=s.useCallback(te=>y(be=>be.filter(G=>G.id!==te)),[]),I=s.useCallback(te=>y(be=>be.some(G=>G.id===te.id)?be:[te,...be]),[]),B=s.useCallback((te,be)=>k(G=>({...G,[te]:be})),[]),Y=s.useMemo(()=>D?{brand:D,workspace:u,root:h,recent:m,sets:w,membership:b,loaded:S,refresh:O,applySet:Q,dropSet:V,insertSet:I,applyMembership:B,applyNodes:z,subscribeActivity:re,shotsEpoch:j,resetShots:P}:null,[D,u,h,m,w,b,S,O,Q,V,I,B,z,re,j,P]);s.useEffect(()=>{C(!1),v([]),p(null)},[D==null?void 0:D.id]),s.useEffect(()=>{D&&pB(D.id)},[D==null?void 0:D.id]),s.useEffect(()=>{O()},[O]);const ae=s.useCallback(()=>{c(),O()},[c,O]),X=r?t.slice(r.pathnameBase.length):"",le=!!D&&e!==D.slug,ke=D?mo(D)+X+n:"";if(s.useEffect(()=>{le&&$(ke,{replace:!0})},[le,ke,$]),!D){const te=dN(a),be=!!H.current&&!a.some(ne=>ne.id===H.current),G=new URLSearchParams(n);be&&(G.delete("settings"),G.delete("new"));const J=G.toString();return o.jsx(fo,{to:te?mo(te)+X+(J?`?${J}`:""):ut.root,replace:!0})}return o.jsxs(pM.Provider,{value:Y,children:[o.jsx(Yq,{engines:i,brandId:D.id,onSaved:ae}),o.jsx(iX,{engines:i,onSaved:c}),o.jsx(tX,{}),o.jsx(sG,{brand:D,onActivity:F,children:o.jsxs(kY,{brand:D,children:[o.jsx(dte,{}),o.jsx(cY,{children:o.jsxs(mM.Provider,{value:L,children:[o.jsxs("div",{className:"sc-shell",children:[o.jsx(yY,{}),o.jsx(dc,{}),o.jsx(yG,{})]}),o.jsx(ete,{}),o.jsx(rte,{}),o.jsx(TX,{})]})})]})})]})}function lte(e){return!e.unread||e.spent||e.firstUse||!e.loaded||!e.visible||e.dialogOpen?!1:e.running===0&&e.builds===0}const cte=Number(window.localStorage.getItem("scenri:whatsnew-settle-ms")??2500)||2500,gM=s.createContext(null);function cm(){const e=s.useContext(gM);if(!e)throw new Error("useWhatsNew must be used inside WhatsNewProvider");return e}function ute({children:e}){const[t,n]=s.useState(null),[r,a]=s.useState(null),[i,c]=s.useState(null),[u,f]=s.useState(null),[h,p]=s.useState(null),[m,v]=s.useState("loading"),[w,y]=s.useState(!1),b=Ns("whatsnew");s.useEffect(()=>{let $=!0;return Me.releaseNotes().then(R=>{$&&(n(R.version),a(R.entry),c(R.changelogUrl),f(R.releasesUrl??null),p(R.seen),v("ready"))}).catch(()=>{$&&v("failed")}),()=>{$=!1}},[]);const k=b.open,S=s.useCallback(()=>k(t??"latest"),[k,t]),C=s.useCallback(()=>{y(!0),S()},[S]),j=s.useCallback(()=>{!t||h===t||(p(t),Me.releaseSeen(t).catch(()=>{}))},[t,h]),N=t!==null&&h!==t&&r!==null&&r.sections.length>0,P=s.useMemo(()=>({status:m,version:t,entry:r,changelogUrl:i,releasesUrl:u,unread:N,open:S,autoOpenSpent:w,autoOpen:C,markSeen:j}),[m,t,r,i,u,N,S,w,C,j]);return o.jsx(gM.Provider,{value:P,children:e})}function dte(){var k;const e=cm(),{running:t,builds:n}=Va(),{loaded:r}=on(),[a]=tl(),[i,c]=s.useState(()=>!document.hidden),u=s.useRef(!1),f=hv(),h=HX(),p=f.eligible&&f.welcome===null,m=p||h||((k=f.active)==null?void 0:k.task)==="first-shot"&&!f.active.paused,v=!f.loaded||m;m&&(u.current=!0);const w=s.useRef(!1),{markSeen:y}=e;s.useEffect(()=>{p?w.current=!0:w.current&&(w.current=!1,y())},[p,y]),s.useEffect(()=>{const S=()=>c(!document.hidden);return document.addEventListener("visibilitychange",S),()=>document.removeEventListener("visibilitychange",S)},[]);const b=a.has("settings")||a.has("setup")||a.has("new")||a.has("whatsnew");return s.useEffect(()=>{if(!lte({unread:e.unread,spent:u.current||e.autoOpenSpent,loaded:r,visible:i,dialogOpen:b,running:t,builds:n.length,firstUse:v}))return;const C=window.setTimeout(()=>{u.current=!0,e.autoOpen()},cte);return()=>window.clearTimeout(C)},[e,r,i,b,t,n.length,v]),null}const vM=s.createContext(null);function Rn(){const e=s.useContext(vM);if(!e)throw new Error("useAppData must be used inside AppShell");return e}function fte(){const e=UW(),[t,n]=s.useState(null),[r,a]=s.useState([]),[i,c]=s.useState(null),u=KW(),f=YW(),h=XW(),p=JW(),m=s.useRef(0),v=s.useRef(new Map),w=s.useRef(0),y=s.useRef(!1),b=s.useCallback(N=>{v.current.set(N.id,++m.current),n(P=>P&&mK(P,N))},[]),k=s.useCallback(async()=>{const N=++m.current;w.current=N;const P=await Me.brands();if(w.current!==N)return;const $=new Set;for(const[R,E]of v.current)E>N&&$.add(R);n(R=>gK(R,P,$))},[]),S=s.useCallback(()=>k().catch(()=>{}),[k]),C=s.useCallback(async()=>{try{await Promise.all([k(),Me.engines().then(a)]),y.current=!0}catch(N){y.current||c(String(N.message??N))}},[k]);s.useEffect(()=>{C(),HW()},[C]);const j=s.useMemo(()=>t===null?null:{brands:t,engines:r,scenes:u.scenes,collections:u.collections,verticals:u.verticals,loaded:u.loaded,error:u.error,refetch:u.refetch,presenters:f.presenters,presenterCategories:f.categories,presenterStyles:f.styles,presentersLoaded:f.loaded,presentersError:f.error,refetchPresenters:f.refetch,demoProducts:h.demoProducts,demoProductCategories:h.categories,demoProductsLoaded:h.loaded,demoProductsError:h.error,showcase:p.showcase,showcaseCategories:p.categories,showcaseLoaded:p.loaded,showcaseError:p.error,refetchShowcase:p.refetch,refresh:C,refreshBrands:S,applyBrand:b},[t,r,u.scenes,u.collections,u.verticals,u.loaded,u.error,u.refetch,f.presenters,f.categories,f.styles,f.loaded,f.error,f.refetch,h.demoProducts,h.categories,h.loaded,h.error,p.showcase,p.categories,p.loaded,p.error,p.refetch,C,S,b]);return i?o.jsx(js,{align:"center",justify:"center",height:"100vh",p:"5",children:o.jsx(mv,{failure:{kind:"unknown",title:"Scenri could not read your library.",fix:"Check that it is still running, then reload.",raw:i,retryable:!0}})}):t===null?o.jsx(js,{align:"center",justify:"center",height:"100vh",children:o.jsx(xr,{size:"3"})}):o.jsx(vM.Provider,{value:j,children:o.jsx(Wj.Provider,{value:e,children:o.jsx(uK,{children:o.jsxs(ute,{children:[o.jsx(KS,{}),o.jsx(dc,{})]})})})})}function Ns(e){const[t,n]=tl(),r=t.get(e),a=s.useCallback(u=>{n(f=>{const h=new URLSearchParams(f);return h.set(e,u),h},{replace:!1})},[e,n]),i=s.useCallback(u=>{n(f=>{const h=new URLSearchParams(f);return h.set(e,u),h},{replace:!0})},[e,n]),c=s.useCallback(()=>{n(u=>{const f=new URLSearchParams(u);return f.delete(e),f},{replace:!0})},[e,n]);return{value:r,open:a,set:i,close:c}}function X1(e,t=""){const[n,r]=tl(),a=n.get(e)??t,i=s.useCallback(c=>{r(u=>{const f=new URLSearchParams(u);return c===null||c===t?f.delete(e):f.set(e,c),f},{replace:!0})},[e,t,r]);return[a,i]}function Gk(e,t){const n=Yk(t.name),r=qk(t.url);return!n&&!r?null:e.find(a=>{var i,c,u,f;return!!(r&&qk((c=(i=a.json)==null?void 0:i.meta)==null?void 0:c.website)===r||n&&Yk(((f=(u=a.json)==null?void 0:u.meta)==null?void 0:f.name)??a.slug)===n)})??null}const Yk=e=>String(e??"").trim().replace(/\s+/g," ").toLowerCase()||null,qk=e=>{const t=String(e??"").trim();if(!t)return null;const n=/^https?:\/\//i.test(t)?t:`https://${t}`;try{return new URL(n).hostname.toLowerCase().replace(/^www\./,"")||null}catch{return null}};function hte(e){const t=e.name.source==="hostname"?{key:"name",found:!1,label:"Name",value:`taken from the address (${e.host})`}:{key:"name",found:!0,label:"Name",value:e.name.value},n=e.logo.status==="primary"?{key:"logo",found:!0,label:"Logo",value:"found on the site"}:e.logo.status==="alternate"?{key:"logo",found:!0,label:"Logo",value:"only a small mark, saved as an alternate"}:{key:"logo",found:!1,label:"Logo",value:"none found"},r=e.colors.count>0?{key:"colors",found:!0,label:"Colours",value:`${e.colors.count} taken from the site`}:{key:"colors",found:!1,label:"Colours",value:"none we could trust"};return[t,n,r]}function pte(e){return e.logo.status!=="primary"||e.colors.count===0||e.name.source==="hostname"}const Gd=(e,t=!1)=>({key:"products",found:t,label:"Products",value:e});function mte(e){switch(e.kind){case"idle":return null;case"scanning":return Gd("looking for a shop");case"timeout":return Gd("this site took too long to search");case"error":return Gd("the search did not finish");case"result":{const{scan:t}=e;if(t.verdict==="none")return null;if(t.verdict==="found"){const n=t.countSource==="sitemap"&&t.count>20;return Gd(`${n?"about ":""}${t.count.toLocaleString()} found`,!0)}return Gd("we could not load the catalogue")}}}function gte(e){return e.kind==="timeout"||e.kind==="error"?!0:e.kind==="result"&&(e.scan.verdict==="blocked"||e.scan.verdict==="likely")}function vte(e){var t;return!e||e.verdict!=="found"?!1:e.candidates.length>0||(((t=e.cards)==null?void 0:t.length)??0)>0}function wte(e,t){const n=e.trim();if(n.length<=t)return n;const r=n.slice(0,t),a=r.lastIndexOf(" ");return`${(a>t*.6?r.slice(0,a):r).replace(/[\s,;:.]+$/,"")}...`}function yte(){var ke,te,be,G,J,ne;const{brands:e,refresh:t}=Rn(),n=Dn(),r=e.length>0,[a,i]=s.useState(""),[c,u]=s.useState(""),[f,h]=s.useState(!1),[p,m]=s.useState(!1),[v,w]=s.useState(null),[y,b]=s.useState(null),[k,S]=s.useState(!1),[C,j]=s.useState(!1),[N,P]=s.useState(null),[$,R]=s.useState(null),[E,M]=s.useState(null),[L,H]=s.useState(null),D=s.useRef(!1),K=s.useRef(null),O=async(W,he)=>{D.current=!0,K.current=null,b(W),await t(),n(`${mo(W)}${he?`?settings=${he}`:""}`,{replace:!0})};s.useEffect(()=>{const W=()=>{const he=K.current;!he||D.current||(K.current=null,fetch(`/api/brands/${he}`,{method:"DELETE",keepalive:!0}).catch(()=>{}))};return window.addEventListener("pagehide",W),()=>{window.removeEventListener("pagehide",W),W()}},[]);const _=async(W=!1)=>{var he,Xe;if(!W){const tt=Gk(e,{url:a.trim()});if(tt){H(tt);return}}m(!0),w(null);try{const tt=await Me.brandFromUrl(a);b(tt),K.current=tt.id,P(tt.report),R(((he=tt.report)==null?void 0:he.read)===!1&&((Xe=tt.warnings)==null?void 0:Xe.slice(0,2).join(" "))||null),m(!1)}catch(tt){w(String(tt.message??tt)),m(!1)}},re=async(W=!1)=>{if(!W){const he=Gk(e,{name:c});if(he){H(he);return}}m(!0),w(null);try{await O(await Me.createBrand({specVersion:"0.1",meta:{name:c.trim()||"Untitled brand"}}))}catch(he){w(String(he.message??he)),m(!1)}},z=()=>n("/",{replace:!0}),{scan:F,scanning:Q,outcome:V,retry:I}=ZA((y==null?void 0:y.id)??null),B=mte(V),Y=V.kind==="timeout"||V.kind==="error",ae=async W=>{var he,Xe;if(y){M(null),j(!0);try{await Me.catalogImport(y.id,String(((Xe=(he=y.json)==null?void 0:he.meta)==null?void 0:Xe.website)??a),W)}catch{M("That did not start. Check your connection and try again."),j(!1);return}j(!1),S(!1),await O(y)}},X=y?Zs((ke=y.json)==null?void 0:ke.palette):[],le=y?Fr((te=cG(y.json))==null?void 0:te.file):null;return o.jsxs("div",{className:"sc-wiz",children:[o.jsxs("div",{className:"sc-wiz-form",children:[o.jsxs("div",{className:"sc-wiz-head",children:[o.jsxs("button",{type:"button",className:"sc-wiz-back",onClick:z,style:r?void 0:{visibility:"hidden"},children:[o.jsx(ga,{size:11})," Back"]}),o.jsx("span",{}),o.jsx("span",{})]}),o.jsxs("h1",{children:["Your ",o.jsx("em",{children:"brand"})]}),o.jsx("p",{className:"sc-wiz-sub",children:y&&N?o.jsxs(o.Fragment,{children:["Built from ",N.host,". Everything here can be changed later, from Settings."]}):o.jsx(o.Fragment,{children:"Paste a website and the kit builds itself: name, logo, palette. You can also start from nothing and fill it in later from Settings."})}),o.jsxs("div",{className:"sc-wiz-fields",children:[y?o.jsx("div",{style:{textAlign:"center"},children:Q?o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",disabled:!0,children:[o.jsx(xr,{size:"1"})," Looking for products"]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void O(y),children:"Skip and add the brand only"})})]}):Y?o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:I,children:["Look for products again ",o.jsx(Pa,{size:12})]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void O(y),children:"Continue without products"})})]}):vte(F)?o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:()=>S(!0),children:["Add brand and products ",o.jsx(Pa,{size:12})]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void O(y),children:"Just the brand"})})]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:()=>void O(y),children:["Looks right ",o.jsx(Pa,{size:12})]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void O(y,"brand"),children:N&&pte(N)?"Finish the kit first":"Edit the kit first"})})]})}):f?o.jsxs(o.Fragment,{children:[o.jsx("label",{htmlFor:"sc-wiz-name",children:"Brand name"}),o.jsx("input",{id:"sc-wiz-name",className:"sc-in",placeholder:"Brand name",value:c,onChange:W=>{u(W.target.value),H(null)},onKeyDown:W=>W.key==="Enter"&&c.trim()&&!p&&void re()}),o.jsxs("div",{style:{textAlign:"center"},children:[o.jsx("button",{type:"button",className:"sc-wiz-cta",disabled:!c.trim()||p,onClick:()=>void re(),children:p?o.jsx(xr,{size:"1"}):o.jsxs(o.Fragment,{children:["Create it ",o.jsx(Pa,{size:12})]})}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>{h(!1),H(null)},children:"Build from a website instead"})})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("label",{htmlFor:"sc-wiz-url",children:"Website"}),o.jsx("input",{id:"sc-wiz-url",className:"sc-in",placeholder:"acme.com",value:a,onChange:W=>{i(W.target.value),H(null)},onKeyDown:W=>W.key==="Enter"&&a.trim()&&!p&&void _()}),o.jsx("p",{className:"sc-wiz-hint",children:"We only read public pages. Nothing leaves this machine."}),o.jsxs("div",{style:{textAlign:"center"},children:[o.jsx("button",{type:"button",className:"sc-wiz-cta",disabled:!a.trim()||p,onClick:()=>void _(),children:p?o.jsx(xr,{size:"1"}):o.jsxs(o.Fragment,{children:["Build the kit ",o.jsx(Pa,{size:12})]})}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>{h(!0),H(null)},children:"Start from scratch instead"})})]})]}),L&&o.jsxs(n6,{color:"amber",mt:"3",size:"1",children:[o.jsxs(r6,{children:["You already have ",ca(L),". Creating another makes a second workspace with its own address."]}),o.jsxs("div",{style:{display:"flex",gap:10,marginTop:4,flexWrap:"wrap"},children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:()=>n(mo(L)),children:["Open ",ca(L)," instead"]}),o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>{H(null),f?re(!0):_(!0)},children:"Create anyway"})]})]}),v&&o.jsx(n6,{color:"red",mt:"3",size:"1",children:o.jsx(r6,{children:v})})]})]}),o.jsx("div",{className:"sc-wiz-preview",children:o.jsxs("div",{className:"sc-wiz-card",children:[o.jsx("div",{className:"sc-wiz-cap",children:y?"Your kit":p?`Reading ${a||"the site"}`:"Live kit preview"}),o.jsxs("div",{className:"sc-wiz-body",children:[p&&!y&&o.jsxs("div",{className:"sc-scrape-row",children:[o.jsx(xr,{size:"1"})," Reading the site and building the kit"]}),!p&&!y&&o.jsx("p",{style:{color:"var(--sc-fg3)",fontSize:12.5,margin:0},children:"The kit appears here as it is found."}),y&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:X.length?16:0},children:[o.jsx("span",{className:"sc-kit-logo",style:{width:44,height:44,padding:7,borderRadius:12},children:le?o.jsx("img",{src:le,alt:""}):o.jsx(Ws,{size:16,color:"var(--sc-fg3)"})}),o.jsxs("span",{children:[o.jsx("b",{dir:"auto",style:{fontFamily:"var(--sc-font-display)",fontSize:16},children:(G=(be=y.json)==null?void 0:be.meta)==null?void 0:G.name}),((ne=(J=y.json)==null?void 0:J.meta)==null?void 0:ne.tagline)&&o.jsx("small",{dir:"auto",style:{display:"block",color:"var(--sc-fg3)",fontSize:11.5},children:wte(String(y.json.meta.tagline),72)})]})]}),X.length>0&&o.jsx("div",{style:{display:"flex",gap:8},children:X.slice(0,5).map(W=>o.jsx("span",{style:{flex:1,height:44,borderRadius:9,border:"1px solid var(--sc-line)",background:W.hex}},W.hex))}),N&&o.jsx("ul",{className:"sc-kit-lines",role:"status",children:[...hte(N),...B?[B]:[]].map(W=>o.jsxs("li",{"data-found":W.found?"":void 0,children:[W.key==="products"&&Q?o.jsx(xr,{size:"1"}):W.found?o.jsx(Kn,{size:12,weight:"bold"}):o.jsx(tW,{size:12}),o.jsx("span",{className:"sc-kit-line-label",children:W.label}),o.jsx("span",{className:"sc-kit-line-value",children:W.value})]},W.key))}),$&&o.jsx("p",{className:"sc-kit-note",role:"status",children:$}),!Q&&!Y&>e(V)&&o.jsx("button",{type:"button",className:"sc-wizpick-open",onClick:I,children:"Try the catalogue again"})]})]})]})}),k&&F&&y&&o.jsx(_A,{brandId:y.id,scan:F,busy:C,error:E,onImport:W=>void ae(W),onImportAll:()=>void ae(),onDismiss:()=>S(!1)})]})}const hu=e=>{const t=(e??"").trim();return t||null};function bte(e){const t=e;return{name:e.name,brand:hu(t.brand)??hu(t.vendor),qualifier:hu(t.format)??hu(t.subcategory)??hu(t.variant)}}function xte(e){return!e.brand||e.name.toLowerCase().startsWith(e.brand.toLowerCase())?e.name:`${e.brand} ${e.name}`}function go(e,t){const n=bte(e);if(t==="chip")return n.name;const r=xte(n);return t==="tooltip"?[r,n.qualifier].filter(Boolean).join(" · "):r}function Ji(e,t){return t==="tooltip"?[e.name,hu(e.lighting)].filter(Boolean).join(" · "):e.name}function Xh(e){return[e.name,...e.legacyNames??[],...e.keywords??[],e.description,e.lighting,e.subject].concat(e.collections??[],e.verticals??[]).filter(Boolean).join(" ")}function qv(e){const t=e;return[e.name,...t.legacyNames??[],...t.keywords??[],t.brand,t.vendor,t.format,t.subcategory,t.variant,t.productType,...t.tags??[]].filter(Boolean).join(" ")}function Qh(e){return[e.name,e.descriptor,e.presentation,e.ageRange,e.facial,e.skin,e.hair,e.build,e.wardrobeDefault,...e.suitableCategories,...e.suitableStyles].filter(Boolean).join(" ")}function kte(e,t,n){return[e.title,e.category,n,t.product?qv(t.product):null,t.presenter?Qh(t.presenter):null,t.scene?Xh(t.scene):null].filter(Boolean).join(" ")}function Xv(){const{brand:e}=on(),t=Dn(),n=mr(e);return s.useCallback(r=>{t(`${n}?presenter=${encodeURIComponent(r)}&compose=1`)},[n,t])}function um(){const{brand:e}=on(),t=Dn(),n=mr(e);return s.useCallback((r,a)=>{const i=a?`&setup=${encodeURIComponent(a)}`:"";t(`${n}?scene=${encodeURIComponent(r)}${i}&compose=1`)},[n,t])}function O6(e){return{...e.brief,...e.variants?{variants:e.variants}:{},...e.quality?{quality:e.quality}:{},_at:Date.now()}}function Ste(){const{brand:e}=on(),t=Dn(),n=mr(e);return s.useCallback(r=>{t(`${n}?showcase=${encodeURIComponent(r)}`)},[n,t])}const bh=e=>`sc-favscenes-${e}`,Ete=e=>`sc-favlooks-${e}`,Cte=e=>`bt-favlooks-${e}`;function wM(e,t){return e==="presenter"?`sc-favpresenters-${t}`:e==="product"?`sc-favproducts-${t}`:bh(t)}function yM(e){try{const t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function si(e){try{const t=localStorage.getItem(bh(e))??o6(Ete(e),bh(e))??o6(Cte(e),bh(e));return yM(t)}catch{return[]}}function zu(e,t){try{return e==="scene"?si(t):yM(localStorage.getItem(wM(e,t)))}catch{return[]}}function bM(e,t,n){try{localStorage.setItem(wM(e,t),JSON.stringify(n))}catch{}}function dm(e,t,n){const r=zu(e,t),a=r.includes(n)?r.filter(i=>i!==n):[...r,n];return bM(e,t,a),a}function Qv(e,t,n,r){const a=zu(e,t),i=r?[...a,...n.filter(c=>!a.includes(c))]:a.filter(c=>!n.includes(c));return bM(e,t,i),i}const xM=[{key:"campaign",label:"Product campaign"},{key:"lifestyle",label:"Lifestyle"},{key:"editorial",label:"Fashion & editorial"},{key:"beauty",label:"Beauty"},{key:"food-drink",label:"Food & drink"},{key:"launch",label:"Tech launch"},{key:"social",label:"Social"},{key:"cinematic",label:"Cinematic"},{key:"catalog",label:"Catalog"},{key:"seasonal",label:"Seasonal"}],jte=new Map(xM.map(e=>[e.key,e]));function Qg(e){var t;return e?((t=jte.get(e))==null?void 0:t.label)??e:null}function Ate(e){const t=new Map(xM.map((n,r)=>[n.key,r]));return[...e].sort((n,r)=>(t.get(n)??99)-(t.get(r)??99)||n.localeCompare(r))}const Pu=14,Nte=768,ai=[{px:190,label:"Compact",cells:3,cols:6,min:200},{px:320,label:"Large",cells:2,cols:5,min:280}];function Mte(e){let t=ai[0];for(const n of ai)Math.abs(n.px-e)<Math.abs(t.px-e)&&(t=n);return t}const kM=320;function SM(e){const t=typeof e=="number"&&Number.isFinite(e)?e:kM;let n=ai[0].px;for(const r of ai)Math.abs(r.px-t)<Math.abs(n-t)&&(n=r.px);return n}const Bu=5;function Ac(e){const t=typeof e=="number"?e:Bu;return t===7||t===5?t:t===6?5:Bu}function Rte(e){const[t,n]=s.useState(0);return s.useLayoutEffect(()=>{if(!e)return;const r=e.clientWidth;n(a=>a===r?a:r)}),s.useLayoutEffect(()=>{if(!e)return;const r=()=>{const i=e.clientWidth;n(c=>c===i?c:i)};r();const a=new ResizeObserver(r);return a.observe(e),()=>a.disconnect()},[e]),t}function Pte(){const[e,t]=s.useState(()=>window.innerWidth);return s.useEffect(()=>{let n=0;const r=()=>{cancelAnimationFrame(n),n=requestAnimationFrame(()=>t(window.innerWidth))};return window.addEventListener("resize",r),()=>{cancelAnimationFrame(n),window.removeEventListener("resize",r)}},[]),e}function Jg(e,t){return Math.max(1,Math.floor((e-Pu*(t-1))/t))}function Lte(e,t,n){if(e<=0)return{tile:t,cols:1};if(n)return{tile:Math.floor((e-Pu)/2),cols:2};const r=ai[1],a=ai[0],i=Math.min(r.cols,Math.max(1,Math.floor((e+Pu)/(r.min+Pu))));if(Mte(t).px===r.px)return{tile:Jg(e,i),cols:i};let c=Math.min(a.cols,i+1);return c>1&&Jg(e,c)<a.min&&(c=i),{tile:Jg(e,c),cols:c}}function Xk(e){return Math.max(1,e)}function fm(e){return Ac(e)===5?"large":"compact"}const Rf=s.createContext("large");function Tte(){return s.useContext(Rf)}const $te=[{value:7,label:"Compact",hint:"More cards per row",cells:3},{value:5,label:"Large",hint:"Fewer, larger cards",cells:2}],Dte=ai.map(e=>({value:e.px,label:e.label,hint:e.label==="Compact"?"More shots per row":"Fewer, larger shots",cells:e.cells}));function hm({value:e,onChange:t}){return o.jsx(EM,{label:"Grid size",value:Ac(e),options:$te,onChange:n=>t(n)})}function Hte({value:e,onChange:t}){return o.jsx(EM,{label:"Shot size",value:SM(e),options:Dte,onChange:t})}function EM({label:e,value:t,options:n,onChange:r}){const a=s.useRef(null);return s.useLayoutEffect(()=>{const i=a.current;if(!i)return;const c=()=>{const f=i.querySelector(":scope > button[data-on]");if(!f){i.style.setProperty("--sc-density-x","0px"),i.style.setProperty("--sc-density-w","0px");return}i.style.setProperty("--sc-density-x",`${f.offsetLeft}px`),i.style.setProperty("--sc-density-w",`${f.offsetWidth}px`)};c(),i.dataset.inkReady||requestAnimationFrame(()=>{i.dataset.inkReady=""});const u=new ResizeObserver(c);return u.observe(i),()=>u.disconnect()},[t]),o.jsxs("div",{ref:a,className:"sc-density",role:"radiogroup","aria-label":e,children:[o.jsx("span",{className:"sc-density-ink","aria-hidden":!0}),n.map(i=>{const c=t===i.value;return o.jsx("button",{type:"button",role:"radio",className:"sc-density-opt","aria-checked":c,"aria-label":i.label,title:i.hint,"data-on":c||void 0,onClick:()=>{c||r(i.value)},children:o.jsx(Ote,{cells:i.cells})},i.value)})]})}function Ote({cells:e}){const t=e,n=16,r=1.5,a=1.5,c=(n-r*2-a*(t-1))/t,u=Math.max(.6,c*.22),f=[];for(let h=0;h<t;h++)for(let p=0;p<t;p++)f.push({x:r+p*(c+a),y:r+h*(c+a)});return o.jsx("svg",{className:"sc-density-icon",width:n,height:n,viewBox:`0 0 ${n} ${n}`,"aria-hidden":!0,children:f.map(h=>o.jsx("rect",{x:h.x,y:h.y,width:c,height:c,rx:u,ry:u,fill:"currentColor"},`${h.x}-${h.y}`))})}function pm(e){const t=Ac(e),n=(t===5?ai[1]:ai[0]).min;return{"--sc-wall-cols":String(t),"--sc-tile-min":`${n}px`}}function Ite(e,t){let r=null,a=null,i=null,c=null,u=null,f=null,h=null,p={dx:0,dy:0},m={w:0,h:0},v=0;const w=M=>{M.style.position="fixed",M.style.left="0",M.style.top="0",M.style.margin="0",M.style.zIndex="var(--sc-z-popover)",M.style.pointerEvents="none"},y=()=>{const M=L=>{var H,D;window.removeEventListener("click",M,!0),!((D=(H=L.target).closest)!=null&&D.call(H,'[data-role="remove"]'))&&(L.stopPropagation(),L.preventDefault())};window.addEventListener("click",M,!0),setTimeout(()=>window.removeEventListener("click",M,!0),250)},b=()=>{if(h!==null){try{e.releasePointerCapture(h)}catch{}h=null}i==null||i.remove(),c==null||c.remove(),i=null,c=null,u=null,a==null||a.removeAttribute("data-drag-src"),a=null,r=null,e.removeAttribute("data-chip-drag"),document.documentElement.style.cursor="",cancelAnimationFrame(v)},k=M=>{!e.isConnected||!e.contains(document.activeElement)||(f!==null?Ra(e,f):zl(e,M,"after"))},S=()=>{if(!a)return;const M=a;b(),y(),k(M),t.onCancelled()},C=M=>{if(M.button!==0||M.pointerType==="touch")return;const L=M.target;if(L.closest('[data-role="remove"]'))return;const H=Ti(L);H&&(r={chip:H,x:M.clientX,y:M.clientY})},j=M=>{var H,D;if(!r)return;f=$o(e),a=r.chip,t.onDragStart(),(H=window.getSelection())==null||H.removeAllRanges(),e.setAttribute("data-chip-drag","");const L=a.getBoundingClientRect();p={dx:r.x-L.left,dy:r.y-L.top},r=null;try{e.setPointerCapture(M.pointerId),h=M.pointerId}catch{}document.documentElement.style.cursor="grabbing",i=a.cloneNode(!0),(D=i.querySelector('[data-role="remove"]'))==null||D.remove(),i.className=`${a.className} sc-chip-ghost`,i.removeAttribute("data-drag-src"),i.removeAttribute("title"),w(i),i.style.width=`${L.width}px`,i.style.height=`${L.height}px`,i.style.fontSize=getComputedStyle(a).fontSize,m={w:L.width,h:L.height},document.body.appendChild(i),a.setAttribute("data-drag-src",""),c=document.createElement("div"),c.className="sc-drop-caret",w(c),c.style.display="none",document.body.appendChild(c),N(M)},N=M=>{if(!i||!a)return;const L=Math.min(Math.max(4,M.clientX-p.dx),window.innerWidth-m.w-4),H=Math.min(Math.max(4,M.clientY-p.dy),window.innerHeight-m.h-4);i.style.transform=`translate3d(${L}px, ${H}px, 0)`;const D=sk(e,a,M.clientX,M.clientY);if(u=D,!c)return;const K=D&&!D.noop?Qk(e,D.units):null;if(!K||!D){c.style.display="none";return}const O=lQ(e,D.units),_=O<D.units?Qk(e,O):null,re=!!_&&Math.abs(_.top+_.height/2-(K.top+K.height/2))<K.height/2,z=_&&re?(_.left+K.left)/2:K.left;c.style.display="",c.style.transform=`translate3d(${z-1.5}px, ${K.top-2}px, 0)`,c.style.height=`${K.height+4}px`},P=M=>{if(r){if(Math.hypot(M.clientX-r.x,M.clientY-r.y)<5)return;M.preventDefault(),j(M);return}if(!a)return;M.preventDefault(),cancelAnimationFrame(v);const{clientX:L,clientY:H}=M;v=requestAnimationFrame(()=>N({clientX:L,clientY:H}))},$=M=>{if(r){r=null;return}if(!a)return;const L=a;let H;try{H=sk(e,L,M.clientX,M.clientY)??u}catch{H=u}finally{b()}if(y(),H&&!H.noop&&TN(e,L,H.units)){zl(e,L,"after"),t.onMoved(L,P6(e,L));return}k(L),t.onCancelled()},R=M=>{M.key==="Escape"&&a&&(M.stopPropagation(),S())},E=M=>{Ti(M.target)&&M.preventDefault()};return e.addEventListener("pointerdown",C),e.addEventListener("dragstart",E),e.addEventListener("lostpointercapture",S),window.addEventListener("pointermove",P),window.addEventListener("pointerup",$),window.addEventListener("pointercancel",S),window.addEventListener("blur",S),window.addEventListener("keydown",R,!0),()=>{b(),e.removeEventListener("pointerdown",C),e.removeEventListener("dragstart",E),e.removeEventListener("lostpointercapture",S),window.removeEventListener("pointermove",P),window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",S),window.removeEventListener("blur",S),window.removeEventListener("keydown",R,!0)}}function Qk(e,t){let n=0;const r=Array.from(e.childNodes);for(let c=0;c<r.length;c++){const u=r[c],f=Vu(u),h=u.nodeType===Node.TEXT_NODE&&t===n+f&&c<r.length-1;if(t<=n+f&&!h){if(u.nodeType!==Node.TEXT_NODE){const v=u.getBoundingClientRect();return new DOMRect(t===n?v.left:v.right,v.top,0,v.height)}const p=document.createRange();p.setStart(u,Bh(u,Math.max(0,Math.min(t-n,f)))),p.collapse(!0);const m=p.getBoundingClientRect();return m.height?m:null}n+=f}const i=(e.lastElementChild??e).getBoundingClientRect();return new DOMRect(i.right,i.top,0,i.height||18)}function Fte({kind:e,label:t,thumb:n,onInspect:r,onMove:a,onRemove:i,onClose:c}){const{sheet:u,grip:f}=td(()=>c("dismiss")),h=e==="mark"?"brand mark":"reference image";return o.jsx(hc,{open:!0,onOpenChange:p=>!p&&c("dismiss"),children:o.jsxs(pc,{children:[o.jsx(mc,{className:"sc-shotsheet-scrim"}),o.jsxs(gc,{ref:u,className:"sc-shotsheet sc-swapsheet","data-kind":e,"aria-describedby":void 0,onOpenAutoFocus:p=>{var m;p.preventDefault(),(m=u.current)==null||m.focus({preventScroll:!0})},onCloseAutoFocus:p=>p.preventDefault(),onEscapeKeyDown:p=>{p.preventDefault(),c("escape")},children:[o.jsxs("div",{className:"sc-shotsheet-grip",...f,children:[o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0}),o.jsxs(vc,{className:"sc-vh",children:["Move or remove ",h]})]}),o.jsxs("div",{className:"sc-movesheet-head",children:[n&&o.jsx("button",{type:"button",className:"sc-movesheet-face",onClick:r,"aria-label":`Open ${h}`,children:o.jsx("img",{src:n,alt:"",onError:p=>p.currentTarget.remove()})}),o.jsxs("span",{className:"sc-movesheet-txt",children:[o.jsx("b",{dir:"auto",children:t||h}),o.jsx("span",{children:h})]})]}),o.jsxs("div",{className:"sc-swap-foot",children:[o.jsxs("div",{className:"sc-swap-move",children:[o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>a(-1),children:[o.jsx(cv,{size:13})," Move earlier"]}),o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>a(1),children:["Move later ",o.jsx(Pa,{size:13})]})]}),i&&o.jsxs("button",{type:"button",className:"sc-swap-remove",onClick:i,children:[o.jsx(ll,{size:13}),"Remove ",e==="mark"?"mark":"reference"]})]})]})]})})}const _te=440,Zte=460,Jk=156,CM=8,xh=14,e8=20,hr=12,jM=200,Vte=240,AM=204;function zte(e,t,n){if(e.bottom<0||e.top>t.height)return null;const r=Math.min(n==null?void 0:n.width,t.width-hr*2),i=e.right+xh+r+hr<=t.width?e.right+xh:Math.max(hr,e.left-xh-r),c=Math.max(hr,Math.min(e.top,t.height-hr-AM));return{left:i,top:c,width:r,maxHeight:Math.max(jM,t.height-c-hr),side:"beside"}}function Bte(e,t){const n=(r,a)=>Math.min(Math.max(r,e8),Math.max(e8,a-e8));return t.side==="beside"?{edge:t.left>=e.right?"left":"right",x:0,y:n((e.top+e.bottom)/2-t.top,AM)}:{edge:t.side==="above"?"bottom":"top",x:n((e.left+e.right)/2-t.left,t.width),y:0}}function Ute(e,t,n,r){if(e.bottom<0||e.top>t.height)return null;const a=CM,i=Math.min(n.width,t.width-hr*2),c=n.height,u=Math.min(Math.max(e.left+(e.right-e.left)/2-i/2,hr),Math.max(hr,t.width-i-hr)),h=e.top-a-hr>=c?e.top-a-c:Math.min(e.bottom+a,Math.max(hr,t.height-c-hr));return{left:u,top:h}}function Jv(e,t,n){if(e.bottom<0||e.top>t.height)return null;const r=Math.min((n==null?void 0:n.width)??_te,t.width-hr*2),a=(n==null?void 0:n.gap)??CM,i=e.top-a-hr,c=t.height-e.bottom-a-hr,u=i>=Vte||i>=c?"above":"below",h=Math.max(jM,Math.min(Zte,u==="above"?i:c)),p=Math.min(Math.max(e.left,hr),Math.max(hr,t.width-r-hr)),m=u==="above"?Math.max(hr,e.top-a-h):e.bottom+a;return u==="above"?{left:p,top:m,width:r,maxHeight:h,side:u,bottomEdge:e.top-a}:{left:p,top:m,width:r,maxHeight:h,side:u}}function NM(e){return e.side==="above"&&e.bottomEdge!==void 0?{left:e.left,width:e.width,maxHeight:e.maxHeight,top:"auto",bottom:window.innerHeight-e.bottomEdge}:{left:e.left,width:e.width,maxHeight:e.maxHeight,top:e.top}}const Wte=["ref","mark","product","presenter","scene","shot"],kh=e=>Wte.includes(e),MM={ref:"Reference image",mark:"Brand mark",product:"Product",presenter:"Presenter",scene:"Scene",shot:"Shot"};function Kte(e){return e.side==="below"||e.side==="beside"?{top:Math.round(e.top)}:{bottom:Math.round(window.innerHeight-(e.top+e.maxHeight))}}function od({anchor:e,kind:t,src:n,label:r,warning:a,note:i,noun:c,side:u="auto",onOpen:f,onHoverIn:h,onHoverOut:p,onClose:m}){const[v,w]=s.useState(null),[y,b]=s.useState(!1);if(s.useEffect(()=>b(!1),[n]),s.useLayoutEffect(()=>{var C,j;const S=()=>{const N=window.visualViewport,P=e.getBoundingClientRect(),$={width:(N==null?void 0:N.width)??window.innerWidth,height:(N==null?void 0:N.height)??window.innerHeight},R=u==="beside"?zte(P,$,{width:Jk}):Jv(P,$,{width:Jk,gap:xh});if(!R){m();return}w({...R,tail:Bte(P,R)})};return S(),window.addEventListener("resize",S),window.addEventListener("scroll",S,!0),(C=window.visualViewport)==null||C.addEventListener("resize",S),(j=window.visualViewport)==null||j.addEventListener("scroll",S),()=>{var N,P;window.removeEventListener("resize",S),window.removeEventListener("scroll",S,!0),(N=window.visualViewport)==null||N.removeEventListener("resize",S),(P=window.visualViewport)==null||P.removeEventListener("scroll",S)}},[e,u,m]),s.useEffect(()=>{const S=C=>{C.key==="Escape"&&m()};return window.addEventListener("keydown",S,!0),()=>window.removeEventListener("keydown",S,!0)},[m]),!v)return null;const k=c??MM[t];return Rr.createPortal(o.jsxs("div",{className:"sc-chip-preview","data-kind":t,"data-side":v.side,"aria-hidden":"true",style:{left:Math.round(v.left),...Kte(v),maxWidth:v.width,maxHeight:v.maxHeight},onPointerEnter:h,onPointerLeave:p,children:[o.jsx("span",{className:"sc-chip-preview-tail","data-edge":v.tail.edge,style:v.tail.edge==="left"||v.tail.edge==="right"?{top:Math.round(v.tail.y)}:{left:Math.round(v.tail.x)}}),o.jsxs("button",{type:"button",className:"sc-chip-preview-hit",tabIndex:-1,onClick:f,children:[y?o.jsxs("span",{className:"sc-chip-preview-plate sc-chip-preview-blank",children:[o.jsx(Ws,{size:20}),"Image unavailable"]}):o.jsx("img",{className:"sc-chip-preview-plate",src:n,alt:"",decoding:"async",onError:()=>b(!0)}),r&&o.jsx("b",{dir:"auto",children:r}),k&&o.jsx("span",{children:k})]}),i&&o.jsx("p",{className:"sc-chip-preview-note",children:i}),a&&o.jsx("p",{className:"sc-swap-warn",children:a})]}),document.body)}const Gte=160,Yte=120;function id(){const[e,t]=s.useState(null),n=s.useRef(null),r=s.useRef(!1);r.current=e!==null;const a=s.useCallback(()=>{n.current&&clearTimeout(n.current),n.current=null},[]),i=s.useCallback(f=>{if(a(),r.current){t(f);return}n.current=setTimeout(()=>t(f),Gte)},[a]),c=s.useCallback(()=>{a(),n.current=setTimeout(()=>t(null),Yte)},[a]),u=s.useCallback(()=>{a(),t(null)},[a]);return s.useEffect(()=>a,[a]),{shown:e,open:i,keep:a,close:c,closeNow:u}}const l0="sc-insert-menu";function qte(e){var t;return!!(((t=e.nativeEvent)==null?void 0:t.isComposing)??e.isComposing)||e.keyCode===229}function Xte(e){return e==="/"?"Scenes":e==="@"?"Presenters":e==="#"?"Colors":"Products"}function Qte(e){return e==="/"?"No matching scenes":e==="#"?"No matching colours":e==="@"?"No matching presenters":"No matching products"}function Jte({menuOpen:e,handled:t}){return!e&&!t}function ene(e,t){return t||!e?{open:!1}:{open:!0,sigil:e.sigil,query:e.query}}function tne(e,t){const n=t.trim().split(/\s+/).filter(Boolean)[0];if(!n)return[{text:e,hit:!1}];const r=e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase());if(r<0)return[{text:e,hit:!1}];const a=r+n.length;return[...r>0?[{text:e.slice(0,r),hit:!1}]:[],{text:e.slice(r,a),hit:!0},...a<e.length?[{text:e.slice(a),hit:!1}]:[]]}function nne(e,t){return{x:e.left-t.left,y:e.top-t.top,w:e.right-e.left,h:e.bottom-e.top}}function rne(e,t){return{left:e.left+t.x,top:e.top+t.y,right:e.left+t.x+t.w,bottom:e.top+t.y+t.h}}function sne(e,t,n){return n?t:e||t}function ane(e,t){return!t||e==null?!0:e===t?!1:!t.contains(e)}function t8(e,t){return e===t?!0:!e||!t?!1:e.left===t.left&&e.top===t.top&&e.width===t.width&&e.maxHeight===t.maxHeight&&e.side===t.side&&e.shell===t.shell}function one(e,t,n){return Math.min(n,Math.max(0,e)+Math.max(0,t))}function ine(e,t,n){return n>0&&t>0&&e!==t}function lne(e,t){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();n.bottom>r.bottom?e.scrollTop+=n.bottom-r.bottom:n.top<r.top&&(e.scrollTop-=r.top-n.top)}const RM=320,Jh=320,cne=280,Fl=8,Dl=12,une=8,e5=80,dne=120,PM=48;function LM(e,t){return!(!e||e.top===0&&e.left===0&&e.right===0&&e.bottom===0||e.bottom<0||e.top>t.height||e.right-e.left>PM)}function fne(e){return{top:e.top,bottom:Math.min(e.bottom,e.top+22),left:e.left,right:e.left+2}}function TM(e,t,n,r){return Math.min(Math.max(e,r),Math.max(r,n.width-t-r))}function I6(e,t,n,r){const a=n?une:Dl,i=n?Math.max(0,e.right-e.left):Math.min(RM,t.width-a*2),c=n?e.left:TM(e.left,i,t,a),u=n?Math.min(cne,Math.floor(t.height*.4)):Jh,f=Math.min(u,r??u),h=e.top-Fl-a,p=Math.max(0,Math.min(f,h)),m=Math.max(a,e.top-Fl-p);return{left:c,top:m,width:i,maxHeight:p,side:"above",shell:"dock"}}function t5(e,t,n,r){const a=Math.min(RM,n.width-Dl*2),i=TM(e.left,a,n,Dl),c=e.top-Fl-Dl,u=n.height-e.bottom-Fl-Dl,f=c>=dne||c>=u?"above":"below",h=Math.min(Jh,r??Jh),p=f==="above"?c:u,m=Math.min(h,r==null?Math.max(e5,p):p);if(f==="above"){const w=Math.max(Dl,e.top-Fl-Math.min(h,c)),y=Math.min(h,e.top-Fl-w);return r==null&&y<e5?I6(t,n,!1):{left:i,top:w,width:a,maxHeight:y,side:f,shell:"caret"}}const v=e.bottom+Fl;return v+Math.min(m,u)>n.height-Dl?I6(t,n,!1,r):{left:i,top:v,width:a,maxHeight:Math.min(h,u),side:f,shell:"caret"}}function hne(e,t,n,r={}){if(r.phone)return I6(t,n,!0,r.height);const a=r.line??t;if(LM(e,n)&&e)return t5(e,t,n,r.height);const i=e&&e.right-e.left>PM?e:a;return t5(fne(i),t,n,r.height)}function pne({anchor:e,composer:t,line:n,query:r,options:a,remaining:i=0,total:c=0,sigil:u,onMore:f,onActiveId:h,onClose:p}){const m=wr(Ks),[v,w]=s.useState(0),[y,b]=s.useState(null),k=s.useRef(null),S=s.useRef(null),C=s.useRef(null),j=s.useRef(null),N=`${u??""}\0${r}`,P=s.useRef({}),$=s.useRef(f);$.current=f;const R=s.useRef(i);R.current=i;const E=s.useRef(0),M=s.useCallback(()=>{var O;ine(E.current,a.length,R.current)&&(E.current=a.length,(O=$.current)==null||O.call($))},[a.length]);s.useEffect(()=>{w(0),E.current=0},[r]),s.useEffect(()=>{w(O=>Math.min(O,Math.max(0,a.length-1)))},[a.length]),s.useEffect(()=>{j.current=null,P.current={}},[u]);const L=s.useCallback(O=>{var ae;const _=t==null?void 0:t.getBoundingClientRect();if(!_)return null;const re=(n==null?void 0:n.getBoundingClientRect())??_,z=window.visualViewport,F={width:(z==null?void 0:z.width)??window.innerWidth,height:(z==null?void 0:z.height)??window.innerHeight},Q=!!((ae=k.current)!=null&&ae.contains(document.activeElement)),V=Q?null:NN(),I=V&&LM(V,F)?V:null;I&&(j.current=nne(I,re));const B=j.current?rne(re,j.current):null,Y=sne(I,B,Q)??(Q?null:(e==null?void 0:e.getBoundingClientRect())??null);return hne(Y,_,F,{phone:m,line:re,height:O})},[e,t,n,m]);s.useLayoutEffect(()=>{var z,F;P.current.sigil!==u&&(P.current={sigil:u});const O=()=>{const Q=R.current>0?void 0:P.current.height,V=L(Q);b(I=>t8(I,V)?I:V)},_=Q=>{ane(Q.target,k.current)&&O()};O();const re=requestAnimationFrame(O);return window.addEventListener("resize",O),window.addEventListener("scroll",_,!0),(z=window.visualViewport)==null||z.addEventListener("resize",O),(F=window.visualViewport)==null||F.addEventListener("scroll",O),()=>{var Q,V;cancelAnimationFrame(re),window.removeEventListener("resize",O),window.removeEventListener("scroll",_,!0),(Q=window.visualViewport)==null||Q.removeEventListener("resize",O),(V=window.visualViewport)==null||V.removeEventListener("scroll",O)}},[e,t,n,m,u,L]),s.useLayoutEffect(()=>{if(!y||!k.current)return;if(i>0){if(P.current.height==null&&P.current.sigil===(u??""))return;P.current={sigil:u??""};const Q=L();Q&&!t8(y,Q)&&b(Q);return}const O=k.current,_=S.current,re=_?O.offsetHeight-_.clientHeight:O.offsetHeight,z=one(re,(_==null?void 0:_.scrollHeight)??0,Jh);if(!(z>0)||P.current.height===z&&P.current.sigil===(u??""))return;P.current={sigil:u??"",height:z};const F=L(z);!F||t8(y,F)||b(F)},[y,N,L,i,a.length,u]),s.useLayoutEffect(()=>{const O=_=>{_.isComposing||_.keyCode===229||(_.key==="ArrowDown"?(_.preventDefault(),v>=a.length-1?M():w(re=>re+1)):_.key==="ArrowUp"?(_.preventDefault(),w(re=>Math.max(0,re-1))):(_.key==="Enter"||_.key==="Tab")&&a[v]?(_.preventDefault(),a[v].run()):_.key==="Escape"&&(_.preventDefault(),p()))};return window.addEventListener("keydown",O,!0),()=>window.removeEventListener("keydown",O,!0)},[a,v,p,M]),s.useEffect(()=>{const O=S.current,_=O==null?void 0:O.querySelector('[data-active="true"]');O&&_&&lne(O,_)},[v]),s.useEffect(()=>{const O=C.current,_=S.current;if(!O||!_)return;const re=new IntersectionObserver(z=>{_.scrollTop<=0||z.some(F=>F.isIntersecting)&&M()},{root:_,rootMargin:"0px 0px 8px 0px"});return re.observe(O),()=>re.disconnect()},[y,N,M]);const H=a[v]?`${l0}-opt-${v}`:null;if(s.useEffect(()=>(h==null||h(H),()=>h==null?void 0:h(null)),[H,h]),s.useEffect(()=>{const O=_=>{_.target.closest(".sc-cmd")||(L6(_),p())};return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[p]),!y)return null;const D=`${l0}-list`,K=Xte(u);return Rr.createPortal(o.jsx("div",{className:"sc-cmd",id:l0,"data-shell":y.shell,style:{left:y.left,top:y.top,width:y.width,maxHeight:y.maxHeight,height:y.side==="above"&&i>0?y.maxHeight:void 0},ref:k,children:o.jsxs("div",{className:"sc-cmd-list",ref:S,role:"listbox","aria-label":K,id:D,children:[a.length?a.map((O,_)=>{var z;const re=_===0||O.group!==((z=a[_-1])==null?void 0:z.group);return o.jsxs("div",{children:[re&&o.jsx(n5,{name:O.group,total:c}),o.jsxs("button",{type:"button",id:`${l0}-opt-${_}`,className:"sc-cmd-row",role:"option","aria-selected":_===v,"data-active":_===v,onMouseEnter:()=>w(_),onMouseDown:F=>L6(F),onClick:()=>O.run(),children:[O.thumb?o.jsx("img",{src:O.thumb,alt:"","data-crop":O.crop}):O.swatch?o.jsx("span",{className:"sc-cmd-swatch",style:{background:O.swatch}}):null,o.jsx(mne,{text:O.label,query:r}),O.hint&&o.jsx("span",{className:"sc-cmd-hint",children:O.hint})]})]},O.key)}):o.jsxs(o.Fragment,{children:[o.jsx(n5,{name:K,total:c}),o.jsx("div",{className:"sc-cmd-empty",children:Qte(u)})]}),i>0&&a.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"sc-cmd-count","aria-live":"polite",children:[a.length," of ",c]}),o.jsx("div",{ref:C,className:"sc-cmd-sentinel","aria-hidden":!0})]})]})}),document.body)}function n5({name:e,total:t}){return o.jsxs("div",{className:"sc-cmd-group",children:[e," ",o.jsx("span",{className:"sc-cmd-n",children:t})]})}function mne({text:e,query:t}){return o.jsx("span",{className:"sc-cmd-label",children:tne(e,t).map(n=>n.hit?o.jsx("b",{children:n.text},`h:${n.text}`):o.jsx("span",{children:n.text},`t:${n.text}`))})}const gne={fragrance:["Fragrance"],footwear:["Footwear"],apparel:["Apparel"],furniture:["Furniture","Home"],beauty:["Beauty"],electronics:["Electronics"],accessories:["Accessories"],beverage:["Food & drink"],jewelry:["Jewelry"],food:["Food & drink"]},vne={fragrance:["Fragrance"],footwear:["Footwear","Apparel"],apparel:["Apparel"],furniture:["Furniture","Home"],beauty:["Beauty"],electronics:["Electronics"],accessories:["Accessories"],beverage:["Food & drink"],jewelry:["Jewelry"],food:["Food & drink"]};function wne(e,t){if(!t)return!1;const n=gne[t];return!!n&&n.some(r=>e.verticals.includes(r))}function yne(e,t){if(!t)return!1;const n=vne[t];return!!n&&n.some(r=>e.suitableCategories.includes(r))}function r5(e){return e.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").replace(/[\u200e\u200f\u061c\u202a-\u202e\u2066-\u2069]/g,"").toLowerCase()}const bne=4;function vo(e,t){const n=r5(t).trim().split(/\s+/).filter(Boolean);if(!n.length)return!0;const r=r5(e);return n.every(a=>r.includes(a)||a.length>=bne&&a.endsWith("s")&&r.includes(a.slice(0,-1)))}function ew(e,t){return{visible:e.slice(0,t),remaining:Math.max(0,e.length-t)}}function $M(e,t){return[...e].sort((n,r)=>Number(t(r))-Number(t(n)))}function DM(e,t){if(e.t==="product"){const n=t.products.find(a=>a.id===e.id)??null,r=n?null:t.demoProducts.find(a=>a.id===e.id)??null;return{kind:"product",product:n,demo:r}}if(e.t==="character"){const n=t.cast.find(a=>a.id===e.id)??null,r=n?null:t.presenters.find(a=>a.id===e.id)??null;return{kind:"presenter",character:n,presenter:r}}if(e.t==="template"){const n=t.scenes.find(r=>r.id===e.id)??null;return{kind:"scene",scene:n,custom:!!n&&"custom"in n&&!!n.custom}}return null}const Pf={product:"product",presenter:"presenter",scene:"scene"},Zi=48;function xne(e){return e?e.t==="product"?"product":e.t==="character"?"presenter":e.t==="template"?"scene":null:null}function pu(e){const t=xne(e);return t||((e==null?void 0:e.t)==="color"?"color":null)}function kne(e){const t=pu(e);return t||((e==null?void 0:e.t)==="ref"||(e==null?void 0:e.t)==="mark"?e.t:null)}function n8(e){return(e==null?void 0:e.t)==="ref"||(e==null?void 0:e.t)==="mark"?e.imageHash:null}const v0=e=>{const t=(e??"").trim();return t||void 0},s5=e=>(e==null?void 0:e.custom)===!0;function Vi(e,t){return e==="product"?[...(t.libraryProducts.length?t.libraryProducts:t.brandProducts).map(r=>{var a,i;return a5(r,"brand",Kp((i=(a=r.shots)==null?void 0:a[0])==null?void 0:i.file,"tile"))}),...t.demoProducts.map(r=>a5(r,"catalog",r.previewUrl??null))]:e==="presenter"?[...t.presenters.map(n=>{const r=ti(n);return{kind:"presenter",id:n.id,label:n.name,full:[n.name,v0(n.descriptor)].filter(Boolean).join(" · "),sub:v0(n.descriptor),search:Qh(n),thumb:sr(r.src,"tile"),crop:r.crop,source:s5(n)?"brand":"catalog",recommended:yne(n,t.productCategory),token:{t:"character",id:n.id}}}),...t.cast.map(n=>{const r=Cv(n);return{kind:"presenter",id:n.id,label:n.name,full:n.name,search:n.name,thumb:sr(r.src,"tile"),crop:r.crop,source:"brand",token:{t:"character",id:n.id}}})]:t.scenes.map(n=>({kind:"scene",id:n.id,label:Ji(n,"card"),full:Ji(n,"tooltip"),sub:v0(n.lighting),search:Xh(n),thumb:sr(n.previewUrl??null,"tile"),tint:Ru(n.previewColor),source:s5(n)?"brand":"catalog",recommended:wne(n,t.productCategory),token:{t:"template",id:n.id}}))}function a5(e,t,n){return{kind:"product",id:e.id,label:go(e,"chip"),full:go(e,"tooltip"),sub:Sne(e),search:qv(e),thumb:n,source:t,token:{t:"product",id:e.id}}}function Sne(e){const t=e;return v0(t.brand)??v0(t.vendor)}function Lu(e,t){const n=t.trim();return n?e.filter(r=>vo(r.search,n)):e}function o5(e,t,n){return t.source==="brand"?0:e==="scene"?n.has(t.id)?1:t.recommended?2:3:e==="presenter"?t.recommended?1:2:1}function mm(e,t,n){const r=n.currentId?t.find(h=>h.id===n.currentId)??null:null,a=r?t.filter(h=>h.id!==r.id):t,c=[...Lu(a,n.query)].sort((h,p)=>o5(e,h,n.bookmarked)-o5(e,p,n.bookmarked)).map(h=>n.bookmarked.has(h.id)?{...h,bookmarked:!0}:h),{visible:u,remaining:f}=ew(c,n.shown??Zi);return{current:r,items:u,remaining:f,total:c.length}}const Ene={$:"product","/":"scene","@":"presenter"},HM={Products:8,Presenters:8,Colors:16,Scenes:8},OM={$:"Products","/":"Scenes","@":"Presenters","#":"Colors"};function Yd(e){return HM[OM[e??"$"]]}function IM(e){return{key:`${e.kind}:${e.id}`,group:e.kind==="presenter"?"Presenters":e.kind==="scene"?"Scenes":"Products",label:e.label,hint:e.sub,search:e.search,thumb:e.thumb??void 0,crop:e.crop,token:e.token}}function Cne(e,t,n){return mm(e,t,{currentId:null,query:"",bookmarked:n,shown:t.length}).items.map(IM)}function i5(e,t){const{visible:n,remaining:r}=ew(e,t);return{items:n,remaining:r,total:e.length}}function jne(e,t,n={query:""}){const r=n.query.trim(),a=n.bookmarked??new Set,i=n.shown??HM[OM[e]];if(e==="#"){const h=(t.colors??[]).map(Ane),p=r?h.filter(m=>vo(m.search??m.label,r)):h;return i5(p,i)}const c=Ene[e],u=c==="product"?t.products:c==="presenter"?t.presenters:t.scenes??[],f=r?Lu(u,r).map(IM):Cne(c,u,a);return i5(f,i)}function Ane(e){return{key:`color:${e.hex}`,group:"Colors",label:e.name,hint:e.hex,search:`${e.name} ${e.hex}`,swatch:e.hex,token:{t:"color",hex:e.hex,name:e.name||void 0}}}const Nne="(pointer: coarse)";function Mne(e){return wr(Ks)?o.jsx($ne,{...e}):o.jsx(Tne,{...e,onMove:void 0})}function Rne(){return!wr(Nne)}const Pne=e=>`Remove ${Pf[e]}`;function Lne(e,t,n){const r={slug:t};return e==="product"?la(r,n):e==="presenter"?ha(r,n):_r(r,n)}function FM({kind:e,currentId:t,candidates:n,brandId:r,brandSlug:a,warning:i,note:c,onPick:u,onRemove:f,onClose:h,onAttachRequest:p,onMove:m,autoFocusSearch:v}){const[w,y]=s.useState(""),[b,k]=s.useState(Zi),S=s.useRef(null),C=s.useRef(null),[j,N]=s.useState(0),P=s.useMemo(()=>e==="scene"?new Set(si(r)):new Set,[e,r]);s.useEffect(()=>{k(Zi),N(0)},[w]);const $=s.useMemo(()=>mm(e,n,{currentId:t,query:w,bookmarked:P,shown:b}),[e,n,t,w,P,b]);s.useLayoutEffect(()=>{var D;v&&((D=S.current)==null||D.focus({preventScroll:!0}))},[v]),s.useEffect(()=>{N(D=>Math.max(0,Math.min(D,$.items.length-1)))},[$.items.length]);const R=s.useCallback(D=>{var O;const K=(O=C.current)==null?void 0:O.querySelectorAll("[data-nav]")[D];K&&(N(D),K.focus({preventScroll:!0}),K.scrollIntoView({block:"nearest"}))},[]),E=s.useCallback(()=>{const D=C.current;return D?Math.max(1,getComputedStyle(D).gridTemplateColumns.split(" ").filter(Boolean).length):1},[]),M=D=>{var re;if(D.key==="Escape"){D.preventDefault(),D.stopPropagation(),h("escape");return}const K=D.target===S.current;if(K&&D.key==="ArrowDown"){D.preventDefault(),R(0);return}if(K&&D.key==="Enter"){D.preventDefault(),$.items[0]&&u($.items[0]);return}if(K)return;const O=E(),_=D.key==="ArrowRight"?1:D.key==="ArrowLeft"?-1:D.key==="ArrowDown"?O:D.key==="ArrowUp"?-O:0;if(_){D.preventDefault();const z=j+_;z<0&&_===-O?(re=S.current)==null||re.focus():z>=0&&z<$.items.length&&R(z);return}D.key==="Home"?(D.preventDefault(),R(0)):D.key==="End"&&(D.preventDefault(),R($.items.length-1))},L=Pf[e],H=e==="product";return o.jsxs("div",{className:"sc-swap-inner",onKeyDown:M,children:[o.jsx("div",{className:"sc-swap-head",children:o.jsxs("span",{className:"sc-swap-search",children:[o.jsx(_u,{size:13}),o.jsx("input",{ref:S,type:"text",value:w,onChange:D=>y(D.target.value),placeholder:`Search ${L}s`,"aria-label":`Search ${L}s`,autoComplete:"off",spellCheck:!1})]})}),$.current&&o.jsxs("div",{className:"sc-swap-cur",title:$.current.full,children:[o.jsx(l5,{src:$.current.thumb,tinted:!!$.current.tint,crop:$.current.crop}),o.jsxs("span",{className:"sc-swap-curtext",children:[o.jsx("b",{dir:"auto",children:$.current.label}),$.current.sub&&o.jsx("span",{dir:"auto",children:$.current.sub})]}),o.jsx("a",{className:"sc-swap-open",href:Lne(e,a,$.current.id),target:"_blank",rel:"noreferrer",title:`Open this ${L} in a new tab`,"aria-label":`Open ${$.current.label} in a new tab`,children:o.jsx(wf,{size:14})}),o.jsx("span",{className:"sc-swap-tick","aria-hidden":!0,children:o.jsx(Kn,{size:11,weight:"bold"})})]}),o.jsxs("div",{className:"sc-swap-body",children:[$.items.length===0&&o.jsx("p",{className:"sc-swap-empty",children:w.trim()?`Nothing matches “${w.trim()}”.`:`No other ${L}s.`}),o.jsx("div",{className:"sc-swap-grid",ref:C,role:"listbox","aria-label":`Choose a ${L}`,children:$.items.map((D,K)=>o.jsxs("div",{className:"sc-swap-card",role:"option","aria-selected":!1,"data-nav":K,tabIndex:K===j?0:-1,title:D.full,style:D.tint?{"--tint":D.tint}:void 0,onFocus:()=>N(K),onClick:()=>u(D),onKeyDown:O=>{O.key!=="Enter"&&O.key!==" "||(O.preventDefault(),u(D))},children:[o.jsx(l5,{src:D.thumb,tinted:!!D.tint,crop:D.crop}),o.jsxs("b",{dir:"auto",children:[D.bookmarked&&o.jsxs(o.Fragment,{children:[o.jsx(Da,{className:"sc-bm-mark",size:10,weight:"fill","aria-hidden":!0}),o.jsx("span",{className:"sc-vh",children:"Kept. "})]}),D.label]}),H&&D.sub&&o.jsx("span",{dir:"auto",children:D.sub})]},D.id))}),$.remaining>0&&o.jsxs("button",{type:"button",className:"sc-swap-more",onClick:()=>k(D=>D+Zi),children:["Show ",Math.min(Zi,$.remaining)," more of ",$.total]})]}),o.jsxs("div",{className:"sc-swap-foot",children:[t&&!$.current&&o.jsxs("p",{className:"sc-swap-warn",children:["This ",L," is no longer available."]}),c&&o.jsx("p",{className:"sc-chip-preview-note",children:c}),i&&o.jsx("p",{className:"sc-swap-warn",children:i}),i&&p&&e==="scene"&&o.jsxs("div",{className:"sc-swap-attach",children:[i.includes("product")&&o.jsx("button",{type:"button",className:"sc-btn",onClick:()=>p("Products"),children:"Attach a product"}),i.includes("person")&&o.jsx("button",{type:"button",className:"sc-btn",onClick:()=>p("Presenters"),children:"Attach a presenter"})]}),m&&o.jsxs("div",{className:"sc-swap-move",children:[o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>m(-1),children:[o.jsx(cv,{size:13})," Move earlier"]}),o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>m(1),children:["Move later ",o.jsx(Pa,{size:13})]})]}),f&&o.jsxs("button",{type:"button",className:"sc-swap-remove",onClick:f,children:[o.jsx(ll,{size:13}),Pne(e)]})]})]})}function l5({src:e,tinted:t,crop:n}){const[r,a]=s.useState(!1);return s.useEffect(()=>a(!1),[e]),!e||r?o.jsx("span",{className:"sc-swap-thumb sc-swap-thumb-empty",children:o.jsx(Ws,{size:18})}):o.jsx("img",{className:"sc-swap-thumb","data-tinted":t||void 0,"data-crop":n,src:e,alt:"",loading:"lazy",onError:()=>a(!0)})}function Tne(e){const{anchor:t,kind:n,onClose:r}=e,a=Rne(),[i,c]=s.useState(null),u=s.useRef(null);return s.useLayoutEffect(()=>{var h,p;const f=()=>{const m=window.visualViewport,v=Jv(t.getBoundingClientRect(),{width:(m==null?void 0:m.width)??window.innerWidth,height:(m==null?void 0:m.height)??window.innerHeight});if(!v){r("outside");return}c(v)};return f(),window.addEventListener("resize",f),window.addEventListener("scroll",f,!0),(h=window.visualViewport)==null||h.addEventListener("resize",f),(p=window.visualViewport)==null||p.addEventListener("scroll",f),()=>{var m,v;window.removeEventListener("resize",f),window.removeEventListener("scroll",f,!0),(m=window.visualViewport)==null||m.removeEventListener("resize",f),(v=window.visualViewport)==null||v.removeEventListener("scroll",f)}},[t,r]),s.useEffect(()=>{const f=h=>{var m;const p=h.target;(m=u.current)!=null&&m.contains(p)||t.contains(p)||r("outside")};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[r,t]),i?Rr.createPortal(o.jsx("div",{ref:u,className:"sc-swap","data-kind":n,"data-side":i.side,role:"dialog","aria-label":`Change ${Pf[n]}`,style:NM(i),children:o.jsx(FM,{...e,autoFocusSearch:a})}),document.body):null}function $ne(e){const{kind:t,onClose:n}=e,{sheet:r,grip:a}=td(()=>n("dismiss"));return o.jsx(hc,{open:!0,onOpenChange:i=>!i&&n("dismiss"),children:o.jsxs(pc,{children:[o.jsx(mc,{className:"sc-shotsheet-scrim"}),o.jsxs(gc,{ref:r,className:"sc-shotsheet sc-swapsheet","data-kind":t,"aria-describedby":void 0,onOpenAutoFocus:i=>{var c;i.preventDefault(),(c=r.current)==null||c.focus({preventScroll:!0})},onCloseAutoFocus:i=>i.preventDefault(),onEscapeKeyDown:i=>{i.preventDefault(),n("escape")},children:[o.jsxs("div",{className:"sc-shotsheet-grip",...a,children:[o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0}),o.jsxs(vc,{className:"sc-vh",children:["Change ",Pf[t]]})]}),o.jsx(FM,{...e,autoFocusSearch:!1})]})]})})}const Dne=260;function Hne(e){return wr(Ks)?o.jsx(Ine,{...e}):o.jsx(One,{...e,onMove:void 0})}function tu(e,t){const n=e?nr(e):null,r=t?nr(t):null;return!!n&&n===r}function _M({currentHex:e,currentName:t,palette:n,onPick:r,onRemove:a,onClose:i,onMove:c}){const u=s.useMemo(()=>{const S=new Set,C=[],j=P=>{const $=nr(P.hex);!$||S.has($)||(S.add($),C.push({...P,hex:$}))},N=e?nr(e):null;N&&!n.some(P=>tu(P.hex,N))&&j({hex:N,name:t||N,slot:"accent"});for(const P of n)j(P);return C},[n,e,t]),f=s.useRef(null),[h,p]=s.useState(()=>Math.max(0,u.findIndex(S=>tu(S.hex,e))));s.useEffect(()=>{p(S=>Math.max(0,Math.min(S,Math.max(0,u.length-1))))},[u.length]),s.useLayoutEffect(()=>{var C,j;const S=Math.max(0,u.findIndex(N=>tu(N.hex,e)));(j=(C=f.current)==null?void 0:C.querySelectorAll("[data-nav]")[S])==null||j.focus({preventScroll:!0})},[]);const m=s.useCallback(S=>{var j;const C=(j=f.current)==null?void 0:j.querySelectorAll("[data-nav]")[S];C&&(p(S),C.focus({preventScroll:!0}))},[]),v=S=>{if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),i("escape");return}if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault();const C=h+(S.key==="ArrowDown"?1:-1);C>=0&&C<u.length&&m(C)}},w=S=>r({t:"color",hex:S.hex,name:S.name||void 0}),y=(S,C)=>{const j=u.find(N=>tu(N.hex,S));r({t:"color",hex:S,name:(j==null?void 0:j.name)||void 0},{live:!0})},b=e?nr(e):null,k=!!b&&!n.some(S=>tu(S.hex,b));return o.jsxs("div",{className:"sc-swap-inner",onKeyDown:v,children:[o.jsx("div",{className:"sc-swap-body",children:u.length===0?o.jsx("p",{className:"sc-swap-empty",children:"No brand colours yet."}):o.jsx("div",{className:"sc-swap-swatches",ref:f,role:"listbox","aria-label":"Choose a colour",children:u.map((S,C)=>{const j=tu(S.hex,e),N=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-swap-dot",style:{background:S.hex},"aria-hidden":!0}),o.jsx("b",{dir:"auto",children:S.name}),o.jsx("span",{children:S.hex}),j&&o.jsx("span",{className:"sc-swap-tick","aria-hidden":!0,children:o.jsx(Kn,{size:11,weight:"bold"})})]});return k&&j?o.jsx(Zu,{className:"sc-swap-swatch",triggerStyle:{background:"none"},value:S.hex,presets:n.map(P=>P.hex),commitMode:"live",align:"start",label:`Edit ${S.name}`,triggerProps:{role:"option","aria-selected":!0,"data-on":"","data-nav":C,tabIndex:C===h?0:-1,title:`${S.name} ${S.hex}`,onFocus:()=>p(C)},onChange:P=>y(P),children:N},"current-custom"):o.jsx("div",{className:"sc-swap-swatch",role:"option","aria-selected":j,"data-on":j||void 0,"data-nav":C,tabIndex:C===h?0:-1,title:`${S.name} ${S.hex}`,onFocus:()=>p(C),onClick:()=>w(S),onKeyDown:P=>{P.key!=="Enter"&&P.key!==" "||(P.preventDefault(),w(S))},children:N},S.hex)})})}),o.jsxs("div",{className:"sc-swap-foot",children:[o.jsxs(Zu,{className:"sc-swap-swatch sc-swap-custom",triggerStyle:{background:"none"},value:e??nm(n),presets:n.map(S=>S.hex),commitMode:"live",align:"start",label:"Custom colour",onChange:S=>y(S),children:[o.jsx(cr,{size:12}),o.jsx("b",{children:"Custom colour"})]}),c&&o.jsxs("div",{className:"sc-swap-move",children:[o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>c(-1),children:[o.jsx(cv,{size:13})," Move earlier"]}),o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>c(1),children:["Move later ",o.jsx(Pa,{size:13})]})]}),a&&o.jsxs("button",{type:"button",className:"sc-swap-remove",onClick:a,children:[o.jsx(ll,{size:13}),"Remove colour"]})]})]})}function One(e){const{anchor:t,onClose:n}=e,[r,a]=s.useState(null),i=s.useRef(null);return s.useLayoutEffect(()=>{var u,f;const c=()=>{const h=window.visualViewport,p=Jv(t.getBoundingClientRect(),{width:(h==null?void 0:h.width)??window.innerWidth,height:(h==null?void 0:h.height)??window.innerHeight},{width:Dne});if(!p){n("outside");return}a(p)};return c(),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0),(u=window.visualViewport)==null||u.addEventListener("resize",c),(f=window.visualViewport)==null||f.addEventListener("scroll",c),()=>{var h,p;window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0),(h=window.visualViewport)==null||h.removeEventListener("resize",c),(p=window.visualViewport)==null||p.removeEventListener("scroll",c)}},[t,n]),s.useEffect(()=>{const c=u=>{var h,p;const f=u.target;(h=i.current)!=null&&h.contains(f)||t.contains(f)||(p=f.closest)!=null&&p.call(f,".sc-cp")||n("outside")};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n,t]),r?Rr.createPortal(o.jsx("div",{ref:i,className:"sc-swap","data-kind":"color","data-side":r.side,role:"dialog","aria-label":"Change colour",style:NM(r),children:o.jsx(_M,{...e})}),document.body):null}function Ine(e){const{onClose:t}=e,{sheet:n,grip:r}=td(()=>t("dismiss"));return o.jsx(hc,{open:!0,onOpenChange:a=>!a&&t("dismiss"),children:o.jsxs(pc,{children:[o.jsx(mc,{className:"sc-shotsheet-scrim"}),o.jsxs(gc,{ref:n,className:"sc-shotsheet sc-swapsheet","data-kind":"color","aria-describedby":void 0,onOpenAutoFocus:a=>{var i;a.preventDefault(),(i=n.current)==null||i.focus({preventScroll:!0})},onCloseAutoFocus:a=>a.preventDefault(),onEscapeKeyDown:a=>{a.preventDefault(),t("escape")},children:[o.jsxs("div",{className:"sc-shotsheet-grip",...r,children:[o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0}),o.jsx(vc,{className:"sc-vh",children:"Change colour"})]}),o.jsx(_M,{...e})]})]})})}function Lf(e){const{brand:t,products:n}=on(),{scenes:r,presenters:a,demoProducts:i}=Rn(),c=s.useMemo(()=>_h(jc(t),r),[t,r]),u=s.useMemo(()=>_h(Cf(t),a),[t,a]),f=s.useMemo(()=>{var p;return(((p=t==null?void 0:t.json)==null?void 0:p.characters)??[]).filter(m=>(m==null?void 0:m.origin)!=="custom")},[t]),h=s.useMemo(()=>{var p;return T0(((p=t==null?void 0:t.json)==null?void 0:p.products)??[])},[t]);return s.useMemo(()=>({libraryProducts:OA(n),brandProducts:h,demoProducts:i,presenters:u,cast:f,scenes:c,productCategory:e??null}),[n,h,i,u,f,c,e])}const qd=new Map,Fne=64;function ZM(e){let t=qd.get(e);if(!t)for(t=Zne(e).then(n=>n?Vne(n.data,4):null).catch(()=>null),qd.set(e,t);qd.size>Fne;)qd.delete(qd.keys().next().value);return t}function _ne(e,t){ZM(t).then(n=>{const r=Ru(n??void 0);!r||!e.isConnected||(e.dataset.tinted="true",e.style.setProperty("--tint",r))})}async function Zne(e){const t=new Image;t.decoding="async",t.src=e;try{await t.decode()}catch{return null}const n=Math.min(1,48/Math.max(t.naturalWidth,t.naturalHeight,1)),r=Math.max(1,Math.round(t.naturalWidth*n)),a=Math.max(1,Math.round(t.naturalHeight*n)),i=document.createElement("canvas");i.width=r,i.height=a;const c=i.getContext("2d",{willReadFrequently:!0});if(!c)return null;c.drawImage(t,0,0,r,a);try{return c.getImageData(0,0,r,a)}catch{return null}}function Vne(e,t){const n=Array.from({length:24},()=>({score:0,r:0,g:0,b:0}));for(let a=0;a+t-1<e.length;a+=t){if(e[a+3]<128)continue;const i=e[a],c=e[a+1],u=e[a+2],{h:f,s:h,l:p}=zne(i,c,u);if(h<.18||p<.12||p>.92)continue;const m=h*(1-Math.abs(p-.5)*1.2),v=n[Math.min(23,Math.floor(f/360*24))];v.score+=m,v.r+=i*m,v.g+=c*m,v.b+=u*m}const r=n.reduce((a,i)=>i.score>a.score?i:a,n[0]);return r.score<=0?null:Bne(r.r/r.score,r.g/r.score,r.b/r.score)}function zne(e,t,n){const r=e/255,a=t/255,i=n/255,c=Math.max(r,a,i),u=Math.min(r,a,i),f=(c+u)/2;if(c===u)return{h:0,s:0,l:f};const h=c-u,p=f>.5?h/(2-c-u):h/(c+u);let m;return c===r?m=((a-i)/h+(a<i?6:0))*60:c===a?m=((i-r)/h+2)*60:m=((r-a)/h+4)*60,{h:m,s:p,l:f}}function Bne(e,t,n){const r=a=>Math.max(0,Math.min(255,Math.round(a))).toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(n)}`}function Une(e){return!e||e.cap==null||e.cap<=0?null:e.cap}function Wne(e){const t=new Set;if(!e||e.cap==null||e.cap<=0)return t;const n=new Set(e.attachments.map(r=>_l(r.role,r.id??r.hash)));for(const r of e.dropped){const a=_l(r.role,r.id??r.hash);r.reason!=="missing"&&!n.has(a)&&t.add(a)}return t}const _l=(e,t)=>`${e}:${t}`,c0=new Set(["product","character","ref","mark","template"]),ep=12,F6=`Shot is full: ${ep} identities. Remove one to add another.`,Xr=[{id:"square",label:"Square",hint:"1:1",w:1024,h:1024},{id:"portrait",label:"Portrait",hint:"4:5",w:1024,h:1280},{id:"story",label:"Story",hint:"9:16",w:1080,h:1920},{id:"landscape",label:"Landscape",hint:"16:9",w:1600,h:900}];function Uu(e){const t=Xr.find(n=>n.id===e);return t?t.w/t.h:1}function Kne(e,t=0){var i,c;const n=Xr.find(u=>u.id===(e==null?void 0:e.format));if(n)return n.id;const r=(c=(i=e==null?void 0:e.rendered)==null?void 0:i.sizes)==null?void 0:c[t];if(!r||!(r[0]>0)||!(r[1]>0))return;const a=Math.log(r[0]/r[1]);return Xr.reduce((u,f)=>Math.abs(Math.log(f.w/f.h)-a)<Math.abs(Math.log(u.w/u.h)-a)?f:u).id}const Q1=6,Gne=s.forwardRef(function({initialTokens:t,onChange:n,brand:r,templates:a,presenters:i,demoProducts:c,onTemplatePick:u,scenesSitOut:f,placeholder:h,placeholderSm:p,label:m="Brief",flag:v,described:w,describedNote:y,onInspect:b,activeProductCategory:k,onAttachRequest:S,onSubmit:C,onDropFiles:j},N){var bt,vt,jt,st,$t,An;const P=s.useRef(null),$=s.useRef(null),R=s.useId(),[E,M]=s.useState(""),L=s.useCallback(q=>{M(""),requestAnimationFrame(()=>M(q))},[]),H=s.useRef(null),[D,K]=s.useState(null),[O,_]=s.useState(null),re=id(),{shown:z,closeNow:F}=re,Q=s.useRef(O);s.useEffect(()=>{Q.current=O},[O]);const V=s.useRef(v);s.useEffect(()=>{V.current=v},[v]);const[I,B]=s.useState(""),[Y,ae]=s.useState(Yd("$")),[X,le]=s.useState(null),ke=s.useRef(!1),te=s.useRef(0),[be,G]=s.useState(!1),J=s.useRef(0),{products:ne}=on(),W=ne.length?ne:((bt=r.json)==null?void 0:bt.products)??[],he=((vt=r.json)==null?void 0:vt.characters)??[],Xe=s.useMemo(()=>Sf(r.json),[r]),tt=s.useCallback((q,fe)=>{var In,Dt,On;const Ae=document.createElement("span");Ae.className=Ol,Ae.contentEditable="false",Ae.dir="ltr",Ae.dataset.kind=q.t,Ae.dataset.tok=am(q),Ae.dataset.uid=fe??`u${te.current++}`;let Ye="",ft=null,wt,Zt=null;const Ht=DM(q,{products:W,demoProducts:c,cast:he,presenters:i,scenes:a});if((Ht==null?void 0:Ht.kind)==="scene"){const Et=Ht.scene;Ye=Et?Ji(Et,"chip"):"missing template",ft=(Et==null?void 0:Et.previewUrl)??null;const Hn=Ru(Et==null?void 0:Et.previewColor);Hn&&(Ae.dataset.tinted="true",Ae.style.setProperty("--tint",Hn)),!Hn&&ft&&Ht.custom&&_ne(Ae,ft)}else if((Ht==null?void 0:Ht.kind)==="product"){const Et=Ht.product??Ht.demo;Ye=Et?go(Et,"chip"):"missing product",ft=Ht.product?Kp((Dt=(In=Ht.product.shots)==null?void 0:In[0])==null?void 0:Dt.file,"micro"):((On=Ht.demo)==null?void 0:On.previewUrl)??null}else if((Ht==null?void 0:Ht.kind)==="presenter"){const{character:Et,presenter:Hn}=Ht;Ye=(Et==null?void 0:Et.name)??(Hn==null?void 0:Hn.name)??"missing person";const Ot=Et?Cv(Et):Hn?ti(Hn):{src:null};ft=sr(Ot.src,"micro"),wt=Ot.crop}else if(q.t==="color")Ye=q.name??q.hex,Zt=q.hex;else if(q.t==="ref")Ye=q.label??"Image",ft=dn(q.imageHash,"micro");else if(q.t==="mark"){const Et=Xe.find(Hn=>Hn.hash===q.imageHash);Ye=Et?Jp(r.json,Et):"missing mark",ft=dn(q.imageHash,"micro")}if(Ye.startsWith("missing ")&&(Ae.dataset.missing=""),ft){const Et=document.createElement("img");Et.src=ft,Et.alt="",wt&&(Et.dataset.crop=wt),Et.onerror=()=>Et.remove(),Ae.appendChild(Et)}else if(Zt){const Et=document.createElement("span");Et.className="sc-token-swatch",Et.style.background=Zt,Ae.appendChild(Et)}const pn=document.createElement("span");pn.className="sc-token-label",pn.dir="auto",pn.textContent=Ye,Ae.appendChild(pn);const Wt=(v==null?void 0:v(q))??null;Wt&&(Ae.title=Wt,q.t!=="template"&&(Ae.dataset.warn="1")),w!=null&&w(q)&&(Ae.dataset.described="1");const wn=pu(q);if(wn){const Et=wn==="color"?"colour":Pf[wn];Ae.tabIndex=0,Ae.setAttribute("role","button"),Ae.setAttribute("aria-haspopup","dialog"),Ae.setAttribute("aria-expanded","false"),Ae.setAttribute("aria-label",`${Et}: ${Ye}. Change or remove.`)}else Ae.tabIndex=0,Ae.setAttribute("role","button"),Ae.setAttribute("aria-haspopup","dialog"),Ae.setAttribute("aria-expanded","false"),Ae.setAttribute("aria-label",`${q.t==="mark"?"brand mark":"reference image"}: ${Ye}. Open, remove or move.`);Ae.setAttribute("aria-keyshortcuts","Alt+ArrowLeft Alt+ArrowRight"),Ae.setAttribute("aria-describedby",R),Ae.setAttribute("draggable","false");const sn=document.createElement("button");return sn.type="button",sn.tabIndex=-1,sn.setAttribute("aria-hidden","true"),sn.dataset.role="remove",sn.appendChild(gQ()),Ae.appendChild(sn),Ae},[a,W,he,i,c,Xe,r,v,w,R]),ze=s.useCallback(()=>{const q=P.current;q&&n(Qx(q))},[n]);s.useEffect(()=>{const q=P.current;q&&(Jx(q,t!=null&&t.length?t:Ho(),fe=>tt(fe)),o0(q))},[]);const nt=s.useCallback((q,fe)=>{var ft;const Ae=P.current,Ye=Ae==null?void 0:Ae.querySelector(`[data-uid="${CSS.escape(q)}"]`);if(Ae&&Ye&&rk(Ae,Ye,fe)){zl(Ae,Ye,"after");const wt=$o(Ae);wt!==null&&(H.current=wt,((ft=Q.current)==null?void 0:ft.uid)===q&&(Q.current={...Q.current,caret:wt}),_(Zt=>Zt&&Zt.uid===q?{...Zt,caret:wt}:Zt)),ze(),L(P6(Ae,Ye))}},[ze,L]);s.useEffect(()=>{const q=P.current;if(q)return Ite(q,{onDragStart:()=>{K(null),B(""),F()},onMoved:(fe,Ae)=>{ze(),L(Ae)},onCancelled:()=>L("Reorder cancelled.")})},[ze,L,F]),s.useEffect(()=>{const q=P.current;if(q)for(const fe of q.querySelectorAll(`.${Ol}`)){const Ae=as(fe.dataset.tok??"");if(!Ae)continue;const Ye=(v==null?void 0:v(Ae))??null;Ye&&Ae.t!=="template"?fe.dataset.warn="1":delete fe.dataset.warn,w!=null&&w(Ae)?fe.dataset.described="1":delete fe.dataset.described,Ye&&!("open"in fe.dataset)?fe.title=Ye:fe.removeAttribute("title")}},[v,w]),s.useEffect(()=>{const q=()=>{const fe=$o(P.current);fe!==null&&(H.current=fe)};return document.addEventListener("selectionchange",q),()=>document.removeEventListener("selectionchange",q)},[]);const ce=s.useCallback(q=>{const fe=P.current;if(!fe)return;if(q.t==="template"){const wt=zd(fe);if(wt){wt.replaceWith(tt(q,wt.dataset.uid)),ro(fe),ze(),K(null),B("");return}}const Ae=Ta(q);if(Ae){const wt=_g(fe,Ae);if(wt){K(null),B(""),L(`${Oo(wt)||"That"} is already in the brief.`);return}}if(c0.has(q.t)&&!(q.t==="template"&&zd(fe))&&Array.from(fe.querySelectorAll(`.${Ol}`)).filter(Zt=>c0.has(Zt.dataset.kind??"")).length>=ep){K(null),B(""),L(F6);return}XX(fe,tt(q),{eatQuery:!!D,fallbackUnits:H.current});const ft=$o(fe);ft!==null&&(H.current=ft),ze(),K(null),B("")},[D,tt,ze,L]),ve=s.useRef(ce);s.useEffect(()=>{ve.current=ce},[ce]);const Pe=s.useCallback((q,fe)=>{const Ae=P.current,Ye=Ae==null?void 0:Ae.querySelector(`[data-uid="${CSS.escape(q)}"]`);return!Ae||!Ye?!1:(Ye.replaceWith(tt(fe,q)),ro(Ae),ze(),!0)},[tt,ze]),ue=s.useCallback(q=>{const fe=P.current,Ae=fe==null?void 0:fe.querySelector(`[data-uid="${CSS.escape(q)}"]`);if(!fe||!Ae)return null;const Ye=ni(fe,Ae);return Zg(fe,Ae),ze(),Ye},[ze]),Ee=()=>{var q;return document.documentElement.dataset.guideTask==="first-shot"&&!!((q=P.current)!=null&&q.closest('[data-guide="compose"]'))},Ke=(q,fe)=>{var wt;const Ae=[...q.querySelectorAll(".sc-token")];if(!Ae.length)return!1;const[Ye]=((wt=fe.getTargetRanges)==null?void 0:wt.call(fe))??[];if(!Ye)return!1;const ft=document.createRange();return ft.setStart(Ye.startContainer,Ye.startOffset),ft.setEnd(Ye.endContainer,Ye.endOffset),Ae.some(Zt=>ft.intersectsNode(Zt))},ye=s.useRef(ue);s.useEffect(()=>{ye.current=ue},[ue]),s.useEffect(()=>{const q=P.current;if(!q)return;const fe=Ae=>{if(Ae.inputType.startsWith("delete")&&Ee()&&Ke(q,Ae))return Ae.preventDefault();const Ye=Ae.inputType==="deleteContentBackward"?"Backspace":Ae.inputType==="deleteContentForward"?"Delete":null;if(!Ye)return;const ft=ek(q,Ye);if(!(ft!=null&&ft.dataset.uid)){tk(q,Ye)&&Ae.preventDefault();return}Ae.preventDefault();const wt=ye.current(ft.dataset.uid);wt!=null&&Ra(q,wt)};return q.addEventListener("beforeinput",fe),()=>q.removeEventListener("beforeinput",fe)},[]);const Se=s.useCallback(q=>{const fe=as(q.dataset.tok??"");if(!fe||fe.t!=="ref"&&fe.t!=="mark")return!1;const Ae=P.current,Ye=Ae?$o(Ae):null;return Ye!=null&&(H.current=Ye),F(),b==null||b({src:Mr(fe.imageHash),kind:fe.t,label:fe.t==="mark"?Oo(q):null}),!0},[b,F]),Ie=s.useCallback((q,fe,Ae,Ye)=>{const ft=q.dataset.uid;ft&&(F(),q.dataset.open="",q.hasAttribute("aria-haspopup")&&q.setAttribute("aria-expanded","true"),q.removeAttribute("title"),K(null),B(""),_({uid:ft,kind:fe,anchor:q,caret:Ae,touch:Ye}))},[F]),Be=s.useCallback((q,fe)=>{var Zt;const Ae=Q.current;if(Q.current=null,_(null),!Ae)return;const Ye=P.current,ft=Ye==null?void 0:Ye.querySelector(`[data-uid="${CSS.escape(Ae.uid)}"]`);if(ft){delete ft.dataset.open,ft.hasAttribute("aria-haspopup")&&ft.setAttribute("aria-expanded","false");const Ht=as(ft.dataset.tok??""),pn=Ht?((Zt=V.current)==null?void 0:Zt.call(V,Ht))??null:null;pn&&(ft.title=pn)}const wt=fe!==void 0?fe:Ae.caret;if(Ae.touch){wt!=null&&(H.current=wt);return}Ye&&(Ye.focus({preventScroll:!0}),wt!=null?Ra(Ye,wt):Il(Ye))},[]);s.useEffect(()=>{if(!O)return;const q=P.current;q!=null&&q.querySelector(`[data-uid="${CSS.escape(O.uid)}"]`)||Be("outside")},[O,Be]),s.useEffect(()=>{var q;z&&((q=P.current)!=null&&q.contains(z.anchor)||F())},[z,F]),s.useEffect(()=>{const q=z==null?void 0:z.anchor;if(!q)return;q.dataset.open="";const fe=q.getAttribute("title");return fe&&q.removeAttribute("title"),()=>{delete q.dataset.open,fe&&q.setAttribute("title",fe)}},[z]),s.useImperativeHandle(N,()=>({insert:q=>ve.current(q),setTokens:q=>{const fe=P.current;fe&&(Jx(fe,q.length?q:Ho(),Ae=>tt(Ae)),o0(fe),n(Qx(fe)))},removeTemplate:()=>{const q=P.current,fe=q?zd(q):null;!q||!fe||(Zg(q,fe),ze())},remove:q=>{const fe=P.current;if(!fe)return;const Ae=_g(fe,Ta(q));Ae&&(Zg(fe,Ae),ze())},openMenu:q=>{B(""),ae(Yd("$")),K({anchor:q})},focus:()=>Il(P.current),restoreCaret:()=>{const q=P.current;if(!q)return;q.focus({preventScroll:!0});const fe=H.current;fe!=null?Ra(q,fe):Il(q)}}));const Re=Lf(k),Ze=s.useCallback(q=>Vi(q,Re),[Re]),Qe=s.useMemo(()=>new Set(si(r.id)),[r.id]),lt=s.useMemo(()=>{var q;return D?jne(D.sigil??"$",{products:Vi("product",Re),presenters:Vi("presenter",Re),scenes:f?[]:Vi("scene",Re),colors:Zs((q=r.json)==null?void 0:q.palette)},{query:I,bookmarked:Qe,shown:Y}):{items:[],remaining:0,total:0}},[D,Re,I,Qe,Y,f,(jt=r.json)==null?void 0:jt.palette]),Lt=s.useMemo(()=>lt.items.map(q=>({...q,run:()=>q.token.t==="template"?u(q.token.id):ve.current(q.token)})),[lt.items,u]),Ut=s.useCallback(()=>{lt.remaining<=0||ae(q=>q+Yd(D==null?void 0:D.sigil))},[lt.remaining,D==null?void 0:D.sigil]),Ct=q=>{const fe=P.current,Ae=q.target;if(Ae.closest('[data-role="remove"]')){if(q.preventDefault(),Ee())return;const pn=Ti(Ae);O&&(pn==null?void 0:pn.dataset.uid)===O.uid&&Be("remove"),pn!=null&&pn.dataset.uid&&ue(pn.dataset.uid),K(null);return}const Ye=Ti(Ae),ft=Ye==null?void 0:Ye.getBoundingClientRect();if(!(!!Ye&&!!ft&&q.clientX-ft.left>Q1&&ft.right-q.clientX>Q1)){if(UX(fe))return;nk(fe,q.clientX,q.clientY);return}nk(fe,q.clientX,q.clientY);const Zt=Ye.dataset.uid??null;if(Zt&&(O==null?void 0:O.uid)===Zt){q.detail!==0&&Be("outside");return}const Ht=pu(as(Ye.dataset.tok??""));if(!Ht){Se(Ye);return}Ie(Ye,Ht,$o(fe),!1)},cn=q=>{if(q.pointerType!=="mouse")return;const fe=P.current;if(O||D||fe&&"chipDrag"in fe.dataset)return;const Ae=Ti(q.target),Ye=Ae==null?void 0:Ae.dataset.uid;if(!Ae||!Ye||!Fe(Ae)){re.close();return}if((z==null?void 0:z.uid)===Ye){re.keep();return}re.open({uid:Ye,anchor:Ae})},Fe=q=>{const fe=as(q.dataset.tok??"");if(n8(fe))return!0;const Ae=pu(fe);return!!(Ae&&Ae!=="color"&&kh(Ae)&&q.querySelector("img"))},mt=q=>{const fe=Ti(q.target),Ae=fe==null?void 0:fe.dataset.uid;!fe||!Ae||O||D||Fe(fe)&&em(fe)&&re.open({uid:Ae,anchor:fe})},it=q=>{if(q.pointerType==="mouse")return;const fe=q.target;if(fe.closest('[data-role="remove"]'))return;const Ae=Ti(fe);if(!Ae)return;const Ye=Ae.getBoundingClientRect();if(q.clientX-Ye.left<=Q1||Ye.right-q.clientX<=Q1)return;const ft=kne(as(Ae.dataset.tok??""));if(!ft||Ae.dataset.uid&&(O==null?void 0:O.uid)===Ae.dataset.uid)return;q.preventDefault();const wt=P.current,Zt=document.activeElement===wt,Ht=Zt?$o(wt):H.current;Zt&&(wt==null||wt.blur()),Ie(Ae,ft,Ht,!0)},St=q=>{const fe=P.current,Ae=Ti(q.target);if(Ae&&!O){const Ye=()=>{zl(fe,Ae,"after"),fe==null||fe.focus({preventScroll:!0})};if(q.altKey&&(q.key==="ArrowLeft"||q.key==="ArrowRight")){q.preventDefault(),fe&&rk(fe,Ae,q.key==="ArrowLeft"?-1:1)&&(Ae.focus({preventScroll:!0}),ze(),L(P6(fe,Ae)));return}if(q.key==="ArrowLeft"||q.key==="ArrowRight"){q.preventDefault(),zl(fe,Ae,q.key==="ArrowLeft"?"before":"after"),fe==null||fe.focus({preventScroll:!0});return}if(q.key==="Tab"){q.preventDefault(),zl(fe,Ae,q.shiftKey?"before":"after"),fe==null||fe.focus({preventScroll:!0});return}if(q.key==="Enter"||q.key===" "){q.preventDefault();const ft=pu(as(Ae.dataset.tok??""));ft&&fe?Ie(Ae,ft,ni(fe,Ae)+1,!1):Se(Ae);return}if(q.key==="Backspace"||q.key==="Delete"){if(q.preventDefault(),Ee())return;const ft=Ae.dataset.uid?ue(Ae.dataset.uid):null;fe==null||fe.focus({preventScroll:!0}),ft!=null&&Ra(fe,ft);return}if(q.key==="Escape"){q.preventDefault(),Ye();return}}if(q.key==="Escape"&&D){q.preventDefault(),K(null),B("");return}if(q.key==="Enter"&&!q.shiftKey){const Ye=q.defaultPrevented;q.preventDefault(),Jte({menuOpen:!!D,handled:Ye})&&C();return}if(!(D||O)&&!qte(q)){if(!q.shiftKey&&!q.altKey&&!q.metaKey&&!q.ctrlKey){if(q.key==="ArrowLeft"||q.key==="ArrowRight"){YX(fe,q.key==="ArrowLeft"?"left":"right")&&q.preventDefault();return}if(q.key==="Backspace"||q.key==="Delete"){const Ye=ek(fe,q.key);if(Ye!=null&&Ye.dataset.uid){if(q.preventDefault(),Ee())return;const ft=ue(Ye.dataset.uid);ft!=null&&Ra(fe,ft);return}if(tk(fe,q.key)){q.preventDefault();return}}}if((q.key==="$"||q.key==="/"||q.key==="@"||q.key==="#")&&!Ee()){const Ye=P.current,ft=AN(Ye),wt=ft.slice(-1);if(ft.length&&!/[\s\u00a0]/.test(wt))return;B(""),ae(Yd(q.key)),K({anchor:{getBoundingClientRect:()=>NN()??(Ye==null?void 0:Ye.getBoundingClientRect())??new DOMRect},sigil:q.key})}}},xt=s.useCallback(q=>{var fe,Ae;return(Ae=Zs((fe=r.json)==null?void 0:fe.palette).find(Ye=>Ye.hex===q))==null?void 0:Ae.name},[(st=r.json)==null?void 0:st.palette]),Nt=s.useCallback(()=>{requestAnimationFrame(()=>{const q=$.current;if(!q)return;q.scrollHeight-q.scrollTop-q.clientHeight>1?q.dataset.more="":delete q.dataset.more})},[]);s.useEffect(()=>{const q=$.current;if(!q)return;Nt();const fe=new ResizeObserver(Nt);fe.observe(q);for(const Ae of q.children)fe.observe(Ae);return()=>fe.disconnect()},[Nt]);const Kt=q=>{Nt();const fe=P.current,Ae=q==null?void 0:q.nativeEvent;if(Ae!=null&&Ae.isComposing)return;WX(fe)||ro(fe),o0(fe)&&Il(fe);const Ye=ke.current;ke.current=!1;const ft=Vg(fe,Zt=>tt(Zt),{commit:Ye,nameFor:xt});ft&&(K(null),B(""));const wt=ft?{open:!1}:ene(eQ(fe),Ye);wt.open?D&&(wt.query!==I&&ae(Yd(wt.sigil)),B(wt.query)):D&&(K(null),B("")),ze()},et=q=>{const fe=window.getSelection();if(!fe||fe.rangeCount===0||fe.isCollapsed)return null;const Ae=fe.getRangeAt(0),{text:Ye,html:ft}=nQ(Ae);return Ye?(q.clipboardData.setData("text/plain",Ye),q.clipboardData.setData("text/html",ft),q.preventDefault(),Ae):null},gt=q=>{et(q)},ot=q=>{const fe=et(q);fe&&(fe.deleteContents(),ro(P.current),ze())},kn=s.useCallback(q=>q.t==="template"?a.some(fe=>fe.id===q.id):q.t==="product"?W.some(fe=>fe.id===q.id)||c.some(fe=>fe.id===q.id):q.t==="character"?he.some(fe=>fe.id===q.id)||i.some(fe=>fe.id===q.id):q.t==="mark"?Xe.some(fe=>fe.hash===q.imageHash):!0,[a,W,he,i,c,Xe]);s.useEffect(()=>{const q=P.current;if(q)for(const fe of q.querySelectorAll(`.${Ol}[data-missing]`)){const Ae=as(fe.dataset.tok??"");Ae&&kn(Ae)&&fe.replaceWith(tt(Ae,fe.dataset.uid))}},[kn,tt]);const dt=q=>{Array.from(q.dataTransfer.types).includes("Files")&&(q.preventDefault(),J.current++,G(!0))},Gt=q=>q.preventDefault(),Ft=()=>{J.current=Math.max(0,J.current-1),J.current===0&&G(!1)},en=q=>{q.preventDefault(),J.current=0,G(!1),q.dataTransfer.files.length&&(j==null||j(q.dataTransfer.files))},Jt=q=>{q.preventDefault();const fe=q.clipboardData.files;if(fe.length&&Array.from(fe).some(ft=>ft.type.startsWith("image/"))){j==null||j(fe);return}ke.current=!0;const Ae=sQ(q.clipboardData.getData("text/html"));if(Ae&&se(Ae)){const ft=P.current;Vg(ft,wt=>tt(wt),{commit:!0,nameFor:xt})&&ze();return}const Ye=q.clipboardData.getData("text/plain");Ye&&document.execCommand("insertText",!1,Ye)},se=q=>{const fe=P.current,Ae=window.getSelection();if(!fe||!Ae||Ae.rangeCount===0||!fe.contains(Ae.getRangeAt(0).startContainer))return!1;const Ye=Ae.getRangeAt(0);Ye.deleteContents();let ft=!1,wt=Array.from(fe.querySelectorAll(`.${Ol}`)).filter(Dt=>c0.has(Dt.dataset.kind??"")).length,Zt=!1;const Ht=new Set,pn=[];for(const Dt of q){if(typeof Dt=="string"){pn.push(Dt);continue}if(!kn(Dt)){pn.push(Xne(Dt,a,W));continue}if(Dt.t==="template"){if(ft)continue;ft=!0}const On=Ta(Dt);if(On){if(Ht.has(On)||_g(fe,On))continue;Ht.add(On)}if(c0.has(Dt.t)&&!(Dt.t==="template"&&zd(fe))){if(wt>=ep){Zt=!0;continue}wt+=1}pn.push(Dt)}Zt&&L(F6);const Wt=ft?zd(fe):null,wn=document.createDocumentFragment();for(const Dt of pn)wn.appendChild(typeof Dt=="string"?document.createTextNode(Dt):tt(Dt));const sn=wn.lastChild;Ye.insertNode(wn),Wt&&Wt.remove();const In=sn?sn.nodeType===Node.TEXT_NODE?Uh(fe,sn,sn.length):Uh(fe,fe,Array.from(fe.childNodes).indexOf(sn)+1):$o(fe)??0;return ro(fe),Ra(fe,In),ze(),!0},oe=s.useCallback(()=>{requestAnimationFrame(()=>{const q=P.current;q&&document.activeElement===q&&o0(q)&&Il(q)})},[]),we=O?as(O.anchor.dataset.tok??""):null,ge=n8(we),ee=we?(v==null?void 0:v(we))??null:null,He=we&&(w!=null&&w(we))?y??null:null,We=z?as(z.anchor.dataset.tok??""):null,Ue=n8(We),Ge=(($t=z==null?void 0:z.anchor.querySelector("img"))==null?void 0:$t.getAttribute("src"))??null,me=Ue?dn(Ue,"tile"):sr(Ge,"tile"),_e=pu(We),U=We&&kh(We.t)?We.t:_e&&_e!=="color"&&kh(_e)?_e:null,pe=We?(v==null?void 0:v(We))??null:null,Oe=We&&(w!=null&&w(We))?y??null:null,Le=Ee()?void 0:()=>{if(!O)return;const q=ue(O.uid);Be("remove",q)};return o.jsxs("div",{className:"sc-brief",ref:$,onScroll:Nt,"data-drag-over":be||void 0,children:[o.jsx("span",{id:R,className:"sc-vh",children:"Press Enter to open, Delete to remove, Alt plus arrow keys to move."}),o.jsx("span",{className:"sc-vh",role:"status","aria-live":"polite",children:E}),o.jsx("div",{ref:P,className:"sc-brief-line",contentEditable:!0,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-autocomplete":"list","aria-expanded":D?!0:void 0,"aria-controls":D?l0:void 0,"aria-activedescendant":D?X??void 0:void 0,"aria-label":m,"aria-placeholder":h,tabIndex:0,dir:"auto","data-ph":h,...p?{"data-ph-sm":p}:{},onClick:Ct,onPointerDown:it,onPointerOver:cn,onPointerLeave:q=>q.pointerType==="mouse"&&re.close(),onFocusCapture:mt,onKeyDown:St,onInput:Kt,onCopy:gt,onCut:ot,onPaste:Jt,onDragEnter:dt,onDragOver:Gt,onDragLeave:Ft,onDrop:en,onFocus:oe,onBlur:()=>{const q=P.current;Vg(q,fe=>tt(fe),{commit:!0,nameFor:xt})&&(K(null),B("")),ze()}}),D&&o.jsx(pne,{anchor:D.anchor,composer:{getBoundingClientRect:()=>{var q,fe,Ae;return((fe=(q=P.current)==null?void 0:q.closest(".sc-promptcard"))==null?void 0:fe.getBoundingClientRect())??((Ae=P.current)==null?void 0:Ae.getBoundingClientRect())??new DOMRect}},line:{getBoundingClientRect:()=>{var q;return((q=P.current)==null?void 0:q.getBoundingClientRect())??new DOMRect}},query:I,options:Lt,remaining:lt.remaining,total:lt.total,sigil:D.sigil,onMore:Ut,onActiveId:le,onClose:()=>{K(null),B("")}}),z&&me&&U&&o.jsx(od,{anchor:z.anchor,kind:U,src:me,label:Oo(z.anchor),warning:pe,note:Oe,onOpen:()=>{const q=z.anchor;if(Ue){Se(q);return}F(),b==null||b({src:me,kind:U,label:Oo(q)})},onHoverIn:re.keep,onHoverOut:re.close,onClose:F},z.uid),(O==null?void 0:O.kind)==="ref"||(O==null?void 0:O.kind)==="mark"?o.jsx(Fte,{kind:O.kind,label:Oo(O.anchor),thumb:ge?dn(ge,"micro"):null,onInspect:()=>Se(O.anchor),onMove:q=>nt(O.uid,q),onRemove:Le,onClose:Be},O.uid):(O==null?void 0:O.kind)==="color"?o.jsx(Hne,{anchor:O.anchor,currentHex:J1(O.anchor),currentName:Yne(O.anchor),palette:Zs((An=r.json)==null?void 0:An.palette),onPick:(q,fe)=>{var Ye;const Ae=O.uid;if(fe!=null&&fe.live){const ft=(Ye=P.current)==null?void 0:Ye.querySelector(`[data-uid="${CSS.escape(Ae)}"]`);ft&&dQ(ft,q),ze();return}if(qne(q.hex,J1(O.anchor))){Be("pick");return}Pe(Ae,q),Be("pick")},onRemove:Le,onMove:q=>nt(O.uid,q),onClose:Be},O.uid):O?o.jsx(Mne,{kind:O.kind,anchor:O.anchor,currentId:J1(O.anchor),candidates:Ze(O.kind),brandId:r.id,brandSlug:r.slug,warning:ee,note:He,onAttachRequest:S?q=>{Be("outside"),S(q)}:void 0,onPick:q=>{const fe=O.uid;if(q.id===J1(O.anchor)){Be("pick");return}q.kind==="scene"?u(q.id):Pe(fe,q.token),Be("pick")},onRemove:Le,onMove:q=>nt(O.uid,q),onClose:Be},O.uid):null]})});function J1(e){const t=as(e.dataset.tok??"");return t?t.t==="color"?t.hex:"id"in t?t.id:null:null}function Yne(e){const t=as(e.dataset.tok??"");return(t==null?void 0:t.t)==="color"?t.name:void 0}function qne(e,t){const n=e?nr(e):null,r=t?nr(t):null;return!!n&&n===r}function Xne(e,t,n){var r,a;return e.t==="template"?((r=t.find(i=>i.id===e.id))==null?void 0:r.name)??"template":e.t==="product"?((a=n.find(i=>i.id===e.id))==null?void 0:a.name)??"product":e.t==="character"?"someone":e.t==="color"?e.name??e.hex:e.t==="mark"?"brand mark":e.t==="ref"?e.label??"Image":"reference"}function eh(e,t){return t===null?e===null:e===t}function Qne(e){const t=e.closest(".sc-filterbar, .sc-toolbar"),n=t==null?void 0:t.closest("[data-page-scroll]");if(!t||!n)return;let r=t.nextElementSibling;for(;r&&r.getBoundingClientRect().height===0;)r=r.nextElementSibling;if(!r)return;const i=r.getBoundingClientRect().top-n.getBoundingClientRect().top+n.scrollTop-Number.parseFloat(getComputedStyle(t).marginBottom)-t.offsetHeight;if(n.scrollTop<=i+1)return;const c=window.matchMedia("(prefers-reduced-motion: reduce)").matches;n.scrollTo({top:i,behavior:c?"auto":"smooth"})}function tw({"aria-label":e,activeKey:t,items:n,onSelect:r}){const a=s.useRef(null),i=s.useRef(null),c=n.map(p=>`${p.value??""}:${p.count??""}`).join("|");s.useLayoutEffect(()=>{const p=a.current,m=i.current;if(!p||!m)return;let v=0;const w=()=>{const N=m.querySelector(":scope > button[data-on]");if(!N)return m.style.setProperty("--sc-ink-x","0px"),m.style.setProperty("--sc-ink-w","0px"),null;const P=N.querySelector(".sc-vlabel")??N;return m.style.setProperty("--sc-ink-x",`${N.offsetLeft+P.offsetLeft}px`),m.style.setProperty("--sc-ink-w",`${P.offsetWidth}px`),N},y=()=>{const N=m.scrollWidth-m.clientWidth;if(N<=1){delete p.dataset.overflowLeft,delete p.dataset.overflowRight;return}m.scrollLeft>2?p.dataset.overflowLeft="":delete p.dataset.overflowLeft,m.scrollLeft<N-2?p.dataset.overflowRight="":delete p.dataset.overflowRight},b=N=>{const P=m.scrollWidth-m.clientWidth;if(P<=0)return;const $=[...m.querySelectorAll(":scope > button")],R=$.indexOf(N);if(R<0)return;const E=72,M=m.scrollLeft,L=M+m.clientWidth,H=$[R-1],D=$[R+1],K=D?D.offsetLeft+Math.min(E,D.offsetWidth):N.offsetLeft+N.offsetWidth+8,O=H?Math.max(0,H.offsetLeft+H.offsetWidth-E):Math.max(0,N.offsetLeft-8);let _=M;if(K>L)_=Math.min(P,K-m.clientWidth);else if(O<M)_=O;else return;if(Math.abs(_-M)<1)return;const re=window.matchMedia("(prefers-reduced-motion: reduce)").matches;m.scrollTo({left:_,behavior:re?"auto":"smooth"})},k=w();k&&b(k),y(),m.dataset.inkReady||requestAnimationFrame(()=>{m.dataset.inkReady=""});const S=()=>{v||(v=requestAnimationFrame(()=>{v=0,y()}))},C=N=>{if(m.scrollWidth<=m.clientWidth+1||Math.abs(N.deltaX)>Math.abs(N.deltaY)||N.deltaY===0)return;const P=m.scrollWidth-m.clientWidth,$=Math.max(0,Math.min(P,m.scrollLeft+N.deltaY));$!==m.scrollLeft&&(N.preventDefault(),m.scrollLeft=$,y())},j=new ResizeObserver(()=>{w(),y()});j.observe(m);for(const N of m.querySelectorAll(":scope > button"))j.observe(N);return m.addEventListener("scroll",S,{passive:!0}),m.addEventListener("wheel",C,{passive:!1}),()=>{v&&cancelAnimationFrame(v),j.disconnect(),m.removeEventListener("scroll",S),m.removeEventListener("wheel",C)}},[t,c]);const u=p=>{eh(t,p)||(a.current&&Qne(a.current),r(p))},f=p=>{var y;if(p.key!=="ArrowLeft"&&p.key!=="ArrowRight"&&p.key!=="Home"&&p.key!=="End"||n.length===0)return;p.preventDefault();const m=Math.max(0,n.findIndex(b=>eh(t,b.value)));let v=m;if(p.key==="ArrowRight"?v=Math.min(n.length-1,m+1):p.key==="ArrowLeft"?v=Math.max(0,m-1):p.key==="Home"?v=0:p.key==="End"&&(v=n.length-1),v===m)return;u(n[v].value);const w=(y=i.current)==null?void 0:y.querySelectorAll(":scope > button")[v];w==null||w.focus()},h=n.findIndex(p=>eh(t,p.value));return o.jsx("div",{ref:a,className:"sc-verticals-shell",children:o.jsxs("div",{ref:i,className:"sc-verticals",role:"tablist","aria-label":e,onKeyDown:f,children:[o.jsx("span",{className:"sc-verticals-ink","aria-hidden":!0}),n.map((p,m)=>{const v=eh(t,p.value);return o.jsxs("button",{type:"button",role:"tab","aria-selected":v,"data-on":v?"":void 0,tabIndex:v||h<0&&m===0?0:-1,onClick:()=>u(p.value),children:[o.jsx("span",{className:"sc-vlabel",children:p.label}),p.count!==void 0&&o.jsx("span",{className:"sc-vcount",children:p.count})]},p.value??"__all__")})]})})}function ld({value:e,onChange:t,noun:n,total:r,shortcut:a=!0}){const i=s.useRef(null),[c,u]=s.useState(e.trim().length>0),f=s.useCallback(()=>{var p;Rr.flushSync(()=>u(!0)),(p=i.current)==null||p.focus()},[]);s.useEffect(()=>{e.trim().length>0&&u(!0)},[e]),s.useEffect(()=>{if(!a)return;const p=m=>{if(m.key!=="/"||m.metaKey||m.ctrlKey||m.altKey)return;const v=m.target;v!=null&&v.isContentEditable||v&&/^(input|textarea|select)$/i.test(v.tagName)||(m.preventDefault(),f())};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[f,a]);const h=p=>{var m;p.key==="Escape"&&(p.stopPropagation(),e?t(""):(u(!1),(m=i.current)==null||m.blur()))};return o.jsxs("div",{className:"sc-libsearch","data-open":c?"":void 0,children:[o.jsx("button",{type:"button",className:"sc-libsearch-toggle","aria-label":`Search ${n}`,"aria-expanded":c,tabIndex:c?-1:0,onClick:f,children:o.jsx(_u,{size:16})}),o.jsxs("div",{className:"sc-libsearch-field",children:[o.jsx(_u,{size:15,"aria-hidden":!0}),o.jsx("input",{ref:i,type:"search",value:e,placeholder:r==null?`Search ${n}`:`Search ${r} ${n}`,"aria-label":`Search ${n}`,autoComplete:"off",autoCorrect:"off",spellCheck:!1,tabIndex:c?0:-1,onChange:p=>t(p.target.value),onKeyDown:h,onBlur:()=>{e.trim()||u(!1)}}),o.jsx("button",{type:"button",className:"sc-libsearch-clear","aria-label":"Clear search",hidden:!e,tabIndex:e?0:-1,onMouseDown:p=>p.preventDefault(),onClick:()=>{var p;t(""),(p=i.current)==null||p.focus()},children:o.jsx(jn,{size:12,weight:"bold"})})]})]})}function VM({why:e,children:t}){return e?o.jsx(lv,{content:e,className:"sc-tip",maxWidth:"220px",children:$A(t)}):t}const Jne=["All","Products","Presenters","Scenes","Colors","Brand","Shots"],tp=Jne.filter(e=>e!=="All"),c5={Products:"Products",Presenters:"Presenters",Scenes:"Scenes",Colors:"Brand colors",Brand:"Brand marks",Shots:"Shots"},ere={Products:"Product",Presenters:"Presenter",Scenes:"Scene",Colors:"Brand color",Brand:"Brand mark",Shots:"Reference shot"},_6={Products:"products",Presenters:"presenters",Scenes:"scenes",Colors:"brand colors",Brand:"brand marks",Shots:"shots"},tre={Products:"square",Presenters:"square",Scenes:"square",Colors:"swatch",Brand:"square",Shots:"square"},zM={Products:132,Presenters:132,Scenes:132,Colors:132,Brand:132,Shots:132},Z6={Products:96,Presenters:96,Scenes:96,Colors:96,Brand:96,Shots:96},u5=10;function nre(e,t,n){const r=(n?Z6:zM)[e];return r<=0||t<=0?1:Math.max(1,Math.floor((t+u5)/(r+u5)))}const rre={product:"Products",presenter:"Presenters",scene:"Scenes"};function sre(e){const t=rre[e.kind];return{key:Ta(e.token),group:t,shape:tre[t],label:e.label,sub:e.kind==="product"?e.sub:void 0,full:e.recommended?`${e.full} · Recommended`:e.full,search:e.search,thumb:sr(e.thumb??null,"small"),crop:e.crop,recommended:e.recommended,bookmarked:e.bookmarked,token:e.token}}function are(e){const t=Sf(e).map(r=>{const a=r.hash,i=Jp(e,r);return{key:`m:${a}`,group:"Brand",shape:"square",label:i,full:`${i} · the mark itself`,search:i,thumb:dn(a,"micro"),token:{t:"mark",imageHash:a}}}),n=Zs(e==null?void 0:e.palette).map(r=>{const a={t:"color",hex:r.hex,name:r.name};return{key:Ta(a),group:"Colors",shape:"swatch",label:r.name,full:`${r.name} · ${r.hex}`,search:`${r.name} ${r.hex}`,swatch:r.hex,token:a}});return[...t,...n]}function ore(e,t){return e.map((n,r)=>{const a=`Shot ${Math.max(1,t-r)}`;return{key:`r:${n.images[0]}`,group:"Shots",shape:"square",label:a,full:`${a} · joins the shot as a reference image`,search:a,thumb:dn(n.images[0],"micro"),token:{t:"ref",imageHash:n.images[0],label:"Shot"}}})}const d5=(e,t)=>vo(`${e.label} ${e.sub??""} ${e.search}`,t),BM=`
|
|
104
|
-
`;function ire(e){return e.map(Ta).filter(t=>t.length>0).join(BM)}function lre(e){return new Set(e?e.split(BM):[])}const cre=new Set(["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"]);function ure(e,t,n,r){const a=r.length?r[r.length-1].end+1:0;if(a===0)return t==="ArrowUp"?"search":null;const i=Math.max(1,n),c=r.findIndex(p=>e>=p.start&&e<=p.end),u=r[c]??{start:0,end:a-1},f=(e-u.start)%i,h=p=>p.start+Math.floor((p.end-p.start)/i)*i;switch(t){case"ArrowRight":return e+1<a?e+1:null;case"ArrowLeft":return e>0?e-1:null;case"Home":return 0;case"End":return a-1;case"ArrowDown":{if(e+i<=u.end)return e+i;if(e<h(u))return u.end;const p=r[c+1];return p?p.start+Math.min(f,p.end-p.start):null}case"ArrowUp":{if(e-i>=u.start)return e-i;const p=r[c-1];return p?Math.min(p.end,h(p)+f):"search"}}}function dre(e,t){const n=t.trim();return e==="All"?n?`Nothing matches “${n}”.`:"Nothing to add yet.":n?`No matching ${_6[e]}.`:e==="Shots"?"No finished shots yet.":`No ${_6[e]} yet.`}function fre(e){return[{value:null,label:"All",count:tp.reduce((n,r)=>n+e[r],0)},...tp.map(n=>({value:n,label:n,count:e[n]}))]}const hre=s.memo(function({card:t,index:n,active:r,ticked:a,why:i,onPick:c,onFocus:u}){const f=m=>{(m.key==="Enter"||m.key===" ")&&m.stopPropagation()},h=i&&!a?i:null,p=o.jsxs("button",{type:"button",className:"sc-ap-card","data-shape":t.shape,"data-group":t.group,"data-nav":n,"data-on":a?"":void 0,tabIndex:r?0:-1,"aria-disabled":h?!0:void 0,"aria-pressed":a,title:h??(a?`${t.label} is in the shot. Press to remove it.`:t.full),onClick:h?void 0:()=>c(n),onFocus:()=>u(n),onKeyDown:f,children:[t.shape==="swatch"?o.jsx("span",{className:"sc-ap-thumb sc-ap-swatch",style:{background:t.swatch},"aria-hidden":!0}):o.jsx(pre,{src:t.thumb,crop:t.crop}),o.jsxs("span",{className:"sc-ap-cap",children:[o.jsxs("span",{className:"sc-vh",children:[ere[t.group],": "]}),o.jsx("b",{dir:"auto",children:t.label}),t.sub&&o.jsx("span",{dir:"auto",children:t.sub})]}),(a||!i)&&o.jsxs("span",{className:"sc-ap-puck","aria-hidden":!0,children:[o.jsx(cr,{className:"sc-ap-puck-add",size:11,weight:"bold"}),o.jsx(Kn,{className:"sc-ap-puck-on",size:11,weight:"bold"}),o.jsx(jn,{className:"sc-ap-puck-off",size:11,weight:"bold"})]}),a&&o.jsx("span",{className:"sc-vh",children:" In the shot."})]});return o.jsx(VM,{why:h,children:p})});function pre({src:e,crop:t}){const[n,r]=s.useState(!1);return s.useEffect(()=>r(!1),[e]),o.jsx("span",{className:"sc-ap-thumb","data-empty":!e||n?"":void 0,children:!e||n?o.jsx(Ws,{size:16}):o.jsx("img",{src:e,alt:"",loading:"lazy",decoding:"async","data-crop":t,onError:()=>r(!0)})})}function f5({onClick:e}){return o.jsxs("button",{type:"button",className:"sc-ap-card sc-ap-add sc-ap-upload-tile",title:"Add an image from your phone. It joins the shot as a reference.",onClick:e,children:[o.jsx("span",{className:"sc-ap-thumb",children:o.jsx(fv,{size:22,"aria-hidden":!0})}),o.jsx("span",{className:"sc-ap-cap",children:o.jsx("b",{children:"Upload image"})})]})}const mre=48,gre={items:[],total:0,hasMore:!1,loading:!1,settled:!1,error:null,loadMore:()=>{}};function nw(e,t,n=!0){const r=t.trim(),{shotsEpoch:a,subscribeActivity:i}=on(),c=`${e}|${r}|${a}`,[u,f]=s.useState({key:"",items:[],next:null,total:0}),[h,p]=s.useState(!1),[m,v]=s.useState(null),w=s.useRef(null),y=s.useCallback(async S=>{var j;(j=w.current)==null||j.abort();const C=new AbortController;w.current=C,p(!0),v(null);try{const N=await Me.feed(e,{lens:"all",sort:"newest",q:r,limit:mre,cursor:S??void 0},C.signal);if(C.signal.aborted)return;f(P=>{var R;const $=S===null||P.key!==c;return{key:c,items:$?N.items:[...P.items,...N.items],next:N.next,total:((R=N.counts)==null?void 0:R.all)??($?N.items.length:P.total)}})}catch(N){if(C.signal.aborted)return;v(String(N.message??N))}finally{C.signal.aborted||p(!1)}},[e,r,c]);s.useEffect(()=>{if(!n)return;const S=u.key===""?0:150,C=setTimeout(()=>void y(null),S);return()=>clearTimeout(C)},[y,n]),s.useEffect(()=>()=>{var S;return(S=w.current)==null?void 0:S.abort()},[]),s.useEffect(()=>i(S=>{const C=new Map(S.map(j=>[j.id,j]));f(j=>{if(!j.items.some(P=>C.has(P.id)))return j;const N=j.items.flatMap(P=>{const $=C.get(P.id);return $?$.archived?[]:[{...P,...$}]:[P]});return{...j,items:N,total:Math.max(0,j.total-(j.items.length-N.length))}})}),[i]);const b=u.key===c?u:null,k=s.useCallback(()=>{b!=null&&b.next&&y(b.next)},[b==null?void 0:b.next,y]);return b?{items:b.items.filter(S=>S.status==="done"&&S.images.length>0),total:b.total,hasMore:b.next!==null,loading:h,settled:!0,error:m,loadMore:k}:{...gre,loading:h,error:m,loadMore:k}}const r8={Products:"product",Presenters:"presenter",Scenes:"scene"};function vre({brand:e,tab:t,onTab:n,only:r,activeProductCategory:a,refining:i,full:c,attached:u,phone:f,touch:h,onPick:p,onRemove:m,onUpload:v,onFiles:w,onClose:y}){const b=s.useRef(a).current,k=Lf(b),S=s.useMemo(()=>new Set(si(e.id)),[e.id]),C=cl(),{applyBrand:j}=Rn(),{push:N}=ir(),[P,$]=s.useState(!1),[R,E]=s.useState(""),M=s.useDeferredValue(R),[L,H]=s.useState(Zi),[D,K]=s.useState(0),[O,_]=s.useState(f?347:696),re=s.useRef(null),z=s.useRef(null);s.useEffect(()=>{H(Zi),K(0)},[t,M]),s.useLayoutEffect(()=>{const ce=z.current;if(!ce)return;const ve=()=>_(ce.clientWidth-2*yre(ce));ve();const Pe=new ResizeObserver(ve);return Pe.observe(ce),()=>Pe.disconnect()},[]);const F=s.useMemo(()=>({product:Vi("product",k),presenter:Vi("presenter",k),scene:Vi("scene",k)}),[k]),Q=s.useMemo(()=>are(e.json),[e.json]),V=nw(e.id,M),I=s.useMemo(()=>ore(V.items,V.total),[V.items,V.total]),B=s.useMemo(()=>{const ce={};for(const ve of tp){const Pe=r8[ve];ce[ve]=ve==="Shots"?V.total:Pe?Lu(F[Pe],M).length:Q.filter(ue=>ue.group===ve&&d5(ue,M)).length}return ce},[F,Q,M,V.total]),Y=s.useCallback((ce,ve)=>{const Pe=r8[ce];if(Pe){const Ee=mm(Pe,F[Pe],{currentId:null,query:M,bookmarked:S,shown:ve});return{group:ce,items:Ee.items.map(sre),total:Ee.total,remaining:Ee.remaining}}if(ce==="Shots"){const Ee=I.slice(0,ve),Ke=V.hasMore?Math.max(1,V.total-I.length):Math.max(0,I.length-ve);return{group:ce,items:Ee,total:V.total,remaining:Ke}}const ue=Q.filter(Ee=>Ee.group===ce&&d5(Ee,M));return{group:ce,items:ue.slice(0,ve),total:ue.length,remaining:Math.max(0,ue.length-ve)}},[F,Q,M,S,I,V.hasMore,V.total]),ae=s.useMemo(()=>{if(t==="All"){const ce=[];for(const ve of tp){const Pe=nre(ve,O,f),ue=Y(ve,f&&ce.length===0?Math.max(1,Pe-1):Pe);ue.items.length>0&&ce.push(ue)}return ce}return[Y(t,t==="Shots"?Number.MAX_SAFE_INTEGER:L)]},[t,Y,L,O,f]),{flat:X,navGroups:le}=s.useMemo(()=>{const ce=[],ve=[];for(const Pe of ae)Pe.items.length&&(ve.push({start:ce.length,end:ce.length+Pe.items.length-1}),ce.push(...Pe.items));return{flat:ce,navGroups:ve}},[ae]);s.useEffect(()=>{K(ce=>Math.max(0,Math.min(ce,X.length-1)))},[X.length]);const ke=s.useCallback(ce=>{var Pe;const ve=(Pe=z.current)==null?void 0:Pe.querySelector(`[data-nav="${ce}"]`);ve&&(K(ce),ve.focus({preventScroll:!0}),ve.scrollIntoView({block:"nearest"}))},[]),te=s.useRef(null),be=s.useRef(()=>{});be.current=()=>{const ce=ae[0];!ce||t==="All"||ce.remaining<=0||(ce.group==="Shots"?V.loading||V.loadMore():H(ve=>ve+Zi))},s.useEffect(()=>{const ce=te.current,ve=z.current;if(!ce||!ve)return;const Pe=new IntersectionObserver(ue=>{ue.some(Ee=>Ee.isIntersecting)&&be.current()},{root:ve,rootMargin:"0px 0px 240px 0px"});return Pe.observe(ce),()=>Pe.disconnect()},[t,ae]);const G=s.useCallback(ce=>{var Pe,ue;const ve=X[ce];ve&&(u.has(ve.key)?m(ve):p(ve),h&&((ue=(Pe=document.activeElement)==null?void 0:Pe.blur)==null||ue.call(Pe)))},[X,u,h,p,m]),J=ce=>{const ve=ce.clipboardData.files;!ve.length||!Array.from(ve).some(Pe=>Pe.type.startsWith("image/"))||(ce.preventDefault(),w(ve))},ne=ce=>{var Ke,ye;const ve=ce.target,Pe=ve instanceof HTMLInputElement&&!!((Ke=re.current)!=null&&Ke.contains(ve));if(ce.key==="Escape"){if(Pe)return;ce.preventDefault(),ce.stopPropagation(),y();return}if(Pe){ce.key==="ArrowDown"?(ce.preventDefault(),ce.stopPropagation(),ke(0)):ce.key==="Enter"&&(ce.preventDefault(),ce.stopPropagation(),G(0));return}if(!cre.has(ce.key)||(ce.stopPropagation(),ve.closest('[role="tablist"]')))return;const ue=ve.closest("[data-nav]");if(!ue)return;ce.preventDefault();const Ee=ure(D,ce.key,wre(ue.closest(".sc-ap-grid")),le);if(Ee==="search"){const Se=re.current;(ye=(Se==null?void 0:Se.querySelector(".sc-libsearch[data-open] input"))??(Se==null?void 0:Se.querySelector(".sc-libsearch-toggle")))==null||ye.focus()}else Ee!=null&&ke(Ee)},W=async ce=>{$(!0);try{const ve=await Oj(e.id,ce);j(ve);const Pe=ve.logoHash;Pe&&p({key:`m:${Pe}`,group:"Brand",shape:"square",label:"Logo",full:"Logo",search:"",token:{t:"mark",imageHash:Pe}});const ue=ve.logoEdge;ue&&ue<512&&N({kind:"warning",title:"Logo added, but it is small",detail:`Only ${ue}px across. Fine lettering may not survive generation. Export it larger, or as SVG.`})}catch(ve){N(nn(ve,"Could not upload that logo"))}finally{$(!1)}},he=ce=>C(ce,{onCreated:ve=>{if(ve.kind===ce){if(ve.kind==="product"){const Pe={t:"product",id:ve.id};p({key:Ta(Pe),group:"Products",shape:"square",label:"Product",full:"",search:"",token:Pe});return}if(ve.kind==="presenter"){const Pe={t:"character",id:ve.id};p({key:Ta(Pe),group:"Presenters",shape:"square",label:"Presenter",full:ve.name,search:ve.name,token:Pe});return}n("Scenes")}}}),Xe=async ce=>{var ue;const ve=XA((ue=e.json)==null?void 0:ue.palette,ce);if(!ve.swatch)return;if(ve.added)try{const Ee=await Me.updateBrand(e.id,{...e.json??{},palette:ve.palette});j(Ee)}catch(Ee){N(nn(Ee,"Could not save the brand"));return}const Pe={t:"color",hex:ve.swatch.hex,name:ve.swatch.name};p({key:Ta(Pe),group:"Colors",shape:"swatch",label:ve.swatch.name,full:"",search:"",swatch:ve.swatch.hex,token:Pe})},tt=ce=>i&&ce==="Scenes"?"Scenes set up a new shot. Press X on Refining to use one.":c&&ce!=="Colors"?c:null,ze=X.length===0;let nt=0;return o.jsxs("div",{className:"sc-ap-inner",onKeyDown:ne,onPaste:J,children:[o.jsxs("div",{className:"sc-ap-head",ref:re,children:[o.jsx("div",{className:"sc-ap-tabs",children:o.jsx(tw,{"aria-label":"What to add",activeKey:t==="All"?null:t,items:fre(B),onSelect:ce=>n(ce??"All")})}),o.jsxs("div",{className:"sc-ap-actions",children:[o.jsxs("div",{className:"sc-ap-actions-add",children:[o.jsx(ld,{value:R,onChange:E,noun:t==="All"?"everything":_6[t],total:t==="All"?void 0:B[t],shortcut:!1}),!f&&o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary sc-ap-upload",onClick:v,title:"Add an image from your computer. It joins the shot as a reference.",children:[o.jsx(fv,{size:14,"aria-hidden":!0}),o.jsx("span",{children:"Upload image"})]})]}),!f&&o.jsx("button",{type:"button",className:"sc-icon-btn sc-ap-close",onClick:y,"aria-label":"Close",children:o.jsx(jn,{size:14})})]})]}),o.jsxs("div",{className:"sc-ap-body",ref:z,children:[i&&t==="Scenes"&&o.jsx("p",{className:"sc-ap-hint",children:"Scenes set up a new shot, so they sit out while you are refining. Press X on Refining to use one."}),ae.map((ce,ve)=>{var Se,Ie,Be;const Pe=tt(ce.group),ue=nt;nt+=ce.items.length;const Ee=r8[ce.group],ye={"--ap-min":`${(f?Z6:zM)[ce.group]}px`,"--ap-lines":Ee==="product"?2:1};return o.jsxs("section",{className:"sc-ap-group","aria-label":c5[ce.group],children:[o.jsxs("div",{className:"sc-ap-sec",children:[o.jsxs("span",{className:"sc-ap-sec-title",children:[c5[ce.group],o.jsx("span",{className:"sc-ap-sec-n",children:ce.total})]}),t==="All"&&ce.total>ce.items.length&&o.jsxs("button",{type:"button",className:"sc-ap-sec-act",onClick:()=>n(ce.group),children:["Show all ",ce.total]}),t==="Products"&&!r&&o.jsx("button",{type:"button",className:"sc-ap-sec-act sc-ap-add",onClick:()=>he("product"),children:"Add product"}),t==="Presenters"&&!r&&o.jsx("button",{type:"button",className:"sc-ap-sec-act sc-ap-add",onClick:()=>he("presenter"),children:"Create presenter"}),t==="Scenes"&&!r&&o.jsx("button",{type:"button",className:"sc-ap-sec-act sc-ap-add",onClick:()=>he("scene"),children:"Create scene"}),t==="Colors"&&o.jsx(Zu,{className:"sc-ap-sec-act sc-ap-add",triggerStyle:{background:"none"},value:nm(Zs((Se=e.json)==null?void 0:Se.palette)),presets:Zs((Ie=e.json)==null?void 0:Ie.palette).map(Re=>Re.hex),commitMode:"close",align:"end",label:"Add color",onChange:Re=>void Xe(Re),children:"Add color"}),t==="Brand"&&o.jsxs("label",{className:"sc-ap-sec-act sc-ap-add",title:"Add your logo to the brand kit","data-busy":P||void 0,children:[o.jsx("input",{type:"file",accept:"image/*",className:"sc-vh",disabled:P,onChange:Re=>{var Qe;const Ze=(Qe=Re.target.files)==null?void 0:Qe[0];Re.target.value="",Ze&&W(Ze)}}),"Add logo"]})]}),o.jsxs("div",{className:"sc-ap-grid","data-shape":((Be=ce.items[0])==null?void 0:Be.shape)??"square",style:ye,children:[f&&ve===0&&!r&&o.jsx(f5,{onClick:v}),ce.items.map((Re,Ze)=>o.jsx(hre,{card:Re,index:ue+Ze,active:ue+Ze===D,ticked:u.has(Re.key),why:Pe,onPick:G,onFocus:K},Re.key))]}),t!=="All"&&ce.remaining>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:te,className:"sc-ap-sentinel","aria-hidden":!0}),o.jsxs("p",{className:"sc-ap-foot","aria-live":"polite",children:[ce.items.length," of ",ce.total]})]})]},ce.group)}),t==="Shots"&&V.error&&o.jsxs("p",{className:"sc-ap-empty",children:["Could not load the shots. ",V.error]}),ze&&f&&o.jsx("div",{className:"sc-ap-grid",style:{"--ap-min":`${Z6.Products}px`},children:o.jsx(f5,{onClick:v})}),ze&&!(t==="Shots"&&(!V.settled||V.loading||V.error))&&o.jsx("p",{className:"sc-ap-empty",children:dre(t,R)})]})]})}function wre(e){return e?Math.max(1,getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length):1}function yre(e){return Number.parseFloat(getComputedStyle(e).paddingLeft)||0}const bre="(pointer: coarse)";function xre(e){const t=wr(Ks),n=wr(bre),[r,a]=s.useState(e.initialTab??"All");s.useEffect(()=>{a(e.initialTab??"All")},[e.initialTab,e.tabNonce]);const[i]=tl(),c=i.get("new")!==null;return o.jsx(kre,{id:e.id,phone:t,touch:n,creating:c,onClose:e.onClose,children:o.jsx(vre,{brand:e.brand,tab:e.only??r,onTab:a,only:e.only,activeProductCategory:e.activeProductCategory,refining:e.refining,full:e.full,attached:e.attached,phone:t,touch:n,onPick:e.onPick,onRemove:e.onRemove,onUpload:e.onUpload,onFiles:e.onFiles,onClose:()=>e.onClose({restore:!n})})})}function kre({id:e,phone:t,touch:n,creating:r,onClose:a,children:i}){const c=s.useRef(null),u=()=>{var p;return a({restore:!n&&!!((p=c.current)!=null&&p.contains(document.activeElement))})},f=s.useRef(u);f.current=u,s.useEffect(()=>{var p,m;n&&((m=(p=document.activeElement)==null?void 0:p.blur)==null||m.call(p))},[n]),s.useLayoutEffect(()=>{var y,b;const p=c.current,m=p==null?void 0:p.parentElement;if(!t||!p||!m)return;const v=()=>{const k=p.closest(".sc-shell")??document.documentElement,S=Number.parseFloat(getComputedStyle(k).getPropertyValue("--sc-topbar-h"))||0,C=m.getBoundingClientRect().top-S-16;p.style.setProperty("--ap-avail",`${Math.max(160,Math.round(C))}px`)};v();const w=new ResizeObserver(v);return w.observe(m),window.addEventListener("resize",v),(y=window.visualViewport)==null||y.addEventListener("resize",v),(b=window.visualViewport)==null||b.addEventListener("scroll",v),()=>{var k,S;w.disconnect(),window.removeEventListener("resize",v),(k=window.visualViewport)==null||k.removeEventListener("resize",v),(S=window.visualViewport)==null||S.removeEventListener("scroll",v)}},[t]),s.useEffect(()=>{const p=m=>{var w;if(m.key!=="Escape"||r)return;const v=document.activeElement;v instanceof HTMLInputElement&&((w=c.current)!=null&&w.contains(v))||(m.preventDefault(),m.stopPropagation(),f.current())};return window.addEventListener("keydown",p,!0),()=>window.removeEventListener("keydown",p,!0)},[r]);const h=p=>{var w;const m=document.activeElement,v=p.target;m instanceof HTMLInputElement&&((w=c.current)!=null&&w.contains(m))&&!v.closest("input")&&m.blur(),L6(p)};return s.useEffect(()=>{const p=m=>{if(r)return;const v=m.target;v.closest('[data-guide="catch"], [data-guide="card"], [data-guide="inline"]')||document.querySelector('[data-guide="catch"]')||v.closest(".sc-attachpanel, .sc-attach-toggle, [data-attach-opener]")||f.current()};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[r]),o.jsx("div",{ref:c,className:"sc-attachpanel","data-guide-shape":"",role:"dialog",id:e,"aria-label":"Add to shot",onMouseDownCapture:h,children:i})}function Sre({target:e,onOpenImage:t,onClear:n}){var f;const r=id(),a=e.images[0],c=(((f=e.brief)==null?void 0:f.tokens)??[]).filter(h=>h.t==="text"&&typeof h.v=="string").map(h=>h.v.trim()).join(" ").trim()||Sr(e),u=s.useCallback(()=>{a&&(r.closeNow(),t())},[a,r.closeNow,t]);return o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"sc-token sc-target-chip",role:"button",tabIndex:0,"aria-haspopup":"dialog","aria-label":n?`Version being refined: ${c}. Open the image, or remove to make a new shot.`:`Version being refined: ${c}. Open the image.`,onPointerEnter:h=>{h.pointerType==="mouse"&&a&&r.open({anchor:h.currentTarget})},onPointerLeave:h=>h.pointerType==="mouse"&&r.close(),onClick:u,onKeyDown:h=>{h.target===h.currentTarget&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),u())},children:[a?o.jsx("img",{src:dn(a,"micro"),alt:""}):o.jsx("span",{className:"sc-target-thumb sc-shimmer"}),"Refining",n&&o.jsx("button",{type:"button",onClick:h=>{h.stopPropagation(),r.closeNow(),n()},"aria-label":"Make a new shot instead",children:o.jsx(jn,{size:12})})]}),r.shown&&a&&o.jsx(od,{anchor:r.shown.anchor,kind:"shot",src:dn(a,"tile"),label:c,noun:"Refining this shot",onOpen:u,onHoverIn:r.keep,onHoverOut:r.close,onClose:r.closeNow})]})}function Wu({src:e,kind:t,label:n,noun:r,actions:a,onRestoreFocus:i,onClose:c}){const[u,f]=s.useState(!1),h=r??MM[t],p=s.useRef(null);return o.jsxs(Ts,{className:"sc-lightbox",maxWidth:"min(880px, 92vw)",onOpenAutoFocus:()=>{p.current=document.activeElement},onCloseAutoFocus:m=>{var v;if(m.preventDefault(),i)return i();(v=p.current)!=null&&v.isConnected&&p.current.focus()},onDismiss:c,children:[o.jsx("div",{className:"sc-lightbox-frame","data-kind":t,children:u?o.jsxs("span",{className:"sc-lightbox-blank",children:[o.jsx(Ws,{size:28}),"Image unavailable"]}):o.jsx("img",{src:e,alt:n?`${n}, ${h.toLowerCase()}`:h,onError:()=>f(!0)})}),o.jsxs("p",{className:"sc-lightbox-cap",children:[n&&o.jsx("b",{dir:"auto",children:n}),o.jsx("span",{children:h})]}),a&&o.jsx("div",{className:"sc-lightbox-acts",children:a})]})}const Ere={"codex-cli":{sizing:"advisory"},openrouter:{sizing:"ratio"},replicate:{sizing:"ratio",formats:["square","story","landscape"]},fal:{sizing:"exact"},demo:{sizing:"exact"}},Cre={sizing:"exact"},UM=e=>Ere[e]??Cre;function jre(e,t){const n=UM(e).formats;return!n||n.includes(t)}const rw=e=>UM(e).sizing,Are="portrait",Nre=1,Mre="standard",zi=[{id:"draft",label:"Draft",edge:768,note:"quick checks"},{id:"standard",label:"Standard",edge:1024,note:"everyday shots"},{id:"high",label:"High",edge:1536,note:"hero and print"}],np=[1,2,3,4],WM=e=>Xr.filter(t=>!jre(e,t.id)).map(t=>t.id),V6=(e,t)=>t.length===0?void 0:`${e} cannot make ${Xr.filter(n=>t.includes(n.id)).map(n=>n.hint).join(" or ")}.`,sw=e=>{var n;e.preventDefault();const t=e.currentTarget??e.target;(n=t==null?void 0:t.querySelector('[role="radiogroup"]'))==null||n.focus()};function s8({aria:e,width:t,trigger:n,open:r,onOpenChange:a,children:i,onCloseAutoFocus:c,guide:u}){const f=s.useRef(null);return s.useEffect(()=>{var p;const h=(p=f.current)==null?void 0:p.parentElement;h&&(h.style.pointerEvents=r?"":"none")},[r]),o.jsxs(Ou,{open:r,onOpenChange:a,children:[o.jsx(Iu,{children:o.jsx("button",{type:"button",className:"sc-var","aria-label":e,"data-guide":u,children:n})}),o.jsx(Fu,{ref:f,className:"sc-setpop",align:"end",sideOffset:8,width:t,onOpenAutoFocus:sw,onCloseAutoFocus:c,onInteractOutside:h=>{var p;(p=h.target)!=null&&p.closest(".sc-prompt-pills")&&h.preventDefault()},children:i(()=>a(!1))})]})}function Rre({mode:e,engineId:t,engineName:n,formatId:r,onFormat:a,count:i,onCount:c,quality:u,onQuality:f,onCloseAutoFocus:h,guided:p=!1,onSettle:m}){const v=Xr.find($=>$.id===r)??Xr[0],w=zi.find($=>$.id===u)??zi[1],y=WM(t),b=rw(t),[k,S]=s.useState(null),C=s.useRef(null);C.current=k;const j=$=>{$.preventDefault(),C.current===null&&(h==null||h($))},N={aspect:"shape",variants:"count",resolution:"quality"},P=$=>({open:k===$,onCloseAutoFocus:j,guide:p?`compose.${N[$]}`:void 0,onOpenChange:R=>{!R&&C.current===$&&(m==null||m(N[$])),S(E=>R?$:E===$?null:E)}});return o.jsxs("div",{className:"sc-prompt-pills","data-guide":p?"compose.settings-row":void 0,children:[o.jsx(s8,{...P("aspect"),aria:`Aspect ${v.label}, ${v.hint}`,width:"178px",trigger:o.jsxs(o.Fragment,{children:[o.jsx(x6,{w:v.w,h:v.h,slot:15,box:13}),v.label]}),children:$=>o.jsxs(o.Fragment,{children:[o.jsx(Fo,{label:"Aspect ratio",className:"sc-setpop-list",value:r,ids:Xr.map(R=>R.id),unavailable:y,onChange:a,children:Xr.map(R=>o.jsxs(_o,{id:R.id,className:"sc-setrow",on:R.id===r,unavailable:y.includes(R.id),label:`${R.label}, ${R.hint}`,onPick:()=>{a(R.id),$()},children:[o.jsx(x6,{w:R.w,h:R.h,slot:20,box:17}),o.jsx("span",{className:"sc-setrow-n",children:R.label}),o.jsx("span",{className:"sc-setrow-v",children:R.hint}),o.jsx(Rx,{})]},R.id))}),V6(n,y)&&o.jsx(CY,{children:V6(n,y)})]})}),e==="generation"&&o.jsx(s8,{...P("variants"),aria:`${i} shot${i===1?"":"s"}`,width:"156px",trigger:o.jsxs(o.Fragment,{children:[o.jsx(bj,{size:14}),i]}),children:$=>o.jsx(o.Fragment,{children:o.jsx(Fo,{label:"Shots",className:"sc-seg",value:String(i),ids:np.map(String),onChange:R=>c(Number(R)),children:np.map(R=>o.jsx(_o,{id:String(R),className:"sc-seg-o",on:R===i,label:`${R} shot${R===1?"":"s"}`,onPick:()=>{c(R),$()},children:R},R))})})}),e==="generation"&&b!=="ratio"&&o.jsx(s8,{...P("resolution"),aria:`Resolution ${w.label}, ${w.edge} px`,width:"192px",trigger:o.jsxs(o.Fragment,{children:[o.jsx(VC,{size:14}),w.label]}),children:$=>o.jsx(o.Fragment,{children:o.jsx(Fo,{label:"Resolution",className:"sc-setpop-list",value:u,ids:zi.map(R=>R.id),onChange:R=>f(R),children:zi.map(R=>o.jsxs(_o,{id:R.id,className:"sc-setrow",on:R.id===u,label:`${R.label}, ${R.edge} px, ${R.note}`,onPick:()=>{f(R.id),$()},children:[o.jsx("span",{className:"sc-setrow-n",children:R.label}),o.jsxs("span",{className:"sc-setrow-v",children:[R.edge," px"]}),o.jsx(Rx,{})]},R.id))})})})]})}function KM({mode:e,engineId:t,engineName:n,formatId:r,onFormat:a,count:i,onCount:c,quality:u,onQuality:f,engineChoices:h,onEngine:p}){const m=WM(t),v=rw(t);return o.jsxs(o.Fragment,{children:[h&&p&&h.length>1&&o.jsx(th,{label:"Engine",children:o.jsx(Fo,{label:"Engine",className:"sc-seg",value:t,ids:h.map(w=>w.id),onChange:p,children:h.map(w=>o.jsx(_o,{id:w.id,className:"sc-seg-o",on:w.id===t,label:w.displayName,onPick:()=>p(w.id),children:w.displayName},w.id))})}),o.jsx(th,{label:"Aspect ratio",note:V6(n,m),children:o.jsx(Fo,{label:"Aspect ratio",className:"sc-seg",value:r,ids:Xr.map(w=>w.id),unavailable:m,onChange:a,children:Xr.map(w=>o.jsxs(_o,{id:w.id,className:"sc-seg-o sc-seg-ratio",on:w.id===r,unavailable:m.includes(w.id),label:`${w.label}, ${w.hint}`,onPick:()=>a(w.id),children:[o.jsx(x6,{w:w.w,h:w.h,slot:17,box:14}),w.hint]},w.id))})}),e==="generation"&&o.jsx(th,{label:"Shots",children:o.jsx(Fo,{label:"Shots",className:"sc-seg",value:String(i),ids:np.map(String),onChange:w=>c(Number(w)),children:np.map(w=>o.jsx(_o,{id:String(w),className:"sc-seg-o",on:w===i,label:`${w} shot${w===1?"":"s"}`,onPick:()=>c(w),children:w},w))})}),e==="generation"&&v!=="ratio"&&o.jsx(th,{label:"Resolution",note:v==="advisory"?"This engine renders at its own size, so this is a request rather than a guarantee.":void 0,children:o.jsx(Fo,{label:"Resolution",className:"sc-seg",value:u,ids:zi.map(w=>w.id),onChange:w=>f(w),children:zi.map(w=>o.jsx(_o,{id:w.id,className:"sc-seg-o",on:w.id===u,label:v==="advisory"?`${w.label}, asks for ${w.edge} px, ${w.note}`:`${w.label}, ${w.edge} px, ${w.note}`,onPick:()=>f(w.id),children:w.label},w.id))})})]})}function th({label:e,note:t,children:n}){return o.jsxs("div",{className:"sc-shotfield",children:[o.jsx("span",{className:"sc-shotfield-lb",children:e}),n,t&&o.jsx("p",{className:"sc-shotfield-note",children:t})]})}function Pre({guide:e,onSettle:t,...n}){const[r,a]=s.useState(!1),i=f=>{!f&&r&&(t==null||t()),a(f)},{sheet:c,grip:u}=td(()=>i(!1));return o.jsxs(hc,{open:r,onOpenChange:i,children:[o.jsx(x4,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-var sc-shotset","aria-label":"Shot settings",title:"Shot settings","data-guide":e,children:o.jsx(dv,{size:16})})}),o.jsxs(pc,{children:[o.jsx(mc,{className:"sc-shotsheet-scrim"}),o.jsxs(gc,{ref:c,className:"sc-shotsheet","aria-describedby":void 0,onOpenAutoFocus:sw,onCloseAutoFocus:f=>f.preventDefault(),children:[o.jsxs("div",{className:"sc-shotsheet-grip",...u,children:[o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0}),o.jsx(vc,{className:"sc-vh",children:"Shot settings"})]}),o.jsx(KM,{...n})]})]})]})}const bu=e=>`scenri:draft-${e}`,Lre=e=>cs.get(e),Tre=(e,t)=>cs.set(e,t),Sh=e=>cs.del(e);function h5(e,t){return e.some(n=>n.t==="text"?!!n.v.trim():n.t!=="template")||Object.values(t).some(n=>!!n.trim())}function $re(e){const t=Lre(bu(e));if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(typeof n!="object"||n===null)return null;const r=n;if(r.v!==1||r.brandId!==e||!Array.isArray(r.tokens)||typeof r.tplFields!="object"||!r.tplFields||r.branchId)return Sh(bu(e)),null;const a=Date.now()-Date.parse(r.updatedAt??"");return!Number.isFinite(a)||a>Qj?(Sh(bu(e)),null):{v:1,brandId:e,updatedAt:r.updatedAt,tokens:r.tokens,tplFields:r.tplFields,setSlug:r.setSlug??null}}function GM(e,t){const n={v:1,brandId:e,updatedAt:new Date().toISOString(),tokens:t.tokens,tplFields:t.tplFields,setSlug:t.setSlug??null};Tre(bu(e),JSON.stringify(n))}function p5(e){Sh(bu(e))}function m5(e,t,n,r,a){if(e===t)return{changed:!1,toast:null};const i=!!r;return e===null&&!i?{changed:!0,toast:null}:{changed:!0,toast:{title:i?`Switched to ${n}. This starts a new shot instead of refining ${a??"that shot"}.`:`Switched to ${n}.`,prevSceneId:e,branchWasCleared:i}}}function Dre(e,t){return e>0&&t>0&&Math.abs(Math.log(t))<Math.abs(Math.log(e))-.01?"crop":"extend"}const a8=2,Hre=.15;function Ore(e,t){if(Dre(e,t)==="crop")return"crop";if(!(e>0&&t>0))return"extend";const n=t>e?t/e:e/t;return(n>a8?Math.max(a8,n*(1-Hre)):n)>a8+1e-9?"crop":"extend"}const z6=4,rp=24,w0=24,YM={product:[],presenter:[],scene:null,ref:[],color:[]};function Ire(e){const t=[],n=[],r=[],a=[];let i=null;const c=(u,f)=>{u.includes(f)||u.push(f)};for(const u of e)u.t==="product"?c(t,u.id):u.t==="character"?c(n,u.id):u.t==="template"?i=u.id:u.t==="ref"?c(r,u.imageHash):u.t==="color"&&c(a,u.hex.toLowerCase());return{product:t,presenter:n,scene:i,ref:r,color:a}}function Fre(e){return`${e.product.join(",")}|${e.presenter.join(",")}|${e.scene??""}|${e.ref.join(",")}|${e.color.join(",")}`}function _re(e,t,n){const r=e.slice(0,n);return{visible:r,more:Math.max(0,e.length-r.length)}}const aw=s.forwardRef(function({projectId:t,brand:n,engines:r,parentId:a,initialBrief:i,suppressDraftRestore:c,startScene:u,startSetup:f,startPresenter:h,startProduct:p,onSeedsSpent:m,openAttachTab:v,onQueued:w,onSending:y,onAttached:b,onCeiling:k,target:S,onClearTarget:C,sourceImage:j,onRestoreBranchId:N,setSlug:P,persistDraft:$=!0,variant:R="dock",guided:E=!1},M){var fd,pl;const{products:L,productsLoaded:H}=on(),{demoProducts:D,demoProductsLoaded:K,loaded:O}=Rn(),_=Lf(),re=_.scenes,z=_.presenters,F=yf(),Q=Cc(),{push:V}=ir(),I=r.filter(Ce=>Ce.available),[B,Y]=fa(Dr.engine,O0);s.useEffect(()=>{const Ce=iq(I,B);Ce!==B&&Y(Ce)},[I,B,Y]);const ae=I.length===0&&r.some(Ce=>Ce.code==="not-installed"||Ce.code==="not-authenticated"),X=I.length===0,le=X?ae?{icon:o.jsx(nN,{}),title:"Image generation is not set up yet",detail:"About a minute, using the ChatGPT account you already have.",action:"Set up",onAct:()=>Q(),info:!0}:{icon:o.jsx(P0,{size:15}),title:"No image provider connected",detail:"Add a provider key and this prompt is ready to run.",action:"Open settings",onAct:()=>F("engines"),info:!1}:null,[ke,te]=s.useState(Ho()),[be,G]=s.useState(void 0),[J,ne,W]=Eg(Dr.format,Are),[he,Xe]=s.useState({}),tt=S&&S.kind!=="root"?S:null,ze=tt?Kne(tt.brief):void 0,nt=tt?he[tt.id]??ze??J:J,ce=Ce=>{tt?Xe(pt=>({...pt,[tt.id]:Ce})):ne(Ce)},[ve,Pe]=s.useState({}),[ue,Ee,Ke]=Eg(Dr.count,Nre),[ye,Se]=s.useState(!1),[Ie,Be]=s.useState(null),[Re,Ze]=s.useState(null),[Qe,lt]=s.useState(!1),[Lt,Ut]=s.useState("All"),[Ct,cn]=s.useState(0),[Fe,mt]=s.useState(null),[it,St,xt]=Eg(Dr.quality,Mre),[Nt,Kt]=s.useState(!1),[et,gt]=s.useState(!1),ot=Ce=>gt(Ce);wr("(hover: hover) and (min-width: 1024px)");const kn=wr("(max-width: 767px)"),dt=s.useRef(null),Gt=s.useRef(null),Ft=s.useRef(null),en=s.useId(),Jt=s.useRef({tokens:ke,tplFields:ve,branchId:(S==null?void 0:S.id)??null});Jt.current={tokens:ke,tplFields:ve,branchId:(S==null?void 0:S.id)??null};const se=s.useRef(null),oe=s.useRef(null),we=s.useRef(void 0),ge=s.useRef(void 0),ee=s.useRef(void 0),He=s.useCallback(Ce=>{if(oe.current&&(clearTimeout(oe.current),oe.current=null),!$)return;const pt=Jt.current;pt.branchId||(h5(pt.tokens,pt.tplFields)?GM(Ce,{tokens:pt.tokens,tplFields:pt.tplFields,setSlug:P}):p5(Ce))},[P,$]);s.useEffect(()=>{v&&(Ut(v),lt(!0))},[v]),s.useEffect(()=>{if(!i)return;const Ce=(i.tokens??[]).find(pt=>pt.t==="format");Ce&&W(Ce.id),i.variants&&Ke(i.variants),i.quality&&xt(i.quality),G(Iv(i)),Pe(i.templateFields??{})},[i]),s.useEffect(()=>{var ps;const Ce=se.current;Ce&&Ce!==n.id&&He(Ce);const pt=!!i||!!c||!$,It=Ce!==n.id;let qt=null,fn=null;if(!pt&&It){const Xt=$re(n.id);Xt&&h5(Xt.tokens,Xt.tplFields)&&(qt=b6(n,Xt.tokens),fn=Xt.tplFields)}let mn=!1;if(u&&u!==we.current){we.current=u,mn=!0;const Xt=qt??Ho(),Fn=Xt.find(xa=>xa.t==="template"),Tn=(Fn==null?void 0:Fn.id)??null,Wa=((ps=re.find(xa=>xa.id===u))==null?void 0:ps.name)??"this scene",Rc=m5(Tn,u,Wa,null,null);if(Rc.changed&&(qt=[{t:"template",id:u,...f?{setup:f}:{}},...Xt.filter(xa=>xa.t!=="template")],Rc.toast)){const xa=Rc.toast;V({kind:"info",title:xa.title,action:{label:"Undo",onClick:()=>{var Hf,Of;xa.prevSceneId?(Hf=dt.current)==null||Hf.insert({t:"template",id:xa.prevSceneId}):(Of=dt.current)==null||Of.removeTemplate()}}})}}if(h&&h!==ge.current){ge.current=h,mn=!0;const Xt=qt??Ho();Xt.some(Tn=>Tn.t==="character"&&Tn.id===h)||(qt=[...Xt,{t:"character",id:h}])}if(p&&p!==ee.current){ee.current=p,mn=!0;const Xt=qt??Ho();Xt.some(Tn=>Tn.t==="product"&&Tn.id===p)||(qt=[...Xt,{t:"product",id:p}])}qt&&(G(qt),Pe(fn??{})),mn&&(m==null||m()),se.current=n.id},[n.id,u,h,p]),s.useEffect(()=>{var Ce;be&&((Ce=dt.current)==null||Ce.setTokens(be),G(void 0))},[be]);const We=s.useMemo(()=>{var fn;const Ce=Xr.find(mn=>mn.id===nt)??Xr[0],It=(((fn=zi.find(mn=>mn.id===it))==null?void 0:fn.edge)??1024)/Math.max(Ce.w,Ce.h),qt=mn=>Math.max(256,Math.round(mn*It/8)*8);return{t:"format",id:Ce.id,w:qt(Ce.w),h:qt(Ce.h)}},[nt,it]),Ue=s.useMemo(()=>[We,...ke],[We,ke]),Ge=s.useMemo(()=>({tokens:Ue,templateFields:ve,variants:ue,quality:it,format:nt}),[Ue,ve,ue,it,nt]),me=ke.some(Ce=>Ce.t==="text"?!!Ce.v.trim():!0),_e=s.useMemo(()=>{const Ce=ke.find(pt=>pt.t==="template");return Ce?re.find(pt=>pt.id===Ce.id)??null:null},[ke,re]),U=s.useMemo(()=>{const Ce=ke.find(pt=>pt.t==="template");return(Ce==null?void 0:Ce.id)??null},[ke]),pe=s.useCallback(Ce=>{var mn,ps;const pt=(_e==null?void 0:_e.id)??null,It=(S==null?void 0:S.id)??null,qt=((mn=re.find(Xt=>Xt.id===Ce))==null?void 0:mn.name)??"this scene",fn=m5(pt,Ce,qt,It,S?Sr(S):null);if(fn.changed&&((ps=dt.current)==null||ps.insert({t:"template",id:Ce}),fn.toast)){const Xt=fn.toast;V({kind:"info",title:Xt.title,action:{label:"Undo",onClick:()=>{var Fn,Tn;Xt.prevSceneId?(Fn=dt.current)==null||Fn.insert({t:"template",id:Xt.prevSceneId}):(Tn=dt.current)==null||Tn.removeTemplate(),Xt.branchWasCleared&&It&&(N==null||N(It))}}})}},[_e,S,re,V,N]);s.useImperativeHandle(M,()=>({insertToken:Ce=>{var pt;return(pt=dt.current)==null?void 0:pt.insert(Ce)},removeToken:Ce=>{var pt;return(pt=dt.current)==null?void 0:pt.remove(Ce)},applyScene:Ce=>pe(Ce),removeTemplate:()=>{var Ce;return(Ce=dt.current)==null?void 0:Ce.removeTemplate()},openAttach:Ce=>wa(Ce),showAttach:()=>{So.current||wa("All")},focus:()=>{var Ce;return(Ce=dt.current)==null?void 0:Ce.focus()},submit:()=>{fi()}}));const Oe=s.useMemo(()=>Ire(ke),[ke]),Le=Fre(Oe),bt=ire(ke),vt=s.useMemo(()=>lre(bt),[bt]),jt=s.useRef(Oe);jt.current=Oe,s.useEffect(()=>{b==null||b(jt.current)},[Le,b]),s.useEffect(()=>{var Ce;!O||!U||_e||((Ce=dt.current)==null||Ce.removeTemplate(),V({kind:"warning",title:"That scene is no longer available",detail:"Removed from the brief."}))},[O,U,_e,V]);const st=s.useRef(null);s.useEffect(()=>(oe.current&&clearTimeout(oe.current),oe.current=setTimeout(()=>He(se.current??n.id),500),()=>{oe.current&&clearTimeout(oe.current)}),[ke,ve,S==null?void 0:S.id,n.id,He]),s.useEffect(()=>()=>He(se.current??n.id),[He]),s.useEffect(()=>{const Ce=()=>He(se.current??n.id);return window.addEventListener("beforeunload",Ce),()=>window.removeEventListener("beforeunload",Ce)},[He,n.id]);const $t=r.find(Ce=>Ce.id===B),An=$t?Wi($t.displayName):"This engine",q=!!S&&S.kind!=="root"&&S.status==="running",fe=S&&S.kind!=="root"&&S.status==="done"&&S.images.length>0||q,Ae=!!($t!=null&&$t.supportsEdit),ft=!!tt&&!!ze&&ze!==nt&&fe&&!_e,wt=ft?Ore(Uu(ze),Uu(nt)):null,Zt=wt==="crop",Ht=wt==="extend"&&Ae,pn=Xr.find(Ce=>Ce.id===nt),Wt=pn?`${pn.label} ${pn.hint}`:nt,[wn,sn]=s.useState(null),In=()=>{S!=null&&S.images[0]&&sn({src:Mr(S.images[0]),kind:"shot",label:Sr(S),noun:"Refining this shot"})},Dt=fe&&!_e&&(Ae||Zt||Ht)?"edit":"generation",On=Dt==="edit"&&!!S&&R!=="overlay",Et=fe?_e?"A scene starts a new shot.":Zt||Ht||Ae?null:`${($t==null?void 0:$t.displayName)??"This engine"} cannot edit. This makes a new shot.`:null,Hn=s.useMemo(()=>{const Ce=Xr.find(mn=>mn.id===nt)??Xr[0],pt=`Aspect ${Ce.label} ${Ce.hint}`;if(Dt==="edit")return pt;const It=zi.find(mn=>mn.id===it),qt=rw(B),fn=qt==="ratio"||!It?null:qt==="advisory"?`${It.label}, asking for ${It.edge} px`:`${It.label} ${It.edge} px`;return[pt,`${ue} shot${ue===1?"":"s"}`,fn&&`resolution ${fn}`].filter(Boolean).join(", ")},[Dt,nt,ue,it,B]),Ot=s.useRef(void 0),tn=s.useRef(void 0);s.useEffect(()=>{var qt;const Ce=fe?(S==null?void 0:S.id)??null:null,pt=Ce!==Ot.current&&Ot.current!==void 0;Ot.current=Ce;const It=U!==tn.current;tn.current=U,!(!_e||!fe)&&(pt&&!It&&Ce?(qt=dt.current)==null||qt.removeTemplate():C==null||C())},[_e,U,fe,S,C]);const Vn=(Re==null?void 0:Re.warnings.filter(Ce=>Ce.includes("built around a product")))??[],ur=ft&&!me,Zr=Zt&&me,zn=!ye&&(me||ur)&&!Zr&&!!t&&!q&&(Zt||!X),yn=X&&!Zt?"Image generation is not set up yet":ye?"Working on the last one":t?q?"Wait for this version to finish, or press X to start a new shot":Zr?"This shape is reached by cropping, and a crop uses no words. Clear the prompt, or keep the current shape.":!me&&!ur?"Write a prompt first":null:"Still opening this brand";s.useEffect(()=>{const Ce=Dt==="edit"&&!!S;if(Zt||!me&&!Ce){Ze(null);return}st.current&&clearTimeout(st.current);const pt=Ge;return st.current=setTimeout(()=>{Me.previewBrief(Ge,B,n.id,Ce?S.id:void 0).then(It=>Ze({...It,forBrief:pt})).catch(()=>Ze(null))},280),()=>{st.current&&clearTimeout(st.current)}},[Ge,B,n.id,me,Dt,S,Zt]);const za=Ce=>{var pt;ce(Ce),(pt=dt.current)==null||pt.focus()},xo=Ce=>{var pt;St(Ce),(pt=dt.current)==null||pt.focus()},ko=Ce=>{var pt;Ee(Ce),(pt=dt.current)==null||pt.focus()},dl=Ce=>{var pt;Ce.preventDefault(),(pt=dt.current)==null||pt.focus()},wa=Ce=>{Ut(Ce),cn(pt=>pt+1),lt(!0)},So=s.useRef(!1);So.current=Qe;const ya=s.useRef(wa);ya.current=wa;const ba=s.useCallback(({restore:Ce})=>{var pt;So.current&&(So.current=!1,lt(!1),Ce&&((pt=dt.current)==null||pt.restoreCaret()))},[]),Vr=s.useRef(pe);Vr.current=pe;const ts=s.useRef(ke);ts.current=ke;const Gs=s.useCallback(Ce=>{var It;const pt=Ce.token;pt.t==="template"?Vr.current(pt.id):(It=dt.current)==null||It.insert(pt)},[]),Ba=s.useCallback(Ce=>{var It,qt;const pt=Ce.token;pt.t==="template"?(It=dt.current)==null||It.removeTemplate():(qt=dt.current)==null||qt.remove(pt)},[]),Pr=async Ce=>{var It;if(!(Ce!=null&&Ce.length))return;const pt=Array.from(Ce).filter(qt=>qt.type.startsWith("image/"));if(!pt.length){V({kind:"warning",title:"Only images can be attached here"});return}Kt(!0),Be(null);try{for(const qt of pt.slice(0,4)){const fn=await L0(qt);(It=dt.current)==null||It.insert({t:"ref",imageHash:fn,label:Zre(qt.name)})}pt.length>4&&V({kind:"warning",title:"Only the first 4 images were attached",detail:`${pt.length-4} more ${pt.length-4===1?"was":"were"} skipped. Attach ${pt.length-4===1?"it":"them"} in another pick.`})}catch(qt){Be(String(qt.message??qt)),V(nn(qt,"Could not attach that image"))}finally{Kt(!1),Ft.current&&(Ft.current.value="")}},Lr=Re&&Re.forBrief===Ge?Re:null,Ua=s.useMemo(()=>ke.filter(Ce=>c0.has(Ce.t)).length,[ke]),di=s.useRef(null),ie=s.useMemo(()=>Ua===0?(di.current=null,null):(Lr&&(di.current={cap:Une(Lr),described:Wne(Lr),preview:Lr}),di.current),[Lr,Ua]),$e=(ie==null?void 0:ie.cap)??null,Je=(ie==null?void 0:ie.preview)??null,Vt=($t==null?void 0:$t.displayName)??"This engine",Yt=Ua>=ep?F6:null;s.useEffect(()=>{k==null||k(Yt)},[Yt,k]);const Bn=Ce=>{const pt=ie==null?void 0:ie.described;return!pt||pt.size===0?!1:Ce.t==="product"?pt.has(_l("product",Ce.id)):Ce.t==="character"?pt.has(_l("character",Ce.id)):Ce.t==="template"?pt.has(_l("scene",Ce.id)):Ce.t==="ref"?pt.has(_l("reference",Ce.imageHash)):Ce.t==="mark"?pt.has(_l("brand",Ce.imageHash)):!1},Nn=$e!=null?`Described in words: ${Vt} pictures ${$e} per shot, products and presenters first. Drag it earlier to picture it.`:null,xn=_e?Vn.length>0?"This scene builds around a product. Attach one.":(Je==null?void 0:Je.warnings.some(Ce=>Ce.includes("built around a person")))??!1?"This scene builds around a person. Without a presenter, only the set renders.":null:null,Sn=Ce=>{var mn,ps;if(Ce.t==="template")return xn;if(Ce.t==="product"&&H&&K&&!((L.length?L:((mn=n.json)==null?void 0:mn.products)??[]).some(Tn=>Tn.id===Ce.id)||D.some(Tn=>Tn.id===Ce.id)))return"This product is no longer in your library. Remove it from the brief.";if(Ce.t==="mark"&&!Sf(n.json).some(Xt=>Xt.hash===Ce.imageHash))return"This mark is no longer in your brand kit. Remove it from the brief.";if(!Je)return null;const pt=($t==null?void 0:$t.displayName)??"this engine",It=Je.cap,qt=Xt=>`${Xt} won't reach ${pt} this time.`,fn=(Xt,Fn)=>{var Tn;return((Tn=Je.dropped)==null?void 0:Tn.some(Wa=>Wa.role===Xt&&Wa.id===Fn&&Wa.reason==="missing"))??!1};if(Ce.t==="ref"&&!Je.attachments.some(Xt=>Xt.hash===Ce.imageHash))return It===0?`This reference won't reach ${pt}. Choose an engine that reads images, or remove it.`:It==null?qt("This reference"):null;if(Ce.t==="mark"&&!Je.attachments.some(Xt=>Xt.role==="brand"&&Xt.hash===Ce.imageHash))return It===0?`The brand mark won't reach ${pt}, so the logo can't be drawn from it. Choose an engine that reads images.`:It==null?`${qt("The brand mark")} The logo can't be drawn from it.`:null;if(Ce.t==="mark"){const Xt=Je.warnings.find(Fn=>Fn.includes("px across"));if(Xt)return Xt}if(Ce.t==="product"){const Fn=(L.length?L:((ps=n.json)==null?void 0:ps.products)??[]).find(Tn=>Tn.id===Ce.id)??D.find(Tn=>Tn.id===Ce.id);if(Fn&&!Je.attachments.some(Tn=>Tn.role==="product"&&Tn.id===Fn.id))return fn("product",Fn.id)?`${Fn.name} has no usable photo. Re-add one, or remove this.`:null}if(Ce.t==="character"){const Xt=z.find(Fn=>Fn.id===Ce.id);if(!Xt&&z.length>0)return"This presenter is no longer in your roster. Remove them from the brief.";if(Xt&&!Je.attachments.some(Fn=>Fn.role==="character"&&Fn.id===Xt.id))return fn("character",Xt.id)?`${Xt.name} has no usable photo. Re-add one, or remove this.`:null}return null},hs=s.useCallback(Sn,[Je,$t==null?void 0:$t.displayName,xn,L,H,n.json,D,K,z]),ud=s.useCallback(Bn,[ie]),fi=async()=>{var pt,It,qt;if(!zn)return;Se(!0),Be(null);const Ce=ke.flatMap(fn=>fn.t==="text"?[fn.v]:[]).join(" ").replace(/\s+/g," ").trim();y==null||y({said:Ce||"Your shot",count:Dt==="generation"?ue:1});try{if(!t)throw new Error("the workspace is still loading");const fn=await Me.addNode({projectId:t,parentId:Dt==="edit"&&S?S.id:a,kind:Dt,engineId:B,count:ue,brief:{...Ge,tokens:b6(n,Ge.tokens)},...Dt==="edit"&&j?{sourceImage:j}:{},...Dt==="edit"&&wt?{reshape:wt}:{}}),mn=fn.warnings??[];mn.length===1?V({kind:"warning",title:"Sent, with one thing to know",detail:mn[0]}):mn.length>1&&V({kind:"warning",title:`Sent, with ${mn.length} things to know`,detail:mn.join(" ")}),(pt=dt.current)==null||pt.setTokens(Ho()),Pe({}),W(null),Xe({}),Ke(null),xt(null),$&&p5(n.id),w(fn.id,Dt,(It=fn.siblings)==null?void 0:It.map(ps=>ps.id),(qt=fn.siblings)!=null&&qt.length?fn.siblings:[fn])}catch(fn){const mn=String(fn.message??fn);Be(mn),V(nn(fn,"That did not send",$t==null?void 0:$t.displayName)),y==null||y(null)}finally{Se(!1)}},hi=(fd=ke.find(Ce=>Ce.t==="product"))==null?void 0:fd.id,fl=hi?L.find(Ce=>Ce.id===hi)??(((pl=n.json)==null?void 0:pl.products)??[]).find(Ce=>Ce.id===hi)??D.find(Ce=>Ce.id===hi)??null:null,Nc=fl?Rv(fl):null,dd=E?{brandId:n.id,products:ke.filter(Ce=>Ce.t==="product").length,presenters:ke.filter(Ce=>Ce.t==="character").length,scene:!!_e,others:ke.filter(Ce=>Ce.t==="color"||Ce.t==="ref"||Ce.t==="mark").length,words:ke.some(Ce=>Ce.t==="text"&&!!Ce.v.trim()),busy:ye,pickerOpen:Qe,refining:Dt==="edit"&&!!S,engine:X?ae?"setup":"settings":"ready"}:null;s.useEffect(()=>{dd&&Kx(dd)}),s.useEffect(()=>{if(E)return()=>Kx(null)},[E]),s.useEffect(()=>{if(!E||!Qe)return;const Ce=()=>ba({restore:!0});return window.addEventListener("scenri:guide-close-picker",Ce),()=>window.removeEventListener("scenri:guide-close-picker",Ce)},[E,Qe,ba]),s.useEffect(()=>{if(!E)return;const Ce=pt=>{var mn;const{kind:It}=pt.detail,qt=It==="presenter"?"character":It==="scene"?"template":"product",fn=[...ts.current].reverse().find(ps=>ps.t===qt);fn&&((mn=dt.current)==null||mn.remove(fn))};return window.addEventListener("scenri:guide-take-back",Ce),()=>window.removeEventListener("scenri:guide-take-back",Ce)},[E]),s.useEffect(()=>{if(!C)return;const Ce=()=>C();return window.addEventListener("scenri:guide-clear-refine",Ce),()=>window.removeEventListener("scenri:guide-clear-refine",Ce)},[C]),s.useEffect(()=>{if(!E)return;const Ce=pt=>{const{tab:It}=pt.detail;mt(It??null),It&&ya.current(It)};return window.addEventListener("scenri:guide-picker",Ce),()=>{window.removeEventListener("scenri:guide-picker",Ce),mt(null)}},[E]);const[Ys,Mc]=s.useState(!1),hl=R==="overlay"&&(Ys||ke.some(Ce=>Ce.t==="text"&&!!Ce.v.trim()));return s.useEffect(()=>{R==="overlay"&&Gx({engaged:hl})},[R,hl]),s.useEffect(()=>{if(R==="overlay")return()=>Gx(null)},[R]),o.jsxs("div",{className:"sc-composer","data-guide":E?"compose":void 0,onPointerDownCapture:R==="overlay"&&!Ys?()=>Mc(!0):void 0,onKeyDownCapture:R==="overlay"&&!Ys?()=>Mc(!0):void 0,children:[o.jsx("input",{ref:Ft,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:Ce=>void Pr(Ce.target.files)}),wn&&o.jsx(Wu,{src:wn.src,kind:wn.kind,label:wn.label,noun:wn.noun,onRestoreFocus:()=>{var Ce;return(Ce=dt.current)==null?void 0:Ce.restoreCaret()},onClose:()=>sn(null)}),Qe&&o.jsx(xre,{brand:n,activeProductCategory:Nc,refining:On,full:Yt,initialTab:Lt,tabNonce:Ct,only:Fe,id:en,attached:vt,onUpload:()=>{var Ce;return(Ce=Ft.current)==null?void 0:Ce.click()},onFiles:Ce=>void Pr(Ce),onPick:Gs,onRemove:Ba,onClose:ba}),le&&o.jsx("div",{className:"sc-notes","data-guide-shape":E?"":void 0,children:le&&o.jsxs("div",{className:"sc-banner","data-tone":"action",children:[o.jsx("span",{className:"sc-banner-ic",children:le.icon}),o.jsxs("span",{className:"sc-banner-txt",children:[o.jsx("b",{children:le.title}),o.jsxs("small",{children:[le.detail,le.info&&o.jsxs(Ou,{children:[o.jsx(Iu,{children:o.jsx("button",{type:"button",className:"sc-note-info","aria-label":"What a ChatGPT account has to do with this",children:o.jsx(zp,{size:13})})}),o.jsxs(Fu,{className:"sc-note-pop",align:"start",sideOffset:8,width:"300px",children:[o.jsx("p",{children:"Codex CLI signs in with your ChatGPT account and makes the images there. Every plan includes some Codex usage, so how many images you get depends on the plan you are on."}),o.jsx("p",{children:"No ChatGPT account, or run out for now? Use your own key from an image provider instead."}),o.jsx("p",{className:"sc-note-pop-fine",children:"Scenri never sees your password or token. The sign-in happens in your browser and stays with Codex."}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>F("engines"),children:"Use a provider key instead"})]})]})]})]}),o.jsx("button",{type:"button",className:"sc-banner-act","data-primary":"","data-guide":E?"compose.engine":void 0,onClick:le.onAct,children:le.action})]})}),o.jsxs("div",{className:"sc-promptcard","data-guide-shape":E?"":void 0,children:[fe&&(C||R==="overlay"&&Dt==="edit")&&o.jsxs("div",{className:"sc-target","data-note":Et?"":void 0,children:[o.jsx(Sre,{target:S,onOpenImage:In,onClear:C}),Et&&o.jsx("small",{className:"sc-target-note",children:Et})]}),fe&&!C&&Et&&!(R==="overlay"&&Dt==="edit")&&o.jsx("small",{className:"sc-target-note sc-target-note-alone",children:Et}),ft&&(Zt||Ht)&&o.jsxs("small",{className:"sc-reshape-hint","aria-live":"polite",children:[Zt?"Will crop to":"Will extend to"," ",Wt]}),o.jsx(Gne,{ref:dt,onChange:te,brand:n,templates:re,presenters:z,demoProducts:D,onTemplatePick:pe,scenesSitOut:On,flag:hs,described:ud,describedNote:Nn,onInspect:Ce=>sn(Ce),onAttachRequest:Ce=>wa(Ce),activeProductCategory:Nc,placeholder:_e?"Add art direction, or run it as written":Dt==="edit"?"Say what to change about this shot":"What should we shoot? (use $ / @ #)",placeholderSm:_e||Dt==="edit"?void 0:"What should we shoot? ($ / @ #)",label:_e?"Art direction":Dt==="edit"?"What to change":"Shot brief",onSubmit:()=>void fi(),onDropFiles:Ce=>void Pr(Ce)}),o.jsxs("div",{className:"sc-prompt-row",children:[o.jsxs("div",{className:"sc-prompt-left",children:[o.jsx("button",{type:"button",ref:Gt,className:"sc-icon-btn sc-attach-toggle","data-guide":E?"compose.add":void 0,"aria-expanded":Qe,"aria-controls":Qe?en:void 0,"aria-label":"Add to shot",title:"Add a product, a presenter, a scene, a colour or an image",onClick:()=>Qe?ba({restore:!1}):wa("All"),children:Nt?o.jsx(xr,{size:"1"}):o.jsx(cr,{size:16})}),I.length>1&&o.jsxs(q7,{value:B,onValueChange:Y,children:[o.jsxs(X7,{variant:"ghost",className:"sc-mini-sel",children:[o.jsx(P0,{size:14}),o.jsx("span",{className:"sc-mini-sel-t",children:$t?Wi($t.displayName):"Demo"})]}),o.jsx(Q7,{children:I.map(Ce=>o.jsx(J7,{value:Ce.id,children:Wi(Ce.displayName)},Ce.id))})]})]}),o.jsxs("div",{className:"sc-prompt-right",children:[o.jsx(Rre,{mode:Dt,engineId:B,engineName:An,formatId:nt,onFormat:za,count:ue,onCount:ko,quality:it,onQuality:xo,onCloseAutoFocus:dl,guided:E}),o.jsxs(Ou,{open:et,onOpenChange:ot,children:[o.jsx(Iu,{children:o.jsxs("button",{type:"button",className:"sc-var sc-more","aria-label":`Shot settings. ${Hn}`,"data-guide":E&&!kn?"compose.settings":void 0,children:[o.jsx(dv,{size:14}),"More"]})}),o.jsx(Fu,{className:"sc-morepop",align:"end",sideOffset:8,width:"300px",onOpenAutoFocus:sw,onCloseAutoFocus:dl,children:o.jsx(KM,{mode:Dt,engineId:B,engineName:An,formatId:nt,onFormat:za,count:ue,onCount:ko,quality:it,onQuality:xo})})]}),o.jsx(Pre,{guide:E&&kn?"compose.settings":void 0,mode:Dt,engineId:B,engineName:An,formatId:nt,onFormat:za,count:ue,onCount:ko,quality:it,onQuality:xo}),o.jsxs("button",{type:"button",className:"sc-send","data-guide":E?"compose.send":void 0,"aria-disabled":!zn||void 0,onClick:()=>void fi(),"aria-label":Dt==="edit"?"Refine":"Generate",title:Ie??xn??yn??`${Dt==="edit"?"Refine":"Generate"} (enter)`,children:[o.jsx("span",{className:"sc-send-ico",children:ye?o.jsx(xr,{size:"1"}):o.jsx(gC,{size:17,weight:"bold"})}),o.jsx("span",{className:"sc-send-lb",children:Dt==="edit"?"Refine":"Generate"})]})]})]})]})]})});function Zre(e){return e.replace(/\.[a-z0-9]{2,5}$/i,"").trim()||"Image"}function ow(e,t){s.useLayoutEffect(()=>{if(!e||typeof ResizeObserver>"u")return;const n=document.documentElement,r=()=>n.style.setProperty(t,`${Math.round(e.offsetHeight)}px`);r();const a=new ResizeObserver(r);return a.observe(e),()=>{a.disconnect(),n.style.removeProperty(t)}},[e,t])}function qM({full:e=!0,children:t}){const[n,r]=s.useState(null);return ow(n,"--sc-dock-h"),o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-dock-fade","data-full":e,"aria-hidden":!0}),o.jsx("div",{className:"sc-canvas-dock","data-full":e,ref:r,children:t})]})}function iw(){const{brand:e}=on(),{tasks:t}=Va(),[n,r]=s.useState(null),[a,i]=s.useState(null),[c,u]=s.useState(()=>Date.now()),f=s.useRef({id:"",pct:0}),h=t.find(y=>y.kind==="catalog"&&y.state==="running");if(s.useEffect(()=>{if(!h)return;const y=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(y)},[h]),!h&&!a)return null;const p=h!=null&&h.id.startsWith("catalog:")?h.id.slice(8):null,m=h!=null&&n===h.id,v=uG(e.json),w=Fr(v==null?void 0:v.file);return h&&(f.current.id!==h.id&&(f.current={id:h.id,pct:0}),f.current.pct=Math.max(f.current.pct,h.percent??0)),o.jsxs(o.Fragment,{children:[h&&o.jsxs("div",{className:"sc-impbar",role:"status",style:{"--sc-impbar-p":`${f.current.pct}%`},children:[o.jsx("span",{className:"sc-impbar-fill","aria-hidden":!0}),o.jsxs("button",{type:"button",className:"sc-impbar-open",onClick:()=>p&&i(p),disabled:!p,"aria-label":"Show import details",children:[o.jsx("span",{className:"sc-impbar-mark","aria-hidden":!0,children:w?o.jsx("img",{src:w,alt:"",className:(v==null?void 0:v.role)==="mark"?"sc-impbar-badge":void 0}):o.jsx(Sj,{size:13,weight:"regular"})}),o.jsx("span",{className:"sc-impbar-count",children:h.subtitle}),o.jsx("span",{className:"sc-impbar-clock",children:ac(h.startedAt,c)})]}),p&&o.jsxs("button",{type:"button",className:"sc-impbar-stop",disabled:m,"aria-label":"Stop importing",onClick:()=>{r(h.id),Me.cancelCatalogJob(e.id,p).catch(()=>r(null))},children:[o.jsx(jn,{size:12,weight:"bold"}),m?"Stopping":"Stop"]})]}),a&&o.jsx(v6,{brandId:e.id,jobId:a,onDismiss:()=>i(null)})]})}const Vre={presenter:"Presenter",product:"Product",scene:"Scene"};function XM({entry:e,productName:t,productPreviewUrl:n,productId:r,presenterName:a,presenterPreviewUrl:i,presenterId:c,sceneName:u,scenePreviewUrl:f,sceneId:h,onOpen:p,productHref:m,presenterHref:v,sceneHref:w,active:y,hideRecipe:b,decorative:k,size:S="grid"}){const C=[t,a,u].filter(Boolean).join(" · "),j=a?{key:"presenter",name:a,previewUrl:i,linked:!!(v&&c),href:v&&c?v(c):void 0}:null,N=n&&t?{key:"product",name:t,previewUrl:n,linked:!!(m&&r),href:m&&r?m(r):void 0}:null,P=f&&u?{key:"scene",name:u,previewUrl:f,linked:!!(w&&h),href:w&&h?w(h):void 0}:null;return o.jsxs("div",{className:"sc-showcase-tile","data-active":y||void 0,"aria-hidden":k||void 0,...k?{inert:""}:{},children:[o.jsx(rd,{id:e.id,previewUrl:e.previewUrl,title:e.title,primary:e.title,secondary:b?"":C,useLabel:"Recreate this",variant:"use",onOpen:p,onUse:p,size:S}),(j||N||P)&&o.jsx(Bre,{presenter:j,product:N,scene:P})]})}function zre(e){return o.jsx(tm,{...e,caption:!1})}function Bre({presenter:e,product:t,scene:n}){const[r,a]=s.useState(null),i=[t,n].filter(Boolean),c=i.length+(e?1:0)+Math.max(0,i.length-1);let u=0;const f=()=>({"--i":u++});return o.jsxs("div",{className:"sc-showcase-chips",onMouseLeave:()=>a(null),children:[e&&o.jsx(g5,{credit:e,open:r==="presenter",onEnter:()=>a("presenter"),children:Wre(e)}),i.length>0&&o.jsxs("div",{className:"sc-showcase-recipe",style:{"--n":c},children:[e&&o.jsx("span",{className:"sc-showcase-join",style:f(),"aria-hidden":!0}),i.map((h,p)=>o.jsxs(s.Fragment,{children:[p>0&&o.jsx("span",{className:"sc-showcase-join",style:f(),"aria-hidden":!0}),o.jsx(g5,{credit:h,open:r===h.key,onEnter:()=>a(h.key),style:f(),children:Ure({credit:h,step:p===0?1:2})})]},h.key))]})]})}function g5({credit:e,open:t,onEnter:n,children:r,style:a}){const i=s.useRef(null),c=s.useRef(null),[u,f]=s.useState(null),h=Tte(),p=h==="large"?144:88,m=h==="large"?168:112;if(s.useLayoutEffect(()=>{var S,C;if(!t||!e.previewUrl){f(null);return}const w=()=>{const j=i.current;if(!j)return;const N=j.getBoundingClientRect(),P=c.current,$=(P==null?void 0:P.offsetWidth)||p,R=(P==null?void 0:P.offsetHeight)||m,E=window.visualViewport,M=Ute(N,{width:(E==null?void 0:E.width)??window.innerWidth,height:(E==null?void 0:E.height)??window.innerHeight},{width:$,height:R});if(!M){f(null);return}f({left:Math.round(M.left),top:Math.round(M.top)})};w();const y=requestAnimationFrame(w),b=i.current,k=b?new ResizeObserver(w):null;return b&&k&&k.observe(b),window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),(S=window.visualViewport)==null||S.addEventListener("resize",w),(C=window.visualViewport)==null||C.addEventListener("scroll",w),()=>{var j,N;cancelAnimationFrame(y),k==null||k.disconnect(),window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w),(j=window.visualViewport)==null||j.removeEventListener("resize",w),(N=window.visualViewport)==null||N.removeEventListener("scroll",w)}},[t,e.previewUrl,e.key,p,m]),!e.previewUrl)return o.jsx("span",{ref:i,className:"sc-credit-tip",onPointerEnter:n,style:a,children:r});const v=Vre[e.key];return o.jsxs("span",{ref:i,className:"sc-credit-tip","data-open":t||void 0,onPointerEnter:n,style:a,children:[r,t&&Rr.createPortal(o.jsx("span",{ref:c,className:"sc-credit-tip-pop","data-size":h,style:u?{left:u.left,top:u.top}:{left:-9999,top:0},role:"tooltip","aria-label":`${v}: ${e.name}`,children:o.jsxs("span",{className:"sc-credit-tip-card",children:[o.jsx("img",{src:e.previewUrl,alt:""}),o.jsx("span",{className:"sc-credit-tip-name",children:e.name}),o.jsx("span",{className:"sc-credit-tip-role",children:v})]})}),document.body)]})}function Ure({credit:e,step:t}){const{name:n,previewUrl:r,linked:a,href:i}=e;return a&&i?o.jsx(_n,{className:"sc-showcase-chip",to:i,"data-link":!0,"data-step":t,"aria-label":`See ${n}`,onClick:c=>c.stopPropagation(),children:r?o.jsx("img",{src:r,alt:""}):null}):o.jsx("span",{className:"sc-showcase-chip","data-step":t,children:r?o.jsx("img",{src:r,alt:n}):o.jsx("span",{className:"sc-vh",children:n})})}function Wre(e){const{name:t,previewUrl:n,linked:r,href:a}=e;return r&&a?o.jsxs(_n,{className:"sc-showcase-badge",to:a,"data-link":!0,"aria-label":`See ${t}`,onClick:i=>i.stopPropagation(),children:[n?o.jsx("img",{src:n,alt:""}):null,o.jsx("span",{className:"sc-showcase-badge-name",children:t})]}):o.jsxs("span",{className:"sc-showcase-badge","aria-hidden":!0,children:[n?o.jsx("img",{src:n,alt:""}):null,o.jsx("span",{className:"sc-showcase-badge-name",children:t})]})}function v5(e){return{key:"open-tab",icon:"open-tab",label:"Open in new tab",onSelect:()=>window.open(e,"_blank")}}function w5(e){return{key:"select",icon:"select",label:"Select",onSelect:e}}function el(e){if(e.only)return[{key:"only",icon:"use",label:e.only.label,onSelect:e.only.run}];if(e.draft){const n=[{key:"continue",icon:"continue",label:"Continue",onSelect:e.draft.onContinue}];return e.draft.href&&n.push(v5(e.draft.href)),e.select&&n.push(w5(e.select.run)),n.push({key:"discard",icon:"discard",label:"Discard",onSelect:e.draft.onDiscard,danger:!0,separated:!0}),n}const t=[];return e.onOpen&&t.push({key:"open",icon:"open",label:"Open",onSelect:e.onOpen}),e.href&&t.push(v5(e.href)),e.use&&t.push({key:"use",icon:"use",label:e.use.label,onSelect:e.use.run}),e.select&&t.push(w5(e.select.run)),e.keep&&t.push({key:"keep",icon:e.keep.on?"kept":"keep",label:e.keep.on?"Remove from Keepers":"Add to Keepers",onSelect:e.keep.run}),e.onRename&&t.push({key:"rename",icon:"rename",label:"Rename",onSelect:e.onRename}),e.onDuplicate&&t.push({key:"duplicate",icon:"duplicate",label:"Duplicate presenter",onSelect:e.onDuplicate}),e.onEdit&&t.push({key:"edit",icon:"edit",label:"Edit presenter",onSelect:e.onEdit}),e.remove&&t.push({key:"delete",icon:"delete",label:e.remove.label,onSelect:e.remove.run,danger:!0,separated:!0}),t}function qr(e,t){if(e==="draft")return{tool:"Discard",menu:t>1?`Discard ${t} drafts`:"Discard",icon:"discard",danger:!0};const n=e==="presenter"?"Delete presenter":e==="product"?"Delete product":"Delete scene",r=e==="presenter"?"presenters":e==="product"?"products":"scenes";return{tool:"Delete",menu:t>1?`Delete ${t} ${r}`:n,icon:"delete",danger:!0}}function gm(e,t,n){return{tool:t?"Remove from keepers":"Keep",menu:e>1?t?`Remove ${e} ${n} from Keepers`:`Add ${e} ${n} to Keepers`:t?"Remove from Keepers":"Add to Keepers",icon:t?"kept":"keep"}}function vm({kind:e,count:t,openLabel:n,onOpen:r,href:a,onDeselect:i,onAct:c,onKeep:u,allKept:f}){const h=qr(e,t),p=[{key:"open",icon:n==="Continue"?"continue":"open",label:n,onSelect:r}];if(a&&p.push({key:"open-tab",icon:"open-tab",label:"Open in new tab",onSelect:()=>window.open(a,"_blank")}),p.push({key:"deselect",icon:"select",label:t>1?"Deselect this":"Deselect",onSelect:i}),u&&e!=="draft"){const v=gm(t,!!f,e==="presenter"?"presenters":e==="product"?"products":"scenes");p.push({key:"keep",icon:v.icon,label:v.menu,onSelect:u})}return p.push({key:e==="draft"?"discard":"delete",icon:h.icon,label:h.menu,onSelect:c,danger:h.danger||void 0,separated:!0}),p}async function sp(e,t){const n=[];let r;for(const a of e)try{await t(a)}catch(i){if((i==null?void 0:i.status)===404)continue;n.push(a),r??(r=i)}return{failed:n,error:r}}function B6({presenter:e,variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:c,onDuplicate:u,onEdit:f,onDelete:h,onRename:p,bookmarked:m,onBookmark:v,fresh:w,chosen:y,batching:b,onPick:k,batch:S,size:C="grid"}){const N=S?vm({kind:"presenter",count:S.count,openLabel:"Open",onOpen:()=>n==null?void 0:n(e.id),href:a,onDeselect:()=>k==null?void 0:k(e.id),onAct:S.onAct,onKeep:S.onKeep,allKept:S.allKept}):el(!a&&!r&&!!n?{only:{label:"Use in a shot",run:()=>n(e.id)}}:{onOpen:n?()=>n(e.id):void 0,href:a,use:r?{label:"Use in a shot",run:()=>r(e.id)}:void 0,select:k?{run:()=>k(e.id)}:void 0,keep:v?{on:!!m,run:()=>v(e.id)}:void 0,onRename:p?()=>p(e.id):void 0,onDuplicate:u?()=>u(e.id):void 0,onEdit:f?()=>f(e.id):void 0,remove:h?{label:"Delete presenter",run:()=>h(e.id)}:void 0});return o.jsx(rd,{id:e.id,previewUrl:e.previewUrl,title:e.descriptor||e.name,primary:e.name,secondary:"",useLabel:"Use in a shot",variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:c,menu:N,bookmarked:m,onBookmark:v,fresh:w,chosen:y,batching:b,onPick:k,size:C})}function QM(e){return o.jsx(tm,{...e})}function F0({scene:e,variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:c,bookmarked:u,onBookmark:f,onDelete:h,onRename:p,chosen:m,batching:v,onPick:w,batch:y,size:b="grid"}){const S=y&&h?vm({kind:"owned-scene",count:y.count,openLabel:"Open",onOpen:()=>n==null?void 0:n(e.id),href:a,onDeselect:()=>w==null?void 0:w(e.id),onAct:y.onAct,onKeep:y.onKeep,allKept:y.allKept}):el(!a&&!r&&!!n?{only:{label:"Use in a shot",run:()=>n(e.id)}}:{onOpen:n?()=>n(e.id):void 0,href:a,use:r?{label:"Use in a shot",run:()=>r(e.id)}:void 0,select:w?{run:()=>w(e.id)}:void 0,keep:f?{on:!!u,run:()=>f(e.id)}:void 0,onRename:p?()=>p(e.id):void 0,remove:h?{label:"Delete scene",run:()=>h(e.id)}:void 0});return o.jsx(rd,{id:e.id,previewUrl:e.previewUrl,title:e.description||Ji(e,"tooltip"),primary:Ji(e,"card"),secondary:"",useLabel:"Use in a shot",variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:c,bookmarked:u,onBookmark:f,menu:S,chosen:m,batching:v,onPick:w,size:b})}function JM(e){return o.jsx(tm,{...e})}const mu=new Map,Kre=50;function Gre(e,t){for(mu.delete(e),mu.set(e,t);mu.size>Kre;)mu.delete(mu.keys().next().value)}function Yre(e){return mu.get(e)}const qre=1e3;function is({className:e="sc-home",children:t}){const n=s.useRef(null),{key:r}=Zn(),a=s.useRef(!1);return s.useLayoutEffect(()=>{const i=n.current,c=Yre(r);if(!i||!c)return;let u=!1;const f=()=>{u||(u=!0,a.current=!1,p.disconnect(),clearTimeout(m),i.removeEventListener("wheel",f),i.removeEventListener("touchstart",f))},h=()=>{u||(i.scrollTop=c,Math.abs(i.scrollTop-c)<1&&f())};a.current=!0;const p=new ResizeObserver(h),m=setTimeout(f,qre);return i.addEventListener("wheel",f,{passive:!0}),i.addEventListener("touchstart",f,{passive:!0}),h(),p.observe(i),i.firstElementChild&&p.observe(i.firstElementChild),f},[r]),s.useEffect(()=>{const i=n.current;if(!i)return;const c=()=>{a.current||Gre(r,i.scrollTop)};return i.addEventListener("scroll",c,{passive:!0}),()=>i.removeEventListener("scroll",c)},[r]),o.jsx("div",{ref:n,className:e,"data-page-scroll":"",children:t})}function wm({title:e,filters:t,active:n,summary:r,onClear:a,density:i,search:c,action:u}){return o.jsxs("div",{className:"sc-filterbar",children:[e?o.jsx("h1",{className:"sc-vh",children:e}):null,t,o.jsxs("div",{className:"sc-filterbar-actions",children:[n&&o.jsxs("span",{className:"sc-lib-count",children:[r,a&&o.jsx("button",{type:"button",className:"sc-lib-clear",onClick:a,children:"Clear"})]}),c,i,u?o.jsx("span",{className:"sc-filterbar-cta",children:u}):null]})]})}function ym({mode:e,group:t}){if(e==="none"||!t)return null;const n=[{value:null,label:t.everyLabel,count:t.everyCount},...t.options.map(r=>({value:r.value,label:r.label,count:r.count}))];return o.jsx(tw,{"aria-label":t.label,activeKey:t.selected,items:n,onSelect:t.onSelect})}const lw=o.jsx(Da,{size:21,weight:"regular"});function io({shape:e,title:t,body:n,action:r,mark:a,onRetry:i}){return e==="error"?o.jsxs(o.Fragment,{children:[o.jsx("h1",{children:t??"Couldn't load this library"}),o.jsx("p",{className:"sc-lookpage-lede",children:n}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:i,children:"Retry"})})]}):e==="cold"?o.jsxs("div",{className:"sc-canvas-empty",children:[t&&o.jsx("h3",{children:t}),o.jsx("p",{children:n}),r&&o.jsx("div",{className:"sc-lookpage-acts",children:r})]}):o.jsxs("div",{className:"sc-lib-zero",children:[a&&o.jsx("span",{className:"sc-lib-zero-mark","aria-hidden":!0,children:a}),t&&o.jsx("h3",{children:t}),o.jsx("p",{children:n}),r]})}function bm({noun:e,q:t,facet:n,onClearSearch:r,onClearAll:a}){const i=t.trim(),c=i?o.jsxs(o.Fragment,{children:["No ",e," found for ",o.jsxs("em",{children:["“",i,"”"]}),n?` in ${n}`:""]}):o.jsxs(o.Fragment,{children:["No ",e," in ",n]});return o.jsx(io,{shape:"zero",body:c,action:o.jsxs("span",{className:"sc-lib-zero-acts",children:[i&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:r,children:"Clear search"}),i&&n&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:a,children:"Clear all"}),!i&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:a,children:"Clear filter"})]})})}const Xre=150;function Tf(e){const[t,n]=tl(),r=t.get("q")??"",a=e.join(","),i=s.useMemo(()=>{const C={};for(const j of a.split(",").filter(Boolean))C[j]=t.get(j)||null;return C},[t,a]),c=s.useCallback(C=>{n(j=>{const N=new URLSearchParams(j);for(const[P,$]of Object.entries(C))$===null||$===""?N.delete(P):N.set(P,$);return N},{replace:!0})},[n]),[u,f]=s.useState(r),h=s.useRef(r),p=s.useRef(null),m=s.useCallback(()=>{p.current!==null&&(clearTimeout(p.current),p.current=null)},[]);s.useEffect(()=>{r!==h.current&&(h.current=r,m(),f(r))},[r,m]),s.useEffect(()=>m,[m]);const v=s.useCallback(C=>{f(C),m(),p.current=setTimeout(()=>{p.current=null,h.current=C,c({q:C||null})},Xre)},[c,m]),w=s.useCallback((C,j)=>c({[C]:j}),[c]),y=c,b=u.trim().length>0||Object.values(i).some(Boolean),k=s.useCallback(()=>{m(),f(""),h.current="",c({q:null})},[c,m]),S=s.useCallback(()=>{m(),f(""),h.current="";const C={q:null};for(const j of a.split(",").filter(Boolean))C[j]=null;c(C)},[c,m,a]);return{q:u,setQ:v,facets:i,setFacet:w,setFacets:y,active:b,clearSearch:k,clear:S}}const Qre=8;function Jre(){var nt;const{engines:e,scenes:t,loaded:n,presenters:r,presentersLoaded:a,demoProducts:i,showcase:c,showcaseCategories:u,showcaseLoaded:f,showcaseError:h,refetchShowcase:p}=Rn(),{brand:m,workspace:v,root:w,products:y,applyNodes:b}=on(),{poke:k}=Va(),S=cl(),C=Dn(),{push:j}=ir(),N=Xv(),P=um(),$=Ste(),R=wr(Ks),{q:E,setQ:M,facets:L,setFacet:H,clearSearch:D,clear:K}=Tf(["category"]),O=L.category,_=ce=>H("category",ce),re=E.trim().length>0,[z,F]=fa(Dr.wallDensity,Bu),Q=Ac(z),V=ce=>F(ce),I=pm(Q),B=fm(Q),Y=ce=>{const ve=new URLSearchParams(ce??{}).toString();C(`${mr(m)}${ve?`?${ve}`:""}`)},ae=y.length?y:((nt=m.json)==null?void 0:nt.products)??[],X=ce=>{var Ee,Ke,ye;const ve=(Ee=ce.brief.tokens.find(Se=>Se.t==="product"))==null?void 0:Ee.id,Pe=(Ke=ce.brief.tokens.find(Se=>Se.t==="character"))==null?void 0:Ke.id,ue=(ye=ce.brief.tokens.find(Se=>Se.t==="template"))==null?void 0:ye.id;return{product:ve?i.find(Se=>Se.id===ve):void 0,presenter:Pe?r.find(Se=>Se.id===Pe):void 0,scene:ue?t.find(Se=>Se.id===ue):void 0}},le=s.useMemo(()=>{const ce=new Map;for(const ve of c){const{product:Pe,presenter:ue,scene:Ee}=X(ve);ce.set(ve.id,kte(ve,{product:Pe,presenter:ue,scene:Ee},Qg(ve.category)))}return ce},[c,i,r,t]),ke=s.useMemo(()=>(O?c.filter(ve=>ve.category===O):c).filter(ve=>vo(le.get(ve.id)??ve.title,E)),[c,O,E,le]),te=s.useMemo(()=>{const ce=Ate(u);return{key:"category",label:"Categories",everyLabel:"All examples",everyCount:c.length,selected:O,onSelect:_,options:ce.map(ve=>({value:ve,label:Qg(ve)??ve,count:c.filter(Pe=>Pe.category===ve).length}))}},[c,u,O,_]),be=ce=>{const{product:ve,presenter:Pe,scene:ue}=X(ce);return{productName:ve?go(ve,"chip"):null,productPreviewUrl:(ve==null?void 0:ve.previewUrl)??null,productId:(ve==null?void 0:ve.id)??null,presenterName:(Pe==null?void 0:Pe.name)??null,presenterPreviewUrl:Pe?ti(Pe).src:null,presenterId:(Pe==null?void 0:Pe.id)??null,sceneName:ue?Ji(ue,"chip"):null,scenePreviewUrl:(ue==null?void 0:ue.previewUrl)??null,sceneId:(ue==null?void 0:ue.id)??null}},[G,J]=s.useState(null),W=R?$:ce=>{const ve=c.find(Pe=>Pe.id===ce);ve&&(J(O6(ve)),j({kind:"info",title:`Starting from "${ve.title}"`}))},he=()=>{const ve=[...si(m.id)].reverse().find(Pe=>t.some(ue=>ue.id===Pe));Y(ve?{scene:ve,attach:"products",compose:"1"}:{attach:"products",compose:"1"})},Xe=s.useMemo(()=>_h(Cf(m),r).slice(0,8),[m,r]),tt=s.useMemo(()=>{const ce=si(m.id);return _h(jc(m),$M(t,ve=>ce.includes(ve.id))).slice(0,8)},[t,m]),ze=s.useMemo(()=>{var ye,Se,Ie,Be,Re;const ce=new Set,ve=Ze=>!Ze||ce.has(Ze)?null:(ce.add(Ze),sr(Ze,"tile")),Pe=Ze=>{for(const Qe of Ze){const lt=c.find(Ut=>Ut.id===Qe&&Ut.previewUrl),Lt=ve(lt==null?void 0:lt.previewUrl);if(Lt)return Lt}return null},ue=Ze=>{for(const Qe of Ze){const lt=t.find(Ut=>Ut.id===Qe&&Ut.previewUrl),Lt=ve(lt==null?void 0:lt.previewUrl);if(Lt)return Lt}return null},Ee=Ze=>{for(const Qe of c)if(!(!Qe.previewUrl||ce.has(Qe.previewUrl))&&!(Ze&&!Qe.brief.tokens.some(lt=>lt.t===Ze)))return ve(Qe.previewUrl);return null},Ke=ae.find(Ze=>{var Qe,lt;return Fr((lt=(Qe=Ze==null?void 0:Ze.shots)==null?void 0:Qe[0])==null?void 0:lt.file)});return{compose:ve(Ke?Fr((Se=(ye=Ke.shots)==null?void 0:ye[0])==null?void 0:Se.file):null)??Pe(["aurelia-serum-succulent-dew","verity-pearls-suspended-silk","solstice-aviators-screen-print"])??ve((Ie=i.find(Ze=>Ze.id==="aurelia-amber-serum"))==null?void 0:Ie.previewUrl)??ve((Be=i.find(Ze=>Ze.previewUrl))==null?void 0:Be.previewUrl)??Ee("product"),product:Pe(["voss-rowe-runner-volcanic-ash","birchwood-salt-flat","voss-rowe-dune-slip-face"])??ve((Re=i.find(Ze=>Ze.id==="voss-rowe-trail-runner"))==null?void 0:Re.previewUrl)??Ee("product"),presenter:ve(ti(r.find(Ze=>Ze.id==="maren")??r.find(Ze=>Ze.avatarUrl)??r[0]??{}).src)??Ee("character"),scene:ue(["furniture-travertine-atrium","wide-establishing-environment","studio-soft-horizon","studio-volcanic-ash-field","furniture-lamplight-hours"])??Pe(["moss-larkin-chair-travertine-atrium","calder-snow-loft","basalt-snells-window"])??Ee("template")}},[t,r,ae,i,c]);return o.jsx(Rf.Provider,{value:B,children:o.jsxs(is,{children:[o.jsxs("main",{className:"sc-main",id:"main","data-no-dock":R||void 0,children:[o.jsxs("h1",{className:"sc-greet",children:["Compose a shot ",o.jsx("em",{children:"on brand"})]}),o.jsxs("div",{className:"sc-create-grid",children:[o.jsxs("button",{type:"button",className:"sc-create-card","data-tone":"compose","data-main":"",onClick:he,children:[o.jsx(eR,{thumbUrl:ze.compose,fallback:o.jsx(sC,{size:22,weight:"fill"})}),o.jsx("b",{children:"Create an image"})]}),o.jsx(o8,{tone:"product",title:"Add a product",count:ae.length,thumbUrl:ze.product,icon:o.jsx(Bp,{size:22,weight:"fill"}),onClick:()=>S("product")}),o.jsx(o8,{tone:"presenter",title:"Create a presenter",thumbUrl:ze.presenter,icon:o.jsx(uW,{size:22,weight:"fill"}),onClick:()=>S("presenter")}),o.jsx(o8,{tone:"scene",title:"Create a scene",thumbUrl:ze.scene,icon:o.jsx(nW,{size:22,weight:"fill"}),onClick:()=>S("scene")})]}),!f&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":B,style:I,"aria-hidden":!0,children:o.jsx(zre,{size:"grid",count:8})}),f&&h&&o.jsxs("p",{className:"sc-feed-empty",children:["Couldn't load the showcase gallery."," ",o.jsx("button",{type:"button",className:"sc-sec-more",onClick:()=>p(),children:"Retry"})]}),f&&!h&&c.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(wm,{filters:o.jsx(ym,{mode:"tabs",group:te}),search:c.length>=Qre&&o.jsx(ld,{value:E,onChange:M,noun:"examples",total:c.length}),density:o.jsx(hm,{value:Q,onChange:V})}),ke.length>0&&o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":B,style:I,children:ke.map(ce=>o.jsx(XM,{entry:ce,size:"grid",hideRecipe:!0,onOpen:W,productHref:ve=>la(m,ve),presenterHref:ve=>ha(m,ve),sceneHref:ve=>_r(m,ve),...be(ce)},ce.id))}),ke.length===0&&(re?o.jsx(bm,{noun:"examples",q:E,facet:O?Qg(O):null,onClearSearch:D,onClearAll:K}):o.jsx("p",{className:"sc-looks-empty",children:"No example carries that category yet."}))]}),!a&&o.jsx("div",{className:"sc-masonry","aria-hidden":!0,children:o.jsx(QM,{size:"grid",count:8})}),a&&Xe.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"sc-sec-head",children:[o.jsx("span",{className:"sc-sec-title",children:"Presenters"}),o.jsx(_n,{className:"sc-sec-more",to:Uo(m),children:"Browse presenters"})]}),o.jsx("div",{className:"sc-masonry",children:Xe.map(ce=>o.jsx(B6,{presenter:ce,variant:"navigate",size:"grid",onOpen:N},ce.id))})]}),!n&&o.jsx("div",{className:"sc-masonry","aria-hidden":!0,children:o.jsx(JM,{size:"grid",count:8})}),n&&t.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"sc-sec-head",children:[o.jsx("span",{className:"sc-sec-title",children:"Scenes"}),o.jsx(_n,{className:"sc-sec-more",to:Kl(m),children:"Browse scenes"})]}),o.jsx("div",{className:"sc-masonry",children:tt.map(ce=>o.jsx(F0,{scene:ce,variant:"navigate",size:"grid",onOpen:P},ce.id))})]})]}),!R&&o.jsxs(qM,{children:[o.jsx(iw,{}),o.jsx(aw,{projectId:(v==null?void 0:v.id)||null,brand:m,engines:e,parentId:w,initialBrief:G,onQueued:(ce,ve,Pe,ue)=>{ue!=null&&ue.length&&b(ue),k(),C(mr(m))}})]})]})})}function o8({tone:e,title:t,icon:n,count:r,thumbUrl:a,onClick:i}){return o.jsxs("button",{type:"button",className:"sc-create-card","data-tone":e,onClick:i,children:[o.jsx(eR,{thumbUrl:a,fallback:n}),o.jsxs("b",{children:[t,r?o.jsx(I7,{variant:"soft",radius:"full",size:"1",children:r}):null]})]})}function eR({thumbUrl:e,fallback:t}){return o.jsx("span",{className:"sc-glyph","data-photo":e?"":void 0,"aria-hidden":!0,children:e?o.jsx("span",{className:"sc-glyph-shot",children:o.jsx("img",{src:e,alt:"",loading:"lazy"})}):t})}function tR({id:e,name:t,hash:n,drawing:r,state:a,href:i,blank:c,onDiscard:u,chosen:f,batching:h,onPick:p,batch:m}){const v=Dn(),w=Ev(),y=m?vm({kind:"draft",count:m.count,openLabel:"Continue",onOpen:()=>v(i),href:i,onDeselect:()=>p==null?void 0:p(e),onAct:m.onAct}):el(u?{draft:{onContinue:()=>v(i),href:i,onDiscard:()=>u(e)},select:p?{run:()=>p(e)}:void 0}:{onOpen:()=>v(i),href:i}),b=o.jsxs("div",{className:"sc-lookcard","data-variant":"plain","data-size":"grid","data-build":!0,"data-building":r||void 0,"data-picked":f||void 0,"data-batching":h||void 0,children:[o.jsxs(_n,{className:"sc-lookcard-media",to:i,"aria-label":h?`${f?"Deselect":"Select"} ${t}`:`Continue ${t}`,onClick:k=>{h&&p&&(k.preventDefault(),p(e))},children:[n?o.jsx("img",{src:dn(n,"tile"),alt:""}):o.jsx("span",{className:"sc-lookcard-blank",children:c}),r&&o.jsx("span",{className:"sc-shimmer","aria-hidden":!0}),o.jsx("span",{className:"sc-draftmark",children:"Draft"})]}),p&&o.jsx("button",{type:"button",className:"sc-cell-ctl sc-lookcard-pick","data-on":f||void 0,"aria-pressed":!!f,"aria-label":f?`Deselect ${t}`:`Select ${t}`,onClick:k=>{k.preventDefault(),k.stopPropagation(),p(e)},children:o.jsx(Kn,{size:13,weight:"bold"})}),u&&!h&&o.jsx("button",{type:"button",className:"sc-cardpuck","aria-label":`Discard ${t}`,onClick:()=>u(e),children:o.jsx(jn,{size:13})}),o.jsxs("span",{className:"sc-lookcard-cap",children:[o.jsx("b",{dir:"auto",children:t}),o.jsx("span",{children:a})]})]});return w?b:o.jsxs(pf,{children:[o.jsx(mf,{children:b}),o.jsx(gf,{children:y.map(k=>o.jsxs("span",{style:{display:"contents"},children:[k.separated&&o.jsx(Fp,{}),o.jsxs(vf,{color:k.danger?"red":void 0,onSelect:k.onSelect,children:[o.jsx(Nv,{name:k.icon}),k.label]})]},k.key))})]})}function cw({title:e,name:t,maxLength:n,busy:r,error:a,onConfirm:i,onDismiss:c}){const[u,f]=s.useState(t),h=s.useRef(null),p=s.useRef(!1),m=u.trim(),v=m.length>0,w=b=>{b&&(b.style.height="auto",b.style.height=`${b.scrollHeight}px`)};s.useEffect(()=>{p.current=!1,w(h.current)},[t]),s.useEffect(()=>{r||(p.current=!1)},[r]);const y=()=>{if(!(!v||r||p.current)){if(m===t.trim())return c();p.current=!0,i(m)}};return o.jsxs(Ts,{className:"sc-newdlg sc-pdetails",maxWidth:"min(420px, 94vw)",onDismiss:c,onOpenAutoFocus:b=>{b.preventDefault();const k=h.current;k&&(k.focus(),k.select(),w(k))},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:e}),o.jsx(As,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx("span",{"aria-hidden":!0,children:"×"})})})]}),o.jsxs("div",{className:"sc-newdlg-body",children:[o.jsxs("label",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Name"}),o.jsx("textarea",{ref:h,className:"sc-pdetails-field",value:u,dir:"auto",rows:1,maxLength:n,"aria-label":"Name",onChange:b=>{f(b.target.value),w(b.currentTarget)},onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),y())}})]}),a&&o.jsx("p",{className:"sc-assetform-err",children:a})]}),o.jsxs("div",{className:"sc-newdlg-foot",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:c,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:!v||r,"data-busy":r||void 0,onClick:y,children:r?"Saving":"Save"})]})]})}function nR({since:e}){const[t,n]=s.useState(Date.now());return s.useEffect(()=>{const r=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(r)},[]),o.jsx("span",{className:"sc-cell-tag",role:"status","aria-label":`${xv(e,t)}, ${ac(e,t)}`,children:ac(e,t)})}function ese({build:e,onCancel:t,onRetry:n,onDismiss:r}){const a=e.stage==="failed",i=a?Ef(e.error):null;return o.jsxs("div",{className:"sc-lookcard","data-variant":"plain","data-size":"grid","data-build":a||void 0,"data-building":!a||void 0,children:[o.jsxs("div",{className:"sc-lookcard-media",children:[o.jsx("span",{className:"sc-lookcard-blank"}),!a&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-shimmer"}),o.jsx(nR,{since:e.startedAt})]}),!a&&t&&o.jsx("button",{type:"button",className:"sc-cardpuck","aria-label":`Stop building ${e.name}`,onClick:()=>t(e.id),children:o.jsx(jn,{size:13})}),a&&r&&o.jsx("button",{type:"button",className:"sc-cardpuck","aria-label":`Dismiss ${e.name}`,onClick:()=>r(e.id),children:o.jsx(jn,{size:13})}),a&&n&&o.jsxs("button",{type:"button",className:"sc-lookcard-use",onClick:()=>n(e),children:[o.jsx(cC,{size:12})," Try again"]})]}),i?o.jsxs("span",{className:"sc-lookcard-cap",title:i.raw,children:[o.jsx("b",{dir:"auto",children:e.name}),o.jsx("span",{children:i.title})]}):null]})}function uw({count:e,loaded:t,tool:n,icon:r,danger:a,onAct:i,keep:c,onClear:u,onSelectAll:f}){return o.jsxs("div",{className:"sc-picked",role:"toolbar","aria-label":"Selection",children:[o.jsxs("span",{className:"sc-picked-meta",children:[o.jsxs("span",{className:"sc-picked-n",role:"status",children:[e,o.jsx("span",{className:"sc-vh",children:" selected"})]}),t>1&&o.jsx("button",{type:"button",className:"sc-picked-all",onClick:e<t?f:u,children:e<t?"Select all":"Deselect all"})]}),o.jsx("span",{className:"sc-picked-rule","aria-hidden":!0}),o.jsxs("span",{className:"sc-picked-tools",children:[c&&o.jsx(i8,{label:c.label,onClick:c.onAct,children:o.jsx(Da,{size:17,weight:c.filled?"fill":"regular"})}),o.jsx(i8,{label:n,tone:a?"danger":void 0,onClick:i,children:o.jsx(tse,{name:r})})]}),o.jsx("span",{className:"sc-picked-rule","aria-hidden":!0}),o.jsx("span",{className:"sc-picked-exit",children:o.jsx(i8,{label:"Done",onClick:u,children:o.jsx(jn,{size:16,weight:"bold"})})})]})}function tse(e){return o.jsx(ll,{size:17})}function i8({label:e,tone:t,onClick:n,children:r}){return o.jsx(or,{label:e,children:o.jsx("button",{type:"button",className:"sc-picked-tool","data-tone":t,"aria-label":e,onClick:n,children:r})})}const Xd=()=>({kind:null,ids:new Set});function dw(e){const[t,n]=s.useState(Xd),r=s.useCallback(()=>n(Xd()),[]);s.useEffect(()=>{r()},[e,r]),s.useEffect(()=>{if(t.ids.size===0)return;const p=m=>{m.defaultPrevented||m.key!=="Escape"||r()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[t.ids.size,r]);const a=s.useCallback((p,m)=>{n(v=>{if(v.kind&&v.kind!==p)return v;const w=new Set(v.ids);return w.has(m)?w.delete(m):w.add(m),w.size?{kind:v.kind??p,ids:w}:Xd()})},[]),i=s.useCallback((p,m)=>{n({kind:p,ids:new Set(m)})},[]),c=s.useCallback(p=>{const m=new Set(p);n(v=>{const w=new Set([...v.ids].filter(y=>m.has(y)));return w.size?{kind:v.kind,ids:w}:Xd()})},[]),u=s.useCallback(p=>{n(m=>{if(!m.ids.has(p))return m;const v=new Set(m.ids);return v.delete(p),v.size?{kind:m.kind,ids:v}:Xd()})},[]),f=s.useCallback(p=>{t.ids.size===0||p.target.closest(".sc-lookcard, .sc-picked, button, a, input, select, textarea, label, [role], [contenteditable]")||r()},[t.ids.size,r]),h=s.useCallback(p=>t.kind===null||t.kind===p,[t.kind]);return{kind:t.kind,ids:t.ids,toggle:a,selectAll:i,clear:r,retain:c,forget:u,onBlank:f,picking:h,batching:t.kind}}function fw({label:e}){return o.jsx("div",{className:"sc-starter-rule",children:o.jsx("span",{children:e})})}const l8=60;function hw(e,t){const[n,r]=s.useState(l8);s.useEffect(()=>{r(l8)},[t]);const{visible:a,remaining:i}=ew(e,n),c=s.useCallback(()=>r(u=>u+l8),[]);return{visible:a,remaining:i,showMore:c}}const nse=24,rse=8,c8="__bookmarked";function sse(){const{scenes:e,collections:t,verticals:n,loaded:r,error:a,refetch:i,applyBrand:c,refreshBrands:u}=Rn(),{brand:f}=on(),{push:h}=ir(),p=Dn(),[m,v]=s.useState(()=>si(f.id)),w=ee=>v(dm("scene",f.id,ee)),y=um(),{builds:b,poke:k,studio:S}=Va(),C=cl(),j=s.useMemo(()=>jc(f),[f]),N=b.filter(ee=>ee.kind==="scene"&&(!ee.finished||ee.stage==="failed")),P=!!un({path:ut.sceneStudio}),[$,R]=s.useState(()=>yh(f.id)),E=S.filter(ee=>ee.kind==="scene").map(ee=>`${ee.id}:${ee.status}`).join("|");s.useEffect(()=>{P||R(yh(f.id))},[P,f.id,E]);const M=s.useMemo(()=>Wee($,S),[$,S]),[L,H]=s.useState(null),D=ee=>{ee.drawing&&ee.jobId&&Me.cancelSceneStudioJob(f.id,ee.jobId).catch(()=>{}),Gee(f.id,ee.convo),R(yh(f.id))},K=ee=>{const He=M.find(We=>We.convo===ee);He&&(He.hash||He.drawing?H(He):D(He))},{q:O,setQ:_,facets:re,setFacets:z,clearSearch:F,clear:Q}=Tf(["vertical","bookmarked"]),V=re.vertical,I=re.bookmarked==="1",B=dw(`${f.id}|${O}|${V??""}|${I?"1":""}`),Y=O.trim().length>0,[ae,X]=fa(Dr.wallDensity,Bu),le=Ac(ae),ke=ee=>X(ee),te=pm(le),be=fm(le),G=ee=>p(_r(f,ee)),[J,ne]=s.useState(null),[W,he]=s.useState(!1),[Xe,tt]=s.useState(null),[ze,nt]=s.useState(!1),[ce,ve]=s.useState(null),[Pe,ue]=s.useState(!1),Ee=s.useCallback(ee=>{const He=j.find(We=>We.id===ee);He&&ne(He)},[j]),Ke=s.useCallback(ee=>{const He=j.find(We=>We.id===ee);He&&(ve(null),tt(He))},[j]),ye=async ee=>{if(!(!Xe||ze)){nt(!0),ve(null);try{c((await Me.updateScene(f.id,Xe.id,{name:ee})).brand),tt(null)}catch(He){const We=nn(He,"Could not rename this scene");ve([We.title,We.detail].filter(Boolean).join(" "))}finally{nt(!1)}}},Se=async()=>{if(!(!J||W)){he(!0);try{c((await Me.deleteScene(f.id,J.id)).brand),B.forget(J.id),ne(null)}catch(ee){(ee==null?void 0:ee.status)===404?(await u(),B.forget(J.id),ne(null)):h(nn(ee,"Could not delete this scene"))}finally{he(!1)}}},Ie=s.useMemo(()=>I?e.filter(ee=>m.includes(ee.id)):V?e.filter(ee=>ee.verticals.includes(V)):e,[e,V,I,m]),Re=!(j.length>0||N.length>0||M.length>0),Ze=[...e,...j].reduce((ee,He)=>ee+(m.includes(He.id)?1:0),0),Qe=I&&Ze===0,lt=Qe&&Re,Lt=Qe&&!Re,Ut=Y||I&&!lt,Ct=s.useMemo(()=>lt?e:Ie,[lt,e,Ie]),cn=s.useMemo(()=>Ct.filter(ee=>vo(Xh(ee),O)),[Ct,O]),[Fe,mt]=s.useState(()=>new Set),{visible:it,remaining:St,showMore:xt}=hw(cn,`${V??""}|${I?"bookmarked":""}|${lt?"browse":""}|${O}`),Nt=ee=>[...j,...e].filter(He=>!He.verticals.length||He.verticals.includes(ee)).length,Kt=[{value:c8,label:"Keepers",count:Ze},...n.map(ee=>({value:ee,label:ee,count:Nt(ee)}))],et=e.length>0?"tabs":"none",gt={key:"vertical",label:"Vertical",everyLabel:"All scenes",everyCount:e.length+j.length,selected:I?c8:V,onSelect:ee=>z(ee===c8?{bookmarked:"1",vertical:null}:{bookmarked:null,vertical:ee}),options:Kt},ot=s.useMemo(()=>j.filter(ee=>V?!ee.verticals.length||ee.verticals.includes(V):!0).filter(ee=>vo(Xh(ee),O)).filter(ee=>I?m.includes(ee.id):!0),[j,V,O,I,m]),kn=I?ot.length>0:M.length>0||N.length>0||ot.length>0,dt=()=>{B.ids.size===1?Ee([...B.ids][0]):ue(!0)},Gt=[...B.ids],Ft=Gt.length>0&&Gt.every(ee=>m.includes(ee)),en=()=>v(Qv("scene",f.id,Gt,!Ft)),Jt=gm(B.ids.size,Ft,"scenes"),se=async()=>{if(W)return;const ee=[...B.ids];he(!0);try{const{failed:He,error:We}=await sp(ee,Ue=>Me.deleteScene(f.id,Ue));await u(),B.retain(He),ue(!1),We&&h(nn(We,"Could not delete these scenes"))}finally{he(!1)}},oe=o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>C("scene"),children:[o.jsx(cr,{size:12})," Create scene"]}),we=(ee,He=!1)=>o.jsx("div",{className:"sc-masonry","data-wall":He||void 0,"data-density":!0,"data-density-size":be,style:te,children:ee.map(We=>o.jsx(F0,{scene:We,variant:"use",size:"grid",onOpen:G,href:_r(f,We.id),onUse:y,bookmarked:m.includes(We.id),onBookmark:w},We.id))}),ge=o.jsx(wm,{title:"Scenes",filters:o.jsx(ym,{mode:et,group:gt}),density:o.jsx(hm,{value:le,onChange:ke}),search:e.length>=rse&&o.jsx(ld,{value:O,onChange:_,noun:"scenes",total:e.length})});return o.jsxs(Rf.Provider,{value:be,children:[o.jsx(is,{children:o.jsxs("main",{className:"sc-looks sc-scenes",id:"main","data-hero":Re||void 0,onClick:B.onBlank,children:[!Re&&ge,kn&&o.jsxs("section",{className:"sc-owned",children:[o.jsx("div",{className:"sc-sec-head",children:o.jsx("h2",{className:"sc-sec-title",children:"Your scenes"})}),o.jsxs("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":be,style:te,children:[!I&&M.map(ee=>o.jsx(tR,{id:ee.convo,name:ee.name||"Untitled scene",hash:ee.hash,drawing:ee.drawing,state:Kee(ee),href:Bi(f,ee.convo),blank:o.jsx(Cj,{size:44,weight:"thin"}),onDiscard:K},ee.convo)),L&&o.jsx(Wn,{label:"Discard",title:`Discard ${L.name||"this unfinished scene"}?`,body:L.drawing?"The picture being drawn is stopped, and what was drawn here is thrown away. Nothing was saved to the library.":"What was drawn here is thrown away. Nothing was saved to the library.",open:!0,busy:!1,onOpenChange:ee=>{ee||H(null)},onConfirm:()=>{D(L),H(null)}}),!I&&N.map(ee=>o.jsx(ese,{build:ee,onCancel:He=>void Me.cancelAssetBuild(f.id,He).then(k),onDismiss:He=>void Me.deleteAssetBuild(f.id,He).then(k),onRetry:()=>C("scene")},ee.id)),ot.map(ee=>o.jsx(F0,{scene:ee,variant:"use",size:"grid",onOpen:G,href:_r(f,ee.id),onUse:y,bookmarked:m.includes(ee.id),onBookmark:w,onDelete:Ee,onRename:Ke,chosen:B.ids.has(ee.id),batching:B.batching==="owned-scene",onPick:B.picking("owned-scene")?He=>B.toggle("owned-scene",He):void 0,batch:B.kind==="owned-scene"&&B.ids.has(ee.id)?{count:B.ids.size,onAct:dt,onKeep:en,allKept:Ft}:null},ee.id))]}),Xe&&o.jsx(cw,{title:"Rename scene",name:Xe.name,maxLength:60,busy:ze,error:ce,onConfirm:ee=>void ye(ee),onDismiss:()=>{ze||tt(null)}}),J&&o.jsx(Wn,{label:"Delete scene",title:`Delete ${J.name}?`,body:"Shots already made here keep their images and their recipe. Only future shots lose it.",open:!0,busy:W,onOpenChange:ee=>{!ee&&!W&&ne(null)},onConfirm:()=>void Se()}),Pe&&o.jsx(Wn,{label:qr("owned-scene",B.ids.size).menu,title:`${qr("owned-scene",B.ids.size).menu}?`,body:"Shots already made here keep their images and their recipe. Only future shots lose it.",open:!0,busy:W,onOpenChange:ee=>{!ee&&!W&&ue(!1)},onConfirm:()=>void se()})]}),Re&&r&&!a&&e.length>0&&o.jsx(io,{shape:"cold",title:o.jsxs(o.Fragment,{children:["Build your own ",o.jsx("em",{children:"scene"})]}),body:"Upload a few references of a place, or describe it, and its light and materials carry into every image you make.",action:oe}),kn&&r&&!a&&Ie.length>0&&o.jsx("div",{className:"sc-sec-head sc-owned-divider",children:o.jsx("h2",{className:"sc-sec-title",children:"Scenri scenes"})}),Re&&r&&!a&&e.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(fw,{label:"Or start from one of ours"}),ge]}),!r&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":be,style:te,"aria-hidden":!0,children:o.jsx(JM,{size:"grid",count:8})}),r&&a&&o.jsx(io,{shape:"error",title:"Couldn't load this library",body:"Something went wrong reaching the catalog.",onRetry:()=>i()}),r&&!a&&!Ut&&t.map(ee=>{const He=Ct.filter(Ge=>Ge.collections.includes(ee));if(!He.length)return null;const Ue=Fe.has(ee)?He:He.slice(0,nse);return o.jsxs("section",{className:"sc-coll",children:[o.jsx("h2",{children:ee}),we(Ue),Ue.length<He.length&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>mt(Ge=>new Set(Ge).add(ee)),children:["Show all ",He.length]})})]},ee)}),r&&!a&&Ut&&it.length>0&&we(it,!0),r&&!a&&Lt&&o.jsx(io,{shape:"zero",title:"Nothing in Keepers yet",body:"Keep a scene from its card and it stays here.",mark:lw,action:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>z({bookmarked:null}),children:"Browse every scene"})}),r&&!a&&e.length>0&&!Lt&&cn.length===0&&ot.length===0&&o.jsx(bm,{noun:"scenes",q:O,facet:lt?null:I?"Keepers":V,onClearSearch:F,onClearAll:Q}),Ut&&St>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:xt,children:["Show ",Math.min(St,60)," more"]})})]})}),o.jsx(dc,{}),B.kind==="owned-scene"&&B.ids.size>0&&o.jsx("div",{className:"sc-wall-dock",children:o.jsx(uw,{count:B.ids.size,loaded:ot.length,tool:qr("owned-scene",B.ids.size).tool,icon:qr("owned-scene",B.ids.size).icon,danger:!0,onAct:dt,keep:{label:Jt.tool,filled:Ft,onAct:en},onClear:B.clear,onSelectAll:()=>B.selectAll("owned-scene",ot.map(ee=>ee.id))})})]})}function pw(e,t,n=12){const r=t.filter(Boolean).join(","),[a,i]=s.useState({key:"",items:[]});return s.useEffect(()=>{if(!r)return;const c=new AbortController;return Me.feed(e,{token:r,limit:n},c.signal).then(u=>{c.signal.aborted||i({key:r,items:u.items.filter(f=>f.status==="done"&&f.images.length>0)})}).catch(()=>{}),()=>c.abort()},[e,r,n]),a.key===r?a.items:[]}const U6=[{id:"top-down",label:"Top down",camera:"Directly overhead, looking straight down, the subject centred, deep focus"},{id:"eye-level",label:"Eye level",camera:"Eye level, the subject at a natural three-quarter angle, medium depth"},{id:"ground",label:"Ground level",camera:"Ground level, camera low, the subject close and large in frame, the place rising behind it"},{id:"wide",label:"Wide",camera:"A wide view, the subject small in the frame, the place around it doing the talking"},{id:"close",label:"Close",camera:"Close in on the subject, its surface, edge and material filling the frame"}],rR=4;function ase(e,t=""){var u,f;const n=[],r=((u=e.refs)==null?void 0:u.length)??0;r>0&&n.push(`read from ${r} ${r===1?"photograph":"photographs"}`);const a=((f=e.setups)==null?void 0:f.length)??0;a>0&&n.push(`${a} ${a===1?"way":"ways"} to shoot it`);const i=n.join(" · "),c=i?`${i.charAt(0).toUpperCase()}${i.slice(1)}.`:"";return[t.trim(),c].filter(Boolean).join(" ")}function mw({to:e,wall:t,where:n}){return o.jsxs("div",{className:"sc-lookpage-crumb",children:[o.jsx(_n,{to:e,children:t}),o.jsx("span",{children:"/"}),o.jsx("span",{children:n})]})}function gw({kind:e,brandId:t,id:n}){const[r,a]=s.useState(()=>zu(e,t).includes(n));s.useEffect(()=>{a(zu(e,t).includes(n))},[e,t,n]);const i=r?"Remove from Keepers":"Add to Keepers";return o.jsx(or,{label:i,children:o.jsx("button",{type:"button",className:"sc-icon-btn sc-lookpage-keep","data-kept":r||void 0,"aria-pressed":r,"aria-label":i,onClick:()=>a(dm(e,t,n).includes(n)),children:o.jsx(Da,{size:15,weight:r?"fill":"regular"})})})}function ose({items:e,placeholder:t,open:n,hit:r,onRemove:a,onOpen:i}){return o.jsxs("div",{className:"sc-chipfield","data-state":n?"open":void 0,children:[r,o.jsxs("span",{className:"sc-chipfield-row",children:[e.length===0&&t?o.jsx("span",{className:"sc-chipfield-ph",children:t}):null,e.map(c=>o.jsxs("span",{className:"sc-chipfield-chip",onClick:()=>i==null?void 0:i(),children:[c,a&&o.jsx("button",{type:"button","data-role":"remove","aria-label":`Remove ${c}`,onPointerDown:u=>u.stopPropagation(),onClick:u=>{u.preventDefault(),u.stopPropagation(),a(c)},children:o.jsx(jn,{size:10,weight:"bold"})})]},c))]}),o.jsx(Xi,{size:13,className:"sc-chipfield-caret","aria-hidden":!0})]})}function ise({value:e,onChange:t,options:n,label:r,placeholder:a="Any",findPlaceholder:i="Find or add",emptyNote:c="Nothing by that name.",max:u=12,maxLength:f=40}){const[h,p]=s.useState(!1),[m,v]=s.useState(""),w=s.useRef(null),y=[...n,...e.filter(P=>!n.some($=>nu($,P)))],b=m.trim(),k=b?y.filter(P=>P.toLowerCase().includes(b.toLowerCase())):y,S=e.length>=u,C=b.length>0&&!y.some(P=>nu(P,b))&&!S,j=P=>{const $=e.some(R=>nu(R,P));!$&&S||t($?e.filter(R=>!nu(R,P)):[...e,P])},N=()=>{var P;C&&(t([...e,b.slice(0,f)]),v(""),(P=w.current)==null||P.focus())};return s.useEffect(()=>{if(!h)return;const P=setTimeout(()=>{var $;return($=w.current)==null?void 0:$.focus()},0);return()=>clearTimeout(P)},[h]),o.jsxs(Ss,{open:h,onOpenChange:P=>{p(P),P||v("")},children:[o.jsx(ose,{items:e,placeholder:a,open:h,onOpen:()=>p(!0),onRemove:P=>t(e.filter($=>!nu($,P))),hit:o.jsx(Es,{children:o.jsx("button",{type:"button",className:"sc-chipfield-hit","aria-label":r})})}),o.jsxs(Cs,{align:"start",sideOffset:6,className:"sc-menu sc-chippick-menu",children:[o.jsx("input",{ref:w,className:"sc-chippick-find",type:"text",value:m,maxLength:f,placeholder:i,"aria-label":i,onChange:P=>v(P.target.value),onKeyDown:P=>{P.stopPropagation(),P.key==="Enter"?(P.preventDefault(),C?N():k.length===1&&j(k[0])):P.key==="Escape"&&p(!1)}}),o.jsxs("div",{className:"sc-chippick-list",children:[k.map(P=>{const $=e.some(R=>nu(R,P));return o.jsxs(tr,{className:"sc-menu-item","data-on":$||void 0,"data-off":!$&&S?"":void 0,onSelect:R=>{R.preventDefault(),j(P)},children:[o.jsx("span",{className:"sc-menu-lb",children:P}),$&&o.jsx(Kn,{size:14,className:"sc-menu-check","aria-hidden":"true"})]},P)}),!k.length&&!C&&o.jsx("p",{className:"sc-chippick-none",children:c})]}),C&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-menu-sep"}),o.jsxs(tr,{className:"sc-menu-item",onSelect:P=>{P.preventDefault(),N()},children:[o.jsx(cr,{size:16,className:"sc-menu-ic"}),o.jsxs("span",{className:"sc-menu-lb",children:['Add "',b,'"']})]})]}),S&&o.jsx("p",{className:"sc-chippick-none",children:"That is as many as this holds."})]})]})}const nu=(e,t)=>e.trim().toLowerCase()===t.trim().toLowerCase();function sR({name:e,categories:t,known:n,hint:r,ways:a,wayChoices:i,wayMax:c,busy:u,error:f,onSave:h,onDismiss:p}){const[m,v]=s.useState(e),[w,y]=s.useState(t),[b,k]=s.useState(()=>[...a??[]]),S=m.trim(),C=S.length>0,j=R=>R.map(E=>E.id).join(" "),N=S!==e.trim()||w.join(" ")!==t.join(" ")||!!a&&j(b)!==j(a),P=b.length>=(c??Number.POSITIVE_INFINITY)?[]:(i??[]).filter(R=>!b.some(E=>E.id===R.id)),$=()=>{if(!(!C||u)){if(!N)return p();h({name:S,categories:w,...a?{ways:b}:{}})}};return o.jsxs(Ts,{className:"sc-newdlg sc-pdetails",maxWidth:"min(460px, 94vw)",onDismiss:p,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:"Details"}),o.jsx(As,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx("span",{"aria-hidden":!0,children:"×"})})})]}),o.jsxs("div",{className:"sc-newdlg-body",children:[o.jsxs("label",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Name"}),o.jsx("input",{className:"sc-pdetails-field",value:m,dir:"auto",onChange:R=>v(R.target.value),onKeyDown:R=>R.key==="Enter"&&$()})]}),o.jsxs("div",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Categories"}),o.jsx(ise,{value:w,onChange:y,options:n,label:"Categories",placeholder:"Any",findPlaceholder:"Find or add a category",emptyNote:"Nothing by that name.",maxLength:30}),o.jsx("span",{className:"sc-pdetails-hint",children:r})]}),a&&o.jsxs("div",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Ways to shoot it"}),o.jsxs("div",{className:"sc-pdetails-ways",children:[b.map(R=>o.jsxs("div",{className:"sc-pdetails-way",children:[o.jsx("span",{className:"sc-pdetails-way-lb",children:R.label}),o.jsx("span",{className:"sc-pdetails-way-sub",children:R.camera}),o.jsx("button",{type:"button",className:"sc-icon-btn","aria-label":`Remove ${R.label}`,onClick:()=>k(b.filter(E=>E.id!==R.id)),children:o.jsx(jn,{size:13,weight:"bold","aria-hidden":!0})})]},R.id)),P.length>0&&o.jsxs(Ss,{children:[o.jsx(Es,{children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost","aria-label":"Add a way to shoot it",children:[o.jsx(cr,{size:12,weight:"bold","aria-hidden":!0}),o.jsx("span",{children:"Add a way"})]})}),o.jsx(Cs,{children:P.map(R=>o.jsx(tr,{onSelect:()=>k([...b,R]),children:R.label},R.id))})]})]}),o.jsxs("span",{className:"sc-pdetails-hint",children:["A way moves the camera and leaves the world alone.",c?` ${c} at most.`:""]})]}),f&&o.jsx("p",{className:"sc-assetform-err",children:f})]}),o.jsxs("div",{className:"sc-newdlg-foot",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:p,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:!C,"data-busy":u||void 0,onClick:$,children:u?"Saving":"Save"})]})]})}function Bl({src:e,crop:t}){const[n,r]=s.useState(!1);return n?o.jsx("span",{className:"sc-lookpage-ref-blank","aria-hidden":!0,children:o.jsx(Ws,{size:20})}):o.jsx("img",{src:e,alt:"",loading:"lazy",decoding:"async",...t?{"data-crop":t}:{},onError:()=>r(!0)})}function vw(){return o.jsx("div",{className:"sc-lookpage-refs",children:o.jsx("div",{className:"sc-lookpage-ref",children:o.jsx("span",{className:"sc-lookpage-ref-blank",children:o.jsx(Ws,{size:20})})})})}function ww({node:e,to:t}){const[n,r]=s.useState(!1);return o.jsx(_n,{className:"sc-lookcard","aria-label":`Open ${Sr(e)}`,to:t,children:n?o.jsx("span",{className:"sc-lookcard-blank",children:o.jsx(Ws,{size:20})}):o.jsx("img",{src:dn(e.images[0],"tile"),alt:"",loading:"lazy",onError:()=>r(!0)})})}function Tu({label:e,children:t}){const n=s.useRef(null),r=s.useRef(null),a=s.useRef(!1),i=s.useRef(()=>{});s.useLayoutEffect(()=>{const u=n.current,f=r.current;if(!u||!f)return;let h=0;const p=()=>{const w=f.scrollWidth-f.clientWidth;if(w<=1){delete u.dataset.overflowLeft,delete u.dataset.overflowRight;return}f.scrollLeft>2?u.dataset.overflowLeft="":delete u.dataset.overflowLeft,f.scrollLeft<w-2?u.dataset.overflowRight="":delete u.dataset.overflowRight};i.current=p,p();const m=()=>{h||(h=requestAnimationFrame(()=>{h=0,p()}))},v=new ResizeObserver(()=>p());return v.observe(f),f.addEventListener("scroll",m,{passive:!0}),()=>{h&&cancelAnimationFrame(h),i.current=()=>{},v.disconnect(),f.removeEventListener("scroll",m)}},[]);const c=u=>{const f=r.current;if(!(f!=null&&f.firstElementChild)||a.current)return;const h=f.firstElementChild.getBoundingClientRect().width+16,p=f.scrollWidth/2;u<0&&f.scrollLeft<h&&(f.scrollLeft+=p);const m=f.scrollLeft,v=u*h,w=performance.now();a.current=!0;const y=b=>{const k=Math.min(1,(b-w)/420);f.scrollLeft=m+v*(1-(1-k)**3),i.current(),k<1?requestAnimationFrame(y):(a.current=!1,f.scrollLeft>=p&&(f.scrollLeft-=p),i.current())};requestAnimationFrame(y)};return o.jsxs("section",{className:"sc-lookpage-band",children:[o.jsx("p",{className:"sc-bandhead",children:e}),o.jsxs("div",{className:"sc-slider",ref:n,children:[o.jsx("button",{type:"button",className:"sc-slider-arrow prev","aria-label":"Previous",onClick:()=>c(-1),children:o.jsx(ga,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-slider-arrow next","aria-label":"Next",onClick:()=>c(1),children:o.jsx(il,{size:13,weight:"bold"})}),o.jsxs("div",{className:"sc-slider-track",ref:r,children:[t,t]})]})]})}function aR(e){const t=s.useRef(null),n=s.useRef(null);s.useLayoutEffect(()=>{const a=t.current,i=n.current;if(!a||!i)return;let c=0;const u=()=>{const p=i.scrollWidth-i.clientWidth;if(p<=1){delete a.dataset.overflowLeft,delete a.dataset.overflowRight;return}i.scrollLeft>2?a.dataset.overflowLeft="":delete a.dataset.overflowLeft,i.scrollLeft<p-2?a.dataset.overflowRight="":delete a.dataset.overflowRight},f=()=>{c||(c=requestAnimationFrame(()=>{c=0,u()}))};u();const h=new ResizeObserver(()=>u());h.observe(i);for(const p of i.children)h.observe(p);return i.addEventListener("scroll",f,{passive:!0}),()=>{c&&cancelAnimationFrame(c),h.disconnect(),i.removeEventListener("scroll",f)}},[e]);const r=s.useCallback(a=>{const i=n.current;if(!(i!=null&&i.firstElementChild))return;const c=i.firstElementChild.getBoundingClientRect().width,u=Number.parseFloat(getComputedStyle(i).columnGap)||0,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches;i.scrollBy({left:a*(c+u),behavior:f?"auto":"smooth"})},[]);return{shellRef:t,railRef:n,page:r}}function yw({count:e,label:t,className:n,trackClassName:r,style:a,children:i}){const{shellRef:c,railRef:u,page:f}=aR(e);return o.jsxs("div",{className:n?`sc-rail ${n}`:"sc-rail",ref:c,style:{"--sc-rail-count":e},children:[o.jsx("button",{type:"button",className:"sc-rail-arrow prev","aria-label":`${t}, earlier`,onClick:()=>f(-1),children:o.jsx(ga,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-rail-arrow next","aria-label":`${t}, later`,onClick:()=>f(1),children:o.jsx(il,{size:13,weight:"bold"})}),o.jsx("ol",{className:r?`sc-rail-track ${r}`:"sc-rail-track","aria-label":t,ref:u,style:a,children:i})]})}function xm(){const e=s.useRef(!1);return s.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),s.useCallback(()=>{const t=window.location.pathname;return()=>e.current&&window.location.pathname===t},[])}const lse=1500;function oR(e,t,n){const{refreshBrands:r}=Rn(),[a,i]=s.useState(null),[c,u]=s.useState([]),[f,h]=s.useState([]),[p,m]=s.useState(!1),[v,w]=s.useState(0),y=s.useRef(void 0),b=s.useRef(r);b.current=r,s.useEffect(()=>{if(!t)return;let S=!0,C=null;const j=async()=>{var N;try{const P=await Me.sceneExamples(e,t);if(!S)return;const $=P.job?`${P.job.id}:${P.job.done.length}:${P.job.status}`:null;if($&&y.current!==void 0&&$!==y.current&&await b.current(),!S)return;y.current=$,i(P.job),u(P.first),h(P.more),m(!0),((N=P.job)==null?void 0:N.status)==="running"&&(C=setTimeout(j,lse))}catch{}};return j(),()=>{S=!1,C&&clearTimeout(C)}},[e,t,n,v]);const k=s.useCallback(()=>w(S=>S+1),[]);return{job:a,first:c,more:f,read:p,again:k}}const cse=["no","one","two","three","four","five"];function use({brandId:e,scene:t,onError:n}){const{applyBrand:r}=Rn(),a=um(),i=xm(),{job:c,first:u,again:f}=oR(e,t.id,t.previewUrl??null),[h,p]=s.useState(!1),[m,v]=s.useState(!1),[w,y]=s.useState(null),b=gA(t.examples,c),k=(c==null?void 0:c.status)==="running",S=BK(t.examples),C=async()=>{if(m||!u.length)return;const L=i();v(!0),n(null);try{await Me.drawSceneExamples(e,t.id,{first:!0}),f()}catch(H){L()&&n(String((H==null?void 0:H.message)??H))}finally{L()&&v(!1)}},j=u.length&&(c==null?void 0:c.status)!=="running"?o.jsx("p",{className:"sc-scenepage-examples-ask",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:m,onClick:()=>void C(),children:[S.length?"Draw them again":"Draw it in use",`, ${cse[u.length]??u.length} picture${u.length===1?"":"s"}`]})}):null,N=async L=>{const H=U6.find(K=>K.id===L);if(!H||h)return;const D=i();p(!0),n(null);try{const K=t.setups??[];if(!K.some(O=>O.id===H.id)){const O=await Me.updateScene(e,t.id,{setups:[...K,H]});r(O.brand)}a(t.id,H.id)}catch(K){D()&&n(String((K==null?void 0:K.message)??K))}finally{D()&&p(!1)}},P=t.previewUrl?{src:t.previewUrl,label:"The place"}:null;if(!b.length&&!P)return o.jsx(vw,{});if(!b.length&&P)return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-scenepage-place",children:o.jsx("button",{type:"button","aria-label":`${P.label}, open`,onClick:()=>y(P),children:o.jsx(Bl,{src:sr(P.src,"tile")})})}),j,w&&o.jsx(Wu,{src:w.src,kind:"scene",label:w.label,noun:t.name,onClose:()=>y(null)})]});const $=w==null?void 0:w.tile,R=$!=null&&$.setup?U6.find(L=>L.id===$.setup):void 0,E=!!R&&((t.setups??[]).some(L=>L.id===R.id)||(t.setups??[]).length<rR),M=k&&c?bv({status:c.status,step:c.current,done:c.done.length,total:c.roles.length,error:c.error}):S.length>0?`${S.length===1?`The ${rc[S[0]].toLowerCase()} shows`:"These show"} an earlier picture of this place.`:null;return o.jsxs(o.Fragment,{children:[o.jsxs(yw,{count:b.length+(P?1:0),label:"Pictures of this place",className:"sc-refset-rail",trackClassName:"sc-refset",children:[P&&o.jsxs("li",{children:[o.jsx("button",{type:"button",className:"sc-refset-tile","aria-label":"The place, open",onClick:()=>y(P),children:o.jsx(Bl,{src:sr(P.src,"small")})}),o.jsx("span",{className:"sc-refset-lb","aria-hidden":!0,children:"The place"})]}),b.map(L=>{const H=rc[L.role];return o.jsxs("li",{children:[L.state==="drawing"?o.jsxs("span",{className:"sc-refset-tile","data-state":"drawing",role:"img","aria-label":`${H}, drawing`,children:[L.url&&o.jsx(Bl,{src:sr(L.url,"small")}),o.jsx("span",{className:"sc-shimmer","aria-hidden":!0})]}):L.state==="failed"?o.jsxs("span",{className:"sc-refset-tile","data-state":"failed",role:"img","aria-label":`${H} did not draw`,title:L.error,children:[o.jsx(Sc,{size:20,"aria-hidden":!0}),o.jsx("span",{children:"Did not draw"})]}):o.jsx("button",{type:"button",className:"sc-refset-tile","aria-label":`${H}, open`,onClick:()=>y({src:L.url,label:H,tile:L}),children:o.jsx(Bl,{src:sr(L.url,"small")})}),o.jsx("span",{className:"sc-refset-lb","aria-hidden":!0,children:H})]},L.role)})]}),M&&o.jsx("p",{className:"sc-scenepage-examples-state","aria-live":"polite",children:M}),j,w&&o.jsx(Wu,{src:w.src,kind:"scene",label:w.label,noun:t.name,onClose:()=>y(null),actions:R&&E?o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:h,onClick:()=>void N(R.id),children:"Shoot it this way"}):void 0})]})}function dse(){var le,ke,te,be;const{sceneId:e}=Bs(),{scenes:t,loaded:n,error:r,refetch:a,applyBrand:i,refreshBrands:c}=Rn(),{brand:u}=on(),f=Dn(),h=um(),p=u.id,[m,v]=s.useState([]),[w,y]=s.useState(null),b=G=>f(_r(u,G)),k=Fh(u,e??""),S=k??t.find(G=>G.id===e);Ec(S==null?void 0:S.name);const C=!!k;s.useEffect(()=>{let G=!0;if(v([]),!C)return Me.sceneFrames(e??"").then(J=>{G&&v(J.frames)}).catch(()=>{G&&v([])}),()=>{G=!1}},[e,C]);const j=pw(u.id,[e??""]),N=s.useMemo(()=>{if(!S||C)return[];return t.filter(ne=>ne.id!==S.id).sort((ne,W)=>J(W)-J(ne)).slice(0,8);function J(ne){const W=ne.lighting.split(/[ ,]+/).some(Xe=>Xe.length>3&&S.lighting.toLowerCase().includes(Xe.toLowerCase())),he=ne.collections.some(Xe=>S.collections.includes(Xe));return(W?2:0)+(he?1:0)}},[t,S,C]),P=s.useMemo(()=>{if(S||!n||r)return[];const G=si(p);return $M(t,J=>G.includes(J.id)).slice(0,6)},[S,n,r,t,p]),[$,R]=s.useState(null),[E,M]=s.useState(!1),[L,H]=s.useState(!1),[D,K]=s.useState(!1),O=s.useRef(!1),_=xm(),re=s.useMemo(()=>[...new Set([...t.flatMap(G=>G.verticals),...jc(u).flatMap(G=>G.verticals)])].sort((G,J)=>G.localeCompare(J)),[t,u]),z=async G=>{if(k){H(!0),R(null);try{const J=await Me.updateScene(u.id,k.id,{name:G.name,verticals:G.categories,...G.ways?{setups:G.ways}:{}});i(J.brand),K(!1)}catch(J){R(String(J.message??J))}finally{H(!1)}}},F=async()=>{if(!k||O.current)return;O.current=!0;const G=_(),J=Kl(u);M(!0);try{const ne=await Me.deleteScene(u.id,k.id);i(ne.brand)}catch(ne){if((ne==null?void 0:ne.status)!==404){O.current=!1,G()&&(R(String(ne.message??ne)),M(!1));return}await c()}G()&&f(J,{replace:!0})};if(!n&&!k)return o.jsx(is,{children:o.jsx("main",{className:"sc-lookpage sc-scenepage",id:"main",children:o.jsx("div",{className:"sc-tplrow","aria-hidden":!0})})});if(r&&!k)return o.jsx(is,{children:o.jsxs("main",{className:"sc-lookpage sc-scenepage",id:"main",children:[o.jsx("h1",{children:"Couldn't load this scene"}),o.jsx("p",{className:"sc-lookpage-lede",children:"Something went wrong reaching the catalog."}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>a(),children:"Retry"})})]})});if(!S)return o.jsx(is,{children:o.jsxs("main",{className:"sc-lookpage sc-scenepage",id:"main",children:[o.jsx("h1",{children:"This scene isn't here anymore"}),o.jsx("p",{className:"sc-lookpage-lede",children:"It may have been removed from the catalog, or the link is out of date."}),o.jsxs("div",{className:"sc-lookpage-acts",children:[o.jsx(_n,{className:"sc-btn sc-btn-primary",to:`${mr(u)}?compose=1`,children:"Start from scratch"}),o.jsx(_n,{className:"sc-btn sc-btn-ghost",to:Kl(u),children:"Browse all scenes"})]}),P.length>0&&o.jsx(Tu,{label:"You might like",children:P.map(G=>o.jsx(F0,{scene:G,variant:"navigate",size:"slider",onOpen:b,href:_r(u,G.id)},G.id))})]})});const Q=m.length?m.map((G,J)=>({src:G,label:`Example ${J+1}`})):S.previewUrl?[{src:S.previewUrl,label:"The place"}]:[],V=S.subject!=="person"&&Q.length>0?"Shown with a demo product for reference. Yours replaces it.":"",I=(k==null?void 0:k.setups)??[],B=((k==null?void 0:k.refs)??[]).filter(G=>G!==(k==null?void 0:k.previewUrl)),Y=((ke=(le=k==null?void 0:k.examples)==null?void 0:le.find(G=>!G.earlier))==null?void 0:ke.with)??((be=(te=k==null?void 0:k.examples)==null?void 0:te[0])==null?void 0:be.with),ae=k?k.figure?"The person in it is a stand-in: with a presenter attached, the picture goes with the shot and they take the role.":Y?`Shown in use with a Scenri demo ${Y}. Shots are told the words, never handed these pictures.`:k.previewUrl?"Shots are told the words, never handed this picture.":"":"",X=k?ase({refs:B,setups:k.setups},ae):"";return o.jsx(is,{children:o.jsxs("main",{className:"sc-lookpage sc-scenepage",id:"main",children:[o.jsx(mw,{to:Kl(u),wall:"Scenes",where:k?"Yours":"Scenri library"}),o.jsx("h1",{children:S.name}),S.verticals.length>0&&o.jsx("ul",{className:"sc-lookpage-cats","aria-label":"Filed under",children:S.verticals.map(G=>o.jsx("li",{className:"sc-chip","data-static":!0,children:G},G))}),o.jsx("p",{className:"sc-lookpage-lede",children:S.description}),o.jsxs("div",{className:"sc-lookpage-acts",children:[I.length>0?o.jsxs("span",{className:"sc-splitbtn",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary sc-splitbtn-go",onClick:()=>void h(S.id),children:"Use in a shot"}),o.jsxs(Ss,{children:[o.jsx(Es,{children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary sc-splitbtn-more","aria-label":"Use it a way",children:o.jsx(Xi,{size:12,weight:"bold","aria-hidden":!0})})}),o.jsx(Cs,{children:I.map(G=>o.jsx(tr,{onSelect:()=>void h(S.id,G.id),children:G.label},G.id))})]})]}):o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>void h(S.id),children:"Use in a shot"}),k&&o.jsx(_n,{className:"sc-btn sc-btn-ghost",to:pv(u,k.id),children:"Edit scene"}),o.jsx(gw,{kind:"scene",brandId:p,id:S.id}),k&&o.jsx(or,{label:"Edit name, filing and ways",children:o.jsx("button",{type:"button",className:"sc-icon-btn","aria-label":"Edit name, filing and ways","aria-haspopup":"dialog",onClick:()=>K(!0),children:o.jsx(ed,{size:17})})})]}),$&&o.jsx("p",{className:"sc-assetform-err",children:$}),k?o.jsx(use,{brandId:u.id,scene:k,onError:R},k.id):Q.length>1?o.jsx(yw,{count:Q.length,label:"Pictures of this place",className:"sc-refset-rail",trackClassName:"sc-refset",children:Q.map(G=>o.jsxs("li",{children:[o.jsx("button",{type:"button",className:"sc-refset-tile","aria-label":`${G.label}, open`,onClick:()=>y(G),children:o.jsx(Bl,{src:sr(G.src,"small")})}),o.jsx("span",{className:"sc-refset-lb","aria-hidden":!0,children:G.label})]},G.src))}):Q.length===1?o.jsx("div",{className:"sc-scenepage-place",children:o.jsx("button",{type:"button","aria-label":`${Q[0].label}, open`,onClick:()=>y(Q[0]),children:o.jsx(Bl,{src:sr(Q[0].src,"tile")})})}):o.jsx(vw,{}),!k&&V&&o.jsx("p",{className:"sc-lookpage-note",children:V}),k&&o.jsxs("section",{className:"sc-scenepage-told",children:[o.jsxs("dl",{className:"sc-lookpage-told",children:[o.jsxs("div",{children:[o.jsx("dt",{children:Ne.lightLabel}),o.jsx("dd",{dir:"auto",children:k.lighting})]}),k.camera&&o.jsxs("div",{children:[o.jsx("dt",{children:Ne.cameraLabel}),o.jsx("dd",{dir:"auto",children:k.camera})]}),k.figure&&o.jsxs("div",{children:[o.jsx("dt",{children:Ne.figureLabel}),o.jsx("dd",{dir:"auto",children:k.figure})]})]}),o.jsx("p",{className:"sc-lookpage-note",children:"Every shot made here is told this. Anything you write in the shot wins."})]}),B.length>0&&o.jsxs("section",{className:"sc-presenterpage-sources",children:[o.jsx("p",{className:"sc-presenterpage-sources-lb",children:"What it was read from"}),o.jsx("div",{className:"sc-presenterpage-sources-row",children:B.map((G,J)=>o.jsx("button",{type:"button",className:"sc-presenterpage-source","aria-label":`Source photo ${J+1}, open`,onClick:()=>y({src:G,label:`Source photo ${J+1}`}),children:o.jsx(Bl,{src:sr(G,"micro")})},G))})]}),k&&o.jsxs("div",{className:"sc-prec",children:[X&&o.jsx("p",{className:"sc-prec-note",children:X}),o.jsx(Wn,{label:"Delete scene",title:`Delete ${k.name}?`,body:"Shots already made here keep their images. Their recipe will say this scene is gone, and building from one again will miss it.",busy:E,onConfirm:()=>void F()})]}),j.length>0&&o.jsx(Tu,{label:`Shots made in ${S.name}`,children:j.map(G=>o.jsx(ww,{node:G,to:Yp(u,null,G.id)},G.id))}),N.length>0&&o.jsx(Tu,{label:"Other scenes, similar light",children:N.map(G=>o.jsx(F0,{scene:G,variant:"navigate",size:"slider",onOpen:b,href:_r(u,G.id)},G.id))}),D&&k&&o.jsx(sR,{name:k.name,categories:k.verticals,known:re,hint:"The verticals this place suits, so it surfaces where you work.",ways:I,wayChoices:U6,wayMax:rR,busy:L,error:$,onSave:G=>void z(G),onDismiss:()=>K(!1)}),w&&o.jsx(Wu,{src:w.src,kind:"scene",label:w.label,noun:S.name,onClose:()=>y(null)})]})})}function fse({draft:e,href:t,onDiscard:n,chosen:r,batching:a,onPick:i,batch:c}){return o.jsx(tR,{id:e.id,name:e.name.trim()||"Untitled presenter",hash:e.hash,drawing:!!e.drawing,state:hse(e),href:t,blank:o.jsx(dW,{size:44,weight:"thin"}),onDiscard:n,chosen:r,batching:a,onPick:i,batch:c})}function hse(e){return e.drawing?"Drawing":e.approved?e.approved===1?"Face ready":e.approved>=e.of?"Ready to save":`${e.approved} of ${e.of} views ready`:e.hash?"A face to decide":e.source==="photos"?"Photos added":"Not drawn yet"}function pse({suggested:e,busy:t,error:n,onConfirm:r,onDismiss:a}){const[i,c]=s.useState(e),u=s.useRef(null),f=s.useRef(!1),h=i.trim(),p=h.length>0;s.useEffect(()=>{f.current=!1},[e]),s.useEffect(()=>{t||(f.current=!1)},[t]);const m=()=>{!p||t||f.current||(f.current=!0,r(h))};return o.jsxs(Ts,{className:"sc-newdlg sc-pdetails",maxWidth:"min(420px, 94vw)",onDismiss:a,onOpenAutoFocus:v=>{v.preventDefault();const w=u.current;w&&(w.focus(),w.select())},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:"Duplicate presenter"}),o.jsx(As,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx("span",{"aria-hidden":!0,children:"×"})})})]}),o.jsxs("div",{className:"sc-newdlg-body",children:[o.jsxs("label",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Name"}),o.jsx("input",{ref:u,className:"sc-pdetails-field",value:i,dir:"auto",maxLength:60,onChange:v=>c(v.target.value),onKeyDown:v=>v.key==="Enter"&&m()})]}),n&&o.jsx("p",{className:"sc-assetform-err",children:n})]}),o.jsxs("div",{className:"sc-newdlg-foot",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:a,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:!p||t,"data-busy":t||void 0,onClick:m,children:t?"Duplicating":"Duplicate"})]})]})}const mse=60;function gse(e,t,n=mse){var c;const r=e.trim(),a=(((c=r.match(/^(.*?)(?: copy(?: \d+)?)?$/i))==null?void 0:c[1])??r).trim()||r,i=new Set(t.map(u=>u.trim().toLowerCase()).filter(Boolean));for(let u=1;u<1e4;u++){const f=u===1?" copy":` copy ${u}`,h=Math.max(1,n-f.length),p=`${a.slice(0,h).trimEnd()}${f}`;if(!i.has(p.toLowerCase()))return p}return`${a.slice(0,Math.max(1,n-5)).trimEnd()} copy`}const vse=8,u8="__bookmarked";function wse(){const{presenters:e,presenterCategories:t,presentersLoaded:n,presentersError:r,refetchPresenters:a,applyBrand:i,refreshBrands:c}=Rn(),{brand:u}=on(),f=Dn(),h=Xv(),{push:p}=ir(),{q:m,setQ:v,facets:w,setFacets:y,clearSearch:b,clear:k}=Tf(["category","bookmarked"]),S=w.category,C=w.bookmarked==="1",[j,N]=s.useState(()=>zu("presenter",u.id)),P=me=>N(dm("presenter",u.id,me)),$=dw(`${u.id}|${m}|${S??""}|${C?"1":""}`),R=cl(),E=s.useMemo(()=>Cf(u),[u]),[M,L]=fa(Dr.wallDensity,Bu),H=Ac(M),D=me=>L(me),K=pm(H),O=fm(H),_=me=>f(ha(u,me)),re=me=>f(Gp(u,me)),z=s.useMemo(()=>S?e.filter(me=>me.suitableCategories.includes(S)):e,[e,S]),F=s.useMemo(()=>z.filter(me=>vo(Qh(me),m)),[z,m]),Q=s.useRef(null),V=s.useRef(null),I=o.jsxs("button",{ref:V,type:"button",className:"sc-btn sc-btn-primary",onClick:()=>R("presenter"),children:[o.jsx(cr,{size:12})," Create presenter"]}),[B,Y]=s.useState([]),ae=s.useRef(0),X=s.useCallback(()=>{const me=++ae.current;return Me.presenterDrafts(u.id).then(_e=>{me===ae.current&&Y(_e.drafts.filter(U=>!U.presenterId))}).catch(()=>{}),()=>{me===ae.current&&ae.current++}},[u.id]),le=!!un({path:ut.presenterStudio}),{tasks:ke}=Va(),te=ke.filter(me=>me.id.startsWith("presenter:")).map(me=>`${me.id}:${me.state}:${me.percent??""}`).join("|");s.useEffect(()=>{if(!le)return X()},[le,X,te]);const be=s.useCallback(me=>{const _e=Math.max(0,B.findIndex(U=>U.id===me));G.current=_e,$.forget(me),Y(U=>U.filter(pe=>pe.id!==me)),Me.deletePresenterDraft(u.id,me).finally(()=>X())},[u.id,B,X,$.forget]),G=s.useRef(null);s.useEffect(()=>{var pe;const me=G.current;if(me===null)return;G.current=null;const _e=(pe=Q.current)==null?void 0:pe.querySelectorAll("[data-build] .sc-cardpuck"),U=_e!=null&&_e.length?_e[Math.min(me,_e.length-1)]:V.current??document.querySelector(".sc-new-go");U==null||U.focus()},[B]);const[J,ne]=s.useState(null),[W,he]=s.useState(!1),[Xe,tt]=s.useState(!1),ze=s.useCallback(me=>{const _e=B.find(U=>U.id===me);_e!=null&&_e.drawn?ne(_e):be(me)},[B,be]),[nt,ce]=s.useState(null),[ve,Pe]=s.useState(null),[ue,Ee]=s.useState(null),[Ke,ye]=s.useState(!1),[Se,Ie]=s.useState(null),[Be,Re]=s.useState(null),Ze=s.useCallback(me=>{const _e=E.find(U=>U.id===me);_e&&(Ie(null),ce(_e))},[E]),Qe=s.useCallback(me=>{const _e=E.find(U=>U.id===me);_e&&(Ie(null),Pe(_e))},[E]),lt=async me=>{if(!(!ve||Ke)){ye(!0),Ie(null);try{i((await Me.updatePresenter(u.id,ve.id,{name:me})).brand),Pe(null)}catch(_e){const U=nn(_e,"Could not rename this presenter");Ie([U.title,U.detail].filter(Boolean).join(" "))}finally{ye(!1)}}},Lt=s.useCallback(me=>{const _e=E.find(U=>U.id===me);_e&&Ee(_e)},[E]),Ut=s.useRef(null);s.useEffect(()=>{var pe;const me=Ut.current;if(me===null)return;Ut.current=null;const _e=(pe=Q.current)==null?void 0:pe.querySelectorAll(".sc-lookcard:not([data-build]) .sc-lookcard-more"),U=_e!=null&&_e.length?_e[Math.min(me,_e.length-1)]:V.current??document.querySelector(".sc-new-go");U==null||U.focus()},[e,u]);const Ct=async me=>{if(!(!nt||Ke)){ye(!0),Ie(null);try{const _e=await Me.duplicatePresenter(u.id,nt.id,me);i(_e.brand),ce(null),Re(_e.presenter.id)}catch(_e){const U=nn(_e,"Could not duplicate this presenter");Ie([U.title,U.detail].filter(Boolean).join(" "))}finally{ye(!1)}}},cn=async()=>{if(!(!ue||Ke)){Ut.current=Math.max(0,Fe.findIndex(me=>me.id===ue.id)),ye(!0);try{const me=await Me.deletePresenter(u.id,ue.id);i(me.brand),$.forget(ue.id),Ee(null)}catch(me){(me==null?void 0:me.status)===404?(await c(),$.forget(ue.id),Ee(null)):p(nn(me,"Could not delete this presenter"))}finally{ye(!1)}}};s.useEffect(()=>{var _e,U;if(!Be)return;(U=(_e=Q.current)==null?void 0:_e.querySelector(".sc-lookcard[data-just-added]"))==null||U.scrollIntoView({block:"nearest"});const me=window.setTimeout(()=>Re(null),1800);return()=>window.clearTimeout(me)},[Be]);const Fe=s.useMemo(()=>E.filter(me=>S?!me.suitableCategories.length||me.suitableCategories.includes(S):!0).filter(me=>vo(Qh(me),m)).filter(me=>C?j.includes(me.id):!0),[E,S,m,C,j]),it=!(E.length>0||B.length>0),St=[...E,...e].reduce((me,_e)=>me+(j.includes(_e.id)?1:0),0),xt=C&&St===0,Nt=xt&&it,Kt=xt&&!it,et=!C||Nt,gt=Fe.filter(me=>!C||Nt||j.includes(me.id)),ot=et&&B.length>0||gt.length>0,kn=s.useMemo(()=>!C||Nt?F:F.filter(me=>j.includes(me.id)),[F,C,Nt,j]),{visible:dt,remaining:Gt,showMore:Ft}=hw(kn,`${S??""}|${C?"keepers":""}|${Nt?"browse":""}|${m}`),en=e.length+E.length>0?"tabs":"none",Jt=s.useCallback(async me=>{const{failed:_e,error:U}=await sp(me,pe=>Me.deletePresenterDraft(u.id,pe));Y(pe=>pe.filter(Oe=>_e.includes(Oe.id)||!me.includes(Oe.id))),$.retain(_e),X(),U&&p(nn(U,"Could not discard these drafts"))},[u.id,X,$.retain,p]),se=()=>{const me=B.filter(_e=>$.ids.has(_e.id));me.some(_e=>_e.drawn)?me.length===1?ne(me[0]):he(!0):Jt(me.map(_e=>_e.id))},oe=()=>{const me=[...$.ids];me.length===1?Lt(me[0]):tt(!0)},we=[...$.ids],ge=$.kind==="presenter"&&we.length>0&&we.every(me=>j.includes(me)),ee=()=>N(Qv("presenter",u.id,we,!ge)),He=gm($.ids.size,ge,"presenters"),We=async()=>{if(Ke)return;const me=[...$.ids];ye(!0);try{const{failed:_e,error:U}=await sp(me,pe=>Me.deletePresenter(u.id,pe));await c(),$.retain(_e),tt(!1),U&&p(nn(U,"Could not delete these presenters"))}finally{ye(!1)}},Ue={key:"category",label:"Category",everyLabel:"All presenters",everyCount:e.length+E.length,selected:C?u8:S,onSelect:me=>y(me===u8?{bookmarked:"1",category:null}:{bookmarked:null,category:me}),options:[{value:u8,label:"Keepers",count:St},...t.map(me=>({value:me,label:me,count:[...E,...e].filter(_e=>!_e.suitableCategories.length||_e.suitableCategories.includes(me)).length}))]},Ge=o.jsx(wm,{title:"Presenters",filters:o.jsx(ym,{mode:en,group:Ue}),density:o.jsx(hm,{value:H,onChange:D}),search:e.length>=vse&&o.jsx(ld,{value:m,onChange:v,noun:"presenters",total:e.length})});return o.jsxs(Rf.Provider,{value:O,children:[o.jsx(is,{children:o.jsxs("main",{className:"sc-looks sc-presenters",id:"main","data-hero":it||void 0,onClick:$.onBlank,children:[!it&&Ge,ot&&o.jsxs("section",{className:"sc-owned",children:[o.jsx("div",{className:"sc-sec-head",children:o.jsx("h2",{className:"sc-sec-title",children:"Your presenters"})}),o.jsxs("div",{ref:Q,className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":O,style:K,children:[et&&B.map(me=>o.jsx(fse,{draft:me,href:Ui(u,me.id),onDiscard:ze,chosen:$.ids.has(me.id),batching:$.batching==="draft",onPick:$.picking("draft")?_e=>$.toggle("draft",_e):void 0,batch:$.kind==="draft"&&$.ids.has(me.id)?{count:$.ids.size,onAct:se}:null},me.id)),J&&o.jsx(Wn,{label:"Discard",title:`Discard ${J.name.trim()||"this unfinished presenter"}?`,body:"The views drawn so far are thrown away. Nothing was saved to the library.",open:!0,busy:!1,onOpenChange:me=>{me||ne(null)},onConfirm:()=>{be(J.id),ne(null)}}),gt.map(me=>o.jsx(B6,{presenter:me,variant:"use",size:"grid",onOpen:_,href:ha(u,me.id),onUse:h,onDuplicate:Ze,onEdit:re,onDelete:Lt,onRename:Qe,bookmarked:j.includes(me.id),onBookmark:P,fresh:me.id===Be,chosen:$.ids.has(me.id),batching:$.batching==="presenter",onPick:$.picking("presenter")?_e=>$.toggle("presenter",_e):void 0,batch:$.kind==="presenter"&&$.ids.has(me.id)?{count:$.ids.size,onAct:oe,onKeep:ee,allKept:ge}:null},me.id)),ve&&o.jsx(cw,{title:"Rename presenter",name:ve.name,maxLength:60,busy:Ke,error:Se,onConfirm:me=>void lt(me),onDismiss:()=>{Ke||Pe(null)}}),nt&&o.jsx(pse,{suggested:gse(nt.name,E.map(me=>me.name)),busy:Ke,error:Se,onConfirm:me=>void Ct(me),onDismiss:()=>{Ke||ce(null)}}),ue&&o.jsx(Wn,{label:"Delete presenter",title:`Delete ${ue.name}?`,body:"Shots already made with them keep their images and their recipe. Only future shots lose them.",open:!0,busy:Ke,onOpenChange:me=>{!me&&!Ke&&Ee(null)},onConfirm:()=>void cn()}),Xe&&o.jsx(Wn,{label:qr("presenter",$.ids.size).menu,title:`${qr("presenter",$.ids.size).menu}?`,body:"Shots already made with them keep their images and their recipe. Only future shots lose them.",open:!0,busy:Ke,onOpenChange:me=>{!me&&!Ke&&tt(!1)},onConfirm:()=>void We()}),W&&o.jsx(Wn,{label:qr("draft",$.ids.size).menu,title:`${qr("draft",$.ids.size).menu}?`,body:"The views drawn so far are thrown away. Nothing was saved to the library.",open:!0,busy:!1,onOpenChange:me=>{me||he(!1)},onConfirm:()=>{const me=[...$.ids];he(!1),Jt(me)}})]})]}),it&&n&&!r&&e.length>0&&o.jsx(io,{shape:"cold",title:o.jsxs(o.Fragment,{children:["Cast your own ",o.jsx("em",{children:"presenter"})]}),body:"Describe someone new, or add photos of a real person. They stay the same person in every image you make.",action:I}),ot&&n&&!r&&dt.length>0&&o.jsx("div",{className:"sc-sec-head sc-owned-divider",children:o.jsx("h2",{className:"sc-sec-title",children:"Scenri presenters"})}),!n&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":O,style:K,"aria-hidden":!0,children:o.jsx(QM,{size:"grid",count:8})}),n&&r&&o.jsx(io,{shape:"error",title:"Couldn't load the presenter library",body:"Something went wrong reaching the catalog.",onRetry:()=>a()}),it&&n&&!r&&e.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(fw,{label:"Or cast someone from ours"}),Ge]}),n&&!r&&dt.length>0&&o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":O,style:K,children:dt.map(me=>o.jsx(B6,{presenter:me,variant:"use",size:"grid",onOpen:_,href:ha(u,me.id),onUse:h,bookmarked:j.includes(me.id),onBookmark:P},me.id))}),n&&!r&&Kt&&o.jsx(io,{shape:"zero",title:"Nothing in Keepers yet",body:"Keep a presenter from its card and it stays here.",mark:lw,action:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>y({bookmarked:null}),children:"Browse every presenter"})}),n&&!r&&!Kt&&!kn.length&&e.length>0&&o.jsx(bm,{noun:"presenters",q:m,facet:C?"Keepers":S,onClearSearch:b,onClearAll:k}),n&&!r&&!e.length&&o.jsx(io,{shape:"zero",body:"The presenter library is still being cast. Check back soon."}),Gt>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:Ft,children:["Show ",Math.min(Gt,60)," more"]})})]})}),$.ids.size>0&&($.kind==="draft"||$.kind==="presenter")&&o.jsx("div",{className:"sc-wall-dock",children:o.jsx(uw,{count:$.ids.size,loaded:$.kind==="draft"?B.length:gt.length,tool:qr($.kind,$.ids.size).tool,icon:qr($.kind,$.ids.size).icon,danger:qr($.kind,$.ids.size).danger,onAct:$.kind==="draft"?se:oe,keep:$.kind==="presenter"?{label:He.tool,filled:ge,onAct:ee}:null,onClear:$.clear,onSelectAll:()=>$.selectAll($.kind==="draft"?"draft":"presenter",($.kind==="draft"?B:gt).map(me=>me.id))})}),o.jsx(dc,{})]})}const yse={portrait:"Face",identity:"Face",front:"Full body","three-quarter":"Three-quarter",back:"Back",left:"Left",right:"Right","left-profile":"Left","right-profile":"Right"},bse=["Front","Left","Right","Back"];function xse(){var ae;const{presenterId:e=""}=Bs(),{presenters:t,presentersLoaded:n,presentersError:r,refetchPresenters:a,applyBrand:i,refreshBrands:c,presenterCategories:u}=Rn(),{brand:f}=on(),h=Dn(),p=xm(),m=s.useRef(!1),v=Xv(),[w,y]=s.useState([]),[b,k]=s.useState(null),[S,C]=s.useState(null),j=VG(f,e),N=j??t.find(X=>X.id===e);Ec(N==null?void 0:N.name);const P=!!j;s.useEffect(()=>{let X=!0;if(y([]),!P)return Me.presenterFrames(e).then(le=>{X&&y(le.frames)}).catch(()=>{X&&y([])}),()=>{X=!1}},[e,P]);const $=!!un({path:ut.presenterEdit});s.useEffect(()=>{let X=!0;if(C(null),!(!P||$))return Me.presenterDrafts(f.id).then(le=>{if(!X)return;const ke=le.drafts.find(te=>te.presenterId===e);C((ke==null?void 0:ke.id)??null)}).catch(()=>{}),()=>{X=!1}},[f.id,e,P,$]);const R=((ae=f.json)==null?void 0:ae.characters)??[],E=R.find(X=>X.presenterId===e),M=R.find(X=>X.id===e),L=pw(f.id,[e??"",(E==null?void 0:E.id)??""]),[H,D]=s.useState(null),[K,O]=s.useState(!1),[_,re]=s.useState(!1),z=async X=>{if(j){O(!0),D(null);try{const le=await Me.updatePresenter(f.id,j.id,X);i(le.brand),re(!1)}catch(le){D(String(le.message??le))}finally{O(!1)}}},F=async()=>{if(!j||m.current)return;m.current=!0;const X=p(),le=Uo(f);O(!0);try{const ke=await Me.deletePresenter(f.id,j.id);i(ke.brand)}catch(ke){if((ke==null?void 0:ke.status)!==404){m.current=!1,X()&&(D(String(ke.message??ke)),O(!1));return}await c()}X()&&h(le,{replace:!0})},Q=Av(f,e);if(Q!==e)return o.jsx(fo,{to:ha(f,Q),replace:!0});if(!n&&!j)return o.jsx(is,{children:o.jsx("main",{className:"sc-lookpage",id:"main",children:o.jsx("div",{className:"sc-tplrow","aria-hidden":!0})})});if(r&&!j)return o.jsx(is,{children:o.jsxs("main",{className:"sc-lookpage",id:"main",children:[o.jsx("h1",{children:"Couldn't load this presenter"}),o.jsx("p",{className:"sc-lookpage-lede",children:"Something went wrong reaching the catalog."}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>a(),children:"Retry"})})]})});if(!N)return o.jsx(is,{children:o.jsxs("main",{className:"sc-lookpage",id:"main",children:[o.jsx("h1",{children:"This presenter isn't here anymore"}),o.jsx("p",{className:"sc-lookpage-lede",children:"They may have been removed from the catalog, or the link is out of date."}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx(_n,{className:"sc-btn sc-btn-primary",to:Uo(f),children:"Browse presenters"})})]})});const V=j?(Array.isArray(M==null?void 0:M.shots)?M.shots:[]).map((X,le)=>({src:Fr(X==null?void 0:X.file),label:yse[(X==null?void 0:X.angle)??""]??`Reference ${le+1}`,angle:typeof(X==null?void 0:X.angle)=="string"?X.angle:void 0})).filter(X=>!!X.src):w.length?w.map((X,le)=>({src:X,label:bse[le]??`Reference ${le+1}`})):N.previewUrl?[{src:N.previewUrl,label:"Preview"}]:[],I=Gp(f,e),B=ti(j??N),Y=[...new Set([...u,...Cf(f).flatMap(X=>X.suitableCategories??[])])].sort((X,le)=>X.localeCompare(le));return o.jsx(is,{children:o.jsxs("main",{className:"sc-lookpage sc-presenterpage",id:"main",children:[o.jsx(mw,{to:Uo(f),wall:"Presenters",where:j?"Yours":"Scenri library"}),B.src&&o.jsx("div",{className:"sc-presenterpage-avatar",children:o.jsx(d8,{src:sr(B.src,"small"),crop:B.crop})}),o.jsx("h1",{children:N.name}),N.suitableCategories.length>0&&o.jsx("ul",{className:"sc-lookpage-cats","aria-label":"Filed under",children:N.suitableCategories.map(X=>o.jsx("li",{className:"sc-chip","data-static":!0,children:X},X))}),N.descriptor&&o.jsx("p",{className:"sc-lookpage-lede",children:N.descriptor}),o.jsxs("div",{className:"sc-lookpage-acts",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>v(e),children:"Use in a shot"}),j&&o.jsx(_n,{className:"sc-btn sc-btn-ghost",to:I,children:S?"Continue editing":"Edit presenter"}),o.jsx(gw,{kind:"presenter",brandId:f.id,id:e}),j&&o.jsx(or,{label:"Edit name and details",children:o.jsx("button",{type:"button",className:"sc-icon-btn","aria-label":"Edit name and details","aria-haspopup":"dialog",onClick:()=>re(!0),children:o.jsx(ed,{size:17})})})]}),H&&o.jsx("p",{className:"sc-assetform-err",children:H}),V.length>0?o.jsx(yw,{count:V.length,label:"Reference set",className:"sc-refset-rail",trackClassName:"sc-refset",children:V.map(X=>o.jsxs("li",{children:[o.jsx("button",{type:"button",className:"sc-refset-tile","data-role":X.angle,"aria-label":`${X.label}, open`,onClick:()=>k(X),children:o.jsx(d8,{src:sr(X.src,"small")})}),o.jsx("span",{className:"sc-refset-lb","aria-hidden":!0,children:X.label})]},X.label))}):o.jsx(vw,{}),j&&j.sourceRefs.length>0&&o.jsxs("section",{className:"sc-presenterpage-sources",children:[o.jsx("p",{className:"sc-presenterpage-sources-lb",children:"From your photos"}),o.jsx("div",{className:"sc-presenterpage-sources-row",children:j.sourceRefs.map((X,le)=>o.jsx("button",{type:"button",className:"sc-presenterpage-source","aria-label":`Source photo ${le+1}, open`,onClick:()=>k({src:X,label:`Source photo ${le+1}`}),children:o.jsx(d8,{src:sr(X,"micro")})},X))})]}),j&&o.jsxs("div",{className:"sc-prec",children:[o.jsxs("p",{className:"sc-prec-note",children:[N.ageRange?`${N.ageRange} · `:"",j.source==="synthetic"?"Created in Scenri. Not a real person.":j.source==="photos"?"Built from your photographs.":"Saved in Scenri.",j.likeness?` Likeness confirmed ${new Date(j.likeness.attestedAt).toLocaleDateString()}.`:""]}),o.jsx(Wn,{label:"Delete presenter",title:`Delete ${j.name}?`,body:"Shots already made with them keep their images and their recipe. Only future shots lose them.",busy:K,onConfirm:()=>void F()})]}),L.length>0&&o.jsx(Tu,{label:`Shots featuring ${N.name}`,children:L.map(X=>o.jsx(ww,{node:X,to:Yp(f,null,X.id)},X.id))}),_&&j&&o.jsx(sR,{name:j.name,categories:N.suitableCategories,known:Y,hint:"The verticals they suit, so they surface where you work.",busy:K,error:H,onSave:X=>void z({name:X.name,suitableCategories:X.categories}),onDismiss:()=>re(!1)}),b&&o.jsx(Wu,{src:b.src,kind:"presenter",label:b.label,noun:N.name,onClose:()=>k(null)})]})})}function d8({src:e,crop:t}){const[n,r]=s.useState(!1);return n?o.jsx("span",{className:"sc-lookpage-ref-blank","aria-hidden":!0,children:o.jsx(Ws,{size:20})}):o.jsx("img",{src:e,alt:"",loading:"lazy",decoding:"async",...t?{"data-crop":t}:{},onError:()=>r(!0)})}function kse({placeholder:e,label:t,action:n="Send",scope:r,hint:a,value:i,onValue:c,allowEmpty:u,disabled:f,why:h,quiet:p,working:m,error:v,focusKey:w,onStop:y,stopping:b,onAttach:k,onAttachFiles:S,attachLabel:C,colour:j,refs:N,onSend:P}){const $=s.useRef(null),R=s.useRef(null),[E,M]=s.useState(void 0);s.useLayoutEffect(()=>{const I=$.current;if(!I)return;I.style.height="auto";const B=Number.parseFloat(getComputedStyle(I).maxHeight)||Number.POSITIVE_INFINITY;I.style.height=`${Math.min(I.scrollHeight,B)}px`,I.style.overflowY=I.scrollHeight>B?"auto":"hidden"},[i]);const[L,H]=s.useState(!1),D=wr(Ks);s.useEffect(()=>{if(!w||w===E||f||(M(w),D))return;const I=$.current;if(I==null||I.focus({preventScroll:!0}),I!=null&&I.value){I.select(),H(!0);const B=setTimeout(()=>H(!1),700);return()=>clearTimeout(B)}},[w,E,f,D]);const K=f||m,O=!!(j!=null&&j.hex)||!!(N!=null&&N.some(I=>!I.busy)),_=!i.trim()&&!u&&!O,re=()=>{K||_||P(i)},z=v?{text:v,tone:"alert"}:{text:(r==null?void 0:r.hint)??a??"",tone:r==null?void 0:r.tone},F=!!y&&(m||!i.trim()&&!O),Q=m||F?null:f&&h?h:_&&!f?"Nothing typed yet.":null,V=o.jsxs("button",{type:"button",className:"sc-convo-send","aria-disabled":(F?!!b:m||K||_)||void 0,"aria-busy":m||F||void 0,"data-stop":F||void 0,onClick:F?b?void 0:y:m?void 0:re,children:[o.jsx("span",{className:"sc-convo-send-ico",children:m||F?o.jsx("span",{className:"sc-convo-spin","aria-hidden":"true"}):o.jsx(gC,{size:17,weight:"bold"})}),F?b?"Stopping":"Stop":m?"Working":n]});return o.jsxs("div",{className:"sc-convo-composer",children:[o.jsxs("div",{className:"sc-convo-card","data-quiet":p||void 0,"data-flash":L||void 0,children:[(r==null?void 0:r.chip)&&o.jsx("div",{className:"sc-convo-scope-row",children:o.jsxs("span",{className:"sc-convo-scope",children:[r.chip.thumb?o.jsx("img",{src:r.chip.thumb,alt:""}):null,r.chip.label]})}),o.jsxs("div",{className:"sc-convo-field",children:[N==null?void 0:N.map(I=>o.jsxs("span",{className:"sc-token","data-kind":"image","data-busy":I.busy||void 0,dir:"ltr",children:[o.jsx("img",{src:I.src,alt:""}),o.jsx("span",{className:"sc-token-label",children:I.label}),o.jsx("button",{type:"button",className:"sc-convo-chip-x","aria-label":`Remove ${I.label}`,onClick:I.onRemove,children:o.jsx(jn,{size:11,weight:"bold"})})]},I.key)),j&&o.jsxs("span",{className:"sc-token","data-kind":"color","data-empty":j.hex?void 0:"",dir:"ltr",children:[o.jsxs(Zu,{className:"sc-convo-chip",triggerStyle:{background:"none"},value:j.hex??j.seed??"#808080",commitMode:"live",align:"start",label:j.hex?`${j.label}. Change the colour.`:"Pick a colour",onChange:j.onPick,children:[o.jsx("span",{className:"sc-token-swatch",style:j.hex?{background:j.hex}:void 0}),o.jsx("span",{className:"sc-token-label",children:j.label})]}),j.hex&&o.jsx("button",{type:"button",className:"sc-convo-chip-x","aria-label":"Remove colour",onClick:j.onClear,children:o.jsx(jn,{size:11,weight:"bold"})})]}),o.jsx("textarea",{ref:$,className:"sc-in",rows:1,maxLength:400,"aria-label":t,placeholder:j!=null&&j.hex&&!i?"":f&&h?h:e,value:i,disabled:f,onChange:I=>c(I.target.value),onKeyDown:I=>{I.key!=="Enter"||I.shiftKey||(I.preventDefault(),re())}})]}),o.jsxs("div",{className:"sc-convo-row",children:[(k||S)&&o.jsxs(o.Fragment,{children:[o.jsx(or,{label:K&&h?h:C??"Add photos",children:o.jsx("button",{type:"button",className:"sc-convo-attach","aria-label":C??"Add photos","aria-disabled":K||void 0,onClick:K?void 0:S?()=>{var I;return(I=R.current)==null?void 0:I.click()}:k,children:o.jsx(cr,{size:16,weight:"bold"})})}),S&&o.jsx("input",{ref:R,type:"file",accept:"image/*",hidden:!0,"aria-label":C??"Add a picture",onChange:I=>{const B=Array.from(I.target.files??[]).filter(Y=>Y.type.startsWith("image/"));I.target.value="",B.length&&S(B)}})]}),Q?o.jsx(or,{label:Q,children:V}):V]})]}),z.text?o.jsx("small",{className:"sc-convo-line",role:z.tone==="alert"?"alert":void 0,"data-tone":z.tone,children:z.text}):null]})}function iR({glyph:e,lead:t,hint:n}){return o.jsxs("div",{className:"sc-pstudio-empty",children:[o.jsxs("span",{className:"sc-pstudio-empty-mark","aria-hidden":!0,children:[o.jsx("span",{className:"sc-pstudio-empty-ring","data-at":"far"}),o.jsx("span",{className:"sc-pstudio-empty-ring","data-at":"near"}),e]}),t&&o.jsxs("span",{className:"sc-pstudio-empty-say",children:[o.jsx("span",{children:t}),n&&o.jsx("span",{children:n})]})]})}const y5=500,lR=400,cR=760,ru=e=>Math.min(cR,Math.max(lR,Math.round(e)));function Sse({title:e,headAction:t,stage:n,body:r,bodyProps:a,foot:i,overlay:c,kind:u,resizeLabel:f,onPaste:h,onDropFiles:p,onClose:m}){const v=s.useRef(null),[w,y]=s.useState(null);ow(w,"--sc-pstudio-dock-h"),s.useEffect(()=>{const j=N=>{N.key!=="Escape"||N.defaultPrevented||(N.preventDefault(),m())};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[m]);const[b,k]=fa(Dr.pstudioRailW,y5),S=s.useRef(0),C=s.useRef(0);return Rr.createPortal(o.jsx(Yu,{trapped:!0,loop:!0,asChild:!0,onMountAutoFocus:j=>{var N;j.preventDefault(),(N=v.current)==null||N.focus({preventScroll:!0})},children:o.jsxs("div",{ref:v,tabIndex:-1,className:"sc-pstudio","data-kind":u,style:{"--sc-pstudio-rail-set":`${ru(b)}px`},role:"dialog","aria-modal":"true","aria-labelledby":"sc-pstudio-title",onDragOver:j=>{p&&Array.from(j.dataTransfer.types).includes("Files")&&j.preventDefault()},onDrop:j=>{var P;if(!p||j.defaultPrevented)return;const N=Array.from(((P=j.dataTransfer)==null?void 0:P.files)??[]);N.length&&(j.preventDefault(),p(N))},onPaste:j=>{var P;if(!h)return;const N=Array.from(((P=j.clipboardData)==null?void 0:P.files)??[]).filter($=>$.type.startsWith("image/"));N.length&&(j.preventDefault(),h(N))},children:[o.jsxs("div",{className:"sc-pstudio-grid",children:[o.jsx("div",{className:"sc-pstudio-resize",role:"separator","aria-orientation":"vertical","aria-label":f,"aria-valuemin":lR,"aria-valuemax":cR,"aria-valuenow":ru(b),tabIndex:0,onPointerDown:j=>{j.button===0&&(j.preventDefault(),j.stopPropagation(),j.currentTarget.setPointerCapture(j.pointerId))},onPointerMove:j=>{if(!j.currentTarget.hasPointerCapture(j.pointerId))return;const N=j.currentTarget.closest(".sc-pstudio");S.current=j.clientX,!C.current&&(C.current=requestAnimationFrame(()=>{C.current=0,N==null||N.style.setProperty("--sc-pstudio-rail-set",`${ru(window.innerWidth-S.current)}px`)}))},onPointerUp:j=>{j.currentTarget.releasePointerCapture(j.pointerId),C.current&&(cancelAnimationFrame(C.current),C.current=0),k(ru(window.innerWidth-j.clientX))},onDoubleClick:()=>k(y5),onKeyDown:j=>{if(j.key==="ArrowLeft")k(N=>ru(N+16));else if(j.key==="ArrowRight")k(N=>ru(N-16));else return;j.preventDefault()}}),o.jsx(or,{label:"Close (esc)",children:o.jsx("button",{type:"button",className:"sc-pstudio-close",onClick:m,"aria-label":"Close",children:o.jsx(jn,{size:13})})}),o.jsxs("div",{className:"sc-pstudio-head sc-newdlg-head",children:[o.jsx("h2",{id:"sc-pstudio-title",className:"sc-newdlg-title",children:e}),t,o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close",onClick:m,"aria-label":"Close",children:o.jsx(jn,{size:16})})]}),o.jsxs("div",{className:"sc-pstudio-scroll",children:[n,o.jsx("div",{className:"sc-pstudio-body",...a,children:r})]}),o.jsx("div",{className:"sc-pstudio-foot sc-dock",ref:y,children:i})]}),c]})}),document.body)}function Ese({hash:e,alt:t,drawing:n,since:r,items:a,onPick:i,compare:c,doing:u,takes:f,onTake:h,empty:p,glyph:m}){const v=Cse(n),[w,y]=s.useState(null),b=f??[],k=Math.max(0,b.findIndex(M=>w?M.hash===w:M.current)),S=b[k];s.useEffect(()=>y(null),[e]);const C=jse(w&&b.some(M=>M.hash===w)?w:e),[j,N]=s.useState(void 0);s.useEffect(()=>N(void 0),[e]);const P=M=>{const L=b[k+M];L&&y(L.hash)},$=s.useRef(null),[R,E]=s.useState(!1);return s.useLayoutEffect(()=>{const M=$.current;E(!(M!=null&&M.complete&&M.naturalWidth))},[C]),o.jsxs("div",{className:"sc-pstudio-stage",children:[o.jsx("div",{className:"sc-pstudio-wrap",children:o.jsxs("div",{className:"sc-pstudio-well","data-drawing":n||void 0,"data-empty":!e||void 0,style:j?{"--sc-well-ar":j}:void 0,children:[e&&C?o.jsx("img",{ref:$,src:Mr(C),srcSet:`${dn(C,"tile")} 640w, ${Mr(C)} 1024w`,sizes:"(max-width: 767px) 92vw, 44vw",alt:t,decoding:"async","data-waiting":R||void 0,onLoad:M=>{const L=M.currentTarget;E(!1),L.naturalWidth&&L.naturalHeight&&N(L.naturalWidth/L.naturalHeight)}}):o.jsx("span",{className:"sc-pstudio-well-blank",children:!n&&o.jsx(iR,{glyph:m,lead:p==null?void 0:p.lead,hint:p==null?void 0:p.hint})}),n&&!e&&o.jsx("span",{className:"sc-shimmer","aria-hidden":!0}),n&&e&&o.jsx("span",{className:"sc-pstudio-veil","aria-hidden":!0}),n&&o.jsxs("span",{className:"sc-pstudio-doing",role:"status",children:[o.jsx("span",{className:"sc-pstudio-ring","aria-hidden":!0}),o.jsx("span",{children:u??"Drawing"}),r&&o.jsx("time",{children:ac(r,v)})]}),b.length>1&&!n&&!(c!=null&&c.on)&&o.jsxs("div",{className:"sc-pstudio-vers",children:[o.jsx("button",{type:"button",className:"sc-pstudio-vers-step","aria-label":"The version before","aria-disabled":k===0||void 0,onClick:()=>k>0&&P(-1),children:o.jsx(ga,{size:13,weight:"bold"})}),o.jsxs("span",{className:"sc-pstudio-vers-n","aria-live":"polite",children:["Version ",(S==null?void 0:S.n)??1," of ",b.length]}),o.jsx("button",{type:"button",className:"sc-pstudio-vers-step","aria-label":"The version after","aria-disabled":k===b.length-1||void 0,onClick:()=>k<b.length-1&&P(1),children:o.jsx(il,{size:13,weight:"bold"})}),S&&!S.current&&h&&o.jsx("button",{type:"button",className:"sc-pstudio-vers-put",onClick:()=>h(S.hash),children:"Put back"}),(S==null?void 0:S.current)&&o.jsx("span",{className:"sc-pstudio-vers-on",children:"Active"})]}),c&&!n&&o.jsx("button",{type:"button",className:"sc-pstudio-compare","aria-pressed":c.on,onClick:c.toggle,children:c.on?"Showing current":"Compare"})]})}),a.length>0&&o.jsx("ol",{className:"sc-pstudio-strip","aria-label":"Views",children:a.map(M=>{const L=M.label+(M.approved?", used":M.state==="stale"?", to be drawn again":"")+(M.photo?", your photo":"")+(M.drawing?", drawing":"")+(M.error?", failed":"");return o.jsxs("li",{children:[o.jsx("button",{type:"button",className:"sc-pstudio-slot","data-state":M.state,"data-view":M.view,"aria-current":M.state==="current"?"step":void 0,"aria-label":L,disabled:!i,onClick:()=>i==null?void 0:i(M.view),children:o.jsxs("span",{className:"sc-pstudio-slot-inner",children:[M.hash?o.jsx("img",{src:dn(M.hash,"micro"),alt:""}):null,M.drawing&&!M.hash?o.jsx("span",{className:"sc-shimmer","aria-hidden":!0}):null,M.drawing&&M.hash?o.jsx("span",{className:"sc-pstudio-slot-work sc-pstudio-ring","aria-hidden":!0}):null,M.approved&&!M.drawing?o.jsx("span",{className:"sc-pstudio-slot-mark","aria-hidden":!0,children:o.jsx(Kn,{size:11,weight:"bold"})}):null,M.error&&!M.drawing?o.jsx("span",{className:"sc-pstudio-slot-mark","data-tone":"alert","aria-hidden":!0,children:o.jsx(Wp,{size:11,weight:"bold"})}):null]})}),o.jsx("span",{className:"sc-pstudio-slot-lb","data-on":M.state==="current"||void 0,"aria-hidden":!0,children:M.label})]},M.view)})})]})}function Cse(e){const[t,n]=s.useState(()=>Date.now());return s.useEffect(()=>{if(!e)return;n(Date.now());const r=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(r)},[e]),t}function jse(e){const[t,n]=s.useState(e);return s.useEffect(()=>{if(!e||e===t){e||n(void 0);return}let r=!0;const a=()=>{r&&n(e)},i=new Image;i.srcset=`${dn(e,"tile")} 640w, ${Mr(e)} 1024w`,i.sizes="(max-width: 767px) 92vw, 44vw",i.src=Mr(e),i.decode?i.decode().then(a,a):(i.onload=a,i.onerror=a);const c=window.setTimeout(a,3e3);return()=>{r=!1,window.clearTimeout(c)}},[e,t]),t}function bw({surface:e,onClose:t}){var p,m,v;const n=wr(Ks),r=e,a=(p=r.stage)==null?void 0:p.onPick,i=a?w=>a(w):void 0,c=r.turns[r.turns.length-1],u=(c==null?void 0:c.kind)==="question"&&c.question.kind==="confirm"&&!c.question.quiet?c.question:null;s.useEffect(()=>{if(!u||r.busy)return;let w=!1;const y=b=>{if(b.key!=="Enter"||b.shiftKey||b.defaultPrevented||w)return;const k=b.target;k&&(k.tagName==="INPUT"||k.tagName==="TEXTAREA"||k.tagName==="BUTTON"||k.isContentEditable)||(b.preventDefault(),w=!0,r.onAnswer(u.id,{kind:"confirm",id:u.options[0].id}))};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[u,r.busy,r.onAnswer]);const f=r.glyph??o.jsx(fW,{size:32}),h=n?null:r.stage?o.jsx(Ese,{hash:r.stage.hash,alt:r.stage.alt,drawing:r.stage.drawing,since:r.stage.since,doing:r.stage.doing,takes:r.stage.takes,onTake:r.stage.onTake,items:r.stage.items,onPick:r.stage.onPick,compare:r.stage.compare,empty:r.stageEmpty,glyph:f}):o.jsx("div",{className:"sc-pstudio-stage","data-reserve":!0,children:o.jsx("div",{className:"sc-pstudio-wrap",children:o.jsx("div",{className:"sc-pstudio-well","data-empty":!0,children:o.jsx("span",{className:"sc-pstudio-well-blank",children:o.jsx(iR,{glyph:f,lead:(m=r.stageEmpty)==null?void 0:m.lead,hint:(v=r.stageEmpty)==null?void 0:v.hint})})})})});return o.jsx(Sse,{kind:r.kind??"presenter",title:r.title,headAction:r.headAction,resizeLabel:"Resize the conversation",onPaste:r.onPaste,onClose:t,overlay:r.overlay,stage:h,bodyProps:{"data-convo":!0},body:o.jsx($J,{turns:r.turns,busy:r.busy,working:r.working,memoryKey:r.memoryKey,resumed:r.resumed,onAnswer:r.onAnswer,onEdit:r.onEdit,onSaveEdit:r.onSaveEdit,onCancelEdit:r.onCancelEdit,onRestore:r.onRestore,onRetry:r.onRetry,onShow:i,onStarter:w=>(r.onStarter??r.onText)(w),onDescribe:r.onDescribe,onAttachFiles:r.onAttachRef}),foot:o.jsxs(o.Fragment,{children:[r.dock,r.composer&&o.jsx(kse,{quiet:!!r.composer.disabled&&!r.composer.working,placeholder:r.composer.placeholder,label:r.composer.label,action:r.composer.action,scope:r.composer.scope,hint:r.composer.hint,value:r.text,onValue:r.onText,allowEmpty:r.composer.allowEmpty,disabled:r.composer.disabled,why:r.composer.why,working:r.composer.working,error:r.composer.error,focusKey:r.composer.focusKey,onAttach:r.composer.onAttach,onAttachFiles:r.composer.onAttachFiles,attachLabel:r.composer.attachLabel,colour:r.composer.colour,refs:r.composer.refs,onStop:r.composer.onStop,stopping:r.composer.stopping,onSend:r.onSend})]})})}const cd=[{id:"glasses",label:"Glasses",ask:"What glasses do they wear?",options:[{id:"thin black rectangular metal frames",label:"Thin black",card:"glasses-1"},{id:"round thin gold metal frames",label:"Round metal",card:"glasses-2"},{id:"clear transparent acetate frames",label:"Clear acetate",card:"glasses-3"},{id:"bold thick black rectangular acetate frames",label:"Bold rectangular",card:"glasses-4"},{id:"tortoiseshell acetate frames",label:"Tortoiseshell",card:"glasses-5"},{id:"rimless frames with thin temples",label:"Rimless",card:"glasses-6"}],saying:"Describe the glasses",refHint:"A clear front or three-quarter view of the frames."},{id:"freckles",label:"Freckles or marks",ask:"What marks their skin?",options:[{id:"light freckles across the nose and cheeks",label:"Light freckles",card:"freckles-1"},{id:"dense freckles across the whole face",label:"Dense freckles",card:"freckles-2"},{id:"freckles across the face and shoulders",label:"Face and shoulders",card:"freckles-3"},{id:"a small birthmark on one cheek",label:"Birthmark",card:"freckles-4"},{id:"a beauty mark above the lip",label:"Beauty mark",card:"freckles-5"}],saying:"Describe it",refHint:"A clear, close photograph of it."},{id:"makeup",label:"Makeup",ask:"What makeup do they wear?",options:[{id:"natural, barely-there makeup",label:"Natural",card:"makeup-1"},{id:"black winged eyeliner",label:"Winged liner",card:"makeup-2"},{id:"a soft smoky eye",label:"Smoky eye",card:"makeup-3"},{id:"a bold red lip",label:"Bold red lip",card:"makeup-4"},{id:"soft glamorous makeup with a warm shimmer",label:"Soft glam",card:"makeup-5"},{id:"strong defined brows and a nude lip",label:"Strong brows",card:"makeup-6"}],saying:"Describe the makeup",refHint:"A clear face photograph showing the look."},{id:"scar",label:"Scar",ask:"What scar do they have?",options:[{id:"a thin pale scar through one eyebrow",label:"Through an eyebrow",card:"scar-1"},{id:"a small pale scar on one cheek",label:"On a cheek",card:"scar-2"},{id:"a small scar on the chin",label:"On the chin",card:"scar-3"},{id:"a fine scar along the jaw",label:"Along the jaw",card:"scar-4"},{id:"a small scar beside one eye",label:"Beside an eye",card:"scar-5"},{id:"a faded scar across the bridge of the nose",label:"Across the nose",card:"scar-6"}],saying:"Describe the scar",refHint:"A clear, close photograph of it."},{id:"piercing",label:"Piercing",ask:"What piercing do they wear?",options:[{id:"a small silver nose stud",label:"Nose stud",card:"piercing-1"},{id:"a silver septum ring",label:"Septum ring",card:"piercing-2"},{id:"a small silver hoop through one eyebrow",label:"Eyebrow hoop",card:"piercing-3"},{id:"several small silver hoops in one ear",label:"Ear hoops",card:"piercing-4"},{id:"a small silver lip ring",label:"Lip ring",card:"piercing-5"},{id:"a row of small silver studs up one ear",label:"Ear studs",card:"piercing-6"}],saying:"Describe the piercing",refHint:"A clear photograph of the jewellery."},{id:"tattoo",label:"Tattoo",ask:"What is their tattoo?",options:[{id:"a fine-line botanical tattoo",label:"Fine line",card:"tattoo-1"},{id:"a small geometric line tattoo",label:"Geometric",card:"tattoo-2"},{id:"a floral tattoo in soft grey shading",label:"Floral",card:"tattoo-3"},{id:"a bold traditional red rose tattoo with heavy black linework",label:"Traditional",card:"tattoo-4"},{id:"a solid blackwork snake tattoo in heavy black ink",label:"Blackwork",card:"tattoo-5"},{id:"a small script tattoo in thin lettering",label:"Script",card:"tattoo-6"}],saying:"Describe the tattoo",refHint:"A clear photograph of the design itself.",where:{ask:"And where is it?",options:[{id:"on their right forearm",label:"Right forearm"},{id:"on their left forearm",label:"Left forearm"},{id:"on their right upper arm",label:"Right upper arm"},{id:"on their left upper arm",label:"Left upper arm"},{id:"on one shoulder",label:"Shoulder"},{id:"on the side of their neck",label:"Neck"},{id:"on their hand",label:"Hand"},{id:"on their back",label:"Back"}]}},{id:"prosthetic",label:"Prosthetic limb",ask:"What does their limb look like?",options:[{id:"a matte black mechanical prosthetic limb with dark articulated joints",label:"Matte black",card:"prosthetic-1"},{id:"a brushed steel mechanical prosthetic limb with dark articulated joints",label:"Brushed steel",card:"prosthetic-2"},{id:"a woven carbon fibre mechanical prosthetic limb with dark articulated joints",label:"Carbon fibre",card:"prosthetic-3"},{id:"a skin-tone mechanical prosthetic limb with dark articulated joints",label:"Skin tone",card:"prosthetic-4"},{id:"a glossy bright red mechanical prosthetic limb with dark articulated joints",label:"Red",card:"prosthetic-5"},{id:"a matte white mechanical prosthetic limb with dark articulated joints",label:"Matte white",card:"prosthetic-6"}],saying:"Describe it",refHint:"A clear photograph showing its shape and finish.",where:{ask:"And which limb?",options:[{id:"in place of their left arm",label:"Left arm"},{id:"in place of their right arm",label:"Right arm"},{id:"in place of their left leg",label:"Left leg"},{id:"in place of their right leg",label:"Right leg"},{id:"in place of their left hand",label:"Left hand"},{id:"in place of their right hand",label:"Right hand"}]}}],va=e=>cd.find(t=>t.id===e),Ase=/\b(forearm|upper arm|arm|shoulder|neck|throat|hand|wrist|back|chest|ribs|thigh|leg|calf|ankle|foot|cheek|eyebrow|brow|chin|lip|nose|ear|temple|jaw|collarbone)\b/i;function uR(e){return Ase.test(e??"")}function Nse(e,t){var a,i,c;const n=((a=t.words)==null?void 0:a.trim())??"",r=((i=t.where)==null?void 0:i.trim())??"";return n?r&&!uR(n)?`${n} ${r}`:n:r?`${((c=va(e))==null?void 0:c.label.toLowerCase())??e} ${r}`:""}function b5(e,t){const n=(t??[]).filter(r=>/\b(left|right)\b/i.test(r.words)&&(e==="front"||!Mse.has(r.id)));if(n.length)return`Check the side: ${n.map(r=>r.words).join("; ")}. Facing you, their right is on your left.`}const Mse=new Set(["tattoo","prosthetic"]),km=["who","age","heritage","skin","hair","length","facial","eyes","build","height"],oc="either",ic=e=>{var t,n;return[(e==null?void 0:e.pick)===oc?"":(t=e==null?void 0:e.pick)==null?void 0:t.trim(),(n=e==null?void 0:e.words)==null?void 0:n.trim()].filter(Boolean).join(", ")},dR=e=>{var t;return!!(e!=null&&e.pick||(t=e==null?void 0:e.words)!=null&&t.trim())},Sm=e=>{var t;return((t=e.source)==null?void 0:t.door)==="scratch"},W6=e=>{var t;return Sm(e)&&((t=e.source)==null?void 0:t.via)==="taps"},Em=e=>{var t;return Sm(e)&&((t=e.source)==null?void 0:t.via)!=="taps"},Cm=e=>{var t;return((t=e.source)==null?void 0:t.door)==="photos"},Rse=/\b(slim|slender|athletic|average|fuller|curvy|broad|lean|muscular|petite|stocky|heavy|thin|plus.size)\b/i;function xw(e){const t=e.trim(),n=t.split(/\s+/).filter(Boolean).length,r=[];return Oh.test(t)||r.push("who"),wv.test(t)||r.push("age"),r.length&&!Rse.test(t)&&n<8&&r.push("build"),r}const Pse=(e,t)=>km.every(n=>!wR(`look-${n}`,e,t)||e[`look-${n}`]!==void 0),fR=e=>Em(e)&&e.describe!==void 0&&xw(e.describe).length>0,Lse=e=>Em(e)&&e.describe!==void 0&&(!fR(e)||e.gaps!==void 0),Tse=(e,t)=>{var n;return Cm(e)&&!!t.draft&&t.draft.source==="photos"&&t.canGenerate&&t.draft.stage!=="analyzing"&&(e.traits!==void 0||!((n=t.draft.keep)!=null&&n.trim()))},hR=(e,t)=>W6(e)?Pse(e,t):Em(e)?Lse(e):Tse(e,t),$se=(e,t)=>Sm(e)||Cm(e)&&!!t.draft,pR=e=>t=>{var n;return!!((n=t.traits)!=null&&n.includes(e))},mR=e=>t=>dR(t[`trait-${e}`]),gR=e=>t=>{var n;return pR(e)(t)&&mR(e)(t)&&!!((n=va(e))!=null&&n.where)&&!uR(ic(t[`trait-${e}`]))},nh=(e,t)=>Array.isArray(e)&&e.includes(t),Dse=(e,t)=>{var n;return hR(e,t)&&(((n=e.traits)==null?void 0:n.every(r=>mR(r)(e)&&(!gR(r)(e)||e[`trait-${r}-where`]!==void 0)))??!1)},Hse=(e,t)=>JSON.stringify(e)!==JSON.stringify(t),Ose=(e,t)=>{var r;if(!Cm(e)||!t.draft||t.draft.stage==="analyzing"||t.draft.views.portrait.status!=="empty")return!1;const n=((r=t.draft.analysis)==null?void 0:r.photos)??[];return n.length>0&&n.every(a=>a.usable===!1)},Xo=[{id:"source",applies:()=>!0},{id:"photos",applies:Cm},{id:"weakphotos",applies:Ose},...km.map(e=>({id:`look-${e}`,applies:e==="facial"?t=>{var n;return W6(t)&&((n=t["look-who"])==null?void 0:n.pick)!=="woman"}:W6})),{id:"describe",applies:Em},{id:"gaps",applies:fR,dependsOn:[{on:"describe"}]},{id:"traits",applies:$se,ready:hR},...cd.flatMap(e=>[{id:`trait-${e.id}`,applies:pR(e.id),dependsOn:[{on:"traits",changed:(t,n)=>nh(t,e.id)!==nh(n,e.id)}]},{id:`trait-${e.id}-where`,applies:gR(e.id),dependsOn:[{on:`trait-${e.id}`,changed:(t,n)=>ic(t)!==ic(n)},{on:"traits",changed:(t,n)=>nh(t,e.id)!==nh(n,e.id)}]}]),{id:"keep",applies:Sm,ready:Dse,optional:!0,sticky:!0}],vR=new Map(Xo.map(e=>[e.id,e])),Ise=Xo.map(e=>e.id),_0=e=>{const t=Xo.findIndex(n=>n.id===e);return t<0?Xo.length:t},Fse=e=>vR.get(e);function wR(e,t,n){return Fse(e).applies(t,n)}function yR(e,t,n){if(e==="photos")return!!n.draft&&n.draft.source==="photos";const r=t[e];return r===void 0?!1:rr(e)||Zse(e)?dR(r):!0}function bR(e,t){return Xo.filter(n=>n.applies(e,t)&&yR(n.id,e,t)).map(n=>n.id)}function jm(e,t){var n;return((n=Xo.find(r=>{var a;return!r.optional&&r.applies(e,t)&&(((a=r.ready)==null?void 0:a.call(r,e,t))??!0)&&!yR(r.id,e,t)}))==null?void 0:n.id)??null}function x5(e,t,n){const r={...e},a=new Set,i=new Set(Object.keys(t));for(const[u,f]of Object.entries(t))Hse(e[u],f)&&(f===void 0?delete r[u]:r[u]=f,a.add(u));if(a.size){const u=Xo.map(m=>m.id),f=Math.min(...[...a].map(m=>u.indexOf(m))),h=new Set(a),p=m=>(m.dependsOn??[]).some(v=>h.has(v.on));for(const m of Xo)u.indexOf(m.id)<=f||i.has(m.id)||r[m.id]===void 0||m.sticky||p(m)||(delete r[m.id],a.add(m.id))}let c=!0;for(;c;){c=!1;for(const u of Xo){if(r[u.id]===void 0)continue;(!i.has(u.id)&&(u.dependsOn??[]).some(h=>a.has(h.on)&&(h.changed?h.changed(e[h.on],r[h.on]):!0))||!u.applies(r,n))&&(delete r[u.id],a.add(u.id),c=!0)}}return r}function _se(e){const t={};for(const n of e.traits??[]){const r=e[`trait-${n}`];r&&(t[n]={words:ic(r)||void 0,where:ic(e[`trait-${n}-where`])||void 0,refs:r.refs.length?r.refs:void 0})}return t}function xR(e){const t={};for(const n of km){const r=e[`look-${n}`];r!==void 0&&(t[n]=r)}return t}const kR=e=>cd.map(t=>t.id).filter(t=>e.includes(t)),rr=e=>e.startsWith("look-"),Zse=e=>e.startsWith("trait-"),_s=e=>vR.has(e);function Jr(e){if(!e.startsWith("trait-"))return null;const t=e.endsWith("-where"),n=t?e.slice(6,-6):e.slice(6);return va(n)?{id:n,part:t?"where":"what"}:null}const Vse=[{to:8,name:"red"},{to:16,name:"scarlet"},{to:30,name:"orange"},{to:36,name:"amber"},{to:46,name:"gold"},{to:64,name:"yellow"},{to:80,name:"lime"},{to:95,name:"yellow-green"},{to:158,name:"green"},{to:172,name:"sea green"},{to:183,name:"teal"},{to:196,name:"cyan"},{to:205,name:"sky blue"},{to:215,name:"azure"},{to:240,name:"blue"},{to:252,name:"indigo"},{to:268,name:"violet"},{to:285,name:"purple"},{to:300,name:"orchid"},{to:318,name:"magenta"},{to:330,name:"fuchsia"},{to:342,name:"pink"},{to:352,name:"rose"},{to:360,name:"red"}],zse=[{to:.05,name:"black"},{to:.16,name:"charcoal"},{to:.32,name:"dark grey"},{to:.62,name:"grey"},{to:.76,name:"light grey"},{to:.88,name:"silver"},{to:.96,name:"off-white"},{to:1.01,name:"white"}],Bse=new Set(["black","charcoal","dark grey","grey","light grey","silver","off-white","white","dark brown","brown","chestnut","auburn","copper","tan","beige","cream","amber","gold","blonde"]),Use=e=>{const t=String(e??"").replace("#","").trim();return(t.length===3?t.split("").map(r=>r+r):[t.slice(0,2),t.slice(2,4),t.slice(4,6)]).map(r=>{const a=Number.parseInt(r,16);return Number.isFinite(a)?a:0})};function Wse(e){const[t,n,r]=Use(e),a=t/255,i=n/255,c=r/255,u=Math.max(a,i,c),f=Math.min(a,i,c),h=(u+f)/2,p=u-f;if(p===0)return{h:0,s:0,l:h};const m=p/(1-Math.abs(2*h-1));return{h:((u===a?60*((i-c)/p%6):u===i?60*((c-a)/p+2):60*((a-i)/p+4))+360)%360,s:m,l:h}}const Kse=e=>{var t;return((t=Vse.find(n=>e<n.to))==null?void 0:t.name)??"red"};function Gse(e,t,n){return e==="orange"||e==="amber"||e==="scarlet"?n<.2?"dark brown":n<.32?e==="scarlet"?"chestnut":"brown":n>=.86&&t<.6?"cream":n>=.72&&t<.6?"beige":n<.44&&t<.7?"brown":n<.62&&t<.55?"tan":null:(e==="gold"||e==="yellow")&&n<.42?"olive":(e==="indigo"||e==="violet"||e==="purple")&&n>=.72&&t<.7?"lavender":(e==="blue"||e==="azure"||e==="indigo")&&n<.22?"navy":e==="red"&&n<.34?t<.55?"burgundy":"maroon":e==="rose"&&n<.34?"burgundy":null}function Yse(e){return e<.18?"deep":e<.34?"dark":e>=.88?"pale":e>=.74?"light":""}function SR(e){var u;const{h:t,s:n,l:r}=Wse(e);if(n<.09){const f=((u=zse.find(h=>r<h.to))==null?void 0:u.name)??"grey";return{name:f,family:f,h:t,s:n,l:r}}const a=Kse(t),i=Gse(a,n,r);if(i){const f=r<.12?"deep":r>=.93?"pale":"";return{name:f?`${f} ${i}`:i,family:i,h:t,s:n,l:r}}const c=Yse(r);return c?{name:`${c} ${a}`,family:a,h:t,s:n,l:r}:n<.22?{name:`muted ${a}`,family:a,h:t,s:n,l:r}:n>.85&&r>.4&&r<.65?{name:`vivid ${a}`,family:a,h:t,s:n,l:r}:{name:a,family:a,h:t,s:n,l:r}}function qse(e){const{family:t,h:n,s:r,l:a}=SR(e);return Bse.has(t)?!0:n>=16&&n<=60&&a>=.7&&r<.7||r<.09}const kw=[{id:"black",label:"Black",color:"#15120f"},{id:"dark brown",label:"Dark brown",color:"#3b2418"},{id:"brown",label:"Brown",color:"#6b4630"},{id:"auburn",label:"Auburn",color:"#8c3b26"},{id:"ginger",label:"Ginger",color:"#c2622a"},{id:"blonde",label:"Blonde",color:"#d8ac63"},{id:"platinum blonde",label:"Platinum",color:"#e9e1d0"},{id:"grey",label:"Grey",color:"#9b9b99"},{id:"white",label:"White",color:"#f0efed"}],ER=[{id:"buzzed",label:"Buzzed",card:"length-1"},{id:"cropped",label:"Cropped",card:"length-2"},{id:"short",label:"Short",card:"length-3"},{id:"chin-length",label:"Chin",card:"length-4"},{id:"shoulder-length",label:"Shoulder",card:"length-5"},{id:"long",label:"Long",card:"length-6"}],Sw=[{id:"porcelain",label:"Porcelain",color:"#f4e0d4"},{id:"fair",label:"Fair",color:"#edcdb6"},{id:"light olive",label:"Light olive",color:"#ddb894"},{id:"olive",label:"Olive",color:"#c2935f"},{id:"tan",label:"Tan",color:"#a9713f"},{id:"brown",label:"Brown",color:"#7c4f2c"},{id:"deep brown",label:"Deep brown",color:"#57351d"},{id:"deep",label:"Deep",color:"#3a2114"}],CR=[{id:"slight",label:"Slight",card:"build-1"},{id:"lean",label:"Lean",card:"build-2"},{id:"average",label:"Average",card:"build-3"},{id:"solid",label:"Solid",card:"build-4"},{id:"full",label:"Full",card:"build-5"}],Xse=[{id:"East Asian",label:"East Asian"},{id:"South Asian",label:"South Asian"},{id:"Southeast Asian",label:"Southeast Asian"},{id:"Middle Eastern",label:"Middle Eastern"},{id:"Mediterranean",label:"Mediterranean"},{id:"North African",label:"North African"},{id:"West African",label:"West African"},{id:"East African",label:"East African"},{id:"Northern European",label:"Northern European"},{id:"Eastern European",label:"Eastern European"},{id:"Latin American",label:"Latin American"},{id:"Caribbean",label:"Caribbean"},{id:"mixed heritage",label:"Mixed"}],Ew=[{id:"dark brown",label:"Dark brown",color:"#3b2a1d"},{id:"brown",label:"Brown",color:"#6b4423"},{id:"hazel",label:"Hazel",color:"#8a7340"},{id:"amber",label:"Amber",color:"#b07d1a"},{id:"green",label:"Green",color:"#5b7a4b"},{id:"blue",label:"Blue",color:"#4a7ba7"},{id:"grey",label:"Grey",color:"#8b949c"}],jR=[{id:"clean-shaven",label:"Clean shaven",card:"facial-1"},{id:"light stubble",label:"Stubble",card:"facial-2"},{id:"a moustache",label:"Moustache",card:"facial-3"},{id:"a goatee",label:"Goatee",card:"facial-4"},{id:"a short beard",label:"Short beard",card:"facial-5"},{id:"a full beard",label:"Full beard",card:"facial-6"}],AR=[{id:"very short",label:"Very short",card:"height-1"},{id:"short",label:"Short",card:"height-2"},{id:"average height",label:"Average",card:"height-3"},{id:"tall",label:"Tall",card:"height-4"},{id:"very tall",label:"Very tall",card:"height-5"}],Qse={},NR=[{id:"woman",label:"Woman"},{id:"man",label:"Man"},{id:"androgynous",label:"Androgynous"}],MR=["20s","30s","40s","50s","60+"].map(e=>({id:e,label:e})),$f={who:{row:{id:"who",label:"Who",options:NR},prompt:"Who are they?"},age:{row:{id:"age",label:"Age",options:MR},prompt:"Roughly how old?"},heritage:{row:{id:"heritage",label:"Heritage",options:Xse},prompt:"Where are they from?"},skin:{row:{id:"skin",label:"Skin",options:Sw},prompt:"And their skin?"},eyes:{row:{id:"eyes",label:"Eyes",options:Ew},prompt:"What colour are their eyes?"},facial:{row:{id:"facial",label:"Facial hair",options:jR},prompt:"Any facial hair?"},hair:{row:{id:"hair",label:"Hair",options:kw},prompt:"What colour is their hair?"},length:{row:{id:"length",label:"Length",options:ER},prompt:"And the length?"},build:{row:{id:"build",label:"Build",options:CR},prompt:"And their build?"},height:{row:{id:"height",label:"Height",options:AR},prompt:"And how tall?"}};km.map(e=>$f[e]);const k5=new Set(["hair","skin","eyes"]),Jse={who:"Who they are, in your words",age:"Their age, in words or a number",heritage:"Where they are from, in your words",hair:"Their hair colour, in words or a swatch",length:"Their cut, in your words",facial:"Their facial hair, in your words",eyes:"Their eye colour, in words or a swatch",skin:"Their skin, in words or a swatch",build:"Their build, in your words",height:"How tall they are, in your words"},eae=e=>e==="man"?"man":e==="woman"?"woman":"androgynous",tae=new Set(["length","height","build"]),nae=900;function Cw(e,t,n){const r=rae(e,t);if(r.far<nae)return r.id;const a=SR(e).name;return n==="hair"&&!qse(e)?`dyed ${a}`:a}function rae(e,t,n){const r=h=>{const p=h.replace("#","");return(p.length===3?p.split("").map(v=>v+v):[p.slice(0,2),p.slice(2,4),p.slice(4,6)]).map(v=>Number.parseInt(v,16)||0)},[a,i,c]=r(e);let u=t[0],f=Number.POSITIVE_INFINITY;for(const h of t){if(!h.color)continue;const[p,m,v]=r(h.color),w=(a-p)**2+(i-m)**2+(c-v)**2;w<f&&(f=w,u=h)}return{id:u.id,far:f}}const S5=e=>e==="skin"?Sw:e==="eyes"?Ew:kw,Eh=e=>e.charAt(0).toUpperCase()+e.slice(1);function RR(e){const t=H=>H!=null&&H.pick&&H.pick!==oc?H.pick:"",n=(H,D,K)=>{var _;const O=t(H);return O?O.startsWith("#")?Cw(O,D,K):O:((_=H==null?void 0:H.words)==null?void 0:_.trim())??""},r=H=>{var D;return t(H)?((D=H==null?void 0:H.words)==null?void 0:D.trim())??"":""},a=(H,...D)=>[H,...D.filter(Boolean)].join(" "),i=(H,D,K)=>n(H,D,K).toLowerCase(),c={androgynous:"androgynous person",man:"man",woman:"woman"},u=i(e.who,[]),f=c[u]??u,p=[n(e.heritage,[]),f].filter(Boolean).join(" "),v=[p?/^(a|an|the)\s/i.test(p)?p:`${/^[aeiou]/i.test(p)?"an":"a"} ${p}`:"a person"],w=i(e.age,[]),y=w==="60+"?"in their 60s or older":/^\d{1,3}$/.test(w)?`aged ${w}`:`in their ${w}`;w&&v.push(a(y,r(e.age)));const b=[],k=i(e.length,ER),S=i(e.hair,kw,"hair"),C=[k,S].filter(Boolean).join(" ");C&&b.push(a(`${C} hair`,r(e.length),r(e.hair)));const j=i(e.facial,jR);j&&b.push(a(j,r(e.facial)));const N=i(e.eyes,Ew);N&&b.push(a(`${N} eyes`,r(e.eyes)));const P=i(e.skin,Sw,"skin");P&&b.push(a(`${P} skin`,r(e.skin)));const $=i(e.height,AR),R=i(e.build,CR),E=$?a(Qse[$]??$,r(e.height)):"",M=R?a(`${/^[aeiou]/.test(R)?"an":"a"} ${R} build`,r(e.build)):"",L=[E,M&&(E?`with ${M}`:M)].filter(Boolean).join(" ");return L&&b.push(L),b.length&&v.push(`with ${b.join(", ")}`),a(v.join(" "),r(e.who))}function sae(e,t){var i,c;const n=t.pick,r=n===oc?"Either way":n!=null&&n.startsWith("#")?Eh(Cw(n,e.options,e.id)):n?((i=e.options.find(u=>u.id===n))==null?void 0:i.label)??Eh(n):"",a=((c=t.words)==null?void 0:c.trim())??"";return r?a?`${r}, ${a}`:r:Eh(a)}function aae(e){return Eh(RR(e))}const Z0=e=>typeof e=="string"&&e.startsWith("aside:"),oae=e=>e.slice(6),ap={answers:{},revision:0,editing:null,saying:null,says:0,text:"",colour:null,composing:null,asides:[],unsure:null,extrasDeclined:!1,uploading:0},iae="That did not read as a description of someone.",PR=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function lae(e){if(!e||e==="name")return null;if(e==="keep")return"keep";const t=Jr(e);return t&&t.part==="what"?`trait-${t.id}`:null}function E5(e,t){var r;const n=lae(t);return n?{id:n,refs:((r=e.answers[n])==null?void 0:r.refs)??[]}:null}function f8(e){const t=e.composing;if(!t)return e.answers;const n=e.answers[t.id];if(!n||PR(n.refs,t.refs))return e.answers;if(!ic(n)&&!t.refs.length){const r={...e.answers};return delete r[t.id],r}return{...e.answers,[t.id]:{...n,refs:t.refs}}}function cae(e,t){var r;if(!rr(t)&&!Jr(t))return;const n=e.answers[t];if(n)return{saying:t,text:n.words??"",colour:(r=n.pick)!=null&&r.startsWith("#")?{step:t,hex:n.pick}:null}}function K6(e,t,n,r){return e.filter(a=>!a.q||!_s(a.q)?!0:!wR(a.q,t,n)||a.edit&&t[a.q]!==void 0?!1:r===void 0||_0(a.q)<=r)}function uae(e){const t=Object.keys(e).filter(n=>_s(n));return t.length?Math.min(...t.map(_0)):void 0}function LR(e,t){if(!e.some(r=>r.at===t.at))return t;let n=1;for(;e.some(r=>r.at===`${t.at}#${n}`);)n+=1;return{...t,at:`${t.at}#${n}`}}function h8(e,t){const n=e.unsure;if(!n)return e;const r=jm(e.answers,t),a=u=>u&&(u===r||_s(u)&&e.answers[u]!==void 0)?u:null,i=e.asides.map(u=>u.q==="unsure"?{...u,q:a(n.q)}:u),c=LR(i,{said:n.said,reply:iae,q:a(n.q),at:n.at});return{...e,unsure:null,asides:K6([...i,c],e.answers,t)}}function dae(e,t){var n,r,a;switch(t.type){case"answer":{const i=x5(e.answers,t.patch,t.ctx),c=!PR(i,e.answers),u=h8(e,t.ctx);return{...u,answers:i,revision:c?e.revision+1:e.revision,asides:K6(u.asides,i,t.ctx,uae(t.patch)),editing:null,saying:null,colour:null,composing:null,text:""}}case"edit":{const i=Z0(t.id)||t.id==="name"?void 0:cae(e,t.id);return{...e,answers:f8(e),composing:Z0(t.id)?null:E5(e,t.id),editing:t.id,saying:(i==null?void 0:i.saying)??null,says:i?e.says+1:e.says,colour:(i==null?void 0:i.colour)??null,text:(i==null?void 0:i.text)??""}}case"amend-aside":{const i=e.asides.find(h=>h.at===t.at),c=i!=null&&i.q&&_s(i.q)?i.q:null,u=c&&e.answers[c]!==void 0?x5(e.answers,{[c]:void 0},t.ctx):e.answers,f=K6(e.asides.filter(h=>h.at<=t.at),u,t.ctx,c?_0(c):void 0);return{...e,answers:u,revision:u===e.answers?e.revision:e.revision+1,editing:null,asides:f.map(h=>h.at===t.at?{...h,said:t.said,reply:t.reply,kind:t.kind,rev:(h.rev??0)+1}:h)}}case"drop-aside":return{...e,editing:null,asides:e.asides.filter(i=>i.at<t.at)};case"cancel-edit":return{...e,answers:f8(e),composing:null,editing:null,saying:null,colour:null,text:""};case"say":{const i=e.saying===t.id?null:t.id;return{...e,answers:f8(e),composing:E5(e,i),saying:i,says:e.says+1,colour:null,text:""}}case"text":return e.text===t.text?e:{...e,text:t.text};case"colour":return t.hex?t.step&&t.step!=="keep"?{...e,colour:{step:t.step,hex:t.hex}}:e:{...e,colour:null};case"aside":{if(!t.aside.said.trim()||!t.aside.reply.trim())return{...e,text:""};const c=!!t.aside.q&&_s(t.aside.q)&&e.answers[t.aside.q]!==void 0?{...t.aside,after:!0}:t.aside;return{...e,asides:[...e.asides,LR(e.asides,c)],text:""}}case"unsure":return{...h8(e,t.ctx),unsure:t.unsure,text:""};case"settle-unsure":return h8(e,t.ctx);case"upload-begin":return{...e,uploading:e.uploading+1};case"upload-end":return{...e,uploading:Math.max(0,e.uploading-1)};case"uploaded":{if(((n=e.answers.source)==null?void 0:n.door)!=="photos")return e;const i=e.answers.photos??{hashes:[],attested:!1};return i.hashes.includes(t.hash)||i.hashes.length>=t.max?e:{...e,answers:{...e.answers,photos:{...i,hashes:[...i.hashes,t.hash]}},revision:e.revision+1}}case"remove-photo":{const i=e.answers.photos;if(!(i!=null&&i.hashes.includes(t.hash)))return e;const c=i.hashes.filter(u=>u!==t.hash);return{...e,answers:{...e.answers,photos:{hashes:c,attested:c.length?i.attested:!1}},revision:e.revision+1}}case"attest":{if(((r=e.answers.source)==null?void 0:r.door)!=="photos")return e;const i=e.answers.photos??{hashes:[],attested:!1};return i.attested===t.checked?e:{...e,answers:{...e.answers,photos:{...i,attested:t.checked}},revision:e.revision+1}}case"ref":{if(t.id!=="keep"){const u=t.id.slice(6);if(!((a=e.answers.traits)!=null&&a.includes(u)))return e}const i=e.answers[t.id]??{refs:[]},c=t.remove?i.refs.filter(u=>u!==t.hash):t.id==="keep"?[...i.refs.filter(u=>u!==t.hash),t.hash].slice(-4):[t.hash];return c.join()===i.refs.join()?e:{...e,answers:{...e.answers,[t.id]:{...i,refs:c}},revision:e.revision+1}}case"extras-declined":return{...e,extrasDeclined:!0};case"start-over":return{...ap,revision:e.revision+1,text:t.text??""};case"restore":return{...ap,answers:t.answers,revision:t.revision,asides:t.asides??[]}}}function G6(e,t){return jm(e.answers,t)===null&&!e.editing&&!e.saying}const TR=5,$R=40;function fae(e){return JSON.stringify({v:TR,answers:e.answers,revision:e.revision,asides:e.asides.slice(-$R)})}function hae(e){if(!e||typeof e!="object")return null;const t=e;if(typeof t.said!="string"||typeof t.reply!="string"||typeof t.at!="string"||!t.said.trim()||!t.reply.trim())return null;const n=typeof t.q=="string"?t.q:null,r=typeof t.rev=="number"&&t.rev>0?t.rev:void 0,a=typeof t.kind=="string"?t.kind:void 0,i=t.after===!0?!0:void 0,c=t.edit===!0?!0:void 0;return{said:t.said,reply:t.reply,q:n,at:t.at,...r?{rev:r}:{},...a?{kind:a}:{},...i?{after:i}:{},...c?{edit:c}:{}}}function pae(e){var r;if(rr(e))return $f[e.slice(5)].row.options;const t=Jr(e),n=t&&va(t.id);return n?t.part==="where"?((r=n.where)==null?void 0:r.options)??[]:n.options:[]}function C5(e,t){return t===oc||/^#[0-9a-f]{6}$/i.test(t)?{pick:t}:pae(e).some(n=>n.id===t)?{pick:t}:{words:t}}function mae(e,t){if(e==="keep")return typeof t=="string"?{words:t,refs:[]}:t;if(typeof t=="string"&&(rr(e)||Jr(e)))return C5(e,t);const n=Jr(e);if((n==null?void 0:n.part)==="what"&&t&&typeof t=="object"){const r=t,a=Array.isArray(r.refs)?r.refs:[];return r.pick!==void 0||typeof r.words!="string"?{...r,refs:a}:{...C5(e,r.words),refs:a}}return t}function op(e){if(!e)return null;try{const t=JSON.parse(e);if(t.v!==TR&&t.v!==4&&t.v!==3&&t.v!==2||!t.answers||typeof t.answers!="object")return null;const n={};for(const[a,i]of Object.entries(t.answers))_s(a)&&(n[a]=mae(a,i));const r=(Array.isArray(t.asides)?t.asides:[]).map(hae).filter(a=>a!==null).slice(-$R);return{answers:n,revision:typeof t.revision=="number"?t.revision:0,asides:r}}catch{return null}}const Pn={source:"Who are we making? Describe someone new, or add photos of a real person.",describe:"Describe them. Age, hair, build, skin and presence all help; one or two sentences is enough.",lookHint:"Skip anything you would rather leave to us.",photos:"Add one clear photo of their face. Up to three more angles hold the likeness better.",weakPhotos:"I cannot read a face in any of those photos, so anything I draw now would be a stranger rather than them.",name:"What should we call them?",nameWhileDrawing:"While it draws: what should we call them?",nameWhileReading:"While I read them: what should we call them?",traits:"Anything else that is always true of them?",traitsPhotos:"Anything in these photos that is always true of them?",keep:"Anything else about them?",agree:"Here is the presenter, in full. Ready to draw?",identity:e=>`Here is ${e==="them"?"the face":e}. Use this person, or change something.`,change:"What should change?",landed:e=>`Here is the ${e}. Use it, or try again.`,extras:"Add back and profile views? They help shots from behind or in profile."},DR=e=>e==="photos"?"the photos":"the face",HR=[{id:"photos",label:"Add photos"},{id:"scratch",label:"Describe someone"}],gae={photos:/\b(photos?|pictures?|pics?|upload|images?|selfies?)\b/,scratch:/\b(scratch|describe|description|invent|make (someone|one|them) up|imagine|new person)\b/},vae=[{label:"Late 30s, warm",text:"A woman in her late 30s, Mediterranean, olive skin, dark shoulder-length hair, slim build, warm and composed."},{label:"Early 20s, bright",text:"A man in his early 20s, fair skin with freckles, short blond hair, athletic build, bright and easygoing."},{label:"Mid 40s, quiet",text:"A man in his mid 40s, East Asian, close-cropped black hair, lean build, quietly confident."},{label:"Late 20s, easy",text:"A woman in her late 20s, deep brown skin, natural curls, tall and graceful, with an easy laugh."},{label:"Sixties, calm",text:"A woman in her early sixties, light skin, silver hair in a soft bob, broad build, calm and assured."}],wae="I have permission to use this person's likeness.";function yae(e){const t=[];return e.over>0&&t.push(e.over===1?`That is one more than ${e.max} photos, so the last one was not added.`:`That is ${e.over} more than ${e.max} photos, so the last ${e.over} were not added.`),e.same>0&&t.push(e.same===1?"One of those is already here.":`${e.same} of those are already here.`),e.failed.length&&t.push(e.failed.join(" ")),t.length?t.join(" "):null}const bae=(e,t)=>`${e} is larger than ${Math.round(t/1024/1024)}MB. Choose a smaller copy of it.`,xae=e=>`${e} could not be read as a photograph. JPEG, PNG, WebP and HEIC all work.`,kae="First portrait appears here",Sae=(e,t)=>!e||e==="portrait"||!t?kae:`The ${t} appears here`;function Eae(e){return e==="agree"?"Ready when you are":e==="photos"?"Add their photos":"Keep describing your presenter"}const OR=e=>e===1?"One thing I cannot tell yet.":e===2?"Two things I cannot tell yet.":"A few things I cannot tell yet.";function Cae(e){return e===1?"One photo":`${e} photos`}function jae(e,t){return e===0?"The same person, face clear. Add the clearest one first.":e===1?"One photo works. Two to four, from different angles, hold the likeness better.":e<t?`${e} photos. More angles hold the likeness better.`:"Four angles. The reference set comes from these, the first one leading."}const Aae="That does not read as a description yet. Draw from it anyway, or describe them: age, hair, build, skin, presence.",Nae=e=>e===0?void 0:e===1?"Changing this asks the one after it again.":`Changing this asks the ${e} after it again.`,Mae="Change this answer?",Rae="The face is drawn again from the change, and the views built on it follow. Nothing already saved changes.",Pae="The views drawn from the photos are drawn again with the change. The photos themselves stay as they are.",Lae={source:"describe them in a sentence, or pick one",describe:"a few words about them is enough: age, hair, build, skin, presence",look:"tap one, or say it in your own words",name:"a name, so the rest of the conversation can use it",refine:"say what should change: hair, age or build change the person; anything else changes the view on the stage",detail:"tap one, or say what it looks like"},Tae={who:{thing:"a person",how:"tap who they are"},age:{thing:"an age",how:"tap an age, or type one: Scenri draws adults"},hair:{thing:"a hair colour",how:"tap a colour, or say it: dark auburn, salt and pepper"},length:{thing:"a length",how:"tap a length, or say it: a chin-length bob"},skin:{thing:"a skin tone",how:"tap a tone, or say it: warm olive"},build:{thing:"a build",how:"tap a build, or say it: lean and tall"}},ss=e=>e.charAt(0).toUpperCase()+e.slice(1);function Ll(e,t,n,r="",a,i=!1){const c=t==="look"?Tae[a??""]??null:null,u=(c==null?void 0:c.how)??Lae[t],f=i?"":` ${ss(u)}.`;if(n>=2&&e!=="likeness"){const h=t==="look"||t==="detail"?"Or Skip it and we will choose.":"";return i?h||`${ss(u)}.`:`${ss(u)}.${h?` ${h}`:""}`}switch(e){case"likeness":return"Describe them by looks. Scenri does not draw a named person.";case"help":return c?`${ss(u)}.`:t==="refine"?"Select a view and say what is wrong with it, or say what should change about them: hair, age, build, skin.":t==="name"?"Any name will do; it can be changed later.":t==="detail"?`${ss(u)}.`:"Describe the person in a sentence: age, hair, build, skin, presence. Or add photos of a real person.";case"question":return c?`This step asks for ${c.thing}: ${u}.`:t==="refine"?`This is where the picture is changed: ${u}.`:t==="name"?`This is where they get a name: ${u}.`:t==="detail"?`This asks what the detail looks like: ${u}.`:`This is where the person is described: ${u}.`;case"nav":return"To begin again, use Start over at the top. Close keeps the draft where it is.";case"go":return t==="refine"?"Try again redraws it as it is; a sentence says what should change.":`Nothing to draw yet. ${ss(u)}.`;case"intent":return c?`${ss(u)}.`:t==="refine"?`Nothing changes until it is said what: ${u}.`:`That is what we are here for. Who are they? ${ss(u)}.`;case"nonsense":return c?`That is not ${c.thing}.${f}`:t==="name"?`That is not a name. ${ss(u)}.`:t==="refine"?`That does not say what should change. ${ss(u)}.`:t==="detail"?`That does not say what it looks like. ${ss(u)}.`:`That does not describe anyone. ${ss(u)}.`;case"greeting":return n?`Still here.${f}`:/^(hi|hello|hey|heya|hiya|yo|hola|shalom|good)\b/i.test(r.trim())?`Hi.${f}`:`${ss(u)}.`;case"ack":return n?`Still here.${f}`:i?"Go ahead.":`Go ahead: ${u}.`;case"vague":return n?`Still here. ${ss(u)}.`:`${ss(u)}.`}}const V0=e=>e.trim().replace(/[.\s]+$/,"");function j5(e,t){const n=e==="portrait"?"face":bn[e];return t==="cancelled"?{id:"retry",kind:"confirm",quiet:!0,prompt:`Stopped drawing the ${n}. Nothing finished was touched.`,options:[{id:"retry",label:"Draw it again"}]}:{id:"retry",kind:"confirm",tone:"alert",prompt:`The ${n} could not be drawn: ${V0(t)}. Nothing finished was touched.`,options:[{id:"retry",label:"Retry"}]}}function $ae(e){var r;const t=(((r=e.analysis)==null?void 0:r.suitableCategories)??[]).filter(Boolean);return t.length?` Filed under ${t.length===1?t[0]:`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}; that can change on their page.`:""}function Dae(e){if(!e)return"";const t=[...e.asks??[],...e.results??[],...e.decisions??[]].map(n=>n.at);return t.length?t.reduce((n,r)=>r>n?r:n):""}const Hae=e=>e.charAt(0).toUpperCase()+e.slice(1);function Oae({draft:e,canGenerate:t,ui:n,afterCoverage:r,asides:a,openId:i,placed:c}){var ke;const u=[],f=(te,be,G)=>u.push({kind:"scenri",id:te,text:be,tone:G}),h=te=>u.push({kind:"question",question:te}),p=((ke=e.name)==null?void 0:ke.trim())??"",m=p||"them",v=()=>{p&&(u.push({kind:"scenri",id:"asked-name",text:Pn.name,quiet:!0}),u.push({kind:"you",id:"name",text:p,editable:!0,editing:n.editingName||void 0}))},w=te=>h({id:"name",kind:"text",prompt:te});if(e.stage==="analyzing")return f("reading",`Reading ${DR(e.source)}.`),p?v():w(Pn.nameWhileReading),u;const y=_K(e,t);if(y&&f("coverage",y.text,y.tone),u.push(...r),!t&&e.source==="photos")return p&&v(),p?(h({id:"blind",kind:"confirm",prompt:"No engine here can draw the other views. Save them from the photos as they are?",options:[{id:"save",label:"Save with photos"},{id:"setup",label:"Set up"}]}),u):(w(Pn.name),u);const b=e.views.portrait,k=e.activeView,S=e.asks??[],C=S[S.length-1],j=C?e.views[C.view]:null,N=!!C&&!!j&&(j.status==="generating"&&e.activeView===C.view||j.status==="candidate"&&j.adjustment===C.text||!!j.error),P=te=>te==="portrait"&&!Ko(e)?Pn.identity(m):Pn.change,$=(e.results??[]).filter(te=>te.how!=="restored"),R=e.decisions??[],E=!e.activeView&&e.stage==="idle",M=new Map,L=new Map,H=new Map;for(const te of $){const be=`${te.view}:${te.hash}`;if(H.set(be,te),M.has(be))continue;const G=(L.get(te.view)??0)+1;L.set(te.view,G),M.set(be,G)}const D=te=>M.get(`${te.view}:${te.hash}`)??1,K=(te,be)=>{const G=D(te),J=e.views[te.view].hash===te.hash,ne=(L.get(te.view)??0)>1;return{kind:"scenri",id:be,text:`Here is ${bn[te.view]} ${G}.`,thumb:te.hash,view:te.view,label:`${tc[te.view]} ${G}`,current:ne&&J&&H.get(`${te.view}:${te.hash}`)===te,restore:E&&!J&&!yv(e,te.view)?{view:te.view,hash:te.hash}:void 0}},O=new Set,_=new Map(S.map(te=>{const be=$.find(G=>!O.has(G)&&G.how==="drawn"&&G.view===te.view&&G.ask===te.text&&G.at>=te.at);return be&&O.add(be),[te,be]})),re=new Map;for(const te of R)te.what==="use"&&!re.has(te.view)&&re.set(te.view,te);const z=te=>te==="portrait"?`Here is ${m} with the change. Use this, or keep the previous one. Using it redraws the views built on the face.`:`Redrew the ${bn[te]}. Use it, or keep the previous one.`,F=te=>{const be=te===re.get(te.view),G=te.view==="portrait"&&be,J=te.what==="again"?"Try again":te.what==="keep"?"Keep previous":G?"Use this person":te.view==="portrait"?"Use this":"Use it";return[{kind:"scenri",id:`asked-decided-${te.at}`,text:G?Pn.identity(m):be?Pn.landed(bn[te.view]):z(te.view),quiet:!0},{kind:"you",id:`decided-${te.at}`,text:J,editable:!1}]},Q=()=>{const te=N?S.slice(0,-1):S,be=Dae(e),G=a.filter(W=>!c.has(W)&&(W.q!==i||W.at<=be));for(const W of G)c.add(W);const J=$.find(W=>kK.includes(W.view)),ne=[...te.map(W=>{const he=_.get(W);return{at:W.at,turns:[{kind:"scenri",id:`asked-ask-${W.at}`,text:P(W.view),quiet:!0},{kind:"you",id:`ask-${W.at}`,text:W.text,editable:!1},...he?[K(he,`redrew-${W.at}`)]:[]]}}),...$.filter(W=>!O.has(W)).map(W=>({at:W.at,turns:[K(W,`result-${W.at}`)]})),...R.map(W=>({at:W.at,turns:F(W)})),...G.map(W=>({at:W.at,turns:ri(W)})),...Ko(e)&&(e.extras||n.extrasDeclined)?[{at:J?J.at.slice(0,-1):"~",turns:[{kind:"scenri",id:"asked-extras",text:Pn.extras,quiet:!0},{kind:"you",id:"extras",text:e.extras?"Add them":"Not now",editable:!1}]}]:[]];ne.sort((W,he)=>W.at<he.at?-1:W.at>he.at?1:0);for(const W of ne)u.push(...W.turns)},V=()=>{!N||!C||(u.push({kind:"scenri",id:`asked-ask-${C.at}`,text:P(C.view),quiet:!0}),u.push({kind:"you",id:`ask-${C.at}`,text:C.text,editable:!1}))};if(!Ko(e)){const te=b.status==="generating"||k==="portrait"&&b.status!=="candidate";return te&&!S.length?(f("drawing-face","Drawing their face."),p?v():w(Pn.nameWhileDrawing),u):(v(),Q(),te?(V(),f("drawing-face",N?"Adjusting the face. Everything else stays.":"Drawing their face."),p||w(Pn.nameWhileDrawing),u):n.failed?(h({id:"retry",kind:"confirm",tone:"alert",prompt:`That did not go through: ${V0(n.failed??"")}. Nothing finished was touched.`,options:[{id:"retry",label:"Retry"}]}),u):b.error?(V(),h(j5("portrait",b.error)),u):(b.status==="candidate"&&(V(),h({id:"identity",kind:"confirm",prompt:N?"Adjusted. Use this person, or try again.":Pn.identity(m),hint:b5("portrait",e.keepItems),options:[{id:"use",label:"Use this person"},{id:"again",label:"Try again"},{id:"change",label:"Change something"}]})),u))}v(),Q();const I=Object.keys(e.views),B=Wo(e),Y=[...B].reverse().find(te=>m6.has(te)),ae=B.find(te=>!m6.has(te)),X=I.find(te=>e.views[te].status==="candidate"),le=I.find(te=>!!e.views[te].error);if(n.failed&&!k)return h({id:"retry",kind:"confirm",tone:"alert",prompt:`That did not go through: ${V0(n.failed??"")}. Nothing finished was touched.`,options:[{id:"retry",label:"Retry"}]}),u;if(k)return V(),f(`drawing-${k}`,N&&(C==null?void 0:C.view)===k?`Redrawing the ${bn[k]}.`:k===Y&&!e.views[k].hash?`Drawing the ${bn[k]} from this face.`:k===ae&&!e.views[k].hash&&Y?`Building the rest of the set from the ${bn[Y]}.`:`Drawing the ${bn[k]}.`),p||w(Pn.nameWhileDrawing),u;if(X){V();const te=e.views[X],be=!!te.prior,G=ne=>ne?M.get(`${X}:${ne}`)??0:0,J=!!te.hash&&!!te.prior&&G(te.hash)<G(te.prior);return te.hash&&u.push({kind:"scenri",id:`candidate-${X}-${te.hash}`,text:J?`Here is ${bn[X]} ${G(te.hash)} again.`:be?X==="portrait"?`Here is ${m} with the change.`:`Redrew the ${bn[X]}.`:`Here is the ${bn[X]}.`,thumb:te.hash,label:tc[X],view:X,current:!0}),h({id:X==="portrait"?"revision":"view-revision",kind:"confirm",prompt:be?X==="portrait"?`Use this, or keep the previous one.${ZK(e,X)?" Using it redraws the views built on the face.":""}`:"Use it, or keep the previous one.":"Use it, or try again.",hint:X==="portrait"||X==="front"?b5(X,e.keepItems):void 0,options:[{id:"use",label:X==="portrait"?"Use this":"Use it"},...be?[{id:"keep",label:"Keep previous"}]:[],{id:"again",label:"Try again"}]}),u}return le?(V(),h(j5(le,e.views[le].error??"")),u):SK(e)?!e.extras&&!n.extrasDeclined?(f("set-ready","The set is ready. Select a view and say what is wrong to redraw it."),h({id:"extras",kind:"confirm",prompt:Pn.extras,options:[{id:"add",label:"Add them"},{id:"save",label:"Not now"}]}),u):p?(h({id:"save",kind:"confirm",prompt:`${Hae(m)} is ready.${$ae(e)}`,options:[{id:"save",label:"Save presenter"}]}),u):(w(Pn.name),u):(p||w(Pn.nameWhileDrawing),u)}const Iae={who:{label:"Who",options:NR},age:{label:"Age",options:MR},build:{label:"Build",options:["slender","average","athletic","fuller"].map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1)}))}},ip=e=>e.charAt(0).toUpperCase()+e.slice(1);function Fae(e){return!e||e==="skipped"?"Draw as is":Object.values(e).map(t=>ip(t)).join(", ")}function _ae(e){const t=e.map(n=>{var r;return((r=va(n))==null?void 0:r.label)??n});return t.length?t.length===1?t[0]:`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`:"Nothing distinctive"}const Zae=e=>qQ(e,HR,gae);function Am(e){var a;if(((a=e.source)==null?void 0:a.via)==="taps"){const i=xR(e),c=ic(i.who);return RR(c&&!ra(c)?{...i,who:void 0}:i)}const t=(e.describe??"").trim(),n=e.gaps&&e.gaps!=="skipped"?e.gaps:{},r=n.build?`${t.replace(/[.\s]+$/,"")}, ${n.build} build`:t;return HK({steer:n.who??null,age:n.age??null},r)}function Vae(e){return Nm(e).map(t=>t.words)}const zae=200,Bae=12;function Nm(e){var i,c;const t=_se(e),n=(u,f,h)=>({id:u,words:f.slice(0,zae),...h!=null&&h.length?{refs:h.slice(0,4)}:{}}),r=[];for(const u of kR(e.traits??[])){const f=t[u],h=f?Nse(u,f):"";h&&r.push(n(u,h,f==null?void 0:f.refs))}const a=(((i=e.keep)==null?void 0:i.words)??"").trim();return a&&r.push(n("said",a,(c=e.keep)==null?void 0:c.refs)),r.slice(0,Bae)}function A5(e){const t=Vae(e);return t.length<2?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}function Uae(e){const t=e.trim().replace(/[.\s]+$/,""),n=t.replace(/^(?:but|and|also|plus|though|although|however)\b[\s,]*/i,"");return n.replace(/^(?:he|she|they|it)\s+(?:has|have|had|has got|have got|is|are|wears?|carries)\s+/i,"")||n||t}function Wae(e,t,n,r){const a=r.toLowerCase().split(/[^a-z0-9]+/).filter(c=>c.length>2);if(!a.length)return!0;const i=Am({...e,[t]:n}).toLowerCase();return a.every(c=>i.includes(c))}function Kae(e){const t=op(e.setup??null);return t&&Object.keys(t.answers).length?{answers:t.answers,asides:t.asides}:{answers:Gae(e),asides:[]}}function Gae(e){const t=op(e.setup??null);return t&&Object.keys(t.answers).length?t.answers:e.source==="photos"?{source:{door:"photos",via:"taps"},photos:{hashes:e.sources??[],attested:!0},...N5(e)}:{source:{door:"scratch",via:"typed"},describe:e.direction??"",gaps:"skipped",traits:[],...N5(e)}}function N5(e){const t=e.keepItems??[];if(!t.length)return{};const n={},r=[];let a;for(const i of t){const c=cd.find(u=>u.id===i.id);if(c){r.push(c.id),n[`trait-${c.id}`]={words:i.words,refs:i.refs??[]};continue}a={words:[a==null?void 0:a.words,i.words].filter(Boolean).join(", "),refs:[...(a==null?void 0:a.refs)??[],...i.refs??[]]}}return n.traits=r,a&&(n.keep=a),n}const IR=(e,t)=>({draft:e?{source:e.source,stage:e.stage,keep:e.keep,views:{portrait:{status:e.views.portrait.status}},analysis:e.analysis?{photos:e.analysis.photos}:void 0}:null,canGenerate:t});function Yae(e,t,n){var a,i;if(e==="source")return t.kind==="choice"?{source:{door:t.id,via:"taps"}}:null;if(rr(e)){const c=(a=n[e])==null?void 0:a.words,u=c?{words:c}:{};return t.kind==="swatches"?{[e]:{pick:t.picks[e.slice(5)]??Object.values(t.picks)[0],...u}}:t.kind==="skip"?{[e]:{pick:oc,...u}}:null}if(e==="gaps")return t.kind==="choices"?{gaps:t.picks}:t.kind==="skip"?{gaps:"skipped"}:null;if(e==="traits")return t.kind==="choices"?{traits:cd.map(c=>c.id).filter(c=>t.picks[c])}:t.kind==="skip"?{traits:[]}:null;const r=Jr(e);if(r&&t.kind==="choice"){if(r.part==="where"){const u=(i=n[e])==null?void 0:i.words;return{[e]:{pick:t.id,...u?{words:u}:{}}}}const c=n[`trait-${r.id}`];return{[e]:{pick:t.id,...c!=null&&c.words?{words:c.words}:{},refs:(c==null?void 0:c.refs)??[]}}}return null}function qae(e,t){var r;return`the ${((r=va(e))==null?void 0:r.label.toLowerCase())??"detail"} in the attached ${t===1?"picture":"pictures"}`}const M5="A scar, a ring, anything we missed",Xae=new Set(["describe","keep"]),Qae=new Set(["likeness","help","question","greeting","ack","nav","intent","go","nonsense"]);function R5(e,t){const n=(t==null?void 0:t.trim())??"";return e?n?`${e}, ${n}`:e:ip(n)}const Jae=/^(?:but|and|though|although|only|just|except(?: that)?|with|without|plus)\s+/i,P5=e=>Jae.test(e.trim());function p8(e){return e.trim().replace(/[.\s]+$/,"").replace(/^(?:but|and|though|although|only|just|except(?: that)?)\s+/i,"").trim()}function z0(e,t){if(!e)return!1;if(Xae.has(e))return!0;if(!rr(e)&&!Jr(e))return!1;const n=t[e];return!!n&&!n.pick&&!!n.words}function rh(e,t,n){const r=t.trim();return r?e==="look-age"&&RK(r)?null:e!=="look-who"&&(rr(e)||e.startsWith("trait-"))&&AK(r)?"nonsense":rr(e)||e.startsWith("trait-")||e==="keep"?toe(r,n):e==="describe"||e==="source"?Zo(r,n):null:"vague"}function m8(e,t,n){if(e&&rr(e))return"look";if(e==="keep"||e!=null&&e.startsWith("trait-"))return"detail";const r=e??t;if(r&&rr(r))return"look";if(r!=null&&r.startsWith("trait-"))return"detail";switch(r){case"source":return"source";case"describe":case"gaps":return"describe";case"name":return"name";case"traits":return"detail";default:return n?"refine":"describe"}}const L5=new Set(["who","age","hair","colour","color","length","cut","skin","build","body","name","look","style","face","person","presenter","glasses","scar","scars","tattoo","piercing","makeup","freckles","prosthetic"]),eoe=/^[a-z]{1,10}\d+$/i,toe=(e,t)=>{const n=e.trim(),r=n.toLowerCase().replace(/[^a-z ]/g,"");if(L5.has(r)||L5.has(r.replace(/^(the|their|its|his|her)\s+/,"")))return"nonsense";const a=n.split(/\s+/).filter(Boolean);if(a.length<=2&&a.some(c=>eoe.test(c)))return"nonsense";const i=Zo(e,t);return i&&Qae.has(i)?i:null};function noe(e,t){return e==="name"?"metadata":t?e==="source"||e==="photos"?"start-over":"redraw":"plain"}function T5(e,t,n,r){var f,h,p,m,v,w,y,b,k;const a=t.answers,i=r?{reopened:!0,cost:Nae(bR(a,n).filter(S=>S!=="keep"&&_0(S)>_0(e)).length)}:{};switch(e){case"source":return{id:e,kind:"choice",prompt:Pn.source,options:HR,given:(f=a.source)==null?void 0:f.door,...i};case"weakphotos":return{id:e,kind:"confirm",prompt:Pn.weakPhotos,options:[{id:"again",label:"Use different photos"},{id:"anyway",label:"Draw from these anyway"}]};case"photos":{const S=a.photos??{hashes:[],attested:!1};return{id:e,kind:"photos",prompt:Pn.photos,hint:jae(S.hashes.length,p0),hashes:S.hashes,max:p0,busy:t.uploading>0,attest:{text:wae,checked:S.attested},submit:"Continue",back:"Describe someone instead"}}case"describe":return{id:e,kind:"text",prompt:Pn.describe,starters:vae};case"gaps":{const S=xw(a.describe??"");return{id:e,kind:"choice",prompt:OR(S.length),groups:S.map(C=>({id:C,...Iae[C]})),submit:"Continue",skip:"Skip, draw as is",given:a.gaps&&a.gaps!=="skipped"?a.gaps:void 0,...i}}case"traits":{const S=((h=a.source)==null?void 0:h.door)==="photos";return{id:e,kind:"choice",prompt:S?Pn.traitsPhotos:Pn.traits,multi:!0,options:cd.map(C=>({id:C.id,label:C.label})),submit:"Continue",skip:S?"Nothing to add":"Nothing else",given:a.traits,...i}}case"keep":return{id:e,kind:"text",prompt:Pn.keep}}if(rr(e)){const S=e.slice(5),{row:C,prompt:j}=$f[S],N=eae((p=a["look-who"])==null?void 0:p.pick),P=tae.has(S)?{...C,options:C.options.map($=>$.card?{...$,card:`${$.card}-${N}`}:$)}:C;return{id:e,kind:"swatches",prompt:j,hint:S==="who"?Pn.lookHint:void 0,row:P,skip:"Skip",describe:S==="who"?"Describe them instead":void 0,saying:t.saying===e,given:((m=a[e])==null?void 0:m.pick)===oc||(v=a[e])==null?void 0:v.pick,skipped:((w=a[e])==null?void 0:w.pick)===oc,note:(y=a[e])==null?void 0:y.words,...i}}const c=Jr(e),u=c?va(c.id):void 0;if(c&&u&&c.part==="where"&&u.where)return{id:e,kind:"choice",prompt:u.where.ask,options:u.where.options.map(S=>({id:S.id,label:S.label})),saying:t.saying===e,given:(b=a[e])==null?void 0:b.pick,note:(k=a[e])==null?void 0:k.words,...i};if(c&&u){const S=a[`trait-${c.id}`];return{id:e,kind:"choice",prompt:u.ask,hint:u.hint,options:u.options.map(C=>({id:C.id,label:C.label,card:C.card})),attach:S!=null&&S.refs.length?"Replace the reference":"Add a reference",saying:t.saying===e,given:S==null?void 0:S.pick,note:S==null?void 0:S.words,...i}}return{id:e,kind:"text",prompt:""}}function $5(e,t){var a,i,c;switch(e){case"source":return Pn.source;case"photos":return Pn.photos;case"describe":return((a=t.source)==null?void 0:a.via)==="typed"?Pn.source:Pn.describe;case"gaps":return OR(xw(t.describe??"").length);case"traits":return((i=t.source)==null?void 0:i.door)==="photos"?Pn.traitsPhotos:Pn.traits;case"keep":return Pn.keep}if(rr(e))return $f[e.slice(5)].prompt;const n=Jr(e),r=n?va(n.id):void 0;return!n||!r?"":n.part==="where"?((c=r.where)==null?void 0:c.ask)??"":r.ask}function roe(e,t,n){var u,f,h,p,m,v,w;switch(e){case"source":return{text:((u=t.source)==null?void 0:u.door)==="photos"?"Add photos":"Describe someone"};case"photos":{const y=(n==null?void 0:n.sources)??((f=t.photos)==null?void 0:f.hashes)??[];return{text:Cae(y.length),photos:y}}case"describe":return{text:(t.describe??"").trim()};case"gaps":return{text:Fae(t.gaps)};case"traits":return{text:_ae(kR(t.traits??[]))};case"keep":return{text:(((h=t.keep)==null?void 0:h.words)??"").trim(),photos:(p=t.keep)==null?void 0:p.refs}}if(rr(e)){const y=e.slice(5);return{text:sae($f[y].row,t[e]??{})}}const r=Jr(e),a=r?va(r.id):void 0;if(!r||!a)return{text:""};if(r.part==="where"){const y=t[e]??{},b=y.pick?((v=(m=a.where)==null?void 0:m.options.find(k=>k.id===y.pick))==null?void 0:v.label)??ip(y.pick):"";return{text:R5(b,y.words)}}const i=t[`trait-${r.id}`],c=i!=null&&i.pick?((w=a.options.find(y=>y.id===i.pick))==null?void 0:w.label)??ip(i.pick):"";return{text:R5(c,i==null?void 0:i.words),photos:i!=null&&i.refs.length?i.refs:void 0}}function soe(e){const t=e.state.asides,n=t.length?ON(D5(e,[],null)):null;return D5(e,t,n)}const FR=(e,t)=>e.at<t.at?-1:e.at>t.at?1:0,lp=(e,t)=>Z0(e.editing)&&oae(e.editing)===t.at;function D5(e,t,n){const r=new Set,a=aoe(e,t,n,r),i=a.length&&a[a.length-1].kind==="question"?a.pop():null,c=t.filter(f=>!r.has(f)).sort(FR),u=e.state.unsure;for(const f of c)(!u||f.at<u.at)&&a.push(...ri(f,lp(e.state,f)));if(i&&a.push(i),u){a.push({kind:"you",id:`unsure-${u.at}`,text:u.said,editable:!1}),a.push({kind:"question",question:{id:"unsure",kind:"confirm",quiet:!0,prompt:Aae,options:[{id:"use",label:"Use it anyway"}]}});for(const f of c)f.at>=u.at&&a.push(...ri(f,lp(e.state,f)))}return a}function aoe({state:e,draft:t,canGenerate:n,failed:r,awaiting:a},i,c,u){var P,$,R,E,M;const f=IR(t,n),h=e.answers,p=[{kind:"you",id:"intent",text:"Create a presenter"}],m=[],v=((P=h.source)==null?void 0:P.door)==="photos",w=(L,H,D=!1)=>{const K=i.filter(O=>!u.has(O)&&!!O.q&&O.q!==c&&H.includes(O.q)&&!!O.after===D).sort(FR);for(const O of K)u.add(O),L.push(...ri(O,lp(e,O)))},y=L=>i.find(H=>H.edit&&H.q===L&&!u.has(H)),b=(L,H,D=!0)=>{var O;if(L.push({kind:"scenri",id:`asked-${H}`,text:$5(H,h),quiet:!0}),w(L,H==="describe"&&((O=h.source)==null?void 0:O.via)==="typed"?["source","describe"]:[H]),!D){const _=y(H);_&&(u.add(_),L.push({kind:"you",id:H,text:_.said}),L.push(...ri(_,lp(e,_),!0))),w(L,[H],!0);return}const K=roe(H,h,t);L.push({kind:"you",id:H,text:K.text,photos:K.photos,editable:!0,editing:e.editing===H&&z0(H,h)||void 0}),w(L,[H],!0)},k=new Set(bR(h,f)),S=Ise.filter(L=>k.has(L)||i.some(H=>H.edit&&H.q===L));for(const L of S){const H=v&&t&&L!=="source"&&L!=="photos"?m:p;if(e.editing===L&&!z0(L,h)){H.push({kind:"scenri",id:`asked-${L}`,text:$5(L,h),quiet:!0}),w(H,[L]),H.push({kind:"question",question:T5(L,e,f,!0)}),w(H,[L],!0);continue}L==="source"&&(($=h.source)==null?void 0:$.via)==="typed"||b(H,L,k.has(L))}let C=null;if(((R=h.source)==null?void 0:R.door)==="scratch"&&!n&&!t)C={id:"noengine",kind:"confirm",quiet:!0,prompt:"Describing someone needs image generation, which is not set up yet.",options:[{id:"setup",label:"Set up"},{id:"photos",label:"Add photos instead"}]};else{const L=jm(h,f);L?C=T5(L,e,f,!1):!t&&((E=h.source)==null?void 0:E.door)==="scratch"&&(h.source.via==="taps"?C={id:"agree",kind:"confirm",prompt:Pn.agree,quote:`${aae(xR(h))}${A5(h)?`, and always ${A5(h)}`:""}.`,options:[{id:"draw",label:"Draw the presenter"}]}:r&&(C={id:"retry",kind:"confirm",tone:"alert",prompt:`That did not go through: ${r}. Nothing was drawn.`,options:[{id:"retry",label:"Retry"}]}))}if(a&&(C=null),!t)return C&&p.push({kind:"question",question:C}),p;const j=Oae({draft:t,canGenerate:n,ui:{extrasDeclined:e.extrasDeclined,failed:r,editingName:e.editing==="name"},afterCoverage:m,asides:i,openId:c,placed:u}),N=[...p,...j];return C&&((M=N[N.length-1])==null?void 0:M.kind)==="question"&&N.pop(),C&&N.push({kind:"question",question:C}),N}function _R(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="question")return n.question;if(!Gh(n))return null}return null}const eo={placeholder:"Nothing to type yet",label:"Message",action:"Send"},H5=(e,t)=>({placeholder:t?Jse[e]??"In your words":k5.has(e)?"Tap a swatch above, or say the colour":"Tap one above, or describe it",label:"Describe it",action:"Send",color:k5.has(e)});function O5(e,t){const n=Jr(e),r=n?va(n.id):void 0,a=(n==null?void 0:n.part)==="where"?"Where it is, in your words":(r==null?void 0:r.saying)??"What it looks like",i=(n==null?void 0:n.part)==="where"?"Tap one above, or say where it is":`Tap one above, or ${((r==null?void 0:r.saying)??"describe it").toLowerCase()}`;return{placeholder:t?a:i,label:(r==null?void 0:r.saying)??"Describe it",action:"Send"}}function ooe(e,t,n,r){if(t.editing!==null&&(t.editing==="name"||Z0(t.editing)||z0(t.editing,t.answers)))return{...eo,off:"Finish the change above."};if(t.saying==="keep")return{placeholder:M5,label:"What should stay the same about them",action:"Send"};if(t.saying&&rr(t.saying))return H5(t.saying.slice(5),!0);if(t.saying)return O5(t.saying,!0);if(t.editing!==null)return{...eo,off:"Finish the change above."};if(e){if(rr(e.id))return H5(e.id.slice(5),!1);if(e.id.startsWith("trait-"))return O5(e.id,!1);switch(e.id){case"source":return{placeholder:"Describe them, or choose above",label:"Describe them",action:"Send"};case"describe":case"unsure":return{placeholder:"Describe them",label:"Describe them",action:"Send"};case"name":return{placeholder:"Their name",label:"Their name",action:"Send"};case"identity":return{placeholder:"What should change? Shorter hair, older",label:"What should change",action:"Refine"};case"agree":return{placeholder:M5,label:"Anything else that is always true of them",action:"Send"};case"traits":return{placeholder:"Tap any above, or say it in your own words",label:"Anything else that is always true of them",action:"Send"};case"gaps":return{placeholder:"Tap one above, or say it in your own words",label:"Fill in what is missing",action:"Send"};case"photos":return{...eo,off:"Add their photos above."};case"noengine":return{...eo,off:"Set up image generation, or add photos."};case"blind":return{...eo,off:"Decide above."};case"retry":return{...eo,off:"Retry above."}}}return n?n.stage==="analyzing"?{...eo,off:`Reading ${n.source==="photos"?"the photos":"the face"}.`}:nc(n)?Ko(n)?{placeholder:I5(r,n),label:"What should change",action:"Refine",off:""}:{...eo,off:""}:Ko(n)?{placeholder:I5(r,n),label:"What should change",action:"Refine"}:{...eo,off:"The face comes first."}:{...eo,off:"Starting the draft."}}function I5(e,t){var r;const n=((r=t.name)==null?void 0:r.trim())||"them";return e==="portrait"?`What should change about ${n}?`:`Change this view: ${bn[e]}`}function F5(e,t){return e.saying?e.saying:t&&_s(t.id)&&(t.id==="source"||t.id==="describe")||t&&_s(t.id)&&(rr(t.id)||t.id.startsWith("trait-"))?t.id:(t==null?void 0:t.id)==="agree"?"keep":(t==null?void 0:t.id)==="name"?"name":null}const ioe=/\b(here|in this (view|one|picture|image|frame)|this (view|one|picture|image|frame))\b/i,loe=/\b(looks? like|doesn'?t look|does not look|not (her|him|them)|drift(s|ed|ing)?|wrong|\boff\b|different person|someone else|regenerate|redraw|again)\b/i,coe=/\b(dress|gown|outfit|wearing|wear|jacket|coat|suit|shirt|t-shirt|tee|hoodie|jeans|trousers|skirt|shoes|heels|sneakers|boots|hat|cap|sunglasses|jewell?ery|necklace|earrings|watch|holding|holds?|product|bottle|perfume|bag|handbag|phone|laptop|scene|beach|paris|london|tokyo|street|rooftop|office|kitchen|cafe|city|forest|desert|snow|rain|sunset|sunrise|golden hour|background|backdrop|lighting|campaign|shoot)\b/i,uoe=/\b(simpler|plainer|plain|neutral|cleaner|tidier)\b/i,doe=/\b(outfit|clothes|clothing|top|wardrobe|wearing)\b/i;function ZR(e,t,n){const r=e.trim();if(!r)return{blocked:"Say what should change."};if(coe.test(r)&&!(uoe.test(r)&&doe.test(r)))return{scope:"out-of-scope"};const a=cA.test(r),i=loe.test(r),c=ioe.test(r),u=n.source==="photos";if(t==="portrait")return u?{blocked:"Their photos define who they are. Change a drawn view instead."}:{scope:"identity",view:"portrait"};if(a&&i&&!c)return u?{scope:"view",view:t}:{scope:"ambiguous"};if(a&&!c)return u?{blocked:"Their photos define who they are. Change a drawn view instead."}:{scope:"identity",view:"portrait"};const f=n.views[t];return f.origin==="photo"?{blocked:"Your photo stands as it is. Pick a drawn view to change."}:f.status!=="approved"&&f.status!=="candidate"?{blocked:`Nothing drawn for the ${bn[t]} yet.`}:{scope:"view",view:t}}const VR=e=>`Use Create for wardrobe, products and scenes. Edits here change who ${e} is.`;function foe(e,t,n,r){const a=e.trim(),i=t==="portrait"?"Describe a change to who they are.":"Say what is wrong with this view, or describe a change to who they are.";if(!a){const u=n.views[t];return t!=="portrait"&&u.origin==="photo"?{chip:null,hint:"Your photo stands as it is. Pick a drawn view to change."}:{chip:null,hint:i}}const c=ZR(a,t,n);return"blocked"in c?{chip:null,hint:c.blocked,tone:"alert"}:c.scope==="out-of-scope"?{chip:null,hint:VR(r),tone:"alert"}:c.scope==="ambiguous"?{chip:null,hint:"This reads as the view or the person. Send it and I will ask which."}:c.scope==="identity"?{chip:{view:"portrait",label:"Changing the person"},hint:"Changes the person. The other views are redrawn after you use it."}:{chip:{view:c.view,label:`Refining the ${bn[c.view]}`},hint:"Changes this view only. Hair, skin, age or build change the person."}}const hoe=e=>e.replace(/^asset:/,"");function zR(e,t){if((e.identityEdits??[]).join(`
|
|
105
|
-
`)!==(t.identityEdits??[]).join(`
|
|
106
|
-
`))return!0;const r=t.shots.some(i=>i.angle==="portrait"&&i.file),a=new Map(t.shots.map((i,c)=>[!r&&c===0?"portrait":i.angle??"",hoe(i.file)]));for(const i of Wo(e)){const c=e.views[i];if(c.status==="candidate"||c.status==="stale"||c.prior)return!0;const u=a.get(i);if(c.status==="approved"&&c.hash&&c.hash!==u||c.status==="empty"&&u)return!0}return!1}const poe=e=>xK.filter(t=>e.views[t].status==="empty"&&t!=="portrait"),moe=e=>e.length<=2?e.map(t=>bn[t]).join(" and "):`${e.slice(0,-1).map(t=>bn[t]).join(", ")} and ${bn[e[e.length-1]]}`,goe={building:!1,buildDeclined:!1,scopeAsk:null,failed:null,conflict:null},voe="Say what should change: hair, age or build change the person; anything else changes the view on the stage.",woe="Still here. Select a view and say what is wrong with it, or say what should change about them.";function yoe(e,t,n){const r=`select a view and say what is wrong with it, or say what should change about ${t}`;switch(e){case"likeness":return"Describe the change by looks. Scenri does not draw a named person.";case"help":case"question":return`This is where ${t} is changed: ${r}.`;case"nav":return"Discard changes is at the top, and Save changes keeps what you did.";case"go":case"intent":return`Nothing changes until it is said what: ${r}.`;case"nonsense":return`That does not say what should change. ${r.charAt(0).toUpperCase()}${r.slice(1)}.`;default:return n?woe:voe}}const Hl={opening:e=>`What would you like to change about ${e}? Select a view to work on it, or describe a change to who they are.`,scope:"Apply this to:",change:"What should change?",saved:"Save changes when you are done."};function boe(e){const t=e.ui.asides??[],n=t.length?ON(_5(e,[],null)):null;return _5(e,t,n)}function _5({draft:e,base:t,name:n,selected:r,canGenerate:a,ui:i},c,u){var be;const f=[{kind:"scenri",id:"opening",text:Hl.opening(n)}],h=new Set,p=()=>{for(const G of c)h.has(G)||f.push(...ri(G));return f},m=(G,J,ne)=>{ne&&f.push({kind:"scenri",id:`asked-${G}`,text:ne}),f.push({kind:"you",id:G,text:J,editable:!1})},v=(G,J,ne)=>f.push({kind:"scenri",id:G,text:J,tone:ne}),w=G=>f.push({kind:"question",question:G});if(!e)return p();const y=poe(e),b=e.source!=="synthetic"||!!((be=e.direction)!=null&&be.trim()),k=Wo(e).some(G=>e.views[G].status==="candidate");if(y.length&&b&&!k&&!i.building&&!i.buildDeclined&&!nc(e)&&a){const G=Wo(e).filter(J=>e.views[J].status==="approved").length;return w({id:"legacy",kind:"confirm",prompt:`${n} has ${G===1?"one reference":`${G} references`}. Build the ${moe(y)} from it?`,options:[{id:"build",label:"Build them"},{id:"not",label:"Not now"}]}),p()}const S=Wo(e),C=e.activeView,j=S.find(G=>e.views[G].status==="candidate"),N=S.find(G=>!!e.views[G].error),P=(t==null?void 0:t.identityEdits)??[];(e.identityEdits??[]).filter(G=>!P.includes(G)).forEach((G,J)=>{m(`edit-${J}`,G,Hl.change),v(`changed-${J}`,`Changed ${n}. The views built on the face were redrawn.`)});const R=e.asks??[],E=R[R.length-1],M=E?e.views[E.view]:null,L=!!E&&!!M&&(M.status==="generating"&&e.activeView===E.view||M.status==="candidate"&&M.adjustment===E.text||!!M.error),H=new Set((e.identityEdits??[]).map(G=>G.toLowerCase())),D=(L?R.slice(0,-1):R).filter(G=>!(G.view==="portrait"&&H.has(G.text.replace(/\s+/g," ").toLowerCase()))),K=[...R,...e.results??[],...e.decisions??[]].map(G=>G.at).reduce((G,J)=>J>G?J:G,""),O=c.filter(G=>!h.has(G)&&(G.q!==u||G.at<=K));for(const G of O)h.add(G);const _=(e.results??[]).filter(G=>G.how!=="restored"),re=!e.activeView&&e.stage==="idle",z=new Map,F=new Map,Q=new Map;for(const G of _){const J=`${G.view}:${G.hash}`;if(Q.set(J,G),z.has(J))continue;const ne=(F.get(G.view)??0)+1;F.set(G.view,ne),z.set(J,ne)}const V=G=>z.get(`${G.view}:${G.hash}`)??1,I=(G,J)=>{const ne=V(G),W=e.views[G.view].hash===G.hash,he=(F.get(G.view)??0)>1;return{kind:"scenri",id:J,text:`Here is ${bn[G.view]} ${ne}.`,thumb:G.hash,view:G.view,label:`${tc[G.view]} ${ne}`,current:he&&W&&Q.get(`${G.view}:${G.hash}`)===G,restore:re&&!W?{view:G.view,hash:G.hash}:void 0}},B=new Set,Y=new Map(R.map(G=>{const J=_.find(ne=>!B.has(ne)&&ne.how==="drawn"&&ne.view===G.view&&ne.ask===G.text&&ne.at>=G.at);return J&&B.add(J),[G,J]})),ae=(e.decisions??[]).filter(G=>!(G.view==="portrait"&&G.what==="use")),X=G=>[{kind:"scenri",id:`asked-decided-${G.at}`,text:G.view==="portrait"?`Here is ${n} with the change. Use this, or keep the previous one. Using it redraws the views built on the face.`:`Redrew the ${bn[G.view]}. Use it, or keep the previous one.`},{kind:"you",id:`decided-${G.at}`,text:G.what==="again"?"Try again":G.what==="keep"?"Keep previous":"Use it",editable:!1}],le=[...D.map(G=>{const J=Y.get(G);return{at:G.at,turns:[{kind:"scenri",id:`asked-ask-${G.at}`,text:Hl.change},{kind:"you",id:`ask-${G.at}`,text:G.text,editable:!1},...J?[I(J,`redrew-${G.at}`)]:[]]}}),..._.filter(G=>!B.has(G)).map(G=>({at:G.at,turns:[I(G,`result-${G.at}`)]})),...ae.map(G=>({at:G.at,turns:X(G)})),...O.map(G=>({at:G.at,turns:ri(G)}))];le.sort((G,J)=>G.at<J.at?-1:G.at>J.at?1:0);for(const G of le)f.push(...G.turns);if(i.scopeAsk)return m("scope-ask",i.scopeAsk.said),w({id:"scope",kind:"choice",prompt:Hl.scope,options:[{id:"view",label:`This view (the ${bn[r]})`},{id:"identity",label:"The presenter"}]}),p();const ke=()=>{L&&E&&m(`ask-${E.at}`,E.text,Hl.change)};if(C){const G=e.views[C];return ke(),v(`drawing-${C}`,L&&(E==null?void 0:E.view)===C?C==="portrait"?`Changing ${n}. Everything else stays.`:`Redrawing the ${bn[C]}.`:G.status==="stale"||S.some(J=>e.views[J].status==="stale")?`Redrawing the views built on the face. The ${bn[C]} first.`:`Drawing the ${bn[C]}.`),p()}if(j){ke();const G=e.views[j];return G.hash&&f.push({kind:"scenri",id:`candidate-${j}-${G.hash}`,text:j==="portrait"?`Here is ${n} with the change.`:`Redrew the ${bn[j]}.`,thumb:G.hash,label:tc[j],view:j,current:!0}),w({id:j==="portrait"?"revision":"view-revision",kind:"confirm",prompt:j==="portrait"?"Use this, or keep the previous one. Using it redraws the views built on the face.":"Use it, or keep the previous one.",options:[{id:"use",label:j==="portrait"?"Use this":"Use it"},{id:"keep",label:"Keep previous"},{id:"again",label:"Try again"}]}),p()}if(i.failed||N){ke();const G=!!N&&e.views[N].error==="cancelled";return w({id:"retry",kind:"confirm",...G?{quiet:!0}:{tone:"alert"},prompt:G?`Stopped drawing the ${bn[N]}. Nothing finished was touched.`:N?`The ${bn[N]} could not be drawn: ${V0(e.views[N].error??"")}. Nothing finished was touched.`:`That did not go through: ${V0(i.failed??"")}. Nothing finished was touched.`,options:[{id:"retry",label:G?"Draw it again":"Retry"}]}),p()}if(i.conflict)return w({id:"conflict",kind:"confirm",tone:"alert",prompt:`${n} changed in another tab. Reload to continue.`,options:[{id:"reload",label:"Reload"}]}),p();const te=S.find(G=>e.views[G].status==="stale");return te?(v(`drawing-${te}`,`Redrawing the views built on the face. The ${bn[te]} first.`),p()):(t&&zR(e,t)&&w({id:"save",kind:"confirm",prompt:`The set is coherent. ${Hl.saved}`,options:[{id:"save",label:"Save changes"}]}),p())}function xoe(e,t,n){return!(!n||t.id!==n||e&&e.id===t.id&&t.updatedAt<e.updatedAt)}function BR(e,t){const[n,r]=s.useState(null),[a,i]=s.useState(!1),[c,u]=s.useState(null),[f,h]=s.useState(!1),p=s.useRef(!0);s.useEffect(()=>(p.current=!0,()=>{p.current=!1}),[]);const m=s.useRef(t);m.current=t;const v=s.useCallback(H=>{p.current&&r(D=>xoe(D,H,m.current)?H:D)},[]);s.useEffect(()=>{r(null),i(!1),u(null),h(!1)},[t]);const w=s.useCallback(async()=>{if(!t)return;const H=t;try{v(await Me.presenterDraft(e,H))}catch(D){if(!p.current||m.current!==H)return;/HTTP 404|not found/i.test(String((D==null?void 0:D.message)??D))?i(!0):u(String((D==null?void 0:D.message)??D))}},[e,t,v]);s.useEffect(()=>{w()},[w]);const y=!!n&&(n.stage!=="idle"||!!n.activeView);s.useEffect(()=>{if(!y)return;const H=setInterval(()=>void w(),1500);return()=>clearInterval(H)},[y,w]);const b=s.useCallback(async H=>{const D=m.current;h(!0),u(null);try{return v(await H()),!0}catch(K){return!p.current||m.current!==D?!1:(K==null?void 0:K.status)===409?(w(),!1):(u(String((K==null?void 0:K.message)??K)),!1)}finally{p.current&&h(!1)}},[v,w]),k=s.useCallback((H,D,K)=>b(async()=>(await Me.generateDraftView(e,t??"",H,{...D?{adjustment:D}:{},...K?{decide:K}:{}})).draft),[b,e,t]),S=s.useCallback(H=>b(()=>Me.approveDraftView(e,t??"",H)),[b,e,t]),C=s.useCallback(H=>b(()=>Me.redoDraftView(e,t??"",H)),[b,e,t]),j=s.useCallback(H=>b(()=>Me.revertDraftView(e,t??"",H)),[b,e,t]),[N,P]=s.useState(!1),$=s.useCallback(async()=>{P(!0);try{return await b(()=>Me.stopDraft(e,t??""))}finally{p.current&&P(!1)}},[b,e,t]),R=s.useCallback((H,D)=>b(()=>Me.restoreDraftView(e,t??"",H,D)),[b,e,t]),E=s.useCallback((H,D)=>b(()=>Me.placeDraftPhoto(e,t??"",H,D)),[b,e,t]),M=s.useCallback(H=>b(()=>Me.updatePresenterDraft(e,t??"",H)),[b,e,t]),L=s.useCallback(()=>u(null),[]);return{draft:n,gone:a,err:c,busy:f,drawing:y,reload:w,generate:k,approve:S,redo:C,revert:j,stop:$,stopping:N,restore:R,placePhoto:E,update:M,clearErr:L}}function koe({presenterId:e,onLeave:t,caps:n}){var ze,nt;const{brand:r}=on(),{applyBrand:a,refreshBrands:i}=Rn(),c=Cc(),u=!!(n!=null&&n.canGenerate),[f,h]=s.useState(null),[p,m]=s.useState(null),[v,w]=s.useState(goe),[y,b]=s.useState(""),[k,S]=s.useState(null),[C,j]=s.useState(!1),[N,P]=s.useState(null),[$,R]=s.useState(!1),[E,M]=s.useState(!1),L=s.useRef(new Set),H=(((ze=r.json)==null?void 0:ze.characters)??[]).find(ce=>ce.id===e),D=((nt=H==null?void 0:H.name)==null?void 0:nt.trim())||"them",K=H?{shots:H.shots??[],identityEdits:H.identityEdits??[]}:null;s.useEffect(()=>{let ce=!0;return h(null),m(null),Me.editPresenter(r.id,e).then(ve=>{ce&&h(ve.id)}).catch(ve=>{ce&&m(String((ve==null?void 0:ve.message)??ve))}),()=>{ce=!1}},[r.id,e]);const O=BR(r.id,f),_=O.draft,re=_?`presenter-edit:${r.id}:${e}:${_.id}`:void 0,z=!0;s.useEffect(()=>{if(!_||O.busy||!u||O.err)return;const ce=aA(_);if(!ce||_.views[ce].status==="empty"&&!v.building)return;const ve=`${ce}:${_.views[ce].attempts}:${_.generations}:${_.views[ce].status}`;L.current.has(ve)||(L.current.add(ve),O.generate(ce,void 0,Do(ce)))},[_,O.busy,O.generate,u,O.err,v.building]);const F=_?oA(_,k):"portrait",Q=_?_.views[F]:null,V=!!_&&(_.activeView===F||_.stage==="analyzing"),I=!!_&&!_.activeView&&_.stage==="idle",B=O.err&&_&&!_.activeView?O.err:null,Y=s.useMemo(()=>boe({draft:_,base:K,name:D,selected:F,canGenerate:u,ui:{...v,failed:B}}),[_,K,D,F,u,v,B]),ae=_R(Y),X=!!_&&!!K&&zR(_,K),le=s.useCallback(ce=>{re&&_i(re),t(ce)},[re,t]),ke=s.useCallback(async()=>{if(!(!_||$)){R(!0),P(null);try{const ce=await Me.savePresenterDraft(r.id,_.id);le(ce.presenter.id),a(ce.brand)}catch(ce){R(!1);const ve=String((ce==null?void 0:ce.message)??ce);/changed elsewhere|HTTP 409/i.test(ve)?w(Pe=>({...Pe,conflict:ve})):P(ve)}}},[_,$,r.id,a,le]),te=s.useCallback(async()=>{M(!0);try{_&&await Me.deletePresenterDraft(r.id,_.id)}catch{}le(e)},[_,r.id,e,le]),be=s.useCallback(async()=>{M(!0);try{const ce=await Me.revertPresenter(r.id,e);_&&await Me.deletePresenterDraft(r.id,_.id).catch(()=>{}),le(ce.presenter.id),a(ce.brand)}catch(ce){M(!1),P(String((ce==null?void 0:ce.message)??ce))}},[r.id,e,_,a,le]),G=s.useCallback((ce,ve)=>{var Pe;if(P(null),!!_)switch(ce){case"legacy":if(ve.kind!=="confirm")return;w(ue=>({...ue,building:ve.id==="build",buildDeclined:ve.id!=="build"}));return;case"scope":{if(ve.kind!=="choice")return;const ue=((Pe=v.scopeAsk)==null?void 0:Pe.said)??"";w(Ee=>({...Ee,scopeAsk:null})),ve.id==="identity"?O.generate("portrait",ue):O.generate(F,ue,Do(F)),S(ve.id==="identity"?"portrait":F);return}case"revision":case"view-revision":{if(ve.kind!=="confirm")return;const ue=Object.keys(_.views).find(Ee=>_.views[Ee].status==="candidate")??F;ve.id==="use"&&O.approve(ue),ve.id==="keep"&&O.revert(ue),ve.id==="again"&&O.generate(ue,_.views[ue].adjustment,Do(ue)),j(!1);return}case"retry":{if(O.err){O.clearErr(),L.current=new Set;return}const ue=Object.keys(_.views).find(Ee=>!!_.views[Ee].error);ue&&O.generate(ue,_.views[ue].adjustment,Do(ue));return}case"conflict":w(ue=>({...ue,conflict:null})),M(!0),i().finally(()=>le(e));return;case"save":ke();return}},[_,v.scopeAsk,O,F,ke,i,le,e]),J=s.useCallback(ce=>{const ve=ce.trim();if(!ve||!_)return!1;P(null);const Pe=(ae==null?void 0:ae.id)??null,ue=Yh(),Ee=(Ie,Be)=>({...Ie,asides:[...Ie.asides??[],{said:ve,reply:Be,q:Pe,at:ue}]}),Ke=Ie=>Ie.scopeAsk?{...Ie,scopeAsk:null,asides:[...Ie.asides??[],{said:Ie.scopeAsk.said,reply:Hl.scope,q:"scope",at:Ie.scopeAsk.at}]}:Ie,ye=Zo(ve,ra);if(ye&&ye!=="vague")return w(Ie=>Ee(Ie,yoe(ye,D,(Ie.asides??[]).some(Be=>Be.q===Pe)))),b(""),!0;if(!u)return P("Image generation is not set up, so nothing can be redrawn yet."),!1;const Se=ZR(ve,F,_);return"blocked"in Se?(P(Se.blocked),!1):Se.scope==="out-of-scope"?(w(Ie=>Ee(Ke(Ie),VR(D))),b(""),!0):Se.scope==="ambiguous"?(w(Ie=>({...Ke(Ie),scopeAsk:{said:ve,at:ue}})),b(""),!0):(w(Ie=>Ke(Ie)),S(Se.view),j(!1),O.generate(Se.view,ve,Se.scope==="view"?Do(Se.view):void 0),b(""),!0)},[_,u,F,O,ae==null?void 0:ae.id,D]),ne=_?foe(y,F,_,D):null,W=ne?{chip:ne.chip?{label:ne.chip.label,thumb:_!=null&&_.views[ne.chip.view].hash?dn(_.views[ne.chip.view].hash,"micro"):void 0}:null,hint:ne.hint,tone:ne.tone}:null,he=C&&(Q!=null&&Q.prior)?Q.prior:Q==null?void 0:Q.hash,Xe=_?(ae==null?void 0:ae.id)==="legacy"?"Decide above.":(ae==null?void 0:ae.id)==="conflict"?"Reload to continue.":(ae==null?void 0:ae.id)==="scope"?"Pick above.":(ae==null?void 0:ae.id)==="retry"?"Retry above.":_.stage==="analyzing"?"Reading the photos.":_.activeView?"":null:null,tt=!!_;return{d:_,record:H,name:D,view:F,slot:Q,dirty:X,saving:$,leaving:E,openErr:p,canRevert:!!(H!=null&&H.revisionOf),discard:te,revert:be,keepPrevious:Q&&Q.status==="approved"&&Q.prior&&!V&&!(_!=null&&_.activeView)&&(_==null?void 0:_.stage)==="idle"?()=>void O.revert(F):null,surface:{title:"Edit presenter",memoryKey:re,resumed:z,turns:Y,busy:O.busy||$||E,stage:_?{hash:he,alt:`${tc[F]}${(Q==null?void 0:Q.status)==="candidate"?", candidate":""}`,drawing:V,since:dA(_),doing:fA(_),takes:yv(_,F)?[]:pA(_,F),onTake:I?ce=>void O.restore(F,ce):void 0,items:iA(_,F),onPick:ce=>{S(ce),j(!1)},compare:Q&&Q.status==="candidate"&&Q.prior?{on:C,toggle:()=>j(ce=>!ce)}:void 0}:null,composer:tt?{placeholder:F==="portrait"?`What should change about ${D}?`:`Change this view: ${bn[F]}`,label:"What should change",action:"Refine",scope:Xe?null:W,hint:null,why:Xe??void 0,error:N,disabled:O.busy||$||E||!!Xe,working:!!(_!=null&&_.activeView),onStop:_!=null&&_.activeView?()=>void O.stop():void 0,stopping:O.stopping,focusKey:`${(ae==null?void 0:ae.id)??"open"}:${(_==null?void 0:_.id)??""}`}:null,text:y,onText:b,onSend:J,onAnswer:G,onRestore:(ce,ve)=>{S(ce),O.restore(ce,ve)}},setupNeeded:u?null:c}}function Soe({onClose:e,...t}){const n=koe(t),r=o.jsxs(o.Fragment,{children:[n.canRevert&&o.jsx(Wn,{label:"Revert last change",tone:"quiet",title:"Revert the last saved change?",body:`${n.name} goes back to the pictures and the person before the last save. Shots already made keep what they were made with.`,busy:n.leaving,onConfirm:()=>void n.revert()}),n.dirty&&o.jsx(Wn,{label:"Discard changes",tone:"quiet",title:"Discard the changes?",body:"The views redrawn in this session are thrown away. The saved presenter stays as it was.",busy:n.leaving,onConfirm:()=>void n.discard()})]}),a=n.keepPrevious?o.jsxs("div",{className:"sc-pstudio-offer",children:[o.jsxs("span",{children:["Redrew the ",bn[n.view],"."]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:n.keepPrevious,children:"Keep previous"})]}):n.openErr?o.jsx("p",{className:"sc-newdlg-err",role:"alert",children:n.openErr}):null;return o.jsx(bw,{surface:{...n.surface,headAction:r,dock:a},onClose:e})}function Eoe(){const{presenterId:e=""}=Bs(),{brand:t}=on(),n=Dn(),{caps:r}=Pv();Ec("Edit presenter");const[a]=s.useState(()=>Av(t,e)),i=s.useCallback(u=>n(ha(t,u),{replace:!0}),[n,t]),c=s.useCallback(()=>n(ha(t,e),{replace:!0}),[n,t,e]);return a!==e?o.jsx(fo,{to:Gp(t,a),replace:!0}):o.jsx(Soe,{presenterId:e,onLeave:i,onClose:c,caps:r})}function Coe(e,t){return(t.source!=="synthetic"||(t.direction??"")===Am(e.answers))&&joe(t.keepItems,Nm(e.answers))}function joe(e,t){const n=e??[];return n.length!==t.length?!1:t.every((r,a)=>{const i=n[a];return!i||i.id!==r.id||i.words!==r.words?!1:(i.refs??[]).every(c=>(r.refs??[]).includes(c))})}function Aoe(e,t){return{...t.source==="synthetic"?{direction:Am(e.answers)}:{},keepItems:Nm(e.answers)}}const Noe=e=>e.source==="photos"?e.views.front.hash?"front":null:e.views.portrait.hash?"portrait":null;function UR(e){if(!e.draftId)return!1;const t=e.draft;return t?e.seededFor!==t.id&&(!e.state.answers.source||!G6(e.state,e.ctx)):!0}function Moe(e){const{state:t,draft:n,ctx:r}=e;if(e.busy||e.err)return[];if(n){if(UR(e))return[{kind:"seed",...Kae(n)}];if(!G6(t,r))return[];const i=[];Coe(t,n)||i.push({kind:"sync",patch:Aoe(t,n),redo:Noe(n)});const c=e.canDraw?aA(n):null;return c&&i.push({kind:"draw",view:c,decide:Do(c)}),i}if(e.draftId)return[];if(!e.canDraw||!G6(t,r))return[];const a=t.answers.source;return(a==null?void 0:a.door)==="scratch"&&a.via!=="taps"?[{kind:"start"}]:[]}function Roe(e){for(const t of Moe(e))if(!e.done.has(WR(t,e)))return t;return null}function WR(e,t){const n=t.draft;switch(e.kind){case"seed":return`seed:${n==null?void 0:n.id}`;case"start":return`start:${t.state.revision}`;case"sync":return`sync:${n==null?void 0:n.id}:${JSON.stringify(e.patch)}:${e.redo??""}`;case"draw":{const r=n==null?void 0:n.views[e.view];return`draw:${n==null?void 0:n.id}:${e.view}:${(r==null?void 0:r.attempts)??0}:${(n==null?void 0:n.generations)??0}:${(r==null?void 0:r.status)??""}`}}}const su=(e,t)=>`scenri:presenter-setup:${e}:${t}`,au={read(e){try{return sessionStorage.getItem(e)}catch{return null}},write(e,t){try{sessionStorage.setItem(e,t)}catch{}},remove(e){try{sessionStorage.removeItem(e)}catch{}}};function Poe(e,t){var r,a,i;const n=t==="keep"?"detail":((a=va(((r=Jr(t))==null?void 0:r.id)??"glasses"))==null?void 0:a.label.toLowerCase())??"detail";return`${(i=e.answers[t])!=null&&i.refs.length?"Replace":"Add"} the picture of the ${n}`}function Z5(e,t,n){const r=e.editing&&e.editing!=="name"?e.editing:e.saying??jm(e.answers,t);if(r==="keep"||!r&&n==="agree")return"keep";if(!r)return null;const a=Jr(r);return a&&a.part==="what"?`trait-${a.id}`:null}function Loe({draftId:e,convoKey:t,onOpenDraft:n,onLeaveDraft:r,onStarted:a,caps:i}){var me,_e;const{brand:c}=on(),{presenterCategories:u,applyBrand:f}=Rn(),h=Cc(),p=!!(i!=null&&i.canGenerate),[m,v]=s.useReducer(dae,{brandId:c.id,convoKey:t},U=>{const pe=op(au.read(su(U.brandId,U.convoKey)));return pe?{...ap,answers:pe.answers,revision:pe.revision,asides:pe.asides}:ap}),w=s.useRef(m);w.current=m;const y=fae(m),b=Object.keys(m.answers).length>0||m.asides.length>0,k=s.useRef(t);s.useEffect(()=>{b?au.write(su(c.id,t),y):au.remove(su(c.id,t));const U=k.current;k.current=t,U!==t&&e&&t===e&&(au.remove(su(c.id,U)),_i(`presenter-create:${c.id}:${U}`))},[c.id,t,e,y,b]);const S=s.useRef(null);s.useEffect(()=>{if(!e||S.current===y)return;const U=setTimeout(()=>{S.current=y,Me.updatePresenterDraft(c.id,e,{setup:y}).catch(()=>{S.current=null})},800);return()=>clearTimeout(U)},[c.id,e,y]);const[C,j]=s.useState(null),[N,P]=s.useState(!1),[$,R]=s.useState(null),[E,M]=s.useState([]),[L,H]=s.useState(!1),[D,K]=s.useState(null),[O,_]=s.useState(!1),[re,z]=s.useState(null),[F,Q]=s.useState(null),[V,I]=s.useState(0),[B,Y]=s.useState([]),ae=s.useRef(new Map),[X]=s.useState(()=>!!e||!!op(au.read(su(c.id,t))));s.useEffect(()=>()=>{for(const U of ae.current.values())URL.revokeObjectURL(U)},[]);const le=s.useRef(!1),ke=s.useRef(new Set),te=s.useRef(!1),be=s.useRef(null),G=s.useRef(!1),J=BR(c.id,e),ne=J.draft,W=s.useMemo(()=>IR(ne,p),[ne,p]);s.useEffect(()=>{ke.current=new Set,le.current=!1,M([]),S.current=null,e||(G.current=!1)},[e]),s.useEffect(()=>{if(le.current||!ne)return;const U=OK(ne,E);U&&(le.current=!0,M(U))},[ne,E]),s.useEffect(()=>{J.gone&&r()},[J.gone,r]);const he=s.useCallback(()=>{au.remove(su(c.id,t)),_i(`presenter-create:${c.id}:${t}`)},[c.id,t]),Xe=s.useCallback(U=>n(U,!0),[n]),tt=s.useCallback(async()=>{const U=w.current;if(!p||O)return;const pe=U.revision;_(!0),R(null);try{const Oe=Nm(U.answers),Le=await Me.createPresenterDraft(c.id,{source:"synthetic",direction:Am(U.answers),...Oe.length?{keepItems:Oe}:{}});if(w.current.revision!==pe){Me.deletePresenterDraft(c.id,Le.id).catch(()=>{});return}Xe(Le.id)}catch(Oe){R(String((Oe==null?void 0:Oe.message)??Oe))}finally{_(!1)}},[c.id,p,O,Xe]),ze=s.useCallback(async()=>{const U=w.current,pe=U.answers.photos;if(!(pe!=null&&pe.hashes.length)||!pe.attested||O)return;const Oe=U.revision;_(!0),R(null);try{const Le=await Me.createPresenterDraft(c.id,{source:"photos",imageHashes:pe.hashes,attestation:!0});if(w.current.revision!==Oe){Me.deletePresenterDraft(c.id,Le.id).catch(()=>{});return}Xe(Le.id)}catch(Le){R(String((Le==null?void 0:Le.message)??Le))}finally{_(!1)}},[c.id,O,Xe]),nt=s.useCallback(async U=>{R(null);const pe=()=>{var vt;return((vt=w.current.answers.photos)==null?void 0:vt.hashes)??[]},Oe=U.slice(0,Math.max(0,p0-pe().length)),Le=[];let bt=0;v({type:"upload-begin"});try{for(const vt of Oe){if(vt.size>dx){Le.push(bae(vt.name,dx));continue}try{const jt=await L0(vt);pe().includes(jt)&&(bt+=1),v({type:"uploaded",hash:jt,max:p0})}catch{Le.push(xae(vt.name))}}}finally{v({type:"upload-end"})}R(yae({over:U.length-Oe.length,same:bt,failed:Le,max:p0}))},[]),ce=s.useCallback(U=>{v({type:"answer",patch:U,ctx:W})},[W]),ve=s.useCallback(async U=>{const pe=U??ne;if(!pe||L)return;const Oe=IK(pe,pe.name,p);if(Oe){K(Oe);return}H(!0),K(null);try{await Me.updatePresenterDraft(c.id,pe.id,{facets:E});const Le=await Me.savePresenterDraft(c.id,pe.id);f(Le.brand),he(),v({type:"start-over"}),a({kind:"presenter",id:Le.presenter.id,name:Le.presenter.name})}catch(Le){H(!1),K(String((Le==null?void 0:Le.message)??Le))}},[ne,L,p,c.id,E,he,a,f]),Pe=s.useCallback(async()=>{var pe;if(!ne||L)return;const U=(pe=ne.sources)==null?void 0:pe[0];if(!U||ne.views.portrait.status==="approved"){ve();return}H(!0),K(null);try{const Oe=await Me.placeDraftPhoto(c.id,ne.id,"portrait",U);H(!1),await ve(Oe)}catch(Oe){H(!1),K(String((Oe==null?void 0:Oe.message)??Oe))}},[ne,L,c.id,ve]),ue=s.useCallback(async()=>{const pe=w.current.answers.describe||(ne==null?void 0:ne.direction)||"";G.current=!0,he(),v({type:"start-over",text:pe}),R(null),z(null),Q(null),ke.current=new Set,ne&&!lA(ne)&&await Me.deletePresenterDraft(c.id,ne.id).catch(()=>{}),r()},[ne,c.id,he,r]),Ee=ne?J.err&&!nc(ne)?J.err:null:$,Ke=s.useMemo(()=>soe({state:m,draft:ne,canGenerate:p,failed:Ee,awaiting:UR({state:m,draft:ne,ctx:W,draftId:e,seededFor:be.current})}),[m,ne,p,Ee,e,W]),ye=_R(Ke),Se=s.useRef(null);Se.current=(ye==null?void 0:ye.id)??null;const Ie=ne?oA(ne,C):"portrait",Be=ne?ne.views[Ie]:null,Re=!!ne&&(ne.activeView===Ie||ne.stage==="analyzing"),Ze=!!ne&&!ne.activeView&&ne.stage==="idle",Qe={state:m,draft:ne,ctx:W,canDraw:p,busy:J.busy||O||te.current||G.current||(ne?nc(ne):!1),err:!!J.err||!!$,draftId:e,seededFor:be.current,done:ke.current},lt=Roe(Qe),Lt=s.useRef(lt);Lt.current=lt;const Ut=lt?WR(lt,Qe):"";s.useEffect(()=>{var pe;ne&&be.current!==ne.id&&!Qe.busy&&!Qe.err&&((pe=Lt.current)==null?void 0:pe.kind)!=="seed"&&(be.current=ne.id);const U=Lt.current;if(!(!U||ke.current.has(Ut)))switch(ke.current.add(Ut),U.kind){case"seed":be.current=(ne==null?void 0:ne.id)??null,v({type:"restore",answers:U.answers,revision:w.current.revision+1,asides:U.asides});return;case"start":tt();return;case"sync":te.current=!0,(async()=>{await J.update(U.patch),U.redo&&await J.redo(U.redo)})().finally(()=>{te.current=!1});return;case"draw":J.generate(U.view,void 0,U.decide);return}},[Ut,ne,tt,J.update,J.redo,J.generate]);const Ct=s.useCallback((U,pe,Oe,Le,bt=!1)=>{v({type:"aside",aside:{said:U,reply:pe,q:Oe,at:Yh(),kind:Le,...bt?{edit:!0}:{}}})},[]),cn=s.useCallback((U,pe)=>{R(null);const Oe=w.current;if(_s(U)){if(U==="weakphotos"&&pe.kind==="confirm"){pe.id==="again"&&ue(),pe.id==="anyway"&&ce({weakphotos:{pick:"anyway"}});return}const Le=Yae(U,pe,Oe.answers);if(Le){const bt=Oe.text.trim(),vt=Le[U],jt=(rr(U)||!!Jr(U))&&vt&&typeof vt=="object"&&!vt.words;ce(jt&&bt?{...Le,[U]:{...vt,words:p8(bt)}}:Le);return}if(U==="photos"&&pe.kind==="photos"){const bt=pe.action;bt.type==="add"&&nt(bt.files),bt.type==="remove"&&v({type:"remove-photo",hash:bt.hash}),bt.type==="attest"&&v({type:"attest",checked:bt.checked}),bt.type==="reject"&&R("That was not an image. Drop a photo, or choose a file."),bt.type==="submit"&&ze(),bt.type==="back"&&ce({source:{door:"scratch",via:"taps"}})}return}switch(U){case"unsure":{if(pe.kind!=="confirm"||pe.id!=="use"||!Oe.unsure)return;const Le=Oe.unsure.said,bt=Oe.unsure.q==="describe"?"describe":"source";v({type:"settle-unsure",ctx:W}),ce(bt==="describe"?{describe:Le}:{source:{door:"scratch",via:"typed"},describe:Le});return}case"noengine":pe.kind==="confirm"&&pe.id==="setup"&&h(),pe.kind==="confirm"&&pe.id==="photos"&&ce({source:{door:"photos",via:"taps"}});return;case"agree":{if(pe.kind!=="confirm")return;pe.id==="draw"&&tt();return}case"identity":if(pe.kind!=="confirm"||!ne)return;pe.id==="use"&&(J.approve("portrait"),j(null)),pe.id==="again"&&J.generate("portrait"),pe.id==="change"&&I(Le=>Le+1);return;case"revision":case"view-revision":{if(pe.kind!=="confirm"||!ne)return;const Le=U==="revision"?"portrait":Object.keys(ne.views).find(bt=>ne.views[bt].status==="candidate")??Ie;pe.id==="use"&&J.approve(Le),pe.id==="keep"&&J.revert(Le),pe.id==="again"&&J.generate(Le,ne.views[Le].adjustment,Do(Le)),P(!1);return}case"retry":{if(!ne){ke.current=new Set,R(null);return}if(J.err){J.clearErr(),ke.current=new Set;return}const Le=Object.keys(ne.views).find(bt=>!!ne.views[bt].error);Le&&J.generate(Le,ne.views[Le].adjustment,Do(Le));return}case"extras":if(pe.kind!=="confirm")return;pe.id==="add"&&J.update({extras:!0}),pe.id==="save"&&v({type:"extras-declined"});return;case"blind":if(pe.kind!=="confirm")return;pe.id==="save"&&Pe(),pe.id==="setup"&&h();return;case"save":ve();return}},[ce,nt,ze,tt,h,ne,J,Ie,ve]),Fe=s.useCallback(U=>{var Ht,pn,Wt,wn,sn,In,Dt,On,Et,Hn;const pe=U.trim(),Oe=w.current,Le=F5(Oe,ye),bt=Le&&((Ht=Oe.colour)==null?void 0:Ht.step)===Le?Oe.colour.hex:null,vt=Le&&rr(Le)?Le.slice(5):null,jt=Le==="keep"?(((pn=Oe.answers.keep)==null?void 0:pn.refs)??[]).length:Le!=null&&Le.startsWith("trait-")?(((Wt=Oe.answers[Le])==null?void 0:Wt.refs)??[]).length:0,st=pe||bt||"";if(!st&&!jt)return!1;if(R(null),Le==="name"){const Ot=st.replace(/^(?:(?:her|his|their|the|my)\s+name\s+is|call\s+(?:her|him|them)|name:)\s*/i,"").trim()||st;return ne&&J.update({name:Ot.slice(0,60)}),v({type:"text",text:""}),!0}const $t=(Ot,tn)=>Oe.asides.filter(Vn=>Vn.q===Ot&&Vn.kind===tn).length,An=(Ot,tn=null)=>m8(Ot,tn,!!(ne!=null&&ne.views.portrait.hash)),q=(Ot,tn,Vn,ur)=>{const Zr=Vn!==null&&Oe.editing===Vn;Zr&&ce({[Vn]:void 0}),Ct(Ot,tn,Vn,ur,Zr)};if(Le&&Le!=="keep"&&Le.startsWith("trait-")){const Ot=Jr(Le);if(!Ot)return!1;const tn=Ot.part==="what"?((wn=Oe.answers[Le])==null?void 0:wn.refs)??[]:[];if(!pe&&tn.length)return ce({[Le]:{pick:(sn=Oe.answers[Le])==null?void 0:sn.pick,words:qae(Ot.id,tn.length),refs:tn}}),!0;const Vn=rh(Le,pe,ra);if(!pe||Vn)return q(pe,Ll(Vn??"vague",An(Le),$t(Le,Vn??"vague"),pe,void 0,!0),Le,Vn??"vague"),!0;const ur=P5(pe),Zr=ur?p8(pe):pe;if(Ot.part==="where"){const zn=Oe.answers[Le];ce({[Le]:{pick:ur?zn==null?void 0:zn.pick:void 0,words:Zr}})}else{const zn=Oe.answers[Le];ce({[Le]:{pick:ur?zn==null?void 0:zn.pick:void 0,words:Zr,refs:(zn==null?void 0:zn.refs)??[]}})}return!0}if(Le==="keep"){const Ot=Oe.answers.keep,tn=(Ot==null?void 0:Ot.refs)??[],Vn=pe||(tn.length&&!(Ot!=null&&Ot.words)?"the detail in the attached picture":"");return Vn?(ce({keep:{words:[(In=Ot==null?void 0:Ot.words)==null?void 0:In.trim(),Vn].filter(Boolean).join(", "),refs:tn}}),!0):!1}if(Le&&rr(Le)&&vt){const Ot=pe&&!/^#[0-9a-f]{6}$/i.test(pe)?rh(Le,pe,ra):null;if(Ot)return q(pe,Ll(Ot,An(Le),$t(Le,Ot),pe,vt,!0),Le,Ot),!0;const tn=Oe.answers[Le],Vn=!pe||P5(pe),ur=bt??(Vn?tn==null?void 0:tn.pick:void 0),Zr={pick:ur,words:pe?Vn?p8(pe):pe:tn==null?void 0:tn.words};if(pe&&!ur&&!Wae(Oe.answers,Le,Zr,pe)){const zn=Oe.answers.keep;return ce({keep:{words:[(Dt=zn==null?void 0:zn.words)==null?void 0:Dt.trim(),Uae(pe)].filter(Boolean).join(", "),refs:(zn==null?void 0:zn.refs)??[]}}),!0}return ce({[Le]:Zr}),!0}const fe=(ye==null?void 0:ye.id)??null,Ae=fe==="unsure"?((On=Oe.unsure)==null?void 0:On.q)??"source":fe;if(fe==="traits"){const Ot=Zo(st,ra);if(Ot)return Ct(st,Ll(Ot,An(null,fe),$t(fe,Ot),st),fe,Ot),!0;const tn=Oe.answers.keep;return ce({traits:[],keep:{words:[(Et=tn==null?void 0:tn.words)==null?void 0:Et.trim(),st].filter(Boolean).join(", "),refs:(tn==null?void 0:tn.refs)??[]}}),!0}if(fe==="gaps"){const Ot=Zo(st,ra);if(Ot)return Ct(st,Ll(Ot,An(null,fe),$t(fe,Ot),st),fe,Ot),!0;const tn=(Oe.answers.describe??"").trim().replace(/[.\s]+$/,"");return ce({describe:tn?`${tn}, ${st}`:st}),!0}const Ye=An(null,Ae),ft=Ae==="source"?Zae(st):null,wt=ft?null:Zo(st,ra);if(wt&&(Ye==="source"||Ye==="describe"||wt!=="vague"))return Ct(st,Ll(wt,Ye,$t(fe,wt),st),fe,wt),!0;if((Ae==="source"||Ae==="describe")&&!ft&&!ra(st))return v({type:"unsure",unsure:{said:st,q:fe,at:Yh()},ctx:W}),!0;if((Ae==="source"||Ae==="describe")&&v({type:"settle-unsure",ctx:W}),Ae==="source")return ft?(ce({source:{door:ft,via:"taps"}}),!0):(ce({source:{door:"scratch",via:"typed"},describe:st}),!0);if(Ae==="describe")return ce({describe:st}),!0;if(ne&&!((Hn=ne.name)!=null&&Hn.trim())&&Ae!=="name"&&/^[A-Z][a-z]+(?:\s[A-Z][a-z]+)?$/.test(st)&&!ra(st))return J.update({name:st.slice(0,60)}),v({type:"text",text:""}),!0;if(Ae==="name"){const Ot=st.replace(/^(?:(?:her|his|their|the|my)\s+name\s+is|call\s+(?:her|him|them)|name:)\s*/i,"").trim()||st;return ne&&J.update({name:Ot.slice(0,60)}),v({type:"text",text:""}),!0}if(!ne)return!1;if(Ae==="identity")return J.generate("portrait",st),v({type:"text",text:""}),!0;const Zt=uA(st,Ie,ne);return"blocked"in Zt?(R(Zt.blocked),!1):(j(Zt.view),P(!1),J.generate(Zt.view,st,Zt.scope==="view"?Do(Zt.view):void 0),v({type:"text",text:""}),!0)},[ye,ce,Ct,ne,J,Ie]),mt=s.useCallback(U=>{if(U==="name"){v({type:"edit",id:"name"});return}const pe=xk(U);if(pe){v({type:"edit",id:`aside:${pe}`});return}if(!_s(U))return;const Oe=noe(U,ne);if(Oe==="start-over"){z("start-over");return}if(Oe==="redraw"){Q(U),z("redraw");return}v({type:"edit",id:U})},[ne]),it=s.useCallback(()=>{z(null),F&&v({type:"edit",id:F}),Q(null)},[F]),St=s.useCallback((U,pe)=>{const Oe=w.current.answers;if(U==="keep"||U.startsWith("trait-")&&!U.endsWith("-where")){const Le=Oe[U];ce({[U]:{pick:U==="keep"||Le==null?void 0:Le.pick,words:pe,refs:(Le==null?void 0:Le.refs)??[]}});return}if(rr(U)||U.startsWith("trait-")){const Le=Oe[U];ce({[U]:{pick:Le==null?void 0:Le.pick,words:pe}});return}ce({[U]:pe})},[ce]),xt=s.useCallback((U,pe)=>{const Oe=pe.trim();if(!Oe)return;if(U==="name"){v({type:"cancel-edit"}),ne&&J.update({name:Oe.slice(0,60)});return}const Le=xk(U);if(Le){const vt=w.current,jt=vt.asides.find(Ye=>Ye.at===Le);if(!jt)return;const st=jt.q&&_s(jt.q)?jt.q:null,$t=st?rh(st,Oe,ra):Zo(Oe,ra);if(!$t&&st){v({type:"drop-aside",at:Le}),St(st,Oe);return}const An=m8(st,jt.q,!!(ne!=null&&ne.views.portrait.hash)),q=st&&rr(st)?st.slice(5):void 0,fe=$t??"vague",Ae=vt.asides.filter(Ye=>Ye.q===jt.q&&Ye.at<jt.at&&Ye.kind===fe).length;v({type:"amend-aside",at:Le,said:Oe,reply:Ll(fe,An,Ae,Oe,q),kind:fe,ctx:W});return}if(!_s(U)||!z0(U,w.current.answers))return;const bt=rh(U,Oe,ra);if(bt){const vt=w.current,jt=m8(U,U,!!(ne!=null&&ne.views.portrait.hash)),st=rr(U)?U.slice(5):void 0,$t=vt.asides.filter(An=>An.q===U&&An.kind===bt).length;ce({[U]:void 0}),Ct(Oe,Ll(bt,jt,$t,Oe,st),U,bt);return}St(U,Oe)},[ne,J.update,ce,St,Fe,ye,W]),Nt=s.useCallback(()=>v({type:"cancel-edit"}),[]),Kt=s.useCallback(()=>{const U=w.current,pe=U.editing&&U.editing!=="name"&&!Z0(U.editing)?U.editing:null,Oe=pe&&!z0(pe,U.answers)?pe:ye==null?void 0:ye.id;if(Oe==="agree"){v({type:"say",id:"keep"});return}if(!(!Oe||!_s(Oe))){if(Oe==="look-who"){ce({source:{door:"scratch",via:"words"}});return}v({type:"say",id:Oe})}},[ye==null?void 0:ye.id,ce]),et=s.useCallback(()=>Z5(w.current,W,Se.current),[W]),gt=s.useCallback(U=>{const pe=et();if(pe){R(null),w.current.saying!==pe&&v({type:"say",id:pe});for(const Oe of U.slice(0,1)){const Le=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,bt=URL.createObjectURL(Oe);Y(vt=>[...vt,{key:Le,id:pe,url:bt}]),L0(Oe).then(vt=>{ae.current.set(vt,bt),v({type:"ref",id:pe,hash:vt}),Y(jt=>jt.filter(st=>st.key!==Le))}).catch(vt=>{R(String((vt==null?void 0:vt.message)??vt)),Y(jt=>jt.filter(st=>st.key!==Le)),URL.revokeObjectURL(bt)})}}},[et]),ot=(U,pe,Oe)=>{const Le=Cw(U,pe,Oe);return Le.charAt(0).toUpperCase()+Le.slice(1)},kn=U=>S5(U).flatMap(pe=>{const Oe=pe.color?nr(pe.color):null;return Oe?[{hex:Oe,name:pe.label,slot:"accent"}]:[]}),dt=Z5(m,W,(ye==null?void 0:ye.id)??null),Gt=(()=>{var $t,An,q;if(!dt)return;const U=(($t=m.answers[dt])==null?void 0:$t.refs)??[],pe=dt==="keep"?U.slice(((An=m.composing)==null?void 0:An.id)==="keep"?m.composing.refs.length:U.length):U,Oe=B.filter(fe=>fe.id===dt);if(!pe.length&&!Oe.length)return;const Le=dt==="keep"?null:Jr(dt),bt=Le&&((q=va(Le.id))==null?void 0:q.label)||"Detail",vt=pe.length+Oe.length>1;let jt=0;const st=()=>vt?`${bt} ${++jt}`:bt;return[...pe.map(fe=>({key:fe,src:ae.current.get(fe)??dn(fe,"micro"),label:st(),onRemove:()=>v({type:"ref",id:dt,hash:fe,remove:!0})})),...Oe.map(fe=>({key:fe.key,src:fe.url,label:st(),busy:!0,onRemove:()=>Y(Ae=>Ae.filter(Ye=>Ye.key!==fe.key))}))]})(),Ft=ooe(ye,m,ne,Ie),en=J.busy||O||!!Ft.off,Jt=dt,se=F5(m,ye),oe=se==="name"?null:se,we=oe&&rr(oe)?oe.slice(5):null,ge=Ft.color&&we?kn(we):null,ee=oe&&((me=m.colour)==null?void 0:me.step)===oe?m.colour.hex:null,He=ne&&Ko(ne)&&!Ft.off&&!(ye!=null&&ye.id.match(/^(name|describe)$/))?(()=>{const U=FK(m.text,Ie,ne),pe=U.chip?ne.views[U.chip.view].hash:void 0;return{chip:U.chip?{label:U.chip.label,thumb:pe?dn(pe,"micro"):void 0}:null,hint:U.hint,tone:U.tone}})():null,We=ne?iA(ne,Ie):[],Ue=(Be==null?void 0:Be.hash)??((ne==null?void 0:ne.stage)==="analyzing"?ne.sources[0]:void 0),Ge=N&&(Be!=null&&Be.prior)?Be.prior:Ue;return{d:ne,view:Ie,slot:Be,facets:E,setFacets:M,presenterCategories:u,saving:L,saveErr:D,confirming:re,setConfirming:z,confirmEdit:it,pendingEdit:F,startOver:ue,begun:Object.keys(m.answers).length>0||!!ne,unsaved:!ne&&Object.keys(m.answers).length>0,leave:()=>{he(),v({type:"start-over"})},revision:m.revision,open:(ye==null?void 0:ye.id)??null,keepPrevious:Be&&Be.status==="approved"&&Be.prior&&!Re&&!(ne!=null&&ne.activeView)&&(ne==null?void 0:ne.stage)==="idle"?()=>void J.revert(Ie):null,surface:{title:"Create presenter",memoryKey:`presenter-create:${c.id}:${t}`,resumed:X,turns:Ke,busy:J.busy||O,working:(ne==null?void 0:ne.stage)==="analyzing"?`Reading ${DR(ne.source)}`:ne!=null&&ne.activeView?"Drawing":O||J.busy,stageEmpty:{lead:Sae(ne?Ie:void 0,bn[Ie]),hint:Eae((ye==null?void 0:ye.id)??null)},stage:ne?{hash:Ge,alt:`${tc[Ie]}${(Be==null?void 0:Be.status)==="candidate"?", candidate":""}`,drawing:Re,since:dA(ne),doing:fA(ne),takes:yv(ne,Ie)?[]:pA(ne,Ie),onTake:Ze?U=>void J.restore(Ie,U):void 0,items:We,onPick:U=>{j(U),P(!1)},compare:Be&&Be.status==="candidate"&&Be.prior?{on:N,toggle:()=>P(U=>!U)}:void 0}:null,composer:{placeholder:Ft.placeholder,label:Ft.label,action:Ft.action,scope:He,hint:null,why:Ft.off??void 0,error:$??D,disabled:en,working:!!ne&&!!ne.activeView&&(ye==null?void 0:ye.id)!=="name",onStop:ne!=null&&ne.activeView?()=>void J.stop():void 0,stopping:J.stopping,focusKey:ye&&!(ye.id==="agree"&&!m.saying)?`${ye.id}:${(ne==null?void 0:ne.id)??"setup"}:${V}:${m.saying??""}:${m.says}`:void 0,onAttach:!Jt&&!ne&&(ye==null?void 0:ye.id)==="source"?()=>ce({source:{door:"photos",via:"taps"}}):void 0,onAttachFiles:Jt?gt:void 0,attachLabel:Jt?Poe(m,Jt):"Add photos",refs:Gt,colour:ge&&we?{hex:ee,label:ee?ot(ee,S5(we),we):"Pick a colour",seed:(_e=ge[Math.floor(ge.length/2)])==null?void 0:_e.hex,onPick:U=>v({type:"colour",hex:U,step:oe}),onClear:()=>v({type:"colour",hex:null,step:oe})}:null},text:m.text,onText:U=>v({type:"text",text:U}),onSend:Fe,onAnswer:cn,onRestore:(U,pe)=>{j(U),J.restore(U,pe)},onEdit:mt,onSaveEdit:xt,onCancelEdit:Nt,onDescribe:Kt,onAttachRef:gt,onStarter:U=>{(ye==null?void 0:ye.id)==="agree"&&v({type:"say",id:"keep"}),v({type:"text",text:U})},onPaste:ne?void 0:U=>void nt(U)}}}function Toe({onClose:e,...t}){const n=Loe(t),r=n.d;s.useEffect(()=>zh({open:n.open}),[n.open]),s.useEffect(()=>()=>zh(null),[]);const[a,i]=s.useState(!1),c=()=>{if(n.unsaved){i(!0);return}e()},u=n.begun?r?o.jsx(Wn,{label:"Start over",tone:"quiet",title:"Start over?",body:`This conversation begins again from the first question. ${lA(r)?"The views drawn so far are kept: the unfinished presenter stays on your wall.":"Nothing has been drawn yet, so nothing is kept."}`,open:n.confirming==="start-over"||void 0,busy:!1,onOpenChange:m=>{m||n.setConfirming(null)},onConfirm:()=>void n.startOver()}):o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void n.startOver(),children:"Start over"}):null,f=o.jsx(o.Fragment,{children:n.keepPrevious&&n.slot&&o.jsxs("div",{className:"sc-pstudio-offer",children:[o.jsxs("span",{children:["Redrew the ",bn[n.view],"."]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:n.keepPrevious,children:"Keep previous"})]})}),h=o.jsx(Wn,{label:"Change it",title:Mae,body:(r==null?void 0:r.source)==="photos"?Pae:Rae,busy:!1,open:n.confirming==="redraw",onOpenChange:m=>{m||n.setConfirming(null)},onConfirm:n.confirmEdit}),p=o.jsxs(o.Fragment,{children:[h,o.jsx(Wn,{label:"Leave",title:"Leave without drawing them?",body:"Nothing has been drawn yet, so the answers are not kept. Starting again starts from the first question.",busy:!1,open:a,onOpenChange:m=>{m||i(!1)},onConfirm:()=>{i(!1),n.leave(),e()}})]});return o.jsx(bw,{surface:{...n.surface,headAction:u,dock:f,overlay:p},onClose:c})}function $oe(){const{draftId:e=null}=Bs(),{key:t}=Zn(),{brand:n}=on(),r=Dn(),{announce:a,caps:i}=Pv();Ec("Create presenter");const c=s.useRef(!1);s.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]);const u=s.useCallback((p,m=!1)=>r(Ui(n,p),{replace:m}),[r,n]),f=s.useCallback(()=>r(Ui(n),{replace:!0}),[r,n]),h=s.useCallback(()=>r(Uo(n),{replace:!0}),[r,n]);return o.jsx(Toe,{draftId:e,convoKey:e??t,onOpenDraft:u,onLeaveDraft:f,onClose:h,onStarted:p=>{a(p),c.current&&r(p.kind==="presenter"?ha(n,p.id):Uo(n),{replace:!0})},caps:i})}const V5=1e3,Doe=3;function Hoe(e,t,n){return{name:e.name.trim()||t.name,prompt:t.prompt,lighting:t.lighting,description:t.description,subject:t.subject,camera:t.camera??"",figure:t.figure??"",figureTreatment:t.figureTreatment??"",keywords:t.keywords??[],collections:t.collections??[],verticals:t.verticals??[],...t.promptName?{promptName:t.promptName}:{},instruction:e.place.trim(),refHashes:e.pictures,...n?{previewHash:n}:{}}}function Ooe(e){var P,$;const{s:t,dispatch:n,brandId:r,sceneId:a,conversation:i,applyBrand:c}=e,[u,f]=s.useState(!1),[h,p]=s.useState(!1),m=s.useRef(t);m.current=t;const v=s.useRef(!1),w=s.useRef(e.onSaved);w.current=e.onSaved;const y=s.useCallback(async(R,E={})=>{if(!(v.current||m.current.job)){v.current=!0;try{const M=m.current,L=Or(M),H=R==="make"?{kind:R,instruction:M.place,imageHashes:M.pictures,draw:E.draw??!1,...E.shot?{shot:!0}:{}}:R==="again"?{kind:R,reading:L==null?void 0:L.reading,imageHashes:M.pictures}:{kind:R,reading:L==null?void 0:L.reading,ask:E.ask,from:(L==null?void 0:L.hash)??void 0,imageHashes:M.pictures,draw:E.draw},D=M.name.trim()||(L==null?void 0:L.reading.name)||void 0,{jobId:K,job:O}=await Me.startSceneStudioJob(r,{...H,conversation:i,...a?{sceneId:a}:{},...D?{label:D}:{}});n({type:"started",id:K,kind:O.kind,ask:O.kind===R?E.ask:void 0,since:O.phaseAt})}catch(M){n({type:"error",text:String((M==null?void 0:M.message)??M)})}finally{v.current=!1}}},[r,n]),b=t.named?t.name.trim():"",k=((P=t.job)==null?void 0:P.id)??null;s.useEffect(()=>{!k||!b||Me.labelSceneStudioJob(r,k,b).catch(()=>{})},[k,b,r]);const S=(($=t.job)==null?void 0:$.id)??null;s.useEffect(()=>{if(!S)return;let R=!0,E=0,M;const L=async()=>{try{const H=await Me.sceneStudioJob(r,S);if(!R)return;E=0,f(!1),H.status==="running"?(n({type:"progress",job:H}),M=setTimeout(L,V5)):n({type:"finished",job:H})}catch(H){if(!R)return;if((H==null?void 0:H.status)===404){n({type:"lost",id:S,error:Ne.lost});return}E++,E>=Doe&&f(!0),M=setTimeout(L,Math.min(V5*2**Math.min(E,3),8e3))}};return L(),()=>{R=!1,clearTimeout(M)}},[S,r,n]);const C=s.useCallback(()=>{const R=m.current.job;!R||R.stopping||(n({type:"stopping",id:R.id}),Me.cancelSceneStudioJob(r,R.id).catch(()=>{}))},[r,n]),j=s.useCallback(R=>{const E=yee(m.current,R);E>=0&&n({type:"put-back",index:E})},[n]),N=s.useCallback(async(R={})=>{var D,K,O,_,re;const E=m.current,M=((D=Or(E))==null?void 0:D.reading.name)||((O=(K=E.job)==null?void 0:K.pending)==null?void 0:O.name)||"",L={...E,name:E.name.trim()||M},H=gee(L);if(!(!H.can||!H.words||v.current)){v.current=!0,p(!0);try{const z=((_=E.job)==null?void 0:_.phase)==="drawing"?E.job.id:null,F=z?null:((re=Or(E))==null?void 0:re.hash)??null,Q=Hoe(L,H.words,F),V=a&&!R.asNew?await Me.updateScene(r,a,Q):await Me.createScene(r,Q);c(V.brand);const I=V.scene;if(z){const B=await Me.attachSceneStudioJob(r,z,I.id).catch(()=>null);(B==null?void 0:B.state)==="landed"&&c(B.brand)}n({type:"saved",id:I.id}),w.current({id:I.id,name:I.name,verticals:I.verticals??[]},!!R.asNew)}catch(z){n({type:"error",text:String((z==null?void 0:z.message)??z)})}finally{v.current=!1,p(!1)}}},[r,a,c,n]);return{offline:u,saving:h,start:y,stop:C,putBack:j,use:N}}const Ioe="scenri:scene-studio:",Foe=10080*60*1e3;function _oe(e){const t=cs.get(e);if(!t)return null;try{const n=JSON.parse(t);return uM(typeof(n==null?void 0:n.session)=="string"?n.session:null)}catch{return null}}function Zoe(e,t,n){cs.set(e,JSON.stringify({at:Date.now(),sceneId:n,session:t}))}function Voe(e){const t=e.trim();if(!t)return"A shot";if(t.length<=60)return t;const n=t.slice(0,60);return`${n.slice(0,Math.max(n.lastIndexOf(" "),40)).trim()}…`}function g8(e){cs.del(e)}function zoe(e=Date.now()){var t;for(const n of cs.keys(Ioe)){let r=0;try{r=Number((t=JSON.parse(cs.get(n)??"null"))==null?void 0:t.at)||0}catch{}e-r>Foe&&cs.del(n)}}function Boe(e){var en,Jt,se,oe,we;const{brand:t,applyBrand:n,sceneId:r,seed:a,conversation:i,storageKey:c,caps:u}=e,f=r&&a?{name:a.name}:null,[h]=s.useState(()=>{zoe();const ge=_oe(c);return ge||_i(c),ge}),[p,m]=s.useReducer(cee,null,()=>(h==null?void 0:h.setup)??lee),[v,w]=s.useReducer(mee,null,()=>(h==null?void 0:h.studio)??a??nM),[y,b]=s.useState(0),[k,S]=s.useState(""),C=s.useRef(null),[j,N]=s.useState(!1),[P,$]=s.useState(void 0),[R,E]=s.useState(null),M=s.useRef(!1),L=s.useRef(p);L.current=p;const H=s.useRef(v);H.current=v;const[D,K]=s.useState(null),O=s.useRef(e.onSaved);O.current=e.onSaved;const _=Ooe({s:v,dispatch:w,brandId:t.id,sceneId:r,conversation:i,applyBrand:n,onSaved:(ge,ee)=>O.current(ge,r&&!ee?"updated":"created")});s.useEffect(()=>{M.current||Zoe(c,Bee(p,v),r??v.saved)},[p,v,c,r]);const re=v.saved,z=re?Fh(t,re):void 0,F=oR(t.id,re,(z==null?void 0:z.previewUrl)??null),Q=((en=F.job)==null?void 0:en.status)==="running",[V,I]=s.useState(!1);s.useEffect(()=>{Q||I(!1)},[Q]);const B=s.useMemo(()=>gA(z==null?void 0:z.examples,F.job),[z==null?void 0:z.examples,F.job]),Y=s.useRef(e.onDone);Y.current=e.onDone;const ae=s.useMemo(()=>{var ee,He;if(!re)return;const ge=(z==null?void 0:z.examples)??[];return{tiles:B,running:Q,read:F.read,who:((ee=ge[0])==null?void 0:ee.with)??((He=F.job)==null?void 0:He.subject.kind)??((z==null?void 0:z.subject)==="person"||z!=null&&z.figure?"presenter":"product"),noSubject:F.read&&!F.job&&!ge.length&&F.more.length===0,missing:zK(F.more,ge,F.job),first:F.first,stale:F.first.length>0&&ge.length>0,finish:e.finish}},[re,z,B,Q,F.read,F.job,F.first,F.more,e.finish]),X=s.useCallback(ge=>{re&&(E(null),Me.drawSceneExamples(t.id,re,ge).then(()=>F.again()).catch(ee=>E(String((ee==null?void 0:ee.message)??ee))))},[t.id,re,F.again]),le=s.useCallback(()=>{re&&(M.current=!0,g8(c),_i(c),Y.current(re))},[re,c]),[ke,te]=s.useState(null);s.useEffect(()=>{f||p.editing||!Tk(p.answers)||w({type:"inputs",place:oee(p.answers),pictures:iee(p.answers)})},[p.answers,p.editing,f]);const be=s.useRef(new Set),G=pee(v,!f&&Tk(p.answers));s.useEffect(()=>{var ge;G===null||be.current.has(G)||(be.current.add(G),_.start("make",{draw:!1,shot:((ge=L.current.answers.source)==null?void 0:ge.door)==="shot"}))},[G,_.start]);const[J,ne]=s.useState(""),W=nw(t.id,J,!f),he=s.useRef(W);he.current=W;const Xe=s.useRef([]);W.settled&&!W.error&&(Xe.current=W.items);const tt=W.settled?W.items:Xe.current,ze=!W.error&&(!W.settled||W.loading),{recent:nt,loaded:ce}=on(),[ve,Pe]=s.useState(null);s.useEffect(()=>{!J.trim()&&W.settled&&!W.error&&Pe(W.items.length>0)},[J,W.settled,W.error,W.items.length]);const ue=ve??(nt.length>0?!0:ce?!1:null),Ee=s.useMemo(()=>({any:ue,items:tt.map(ge=>({id:ge.id,hash:ge.images[0],alt:Voe(ge.promptHead)})),query:J,more:W.settled&&W.hasMore,loading:ze,error:W.error}),[ue,tt,J,W.settled,W.hasMore,ze,W.error]),Ke=Rn().scenes,ye=s.useCallback(async ge=>{var Ge,me,_e;const ee=Xe.current.find(U=>U.id===ge)??W.items.find(U=>U.id===ge);if(!(ee!=null&&ee.images[0]))return;const He=L.current.revision;let We=_k(ee.brief);if(!We&&ee.kind==="edit"){const U=await Me.lineage(ee.id).catch(()=>null);if(We=_k((Ge=U==null?void 0:U.ancestors.find(pe=>pe.kind==="generation"))==null?void 0:Ge.brief),L.current.revision!==He)return}const Ue=We?((me=Fh(t,We))==null?void 0:me.name)??((_e=Ke.find(U=>U.id===We))==null?void 0:_e.name):void 0;Ct({shot:{id:ee.id,hash:ee.images[0],...We&&Ue?{scene:{id:We,name:Ue}}:{}},reuse:void 0})},[t,Ke,W.items]),Se=s.useCallback(()=>{var ee;const ge=(ee=L.current.answers.shot)==null?void 0:ee.scene;ge&&(M.current=!0,g8(c),_i(c),Y.current(ge.id,{existing:!0}))},[c]),Ie=(u==null?void 0:u.canDraw)??!0,Be=_.offline?Ne.offline:R,Re={setup:p,studio:v,canDraw:Ie,uploading:y,edit:f,editingName:j,note:Be,stale:rM(v),shots:Ee,set:ae},Ze=s.useMemo(()=>Fee(Re),[p,v,Ie,y,j,Be,f,Ee,ae]),Qe=(()=>{const ge=Ze[Ze.length-1];return(ge==null?void 0:ge.kind)==="question"?ge.question:null})(),lt=Vee(Re,Qe),Lt=s.useCallback(async ge=>{var Ge,me,_e;const ee=ge.filter(U=>U.type.startsWith("image/")||/\.(heic|heif)$/i.test(U.name));if(!ee.length){E(Ne.onlyPictures);return}((Ge=L.current.answers.source)==null?void 0:Ge.door)!=="photos"&&m({type:"answer",patch:{source:{door:"photos"}}});const Ue=4-(((me=L.current.answers.photos)==null?void 0:me.hashes)??[]).length;if(Ue<=0){E(Ne.fourPictures);return}E(ee.length>Ue?Ne.fourPictures:null),b(U=>U+1);try{for(const U of ee.slice(0,Ue))try{const pe=await L0(U),Oe=((_e=L.current.answers.photos)==null?void 0:_e.hashes)??[];m({type:"photos",hashes:[...Oe,pe]})}catch(pe){E(`${U.name} could not be added: ${String((pe==null?void 0:pe.message)??pe)}`)}}finally{b(U=>U-1)}},[]),Ut=(ge,ee,He)=>m({type:"aside",aside:{said:ge,reply:ee,q:He,at:Yh()}}),Ct=s.useCallback(ge=>{const ee=L.current,He=ee.held??ee.answers;ee.editing&&Ok(H.current)&&JSON.stringify(Gv(He,ge))!==JSON.stringify(He)&&w({type:"forget-record"}),m({type:"answer",patch:ge})},[]),cn=s.useRef(B);cn.current=B;const Fe=s.useCallback((ge,ee)=>{var He,We;if(E(null),ge==="photos"&&ee.kind==="photos"){const Ue=ee.action,Ge=((He=L.current.answers.photos)==null?void 0:He.hashes)??[];Ue.type==="add"?Lt(Ue.files):Ue.type==="instead"?Ct({source:{door:"shot"}}):Ue.type==="remove"?m({type:"photos",hashes:Ge.filter(me=>me!==Ue.hash)}):Ue.type==="reject"?E(Ne.onlyPictures):Ue.type==="submit"&&Ge.length?Ct({photos:{hashes:Ge,done:!0}}):Ue.type==="back"&&Ct({source:{door:"guided"}});return}if(ge==="shot"&&ee.kind==="pick"){const Ue=ee.action;Ue.type==="pick"?ye(Ue.id):Ue.type==="query"?ne(Ue.text):Ue.type==="more"?he.current.loading||he.current.loadMore():Ue.type==="back"&&(ne(""),Ct({source:{door:"photos"},photos:{hashes:[],done:!1}}));return}if(ge==="reuse"&&ee.kind==="choice"&&ee.id==="use"){Se();return}if(Lk(ge)){const Ue=aee(ge,ee,L.current.answers);Ue&&Ct(Ue);return}if(ge==="retry"){_.start("make",{draw:!1,shot:((We=L.current.answers.source)==null?void 0:We.door)==="shot"});return}if(ee.kind==="confirm"){if(ge==="set-start"){ee.id==="draw-set"?(w({type:"set-drawn"}),X({first:!0})):w({type:"set-declined"});return}if(ge==="set-more"){ee.id==="more"?(w({type:"ask-more"}),X({more:!0})):w({type:"decline-more"});return}if(ge==="set-done"){ee.id==="retry-failed"?X({roles:cn.current.filter(Ue=>Ue.state==="failed").map(Ue=>Ue.role)}):le();return}ee.id==="draw"||ee.id==="again"?_.start("again"):ee.id==="use"?_.use():ee.id==="another-shot"&&Nt.current("shot")}},[Lt,Ct,_.start,_.use,X,le,ye,Se]),mt=ge=>{ge.trim()?!C.current&<.target.kind!=="off"&&(C.current=lt.target):C.current=null,S(ge)},it=ge=>{const ee=St(ge);return ee&&(C.current=null,S("")),ee};function St(ge){var ee;{const He=ge.trim();if(!He)return!1;E(null);const We=C.current??lt.target;if(We.kind==="source"){if(lM(He))return Ct({source:{door:"words",text:He.slice(0,400)}}),!0;const Ue=qJ(He),Ge=Object.keys(Ue);return Ge.length>0?(Ct({source:{door:"guided"},...Object.fromEntries(Ge.map(me=>[me,{pick:Ue[me]}]))}),!0):(Ut(He,Uk(Wk(He,"source")??"vague","source"),"source"),!0)}if(We.kind==="row"&&qh(We.id)){const Ue=Wk(He,"row");if(Ue)return Ut(He,Uk(Ue,"row"),We.id),!0;const Ge=(ee=L.current.answers[We.id])==null?void 0:ee.pick;return Ct({[We.id]:{...Ge?{pick:Ge}:{},words:He.slice(0,200)}}),!0}if(We.kind==="name")return w({type:"name",text:sM(He)??He}),!0;if(We.kind==="add"||We.kind==="change"){if(v.job)return!1;const Ue=Nee(He),Ge=Iee(v);return Ue.kind==="rename"?(w({type:"name",text:Ue.name}),Ut(He,Ne.renamed(Ue.name),Ge),!0):Ue.kind!=="change"?(Ut(He,Ue.say,Ge),Ue.kind!=="refuse"):(We.kind==="add"?_.start("change",{ask:He,draw:!1}):Mee(v,He)?_.start("again"):_.start("change",{ask:He}),!0)}return!1}}const xt=s.useCallback(ge=>{v.job||(ge==="name"?N(!0):Lk(ge)&&(ge==="shot"&&ne(""),Ok(v)?K(ge):m({type:"edit",id:ge})))},[v]),Nt=s.useRef(xt);Nt.current=xt;const Kt=s.useCallback((ge,ee)=>{ge==="name"&&(ee.trim()&&w({type:"name",text:ee.trim()}),N(!1))},[]),et=s.useCallback(()=>{N(!1),m({type:"cancel-edit"})},[]),gt=Or(v),ot=Q&&F.job?bv({status:F.job.status,step:F.job.current,done:F.job.done.length,total:F.job.roles.length,error:F.job.error}):void 0,kn=v.job?Xg(v):_.saving?"Saving":ot,dt=[];let Gt=null;if(re){const ge=Q?(Jt=F.job)==null?void 0:Jt.current:null,ee=((se=[...B].reverse().find(Ue=>Ue.state==="shown"))==null?void 0:se.role)??null,He=ke??ge??ee??"place";dt.push({view:"place",label:"The place",state:He==="place"?"current":"approved",hash:(gt==null?void 0:gt.hash)??void 0,photo:!1,drawing:!1,approved:!0,error:!1});for(const Ue of B)dt.push({view:Ue.role,label:rc[Ue.role],state:He===Ue.role?"current":Ue.state==="shown"?"approved":"todo",hash:Ue.hash,photo:!1,drawing:Ue.state==="drawing",approved:Ue.state==="shown",error:Ue.state==="failed"});const We=dt.find(Ue=>Ue.view===He)??dt[0];Gt={hash:We.hash,drawing:We.drawing}}const Ft=!f&&(!!p.answers.source||v.versions.length>0);return{title:f?Ne.editTitle:Ne.title,turns:Ze,working:kn,busy:_.saving,resumed:!!h,memoryKey:c,stage:Gt?{hash:Gt.hash,alt:`${v.name.trim()||(gt==null?void 0:gt.reading.name)||"The scene"}, in use`,drawing:Gt.drawing||!!v.job&&v.job.phase==="drawing",doing:ot??Xg(v),items:dt,onPick:ge=>te(ge)}:{hash:(gt==null?void 0:gt.hash)??void 0,alt:`Preview of ${v.name.trim()||(gt==null?void 0:gt.reading.name)||"the scene"}`,drawing:!!v.job&&v.job.phase==="drawing",since:((oe=v.job)==null?void 0:oe.since)??void 0,doing:Xg(v),takes:v.job?void 0:vee(v),onTake:_.putBack,items:[]},composer:{placeholder:lt.placeholder,label:lt.label,action:lt.action,disabled:lt.target.kind==="off",why:lt.target.kind==="off"&<.target.why||null,working:lt.working,onStop:v.job?_.stop:Q&&re?()=>{I(!0),Me.stopSceneExamples(t.id,re).then(()=>F.again()).catch(()=>{})}:void 0,stopping:!!((we=v.job)!=null&&we.stopping)||V,focusKey:P,onAttachFiles:lt.attach?ge=>void Lt(ge):void 0,attachLabel:Ne.attachLabel},text:k,onText:mt,onSend:it,onAnswer:Fe,onEdit:xt,onSaveEdit:Kt,onCancelEdit:et,confirmingEdit:D!==null,confirmEdit:()=>{D&&m({type:"edit",id:D}),K(null)},cancelConfirm:()=>K(null),onRestore:(ge,ee)=>_.putBack(ee),onRetry:ge=>X({roles:[ge]}),onDescribe:()=>$(String(Date.now())),onStarter:ge=>{mt(ge),$(String(Date.now()))},onPaste:(Qe==null?void 0:Qe.id)==="source"||(Qe==null?void 0:Qe.id)==="photos"?ge=>void Lt(ge):void 0,canDraw:Ie,begun:Ft,unsaved:v.saved?!1:f?Ree(v,a):Ft,running:!!v.job||Q,saved:!!re,finish:le,keptAsDraft:!f&&aM(v),leave:()=>{_.stop(),M.current=!0,g8(c),_i(c)}}}function Uoe({brand:e,applyBrand:t,sceneId:n,seed:r,conversation:a,storageKey:i,caps:c,onClose:u,onStartOver:f,onSaved:h,onDone:p,finish:m}){const v=Boe({brand:e,applyBrand:t,sceneId:n,seed:r,conversation:a,storageKey:i,caps:c,onSaved:h,onDone:p,finish:m}),[w,y]=s.useState(!1),b=v.turns[v.turns.length-1],k=(b==null?void 0:b.kind)==="question"?b.question.id:null;s.useEffect(()=>zh({open:k}),[k]),s.useEffect(()=>()=>zh(null),[]);const S=!!n,C=()=>{if(v.saved){v.finish();return}if(v.running||v.keptAsDraft){u();return}if(v.unsaved){y(!0);return}v.leave(),u()},j=!S&&v.begun&&!v.saved?o.jsx(Wn,{label:Ne.startOver,tone:"quiet",title:Ne.startOverTitle,body:Ne.startOverBody,busy:!1,onConfirm:()=>{v.leave(),f()}}):null;return o.jsx(bw,{onClose:C,surface:{kind:"scene",glyph:o.jsx(Cj,{size:32}),title:v.title,turns:v.turns,busy:v.busy,working:v.working,memoryKey:v.memoryKey,resumed:v.resumed,stage:v.stage,stageEmpty:{lead:Ne.emptyLead,hint:Ne.emptyHint},composer:v.composer,text:v.text,onText:v.onText,onSend:v.onSend,onAnswer:v.onAnswer,onEdit:v.onEdit,onSaveEdit:v.onSaveEdit,onCancelEdit:v.onCancelEdit,onRestore:v.onRestore,onRetry:v.onRetry,onDescribe:v.onDescribe,onStarter:v.onStarter,onPaste:v.onPaste,headAction:j,overlay:o.jsxs(o.Fragment,{children:[o.jsx(Wn,{label:Ne.changeIt,title:Ne.changeTitle,body:Ne.changeBody,busy:!1,open:v.confirmingEdit,onOpenChange:N=>{N||v.cancelConfirm()},onConfirm:v.confirmEdit}),o.jsx(Wn,{label:S?Ne.discard:Ne.leave,title:S?Ne.discardTitle:Ne.leaveTitle,body:S?Ne.discardBody:Ne.leaveBody,busy:!1,open:w,onOpenChange:N=>{N||y(!1)},onConfirm:()=>{y(!1),v.leave(),u()}})]})}})}const z5=e=>{const t=/^asset:([a-f0-9]{32})$/.exec(String(e??""));return t?t[1]:null};function Woe(e,t){var c;const r=(((c=e.json)==null?void 0:c.scenes)??[]).find(u=>(u==null?void 0:u.id)===t);if(!r)return null;const a={name:String(r.name??""),prompt:String(r.prompt??""),lighting:String(r.lighting??""),subject:r.subject==="product"||r.subject==="person"?r.subject:"either",description:String(r.description??""),...r.promptName?{promptName:String(r.promptName)}:{},...r.camera?{camera:String(r.camera)}:{},...r.figure?{figure:String(r.figure)}:{},...r.figure&&r.figureTreatment?{figureTreatment:String(r.figureTreatment)}:{},...Array.isArray(r.keywords)?{keywords:r.keywords.map(String)}:{},...Array.isArray(r.collections)?{collections:r.collections.map(String)}:{},...Array.isArray(r.verticals)?{verticals:r.verticals.map(String)}:{}},i=(Array.isArray(r.refs)?r.refs:[]).map(u=>z5(u==null?void 0:u.file)).filter(Boolean);return hee({place:String(r.instruction??""),pictures:i.slice(0,4),reading:a,hash:z5(r.preview)??null,name:a.name})}function Koe(){return[...crypto.getRandomValues(new Uint8Array(6))].map(t=>t.toString(16).padStart(2,"0")).join("")}function B5(){const{sceneId:e=null,convoId:t=null}=Bs(),{key:n,state:r}=Zn(),{brand:a}=on(),{applyBrand:i}=Rn(),c=Dn(),{announce:u,caps:f}=Pv();Ec(e?"Edit scene":"Create scene");const[h]=s.useState(()=>e?Woe(a,e):null),p=typeof(r==null?void 0:r.from)=="string"?r.from:null,m=p&&(Gi(ut.hub,p.split("?")[0])||Gi(ut.set,p.split("?")[0])),v=s.useCallback(()=>c(p??(e?_r(a,e):Kl(a)),{replace:!0}),[c,p,e,a]),w=s.useMemo(()=>t??Koe(),[t,n]);s.useEffect(()=>{t||e&&!h||c(e?pv(a,e,w):Bi(a,w),{replace:!0,state:r})},[t,w,e,h,a,c,r]);const y=s.useRef(null);return e&&!h?o.jsx(fo,{to:_r(a,e),replace:!0}):o.jsx(Uoe,{brand:a,applyBrand:i,sceneId:e,seed:h,conversation:w,storageKey:`scenri:scene-studio:${a.id}:${w}`,caps:f?{canRead:f.canAnalyze,canDraw:f.canGenerate}:null,onClose:v,onStartOver:()=>c(Bi(a),{replace:!0,state:r}),onSaved:(b,k)=>{y.current={made:b,how:k}},finish:m?Ne.useInAShot:Ne.openScene,onDone:(b,k)=>{var S,C;if(!(k!=null&&k.existing)){const j=Fh(a,b),N=((S=y.current)==null?void 0:S.made.id)===b?y.current.made:null;u({kind:"scene",id:b,name:(N==null?void 0:N.name)??(j==null?void 0:j.name)??"",verticals:(N==null?void 0:N.verticals)??(j==null?void 0:j.verticals)??[],how:((C=y.current)==null?void 0:C.how)??(e===b?"updated":"created")})}m&&p?c(`${p.split("?")[0]}?scene=${encodeURIComponent(b)}&compose=1`,{replace:!0}):c(_r(a,b),{replace:!0})}},w)}function KR(){const{brand:e}=on(),t=Dn(),n=mr(e);return s.useCallback(r=>{t(`${n}?product=${encodeURIComponent(r)}&compose=1`)},[n,t])}function Goe({product:e,variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:c,onDelete:u,onRename:f,bookmarked:h,onBookmark:p,chosen:m,batching:v,onPick:w,batch:y,size:b="grid"}){var S,C;const k=s.useMemo(()=>y?vm({kind:"product",count:y.count,openLabel:"Open",onOpen:()=>n==null?void 0:n(e.id),href:a,onDeselect:()=>w==null?void 0:w(e.id),onAct:y.onAct,onKeep:y.onKeep,allKept:y.allKept}):el({onOpen:n?()=>n(e.id):void 0,href:a,use:r?{label:"Use in a shot",run:()=>r(e.id)}:void 0,select:w?{run:()=>w(e.id)}:void 0,keep:p?{on:!!h,run:()=>p(e.id)}:void 0,onRename:f?()=>f(e.id):void 0,remove:u?{label:"Delete product",run:()=>u(e.id)}:void 0}),[n,r,u,f,w,p,h,a,e.id,y]);return o.jsx(rd,{id:e.id,previewUrl:Fr((C=(S=e.shots)==null?void 0:S[0])==null?void 0:C.file),title:go(e,"tooltip"),primary:go(e,"card"),secondary:"",useLabel:"Use in a shot",variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:c,menu:k,bookmarked:h,onBookmark:p,chosen:m,batching:v,onPick:w,size:b})}function Yoe(e){return o.jsx(tm,{...e})}const GR=s.memo(Goe);function qoe({product:e,variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:c,bookmarked:u,onBookmark:f,size:h="grid"}){const p=D0(e.category)??e.category,m=s.useMemo(()=>el({onOpen:n?()=>n(e.id):void 0,href:a,use:r?{label:"Use in a shot",run:()=>r(e.id)}:void 0,keep:f?{on:!!u,run:()=>f(e.id)}:void 0}),[n,r,f,u,a,e.id]);return o.jsx(rd,{id:e.id,previewUrl:e.previewUrl,title:`${go(e,"tooltip")} · ${p}`,primary:go(e,"card"),secondary:"",useLabel:"Use in a shot",variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:c,menu:m,bookmarked:u,onBookmark:f,size:h})}const YR=s.memo(qoe),Xoe=8,v8="__bookmarked";function Qoe(){var Kt;const{brand:e,products:t,productsLoaded:n,refreshProducts:r}=on(),a=((Kt=qA())==null?void 0:Kt.importing)??!1,{demoProducts:i,applyBrand:c,refreshBrands:u}=Rn(),{push:f}=ir(),h=n&&t.length===0,p=Dn(),m=KR(),v=cl(),{q:w,setQ:y,facets:b,setFacets:k,clearSearch:S,clear:C}=Tf(["category","bookmarked"]),j=b.category,N=b.bookmarked==="1",[P,$]=s.useState(()=>zu("product",e.id)),R=et=>$(dm("product",e.id,et)),E=dw(`${e.id}|${w}|${j??""}|${N?"1":""}`),[M,L]=fa(Dr.wallDensity,Bu),H=Ac(M),D=s.useCallback(et=>L(et),[L]),K=s.useMemo(()=>pm(H),[H]),O=fm(H),_=s.useMemo(()=>{const et=a?t.filter(gt=>{var ot;return(((ot=gt.shots)==null?void 0:ot.length)??0)>0}):t;return OA(et).map(gt=>({product:gt,category:Rv(gt),own:!0}))},[t,a]),re=s.useMemo(()=>i.map(et=>({product:et,category:et.category,own:!1})),[i]),z=s.useMemo(()=>[..._,...re],[_,re]),F=s.useMemo(()=>z.reduce((et,gt)=>et+(P.includes(gt.product.id)?1:0),0),[z,P]),Q=N&&F===0,V=Q&&h,I=Q&&!h,B=s.useMemo(()=>{const et=new Map;for(const{category:gt}of z)gt&&et.set(gt,(et.get(gt)??0)+1);return et},[z]),Y=s.useMemo(()=>$0.filter(et=>B.has(et.key)),[B]),ae=z.length>0?"tabs":"none",X=s.useCallback(et=>p(la(e,et)),[p,e]),[le,ke]=s.useState(null),[te,be]=s.useState(!1),[G,J]=s.useState(null),[ne,W]=s.useState(!1),[he,Xe]=s.useState(null),[tt,ze]=s.useState(!1),nt=s.useCallback(et=>{const gt=t.find(ot=>ot.id===et);gt&&ke(gt)},[t]),ce=et=>et.origin==="catalog"||et.id.startsWith("cat-"),ve=s.useCallback(et=>{const gt=t.find(ot=>ot.id===et);!gt||ce(gt)||(Xe(null),J(gt))},[t]),Pe=async et=>{if(!(!G||ne)){W(!0),Xe(null);try{c(await Me.updateProduct(e.id,G.id,{name:et})),J(null)}catch(gt){const ot=nn(gt,"Could not rename this product");Xe([ot.title,ot.detail].filter(Boolean).join(" "))}finally{W(!1)}}},ue=async()=>{if(!le||te)return;be(!0);const et=le.origin==="catalog"||le.id.startsWith("cat-");try{et?(await Me.deleteCatalogProduct(e.id,le.id),await r()):c(await l6(e.id,le.id)),E.forget(le.id),ke(null)}catch(gt){(gt==null?void 0:gt.status)===404?(await Promise.all([u(),r()]),E.forget(le.id),ke(null)):f(nn(gt,"Could not delete this product"))}finally{be(!1)}},Ee=s.useCallback(et=>et.filter(({product:gt})=>V||!N||P.includes(gt.id)).filter(({category:gt})=>!j||gt===j).filter(({product:gt,category:ot})=>vo([qv(gt),D0(ot)].filter(Boolean).join(" "),w)).map(({product:gt})=>gt),[j,w,N,P,V]),Ke=s.useMemo(()=>Ee(_),[Ee,_]),ye=s.useMemo(()=>Ee(re),[Ee,re]),{visible:Se,remaining:Ie,showMore:Be}=hw(Ke,`${j??""}|${N?"keepers":""}|${w}`),[Re,Ze]=s.useState(null);s.useEffect(()=>{if(!Re||Ie<=0)return;const et=Re.closest(".sc-home"),gt=new IntersectionObserver(ot=>{ot.some(kn=>kn.isIntersecting)&&Be()},{root:et,rootMargin:"200% 0px"});return gt.observe(Re),()=>gt.disconnect()},[Re,Ie,Be]);const Qe={key:"category",label:"Category",everyLabel:"All products",everyCount:z.length,selected:N?v8:j,onSelect:et=>k(et===v8?{bookmarked:"1",category:null}:{bookmarked:null,category:et}),options:[{value:v8,label:"Keepers",count:F},...Y.map(et=>({value:et.key,label:et.label,count:B.get(et.key)??0}))]},lt=o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>v("product"),children:[o.jsx(cr,{size:12})," Add product"]}),Lt=h,Ut=t.length>0,Ct=o.jsx(wm,{title:"Products",filters:o.jsx(ym,{mode:ae,group:Qe}),density:o.jsx(hm,{value:H,onChange:D}),search:z.length>=Xoe&&o.jsx(ld,{value:w,onChange:y,noun:"products",total:z.length})}),cn=et=>{const gt=t.find(kn=>kn.id===et);return gt&>.origin==="catalog"||et.startsWith("cat-")?Me.deleteCatalogProduct(e.id,et):l6(e.id,et)},Fe=()=>{const et=[...E.ids];et.length===1?nt(et[0]):ze(!0)},mt=[...E.ids],it=mt.length>0&&mt.every(et=>P.includes(et)),St=()=>$(Qv("product",e.id,mt,!it)),xt=gm(E.ids.size,it,"products"),Nt=async()=>{if(te)return;const et=[...E.ids];be(!0);try{const{failed:gt,error:ot}=await sp(et,cn);await Promise.all([u(),r()]),E.retain(gt),ze(!1),ot&&f(nn(ot,"Could not delete these products"))}finally{be(!1)}};return o.jsx(Rf.Provider,{value:O,children:o.jsxs(is,{children:[o.jsxs("main",{className:"sc-looks sc-products",id:"main","data-hero":Lt||void 0,onClick:E.onBlank,children:[!Lt&&Ct,!n&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":O,style:K,"aria-hidden":!0,children:o.jsx(Yoe,{size:"grid",count:8})}),Ut&&Se.length>0&&o.jsxs("section",{className:"sc-owned",children:[o.jsx("div",{className:"sc-sec-head",children:o.jsx("h2",{className:"sc-sec-title",children:"Your products"})}),o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":O,style:K,children:Se.map(et=>o.jsx(GR,{product:et,variant:"use",size:"grid",onOpen:X,href:la(e,et.id),onUse:m,bookmarked:P.includes(et.id),onBookmark:R,onDelete:nt,onRename:ce(et)?void 0:ve,chosen:E.ids.has(et.id),batching:E.batching==="product",onPick:E.picking("product")?gt=>E.toggle("product",gt):void 0,batch:E.kind==="product"&&E.ids.has(et.id)?{count:E.ids.size,onAct:Fe,onKeep:St,allKept:it}:null},et.id))}),Ie>0&&o.jsx("div",{ref:Ze,"aria-hidden":!0}),Ie>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:Be,children:["Show ",Math.min(Ie,60)," more"]})}),G&&o.jsx(cw,{title:"Rename product",name:G.name,maxLength:500,busy:ne,error:he,onConfirm:et=>void Pe(et),onDismiss:()=>{ne||J(null)}}),le&&o.jsx(Wn,{label:"Delete product",title:`Delete ${le.name}?`,body:"Shots already made with it keep their images and their recipe. Only future shots lose it.",open:!0,busy:te,onOpenChange:et=>{!et&&!te&&ke(null)},onConfirm:()=>void ue()}),tt&&o.jsx(Wn,{label:qr("product",E.ids.size).menu,title:`${qr("product",E.ids.size).menu}?`,body:"Shots already made with it keep their images and their recipe. Only future shots lose it.",open:!0,busy:te,onOpenChange:et=>{!et&&!te&&ze(!1)},onConfirm:()=>void Nt()})]}),Lt&&o.jsx(io,{shape:"cold",title:o.jsxs(o.Fragment,{children:["Bring in a ",o.jsx("em",{children:"product"})]}),body:"Upload a few clean shots, or import your store, and it stays exact in every image you make.",action:lt}),Ut&&Se.length>0&&ye.length>0&&o.jsx("div",{className:"sc-sec-head sc-owned-divider",children:o.jsx("h2",{className:"sc-sec-title",children:"Scenri products"})}),Lt&&re.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(fw,{label:"Or borrow one of ours"}),Ct]}),ye.length>0&&o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":O,style:K,children:ye.map(et=>o.jsx(YR,{product:et,variant:"use",size:"grid",onUse:m,onOpen:X,href:la(e,et.id),bookmarked:P.includes(et.id),onBookmark:R},et.id))}),n&&I&&o.jsx(io,{shape:"zero",title:"Nothing in Keepers yet",body:"Keep a product from its card and it stays here.",mark:lw,action:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>k({bookmarked:null}),children:"Browse every product"})}),n&&!I&&Ke.length===0&&ye.length===0&&o.jsx(bm,{noun:"products",q:w,facet:N?"Keepers":j?D0(j):null,onClearSearch:S,onClearAll:C})]}),o.jsxs("div",{className:"sc-wall-dock",children:[E.kind==="product"&&E.ids.size>0&&o.jsx(uw,{count:E.ids.size,loaded:Se.length,tool:qr("product",E.ids.size).tool,icon:qr("product",E.ids.size).icon,danger:!0,onAct:Fe,keep:{label:xt.tool,filled:it,onAct:St},onClear:E.clear,onSelectAll:()=>E.selectAll("product",Se.map(et=>et.id))}),o.jsx(iw,{})]})]})})}function Joe({refs:e,cap:t,note:n,addLabel:r,busy:a,onAdd:i,onPromote:c,onRemove:u}){const[f,h]=s.useState(null),p=s.useMemo(()=>e.find(N=>N.file===f)??e[0],[e,f]);s.useEffect(()=>{var N;e.length&&!e.some(P=>P.file===f)&&h(((N=e[0])==null?void 0:N.file)??null)},[e,f]);const m=p?e.findIndex(N=>N.file===p.file):-1,v=!!c&&m>0,w=!!u&&!!p&&e.length>1,y=!!(r&&i&&e.length>0),b=e.length>1||y,{shellRef:k,railRef:S,page:C}=aR(e.length),j=N=>{const P=N==null?void 0:N[0];P&&(i==null||i(P))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-refstage",children:p?o.jsx("div",{className:"sc-refstage-frame",children:o.jsx("img",{src:p.url,alt:""})}):i?o.jsxs("label",{className:"sc-refstage-blank sc-refstage-drop","data-busy":a||void 0,onDragOver:N=>{N.preventDefault(),N.dataTransfer.dropEffect="copy"},onDrop:N=>{N.preventDefault(),j(N.dataTransfer.files)},children:[o.jsx("input",{type:"file",accept:"image/*",hidden:!0,disabled:a,onChange:N=>{j(N.target.files),N.target.value=""}}),a?o.jsx(xr,{size:"2"}):o.jsx(cr,{size:22,weight:"bold"}),o.jsx("span",{children:"Add a reference"})]}):o.jsx("span",{className:"sc-refstage-blank",children:o.jsx(Ws,{size:22})})}),b&&o.jsxs("div",{className:"sc-refrail-shell",ref:k,children:[o.jsxs("div",{className:"sc-refrail-track",children:[o.jsx("button",{type:"button",className:"sc-refrail-arrow prev","aria-label":"Previous references",onClick:()=>C(-1),children:o.jsx(ga,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-refrail-arrow next","aria-label":"Next references",onClick:()=>C(1),children:o.jsx(il,{size:13,weight:"bold"})}),o.jsx("div",{className:"sc-refrail",ref:S,children:e.map((N,P)=>o.jsx("button",{type:"button",className:"sc-refrail-item","data-on":(p==null?void 0:p.file)===N.file?"":void 0,"data-spare":P>=t?"":void 0,"aria-label":`Reference ${P+1}`,"aria-pressed":(p==null?void 0:p.file)===N.file,onClick:()=>h(N.file),children:o.jsx("img",{src:N.url,alt:"",loading:"lazy"})},N.file))})]}),y&&o.jsxs("label",{className:"sc-refrail-item sc-refrail-add","data-busy":a||void 0,children:[o.jsx("input",{type:"file",accept:"image/*",hidden:!0,disabled:a,onChange:N=>{j(N.target.files),N.target.value=""}}),a?o.jsx(xr,{size:"1"}):o.jsx(cr,{size:16,weight:"bold"}),o.jsx("span",{className:"sc-vh",children:r})]})]}),(v||w)&&o.jsx("div",{className:"sc-refacts",children:o.jsxs("span",{className:"sc-refacts-pair",children:[v&&o.jsxs("button",{type:"button",className:"sc-refact sc-refact-lead",onClick:()=>c==null?void 0:c(p.file),children:[o.jsx(_U,{size:14,weight:"bold"}),"Use first"]}),w&&o.jsx("button",{type:"button",className:"sc-refact sc-refact-aside",onClick:()=>u==null?void 0:u(p.file),children:"Remove"})]})}),o.jsx("p",{className:"sc-lookpage-note",children:n})]})}function eie({value:e,onChange:t,onBlur:n,label:r,placeholder:a,className:i="sc-lookpage-titleedit"}){const c=s.useRef(null),u=f=>{f&&(f.style.height="auto",f.style.height=`${f.scrollHeight}px`)};return s.useEffect(()=>u(c.current),[e]),o.jsx("textarea",{ref:c,className:i,rows:1,dir:"auto","aria-label":r,placeholder:a,value:e,onChange:f=>{u(f.currentTarget),t(f.target.value)},onBlur:n,onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),f.currentTarget.blur())}})}function tie({value:e,onChange:t}){const n=D0(e)??"Other",r=e&&$0.some(a=>a.key===e)?e:"other";return o.jsxs(Ss,{children:[o.jsx(Es,{children:o.jsxs("button",{type:"button",className:"sc-pdetails-field sc-catpick","aria-label":`Category: ${n}`,children:[n,o.jsx(Xi,{size:11,weight:"bold"})]})}),o.jsx(Cs,{align:"center",sideOffset:8,children:o.jsx(Th,{value:r,children:$0.map(a=>o.jsx(vu,{value:a.key,onSelect:()=>t(a.key),children:a.label},a.key))})})]})}const w8='mm|cm|inches|inch|in|m|"';function U5(e){if(!e)return;const t=e.toLowerCase();return t==='"'||t==="inch"||t==="inches"?"in":t==="mm"||t==="cm"||t==="m"||t==="in"?t:void 0}function B0(e){const t=Number(e.trim().replace(",","."));return e.trim()&&Number.isFinite(t)&&t>0?String(t):""}const Df=["height","width","depth"],Y6={height:"Height",width:"Width",depth:"Depth"};function qR(e){var f,h,p,m,v,w;const t={unit:"cm",height:"",width:"",depth:""},n=e.trim();if(!n||!new RegExp(w8,"i").test(n))return t;const r={},a=(y,b)=>{if(r[b])return;const k=n.match(new RegExp(`(\\d+(?:[.,]\\d+)?)\\s*(${w8})?\\s*(?:${y})\\b`,"i"));if(!k)return;const S=B0(k[1]);S&&(r[b]={value:S,unit:U5(k[2])})};a("tall|high","height"),a("across|wide","width"),a("long","width"),a("deep","depth");const i=Df.filter(y=>r[y]);if(i.length){const y=new Set(i.map(b=>{var k;return(k=r[b])==null?void 0:k.unit}).filter(b=>!!b));return y.size>1?t:{unit:[...y][0]??"cm",height:((f=r.height)==null?void 0:f.value)??"",width:((h=r.width)==null?void 0:h.value)??"",depth:((p=r.depth)==null?void 0:p.value)??""}}const c=[];for(const y of n.matchAll(new RegExp(`(\\d+(?:[.,]\\d+)?)\\s*(${w8})?`,"gi"))){const b=B0(y[1]);b&&c.push({value:b,unit:U5(y[2])})}if(!c.length)return t;const u=c.map(y=>y.unit).filter(y=>!!y);return!u.length||new Set(u).size>1?t:{unit:u[u.length-1],height:((m=c[0])==null?void 0:m.value)??"",width:((v=c[1])==null?void 0:v.value)??"",depth:((w=c[2])==null?void 0:w.value)??""}}function nie(e){const t=qR(e),n=Df.flatMap(i=>t[i]?[`${Y6[i]} ${t[i]} ${t.unit}`]:[]);if(n.length)return n;const r=e.trim();if(!r)return[];const a=r.replace(/^about\s+/i,"");return[a.charAt(0).toUpperCase()+a.slice(1)]}const rie={height:"tall",width:"across",depth:"deep"};function sie(e){return Df.map(t=>{const n=B0(e[t]);return n?`${n} ${e.unit} ${rie[t]}`:""}).filter(Boolean).join(" and ")}function aie(e,t){return Df.every(n=>B0(e[n])===B0(t[n]))}function oie({size:e,category:t,busy:n,error:r,onSave:a,onDismiss:i}){const c=t??"other",u=(e==null?void 0:e.text)??"",[f]=s.useState(()=>qR(u)),[h,p]=s.useState(f),[m,v]=s.useState(c),w=(S,C)=>S.trim().toLowerCase()===C.trim().toLowerCase(),y=aie(h,f)?u:sie(h),b=()=>{if(!n){if(w(y,u)&&m===c)return i();a({size:y,category:m})}},k=(e==null?void 0:e.by)==="person"?"Yours. Clear it to go back to the size read from its photo.":(e==null?void 0:e.by)==="record"?"From your store's listing.":e?"Read from its photo.":"Not read yet.";return o.jsxs(Ts,{className:"sc-newdlg sc-pdetails",maxWidth:"min(460px, 94vw)",onDismiss:i,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:"Details"}),o.jsx(As,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx("span",{"aria-hidden":!0,children:"×"})})})]}),o.jsxs("div",{className:"sc-newdlg-body",children:[o.jsxs("div",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Category"}),o.jsx(tie,{value:m,onChange:v}),o.jsx("span",{className:"sc-pdetails-hint",children:"Where it is filed, so it surfaces with that kind of product."})]}),o.jsxs("div",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Size"}),o.jsx("div",{className:"sc-size",children:Df.map(S=>o.jsxs("label",{className:"sc-size-dim",children:[o.jsx("span",{className:"sc-size-name",children:Y6[S]}),o.jsxs("span",{className:"sc-size-box",children:[o.jsx("input",{className:"sc-pdetails-field",inputMode:"decimal","aria-label":Y6[S],value:h[S],onChange:C=>p({...h,[S]:C.target.value}),onKeyDown:C=>C.key==="Enter"&&b()}),o.jsx("span",{className:"sc-size-unit","aria-hidden":!0,children:h.unit})]})]},S))}),o.jsx("span",{className:"sc-pdetails-hint",children:k})]}),r&&o.jsx("p",{className:"sc-assetform-err",children:r})]}),o.jsxs("div",{className:"sc-newdlg-foot",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:i,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","data-busy":n||void 0,onClick:b,children:n?"Saving":"Save"})]})]})}const iie=3;function lie(e){const t=e,n=(t.brand??t.vendor??"").trim();return!n||e.name.toLowerCase().startsWith(n.toLowerCase())?null:n}function cie(e){return e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"").replace(/<[^>]+>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\s+/g," ").trim()}function uie(e,t){if(e.length<=t)return e;const n=e.slice(0,t+1).search(/[.!?](\s|$)/);if(n>40)return e.slice(0,n+1);const r=e.lastIndexOf(" ",t);return`${e.slice(0,r>40?r:t).trimEnd()}…`}function die(){var Be;const{productId:e=""}=Bs(),{brand:t,products:n,refreshProducts:r}=on(),{demoProducts:a,demoProductsLoaded:i,applyBrand:c,refreshBrands:u}=Rn(),f=Dn(),h=KR(),{push:p}=ir(),[m,v]=s.useState(!1),[w,y]=s.useState(!1),[b,k]=s.useState(null),S=s.useRef(null),C=s.useRef({}),j=s.useRef(!1),N=xm(),P=n.find(Re=>Re.id===e),[$,R]=s.useState(null);s.useEffect(()=>{if((P==null?void 0:P.origin)!=="catalog"){R(null);return}let Re=!0;return Me.libraryProduct(t.id,P.id).then(Ze=>{Re&&R(Ze.product)}).catch(()=>{}),()=>{Re=!1}},[t.id,P]);const E=$&&P&&$.id===P.id?{...$,...P,shots:$.shots}:P,M=s.useMemo(()=>E?void 0:a.find(Re=>Re.id===e),[E,a,e]);Ec((Be=E??M)==null?void 0:Be.name);const[L,H]=s.useState([]);s.useEffect(()=>{if(!M){H([]);return}let Re=!0;return Me.demoProductFrames(M.id).then(Ze=>{Re&&H(Ze.frames)}).catch(()=>{Re&&H([])}),()=>{Re=!1}},[M==null?void 0:M.id]);const[D,K]=s.useState((E==null?void 0:E.name)??"");s.useEffect(()=>{K((E==null?void 0:E.name)??"")},[E==null?void 0:E.id]);const O=pw(t.id,[e??""]),[_,re]=s.useState(null),[z,F]=s.useState(!1),[Q,V]=s.useState(!1),[I,B]=s.useState(null),Y=!!(E??M);s.useEffect(()=>{if(re(null),!Y||!e)return;let Re=!0;return Me.productSize(t.id,e).then(Ze=>{Re&&re(Ze.size)}).catch(()=>{}),()=>{Re=!1}},[t.id,e,Y]);const ae=async Re=>{if(!e)return!1;const Ze=N();V(!0),B(null);try{const Qe=await Me.setProductSize(t.id,e,Re);return Ze()&&(re(Qe.size),F(!1)),!0}catch(Qe){return B(String(Qe.message??Qe)),!1}finally{V(!1)}},X=((E==null?void 0:E.origin)??"manual")==="manual",le=async(Re,Ze)=>{Ze&&Re&&typeof Re=="object"&&"json"in Re?c(Re):await r()},ke=Re=>{if(!E||j.current)return;C.current={...C.current,...Re},S.current&&clearTimeout(S.current);const Ze=t.id,Qe=E.id,lt=X;S.current=setTimeout(()=>{S.current=null;const Lt=C.current;C.current={},(lt?Me.updateProduct(Ze,Qe,Lt):Me.updateCatalogProduct(Ze,Qe,Lt)).then(Ct=>le(Ct,lt)).catch(Ct=>k(String(Ct.message??Ct)))},500)},te=async Re=>{const Ze=(_==null?void 0:_.text)??"",Qe=Re.size.trim().toLowerCase()!==Ze.trim().toLowerCase();Qe&&!await ae(Re.size)||(Re.category!==(he??"other")&&ke({category:Re.category}),Qe||F(!1))},be=async Re=>{const Ze=X;v(!0),k(null);try{await le(await Re,Ze)}catch(Qe){k(String(Qe.message??Qe))}finally{v(!1)}},G=async()=>{if(!E||j.current)return;j.current=!0,S.current&&clearTimeout(S.current),S.current=null,C.current={};const Re=N(),Ze=Cu(t),Qe=E.origin==="catalog"||E.id.startsWith("cat-");y(!0),k(null);try{Qe?(await Me.deleteCatalogProduct(t.id,E.id),await r()):c(await l6(t.id,E.id))}catch(lt){if((lt==null?void 0:lt.status)!==404){j.current=!1,Re()&&(k(String(lt.message??lt)),y(!1));return}await Promise.all([u(),r()])}Re()&&f(Ze,{replace:!0})};if(!E&&!M&&!i)return o.jsx(is,{children:o.jsxs("main",{className:"sc-lookpage sc-productpage",id:"main",children:[o.jsxs("div",{className:"sc-refskeleton","aria-hidden":!0,children:[o.jsx("span",{className:"sc-refskeleton-title"}),o.jsx("span",{className:"sc-refskeleton-stage"}),o.jsxs("span",{className:"sc-refskeleton-rail",children:[o.jsx("span",{}),o.jsx("span",{}),o.jsx("span",{})]})]}),o.jsx("p",{className:"sc-vh",role:"status",children:"Loading this product"})]})});if(!E&&!M)return o.jsx(is,{children:o.jsxs("main",{className:"sc-lookpage",id:"main",children:[o.jsx("h1",{children:"This product isn't here anymore"}),o.jsx("p",{className:"sc-lookpage-lede",children:"It may have been removed, or the link is out of date."}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx(_n,{className:"sc-btn sc-btn-primary",to:Cu(t),children:"Browse products"})})]})});const J=M?"none":X?"full":"fields",ne=E??M,W=(E==null?void 0:E.id)??M.id,he=E?Rv(E):(M==null?void 0:M.category)??null,Xe=lie(ne),tt=Re=>{const Ze=Fr(Re.file);return Ze?[{file:Re.file,url:Ze,angle:Re.angle}]:[]},ze=M?L.map(Re=>({file:Re.angle,url:Re.url,angle:Re.angle})):((E==null?void 0:E.shots)??[]).flatMap(tt),nt=Re=>{const Ze=ze.map(lt=>lt.file),Qe=Ze.indexOf(Re)+1;be(Me.setProductShots(t.id,W,Ze.filter(lt=>lt!==Re))).then(()=>p({kind:"success",title:"Reference removed",detail:`Reference ${Qe} of ${Ze.length}`,action:{label:"Undo",onClick:()=>void be(Me.setProductShots(t.id,W,Ze))}}))},ce=M?"Our reference set. Yours replaces it.":ze.length===0?X?"No reference yet.":"No reference yet. Images from your store are still arriving.":ze.length===1?"One angle. A shot has to guess at every side it can't see.":ze.length===2?"Two angles. A third pins the shape.":"The first three build every shot. Remove any that show a different colour or version.",ve=J==="none"?null:"Add image",Pe=E!=null&&E.descriptionHtml?uie(cie(E.descriptionHtml),200):"",ue=(M==null?void 0:M.description)||Pe||null,Ee=nie((_==null?void 0:_.text)??""),Ke=M?[M.subcategory]:[E==null?void 0:E.variant,E==null?void 0:E.material,Ee.length?null:E==null?void 0:E.dimensions],ye=D0(he),Se=Ke.filter(Boolean),Ie=M?a.filter(Re=>Re.id!==W).slice(0,8):n.filter(Re=>Re.id!==W).slice(0,8);return o.jsx(is,{children:o.jsxs("main",{className:"sc-lookpage sc-productpage",id:"main",children:[o.jsx(mw,{to:Cu(t),wall:"Products",where:M?"Scenri library":X?"Yours":"From your store"}),Xe&&o.jsx("p",{className:"sc-lookpage-house",children:o.jsx("em",{className:"sc-accent",children:Xe})}),J==="full"?o.jsx(eie,{label:"Product name",value:D,onChange:Re=>{K(Re),ke({name:Re})}}):o.jsx("h1",{dir:"auto",children:ne.name}),(ye||Ee.length>0)&&o.jsxs("div",{className:"sc-lookpage-marks",children:[ye&&o.jsx("ul",{className:"sc-lookpage-cats","aria-label":"Filed under",children:o.jsx("li",{className:"sc-chip","data-static":!0,children:ye})}),Ee.length>0&&o.jsx("ul",{className:"sc-lookpage-cats","aria-label":"Size",children:Ee.map(Re=>o.jsx("li",{className:"sc-chip","data-static":!0,children:Re},Re))})]}),ue&&o.jsx("p",{className:"sc-lookpage-lede",children:ue}),Se.length>0&&o.jsx("p",{className:"sc-lookpage-facts",children:Se.join(" · ")}),o.jsxs("div",{className:"sc-lookpage-acts",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>h(W),children:"Use in a shot"}),o.jsx(gw,{kind:"product",brandId:t.id,id:W}),J!=="none"&&o.jsx(or,{label:"Edit details",children:o.jsx("button",{type:"button",className:"sc-icon-btn","aria-label":"Edit details","aria-haspopup":"dialog",onClick:()=>{B(null),F(!0)},children:o.jsx(ed,{size:17})})})]}),b&&o.jsx("p",{className:"sc-assetform-err",children:b}),o.jsx(Joe,{refs:ze,cap:iie,note:ce,addLabel:ve,busy:m,onAdd:J==="none"?void 0:Re=>void be(SW(t.id,W,Re)),onPromote:J==="none"?void 0:Re=>void be(Me.setProductShots(t.id,W,[Re,...ze.map(Ze=>Ze.file).filter(Ze=>Ze!==Re)])),onRemove:J==="none"?void 0:nt}),O.length>0&&o.jsx(Tu,{label:`Shots featuring ${ne.name}`,children:O.map(Re=>o.jsx(ww,{node:Re,to:Yp(t,null,Re.id)},Re.id))}),Ie.length>0&&o.jsx(Tu,{label:M?"Other products in the library":"Other products",children:Ie.map(Re=>M?o.jsx(YR,{product:Re,variant:"navigate",size:"slider",onOpen:Ze=>f(la(t,Ze)),href:la(t,Re.id)},Re.id):o.jsx(GR,{product:Re,variant:"navigate",size:"slider",onOpen:Ze=>f(la(t,Ze)),href:la(t,Re.id)},Re.id))}),z&&o.jsx(oie,{size:_,category:he,busy:Q,error:I,onSave:Re=>void te(Re),onDismiss:()=>F(!1)}),E&&o.jsx("div",{className:"sc-ownedbits",children:o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx(Wn,{label:"Delete product",title:`Delete ${E.name}?`,body:"Shots already made with it keep their images and their recipe. Only future shots lose it.",busy:w,onConfirm:()=>void G()})})})]})})}function fie(e,t){const n=new Map,r=[];for(const a of t){n.set(a.id,a.status);const i=e.get(a.id);if(i!==a.status){if(i===void 0){a.status==="running"&&r.push("Generating shot.");continue}a.status==="done"?r.push("Shot ready."):a.status==="error"?r.push(`Shot failed${a.error?`: ${a.error}`:"."}`):a.status==="cancelled"&&r.push("Shot cancelled.")}}return{messages:r,next:n}}const hie=[{label:"Generate",keys:["cmd","enter"]},{label:"Jump to the prompt",keys:["/"]},{label:"Product menu",keys:["$"]},{label:"Scene menu",keys:["/"]},{label:"Presenter menu",keys:["@"]},{label:"Colour menu",keys:["#"]},{label:"Previous or next shot",keys:["←","→"]},{label:"Previous or next in the history",keys:["↑","↓"]},{label:"Refine this shot",keys:["b"]},{label:"Keep or unkeep",keys:["k"]},{label:"Open the shot",keys:["enter"]},{label:"Close, or stop refining",keys:["esc"]},{label:"Assets panel",keys:["."]},{label:"This list",keys:["?"]}];function pie({open:e,onOpenChange:t}){return o.jsx(rv,{open:e,onOpenChange:t,children:o.jsxs(sv,{maxWidth:"360px","aria-describedby":void 0,children:[o.jsx(av,{children:"Shortcuts"}),o.jsx("div",{className:"sc-keys",children:hie.map(n=>o.jsxs("div",{className:"sc-krow",children:[o.jsx("span",{children:n.label}),o.jsx("span",{className:"sc-ksp"}),n.keys.map(r=>o.jsx("kbd",{children:r},r))]},n.label))})]})})}const XR=new Set;function mie(e){return XR.has(e)}function gie(e){e&&XR.add(e)}function vie({src:e,fallback:t,alt:n="",aspect:r,guess:a=!0}){const[i,c]=s.useState(!1),u=i&&t?t:e,[f,h]=s.useState(!1),[p,m]=s.useState(u);u!==p&&(m(u),h(!1));const v=s.useRef(null),w=s.useCallback(()=>{gie(u),h(!0)},[u]),y=s.useCallback(k=>{v.current=k,k!=null&&k.complete&&k.naturalWidth&&w()},[w]);s.useLayoutEffect(()=>{const k=v.current;k!=null&&k.complete&&k.naturalWidth&&w()},[w]);const b=mie(u);return o.jsxs("span",{className:"sc-cellimg","data-loaded":f||void 0,"data-cached":b||void 0,"data-guess":a||void 0,style:r?{"--sc-cell-ar":r}:void 0,children:[!f&&!b&&o.jsx("span",{className:"sc-shimmer"}),o.jsx("img",{ref:y,src:u,alt:n,loading:b?"eager":"lazy",decoding:b?"sync":"async",onLoad:()=>w(),onError:()=>{t&&!i?c(!0):w()}})]})}function QR({name:e}){return o.jsx(Nv,{name:e})}function wie({node:e,chosen:t,picking:n,batching:r,armed:a,menu:i,onPick:c,onBranch:u,onToggleKeep:f,onArchive:h,onDelete:p}){const m=Sr(e),v=Ev(),w=(b,k)=>TA(b,k,v),y=()=>{const b=e.images[0];if(!b)return;const k=e.promptHead.slice(0,40).replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"")||"shot",S=document.createElement("a");S.href=Mr(b),S.download=`${k}.png`,S.click()};return o.jsxs(o.Fragment,{children:[!r&&o.jsx("span",{className:"sc-cell-veil","aria-hidden":!0}),n&&w(t?"Deselect":"Select",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-pick","data-on":t||void 0,"aria-pressed":t,"aria-label":t?"Deselect shot":"Select shot",onClick:()=>c==null?void 0:c(e.id),children:o.jsx(Kn,{size:13,weight:"bold"})})),a&&!n&&o.jsxs("span",{className:"sc-cell-ctl sc-cell-pick","data-on":!0,title:"Being refined",children:[o.jsx(Kn,{size:13,weight:"bold"}),o.jsx("span",{className:"sc-vh",children:"Being refined"})]}),o.jsx("div",{className:"sc-shot-tools",children:f&&o.jsxs("div",{className:"sc-corner",children:[i.length>0&&o.jsxs(Ss,{children:[w("More",o.jsx(Es,{children:o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-more","aria-label":`More for ${m}`,children:o.jsx($C,{size:16,weight:"bold"})})})),o.jsx(Cs,{align:"end",sideOffset:4,collisionPadding:12,children:i.map(b=>o.jsxs("span",{style:{display:"contents"},children:[b.separated&&o.jsx(Ul,{}),o.jsxs(tr,{color:b.danger?"red":void 0,onSelect:b.onSelect,children:[o.jsx(QR,{name:b.icon}),b.label]})]},b.key))})]}),u&&!r&&w("Refine",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-branch","data-on":a||void 0,"aria-label":`Refine ${m}`,onClick:()=>u(e.id),children:o.jsx(QC,{size:15,weight:"bold"})})),e.images[0]&&w("Download",o.jsx("button",{type:"button",className:"sc-cell-ctl","aria-label":`Download ${m}`,onClick:y,children:o.jsx(HC,{size:15})})),e.archived?p&&w("Delete permanently",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-danger","aria-label":`Delete ${m} permanently`,onClick:()=>p(e),children:o.jsx(ll,{size:15})})):h&&w("Archive",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-danger","aria-label":`Archive ${m}`,onClick:()=>h(e),children:o.jsx(_p,{size:15})})),w(e.kept?"Remove from Keepers":"Add to Keepers",o.jsx("button",{type:"button",className:`sc-cell-ctl sc-cell-keep${e.kept?" sc-cell-star":""}`,"data-on":e.kept||void 0,"aria-pressed":e.kept,"aria-label":e.kept?`Remove ${m} from Keepers`:`Add ${m} to Keepers`,onClick:()=>f(e),children:o.jsx(Da,{size:15,weight:e.kept?"fill":"regular"})}))]})})]})}function JR(e,t){return e>1?`Remove ${e} shots from ${t}`:`Remove from ${t}`}function sh(e,t,n){return e>1?n(e):t}function yie(e,{chosen:t,batching:n,versions:r,onOpen:a,onBranch:i,onPick:c,onVersions:u,onToggleKeep:f,onArchive:h,onDeletePermanently:p,shotHref:m,inSet:v,filedIn:w,onRemoveFromSet:y,batch:b}){const k=[{key:"open",icon:"open",label:"Open",onSelect:()=>a(e.id)}];m&&k.push({key:"open-tab",icon:"open-tab",label:"Open in new tab",onSelect:()=>window.open(m(e.id),"_blank")}),i&&!n&&k.push({key:"branch",icon:"refine",label:"Refine",onSelect:()=>i(e.id)});const S=!!(n&&t&&b&&b.count>0),C=!!(S&&b&&b.count>1);c&&k.push({key:"pick",icon:"select",label:t?C?"Deselect this shot":"Deselect":"Select",onSelect:()=>c(e.id)});const j=R=>R?"Remove from Keepers":"Add to Keepers",N=(R,E)=>R?`Remove ${E} shots from Keepers`:`Add ${E} shots to Keepers`;S&&b?k.push({key:"keep",icon:b.allKept?"kept":"keep",label:sh(b.count,j(b.allKept),R=>N(b.allKept,R)),onSelect:b.onKeep,separated:C}):f&&k.push({key:"keep",icon:e.kept?"kept":"keep",label:j(e.kept),onSelect:()=>f(e)});const P=S?b==null?void 0:b.onRemoveFromSet:y,$=S?v?[v]:[]:v?[v]:w??[];if(P)for(const R of $)k.push({key:`unset-${R.id}`,icon:"unset",label:JR(S&&b?b.count:1,R.name),onSelect:()=>P(R)});return r>0&&u&&!n&&k.push({key:"versions",icon:"versions",label:`Show ${r} version${r===1?"":"s"}`,onSelect:()=>u(e.id)}),S&&b?(k.push({key:"archive",icon:b.archived?"restore":"archive",label:b.archived?sh(b.count,"Restore",R=>`Restore ${R} shots`):sh(b.count,"Archive",R=>`Archive ${R} shots`),onSelect:b.archived?b.onRestore:b.onArchive,danger:!b.archived,separated:!0}),b.archived&&k.push({key:"delete",icon:"delete",label:sh(b.count,"Delete permanently",R=>`Delete ${R} shots permanently`),onSelect:b.onDelete,danger:!0,separated:!0})):(h&&k.push({key:"archive",icon:e.archived?"restore":"archive",label:e.archived?"Restore":"Archive",onSelect:()=>h(e),danger:!e.archived,separated:!0}),p&&e.archived&&k.push({key:"delete",icon:"delete",label:"Delete permanently",onSelect:()=>p(e),danger:!0,separated:!0})),k}function eP(e,t){var r,a,i,c;const n=(i=(a=(r=e.brief)==null?void 0:r.rendered)==null?void 0:a.sizes)==null?void 0:i[t];return n&&n[0]>0&&n[1]>0?{aspect:n[0]/n[1],guess:!1}:{aspect:Uu((c=e.brief)==null?void 0:c.format),guess:!0}}const bie=s.memo(function({node:t,selected:n,armed:r,chosen:a,picking:i,batching:c,versions:u,handlers:f,inSet:h,filedIn:p,pickedMeta:m}){const v=yie(t,{chosen:a,batching:c,versions:u,onOpen:f.onOpen,shotHref:f.shotHref,onBranch:f.onBranch,onPick:f.onPick,onVersions:f.onVersions,onToggleKeep:f.onToggleKeep,onArchive:f.onArchive,onDeletePermanently:f.onDeleteAsk,inSet:h,filedIn:p,onRemoveFromSet:f.onRemoveFromSet?w=>{var y;return(y=f.onRemoveFromSet)==null?void 0:y.call(f,t,w)}:void 0,batch:c&&a&&m&&f.onKeepPicked?{...m,onKeep:f.onKeepPicked,onArchive:f.onArchivePicked??(()=>{}),onRestore:f.onRestorePicked??(()=>{}),onDelete:f.onDeletePickedAsk??(()=>{}),onRemoveFromSet:f.onRemovePickedFromSet}:null});return o.jsxs(pf,{children:[o.jsx(mf,{children:o.jsxs("div",{className:"sc-cell","data-fb-node":t.id,"data-selected":n,"data-armed":r||void 0,"data-batching":c||void 0,"data-picked":a||void 0,children:[o.jsx(_n,{className:"sc-cell-open",to:f.shotHref(t.id),"aria-label":c?`${a?"Deselect":"Select"} ${Sr(t)}`:`Open ${Sr(t)}`,onClick:w=>{var y;c&&(w.preventDefault(),(y=f.onPick)==null||y.call(f,t.id))},children:o.jsx(vie,{src:dn(t.images[0],"tile"),fallback:Mr(t.images[0]),...eP(t,0)})}),o.jsx(wie,{node:t,chosen:a,picking:i,batching:c,armed:r,menu:v,onPick:f.onPick,onBranch:f.onBranch,onToggleKeep:f.onToggleKeep,onArchive:f.onArchive,onDelete:f.onDeleteAsk})]})}),o.jsx(gf,{children:v.map(w=>o.jsxs("span",{style:{display:"contents"},children:[w.separated&&o.jsx(Fp,{}),o.jsxs(vf,{color:w.danger?"red":void 0,onSelect:w.onSelect,children:[o.jsx(QR,{name:w.icon}),w.label]})]},w.key))})]})}),xie=s.memo(function({node:t,selected:n,shotHref:r,onCancel:a}){var i;return o.jsxs("div",{className:"sc-cell","data-running":"true","data-fb-node":t.id,"data-selected":n,style:{"--sc-cell-ar":Uu((i=t.brief)==null?void 0:i.format)},children:[o.jsxs(_n,{className:"sc-cell-open",to:r(t.id),"aria-label":`Open ${Sr(t)}, still rendering`,children:[o.jsx("span",{className:"sc-shimmer"}),o.jsx(nR,{since:Fi(t)})]}),a&&o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-cancel","data-urgent":sc(Fi(t))>=60||void 0,onClick:()=>a(t),children:"Cancel"})]})}),kie=s.memo(function({node:t,selected:n,shotHref:r,engineName:a,onRetry:i,onArchive:c}){const u=t.status==="cancelled",f=u?MA():Ef(t.error,a==null?void 0:a(t.engineId));return o.jsxs("div",{className:"sc-cell","data-fb-node":t.id,"data-cancelled":u||void 0,"data-failed":!u||void 0,"data-selected":n,children:[o.jsx(_n,{className:"sc-cell-open",to:r(t.id),"aria-label":`Open ${Sr(t)}`}),o.jsx("span",{className:"sc-cell-failed",children:o.jsx(qj,{failure:f,density:"tile",onRetry:()=>i(t),dismiss:c?{label:t.archived?"Restore":"Dismiss",onClick:()=>c(t)}:void 0})})]})}),Sie=40,Eie=1,W5=64,Cie=e=>e>Sie,jie=e=>Math.floor(e/W5)*W5;function ah(e,t,n){const r=Math.max(0,n-2),a=e!=="failed"&&t&&t>0?t:4/5;return Math.round(r/a)+2+Pu}function K5(e){const t=new Array(e.length+1);let n=0;for(let r=0;r<e.length;r++)t[r]=n,n+=e[r];return t[e.length]=n,t}function Aie(e,t,n){const r=e.length-1;if(r<=0||n<=t)return[0,0];let a=0,i=r;for(;a<i;){const u=a+i>>1;e[u+1]<=t?a=u+1:i=u}const c=a;for(a=c,i=r;a<i;){const u=a+i>>1;e[u]<n?a=u+1:i=u}return[c,a]}function G5(e,t){const n=Array.from({length:Math.max(1,t)},()=>[]);for(let r=0;r<e;r++)n[r%n.length].push(r);return n}function Nie(e,t){const n=t*Eie;return[e-n,e+t+n]}function jw(e){const t=e.getBoundingClientRect().top,n=e.querySelector(".sc-toolbar");return n?Math.max(t,n.getBoundingClientRect().bottom):t}function Mie(e,t){const[n,r]=s.useState(()=>({top:0,height:typeof window>"u"?0:window.innerHeight})),a=s.useRef(null),i=s.useRef(null),c=s.useRef((h,p=0)=>{i.current=h?{anchor:h,until:p}:null}).current,u=s.useRef(()=>{}),f=s.useRef(()=>u.current()).current;return s.useLayoutEffect(()=>{if(!e)return;const h=e.closest(".sc-canvas");if(!h)return;let p=0,m=0;const v=()=>{var S;const k=i.current;if(k&&performance.now()<k.until){a.current=k.anchor;return}i.current=null,a.current=h.scrollTop>0?Rie(e,jw(h),(S=a.current)==null?void 0:S.id):null},w=()=>{if(p=0,t){const k=e.getBoundingClientRect().top-h.getBoundingClientRect().top+h.scrollTop,S={top:jie(h.scrollTop-k),height:h.clientHeight};r(C=>C.top===S.top&&C.height===S.height?C:S)}v(),cancelAnimationFrame(m),m=requestAnimationFrame(v)},y=()=>{p||(p=requestAnimationFrame(w))};u.current=w,w(),h.addEventListener("scroll",y,{passive:!0});const b=new ResizeObserver(y);return b.observe(h),b.observe(e),()=>{cancelAnimationFrame(p),cancelAnimationFrame(m),u.current=()=>{},h.removeEventListener("scroll",y),b.disconnect()}},[e,t]),{...n,anchor:a,resync:f,hold:c}}function Rie(e,t,n){let r=null,a=null;for(const c of e.querySelectorAll(".sc-cell[data-fb-node]")){const u=c.getBoundingClientRect();if(u.bottom<=t||u.height===0)continue;const f=c.getAttribute("data-fb-node");if(!f)continue;const h={id:f,top:u.top,left:u.left};if(u.top>=t-1){const p=!!r&&Math.abs(u.top-r.top)<=1;(!r||u.top<r.top-1||p&&r.id!==n&&(f===n||u.left<r.left))&&(r=h)}else(!a||u.left<a.left)&&(a=h)}const i=r??a;return i?{id:i.id,offset:i.top-t}:null}function Pie(e,t,n){const r=s.useRef(new Map),[,a]=s.useState(0),i=s.useRef(null),c=s.useRef(new Set);return s.useLayoutEffect(()=>{if(!t)return;let u=0;const f=new ResizeObserver(h=>{let p=!1;for(const m of h){const v=m.target.getAttribute("data-fb-node");if(!v)continue;const w=m.target;if(w.offsetHeight<=2||w.offsetWidth<=2)continue;const y=(w.offsetHeight-2)/(w.offsetWidth-2),b=r.current.get(v);(b===void 0||Math.abs(b-y)>.004)&&(r.current.set(v,y),p=!0)}p&&!u&&(u=requestAnimationFrame(()=>{u=0,a(m=>m+1)}))});return i.current=f,()=>{cancelAnimationFrame(u),f.disconnect(),i.current=null,c.current=new Set}},[t]),s.useLayoutEffect(()=>{const u=i.current;if(!(!t||!u||!e)){for(const f of c.current)f.isConnected||(u.unobserve(f),c.current.delete(f));for(const f of e.querySelectorAll(".sc-cell[data-fb-node]"))c.current.has(f)||(c.current.add(f),u.observe(f))}}),s.useCallback(u=>{const f=r.current.get(u);return f===void 0?void 0:Math.round(f*Math.max(0,n-2))+2+Pu},[n])}function Lie({nodes:e,selectedId:t,onOpen:n,shotHref:r,onRetry:a,onCancel:i,onToggleKeep:c,onArchive:u,onDeletePermanently:f,picked:h,onPick:p,empty:m,sending:v,onBranch:w,branchingFrom:y,onVersions:b,engineName:k,tile:S,pending:C,onNearEnd:j,inSet:N,setsFor:P,onRemoveFromSet:$,onKeepPicked:R,onArchivePicked:E,onRestorePicked:M,onDeletePicked:L,onRemovePickedFromSet:H}){const D=e.filter(ye=>ye.kind!=="root"),K=!!p,O=K&&((h==null?void 0:h.size)??0)>0,_=s.useMemo(()=>{if(!h||h.size===0)return null;let ye=0,Se=0,Ie=0;for(const Be of e)!h.has(Be.id)||Be.kind==="root"||(ye+=1,Be.kept&&(Se+=1),Be.archived&&(Ie+=1));return{count:h.size,allKept:ye>0&&Se===ye,archived:ye>0&&Ie===ye}},[e,h]),[re,z]=s.useState(null),[F,Q]=s.useState(!1),[V,I]=s.useState(null),{tile:B,cols:Y}=Lte(Rte(V),S,Pte()<Nte),[ae,X]=s.useState(null);s.useEffect(()=>{if(!ae||!j)return;const ye=ae.closest(".sc-canvas"),Se=new IntersectionObserver(Ie=>{Ie.some(Be=>Be.isIntersecting)&&j()},{root:ye,rootMargin:"200% 0px"});return Se.observe(ae),()=>Se.disconnect()},[ae,j]);const le=s.useRef({onOpen:n,shotHref:r,onRetry:a,onCancel:i,onToggleKeep:c,onArchive:u,onBranch:w,onPick:p,onVersions:b,engineName:k,onRemoveFromSet:$,onKeepPicked:R,onArchivePicked:E,onRestorePicked:M,onDeletePicked:L,onRemovePickedFromSet:H});le.current={onOpen:n,shotHref:r,onRetry:a,onCancel:i,onToggleKeep:c,onArchive:u,onBranch:w,onPick:p,onVersions:b,engineName:k,onRemoveFromSet:$,onKeepPicked:R,onArchivePicked:E,onRestorePicked:M,onDeletePicked:L,onRemovePickedFromSet:H};const ke=!!f,te=!!L,be=s.useMemo(()=>({onOpen:ye=>le.current.onOpen(ye),shotHref:ye=>le.current.shotHref(ye),onRetry:ye=>le.current.onRetry(ye),onCancel:i?ye=>{var Se,Ie;return(Ie=(Se=le.current).onCancel)==null?void 0:Ie.call(Se,ye)}:void 0,onToggleKeep:c?ye=>{var Se,Ie;return(Ie=(Se=le.current).onToggleKeep)==null?void 0:Ie.call(Se,ye)}:void 0,onArchive:u?ye=>{var Se,Ie;return(Ie=(Se=le.current).onArchive)==null?void 0:Ie.call(Se,ye)}:void 0,onBranch:w?ye=>{var Se,Ie;return(Ie=(Se=le.current).onBranch)==null?void 0:Ie.call(Se,ye)}:void 0,onPick:p?ye=>{var Se,Ie;return(Ie=(Se=le.current).onPick)==null?void 0:Ie.call(Se,ye)}:void 0,onVersions:b?ye=>{var Se,Ie;return(Ie=(Se=le.current).onVersions)==null?void 0:Ie.call(Se,ye)}:void 0,onDeleteAsk:ke?ye=>z(ye):void 0,engineName:k?ye=>{var Se,Ie;return(Ie=(Se=le.current).engineName)==null?void 0:Ie.call(Se,ye)}:void 0,onRemoveFromSet:$?(ye,Se)=>{var Ie,Be;return(Be=(Ie=le.current).onRemoveFromSet)==null?void 0:Be.call(Ie,ye,Se)}:void 0,onKeepPicked:R?()=>{var ye,Se;return(Se=(ye=le.current).onKeepPicked)==null?void 0:Se.call(ye)}:void 0,onArchivePicked:E?()=>{var ye,Se;return(Se=(ye=le.current).onArchivePicked)==null?void 0:Se.call(ye)}:void 0,onRestorePicked:M?()=>{var ye,Se;return(Se=(ye=le.current).onRestorePicked)==null?void 0:Se.call(ye)}:void 0,onDeletePickedAsk:te?()=>Q(!0):void 0,onRemovePickedFromSet:H?ye=>{var Se,Ie;return(Ie=(Se=le.current).onRemovePickedFromSet)==null?void 0:Ie.call(Se,ye)}:void 0}),[!!i,!!c,!!u,!!w,!!p,!!b,ke,te,!!k,!!$,!!R,!!E,!!M,!!H]),G=[...v?Array.from({length:Math.max(1,v.count)},(ye,Se)=>({key:`sending-${Se}`,node:null,said:v.said})):[],...D.map(ye=>({key:ye.id,node:ye}))],J=ye=>ye.status==="cancelled"||ye.status==="error"||ye.images.length===0,ne=ye=>{const Se=ye.node;return Se?Se.status==="running"?o.jsx(xie,{node:Se,selected:Se.id===t,shotHref:be.shotHref,onCancel:be.onCancel},Se.id):J(Se)?o.jsx(kie,{node:Se,selected:Se.id===t,shotHref:be.shotHref,engineName:be.engineName,onRetry:be.onRetry,onArchive:be.onArchive},Se.id):o.jsx(bie,{node:Se,selected:Se.id===t,armed:Se.id===y,chosen:(h==null?void 0:h.has(Se.id))??!1,picking:K,batching:O,versions:Se.childCount,handlers:be,inSet:N,filedIn:P==null?void 0:P(Se.id),pickedMeta:_},Se.id):o.jsxs("div",{className:"sc-cell","data-running":"true","data-sending":"true",children:[o.jsx("span",{className:"sc-shimmer"}),o.jsx("span",{className:"sc-cell-tag",children:"sending"}),o.jsx("span",{className:"sc-cell-said",dir:"auto",children:ye.said})]},ye.key)},W=ye=>{var Ie;const Se=ye.node;return Se?Se.status==="running"?ah("running",Uu((Ie=Se.brief)==null?void 0:Ie.format),B):J(Se)?ah("failed",void 0,B):ah("done",eP(Se,0).aspect,B):ah("sending",void 0,B)},he=Cie(G.length),Xe=Mie(V,he),tt=Pie(V,he,B),ze=Xk(Y),nt=`${ze}:${B}`,ce=s.useRef(nt),ve=s.useRef({items:G,heightOf:tt,estimate:W});ve.current={items:G,heightOf:tt,estimate:W};const Pe=s.useRef(null);if(s.useLayoutEffect(()=>{const ye=ce.current;ce.current=nt;const Se=Xe.anchor.current,Ie=V==null?void 0:V.closest(".sc-canvas");if(!(ye===nt||!Se||!V||!Ie)){if(Pe.current={anchor:Se,until:performance.now()+Tie},Xe.hold(Se,Pe.current.until),!Y5(V,Ie,Se)){const{items:Be,heightOf:Re,estimate:Ze}=ve.current,Qe=Be.findIndex(Ct=>{var cn;return((cn=Ct.node)==null?void 0:cn.id)===Se.id});if(Qe<0)return;const lt=G5(Be.length,ze)[Qe%ze],Lt=K5(lt.map(Ct=>(Be[Ct].node&&Re(Be[Ct].node.id))??Ze(Be[Ct]))),Ut=V.getBoundingClientRect().top+Lt[Math.floor(Qe/ze)];Ie.scrollTop+=Ut-jw(Ie)-Se.offset}Xe.resync()}},[nt,ze,V,Xe.anchor,Xe.resync,Xe.hold]),s.useLayoutEffect(()=>{const ye=Pe.current,Se=V==null?void 0:V.closest(".sc-canvas");if(!(!ye||!V||!Se)){if(performance.now()>ye.until){Pe.current=null;return}Y5(V,Se,ye.anchor)}}),s.useEffect(()=>{const ye=V==null?void 0:V.closest(".sc-canvas");if(!ye)return;const Se=()=>{Pe.current=null,Xe.hold(null)},Ie=["wheel","touchstart","keydown","pointerdown"];for(const Be of Ie)ye.addEventListener(Be,Se,{passive:!0});return()=>{for(const Be of Ie)ye.removeEventListener(Be,Se)}},[V,Xe.hold]),C&&rx(D)&&!v){const ye=Math.max(1,Math.min(Y,8));return o.jsx("div",{className:"sc-feed",ref:I,style:{"--sc-tile":`${B}px`,"--sc-cols":ye},children:Array.from({length:ye},(Se,Ie)=>o.jsx("div",{className:"sc-feed-col",children:Array.from({length:2},(Be,Re)=>o.jsx("div",{className:"sc-cell","data-running":"true","data-sending":"true",children:o.jsx("span",{className:"sc-shimmer"})},`pending-${Ie}-${Re}`))},`col-${ye}-${Ie}`))})}if(rx(D)&&!v)return o.jsx(o.Fragment,{children:m??o.jsx("p",{className:"sc-feed-empty",children:"Nothing here yet."})});const ue=Xk(Y),Ee=G5(G.length,ue),Ke=he?Nie(Xe.top,Xe.height):null;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-feed",ref:I,style:{"--sc-tile":`${B}px`,"--sc-cols":ue},children:Ee.map((ye,Se)=>{const Ie=`col-${ue}-${Se}`;if(!Ke)return o.jsx("div",{className:"sc-feed-col",children:ye.map(lt=>ne(G[lt]))},Ie);const Be=ye.map(lt=>(G[lt].node&&tt(G[lt].node.id))??W(G[lt])),Re=K5(Be),[Ze,Qe]=Aie(Re,Ke[0],Ke[1]);return o.jsxs("div",{className:"sc-feed-col",children:[Ze>0&&o.jsx("div",{className:"sc-feed-pad",style:{height:Re[Ze]},"aria-hidden":!0}),ye.slice(Ze,Qe).map(lt=>ne(G[lt])),Qe<ye.length&&o.jsx("div",{className:"sc-feed-pad",style:{height:Re[ye.length]-Re[Qe]},"aria-hidden":!0})]},Ie)})}),j&&o.jsx("div",{className:"sc-feed-end",ref:X,"aria-hidden":!0}),o.jsx(of,{open:!!re||F,onOpenChange:ye=>{ye||(z(null),Q(!1))},children:o.jsxs(lf,{maxWidth:"420px",children:[o.jsx(cf,{children:F?`Delete ${(_==null?void 0:_.count)??0} shot${((_==null?void 0:_.count)??0)===1?"":"s"} permanently?`:"Delete this shot permanently?"}),o.jsx(uf,{size:"2",children:"This cannot be undone."}),o.jsxs(js,{gap:"3",mt:"4",justify:"end",children:[o.jsx(ff,{children:o.jsx(ia,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(df,{children:o.jsx(ia,{color:"red",onClick:()=>{F?L==null||L():re&&(f==null||f(re)),z(null),Q(!1)},children:"Delete permanently"})})]})]})})]})}const Tie=800;function Y5(e,t,n){const r=e.querySelector(`.sc-cell[data-fb-node="${CSS.escape(n.id)}"]`);if(!r)return!1;const a=r.getBoundingClientRect().top-jw(t)-n.offset;return Math.abs(a)>=1&&(t.scrollTop+=a),!0}function $ie(e){return e==="open"||e==="result"?"open":"compact"}function q6({name:e,kind:t,count:n,mode:r,onToggle:a,action:i,children:c}){const u=$ie(r);return o.jsxs("div",{className:"sc-agroup","data-mode":r,"data-kind":t,children:[o.jsxs("div",{className:"sc-agroup-h",children:[o.jsxs("button",{type:"button",className:"sc-agroup-t","aria-expanded":r==="open",onClick:a,children:[o.jsx("b",{children:e}),n!==void 0&&n>0&&o.jsx("span",{className:"sc-agroup-n",children:n}),o.jsx(Xi,{size:11,className:"sc-agroup-caret","aria-hidden":"true"})]}),i]}),o.jsx("div",{className:"sc-agroup-body",children:o.jsx("div",{className:"sc-agroup-content",children:o.jsx("div",{className:"sc-agroup-layer",children:c(u)},u)})})]})}function tP({candidate:e,on:t,named:n,disabled:r,title:a,onClick:i}){const c=o.jsxs("button",{type:"button",className:"sc-acard","data-on":t||void 0,"aria-label":e.full,"aria-pressed":t,"aria-disabled":r||void 0,title:r?void 0:e.full,onClick:r?void 0:i,children:[o.jsxs("span",{className:"sc-acard-thumb",children:[e.thumb?o.jsx("img",{src:e.thumb,alt:"",loading:"lazy","data-crop":e.crop}):o.jsx("span",{className:"sc-aswatch",style:{display:"grid",placeItems:"center"},children:o.jsx(Ws,{size:14})}),o.jsx("span",{className:"sc-acard-tick","aria-hidden":!0,children:o.jsx(Kn,{size:10,weight:"bold"})})]}),n&&o.jsxs("span",{className:"sc-acard-label",children:[e.bookmarked&&o.jsxs(o.Fragment,{children:[o.jsx(Da,{className:"sc-bm-mark",size:10,weight:"fill","aria-hidden":!0}),o.jsx("span",{className:"sc-vh",children:"Kept. "})]}),e.label]})]});return o.jsx(VM,{why:r?a:null,children:c})}function y8({kind:e,title:t,items:n,attached:r,mode:a,onToggle:i,onPick:c,onUnpick:u,full:f,moreLabel:h,createLabel:p,onCreate:m}){const v=s.useMemo(()=>new Set(r),[r]),[w,y]=s.useState(rp);return s.useEffect(()=>{a!=="open"&&y(rp)},[a]),a==="result"&&n.length===0?null:o.jsx(q6,{name:t,kind:e,count:n.length,mode:a,onToggle:()=>i(e),action:o.jsx("button",{type:"button",className:"sc-aadd",title:p,"aria-label":p,onClick:m,children:o.jsx(cr,{size:10})}),children:b=>{const{visible:k,more:S}=_re(n,v,b==="open"?w:z6);return o.jsxs("div",{className:b==="open"?"sc-acard-grid":"sc-arow",children:[k.map(C=>o.jsx(tP,{candidate:C,on:v.has(C.id),named:b==="open",disabled:!!f&&!v.has(C.id),title:f??void 0,onClick:()=>v.has(C.id)?u(C.id):c(C.id)},C.id)),b==="open"&&S>0&&o.jsxs("button",{type:"button",className:"sc-amore-tile",onClick:()=>y(C=>C+w0),"aria-label":`Show ${Math.min(S,w0)} more ${h}`,children:[o.jsxs("span",{className:"sc-amore-n",children:["+",S]}),o.jsx("span",{className:"sc-amore-t",children:"more"})]})]})}})}const q5=220,X5="cubic-bezier(0.32, 0.72, 0, 1)";function b8(e){const t=[];for(const n of e.querySelectorAll(".sc-agroup")){const r=n.querySelector(":scope > .sc-agroup-body");r&&t.push({group:n,body:r,height:r.getBoundingClientRect().height,marginBottom:Number.parseFloat(getComputedStyle(n).marginBottom)||0})}return t}function Die(e,t){const n=s.useRef(null),r=()=>{const a=e.current;if(!(!a||window.matchMedia("(prefers-reduced-motion: reduce)").matches)){for(const i of b8(a))for(const c of[...i.body.getAnimations(),...i.group.getAnimations()])c.finish();n.current=b8(a)}};return s.useLayoutEffect(()=>{const a=n.current;n.current=null;const i=e.current;if(!(!a||!i))for(const c of b8(i)){const u=a.find(f=>f.group===c.group);if(u){if(Math.abs(u.height-c.height)>.5){const{body:f}=c;f.style.overflow="hidden";const h=f.animate([{height:`${u.height}px`},{height:`${c.height}px`}],{duration:q5,easing:X5}),p=()=>{f.style.overflow=""};h.onfinish=p,h.oncancel=p}Math.abs(u.marginBottom-c.marginBottom)>.5&&c.group.animate([{marginBottom:`${u.marginBottom}px`},{marginBottom:`${c.marginBottom}px`}],{duration:q5,easing:X5})}}},[t]),r}function Hie({brand:e,shots:t,shotsTotal:n,attached:r=YM,full:a,onToken:i,offToken:c,onTemplate:u,offTemplate:f,onClose:h}){const p=Lf(),m=cl(),{applyBrand:v}=Rn(),{push:w}=ir(),[y,b]=fB(Dr.assetsExpanded,null),k=s.useRef(null),S=Die(k,y),C=Y=>{S(),b(ae=>ae===Y?null:Y)},[j,N]=s.useState(""),P=j.trim().length>0,$=Y=>{S(),N(""),b(Y)},R=Y=>P?"result":y===null?"idle":y===Y?"open":"collapsed",E=s.useMemo(()=>new Set(si(e.id)),[e.id]),M=s.useMemo(()=>{const Y=ae=>{const X=Vi(ae,p);return mm(ae,X,{currentId:null,query:"",bookmarked:E,shown:X.length}).items};return{product:Y("product"),presenter:Y("presenter"),scene:Y("scene")}},[p,E]),L=s.useMemo(()=>({product:Lu(M.product,j),presenter:Lu(M.presenter,j),scene:Lu(M.scene,j)}),[M,j]),H=s.useMemo(()=>{var Y;return Zs((Y=e.json)==null?void 0:Y.palette)},[e]),D=s.useMemo(()=>P?H.filter(Y=>vo(`${Y.name} ${Y.hex}`,j)):H,[H,j,P]),K=Y=>{(async()=>{var X;const ae=XA((X=e.json)==null?void 0:X.palette,Y);if(ae.swatch){if(ae.added)try{const le=await Me.updateBrand(e.id,{...e.json??{},palette:ae.palette});v(le)}catch(le){w(nn(le,"Could not save the brand"));return}$("colors")}})()},O=Y=>{(async()=>{var X;const ae=FY((X=e.json)==null?void 0:X.palette,Y);if(ae.removed)try{const le=await Me.updateBrand(e.id,{...e.json??{},palette:ae.palette});v(le)}catch(le){w(nn(le,"Could not save the brand"))}})()},_=R("shots")==="open",re=nw(e.id,"",_),z=s.useMemo(()=>{const Y=new Set,ae=[];for(const X of[...t,...re.items])X.status!=="done"||X.images.length===0||Y.has(X.id)||(Y.add(X.id),ae.push(X));return ae},[t,re.items]),F=Math.max(n??0,re.total,z.length),[Q,V]=s.useState(rp);s.useEffect(()=>{_||V(rp)},[_]);const I=()=>{V(Y=>Y+w0),re.hasMore&&z.length<Q+2*w0&&re.loadMore()},B=P&&!L.product.length&&!L.presenter.length&&!L.scene.length&&!D.length;return o.jsxs("aside",{ref:k,className:"sc-assets","aria-label":"Assets",children:[o.jsxs("div",{className:"sc-assets-head",children:[o.jsx("b",{children:"Assets"}),o.jsx("button",{type:"button",className:"sc-icon-btn",onClick:h,"aria-label":"Close assets",style:{width:28,height:28},children:o.jsx(jn,{size:12})})]}),o.jsx("div",{className:"sc-assets-searchbar",children:o.jsxs("div",{className:"sc-assets-search",children:[o.jsx(_u,{size:12}),o.jsx("input",{value:j,onChange:Y=>N(Y.target.value),onKeyDown:Y=>{Y.key==="Escape"&&j&&(Y.stopPropagation(),N(""))},placeholder:"Search assets","aria-label":"Search assets in this panel"}),P&&o.jsx("button",{type:"button",className:"sc-assets-clear",onClick:()=>N(""),"aria-label":"Clear search",children:o.jsx(jn,{size:11})})]})}),B&&o.jsxs("p",{className:"sc-assets-zero",children:["Nothing here matches “",j.trim(),"”."]}),o.jsx(y8,{kind:"product",title:"Products",items:L.product,attached:r.product,mode:R("product"),onToggle:C,onPick:Y=>i({t:"product",id:Y}),onUnpick:Y=>c({t:"product",id:Y}),full:a,moreLabel:"products",createLabel:"Add product",onCreate:()=>m("product",{onCreated:Y=>{Y.kind==="product"&&($("product"),i({t:"product",id:Y.id}))}})}),o.jsx(y8,{kind:"presenter",title:"Presenters",items:L.presenter,attached:r.presenter,mode:R("presenter"),onToggle:C,onPick:Y=>i({t:"character",id:Y}),onUnpick:Y=>c({t:"character",id:Y}),full:a,moreLabel:"presenters",createLabel:"Create presenter",onCreate:()=>m("presenter",{onCreated:()=>$("presenter")})}),o.jsx(y8,{kind:"scene",title:"Scenes",items:L.scene,attached:r.scene?[r.scene]:[],mode:R("scene"),onToggle:C,onPick:u,onUnpick:()=>f(),full:a,moreLabel:"scenes",createLabel:"Create scene",onCreate:()=>m("scene",{onCreated:Y=>{Y.kind==="scene"&&$("scene")}})}),!(P&&D.length===0)&&o.jsx(q6,{name:"Brand colors",count:D.length,mode:R("colors"),onToggle:()=>C("colors"),action:o.jsx(Zu,{className:"sc-aadd",triggerStyle:{background:"none"},value:nm(H),presets:H.map(Y=>Y.hex),commitMode:"close",align:"end",label:"Add colour",onChange:K,children:o.jsx(cr,{size:10})}),children:Y=>o.jsx("div",{className:"sc-arow",children:(Y==="open"?D:D.slice(0,z6)).map(ae=>{const X=r.color.includes(ae.hex.toLowerCase());return o.jsxs("div",{className:"sc-aswatch-tile","data-on":X||void 0,children:[o.jsxs("button",{type:"button",title:`${ae.name} ${ae.hex}`,"aria-pressed":X,onClick:()=>X?c({t:"color",hex:ae.hex,name:ae.name}):i({t:"color",hex:ae.hex,name:ae.name}),children:[o.jsx("span",{className:"sc-aswatch",style:{background:ae.hex}}),o.jsx("span",{className:"sc-acard-tick","aria-hidden":!0,children:o.jsx(Kn,{size:10,weight:"bold"})})]}),Y==="open"&&o.jsx("button",{type:"button",className:"sc-aswatch-x","aria-label":`Remove ${ae.name}`,title:"Remove",onClick:()=>O(ae.hex),children:o.jsx(jn,{size:10,weight:"bold"})})]},ae.hex)})})}),z.length>0&&!P&&o.jsx(q6,{name:"Recent shots",count:F,mode:R("shots"),onToggle:()=>C("shots"),children:Y=>o.jsxs("div",{className:Y==="open"?"sc-acard-grid":"sc-arow",children:[z.slice(0,Y==="open"?Q:z6).map((ae,X)=>{const le=ae.images[0],ke=r.ref.includes(le);return o.jsx(tP,{candidate:{label:`Shot ${F-X}`,full:`Shot ${F-X} · as reference`,thumb:dn(le,"micro")},on:ke,named:Y==="open",disabled:!!a&&!ke,title:a??void 0,onClick:()=>ke?c({t:"ref",imageHash:le}):i({t:"ref",imageHash:le,label:"Shot"})},ae.id)}),Y==="open"&&(z.length>Q||re.hasMore)&&o.jsxs("button",{type:"button",className:"sc-amore-tile",onClick:I,"aria-label":`Show ${w0} more shots`,"aria-busy":re.loading||void 0,children:[o.jsxs("span",{className:"sc-amore-n",children:["+",Math.max(1,F-Math.min(z.length,Q))]}),o.jsx("span",{className:"sc-amore-t",children:"more"})]})]})})]})}function Oie({sets:e,active:t,ungrouped:n,ungroupedCount:r,onPlaceAll:a,onPlaceUngrouped:i,onOpenSet:c,onNewSet:u,onResetNewSet:f,onRenameSet:h,onDeleteSet:p,askCreate:m,lens:v,lensCounts:w,onLens:y,q:b,onQ:k,searchTotal:S,sort:C,onSort:j,tile:N,onTile:P,assets:$,onAssets:R,showAssets:E}){const M=t?t.id:n?"__ungrouped__":"__all__",L=t?t.name:n?"Not in a set":"All shots",H=!!t||n,D=wr(Ks),[K,O]=s.useState(!1),[_,re]=s.useState(!1),[z,F]=s.useState(!1),[Q,V]=s.useState(""),I=s.useRef(null),B=s.useRef(!1),Y=()=>{B.current=!0,re(!0),V(""),O(!0)},ae=()=>{t&&(B.current=!1,re(!1),V(t.name),O(!0))};s.useEffect(()=>{m&&Y()},[m]);const X=()=>{const J=Q.trim();if(!J)return;const ne=B.current;B.current=!1,re(!1),O(!1),ne?u(J):h==null||h(J)},le=J=>{if(J){O(!0);return}const ne=B.current;B.current=!1,re(!1),O(!1),ne&&(f==null||f())},ke=Zj.map(J=>({value:J.id==="all"?null:J.id,label:J.label,count:w==null?void 0:w[J.id]})),te=o.jsxs(o.Fragment,{children:[o.jsxs(Th,{value:M,children:[o.jsx(vu,{value:"__all__",onSelect:a,children:"All shots"}),o.jsxs(vu,{value:"__ungrouped__",onSelect:i,children:["Not in a set",r>0?` · ${r}`:""]}),e.length>0&&o.jsx(Ul,{}),e.map(J=>o.jsx(vu,{value:J.id,onSelect:()=>c(J),children:J.name},J.id))]}),o.jsx(Ul,{}),o.jsx(tr,{onSelect:()=>{f==null||f(),Y()},children:"New set"}),t&&h&&o.jsx(tr,{onSelect:ae,children:"Rename"}),t&&p&&o.jsx(tr,{color:"red",onSelect:()=>F(!0),children:"Delete set"})]}),be=o.jsx(Th,{value:C,onValueChange:J=>j(J),children:_j.map(J=>o.jsx(vu,{value:J.id,children:J.label},J.id))}),G=H||C!=="newest";return o.jsxs("div",{className:"sc-toolbar",children:[o.jsxs("div",{className:"sc-toolbar-scope",children:[!D&&o.jsxs("div",{className:"sc-toolbar-where",children:[H&&o.jsx("button",{type:"button",className:"sc-toolbar-back","aria-label":"All shots",onClick:a,children:o.jsx(ga,{size:16})}),o.jsxs(Ss,{children:[o.jsx(Es,{children:o.jsxs("button",{type:"button",className:"sc-toolbar-place","data-on":H||void 0,"aria-label":L,children:[o.jsx(uv,{className:"sc-toolbar-place-ic",size:16}),o.jsx("span",{className:"sc-toolbar-place-t",children:L}),o.jsx(Xi,{size:10,className:"sc-caret"})]})}),o.jsx(Cs,{align:"start",children:te})]})]}),o.jsx(rv,{open:K,onOpenChange:le,children:o.jsxs(sv,{maxWidth:"360px","aria-describedby":void 0,onOpenAutoFocus:J=>{J.preventDefault();const ne=I.current;ne&&(ne.focus(),ne.select())},children:[o.jsx(av,{children:_?"Name this set":"Rename set"}),o.jsx("input",{ref:I,className:"sc-in",style:{width:"100%",marginTop:8},value:Q,"aria-label":"Set name",onChange:J=>V(J.target.value),onKeyDown:J=>{J.key==="Enter"&&X()}}),o.jsxs(js,{gap:"3",mt:"4",justify:"end",children:[o.jsx(ia,{variant:"soft",color:"gray",onClick:()=>le(!1),children:"Cancel"}),o.jsx(ia,{onClick:X,disabled:!Q.trim(),children:"Save"})]})]})}),o.jsx(of,{open:z,onOpenChange:F,children:o.jsxs(lf,{maxWidth:"420px",children:[o.jsx(cf,{children:"Delete this set?"}),o.jsx(uf,{size:"2",children:"Shots stay in the library. Only the set goes."}),o.jsxs(js,{gap:"3",mt:"4",justify:"end",children:[o.jsx(ff,{children:o.jsx(ia,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(df,{children:o.jsx(ia,{color:"red",onClick:()=>{p==null||p(),F(!1)},children:"Delete set"})})]})]})}),o.jsx(tw,{"aria-label":"Shot lenses",activeKey:v==="all"?null:v,items:ke,onSelect:J=>y(J??"all")})]}),o.jsxs("div",{className:"sc-toolbar-actions",children:[o.jsx(ld,{value:b,onChange:k,noun:"shots",total:S}),D?o.jsxs(Ss,{children:[o.jsx(Es,{children:o.jsxs("button",{type:"button",className:"sc-toolbar-btn sc-toolbar-view","data-on":G||void 0,"aria-label":`Set and sort: ${L}`,children:[o.jsx(dv,{size:15}),G&&o.jsx("span",{className:"sc-toolbar-view-dot","aria-hidden":!0})]})}),o.jsxs(Cs,{align:"end",children:[o.jsx(s6,{children:"Set"}),te,o.jsx(Ul,{}),o.jsx(s6,{children:"Sort"}),be]})]}):o.jsxs(Ss,{children:[o.jsx(Es,{children:o.jsxs("button",{type:"button",className:"sc-toolbar-btn","aria-label":"Sort shots",children:[o.jsx(ZU,{size:14}),o.jsx("span",{className:"sc-toolbar-btn-t",children:"Sort"}),o.jsx(Xi,{size:10})]})}),o.jsx(Cs,{align:"end",children:be})]}),o.jsx(Hte,{value:N,onChange:P}),E&&o.jsx("button",{type:"button",className:"sc-icon-btn sc-toolbar-assets","data-on":$||void 0,onClick:R,"aria-label":"Assets panel","aria-pressed":$,title:"Assets panel (.)",children:o.jsx(cW,{size:15,mirrored:!0})})]})]})}function Iie(e){const{push:t}=ir(),n=s.useCallback(c=>Me.archiveNode(c.id,!0).then(u=>(e(u),t({kind:"success",title:"Archived",detail:Sr(c),action:{label:"Undo",onClick:()=>void Me.archiveNode(c.id,!1).then(e)}}),!0)).catch(u=>(t(nn(u,"Could not archive this shot")),!1)),[e,t]),r=s.useCallback(c=>Me.archiveNode(c.id,!1).then(u=>(e(u),!0)).catch(u=>(t(nn(u,"Could not restore this shot")),!1)),[e,t]),a=s.useCallback(c=>Promise.all(c.map(u=>Me.archiveNode(u,!0))).then(u=>{for(const f of u)e(f);return t({kind:"success",title:`Archived ${u.length} shot${u.length===1?"":"s"}`,action:{label:"Undo",onClick:()=>{Promise.all(u.map(f=>Me.archiveNode(f.id,!1))).then(f=>{for(const h of f)e(h)})}}}),!0}).catch(u=>(t(nn(u,"Could not archive these shots")),!1)),[e,t]),i=s.useCallback(c=>Promise.all(c.map(u=>Me.archiveNode(u,!1))).then(u=>{for(const f of u)e(f);return!0}).catch(u=>(t(nn(u,"Could not restore these shots")),!1)),[e,t]);return{archive:n,archiveBatch:a,unarchive:r,unarchiveBatch:i}}function Fie(e){const{push:t}=ir(),n=s.useCallback(a=>Me.deleteNode(a.id).then(()=>e([a.id])).catch(i=>t(nn(i,"Could not delete this shot"))),[e,t]),r=s.useCallback(a=>Me.deleteNodesBatch(a).then(()=>e(a)).catch(i=>t(nn(i,"Could not delete these shots"))),[e,t]);return{remove:n,removeBatch:r}}function _ie(e,{demoProducts:t,presenters:n,scenes:r}){var f,h,p,m;const a=((f=e.brief)==null?void 0:f.tokens)??[],i=(h=a.find(v=>(v==null?void 0:v.t)==="product"))==null?void 0:h.id,c=(p=a.find(v=>(v==null?void 0:v.t)==="character"))==null?void 0:p.id,u=(m=a.find(v=>(v==null?void 0:v.t)==="template"))==null?void 0:m.id;return{product:i?t.find(v=>v.id===i):void 0,presenter:c?n.find(v=>v.id===c):void 0,scene:u?r.find(v=>v.id===u):void 0}}function Zie(e,t){const{product:n,presenter:r,scene:a}=_ie(e,t);return{productName:n?go(n,"chip"):null,productPreviewUrl:(n==null?void 0:n.previewUrl)??null,productId:(n==null?void 0:n.id)??null,presenterName:(r==null?void 0:r.name)??null,presenterPreviewUrl:r?ti(r).src:null,presenterId:(r==null?void 0:r.id)??null,sceneName:a?Ji(a,"chip"):null,scenePreviewUrl:(a==null?void 0:a.previewUrl)??null,sceneId:(a==null?void 0:a.id)??null}}function Vie(e){const t=s.useRef(null),n=s.useRef(0),r=s.useRef(null),a=s.useRef(0),i=s.useCallback(()=>{const h=t.current;h&&(n.current=h.scrollWidth/3)},[]);s.useEffect(()=>{const h=t.current;if(!h||!e)return;i(),h.scrollLeft=n.current;const p=new ResizeObserver(()=>{const m=n.current;i(),m<=0&&n.current>0&&(h.scrollLeft=n.current)});p.observe(h);for(const m of h.children)p.observe(m);return()=>p.disconnect()},[e,i]);const c=s.useCallback(()=>{const h=t.current,p=n.current;!h||p<=0||(h.scrollLeft<p*.5?(h.scrollLeft+=p,r.current!==null&&(r.current+=p)):h.scrollLeft>p*1.5&&(h.scrollLeft-=p,r.current!==null&&(r.current-=p)))},[]),u=s.useCallback(()=>{r.current=null,cancelAnimationFrame(a.current)},[]);s.useEffect(()=>{const h=t.current;if(!h)return;let p=0;const m=()=>{p||(p=requestAnimationFrame(()=>{p=0,c()}))},v=y=>{Math.abs(y.deltaY)<=Math.abs(y.deltaX)||(y.preventDefault(),u(),h.scrollLeft+=y.deltaY)},w=y=>{y.target.closest(".sc-shelf-arrow")||u()};return h.addEventListener("scroll",m,{passive:!0}),h.addEventListener("wheel",v,{passive:!1}),h.addEventListener("pointerdown",w),()=>{p&&cancelAnimationFrame(p),u(),h.removeEventListener("scroll",m),h.removeEventListener("wheel",v),h.removeEventListener("pointerdown",w)}},[u,c]);const f=s.useCallback(h=>{const p=t.current,m=p==null?void 0:p.firstElementChild;if(!p||!m)return;const v=m.offsetWidth||232,w=Number.parseFloat(getComputedStyle(p).columnGap)||0,y=v+w,b=r.current??p.scrollLeft;r.current=b+y*h;const k=()=>{u()};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){p.scrollLeft=r.current,k(),c();return}cancelAnimationFrame(a.current);let S=0;const C=()=>{const j=r.current;if(j===null)return;const N=j-p.scrollLeft;if(S+=1,Math.abs(N)<.5||S>45){p.scrollLeft=j,k(),c();return}p.scrollLeft+=N*.16,a.current=requestAnimationFrame(C)};a.current=requestAnimationFrame(C)},[u,c]);return{ref:t,page:f}}function zie(e){const t=[...e];for(let n=t.length-1;n>0;n--){const r=Math.floor(Math.random()*(n+1));[t[n],t[r]]=[t[r],t[n]]}return t}function Bie({entries:e,catalogs:t,stagedId:n,onUse:r,productHref:a,presenterHref:i,sceneHref:c}){const u=s.useMemo(()=>zie(e).slice(0,10),[e]),{ref:f,page:h}=Vie(u.length);return o.jsxs("div",{className:"sc-canvas-empty",children:[o.jsxs("h3",{children:["Your first ",o.jsx("em",{children:"shot"})]}),o.jsx("p",{children:"Describe what you want in the prompt below, or open one of these."}),u.length>0&&o.jsxs("div",{className:"sc-shelf",children:[o.jsx("button",{type:"button",className:"sc-shelf-arrow prev","aria-label":"Previous examples",onClick:()=>h(-1),children:o.jsx(ga,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-shelf-arrow next","aria-label":"More examples",onClick:()=>h(1),children:o.jsx(il,{size:13,weight:"bold"})}),o.jsx("div",{className:"sc-shelf-row",ref:f,children:[0,1,2].map(p=>u.map(m=>o.jsx(XM,{entry:m,size:"grid",hideRecipe:!0,decorative:p!==1,active:n===m.id,onOpen:()=>r(m),productHref:a,presenterHref:i,sceneHref:c,...Zie(m,t)},`${p}-${m.id}`)))})]})]})}function Qd({text:e,onAll:t,actionLabel:n="Show all shots"}){return o.jsxs("div",{className:"sc-feed-empty",children:[o.jsx("p",{children:e}),t&&o.jsx("button",{type:"button",className:"sc-btn",onClick:t,children:n})]})}function Uie({count:e,sets:t,activeSet:n,onAdd:r,onRemove:a,onNew:i,onClear:c,onKeep:u,onArchiveBatch:f,allKept:h,archivedLens:p,pickedIds:m,onRestoreBatch:v,onDeleteBatch:w,loaded:y,onSelectAll:b}){const[k,S]=s.useState(!1);return o.jsxs("div",{className:"sc-picked","data-lens":p?"archived":void 0,role:"toolbar","aria-label":"Selection",children:[o.jsxs("span",{className:"sc-picked-meta",children:[o.jsxs("span",{className:"sc-picked-n",role:"status",children:[e,o.jsx("span",{className:"sc-vh",children:" selected"})]}),y>1&&o.jsx("button",{type:"button",className:"sc-picked-all",onClick:e<y?b:c,children:e<y?"Select all":"Deselect all"})]}),o.jsx("span",{className:"sc-picked-rule","aria-hidden":!0}),o.jsx("span",{className:"sc-picked-tools",children:p?o.jsxs(o.Fragment,{children:[o.jsx(ou,{label:"Restore",onClick:()=>v(m),children:o.jsx(R0,{size:17})}),o.jsx(ou,{label:`Delete ${e} permanently`,tone:"danger",onClick:()=>S(!0),children:o.jsx(ll,{size:17})})]}):o.jsxs(o.Fragment,{children:[o.jsx(ou,{label:h?"Remove from keepers":"Keep",onClick:u,children:o.jsx(Da,{size:17,weight:h?"fill":"regular"})}),o.jsxs(Ss,{children:[o.jsx(or,{label:"Add to set",children:o.jsx(Es,{children:o.jsx("button",{type:"button",className:"sc-picked-tool","aria-label":"Add to set",children:o.jsx(uv,{size:17})})})}),o.jsxs(Cs,{children:[t.filter(C=>C.id!==(n==null?void 0:n.id)).map(C=>o.jsx(tr,{onSelect:()=>r(C),children:C.name},C.id)),t.some(C=>C.id!==(n==null?void 0:n.id))&&o.jsx(Ul,{}),o.jsx(tr,{onSelect:i,children:"New set…"})]})]}),n&&a&&o.jsx(ou,{label:JR(e,n.name),onClick:a,children:o.jsx(_C,{size:17})}),o.jsx(ou,{label:"Archive",tone:"danger",onClick:()=>f(m),children:o.jsx(_p,{size:17})})]})}),o.jsx("span",{className:"sc-picked-rule","aria-hidden":!0}),o.jsx("span",{className:"sc-picked-exit",children:o.jsx(ou,{label:"Done",onClick:c,children:o.jsx(jn,{size:16,weight:"bold"})})}),p&&o.jsx(Wn,{label:`Delete ${e} permanently`,title:`Delete ${e} shot${e===1?"":"s"} permanently?`,body:"This cannot be undone.",busy:!1,open:k,onOpenChange:S,onConfirm:()=>w(m)})]})}function ou({label:e,tone:t,onClick:n,children:r}){return o.jsx(or,{label:e,children:o.jsx("button",{type:"button",className:"sc-picked-tool","data-tone":t,"aria-label":e,onClick:n,children:r})})}function Wie(e,t){return[e,t.lens??"all",t.set??"",t.ungrouped?"ungrouped":"",t.lineage??"",t.token??"",(t.q??"").trim(),t.sort??"newest",t.limit??""].join("|")}function Kie(e){switch(e){case"oldest":return(t,n)=>wu(n,t);case"cost":return(t,n)=>n.costUsd-t.costUsd||wu(t,n);case"keepers":return(t,n)=>Number(n.kept)-Number(t.kept)||wu(t,n);default:return wu}}function nP(e,t,n){return e.kind==="root"?!1:t.lineage?n.inLineage?n.inLineage(e):!1:t.set?n.inSet?n.inSet(e.id):!1:t.ungrouped?n.inAnySet?!n.inAnySet(e.id):!1:!0}function Gie(e,t){return t==="archived"?e.archived:t==="keepers"?!e.archived&&e.kept:!e.archived}function Q5(e,t,n){var r;return(r=t.q)!=null&&r.trim()?null:nP(e,t,n)&&Gie(e,t.lens)}function J5(e){return!e||e.kind==="root"?{all:0,keepers:0,archived:0}:{all:e.archived?0:1,keepers:!e.archived&&e.kept?1:0,archived:e.archived?1:0}}function x8(e,t,n,r){if(!r)return e;const a=J5(t),i=J5(n),c={...e,all:e.all+i.all-a.all,keepers:e.keepers+i.keepers-a.keepers,archived:e.archived+i.archived-a.archived};return c.all===e.all&&c.keepers===e.keepers&&c.archived===e.archived?e:c}function X6(e,t){const n=e.findIndex(a=>a.id===t.id);if(n===-1||e[n]===t)return e;const r=[...e];return r[n]=t,r}function eS(e,t){const n=new Set(t);return e.some(r=>n.has(r.id))?e.filter(r=>!n.has(r.id)):e}function Yie(e,t,n,r){if(e.some(u=>u.id===t.id))return X6(e,t);const a=Kie(n);let i=0;for(;i<e.length&&a(e[i],t)<=0;)i++;if(i===e.length&&!r)return e;const c=[...e];return c.splice(i,0,t),c}function qie(e,t){const n=new Set(e.map(a=>a.id)),r=t.filter(a=>!n.has(a.id));return r.length?[...e,...r]:e}function Xie(e,t){const n=new Set(t.map(r=>r.id));return[...t,...e.filter(r=>!n.has(r.id))]}const k8=60;function Qie(e,t,n){const{shotsEpoch:r}=on(),a=`${Wie(e,t)}#${r}`,[i,c]=s.useState({brandId:e,key:"",items:[],next:null,counts:null,error:null}),[u,f]=s.useState(!1),h=s.useRef(i);h.current=i;const p=s.useRef(t);p.current=t;const m=s.useRef(n);m.current=n;const v=s.useRef(!1);s.useEffect(()=>{const N=new AbortController;return f(!0),Me.feed(e,{...p.current,limit:k8},N.signal).then(P=>{N.signal.aborted||c({brandId:e,key:a,items:P.items,next:P.next,counts:P.counts??null,error:null})}).catch(P=>{if(N.signal.aborted)return;const $=String((P==null?void 0:P.message)??P);c(R=>({...R,brandId:e,key:a,error:$}))}).finally(()=>{N.signal.aborted||f(!1)}),()=>N.abort()},[e,a]);const w=s.useCallback(()=>{const N=h.current;if(N.key!==a||!N.next||v.current)return;v.current=!0,f(!0);const P=N.next;Me.feed(e,{...p.current,limit:k8,cursor:P}).then($=>{c(R=>R.key!==a?R:{...R,items:qie(R.items,$.items),next:$.next,counts:$.counts??R.counts})}).catch(()=>{}).finally(()=>{v.current=!1,f(!1)})},[e,a]),y=s.useCallback(async()=>{const N=await Me.feed(e,{...p.current,limit:k8});c(P=>P.key!==a?P:{...P,items:Xie(P.items,N.items),next:P.items.length?P.next:N.next,counts:N.counts??P.counts,error:null})},[e,a]),b=s.useCallback(N=>{c(P=>{const $=P.items.find(H=>H.id===N.id);if(!$)return P;const R=p.current,M=Q5(N,R,m.current)===!1?eS(P.items,[N.id]):X6(P.items,N),L=P.counts?x8(P.counts,$,N,!0):P.counts;return M===P.items&&L===P.counts?P:{...P,items:M,counts:L}})},[]),k=s.useCallback((N,P)=>{let $=!1;c(R=>{let E=R.items,M=R.counts;const L=p.current;for(const H of N){if(E.some(_=>_.id===H.id)){E=X6(E,H);continue}const D=Q5(H,L,m.current);if(D===null){$=!0;continue}const K=nP(H,L,m.current);D&&(E=Yie(E,H,L.sort,R.next===null));const O=(P==null?void 0:P.get(H.id))??null;M&&(M=x8(M,O,H,K))}return E===R.items&&M===R.counts?R:{...R,items:E,counts:M}}),$&&y().catch(()=>{})},[y]),S=s.useCallback(N=>{c(P=>{const $=P.items.filter(E=>N.includes(E.id));if(!$.length)return P;let R=P.counts;if(R)for(const E of $)R=x8(R,E,null,!0);return{...P,items:eS(P.items,N),counts:R}})},[]),C=i.brandId===e?i.items:[],j=s.useMemo(()=>new Map(C.map(N=>[N.id,N])),[C]);return{items:C,byId:j,counts:i.brandId===e?i.counts:null,ready:i.key===a&&!i.error,loading:u,complete:i.key===a&&i.next===null,error:i.key===a?i.error:null,loadMore:w,patch:b,insert:k,drop:S,refresh:y}}function Jie(){const e=un(ut.hubShot),t=un(ut.setShot);return(e==null?void 0:e.params.shotId)??(t==null?void 0:t.params.shotId)??null}function tS(e,t){const n=e?t.get(e)??null:null,[r,a]=s.useState(null);return s.useEffect(()=>{if(!e||n)return;let i=!0;return Me.node(e).then(c=>i&&a({id:e,node:c})).catch(()=>i&&a({id:e,node:null})),()=>{i=!1}},[e,n]),e?n?{node:n,missing:!1}:(r==null?void 0:r.id)===e?{node:r.node,missing:r.node===null}:{node:null,missing:!1}:{node:null,missing:!1}}function rP({set:e}){const{engines:t,scenes:n,presenters:r,demoProducts:a,showcase:i,showcaseLoaded:c}=Rn(),{brand:u,workspace:f,root:h,recent:p,sets:m,membership:v,loaded:w,refresh:y,applySet:b,dropSet:k,insertSet:S,applyMembership:C,applyNodes:j,subscribeActivity:N,products:P}=on(),$=Lf(),R=Dn(),[E,M]=tl(),L=Jie(),[H,D]=s.useState(null),[K,O]=s.useState(!1);s.useEffect(()=>{const ie=()=>O(!0);return window.addEventListener("scenri:shortcuts",ie),()=>window.removeEventListener("scenri:shortcuts",ie)},[]);const{open:_,toggle:re,setOpen:z}=ote(),F=wr("(min-width: 1280px)"),Q=F&&_,[V,I]=s.useState(null),[B,Y]=s.useState(YM),[ae,X]=s.useState(null),[le,ke]=s.useState(null),te=s.useRef(!1);s.useEffect(()=>{if(!te.current||L)return;te.current=!1;const ie=requestAnimationFrame(()=>{var $e;return($e=Ze.current)==null?void 0:$e.focus()});return()=>cancelAnimationFrame(ie)},[L,le]);const[be,G]=s.useState(null),[J,ne]=s.useState(new Set),[W,he]=X1("tab","all"),[Xe,tt]=X1("in",""),[ze,nt]=X1("branch",""),[ce,ve]=X1("lineage",""),[Pe,ue]=fa(Dr.tileSize,kM),Ee=SM(Pe),{q:Ke,setQ:ye,clearSearch:Se}=Tf([]),[Ie,Be]=fa(Dr.feedSort,"newest"),Re=MW(Ie)?Ie:"newest",Ze=s.useRef(null),{push:Qe}=ir(),{poke:lt}=Va(),[Lt,Ut]=s.useState(null),Ct=(f==null?void 0:f.id)??"",cn=e?n0(u,e):mr(u),Fe=s.useCallback(ie=>{const $e=E.toString();return`${cn}/shots/${ie}${$e?`?${$e}`:""}`},[cn,E]),mt=s.useCallback((ie,$e=!1)=>R(Fe(ie),{replace:$e}),[R,Fe]),it=s.useCallback(()=>{const ie=new URLSearchParams(E);ie.delete("panel");const $e=ie.toString();R(`${cn}${$e?`?${$e}`:""}`,{replace:!0})},[cn,R,E]),St=RW(W)?W:"all",xt=!e&&Xe==="ungrouped";s.useEffect(()=>{W==="ungrouped"&&(he(null),tt("ungrouped"))},[W,he,tt]);const Nt=s.useMemo(()=>{const ie=new Map;for(const $e of m)for(const Je of v[$e.id]??[])ie.has(Je)||ie.set(Je,[]),ie.get(Je).push($e);return ie},[m,v]),Kt=s.useMemo(()=>({lens:St,set:e==null?void 0:e.id,ungrouped:xt||void 0,lineage:ce||void 0,q:Ke.trim()||void 0,sort:Re}),[St,e==null?void 0:e.id,xt,ce,Ke,Re]),et=s.useRef(v);et.current=v;const gt=s.useRef(Nt);gt.current=Nt;const ot=s.useRef(new Set),kn=s.useMemo(()=>({inSet:ie=>e?(et.current[e.id]??[]).includes(ie):!1,inAnySet:ie=>gt.current.has(ie),inLineage:ie=>ie.id===ce||ie.parentId!==null&&ot.current.has(ie.parentId)}),[e==null?void 0:e.id,ce]),dt=Qie(u.id,Kt,kn),{items:Gt,byId:Ft,counts:en}=dt,Jt=s.useRef(dt);Jt.current=dt,ot.current=s.useMemo(()=>new Set(Gt.map(ie=>ie.id)),[Gt]);const se=s.useRef(new Map);s.useEffect(()=>{for(const ie of Gt)se.current.set(ie.id,ie)},[Gt]);const oe=s.useRef(null),[we,ge]=s.useState("");s.useEffect(()=>N(ie=>{const{messages:$e,next:Je}=fie(oe.current??new Map,ie),Vt=oe.current===null;oe.current=Je,!Vt&&$e.length&&ge($e.join(" "));const Yt=Jt.current;let Bn=!1;const Nn=[],xn=new Map;for(const Sn of ie){if(Yt.byId.has(Sn.id))Yt.patch(Sn);else if(se.current.has(Sn.id)){const hs=se.current.get(Sn.id);hs&&xn.set(Sn.id,hs),Nn.push(Sn)}else Sn.kind!=="root"&&(Bn=!0);se.current.set(Sn.id,Sn)}Nn.length&&Yt.insert(Nn,xn),Bn&&Yt.ready&&Yt.refresh().catch(()=>{})}),[N]);const ee=w&&dt.ready,He=tS(ce||null,Ft);s.useEffect(()=>{!ce||!He.missing||(ve(null),Qe({kind:"info",title:"That shot is no longer available",detail:"Showing everything instead."}))},[ce,He.missing,ve,Qe]);const We=s.useMemo(()=>{var Vt,Yt;const ie=P.length?P:((Vt=u.json)==null?void 0:Vt.products)??[],$e=((Yt=u.json)==null?void 0:Yt.characters)??[],Je=$.scenes;return{product:Bn=>{const Nn=ie.find(xn=>xn.id===Bn)??a.find(xn=>xn.id===Bn);return Nn?go(Nn,"chip"):null},person:Bn=>{var Nn,xn;return((Nn=$e.find(Sn=>Sn.id===Bn))==null?void 0:Nn.name)??((xn=r.find(Sn=>Sn.id===Bn))==null?void 0:xn.name)??null},scene:Bn=>{const Nn=Je.find(xn=>xn.id===Bn);return Nn?Ji(Nn,"chip"):null}}},[P,a,u,r,$.scenes]),Ue=s.useMemo(()=>{const ie=H?Ft.get(H):void 0;return ie||(Gt.find($e=>$e.status!=="error")??Gt[0]??null)},[Ft,Gt,H]),Ge=tS(ze||null,Ft),me=s.useMemo(()=>{const ie=Ge.node;return!ie||ie.kind==="root"?null:ie.status==="running"||ie.status==="done"&&ie.images.length>0?ie:null},[Ge.node]),_e=(me==null?void 0:me.images[0])??null,U=s.useCallback(()=>nt(null),[nt]),pe=s.useRef(null),Oe=s.useCallback((...ie)=>{if(pe.current){for(const Je of ie)pe.current.add(Je);return}const $e=new Set(ie);pe.current=$e,queueMicrotask(()=>{pe.current=null,M(Je=>{const Vt=new URLSearchParams(Je);for(const Yt of $e)Vt.delete(Yt);return Vt},{replace:!0})})},[M]),Le=s.useCallback(()=>Oe("scene","setup","presenter","product"),[Oe]);s.useEffect(()=>{!ze||!ee||(Ge.node&&!me?(U(),Qe({kind:"info",title:"That shot is no longer available to refine",detail:"Making a new shot."})):Ge.missing&&(U(),Qe({kind:"info",title:"That shot is no longer available to refine",detail:"Making a new shot."})))},[ze,Ge.node,Ge.missing,me,ee,U,Qe]);const bt=s.useCallback(ie=>{var $e;nt(ie),($e=Ze.current)==null||$e.focus()},[nt]),vt=ie=>D(ie),jt=ie=>L||/\/shots\//.test(window.location.pathname)?mt(ie,!0):vt(ie),st=s.useCallback(ie=>{for(const $e of ie)se.current.set($e.id,$e);Jt.current.insert(ie),j(ie),lt()},[j,lt]),$t=s.useCallback(async()=>{try{await y(),await Jt.current.refresh(),I(null)}catch(ie){I(String(ie.message??ie))}},[y]),An=s.useCallback(ie=>j([ie]),[j]),{archive:q,archiveBatch:fe,unarchive:Ae,unarchiveBatch:Ye}=Iie(An),ft=s.useCallback(ie=>Jt.current.drop(ie),[]),{remove:wt,removeBatch:Zt}=Fie(ft);s.useEffect(()=>{L&&D(L)},[L]);const Ht=s.useRef(new Set),pn=async ie=>{var $e,Je;if(ie.status==="running"||Ht.current.has(ie.id))return ie.id;if(ie.status==="error"||ie.status==="cancelled"){Ht.current.add(ie.id);try{const Vt=await Me.retryNode(ie.id);return j([Vt]),lt(),Vt.id}catch(Vt){return Qe(nn(Vt,"Could not run this again")),null}finally{Ht.current.delete(ie.id)}}try{const Vt=await Me.node(ie.id),Yt=await Me.addNode({projectId:Ct,parentId:ie.parentId,kind:ie.kind==="edit"?"edit":"generation",prompt:Vt.prompt,engineId:ie.engineId,count:1,brief:ie.brief,...ie.kind==="edit"&&(($e=ie.brief)!=null&&$e.sourceImage)?{sourceImage:ie.brief.sourceImage}:{}});return st((Je=Yt.siblings)!=null&&Je.length?Yt.siblings:[Yt]),(Yt==null?void 0:Yt.id)??null}catch(Vt){return Qe(nn(Vt,"Could not run this again")),null}},Wt=async ie=>{try{await Me.cancelNode(ie.id),j([{...ie,status:"cancelled"}]),lt()}catch($e){Qe(nn($e,"Could not cancel this shot"))}},wn=s.useCallback(ie=>{var $e,Je,Vt;ie!=null&&ie.scene&&(($e=Ze.current)==null||$e.applyScene(ie.scene)),ie!=null&&ie.scenesPanel&&((Je=Ze.current)==null||Je.openAttach("Scenes")),(Vt=Ze.current)==null||Vt.focus()},[]);s.useEffect(()=>{var $e;if(E.get("compose")===null)return;const ie=E.get("attach")==="all";wn(),ie&&(($e=Ze.current)==null||$e.showAttach()),Oe("compose",...ie?["attach"]:[])},[E,wn,Oe]);const sn=E.get("showcase"),In=s.useRef(null);s.useEffect(()=>{if(!sn||!c||In.current===sn)return;In.current=sn;const ie=i.find($e=>$e.id===sn);ie?(ke(O6(ie)),Qe({kind:"info",title:`Starting from "${ie.title}"`})):Qe({kind:"info",title:"That example is no longer available",detail:"Starting from scratch instead."}),M($e=>{const Je=new URLSearchParams($e);return Je.delete("showcase"),Je},{replace:!0})},[sn,c,i,M,Qe]);const Dt=async(ie,$e=!ie.kept)=>{j([{...ie,kept:$e}]);try{j([await Me.keep(ie.id,$e)])}catch(Je){j([ie]),Qe(nn(Je,"Could not update keeper status"))}},On=s.useMemo(()=>[...J].map(ie=>Ft.get(ie)).filter(ie=>!!ie),[Ft,J]),Et=async()=>{const ie=!(On.length>0&&On.every(Je=>Je.kept)),$e=On.filter(Je=>Je.kept!==ie);j($e.map(Je=>({...Je,kept:ie})));try{j(await Promise.all($e.map(Je=>Me.keep(Je.id,ie))))}catch(Je){j($e),Qe(nn(Je,"Could not update keeper status"))}},Hn=ie=>{const $e=ie.map(Je=>Ft.get(Je)).filter(Je=>!!Je&&!Je.archived);$e.length&&j($e.map(Je=>({...Je,archived:!0}))),ne(new Set),fe(ie).then(Je=>{Je||j($e)})},Ot=ie=>{const $e=ie.map(Je=>Ft.get(Je)).filter(Je=>!!Je&&Je.archived);$e.length&&j($e.map(Je=>({...Je,archived:!1}))),ne(new Set),Ye(ie).then(Je=>{Je||j($e)})},tn=s.useCallback((ie,$e)=>{et.current={...et.current,[ie]:$e},C(ie,$e)},[C]),Vn=async ie=>{try{const $e=await Me.addToSet(ie.id,[...J]);tn(ie.id,$e.nodeIds),ne(new Set),(e||xt)&&Jt.current.refresh()}catch($e){Qe(nn($e,"Could not add to the set"))}},ur=async(ie,$e)=>{const Je=et.current[ie.id]??[],Vt=Je.filter(Yt=>!$e.includes(Yt));tn(ie.id,Vt),ne(Yt=>{if(!$e.some(Nn=>Yt.has(Nn)))return Yt;const Bn=new Set(Yt);for(const Nn of $e)Bn.delete(Nn);return Bn}),(e==null?void 0:e.id)===ie.id&&Jt.current.drop($e);try{const Yt=await Me.removeFromSet(ie.id,$e);tn(ie.id,Yt.nodeIds),xt&&Jt.current.refresh()}catch(Yt){tn(ie.id,Je),((e==null?void 0:e.id)===ie.id||xt)&&Jt.current.refresh(),Qe(nn(Yt,"Could not remove from the set"))}},Zr=ie=>ur(ie,[...J]),zn=(ie,$e)=>ur($e,[ie.id]),yn=s.useRef([]),[za,xo]=s.useState(!1);s.useEffect(()=>{za&&xo(!1)},[za]);const ko=async(ie,$e)=>{const Je=$e.trim();if(Je)try{const Vt=await Me.createSet(u.id,Je);if(S(Vt),ie.length>0){const Yt=await Me.addToSet(Vt.id,ie);tn(Vt.id,Yt.nodeIds)}ne(new Set),R(n0(u,Vt))}catch(Vt){Qe(nn(Vt,"Could not create the set"))}},dl=()=>{const ie=yn.current;return yn.current=[],ie},wa=async ie=>{if(!e)return;const $e=ie.trim();if(!(!$e||$e===e.name))try{const Je=await Me.renameSet(e.id,$e);b(Je),R(n0(u,Je),{replace:!0}),y()}catch(Je){Qe(nn(Je,"Could not rename the set"))}},So=async()=>{if(e)try{await Me.deleteSet(e.id),k(e.id),R(mr(u),{replace:!0}),y()}catch(ie){Qe(nn(ie,"Could not delete the set"))}},ya=async ie=>{var Sn;const $e=((Sn=/\/shots\/([^/?#]+)/.exec(window.location.pathname))==null?void 0:Sn[1])??null,Je=$e?Ft.get($e)??null:Ue;if(!Je)return;if(ie==="left"||ie==="right"){const{prev:hs,next:ud}=c6(Gt,Je.id),fi=ie==="left"?hs:ud;fi&&jt(fi.id);return}const Vt=await Me.lineage(Je.id).catch(()=>null);if(!Vt)return;const Yt=Vt.history??[...Vt.ancestors,Je,...Vt.children.slice(0,1)],{prev:Bn,next:Nn}=c6(Yt.filter(hs=>hs.id===Je.id||hs.images[0]),Je.id),xn=ie==="up"?Bn:Nn;xn&&jt(xn.id)};s.useEffect(()=>{const ie=$e=>{var Nn,xn;if($e.defaultPrevented)return;const Je=document.activeElement,Vt=((Je==null?void 0:Je.tagName)??"").toUpperCase(),Yt=Vt==="INPUT"||Vt==="TEXTAREA"||Vt==="SELECT"||!!(Je!=null&&Je.closest('[contenteditable="true"]'))||!!(Je!=null&&Je.closest('[role="separator"]')),Bn=!!(Je!=null&&Je.closest('button, a[href], [role="button"], [role="tab"], [role="menuitem"]'));if($e.key==="Enter"&&($e.metaKey||$e.ctrlKey)){(Nn=Ze.current)==null||Nn.submit(),$e.preventDefault();return}if(!Yt){if($e.key==="?"){O(!0),$e.preventDefault();return}if($e.key==="/"&&!L){(xn=Ze.current)==null||xn.focus(),$e.preventDefault();return}if($e.key==="Escape"&&K){O(!1),$e.preventDefault();return}if($e.key==="Escape"&&L){it(),$e.preventDefault();return}if($e.key==="Escape"&&J.size>0){ne(new Set),$e.preventDefault();return}if($e.key==="Escape"&&ze){U(),$e.preventDefault();return}if(Ue){if($e.key==="b"&&Ue.kind!=="root"&&Ue.status==="done"&&Ue.images.length>0){bt(Ue.id),$e.preventDefault();return}if($e.key==="k"&&Ue.kind!=="root"&&Ue.status==="done"){Dt(Ue),$e.preventDefault();return}$e.key==="ArrowLeft"?(ya("left"),$e.preventDefault()):$e.key==="ArrowRight"?(ya("right"),$e.preventDefault()):$e.key==="ArrowUp"?(ya("up"),$e.preventDefault()):$e.key==="ArrowDown"?(ya("down"),$e.preventDefault()):$e.key==="Enter"&&!L&&Ue.kind!=="root"&&!Bn?mt(Ue.id):$e.key==="."&&!L&&F&&re()}}};return window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)},[Ue,L,K,J.size,ze,bt,nt,h,F]);const ba=ie=>ne($e=>{const Je=new Set($e);return Je.delete(ie)||Je.add(ie),Je}),Vr=ee&&en!==null&&en.total===0,ts=Q||Vr&&F,Gs=Vr?o.jsx(Bie,{entries:i,catalogs:{demoProducts:a,presenters:r,scenes:n},stagedId:be,productHref:ie=>la(u,ie),presenterHref:ie=>ha(u,ie),sceneHref:ie=>_r(u,ie),onUse:ie=>{G(ie.id),ke(O6(ie))}}):Ke.trim()?o.jsx(Qd,{text:`No shots match “${Ke.trim()}”.`,onAll:Se,actionLabel:"Clear search"}):St==="keepers"?o.jsx(Qd,{text:"No keepers yet. Star a shot and it lands here.",onAll:()=>he(null)}):St==="archived"?o.jsx(Qd,{text:"Nothing archived.",onAll:()=>he(null)}):e?o.jsx(Qd,{text:"Nothing in this set yet. Pick shots on All, then add them here."}):xt?o.jsx(Qd,{text:"Every shot is already in a set.",onAll:()=>tt(null)}):null,Ba=s.useRef(0);!Ke.trim()&&en&&(Ba.current=en[St]);const[Pr,Lr]=fa(Dr.feedCounts,null);s.useEffect(()=>{if(!en)return;const ie={brandId:u.id,all:en.all,keepers:en.keepers,archived:en.archived};Lr($e=>$e&&$e.brandId===ie.brandId&&$e.all===ie.all&&$e.keepers===ie.keepers&&$e.archived===ie.archived?$e:ie)},[u.id,en,Lr]);const Ua=s.useMemo(()=>en?{all:en.all,keepers:en.keepers,archived:en.archived}:(Pr==null?void 0:Pr.brandId)===u.id?{all:Pr.all,keepers:Pr.keepers,archived:Pr.archived}:null,[en,Pr,u.id]),di={byId:Ft,items:Gt,loadMore:dt.loadMore,complete:dt.complete,rootId:h,recent:p,loaded:ee,setsFor:ie=>Nt.get(ie)??[],brand:u,engines:t,projectId:Ct,close:it,select:jt,retry:ie=>{pn(ie).then($e=>{$e&&jt($e)})},cancel:ie=>void Wt(ie),keep:ie=>void Dt(ie),reload:$t,remix:ie=>{var Bn;const $e=(Bn=ie.brief)==null?void 0:Bn.tokens,Je=ie.prompt??ie.promptHead,Vt=$e!=null&&$e.length||!Je?ie.brief:{...ie.brief,tokens:[{t:"text",v:Je}]},Yt=Vt!=null&&Vt.tokens?{...Vt,tokens:b6(u,Vt.tokens)}:Vt;ke({...Yt,_at:Date.now()}),Yt&&GM(u.id,{tokens:Iv(Yt),tplFields:Yt.templateFields??{}}),it(),Qe({kind:"info",title:"Starting from this shot",detail:"Its prompt, chips and settings are in the composer. Change anything, then Generate."}),te.current=!0},branch:ie=>{bt(ie.id),it()},archive:ie=>q(ie).then($e=>{$e&&it()}),unarchive:ie=>Ae(ie).then(()=>{}),delete:ie=>void wt(ie).then(()=>it()),landed:st,refined:(ie,$e)=>{$e==="edit"&&nt(ie)},subscribeActivity:N,tokenNames:We};return o.jsxs("div",{className:"sc-work","data-assets":ts,children:[o.jsxs("main",{className:"sc-canvas",id:"main","data-page-scroll":"","data-firstrun":Vr||void 0,onClick:ie=>{if(J.size===0&&!H)return;const $e=ie.target;$e.closest(".sc-cell")||$e.closest("button, a, input, select, textarea, label, [role], [contenteditable]")||(ne(new Set),D(null))},children:[o.jsx("span",{className:"sc-vh",role:"status","aria-live":"polite",children:we}),(V||dt.error)&&o.jsx("div",{className:"sc-canvas-alert",children:o.jsx(mv,{failure:Ef(V??dt.error??"")})}),(!Vr||e)&&o.jsx(Oie,{sets:m,active:e,ungrouped:xt,ungroupedCount:(en==null?void 0:en.ungrouped)??0,onPlaceAll:()=>e?R(mr(u)):tt(null),onPlaceUngrouped:()=>e?R(`${mr(u)}?in=ungrouped`):tt("ungrouped"),onOpenSet:ie=>R(n0(u,ie)),onNewSet:ie=>void ko(dl(),ie),onResetNewSet:()=>{yn.current=[]},onRenameSet:ie=>void wa(ie),onDeleteSet:()=>void So(),askCreate:za,lens:St,lensCounts:Ua,onLens:ie=>he(ie==="all"?null:ie),q:Ke,onQ:ye,searchTotal:Ke.trim()?Ba.current:(en==null?void 0:en[St])??0,sort:Re,onSort:Be,tile:Ee,onTile:ue,assets:Q,onAssets:re,showAssets:F}),ce&&He.node&&o.jsxs("div",{className:"sc-lineage-bar",children:[o.jsx("button",{type:"button",className:"sc-crumb-back",onClick:()=>ve(null),children:"All shots"}),o.jsx("span",{className:"sc-crumb-sep",children:"›"}),o.jsx("b",{dir:"auto",children:Sr(He.node)}),o.jsx("span",{className:"sc-crumb-sep",children:"›"}),o.jsx("span",{className:"sc-crumb-here",children:"versions"})]}),o.jsx(Lie,{nodes:Gt,selectedId:H,onOpen:mt,shotHref:Fe,onRetry:ie=>void pn(ie),onCancel:ie=>void Wt(ie),onToggleKeep:ie=>void Dt(ie),onArchive:ie=>ie.archived?Ae(ie):q(ie),onDeletePermanently:wt,engineName:ie=>{var $e;return($e=t.find(Je=>Je.id===ie))==null?void 0:$e.displayName},picked:J,onPick:ba,sending:Lt,onBranch:bt,branchingFrom:(me==null?void 0:me.id)??null,onVersions:ve,tile:Ee,empty:ee?Gs:null,pending:!ee,onNearEnd:dt.complete?void 0:dt.loadMore,inSet:e,setsFor:ie=>Nt.get(ie)??[],onRemoveFromSet:(ie,$e)=>void zn(ie,$e),onKeepPicked:()=>void Et(),onArchivePicked:()=>Hn([...J]),onRestorePicked:()=>Ot([...J]),onDeletePicked:()=>void Zt([...J]).then(()=>ne(new Set)),onRemovePickedFromSet:ie=>void Zr(ie)})]}),ts&&o.jsx("div",{className:"sc-assets-backdrop",onClick:()=>z(!1),"aria-hidden":!0}),o.jsx(pie,{open:K,onOpenChange:O}),F&&o.jsx(Hie,{brand:u,shots:p,shotsTotal:(Ua==null?void 0:Ua.all)??0,attached:B,full:ae,onToken:ie=>{var $e;return($e=Ze.current)==null?void 0:$e.insertToken(ie)},offToken:ie=>{var $e;return($e=Ze.current)==null?void 0:$e.removeToken(ie)},onTemplate:ie=>{var $e;return($e=Ze.current)==null?void 0:$e.applyScene(ie)},offTemplate:()=>{var ie;return(ie=Ze.current)==null?void 0:ie.removeTemplate()},onClose:()=>z(!1)}),o.jsxs(qM,{full:!ts,children:[o.jsx(iw,{}),J.size>0&&o.jsx(Uie,{count:J.size,sets:m,activeSet:e,onAdd:ie=>void Vn(ie),onRemove:e?()=>void Zr(e):void 0,onNew:()=>{yn.current=[...J],xo(!0)},onClear:()=>ne(new Set),onKeep:()=>void Et(),onArchiveBatch:ie=>Hn(ie),allKept:On.length>0&&On.every(ie=>ie.kept),archivedLens:St==="archived",pickedIds:[...J],onRestoreBatch:ie=>Ot(ie),onDeleteBatch:ie=>void Zt(ie).then(()=>ne(new Set)),loaded:Gt.length,onSelectAll:()=>ne(new Set(Gt.map(ie=>ie.id)))}),o.jsx(aw,{ref:Ze,projectId:Ct||null,brand:u,engines:t,parentId:h,initialBrief:le,suppressDraftRestore:sn!==null,startScene:E.get("scene")??void 0,startSetup:E.get("setup")??void 0,startPresenter:E.get("presenter")??void 0,startProduct:E.get("product")??void 0,onSeedsSpent:Le,openAttachTab:E.get("attach")==="scenes"?"Scenes":E.get("attach")==="products"?"Products":void 0,target:me,onClearTarget:U,onRestoreBranchId:nt,guided:!0,setSlug:(e==null?void 0:e.slug)??null,onSending:Ut,onAttached:Y,onCeiling:X,sourceImage:_e??void 0,onQueued:(ie,$e,Je,Vt)=>{ke(null),M(xn=>{const Sn=new URLSearchParams(xn);return Sn.delete("scene"),Sn.delete("attach"),Sn.delete("presenter"),Sn.delete("product"),Sn},{replace:!0});const Yt=()=>Ut(null),Bn=()=>{$e!=="edit"||!ie||M(xn=>{const Sn=new URLSearchParams(xn);return Sn.set("branch",ie),Sn},{replace:!0})},Nn=()=>{st(Vt??[]),Bn(),Yt()};e&&ie?Me.addToSet(e.id,Je!=null&&Je.length?Je:[ie]).then(xn=>tn(e.id,xn.nodeIds)).catch(xn=>Qe(nn(xn,"Could not add to the set"))).finally(Nn):Nn()}})]}),o.jsx(dc,{context:di})]})}function ele(e){var t;return Uu((t=e.brief)==null?void 0:t.format)}function tle(e){var n,r,a;const t=(a=(r=(n=e.brief)==null?void 0:n.rendered)==null?void 0:r.sizes)==null?void 0:a[0];return t&&t[0]>0&&t[1]>0?t:null}const nle=e=>({"--sc-pic-ar":e[0]/e[1],"--sc-pic-w":`${e[0]}px`});function rle({node:e,onRetry:t,onCancel:n,engineName:r,menu:a}){const[i,c]=s.useState(null),[,u]=s.useState(0);if(s.useEffect(()=>{if(e.status!=="running")return;const m=setInterval(()=>u(v=>v+1),1e3);return()=>clearInterval(m)},[e.status]),e.kind==="root")return o.jsx(f0,{className:"sc-frame",p:"8",children:o.jsxs(js,{direction:"column",align:"center",gap:"2",py:"6",children:[o.jsx(ec,{className:"sc-display",size:"7",align:"center",children:"Blank canvas, full brand."}),o.jsx(ec,{color:"gray",size:"2",align:"center",children:"Pick a Template below (engineered briefs, your product attached) or describe a visual."})]})});if(e.status==="running")return o.jsxs("div",{className:"sc-stage-wait",style:{"--sc-wait-ar":ele(e)},children:[o.jsx("span",{className:"sc-shimmer"}),o.jsxs("div",{className:"sc-stage-wait-say",children:[o.jsx("span",{className:"sc-stage-wait-t",role:"status","aria-label":`${xv(Fi(e))}, ${sc(Fi(e))} seconds`,children:ac(Fi(e))}),n&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","data-urgent":sc(Fi(e))>=60||void 0,onClick:n,children:"Cancel"})]})]});if(e.status==="cancelled"||e.status==="error"){const v=e.status==="cancelled"?MA():Ef(e.error,r);return o.jsx(qj,{failure:v,density:"stage",onRetry:t})}const f=e.status==="done"?e.images[0]:void 0,h=f?tle(e)??(i==null?void 0:i.size)??null:null,p=f?o.jsx(f0,{className:h?"sc-frame sc-stage-pic":"sc-frame sc-stage-free",style:h?nle(h):void 0,children:o.jsx(sle,{hash:f,alt:e.promptHead,onPainted:(m,v,w)=>c({hash:m,size:[v,w]})})}):o.jsx(js,{justify:"center",children:o.jsx(f0,{className:"sc-frame",style:{display:"inline-block",maxWidth:"100%"}})});return a?o.jsxs(pf,{children:[o.jsx(mf,{children:p}),a]}):p}function sle({hash:e,alt:t,onPainted:n}){const[r,a]=s.useState(null),i=s.useRef(null),c=r===e,u=h=>{!(h!=null&&h.complete)||!h.naturalWidth||h.src!==new URL(Mr(e),location.href).href||i.current!==e&&(i.current=e,a(e),n==null||n(e,h.naturalWidth,h.naturalHeight))},f=i.current&&i.current!==e?Mr(i.current):dn(e,"tile");return o.jsxs(f0,{position:"relative",style:{lineHeight:0},children:[!c&&o.jsx("img",{className:"sc-stage-under",src:f,alt:"","aria-hidden":!0,decoding:"async"}),o.jsx("img",{ref:u,src:Mr(e),alt:t,className:"sc-stage-img","data-ready":c||void 0,onLoad:h=>u(h.currentTarget)})]})}const ale=e=>((e==null?void 0:e.tokens)??[]).filter(t=>t&&typeof t.t=="string");function sP(e,t){return ale(e.brief).map(r=>{var a;switch(r.t){case"text":return typeof r.v=="string"?r.v:"";case"product":return t.product(String(r.id))??"a product";case"character":return t.person(String(r.id))??"a presenter";case"template":return t.scene(String(r.id))??"a scene";case"color":return String(r.name??r.hex??"");case"ref":return"the attached reference";case"mark":return((a=t.mark)==null?void 0:a.call(t,String(r.imageHash)))??"the brand mark";default:return""}}).join(" ").replace(/\s+/g," ").replace(/\s+([.,!?;:])/g,"$1").trim()||e.prompt||e.promptHead||""}const ole=e=>e===0?"Original":`Refinement ${e}`,ile=e=>e===0?"the original":`Refinement ${e}`,lle=(e,t)=>e.createdAt.localeCompare(t.createdAt)||e.id.localeCompare(t.id);function cle(e,t,n){const r=new Set(e.map(m=>m.id)),a=n.filter(m=>!r.has(m.id)&&m.parentId!==null&&r.has(m.parentId)),i=a.length?[...e,...a].sort(lle):e,u=(i.some(m=>m.id===t.id)?i:[...i,t]).map(m=>m.id===t.id?t:m).filter(m=>m.id===t.id||m.images[0]);let f=0;const h=u.map(m=>{const v=m.kind==="edit"?++f:0;return{node:m,index:v,label:ole(v),from:null,state:m.images[0]?"ready":m.status==="running"?"pending":"failed"}}),p=new Map(h.map((m,v)=>[m.node.id,v]));return h.map((m,v)=>{if(v===0||!m.node.parentId||m.node.parentId===h[v-1].node.id)return m;const w=p.get(m.node.parentId);return w===void 0?m:{...m,from:ile(h[w].index)}})}function aP(e,t){var a;const n=e.find(i=>i.node.id===t);if(!n)return"";const r=((a=e[e.length-1])==null?void 0:a.index)??0;return n.index===0?"Original":`Refinement ${n.index} of ${r}`}const oh=28;function ule({trail:e,activeId:t,names:n,onSelect:r}){var w;const a=s.useRef(null),i=s.useMemo(()=>e.map(y=>sP(y.node,n)),[e,n]),c=id(),u=(y,b,k)=>c.open({key:y.node.id,src:dn(y.node.images[0],"tile"),label:y.label,said:i[b],from:y.from,el:k,id:y.node.id});s.useEffect(()=>{var y,b;(b=(y=a.current)==null?void 0:y.querySelector('[aria-pressed="true"]'))==null||b.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},[t]);const[f,h]=s.useState(null);s.useEffect(()=>{const y=a.current;if(!y)return;const b=()=>{const C=y.scrollWidth-y.clientWidth;if(C<=1)return h(null);const j=y.scrollLeft;h(j<=1?"end":j>=C-1?"start":"both")},k=()=>{const C=y.querySelector('[aria-pressed="true"]');if(!C)return;const j=C.getBoundingClientRect(),N=y.getBoundingClientRect();j.left<N.left+oh?y.scrollLeft-=N.left+oh-j.left:j.right>N.right-oh&&(y.scrollLeft+=j.right-(N.right-oh))};b(),y.addEventListener("scroll",b,{passive:!0});const S=new ResizeObserver(()=>{k(),b()});return S.observe(y),()=>{y.removeEventListener("scroll",b),S.disconnect()}},[e.length]),s.useEffect(()=>{const y=a.current;if(!y)return;const b=k=>{y.scrollWidth<=y.clientWidth||Math.abs(k.deltaY)<=Math.abs(k.deltaX)||(k.preventDefault(),y.scrollLeft+=k.deltaY)};return y.addEventListener("wheel",b,{passive:!1}),()=>y.removeEventListener("wheel",b)},[]);const p=y=>{var C,j;const b=[...((C=a.current)==null?void 0:C.querySelectorAll(".sc-trail-tile:not([aria-disabled])"))??[]],k=b.indexOf(document.activeElement);let S=-1;if(y.key==="ArrowRight")S=Math.min(b.length-1,k+1);else if(y.key==="ArrowLeft")S=Math.max(0,k-1);else if(y.key==="Home")S=0;else if(y.key==="End")S=b.length-1;else return;y.preventDefault(),y.stopPropagation(),(j=b[S])==null||j.focus()},m=e.some(y=>y.node.id===t)?t:(w=e[0])==null?void 0:w.node.id,v=aP(e,t);return o.jsxs("div",{className:"sc-trail",children:[v&&o.jsx("span",{className:"sc-trail-say",children:v}),o.jsx("nav",{ref:a,className:"sc-thumbs","aria-label":"History of this shot","data-more":f??void 0,onKeyDown:p,children:e.map((y,b)=>{const k=y.node,S=k.id===t,C=y.state==="pending";return o.jsx("button",{type:"button",className:"sc-thumb-btn sc-trail-tile","data-original":y.index===0&&e.length>1?"":void 0,"aria-label":i[b]?`${y.label}: ${i[b]}`:y.label,"aria-pressed":S,"aria-disabled":C||void 0,tabIndex:k.id===m?0:-1,onClick:()=>{C||(c.closeNow(),r(k.id))},onPointerEnter:j=>j.pointerType==="mouse"&&y.state==="ready"&&u(y,b,j.currentTarget),onPointerLeave:j=>j.pointerType==="mouse"&&c.close(),onFocus:j=>em(j.currentTarget)&&y.state==="ready"&&u(y,b,j.currentTarget),children:y.state==="ready"?o.jsx("img",{src:dn(k.images[0],"micro"),alt:"",className:"sc-thumb",loading:"lazy",decoding:"async","data-active":S,width:52,height:52}):C?o.jsx("span",{className:"sc-thumb sc-thumb-wait","data-active":S,children:o.jsx("span",{className:"sc-shimmer"})}):o.jsx("span",{className:"sc-thumb sc-thumb-failed","data-active":S,children:o.jsx(Sc,{size:14})})},k.id)})}),c.shown&&o.jsx(od,{anchor:c.shown.el,kind:"shot",src:c.shown.src,label:c.shown.label,noun:c.shown.said,note:c.shown.from?`From ${c.shown.from}`:null,onOpen:()=>{var b;const y=(b=c.shown)==null?void 0:b.id;c.closeNow(),y&&r(y)},onHoverIn:c.keep,onHoverOut:c.close,onClose:c.closeNow},c.shown.key)]})}const dle=200,nS=32;function fle({shots:e,activeId:t,onSelect:n,onEndReached:r,complete:a}){var y;const i=s.useRef(null),c=id(),u=(b,k)=>c.open({key:b.id,src:dn(b.images[0],"tile"),label:Sr(b),el:k,id:b.id}),f=s.useRef(!1);s.useLayoutEffect(()=>{var k;const b=(k=i.current)==null?void 0:k.querySelector('[aria-pressed="true"]');b&&(b.scrollIntoView({block:"center",behavior:f.current?"smooth":"auto"}),f.current=!0)},[t]);const h=s.useRef(null),p=()=>{const b=i.current,k=h.current;if(!b||!k)return;const S=b.scrollHeight-b.clientHeight,C=b.scrollTop;k.style.setProperty("--sc-shotrail-start",S>1?Math.min(1,C/nS).toFixed(3):"0"),k.style.setProperty("--sc-shotrail-end",S>1?Math.min(1,(S-C)/nS).toFixed(3):"0")};s.useLayoutEffect(()=>{const b=i.current;if(!b)return;p();const k=new ResizeObserver(p);return k.observe(b),()=>k.disconnect()},[e.length]);const m=()=>{p();const b=i.current;!b||a||b.scrollTop+b.clientHeight>=b.scrollHeight-dle&&r()},v=b=>{var j,N;const k=[...((j=i.current)==null?void 0:j.querySelectorAll(".sc-shotrail-tile:not([aria-disabled])"))??[]],S=k.indexOf(document.activeElement);let C=-1;if(b.key==="ArrowDown")C=Math.min(k.length-1,S+1);else if(b.key==="ArrowUp")C=Math.max(0,S-1);else if(b.key==="Home")C=0;else if(b.key==="End")C=k.length-1;else return;b.preventDefault(),b.stopPropagation(),(N=k[C])==null||N.focus()},w=e.some(b=>b.id===t)?t:(y=e[0])==null?void 0:y.id;return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:h,className:"sc-shotrail-shell",children:o.jsx("nav",{ref:i,className:"sc-shotrail","aria-label":"Shots in this view",onScroll:m,onKeyDown:v,children:e.map(b=>{const k=b.id===t,S=b.status==="running",C=b.status==="done"&&!!b.images[0];return o.jsx("button",{type:"button",className:"sc-thumb-btn sc-shotrail-tile","aria-label":S?`${Sr(b)}, still rendering`:Sr(b),"aria-pressed":k,"aria-disabled":S||void 0,tabIndex:b.id===w?0:-1,onClick:()=>{S||(c.closeNow(),n(b.id))},onPointerEnter:j=>j.pointerType==="mouse"&&C&&u(b,j.currentTarget),onPointerLeave:j=>j.pointerType==="mouse"&&c.close(),onFocus:j=>em(j.currentTarget)&&C&&u(b,j.currentTarget),children:C?o.jsx("img",{src:dn(b.images[0],"micro"),alt:"",className:"sc-thumb",loading:"lazy",decoding:"async","data-active":k,width:52,height:52}):S?o.jsx("span",{className:"sc-thumb sc-thumb-wait","data-active":k,children:o.jsx("span",{className:"sc-shimmer"})}):o.jsx("span",{className:"sc-thumb sc-thumb-failed","data-active":k,children:o.jsx(Sc,{size:14})})},b.id)})})}),c.shown&&o.jsx(od,{anchor:c.shown.el,kind:"shot",noun:"Shot",side:"beside",src:c.shown.src,label:c.shown.label,onOpen:()=>{var k;const b=(k=c.shown)==null?void 0:k.id;c.closeNow(),b&&n(b)},onHoverIn:c.keep,onHoverOut:c.close,onClose:c.closeNow},c.shown.key)]})}const hle=60;function ple({onLeft:e,onRight:t}){const n=s.useRef(null);return{onPointerDown:r=>{r.pointerType!=="mouse"&&(n.current={id:r.pointerId,x:r.clientX,y:r.clientY})},onPointerUp:r=>{const a=n.current;if(n.current=null,!a||a.id!==r.pointerId)return;const i=r.clientX-a.x,c=r.clientY-a.y;Math.abs(i)<hle||Math.abs(i)<2*Math.abs(c)||(i<0?e():t())},onPointerCancel:()=>{n.current=null}}}function mle(e){const t=Dn(),n=id(),{shown:r,closeNow:a}=n,[i,c]=s.useState(null),u=i??r,f=()=>{c(null),a()};s.useEffect(()=>{if(!i)return;const w=y=>{const b=y.target;b!=null&&b.closest(".sc-chip-preview")||b!=null&&b.closest(e)||c(null)};return document.addEventListener("pointerdown",w,!0),()=>document.removeEventListener("pointerdown",w,!0)},[i,e]);const[h,p]=s.useState(null),m=w=>({"data-open":(u==null?void 0:u.key)===w.key||void 0,"aria-haspopup":"dialog",onPointerEnter:y=>y.pointerType==="mouse"&&!i&&n.open({...w,el:y.currentTarget}),onPointerLeave:y=>y.pointerType==="mouse"&&n.close(),onFocus:y=>em(y.currentTarget)&&!i&&n.open({...w,el:y.currentTarget}),onClick:y=>{if((i==null?void 0:i.key)===w.key){f();return}a(),c({...w,el:y.currentTarget})}}),v=o.jsxs(o.Fragment,{children:[u&&o.jsx(od,{anchor:u.el,kind:u.kind,src:sr(u.src,"tile"),label:u.label,onOpen:()=>{const w=u;f(),w.to?t(w.to):p({src:sr(w.src,"full"),kind:w.kind,label:w.label})},onHoverIn:n.keep,onHoverOut:()=>!i&&n.close(),onClose:f},u.key),h&&o.jsx(Wu,{src:h.src,kind:h.kind,label:h.label,onClose:()=>p(null)})]});return{bind:m,isOpen:w=>(u==null?void 0:u.key)===w,surface:v}}function gle({brief:e,prompt:t,brand:n,saidRef:r,expanded:a,clamped:i}){var $,R;const{scenes:c,presenters:u,demoProducts:f}=Rn(),h=mle(".sc-ingredient"),p=(e==null?void 0:e.tokens)??[],m=(($=n==null?void 0:n.json)==null?void 0:$.products)??[],v=((R=n==null?void 0:n.json)==null?void 0:R.characters)??[],w=jc(n),y=Sf(n==null?void 0:n.json),[b,k]=s.useState({});s.useEffect(()=>{for(const E of p){if((E==null?void 0:E.t)!=="template")continue;const M=w.find(H=>H.id===E.id);if(!(M!=null&&M.previewUrl)||Ru(M.previewColor))continue;const L=`t${E.id}`;ZM(M.previewUrl).then(H=>{const D=Ru(H??void 0);D&&k(K=>K[L]?K:{...K,[L]:D})})}});const S={products:m,demoProducts:f,cast:v,presenters:u,scenes:[...w,...c]},C=E=>{var L,H;const M=DM(E,S);if((M==null?void 0:M.kind)==="product"){const{product:D,demo:K}=M;return{key:`p${E.id}`,kind:"product",label:(D==null?void 0:D.name)??(K==null?void 0:K.name)??"product",thumb:D?Kp((H=(L=D==null?void 0:D.shots)==null?void 0:L[0])==null?void 0:H.file,"micro"):(K==null?void 0:K.previewUrl)??null,to:n&&(D||K)?la(n,E.id):void 0}}if((M==null?void 0:M.kind)==="presenter"){const{character:D,presenter:K}=M,O=(K==null?void 0:K.id)??(D==null?void 0:D.presenterId)??((D==null?void 0:D.origin)==="custom"?D.id:void 0),_=D?Cv(D):K?ti(K):{src:null};return{key:`h${E.id}`,kind:"presenter",label:D!=null&&D.supersededBy?`${D.name}, edited since`:(D==null?void 0:D.name)??(K==null?void 0:K.name)??"someone",thumb:_.src,crop:_.crop,to:n&&O?ha(n,O):void 0}}if((M==null?void 0:M.kind)==="scene"){const D=M.scene;return{key:`t${E.id}`,kind:"scene",label:(D==null?void 0:D.name)??"a scene no longer in the catalog",thumb:(D==null?void 0:D.previewUrl)??null,to:n&&D?_r(n,D.id):void 0,tint:Ru(D==null?void 0:D.previewColor),custom:M.custom}}if((E==null?void 0:E.t)==="color")return{key:`c${E.hex}`,kind:"color",label:E.name??E.hex,swatch:E.hex};if((E==null?void 0:E.t)==="ref")return{key:`r${E.imageHash}`,kind:"ref",label:E.label??"reference image",thumb:dn(E.imageHash,"micro"),previewHash:E.imageHash};if((E==null?void 0:E.t)==="mark"){const D=y.find(K=>K.hash===E.imageHash);return{key:`m${E.imageHash}`,kind:"mark",label:D?Jp(n==null?void 0:n.json,D):"brand mark",thumb:dn(E.imageHash,"micro"),previewHash:E.imageHash}}return null},j=E=>{const M=o.jsxs(o.Fragment,{children:[E.thumb?o.jsx("img",{src:E.thumb,alt:"","data-crop":E.crop}):E.swatch?o.jsx("i",{style:{background:E.swatch}}):null,E.label]}),L=E.tint??(E.custom?b[E.key]:void 0),H=L?{"--tint":L}:void 0,D=(E.previewHash?dn(E.previewHash,"tile"):sr(E.thumb,"tile"))??(E.to?"":null);if(D!==null&&kh(E.kind)){const K=E.kind,O=h.isOpen(E.key),_={key:E.key,src:D,kind:K,label:E.label,to:E.to};return o.jsx("button",{type:"button",className:"sc-ingredient","data-kind":E.kind,"data-tinted":L?"":void 0,style:H,title:O?void 0:`${E.label}. Preview.`,"aria-label":`${E.label}. Preview.`,...h.bind(_),children:M},E.key)}return o.jsx("span",{className:"sc-ingredient","data-kind":E.kind,"data-tinted":L?"":void 0,style:H,title:`${E.kind}: ${E.label}`,children:M},E.key)},N=[];for(const E of p){if(E.t==="text"){const L=E.v.trim();L&&N.push(L);continue}const M=C(E);M&&N.push(j(M))}if(!N.length&&!t)return null;const P=N.flatMap((E,M)=>M?[" ",E]:[E]);return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:r,className:"sc-brief-said","data-expanded":a||void 0,"data-clamped":i||void 0,dir:"auto",children:P.length?P:t||""}),h.surface]})}const vle=256,Zl=new Map;function rS(e,t){for(Zl.delete(e),Zl.set(e,t);Zl.size>vle;)Zl.delete(Zl.keys().next().value)}function wle(e,t){const n=new Map(e.map(a=>[a.id,a])),r=[];for(let a=t.parentId?n.get(t.parentId):void 0;a;a=a.parentId?n.get(a.parentId):void 0)r.unshift(a);return{ancestors:r,siblings:e.filter(a=>a.parentId===t.parentId),children:e.filter(a=>a.parentId===t.id),history:e}}function yle(e,t){rS(e,t);for(const n of t.history??[])n.id!==e&&rS(n.id,wle(t.history??[],n))}function ble(e){var i;const[t,n]=s.useState(()=>{const c=Zl.get(e.id);return c?{id:e.id,lineage:c}:null});s.useEffect(()=>{let c=!0;return Me.lineage(e.id).then(u=>{c&&(yle(e.id,u),n({id:e.id,lineage:u}))}).catch(()=>{}),()=>{c=!1}},[e.id,e.childCount,e.status,e.parentId]);const r=(t==null?void 0:t.id)===e.id?t.lineage:Zl.get(e.id)??null;if(!r)return{ancestors:[],children:[],siblings:[e],sibIndex:0,parentShot:null,history:null,rootId:e.id,loaded:!1};const a=r.siblings.some(c=>c.id===e.id)?r.siblings:[e,...r.siblings];return{ancestors:r.ancestors,children:r.children,siblings:a,sibIndex:a.findIndex(c=>c.id===e.id),parentShot:r.ancestors[r.ancestors.length-1]??null,history:r.history??null,rootId:((i=r.ancestors[0])==null?void 0:i.id)??e.id,loaded:!0}}const xle=32,Oi=new Map;function kle(e){for(Oi.delete(e.id),Oi.set(e.id,e);Oi.size>xle;)Oi.delete(Oi.keys().next().value)}function Sle(e){const[t,n]=s.useState(()=>Oi.get(e.id)??null);return s.useEffect(()=>{const r=Oi.get(e.id);if(r){n(r);return}let a=!0;return Me.node(e.id).then(i=>{a&&(kle(i),n(i))}).catch(()=>{}),()=>{a=!1}},[e.id]),(t==null?void 0:t.id)===e.id?t:Oi.get(e.id)??null}const Ele="(max-width: 1023px)",oP=380,iP=480,sS=380,iu=e=>Math.min(iP,Math.max(oP,Math.round(e)));function Cle({node:e,rootId:t,items:n,loadMore:r,complete:a,brand:i,engines:c,projectId:u,onClose:f,onSelect:h,onRetry:p,onCancel:m,onKeep:v,onLanded:w,onRemix:y,onArchive:b,onUnarchive:k,onDelete:S,onRefined:C,tokenNames:j}){const{ancestors:N,children:P,history:$}=ble(e),R=Sle(e),E=s.useMemo(()=>c.find(Fe=>Fe.id===e.engineId),[c,e.engineId]),{push:M}=ir(),[L,H]=fa(Dr.ovlPanelW,sS),D=s.useRef(0),K=s.useRef(0),O=s.useRef(null),_=s.useMemo(()=>{var Fe;return(((Fe=e.brief)==null?void 0:Fe.tokens)??[]).some(mt=>(mt==null?void 0:mt.t)&&mt.t!=="text"&&mt.t!=="format")},[e.brief]),re=s.useMemo(()=>{const Fe=Sf(i.json);return{...j,mark:mt=>{const it=Fe.find(St=>St.hash===mt);return it?Jp(i.json,it):null}}},[j,i]),z=s.useMemo(()=>sP(R??e,re),[R,e,re]),[F,Q]=s.useState(!1),[V,I]=s.useState(!1),[B,Y]=s.useState(!1),[ae,X]=s.useState(!1),[le,ke]=s.useState(!1),[te,be]=s.useState(!1);s.useEffect(()=>{Y(!1),be(!1),X(!1)},[e.id]),s.useEffect(()=>{if(!B)return;const Fe=setTimeout(()=>Y(!1),1400);return()=>clearTimeout(Fe)},[B]),s.useEffect(()=>{if(!te)return;const Fe=setTimeout(()=>be(!1),1400);return()=>clearTimeout(Fe)},[te]);const[G,J]=s.useState(null);ow(G,"--sc-ovl-dock-h");const ne=s.useRef(null),[W,he]=s.useState(!1),[Xe,tt]=s.useState(!1);s.useEffect(()=>he(!1),[e.id]),s.useLayoutEffect(()=>{const Fe=ne.current;if(!Fe||W)return;const mt=()=>tt(Fe.scrollHeight>Fe.clientHeight+1);mt();const it=new ResizeObserver(mt);return it.observe(Fe),()=>it.disconnect()},[z,W]);const ze=s.useMemo(()=>cle($??[...N,e,...P.slice(0,6)],e,n),[$,N,e,P,n]),nt=s.useMemo(()=>ze.find(Fe=>Fe.node.id===e.id)??null,[ze,e.id]),ce=wr(Ele),ve=ze.length>1&&ce?aP(ze,e.id):e.kind!=="edit"?"Shot":$&&nt?nt.label:"Refinement",Pe=s.useMemo(()=>c6(n,e.id),[n,e.id]);s.useEffect(()=>{Pe.at>=0&&!a&&n.length-Pe.at<=6&&r()},[Pe.at,n.length,a,r]);const ue=Fe=>{const mt=Fe>0?Pe.next:Pe.prev;mt&&h(mt.id)},Ee=id(),Ke=(Fe,mt)=>Fe!=null&&Fe.images[0]?{onPointerEnter:it=>{it.pointerType==="mouse"&&Ee.open({key:Fe.id,src:dn(Fe.images[0],"tile"),label:Sr(Fe),noun:mt,el:it.currentTarget,id:Fe.id})},onPointerLeave:it=>{it.pointerType==="mouse"&&Ee.close()}}:{},ye=ple({onLeft:()=>ue(1),onRight:()=>ue(-1)});s.useEffect(()=>{const Fe=Ee.shown;if(!Fe)return;const mt=Fe.noun==="Next shot"?Pe.next:Pe.prev;mt!=null&&mt.images[0]?Ee.open({key:mt.id,src:dn(mt.images[0],"tile"),label:Sr(mt),noun:Fe.noun,el:Fe.el,id:mt.id}):Ee.closeNow()},[e.id]),s.useEffect(()=>{var St,xt;const Fe=ze.findIndex(Nt=>Nt.node.id===e.id),it=[(St=ze[Fe-1])==null?void 0:St.node,(xt=ze[Fe+1])==null?void 0:xt.node,Pe.prev,Pe.next].filter(Nt=>!!(Nt!=null&&Nt.images[0])).map(Nt=>{var et;const Kt=new Image;return Kt.decoding="async",Kt.src=dn(Nt.images[0],"tile"),(et=Kt.decode)==null||et.call(Kt).catch(()=>{}),Kt});return()=>{for(const Nt of it)Nt.src=""}},[ze,e.id,Pe.prev,Pe.next]);const Se=e.images[0],Ie=e.promptHead.slice(0,40).replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"")||"shot",Be=async(Fe=!1)=>{if(!V){I(!0);try{const mt=fetch(Mr(Se)).then(it=>{if(!it.ok)throw new Error(`HTTP ${it.status}`);return it.blob()});await navigator.clipboard.write([new ClipboardItem({"image/png":mt})]),Fe?M({kind:"success",title:"Copied to clipboard"}):Y(!0)}catch(mt){M(nn(mt,"Copy failed"))}finally{I(!1)}}},Re=async()=>{if(!ae){X(!0);try{await(e.archived?k(e):b(e))}finally{X(!1)}}},Ze=async()=>{if(!le){ke(!0);try{const Fe=e.brief?Iv(e.brief):null;if(!Fe||Fe.every(mt=>mt.t==="text"&&!mt.v.trim()))await navigator.clipboard.writeText(z);else{const mt=xt=>{var Nt;switch(xt.t){case"text":return xt.v;case"product":return re.product(xt.id)??"a product";case"character":return re.person(xt.id)??"a presenter";case"template":return re.scene(xt.id)??"a scene";case"color":return xt.name??xt.hex;case"ref":return"reference image";case"mark":return((Nt=re.mark)==null?void 0:Nt.call(re,xt.imageHash))??"brand mark"}},{text:it,html:St}=rQ(Fe,mt);await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([it],{type:"text/plain"}),"text/html":new Blob([St],{type:"text/html"})})])}be(!0)}catch(Fe){M(nn(Fe,"Copy failed"))}finally{ke(!1)}}};s.useEffect(()=>{const Fe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Fe}},[]);const Qe=[{key:"download",label:"Download",icon:o.jsx(HC,{size:14}),onClick:()=>{const Fe=document.createElement("a");Fe.href=Mr(Se),Fe.download=`${Ie}.png`,Fe.click()}},{key:"keep",label:e.kept?"Remove from keepers":"Keep",icon:o.jsx(Da,{size:14,weight:e.kept?"fill":"regular"}),onClick:()=>v(e),tint:e.kept?"var(--sc-star)":void 0,on:e.kept},{key:"copy",label:"Copy image",icon:B?o.jsx(Kn,{size:14,weight:"bold"}):o.jsx(tx,{size:14}),onClick:()=>void Be(),onMenu:()=>void Be(!0),busy:V,said:B?"Copied":void 0}],lt=[{key:"archive",label:e.archived?"Restore":"Archive",icon:e.archived?o.jsx(R0,{size:14}):o.jsx(_p,{size:14}),onClick:()=>void Re(),busy:ae},...e.archived?[{key:"delete",label:"Delete permanently",icon:o.jsx(Up,{size:14}),onClick:()=>Q(!0),tint:"var(--sc-red)",dialog:!0}]:[]],Lt=e.status==="done"&&e.images.length>0,Ut=!Lt&&e.kind!=="edit"&&!!e.brief,Ct=Lt?[...Qe,...lt]:lt,cn=Lt?o.jsx(gf,{children:Ct.map(Fe=>o.jsxs(vf,{onSelect:Fe.onMenu??Fe.onClick,disabled:Fe.busy,color:Fe.tint?"red":void 0,children:[Fe.icon,Fe.label]},Fe.key))}):void 0;return Rr.createPortal(o.jsx(Yu,{trapped:!0,loop:!0,asChild:!0,onMountAutoFocus:Fe=>{var mt;Fe.preventDefault(),(mt=O.current)==null||mt.focus({preventScroll:!0})},children:o.jsxs("div",{ref:O,tabIndex:-1,className:"sc-ovl","data-fb":"shot-overlay","data-fb-node":e.id,role:"dialog","aria-modal":"true","aria-label":Sr(e),"data-rail":n.length>1?"":void 0,style:{"--sc-ovl-panel-w":`${iu(L)}px`},children:[n.length>1&&o.jsx(fle,{shots:n,activeId:e.id,onSelect:h,onEndReached:r,complete:a}),o.jsxs("header",{className:"sc-ovl-bar",children:[o.jsxs("div",{className:"sc-ovl-bar-l",children:[o.jsx(or,{label:"Close (esc)",children:o.jsx("button",{type:"button",className:"sc-icon-btn",onClick:f,"aria-label":"Close",children:o.jsx(jn,{size:13})})}),Pe.at>=0&&n.length>1&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"sc-icon-btn",disabled:!Pe.prev,onClick:()=>Pe.prev&&h(Pe.prev.id),"aria-label":"Previous shot",...Ke(Pe.prev,"Previous shot"),children:o.jsx(ga,{size:13})}),o.jsx("button",{type:"button",className:"sc-icon-btn",disabled:!Pe.next,onClick:()=>Pe.next&&h(Pe.next.id),"aria-label":"Next shot",...Ke(Pe.next,"Next shot"),children:o.jsx(il,{size:13})})]})]}),Ct.length>0&&o.jsxs("div",{className:"sc-ovl-bar-r",children:[o.jsx("div",{className:"sc-ovl-acts",children:Ct.map(Fe=>o.jsx(or,{label:Fe.said??Fe.label,open:!!Fe.said,children:o.jsx("button",{type:"button",className:"sc-icon-btn",onClick:Fe.onClick,"aria-label":Fe.label,"aria-pressed":Fe.on===void 0?void 0:Fe.on,"data-on":Fe.on||void 0,"aria-haspopup":Fe.dialog?"dialog":void 0,"aria-busy":Fe.busy||void 0,"data-busy":Fe.busy||void 0,style:Fe.tint?{color:Fe.tint}:void 0,children:Fe.icon})},Fe.key))}),o.jsxs(Ss,{children:[o.jsx(or,{label:"More actions",children:o.jsx(Es,{children:o.jsx("button",{type:"button",className:"sc-icon-btn sc-ovl-overflow","aria-label":"More actions",children:o.jsx(LC,{size:18,weight:"bold"})})})}),o.jsx(Cs,{align:"end",sideOffset:6,children:Ct.map(Fe=>o.jsxs(tr,{onSelect:Fe.onMenu??Fe.onClick,disabled:Fe.busy,color:Fe.tint?"red":void 0,children:[Fe.icon,Fe.label]},Fe.key))})]})]})]}),o.jsx(of,{open:F,onOpenChange:Q,children:o.jsxs(lf,{maxWidth:"420px",children:[o.jsx(cf,{children:"Delete this shot permanently?"}),o.jsx(uf,{size:"2",children:"This cannot be undone."}),o.jsxs(js,{gap:"3",mt:"4",justify:"end",children:[o.jsx(ff,{children:o.jsx(ia,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(df,{children:o.jsx(ia,{color:"red",onClick:()=>S(e),children:"Delete permanently"})})]})]})}),Ee.shown&&o.jsx(od,{anchor:Ee.shown.el,kind:"shot",noun:Ee.shown.noun,src:Ee.shown.src,label:Ee.shown.label,onOpen:()=>{var mt;const Fe=(mt=Ee.shown)==null?void 0:mt.id;Ee.closeNow(),Fe&&h(Fe)},onHoverIn:Ee.keep,onHoverOut:Ee.close,onClose:Ee.closeNow},Ee.shown.key),o.jsxs("div",{className:"sc-ovl-stage","data-takes":ze.length>1?"":void 0,...ye,children:[o.jsx(rle,{node:e,onRetry:()=>p(e),onCancel:()=>m(e),engineName:E==null?void 0:E.displayName,menu:cn}),ze.length>1?o.jsx(ule,{trail:ze,activeId:e.id,names:re,onSelect:h}):o.jsx("div",{className:"sc-trail sc-trail-empty","aria-hidden":!0})]}),o.jsx("div",{className:"sc-ovl-resize",role:"separator","aria-orientation":"vertical","aria-label":"Resize the details panel","aria-valuemin":oP,"aria-valuemax":iP,"aria-valuenow":iu(L),tabIndex:0,onPointerDown:Fe=>{Fe.button===0&&(Fe.preventDefault(),Fe.stopPropagation(),Fe.currentTarget.setPointerCapture(Fe.pointerId))},onPointerMove:Fe=>{if(!Fe.currentTarget.hasPointerCapture(Fe.pointerId))return;const mt=Fe.currentTarget.closest(".sc-ovl");D.current=Fe.clientX,!K.current&&(K.current=requestAnimationFrame(()=>{K.current=0,mt==null||mt.style.setProperty("--sc-ovl-panel-w",`${iu(window.innerWidth-D.current)}px`)}))},onPointerUp:Fe=>{Fe.currentTarget.hasPointerCapture(Fe.pointerId)&&(Fe.currentTarget.releasePointerCapture(Fe.pointerId),H(iu(window.innerWidth-Fe.clientX)))},onDoubleClick:Fe=>{Fe.stopPropagation(),H(sS)},onKeyDown:Fe=>{Fe.key==="ArrowLeft"?H(mt=>iu(mt+16)):Fe.key==="ArrowRight"&&H(mt=>iu(mt-16))}}),o.jsxs("aside",{className:"sc-ovl-meta",children:[o.jsxs("div",{className:"sc-ovl-scroll",children:[o.jsxs("div",{className:"sc-ovl-head",children:[o.jsx("b",{children:ve}),e.archived&&o.jsx("small",{className:"sc-ovl-flag",children:"archived"}),Lt&&e.costUsd>0&&o.jsxs("small",{className:"sc-ovl-spend",title:"Of your API budget",children:["$",e.costUsd.toFixed(2)]})]}),e.kind!=="root"&&(z||_)&&o.jsxs("div",{className:"sc-ovl-sec sc-ovl-brief",children:[o.jsxs("div",{className:"sc-ovl-brief-head",children:[o.jsx("span",{className:"sc-eyebrow",children:"Prompt"}),o.jsx(or,{label:te?"Copied":"Copy the prompt",open:te||void 0,children:o.jsx("button",{type:"button",className:"sc-icon-btn sc-ovl-copy","aria-label":"Copy the prompt","aria-busy":le||void 0,"data-busy":le?"":void 0,onClick:()=>void Ze(),children:te?o.jsx(Kn,{size:14,weight:"bold"}):o.jsx(tx,{size:14})})})]}),o.jsx("div",{className:"sc-brief-record",children:o.jsx(gle,{brief:e.brief,prompt:(R==null?void 0:R.prompt)??e.promptHead,brand:i,saidRef:ne,expanded:W,clamped:Xe&&!W})}),(Xe||W)&&o.jsx("button",{type:"button",className:"sc-s sc-ovl-more","aria-expanded":W,onClick:()=>he(Fe=>!Fe),children:W?o.jsxs(o.Fragment,{children:[o.jsx(VU,{size:12})," Show less"]}):o.jsxs(o.Fragment,{children:[o.jsx(Xi,{size:12})," Show more"]})})]}),(Lt||Ut)&&o.jsxs("div",{className:"sc-sugg",children:[Ut&&o.jsxs("button",{type:"button",className:"sc-s",onClick:()=>y(e),title:"Put this prompt back in the composer, to change and run again",children:[o.jsx(ed,{size:12})," Edit the prompt"]}),Lt&&o.jsxs("button",{type:"button",className:"sc-s",onClick:()=>p(e),title:"Run the same setup again for a different take",children:[o.jsx(R0,{size:12})," Try again"]}),Lt&&o.jsxs("button",{type:"button",className:"sc-s",onClick:()=>y(e),title:"Start a new shot from this setup: same prompt, chips, shape and count, ready to change",children:[o.jsx($h,{size:12})," Reuse setup"]})]})]}),(Lt||e.status==="running")&&o.jsx("div",{className:"sc-ovl-edit sc-dock",ref:J,children:o.jsx(aw,{variant:"overlay",projectId:u,brand:i,engines:c,parentId:t,target:e,sourceImage:Se,persistDraft:!1,onQueued:(Fe,mt,it,St)=>{w(St??[]),Fe&&h(Fe),Fe&&(C==null||C(Fe,mt))}})})]})]})}),document.body)}function aS(){const{shotId:e}=Bs(),t=r$(),{push:n}=ir(),r=e?t.byId.get(e)??null:null,[a,i]=s.useState(null);s.useEffect(()=>{if(!e||r)return;let f=!0;return Me.node(e).then(h=>f&&i({id:e,node:h.kind==="root"?null:h})).catch(()=>f&&i({id:e,node:null})),()=>{f=!1}},[e,r]),s.useEffect(()=>{if(!(!e||r))return t.subscribeActivity(f=>{const h=f.find(p=>p.id===e);h&&i({id:e,node:h})})},[e,r,t.subscribeActivity]);const c=r??(a!==null&&a.id===e?a.node:null),u=!r&&a!==null&&a.id===e&&a.node===null;return s.useEffect(()=>{u&&(n({kind:"info",title:"That shot is no longer available",detail:"Back to the feed."}),t.close())},[u,t.close,n]),c?o.jsx(Cle,{node:c,rootId:t.rootId,items:t.items,loadMore:t.loadMore,complete:t.complete,brand:t.brand,engines:t.engines,projectId:t.projectId,onClose:t.close,onSelect:t.select,onRetry:t.retry,onCancel:t.cancel,onKeep:t.keep,onLanded:t.landed,onRefined:t.refined,tokenNames:t.tokenNames,onRemix:t.remix,onArchive:()=>t.archive(c),onUnarchive:()=>t.unarchive(c),onDelete:()=>t.delete(c)}):u?null:o.jsx("div",{className:"sc-ovl-wait",role:"status","aria-label":"Loading",children:o.jsx(xr,{size:"3"})})}function jle(){const e=BS();return o.jsx(js,{align:"center",justify:"center",height:"100vh",p:"5",children:o.jsx(mv,{failure:{kind:"unknown",title:"This page could not be shown.",fix:"Reloading usually brings it back.",raw:String((e==null?void 0:e.message)??e??""),retryable:!0},action:o.jsx(ia,{size:"1",variant:"soft",color:"gray",onClick:()=>window.location.reload(),children:"Reload"})})})}function Ale(){const{setSlug:e=""}=Bs(),{pathname:t,search:n}=Zn(),{brand:r,sets:a,loaded:i,refresh:c}=on(),u=Dn(),f=un({path:ut.set,end:!1}),h=a.find(v=>v.slug===e)??a.find(v=>v.id===e)??null;Ec(h==null?void 0:h.name);const[p,m]=s.useState(null);if(s.useEffect(()=>{if(!i||h)return;if(p===e){u(mr(r),{replace:!0});return}let v=!0;return c().finally(()=>v&&m(e)),()=>{v=!1}},[i,h,e,p,r,u,c]),s.useEffect(()=>{h&&m(null)},[h]),!i||!h)return null;if(h.slug!==e){const v=f?t.slice(f.pathnameBase.length):"";return o.jsx(fo,{to:n0(r,h)+v+n,replace:!0})}return o.jsx(rP,{set:h},h.id)}function Nle(){const{pathname:e,search:t}=Zn();return o.jsx(fo,{to:FW(e,t),replace:!0})}function Mle(){const{brandSlug:e}=Bs();return o.jsx(fo,{to:`/${e}?settings=brand`,replace:!0})}function Rle(){const{sceneId:e}=Bs();return o.jsxs(o.Fragment,{children:[o.jsx(dse,{},e),o.jsx(dc,{})]})}function Ple(){const{presenterId:e}=Bs();return o.jsxs(o.Fragment,{children:[o.jsx(xse,{},e),o.jsx(dc,{})]})}function Lle(){const{productId:e}=Bs();return o.jsx(die,{},e)}const Tle=Q$([{element:o.jsx(fte,{}),errorElement:o.jsx(jle,{}),children:[{index:!0,element:o.jsx(hX,{})},{path:ut.setup,element:o.jsx(yte,{})},{path:ut.legacy,element:o.jsx(Nle,{})},{path:ut.brand,element:o.jsx(ite,{}),children:[{index:!0,element:o.jsx(Jre,{})},{path:ut.hub,element:o.jsx(rP,{set:null}),children:[{path:ut.hubShot,element:o.jsx(aS,{})}]},{path:ut.set,element:o.jsx(Ale,{}),children:[{path:ut.setShot,element:o.jsx(aS,{})}]},{path:ut.kit,element:o.jsx(Mle,{})},{path:ut.products,element:o.jsx(Qoe,{})},{path:ut.product,element:o.jsx(Lle,{})},{path:ut.scenes,element:o.jsx(sse,{}),children:[{path:ut.sceneStudio,element:o.jsx(B5,{})}]},{path:ut.scene,element:o.jsx(Rle,{}),children:[{path:ut.sceneEdit,element:o.jsx(B5,{})}]},{path:ut.presenters,element:o.jsx(wse,{}),children:[{path:ut.presenterStudio,element:o.jsx($oe,{})}]},{path:ut.presenter,element:o.jsx(Ple,{}),children:[{path:ut.presenterEdit,element:o.jsx(Eoe,{})}]}]},{path:ut.notFound,element:o.jsx(fo,{to:ut.root,replace:!0})}]}]),S8=localStorage.getItem("sc-theme")??localStorage.getItem("bt-theme");document.documentElement.dataset.theme=S8==="light"||S8==="dark"?S8:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark";MG();FL.createRoot(document.getElementById("root")).render(o.jsx($n.StrictMode,{children:o.jsx(yB,{children:o.jsx(bW,{children:o.jsx(k$,{router:Tle})})})}));
|