pixedi 1.0.6 → 1.2.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/dist/lib/index.js CHANGED
@@ -1,10 +1,33 @@
1
- (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.btn{cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;box-sizing:border-box;background-color:#0000;border:1px solid #0000;border-radius:4px;justify-content:center;align-items:center;gap:8px;height:32px;padding-left:8px;padding-right:8px;font-family:inherit;font-size:14px;font-weight:500;transition:background-color .2s,border-color .2s,opacity .2s;display:inline-flex}.btn:disabled{pointer-events:none;opacity:.5}.btn:active{transform:translateY(1px)}.btn svg{flex-shrink:0;width:16px;height:16px}.btn-default{background-color:var(--primary);color:var(--primary-foreground)}.btn-default:hover{opacity:.9}.btn-outline{border-color:var(--border);background-color:var(--background);color:var(--foreground)}.btn-outline:hover{background-color:var(--secondary)}.btn-ghost{color:var(--foreground);padding-left:8px;padding-right:8px}.btn-ghost:hover{background-color:var(--secondary)}.btn-rect{width:32px;height:32px}.btn-crop{border:1px solid var(--border);background-color:var(--background);color:var(--foreground);cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;border-radius:4px;flex-direction:column;justify-content:center;align-items:center;gap:8px;padding:12px;font-family:inherit;font-size:12px;transition:all .2s;display:inline-flex}.btn-crop:hover:not([aria-pressed=true]){background-color:var(--secondary)}.btn-crop[aria-pressed=true]{border-color:var(--accent-blue);background-color:var(--accent-blue-light);color:var(--foreground)}.btn-crop svg{flex-shrink:0;width:20px;height:20px}.btn-crop span{white-space:nowrap}.separator{background-color:var(--border);box-sizing:border-box;border:none;flex-shrink:0;display:block}.separator[data-orientation=horizontal]{width:100%;height:1px}.separator[data-orientation=vertical]{align-self:stretch;width:1px;height:100%;margin:0}.select-wrapper{box-sizing:border-box;width:100%;position:relative}.select-trigger{width:100%;height:32px;color:var(--foreground);background-color:var(--background);border:1px solid var(--border);cursor:pointer;box-sizing:border-box;-webkit-user-select:none;user-select:none;border-radius:4px;outline:none;justify-content:space-between;align-items:center;padding-left:10px;padding-right:8px;font-family:inherit;font-size:14px;transition:border-color .2s;display:flex}.select-trigger:hover,.select-trigger:focus{border-color:var(--muted-foreground)}.select-trigger-arrow{width:16px;height:16px;color:var(--muted-foreground);transition:transform .2s}.select-wrapper[data-state=open] .select-trigger-arrow{transform:rotate(180deg)}.select-content{background-color:var(--background);border:1px solid var(--border);z-index:50;box-sizing:border-box;border-radius:4px;width:100%;max-height:282px;padding:4px;position:absolute;top:calc(100% + 4px);left:0;overflow-y:auto;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d}.select-content::-webkit-scrollbar{width:4px}.select-content::-webkit-scrollbar-track{background:0 0}.select-content::-webkit-scrollbar-thumb{background-color:var(--border);border-radius:10px}.select-wrapper[data-state=closed] .select-content{display:none}.select-group-label{color:var(--muted-foreground);-webkit-user-select:none;user-select:none;padding:8px 10px;font-size:12px;font-weight:500}.select-item{width:100%;color:var(--foreground);cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;background:0 0;border-radius:4px;justify-content:space-between;align-items:center;padding:4px 10px;display:flex}.select-item:hover{background-color:var(--secondary)}.select-item-left{font-size:14px;font-weight:400}.select-item-addon{align-items:center;gap:8px;display:flex}.select-item-addon>span{color:var(--muted-foreground);font-size:12px}.select-item-addon>svg{font-size:14px}.select-item-addon>b{flex-shrink:0;width:16px;height:16px}.select-item-right-container{align-items:center;gap:8px;display:flex}.select-item-right{color:var(--muted-foreground);font-size:14px}.select-item-check{width:16px;height:16px;color:var(--foreground);flex-shrink:0}.input{width:100%;height:32px;color:var(--foreground);background-color:var(--background);border:1px solid var(--input);box-sizing:border-box;border-radius:4px;outline:none;padding-left:8px;padding-right:8px;font-family:inherit;font-size:14px;line-height:normal;transition:border-color .2s,box-shadow .2s;display:block}.input:hover:not(:disabled):not(:focus){border-color:var(--muted-foreground)}.input:focus{box-shadow:0 0 0 1px var(--ring)}.input:disabled{cursor:not-allowed;opacity:.5;background-color:var(--secondary)}.input::placeholder{color:var(--muted-foreground);opacity:1}.input-number-clean::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.input-number-clean::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.input-number-clean[type=number]{-moz-appearance:textfield}.input-pixel-container{position:relative}.input-pixel-legend{color:var(--muted-foreground);background:var(--background);margin-left:8px;padding-left:4px;padding-right:4px;font-size:12px;position:absolute;top:-9px}.input-pixel-suffix{color:var(--muted-foreground);pointer-events:none;-webkit-user-select:none;user-select:none;font-size:14px;position:absolute;bottom:2px;right:8px}.header{box-sizing:border-box;background-color:var(--background);border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;height:48px;padding-left:8px;padding-right:8px;display:flex}.header-tools{gap:8px;display:flex}.header-history{align-items:center;gap:8px;display:flex}.header-history-text{color:var(--muted-foreground);font-size:14px}.crop-image{width:100%;height:100%;position:absolute;inset:0}.crop-box{cursor:move;position:absolute}.crop-tools{background-color:var(--background);box-sizing:border-box;border:1px solid var(--border);border-radius:4px;align-items:center;height:36px;padding-left:12px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.crop-tools-info{min-width:54px;margin-top:-2px;display:inline-block}.crop-tools-info-label{color:var(--muted-foreground);font-size:12px;line-height:12px}.crop-tools-info-value{font-size:14px;line-height:14px}.crop-b{background-color:var(--accent-blue);position:absolute}.crop-b-t{cursor:ns-resize;width:100%;height:2px;top:0;left:0}.crop-b-r{cursor:ew-resize;width:2px;height:100%;top:0;right:0}.crop-b-b{cursor:ns-resize;width:100%;height:2px;bottom:0;left:0;transform:translateY(1px)}.crop-b-l{cursor:ew-resize;width:2px;height:100%;top:0;left:-1px;transform:translate(1px)}.crop-l-box{pointer-events:none;position:absolute;inset:2px}.crop-l{border:1px dashed var(--color-white);opacity:.5;position:absolute}.crop-l-v{border-top:0;border-bottom:0;width:33%;height:100%;top:0;left:33%}.crop-l-h{border-left:0;border-right:0;width:100%;height:33%;top:33%;left:0}.crop-ps{box-sizing:border-box;border:1px solid var(--accent-blue);background-color:var(--overlay-bg-white);border-radius:50%;width:12px;height:12px;position:absolute}.crop-ps-tl{cursor:nwse-resize;top:-5px;left:-5px}.crop-ps-t{cursor:ns-resize;top:-5px;left:50%;transform:translate(-50%)}.crop-ps-tr{cursor:nesw-resize;top:-5px;right:-5px}.crop-ps-r{cursor:ew-resize;top:50%;right:-5px;transform:translateY(-50%)}.crop-ps-br{cursor:nwse-resize;bottom:-5px;right:-5px}.crop-ps-b{cursor:ns-resize;bottom:-5px;left:50%;transform:translate(-50%)}.crop-ps-bl{cursor:nesw-resize;bottom:-5px;left:-5px}.crop-ps-l{cursor:ew-resize;top:50%;left:-5px;transform:translateY(-50%)}.crop-p-b{box-sizing:border-box;border:2px solid var(--accent-blue);position:absolute;inset:0}.crop-p-p{background-color:var(--overlay-bg-white);border:3px solid var(--accent-blue);box-sizing:border-box;border-radius:50%;width:32px;height:32px;position:absolute;bottom:-16px;right:-16px}.frame{box-sizing:border-box;justify-content:center;align-items:center;width:100%;height:100%;min-height:0;padding:16px;display:flex;position:relative;overflow:hidden}.frame--faded{background-color:#00000080}.frame-preview{-webkit-user-select:none;user-select:none;flex-shrink:1;width:auto;min-width:0;max-width:100%;height:auto;min-height:0;max-height:100%;transition:transform .2s;display:block;position:relative}.frame-image{object-fit:contain;width:100%;height:100%}.frame-image--faded{opacity:.4}.resize{background-color:var(--background);border-radius:4px;flex-direction:column;padding:16px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}.resize-text{text-align:center;color:var(--muted-foreground);font-size:14px}.resize-border{border-bottom:1px solid var(--border);width:60px;margin:12px auto 4px;display:inline-block}.resize-tools{align-items:center;gap:6px;margin-top:16px;display:flex}.resize-tools-lock{width:12px;height:12px;color:var(--muted-foreground)}.resize-tools-buttons{margin-left:4px;display:flex}.resize-tools-save{border-top-right-radius:0;border-bottom-right-radius:0;width:36px}.resize-tools-close{border-top-left-radius:0;border-bottom-left-radius:0;width:36px;margin-left:-1px}.sidebar{z-index:10;width:0;transition:transform .15s ease-out;position:relative}@media (width>=768px){.sidebar{width:320px;transition:none}}.sidebar-settings{border-radius:50%;width:40px;height:40px;position:absolute;top:8px;right:8px;box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a}@media (width>=768px){.sidebar-settings{display:none}}.sidebar-container{box-sizing:border-box;border-left:1px solid var(--border);position:absolute;inset:0}.sidebar-content{background-color:var(--background);box-sizing:border-box;flex-direction:column;width:320px;height:100%;padding:16px;display:flex;position:absolute;top:0;left:0;overflow-y:auto}@media (width<=767px){.sidebar-content{padding-top:48px}}.sidebar-close-btn{position:absolute;top:8px;right:8px}.sidebar-separator{margin-top:20px;margin-bottom:12px}.sidebar-resize{justify-content:space-between;align-items:center;display:flex}.sidebar-resize-icon{align-items:center;gap:8px;display:flex}.sidebar-resize-size{color:var(--muted-foreground);font-size:14px}.sidebar-crop{flex-direction:column;gap:8px;display:flex}.sidebar-crop-ratios{grid-template-columns:repeat(3,1fr);gap:8px;display:grid}.sidebar-preset{flex-direction:column;gap:8px;display:flex}.picedi{font-size:16px;font-family:var(--font-sans);--font-sans:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Tahoma, Helvetica, Arial, sans-serif;--color-white:#fff;--color-black:#000;--color-transparent:transparent;--color-red:oklch(63.7% .237 25.331);--color-green:oklch(76.8% .188 151.716);--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--accent-blue:oklch(60.9% .221 251.687);--accent-blue-light:oklch(96% .02 250);--destructive:oklch(57.7% .245 27.325);--success:oklch(76.8% .188 151.716);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--radius:4px;--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:oklch(20.5% 0 0);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0);--overlay-bg:color-mix(in srgb, var(--color-black) 50%, transparent);--overlay-bg-white:color-mix(in srgb, var(--color-white) 80%, transparent)}:host([data-theme=dark]) .picedi,[data-theme=dark] .picedi,[data-theme=dark].picedi{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--accent-blue-light:oklch(25% .06 250);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0);--overlay-bg:color-mix(in srgb, var(--color-black) 75%, transparent)}.picedi h1,.picedi h2,.picedi h3,.picedi h4,.picedi h5,.picedi h6{margin:0;font-weight:600}.text-red{color:var(--color-red)}.bg-red{background-color:var(--color-red)}.bg-green{background-color:var(--color-green)}.text-green{color:var(--color-green)}.mask{background-color:var(--overlay-bg)}.semibold{letter-spacing:.4px;font-weight:600}.bold{letter-spacing:.4px;font-weight:700}.sys{width:100%;height:100%;color:var(--muted-foreground);justify-content:center;align-items:center;display:flex;position:relative}.main{background-color:var(--background);grid-template-rows:auto 1fr;height:100%;display:grid;overflow:hidden}.grid{grid-template-columns:1fr auto;min-height:0;display:grid;position:relative;overflow:hidden}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
2
- import { createContext as e, forwardRef as t, useCallback as n, useContext as r, useEffect as i, useLayoutEffect as a, useMemo as o, useRef as s, useState as c } from "react";
1
+ (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`._button_snd36_1{cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;box-sizing:border-box;background-color:#0000;border:1px solid #0000;border-radius:4px;justify-content:center;align-items:center;gap:8px;height:32px;padding:0 8px;font-family:inherit;font-size:14px;font-weight:500;transition:background-color .2s,border-color .2s,opacity .2s;display:inline-flex}._button_snd36_1:disabled{pointer-events:none;opacity:.5}._button_snd36_1 svg{flex-shrink:0;width:16px;height:16px}._default_snd36_32{background-color:var(--primary);color:var(--primary-foreground)}._default_snd36_32:hover{opacity:.9}._outline_snd36_39{border-color:var(--border);background-color:var(--background);color:var(--foreground)}._outline_snd36_39:hover{background-color:var(--secondary)}._ghost_snd36_47{color:var(--foreground);padding:0 8px}._ghost_snd36_47:hover{background-color:var(--secondary)}._rect_snd36_54{width:32px;height:32px}:host{height:100%;display:block}:host *{box-sizing:border-box}._root_kw2xl_8{width:100%;height:100%;font-size:16px;font-family:var(--font-sans);--font-sans:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Tahoma, Helvetica, Arial, sans-serif;--color-white:#fff;--color-white-fade:color-mix(in srgb, var(--color-white) 30%, transparent);--color-black:#000;--color-transparent:transparent;--color-red:oklch(63.7% .237 25.331);--color-green:oklch(76.8% .188 151.716);--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(75.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--accent-blue:oklch(60.9% .221 251.687);--accent-blue-light:oklch(96% .02 250);--accent-blue-fade:color-mix(in srgb, var(--accent-blue) 60%, transparent);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--overlay-bg:color-mix(in srgb, var(--color-black) 50%, transparent);--overlay-bg-white:color-mix(in srgb, var(--color-white) 80%, transparent);position:relative}._root_kw2xl_8[data-theme=dark]{--background:oklch(24.5% 0 0);--foreground:oklch(78.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(24.5% 0 0);--muted-foreground:oklch(50% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--accent-blue-light:oklch(25% .06 250);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--overlay-bg:color-mix(in srgb, var(--color-black) 75%, transparent)}._root_kw2xl_8 h1,._root_kw2xl_8 h2,._root_kw2xl_8 h3,._root_kw2xl_8 h4,._root_kw2xl_8 h5,._root_kw2xl_8 h6{color:var(--foreground);margin:0;font-weight:600}._textRed_kw2xl_73{color:var(--color-red)}._bgRed_kw2xl_76{background-color:var(--color-red)}._bgGreen_kw2xl_79{background-color:var(--color-green)}._textGreen_kw2xl_82{color:var(--color-green)}._mask_kw2xl_85{background-color:var(--overlay-bg)}._semibold_kw2xl_88{letter-spacing:.4px;font-weight:600}._bold_kw2xl_92{letter-spacing:.4px;font-weight:700}._system_kw2xl_96{color:var(--muted-foreground);background-color:var(--background);justify-content:center;align-items:center;display:flex;position:absolute;inset:0}._wrapper_kw2xl_105{width:100%;height:100%;min-height:480px;position:relative}._main_kw2xl_111{background-color:var(--background);grid-template-rows:auto 1fr;display:grid;position:absolute;inset:0;overflow:hidden}._grid_kw2xl_119{grid-template-columns:1fr auto;min-height:0;display:grid;position:relative;overflow:hidden}._button_gf7m5_1{border:1px solid var(--border);background-color:var(--background);color:var(--foreground);cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;border-radius:4px;flex-direction:column;justify-content:center;align-items:center;gap:8px;padding:12px;font-family:inherit;font-size:12px;transition:all .2s;display:inline-flex}._button_gf7m5_1:hover:not([aria-pressed=true]){background-color:var(--secondary)}._button_gf7m5_1[aria-pressed=true]{border-color:var(--accent-blue);background-color:var(--accent-blue-light);color:var(--foreground)}._button_gf7m5_1 svg{flex-shrink:0;width:20px;height:20px}._button_gf7m5_1 span{white-space:nowrap}._separator_rqskq_1{background-color:var(--border);box-sizing:border-box;border:none;flex-shrink:0;display:block}._separator_rqskq_1[data-orientation=horizontal]{width:100%;height:1px}._separator_rqskq_1[data-orientation=vertical]{align-self:stretch;width:1px;height:100%;margin:0}._wrapper_12rgt_1{box-sizing:border-box;width:100%;position:relative}._trigger_12rgt_6{width:100%;height:32px;color:var(--foreground);background-color:var(--background);border:1px solid var(--border);cursor:pointer;box-sizing:border-box;-webkit-user-select:none;user-select:none;border-radius:4px;outline:none;justify-content:space-between;align-items:center;padding:0 8px 0 10px;font-family:inherit;font-size:14px;transition:border-color .2s;display:flex}._trigger_12rgt_6:hover,._trigger_12rgt_6:focus{border-color:var(--muted-foreground)}._triggerArrow_12rgt_29{width:16px;height:16px;color:var(--muted-foreground);transition:transform .2s}._wrapper_12rgt_1[data-state=open] ._triggerArrow_12rgt_29{transform:rotate(180deg)}._content_12rgt_38{background-color:var(--background);border:1px solid var(--border);z-index:50;box-sizing:border-box;border-radius:4px;width:100%;max-height:282px;padding:4px;position:absolute;top:calc(100% + 4px);left:0;overflow-y:auto;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d}._content_12rgt_38::-webkit-scrollbar{width:4px}._content_12rgt_38::-webkit-scrollbar-track{background:0 0}._content_12rgt_38::-webkit-scrollbar-thumb{background-color:var(--border);border-radius:10px}._wrapper_12rgt_1[data-state=closed] ._content_12rgt_38{display:none}._groupLabel_12rgt_68{color:var(--muted-foreground);-webkit-user-select:none;user-select:none;padding:8px 10px;font-size:12px;font-weight:500}._item_12rgt_75{width:100%;color:var(--foreground);cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;background:0 0;border-radius:4px;justify-content:space-between;align-items:center;padding:4px 10px;display:flex}._item_12rgt_75:hover{background-color:var(--secondary)}._itemLeft_12rgt_91{font-size:14px;font-weight:400}._itemAddon_12rgt_95{align-items:center;gap:8px;display:flex}._itemAddon_12rgt_95>span{color:var(--muted-foreground);font-size:12px}._itemAddon_12rgt_95>svg{font-size:14px}._itemAddon_12rgt_95>b{flex-shrink:0;width:16px;height:16px}._itemRightContainer_12rgt_112{align-items:center;gap:8px;display:flex}._itemRight_12rgt_112{color:var(--muted-foreground);font-size:14px}._itemCheck_12rgt_121{width:16px;height:16px;color:var(--foreground);flex-shrink:0}._input_j55nq_1{width:100%;height:32px;color:var(--foreground);background-color:var(--background);border:1px solid var(--input);box-sizing:border-box;border-radius:4px;outline:none;padding:0 8px;font-family:inherit;font-size:14px;line-height:normal;transition:border-color .2s,box-shadow .2s;display:block}._input_j55nq_1:hover:not(:disabled):not(:focus){border-color:var(--muted-foreground)}._input_j55nq_1:focus{box-shadow:0 0 0 1px var(--ring)}._input_j55nq_1:disabled{cursor:not-allowed;opacity:.5;background-color:var(--secondary)}._input_j55nq_1::placeholder{color:var(--muted-foreground);opacity:1}._numberClean_j55nq_34::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._numberClean_j55nq_34::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}._numberClean_j55nq_34[type=number]{-moz-appearance:textfield}._container_14vsv_1{position:relative}._legend_14vsv_4{color:var(--muted-foreground);background:var(--background);margin-left:8px;padding:0 4px;font-size:12px;position:absolute;top:-9px}._suffix_14vsv_13{color:var(--muted-foreground);pointer-events:none;-webkit-user-select:none;user-select:none;font-size:14px;position:absolute;bottom:2px;right:8px}._group_qpue1_1{margin-left:4px;display:flex}._group_qpue1_1 ._save_qpue1_6{width:36px;color:var(--color-green);border-top-right-radius:0;border-bottom-right-radius:0}._group_qpue1_1 ._close_qpue1_13{width:36px;color:var(--color-red);border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}._sliderContainer_1ntcm_1{cursor:pointer;touch-action:none;--slider-progress:0%;align-items:center;width:100%;height:24px;display:flex;position:relative}._sliderContainer_1ntcm_1._disabled_1ntcm_12{pointer-events:none;cursor:not-allowed;opacity:.5}._sliderTrack_1ntcm_18{background-color:color-mix(in oklch, var(--muted-foreground) 65%, transparent);border-radius:2px;width:100%;height:2px;position:relative}._sliderRange_1ntcm_30{background-color:var(--primary);height:100%;width:var(--slider-progress);border-radius:2px;position:absolute}._sliderThumb_1ntcm_38{background-color:var(--background);border:2px solid var(--primary);pointer-events:none;border-radius:50%;width:12px;height:13px;transition:transform .1s,box-shadow .1s;position:absolute;top:50%;transform:translate(-50%,-50%)}._hiddenInput_1ntcm_53{opacity:0;cursor:pointer;z-index:1;width:100%;height:100%;margin:0;position:absolute;top:0;left:0}._sliderContainer_1ntcm_1:not(._disabled_1ntcm_12):hover ._sliderThumb_1ntcm_38{transform:translate(-50%,-50%)scale(1.1)}._header_msw8l_1{box-sizing:border-box;background-color:var(--background);border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;height:48px;padding:0 8px;display:flex}._tools_msw8l_11{gap:8px;display:flex}._history_msw8l_15{align-items:center;gap:8px;display:flex}._historyText_msw8l_20{color:var(--muted-foreground);font-size:14px}._resize_11cwi_1{background-color:var(--background);border-radius:4px;flex-direction:column;gap:2px;padding:8px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._slider_11cwi_14{width:80%;margin:0 auto -4px}._border_11cwi_18{border-bottom:1px solid var(--border);width:60px;margin:12px auto 4px;display:inline-block}._tools_11cwi_24{align-items:center;gap:6px;margin-top:16px;display:flex}._toolsLock_11cwi_30{width:12px;height:12px;color:var(--muted-foreground)}._preview_dvanl_1{box-sizing:border-box;max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;transition:all .2s linear;position:absolute;inset:0;overflow:hidden}._rotate_dvanl_12{box-sizing:border-box;width:100%;height:100%;transition:all .2s linear;position:absolute;top:50%;left:50%;overflow:hidden;transform:translate(-50%,-50%)}._flip_dvanl_24{box-sizing:border-box;transition:all .2s linear;position:absolute;inset:0;overflow:hidden}._image_dvanl_32{max-width:none;max-height:none;transition:all .2s linear;display:block;position:absolute}._wrapper_13nh3_1{box-sizing:border-box;max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;position:absolute;inset:0}._box_13nh3_9{cursor:move;box-sizing:border-box;-webkit-user-select:none;user-select:none;touch-action:none;border:1px solid var(--color-white-fade);position:absolute}._tools_13nh3_18{background-color:var(--background);box-sizing:border-box;border:1px solid var(--border);border-radius:4px;align-items:center;padding:4px 4px 4px 8px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}._toolsInfo_13nh3_34{-webkit-user-select:none;user-select:none;min-width:54px;margin-top:-2px;display:inline-block}._toolsInfoLabel_13nh3_41{color:var(--muted-foreground);font-size:12px;line-height:12px}._toolsInfoValue_13nh3_46{color:var(--foreground);font-size:14px;line-height:14px}._linesBox_13nh3_51{pointer-events:none;position:absolute;inset:2px}._line_13nh3_51{border:1px dashed var(--color-white);opacity:.5;position:absolute}._lineV_13nh3_61{border-top:0;border-bottom:0;width:33%;height:100%;top:0;left:33%}._lineH_13nh3_69{border-left:0;border-right:0;width:100%;height:33%;top:33%;left:0}._pointer_13nh3_77{box-sizing:border-box;width:14px;height:14px;position:absolute}._pointerTopLeft_13nh3_83{border-top:3px solid var(--accent-blue);border-left:3px solid var(--accent-blue);cursor:nwse-resize;top:-6px;left:-6px}._pointerTopRight_13nh3_90{border-top:3px solid var(--accent-blue);border-right:3px solid var(--accent-blue);cursor:nesw-resize;top:-6px;right:-6px}._pointerBottomRight_13nh3_97{border-bottom:3px solid var(--accent-blue);border-right:3px solid var(--accent-blue);cursor:nwse-resize;bottom:-6px;right:-6px}._pointerBottomLeft_13nh3_104{border-bottom:3px solid var(--accent-blue);border-left:3px solid var(--accent-blue);cursor:nesw-resize;bottom:-6px;left:-6px}._mobileBorder_13nh3_111{box-sizing:border-box;border:2px solid var(--accent-blue);position:absolute;inset:0}._mobilePointer_13nh3_117{background-color:var(--overlay-bg-white);border:3px solid var(--accent-blue);box-sizing:border-box;border-radius:50%;width:32px;height:32px;position:absolute;bottom:-16px;right:-16px}._flip_17ic5_1{background-color:var(--background);border-radius:4px;gap:4px;padding:4px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._btnH_17ic5_14{border-top-right-radius:0;border-bottom-right-radius:0;width:36px}._btnV_17ic5_20{border-top-left-radius:0;border-bottom-left-radius:0;width:36px;margin-left:-1px}._rotate_gkt07_1{background-color:var(--background);border-radius:4px;gap:4px;padding:4px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._btnH_gkt07_14{border-top-right-radius:0;border-bottom-right-radius:0;width:36px}._btnV_gkt07_20{border-top-left-radius:0;border-bottom-left-radius:0;width:36px;margin-left:-1px}._frame_xffug_1{box-sizing:border-box;width:100%;height:100%;margin:0 auto;padding:16px;position:relative}._sidebar_8qtha_1{z-index:10;width:0;transition:transform .15s ease-out;position:relative}@media (width>=768px){._sidebar_8qtha_1{width:320px;transition:none}}._settings_8qtha_11{border-radius:50%;width:40px;height:40px;position:absolute;top:8px;right:8px;box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a}@media (width>=768px){._settings_8qtha_11{display:none}}._container_8qtha_25{box-sizing:border-box;border-left:1px solid var(--border);position:absolute;inset:0}._content_8qtha_31{background-color:var(--background);box-sizing:border-box;flex-direction:column;width:320px;height:100%;padding:16px;display:flex;position:absolute;top:0;left:0;overflow-y:auto}@media (width<=767px){._content_8qtha_31{padding-top:48px}}._closeBtn_8qtha_47{position:absolute;top:8px;right:8px}._separator_8qtha_52{margin-top:20px;margin-bottom:12px}._resize_8qtha_56{justify-content:space-between;align-items:center;display:flex}._resizeIcon_8qtha_61{align-items:center;gap:8px;display:flex}._resizeSize_8qtha_66{color:var(--muted-foreground);font-size:14px}._crop_8qtha_70{flex-direction:column;gap:8px;display:flex}._ratio_8qtha_75{grid-template-columns:repeat(3,1fr);gap:8px;display:grid}._sidebarPreset_8qtha_80{flex-direction:column;gap:8px;display:flex}._flipRotate_8qtha_85{grid-template-columns:repeat(2,1fr);gap:8px;display:grid}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
2
+ import { createContext as e, forwardRef as t, useContext as n, useEffect as r, useLayoutEffect as i, useMemo as a, useRef as o, useState as s } from "react";
3
3
  //#region \0rolldown/runtime.js
4
- var l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), u = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
4
+ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), l = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
5
5
  if (typeof require < "u") return require.apply(this, arguments);
6
6
  throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
7
- }), d = /* @__PURE__ */ l(((e) => {
7
+ }), u = {
8
+ quality: .85,
9
+ saveAsWEBP: !1,
10
+ exportAs: "blob"
11
+ }, d = (e, t, n, r, i, a, o) => ({
12
+ history: {
13
+ pointer: 0,
14
+ items: [{
15
+ width: t,
16
+ height: n,
17
+ action: {
18
+ name: "initial",
19
+ args: null
20
+ }
21
+ }]
22
+ },
23
+ currentAction: null,
24
+ previewUrl: i,
25
+ originalBlob: r,
26
+ mimeType: e,
27
+ sidebar: !1,
28
+ settings: o,
29
+ isAlpha: a
30
+ }), f = e(void 0), p = /* @__PURE__ */ c(((e) => {
8
31
  var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
9
32
  function r(e, n, r) {
10
33
  var i = null;
@@ -19,19 +42,19 @@ var l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
19
42
  };
20
43
  }
21
44
  e.Fragment = n, e.jsx = r, e.jsxs = r;
22
- })), f = /* @__PURE__ */ l(((e) => {
45
+ })), m = /* @__PURE__ */ c(((e) => {
23
46
  process.env.NODE_ENV !== "production" && (function() {
24
47
  function t(e) {
25
48
  if (e == null) return null;
26
- if (typeof e == "function") return e.$$typeof === O ? null : e.displayName || e.name || null;
49
+ if (typeof e == "function") return e.$$typeof === ne ? null : e.displayName || e.name || null;
27
50
  if (typeof e == "string") return e;
28
51
  switch (e) {
29
52
  case v: return "Fragment";
30
53
  case b: return "Profiler";
31
54
  case y: return "StrictMode";
32
55
  case w: return "Suspense";
33
- case T: return "SuspenseList";
34
- case ee: return "Activity";
56
+ case ee: return "SuspenseList";
57
+ case te: return "Activity";
35
58
  }
36
59
  if (typeof e == "object") switch (typeof e.tag == "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
37
60
  case _: return "Portal";
@@ -40,8 +63,8 @@ var l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
40
63
  case C:
41
64
  var n = e.render;
42
65
  return e = e.displayName, e ||= (e = n.displayName || n.name || "", e === "" ? "ForwardRef" : "ForwardRef(" + e + ")"), e;
43
- case E: return n = e.displayName || null, n === null ? t(e.type) || "Memo" : n;
44
- case D:
66
+ case T: return n = e.displayName || null, n === null ? t(e.type) || "Memo" : n;
67
+ case E:
45
68
  n = e._payload, e = e._init;
46
69
  try {
47
70
  return t(e(n));
@@ -67,7 +90,7 @@ var l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
67
90
  }
68
91
  function i(e) {
69
92
  if (e === v) return "<>";
70
- if (typeof e == "object" && e && e.$$typeof === D) return "<...>";
93
+ if (typeof e == "object" && e && e.$$typeof === E) return "<...>";
71
94
  try {
72
95
  var n = t(e);
73
96
  return n ? "<" + n + ">" : "<...>";
@@ -76,14 +99,14 @@ var l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
76
99
  }
77
100
  }
78
101
  function a() {
79
- var e = k.A;
102
+ var e = D.A;
80
103
  return e === null ? null : e.getOwner();
81
104
  }
82
105
  function o() {
83
106
  return Error("react-stack-top-frame");
84
107
  }
85
108
  function s(e) {
86
- if (A.call(e, "key")) {
109
+ if (re.call(e, "key")) {
87
110
  var t = Object.getOwnPropertyDescriptor(e, "key").get;
88
111
  if (t && t.isReactWarning) return !1;
89
112
  }
@@ -91,16 +114,16 @@ var l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
91
114
  }
92
115
  function c(e, t) {
93
116
  function n() {
94
- N || (N = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
117
+ ae || (ae = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
95
118
  }
96
119
  n.isReactWarning = !0, Object.defineProperty(e, "key", {
97
120
  get: n,
98
121
  configurable: !0
99
122
  });
100
123
  }
101
- function l() {
124
+ function u() {
102
125
  var e = t(this.type);
103
- return P[e] || (P[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
126
+ return oe[e] || (oe[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
104
127
  }
105
128
  function d(e, t, n, r, i, a) {
106
129
  var o = n.ref;
@@ -115,7 +138,7 @@ var l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
115
138
  value: null
116
139
  }) : Object.defineProperty(e, "ref", {
117
140
  enumerable: !1,
118
- get: l
141
+ get: u
119
142
  }), e._store = {}, Object.defineProperty(e._store, "validated", {
120
143
  configurable: !1,
121
144
  enumerable: !1,
@@ -140,103 +163,54 @@ var l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
140
163
  }
141
164
  function f(e, n, i, o, l, u) {
142
165
  var f = n.children;
143
- if (f !== void 0) if (o) if (j(f)) {
166
+ if (f !== void 0) if (o) if (ie(f)) {
144
167
  for (o = 0; o < f.length; o++) p(f[o]);
145
168
  Object.freeze && Object.freeze(f);
146
169
  } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
147
170
  else p(f);
148
- if (A.call(n, "key")) {
171
+ if (re.call(n, "key")) {
149
172
  f = t(e);
150
173
  var m = Object.keys(n).filter(function(e) {
151
174
  return e !== "key";
152
175
  });
153
- o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", L[f + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", o, f, m, f), L[f + o] = !0);
176
+ o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", k[f + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", o, f, m, f), k[f + o] = !0);
154
177
  }
155
178
  if (f = null, i !== void 0 && (r(i), f = "" + i), s(n) && (r(n.key), f = "" + n.key), "key" in n) for (var h in i = {}, n) h !== "key" && (i[h] = n[h]);
156
179
  else i = n;
157
180
  return f && c(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), d(e, f, i, a(), l, u);
158
181
  }
159
182
  function p(e) {
160
- m(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === D && (e._payload.status === "fulfilled" ? m(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
183
+ m(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === E && (e._payload.status === "fulfilled" ? m(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
161
184
  }
162
185
  function m(e) {
163
186
  return typeof e == "object" && !!e && e.$$typeof === g;
164
187
  }
165
- var h = u("react"), g = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), S = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), ee = Symbol.for("react.activity"), O = Symbol.for("react.client.reference"), k = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, j = Array.isArray, M = console.createTask ? console.createTask : function() {
188
+ var h = l("react"), g = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), S = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), ee = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), te = Symbol.for("react.activity"), ne = Symbol.for("react.client.reference"), D = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, re = Object.prototype.hasOwnProperty, ie = Array.isArray, O = console.createTask ? console.createTask : function() {
166
189
  return null;
167
190
  };
168
191
  h = { react_stack_bottom_frame: function(e) {
169
192
  return e();
170
193
  } };
171
- var N, P = {}, F = h.react_stack_bottom_frame.bind(h, o)(), I = M(i(o)), L = {};
194
+ var ae, oe = {}, se = h.react_stack_bottom_frame.bind(h, o)(), ce = O(i(o)), k = {};
172
195
  e.Fragment = v, e.jsx = function(e, t, n) {
173
- var r = 1e4 > k.recentlyCreatedOwnerStacks++;
174
- return f(e, t, n, !1, r ? Error("react-stack-top-frame") : F, r ? M(i(e)) : I);
196
+ var r = 1e4 > D.recentlyCreatedOwnerStacks++;
197
+ return f(e, t, n, !1, r ? Error("react-stack-top-frame") : se, r ? O(i(e)) : ce);
175
198
  }, e.jsxs = function(e, t, n) {
176
- var r = 1e4 > k.recentlyCreatedOwnerStacks++;
177
- return f(e, t, n, !0, r ? Error("react-stack-top-frame") : F, r ? M(i(e)) : I);
199
+ var r = 1e4 > D.recentlyCreatedOwnerStacks++;
200
+ return f(e, t, n, !0, r ? Error("react-stack-top-frame") : se, r ? O(i(e)) : ce);
178
201
  };
179
202
  })();
180
- })), p = (/* @__PURE__ */ l(((e, t) => {
181
- process.env.NODE_ENV === "production" ? t.exports = d() : t.exports = f();
182
- })))();
183
- function m({ size: e = 36, className: t, style: n, color: r = "currentColor" }) {
184
- return /* @__PURE__ */ (0, p.jsxs)("svg", {
185
- xmlns: "http://www.w3.org/2000/svg",
186
- x: "0px",
187
- y: "0px",
188
- viewBox: "0 0 80 80",
189
- width: e,
190
- height: e,
191
- fill: r,
192
- className: t,
193
- style: n,
194
- children: [/* @__PURE__ */ (0, p.jsx)("path", {
195
- d: "M10,40c0,0,0-0.4,0-1.1c0-0.3,0-0.8,0-1.3c0-0.3,0-0.5,0-0.8c0-0.3,0.1-0.6,0.1-0.9c0.1-0.6,0.1-1.4,0.2-2.1\n c0.2-0.8,0.3-1.6,0.5-2.5c0.2-0.9,0.6-1.8,0.8-2.8c0.3-1,0.8-1.9,1.2-3c0.5-1,1.1-2,1.7-3.1c0.7-1,1.4-2.1,2.2-3.1\n c1.6-2.1,3.7-3.9,6-5.6c2.3-1.7,5-3,7.9-4.1c0.7-0.2,1.5-0.4,2.2-0.7c0.7-0.3,1.5-0.3,2.3-0.5c0.8-0.2,1.5-0.3,2.3-0.4l1.2-0.1\n l0.6-0.1l0.3,0l0.1,0l0.1,0l0,0c0.1,0-0.1,0,0.1,0c1.5,0,2.9-0.1,4.5,0.2c0.8,0.1,1.6,0.1,2.4,0.3c0.8,0.2,1.5,0.3,2.3,0.5\n c3,0.8,5.9,2,8.5,3.6c2.6,1.6,4.9,3.4,6.8,5.4c1,1,1.8,2.1,2.7,3.1c0.8,1.1,1.5,2.1,2.1,3.2c0.6,1.1,1.2,2.1,1.6,3.1\n c0.4,1,0.9,2,1.2,3c0.3,1,0.6,1.9,0.8,2.7c0.2,0.9,0.3,1.6,0.5,2.4c0.1,0.4,0.1,0.7,0.2,1c0,0.3,0.1,0.6,0.1,0.9\n c0.1,0.6,0.1,1,0.1,1.4C74,39.6,74,40,74,40c0.2,2.2-1.5,4.1-3.7,4.3s-4.1-1.5-4.3-3.7c0-0.1,0-0.2,0-0.3l0-0.4c0,0,0-0.3,0-0.9\n c0-0.3,0-0.7,0-1.1c0-0.2,0-0.5,0-0.7c0-0.2-0.1-0.5-0.1-0.8c-0.1-0.6-0.1-1.2-0.2-1.9c-0.1-0.7-0.3-1.4-0.4-2.2\n c-0.2-0.8-0.5-1.6-0.7-2.4c-0.3-0.8-0.7-1.7-1.1-2.6c-0.5-0.9-0.9-1.8-1.5-2.7c-0.6-0.9-1.2-1.8-1.9-2.7c-1.4-1.8-3.2-3.4-5.2-4.9\n c-2-1.5-4.4-2.7-6.9-3.6c-0.6-0.2-1.3-0.4-1.9-0.6c-0.7-0.2-1.3-0.3-1.9-0.4c-1.2-0.3-2.8-0.4-4.2-0.5l-2,0c-0.7,0-1.4,0.1-2.1,0.1\n c-0.7,0.1-1.4,0.1-2,0.3c-0.7,0.1-1.3,0.3-2,0.4c-2.6,0.7-5.2,1.7-7.5,3.1c-2.2,1.4-4.3,2.9-6,4.7c-0.9,0.8-1.6,1.8-2.4,2.7\n c-0.7,0.9-1.3,1.9-1.9,2.8c-0.5,1-1,1.9-1.4,2.8c-0.4,0.9-0.8,1.8-1,2.6c-0.3,0.9-0.5,1.6-0.7,2.4c-0.2,0.7-0.3,1.4-0.4,2.1\n c-0.1,0.3-0.1,0.6-0.2,0.9c0,0.3-0.1,0.6-0.1,0.8c0,0.5-0.1,0.9-0.1,1.3C10,39.6,10,40,10,40z",
196
- children: /* @__PURE__ */ (0, p.jsx)("animateTransform", {
197
- attributeType: "xml",
198
- attributeName: "transform",
199
- type: "rotate",
200
- from: "0 40 40",
201
- to: "360 40 40",
202
- dur: "0.8s",
203
- repeatCount: "indefinite"
204
- })
205
- }), /* @__PURE__ */ (0, p.jsx)("path", {
206
- fill: "currentColor",
207
- d: "M62,40.1c0,0,0,0.2-0.1,0.7c0,0.2,0,0.5-0.1,0.8c0,0.2,0,0.3,0,0.5c0,0.2-0.1,0.4-0.1,0.7\n c-0.1,0.5-0.2,1-0.3,1.6c-0.2,0.5-0.3,1.1-0.5,1.8c-0.2,0.6-0.5,1.3-0.7,1.9c-0.3,0.7-0.7,1.3-1,2.1c-0.4,0.7-0.9,1.4-1.4,2.1\n c-0.5,0.7-1.1,1.4-1.7,2c-1.2,1.3-2.7,2.5-4.4,3.6c-1.7,1-3.6,1.8-5.5,2.4c-2,0.5-4,0.7-6.2,0.7c-1.9-0.1-4.1-0.4-6-1.1\n c-1.9-0.7-3.7-1.5-5.2-2.6c-1.5-1.1-2.9-2.3-4-3.7c-0.6-0.6-1-1.4-1.5-2c-0.4-0.7-0.8-1.4-1.2-2c-0.3-0.7-0.6-1.3-0.8-2\n c-0.2-0.6-0.4-1.2-0.6-1.8c-0.1-0.6-0.3-1.1-0.4-1.6c-0.1-0.5-0.1-1-0.2-1.4c-0.1-0.9-0.1-1.5-0.1-2c0-0.5,0-0.7,0-0.7\n s0,0.2,0.1,0.7c0.1,0.5,0,1.1,0.2,2c0.1,0.4,0.2,0.9,0.3,1.4c0.1,0.5,0.3,1,0.5,1.6c0.2,0.6,0.4,1.1,0.7,1.8\n c0.3,0.6,0.6,1.2,0.9,1.9c0.4,0.6,0.8,1.3,1.2,1.9c0.5,0.6,1,1.3,1.6,1.8c1.1,1.2,2.5,2.3,4,3.2c1.5,0.9,3.2,1.6,5,2.1\n c1.8,0.5,3.6,0.6,5.6,0.6c1.8-0.1,3.7-0.4,5.4-1c1.7-0.6,3.3-1.4,4.7-2.4c1.4-1,2.6-2.1,3.6-3.3c0.5-0.6,0.9-1.2,1.3-1.8\n c0.4-0.6,0.7-1.2,1-1.8c0.3-0.6,0.6-1.2,0.8-1.8c0.2-0.6,0.4-1.1,0.5-1.7c0.1-0.5,0.2-1,0.3-1.5c0.1-0.4,0.1-0.8,0.1-1.2\n c0-0.2,0-0.4,0.1-0.5c0-0.2,0-0.4,0-0.5c0-0.3,0-0.6,0-0.8c0-0.5,0-0.7,0-0.7c0-1.1,0.9-2,2-2s2,0.9,2,2C62,40,62,40.1,62,40.1z",
208
- children: /* @__PURE__ */ (0, p.jsx)("animateTransform", {
209
- attributeType: "xml",
210
- attributeName: "transform",
211
- type: "rotate",
212
- from: "0 40 40",
213
- to: "-360 40 40",
214
- dur: "0.6s",
215
- repeatCount: "indefinite"
216
- })
217
- })]
218
- });
219
- }
220
- //#endregion
221
- //#region src/shared/components/ImageEditor/provider/initialState.ts
222
- var h = (e, t, n, r) => ({
223
- history: {
224
- pointer: 0,
225
- items: [{
226
- name: "Initial",
227
- base64: r,
228
- width: t,
229
- height: n
230
- }]
231
- },
232
- currentAction: null,
233
- extension: e,
234
- sidebar: !1
235
- }), g = e(void 0), _ = ({ children: e, base64: t, width: n, height: r, ext: i }) => {
236
- let [a, o] = c(h(i, n, r, t)), s = () => a.currentAction, l = (e) => o((t) => ({
203
+ })), h = (/* @__PURE__ */ c(((e, t) => {
204
+ process.env.NODE_ENV === "production" ? t.exports = p() : t.exports = m();
205
+ })))(), g = ({ children: e, mimeType: t, width: n, height: i, originalBlob: c, previewUrl: l, isAlpha: u, settings: p }) => {
206
+ let [m, g] = s(d(t, n, i, c, l, u, p)), _ = o(null);
207
+ r(() => () => {
208
+ _.current &&= (URL.revokeObjectURL(_.current), null);
209
+ }, []);
210
+ let v = (e) => g((t) => ({
237
211
  ...t,
238
212
  currentAction: e
239
- })), u = (e) => o((t) => {
213
+ })), y = (e) => g((t) => {
240
214
  let n = t.history.pointer + 1, r = [...t.history.items.slice(0, n), e];
241
215
  return {
242
216
  ...t,
@@ -246,195 +220,136 @@ var h = (e, t, n, r) => ({
246
220
  pointer: n
247
221
  }
248
222
  };
249
- }), d = () => a.history.items.at(a.history.pointer), f = () => o((e) => ({
250
- ...e,
251
- history: h(i, n, r, t).history
252
- })), m = () => o((e) => {
253
- let t = e.history.items.at(e.history.pointer);
254
- return {
255
- ...e,
256
- history: {
257
- items: [t],
258
- pointer: 0
223
+ }), b = () => {
224
+ let { items: e, pointer: t } = m.history;
225
+ return e.at(t) ?? e.at(0) ?? {
226
+ width: 0,
227
+ height: 0,
228
+ action: {
229
+ name: "initial",
230
+ args: null
259
231
  }
260
232
  };
261
- }), _ = () => o((e) => e.history.pointer <= 0 ? e : {
233
+ }, x = () => {
234
+ let { items: e, pointer: t } = m.history;
235
+ if (e.length === 0 || t < 0) return 0;
236
+ let n = e.slice(0, t + 1).findLast((e) => e.action.name === "rotate");
237
+ return n?.action.name === "rotate" ? n.action.args.degrees : 0;
238
+ }, S = () => g((e) => ({
239
+ ...e,
240
+ history: {
241
+ items: [e.history.items[0]],
242
+ pointer: 0
243
+ }
244
+ })), C = () => g((e) => e.history.pointer <= 0 ? e : {
262
245
  ...e,
263
246
  history: {
264
247
  ...e.history,
265
248
  pointer: e.history.pointer - 1
266
249
  }
267
- }), v = () => o((e) => e.history.pointer >= e.history.items.length - 1 ? e : {
250
+ }), w = () => g((e) => e.history.pointer >= e.history.items.length - 1 ? e : {
268
251
  ...e,
269
252
  history: {
270
253
  ...e.history,
271
254
  pointer: e.history.pointer + 1
272
255
  }
273
- }), y = () => a.sidebar, b = (e) => o((t) => ({
256
+ }), ee = (e) => g((t) => ({
274
257
  ...t,
275
258
  sidebar: e
276
- }));
277
- return /* @__PURE__ */ (0, p.jsx)(g, {
259
+ })), T = a(() => new EventTarget(), []), E = (e) => {
260
+ _.current && URL.revokeObjectURL(_.current), _.current = URL.createObjectURL(e.previewBlob), g(d(e.mimeType, e.width, e.height, e.newBlob, _.current, e.isAlpha, p));
261
+ };
262
+ return /* @__PURE__ */ (0, h.jsx)(f, {
278
263
  value: {
279
- ...a,
280
- getCurrentAction: s,
281
- setCurrentAction: l,
282
- addToHistory: u,
283
- resetHistory: f,
284
- resetHistoryAfterSave: m,
285
- undo: _,
286
- redo: v,
287
- getLastHistoryItem: d,
288
- getSidebar: y,
289
- setSidebar: b
264
+ ...m,
265
+ setImage: E,
266
+ setCurrentAction: v,
267
+ getLastHistoryItem: b,
268
+ getLastRotation: x,
269
+ addToHistory: y,
270
+ resetHistory: S,
271
+ undo: C,
272
+ redo: w,
273
+ setSidebar: ee,
274
+ eventBus: T
290
275
  },
291
276
  children: e
292
277
  });
293
- }, v = {
294
- "image/jpeg": "jpg",
295
- "image/jpg": "jpg",
296
- "image/png": "png",
297
- "image/gif": "gif",
298
- "image/webp": "webp"
299
- }, y = (e) => {
300
- let [t, n] = c({
278
+ }, _ = "(function(){let e=async e=>{let{width:t,height:n}=e,r=Math.min(1,1920/Math.max(t,n)),i=Math.round(t*r),a=Math.round(n*r),o=new OffscreenCanvas(i,a),s=o.getContext(`2d`);if(!s)throw Error(`Failed to get 2D context for preview canvas`);return s.drawImage(e,0,0,i,a),o.convertToBlob({type:`image/webp`,quality:.85})};function t(e){let t=new OffscreenCanvas(e.width,e.height),n=t.getContext(`2d`);if(!n)throw Error(`Failed to create 2D context for canvas.`);n.drawImage(e,0,0);try{let e=n.getImageData(0,0,t.width,t.height).data;for(let t=3;t<e.length;t+=4)if(e[t]<255)return!0;return!1}catch(e){throw Error(`Error reading pixels: ${e}`,{cause:e})}}self.onmessage=async n=>{let r=``;try{let i;if(n.data instanceof Blob)i=n.data;else{let e=n.data.trim();!e.startsWith(`http://`)&&!e.startsWith(`https://`)&&!e.startsWith(`blob:`)&&!e.startsWith(`data:`)&&(r=`image/png`,e=`data:${r};base64,${e}`);let t=await fetch(e);if(!t.ok)throw Error(`HTTP error! Status: ${t.status}`);i=await t.blob()}let a=i.type||r||`image/unknown`,o=await createImageBitmap(i),{width:s,height:c}=o,l=await e(o),u=t(o);o.close(),self.postMessage({success:!0,originalBlob:i,previewBlob:l,mimeType:a,width:s,height:c,isAlpha:u})}catch(e){self.postMessage({success:!1,error:e instanceof Error?e.message:`An error occurred during image loader worker execution.`})}}})();", v = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", _], { type: "text/javascript;charset=utf-8" });
279
+ function y(e) {
280
+ let t;
281
+ try {
282
+ if (t = v && (self.URL || self.webkitURL).createObjectURL(v), !t) throw "";
283
+ let n = new Worker(t, { name: e?.name });
284
+ return n.addEventListener("error", () => {
285
+ (self.URL || self.webkitURL).revokeObjectURL(t);
286
+ }), n;
287
+ } catch {
288
+ return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(_), { name: e?.name });
289
+ }
290
+ }
291
+ //#endregion
292
+ //#region src/shared/components/Pixedi/hooks/useImageLoader.tsx
293
+ var b = (e) => {
294
+ let [t, n] = s({
301
295
  loading: !0,
302
- error: null,
296
+ error: "",
303
297
  width: 0,
304
298
  height: 0,
305
- extension: null,
306
- base64: null
307
- });
308
- return i(() => {
309
- let t = !0;
310
- return (async () => {
311
- try {
312
- let r = await fetch(e);
313
- if (!r.ok) throw Error(`HTTP error! Status: ${r.status}`);
314
- let i = (r.headers.get("content-type") || "").split(";")[0].toLowerCase().trim(), a = i.startsWith("image/"), o = v[i] || "unknown";
315
- if (!a) {
316
- t && n((e) => ({
317
- ...e,
318
- loading: !1,
319
- error: "The requested resource is not a valid image.",
320
- extension: o
321
- }));
322
- return;
323
- }
324
- let s = await r.blob(), c = await new Promise((e, t) => {
325
- let n = new FileReader();
326
- n.onloadend = () => e(n.result), n.onerror = () => t(/* @__PURE__ */ Error("Failed to read image data stream")), n.readAsDataURL(s);
327
- }), l = await new Promise((e, t) => {
328
- let n = new Image();
329
- n.src = c, n.onload = () => e({
330
- width: n.naturalWidth,
331
- height: n.naturalHeight
332
- }), n.onerror = () => t(/* @__PURE__ */ Error("Failed to parse image dimensions"));
333
- });
334
- t && n({
335
- loading: !1,
336
- error: null,
337
- width: l.width,
338
- height: l.height,
339
- extension: o,
340
- base64: c
341
- });
342
- } catch (e) {
343
- t && n((t) => ({
344
- ...t,
345
- loading: !1,
346
- error: e instanceof Error ? e.message : "An error occurred during extraction."
347
- }));
348
- }
349
- })(), () => {
350
- t = !1;
299
+ mimeType: "",
300
+ originalBlob: null,
301
+ previewUrl: "",
302
+ isAlpha: !1
303
+ }), i = o(null);
304
+ return r(() => {
305
+ if (!e) return;
306
+ let t = new y();
307
+ return t.postMessage(e), t.onmessage = (e) => {
308
+ let t = e.data;
309
+ t.success ? (i.current && URL.revokeObjectURL(i.current), i.current = URL.createObjectURL(t.previewBlob), n({
310
+ loading: !1,
311
+ error: "",
312
+ mimeType: t.mimeType,
313
+ width: t.width,
314
+ height: t.height,
315
+ originalBlob: t.originalBlob,
316
+ previewUrl: i.current,
317
+ isAlpha: t.isAlpha
318
+ })) : n((e) => ({
319
+ ...e,
320
+ loading: !1,
321
+ error: t.error || "Error processing image."
322
+ }));
323
+ }, () => {
324
+ t.terminate(), i.current &&= (URL.revokeObjectURL(i.current), null);
351
325
  };
352
326
  }, [e]), t;
353
- }, b = () => {
354
- let e = s(null), t = n((e) => {
355
- let t = e.match(/^data:(image\/[a-zA-Z+.-]+);base64,(.+)$/);
356
- if (!t) throw Error("Invalid Base64 image format");
357
- let n = t[1], r = t[2];
358
- return n === "image/gif" && (n = "image/png"), {
359
- mimeType: n,
360
- rawData: r
361
- };
362
- }, []), r = n(async (e) => {
363
- let { mimeType: n, rawData: r } = t(e), i = atob(r), a = new Uint8Array(i.length);
364
- for (let e = 0; e < i.length; e++) a[e] = i.charCodeAt(e);
365
- let o = new Blob([a], { type: n });
366
- return {
367
- bitmap: await createImageBitmap(o),
368
- mimeType: n
369
- };
370
- }, [t]), i = n((t) => {
371
- e.current ||= document.createElement("canvas");
372
- let n = e.current, r = t === "image/png" || t === "image/webp";
373
- return {
374
- canvas: n,
375
- ctx: n.getContext("2d", { alpha: r })
376
- };
377
- }, []), a = n((e, t) => t === "image/jpeg" || t === "image/webp" ? e.toDataURL(t, .85) : e.toDataURL(t), []);
378
- return {
379
- resize: n(async (e, t, n) => {
380
- let { bitmap: o, mimeType: s } = await r(e), { canvas: c, ctx: l } = i(s);
381
- return c.width = t, c.height = n, l && (l.clearRect(0, 0, t, n), l.drawImage(o, 0, 0, t, n)), o.close(), a(c, s);
382
- }, [
383
- r,
384
- i,
385
- a
386
- ]),
387
- crop: n(async (e, t, n, o, s) => {
388
- let { bitmap: c, mimeType: l } = await r(e), { canvas: u, ctx: d } = i(l);
389
- return u.width = o, u.height = s, d && (d.clearRect(0, 0, o, s), d.drawImage(c, t, n, o, s, 0, 0, o, s)), c.close(), a(u, l);
390
- }, [
391
- r,
392
- i,
393
- a
394
- ]),
395
- flip: n(async (e, t, n) => {
396
- let { bitmap: o, mimeType: s } = await r(e), { canvas: c, ctx: l } = i(s);
397
- return c.width = o.width, c.height = o.height, l && (l.clearRect(0, 0, c.width, c.height), l.save(), l.translate(t ? o.width : 0, n ? o.height : 0), l.scale(t ? -1 : 1, n ? -1 : 1), l.drawImage(o, 0, 0), l.restore()), o.close(), a(c, s);
398
- }, [
399
- r,
400
- i,
401
- a
402
- ]),
403
- rotate: n(async (e, t) => {
404
- let { bitmap: n, mimeType: o } = await r(e), { canvas: s, ctx: c } = i(o);
405
- return s.width = n.width, s.height = n.height, c && (c.clearRect(0, 0, s.width, s.height), c.save(), c.translate(n.width / 2, n.height / 2), c.rotate(t * Math.PI / 180), c.drawImage(n, -n.width / 2, -n.height / 2), c.restore()), n.close(), a(s, o);
406
- }, [
407
- r,
408
- i,
409
- a
410
- ]),
411
- filter: n(async (e, t) => {
412
- let { bitmap: n, mimeType: o } = await r(e), { canvas: s, ctx: c } = i(o);
413
- return s.width = n.width, s.height = n.height, c && (c.filter = Object.entries(t).map(([e, t]) => `${e}(${t}%)`).join(" "), c.drawImage(n, 0, 0)), n.close(), a(s, o);
414
- }, [
415
- r,
416
- i,
417
- a
418
- ])
419
- };
420
327
  }, x = () => {
421
328
  if (typeof window > "u" || !window.navigator) return null;
422
329
  let e = window.navigator.userAgent.toLowerCase();
423
330
  return /android/.test(e) ? "android" : /iphone|ipad|ipod/.test(e) ? "ios" : /windows phone/.test(e) ? "windows-phone" : /blackberry|bb10/.test(e) ? "blackberry" : /opera mini/.test(e) ? "opera-mini" : /mobile/.test(e) ? "mobile" : null;
424
331
  }, S = () => {
425
- let [e] = c(() => x());
332
+ let [e] = s(() => x());
426
333
  return e;
427
334
  }, C = {
428
335
  sm: 640,
429
336
  md: 768,
430
337
  lg: 1024,
431
338
  xl: 1280
339
+ }, w = {
340
+ INITIAL: "initial",
341
+ RESIZE: "resize",
342
+ CROP: "crop",
343
+ PRESET_CROP: "presetCrop",
344
+ FLIP: "flip",
345
+ ROTATE: "rotate",
346
+ FILTERS: "filters"
432
347
  };
433
348
  //#endregion
434
- //#region src/shared/components/ImageEditor/hooks/useBellow.tsx
435
- function w(e) {
436
- let [t, n] = c(() => window.innerWidth < C[e]);
437
- return i(() => {
349
+ //#region src/shared/components/Pixedi/hooks/useBellow.tsx
350
+ function ee(e) {
351
+ let [t, n] = s(() => window.innerWidth < C[e]);
352
+ return r(() => {
438
353
  function t() {
439
354
  n(window.innerWidth < C[e]);
440
355
  }
@@ -442,7 +357,7 @@ function w(e) {
442
357
  }, [e]), t;
443
358
  }
444
359
  //#endregion
445
- //#region src/shared/components/ImageEditor/assets/icons.tsx
360
+ //#region src/shared/components/Pixedi/assets/icons.tsx
446
361
  var T = {
447
362
  xmlns: "http://w3.org",
448
363
  width: "24",
@@ -453,58 +368,58 @@ var T = {
453
368
  strokeWidth: "2",
454
369
  strokeLinecap: "round",
455
370
  strokeLinejoin: "round"
456
- }, E = (e) => /* @__PURE__ */ (0, p.jsx)("svg", {
371
+ }, E = (e) => /* @__PURE__ */ (0, h.jsx)("svg", {
457
372
  ...T,
458
373
  ...e,
459
- children: /* @__PURE__ */ (0, p.jsx)("path", { d: "M20 6 9 17l-5-5" })
460
- }), D = (e) => /* @__PURE__ */ (0, p.jsxs)("svg", {
374
+ children: /* @__PURE__ */ (0, h.jsx)("path", { d: "M20 6 9 17l-5-5" })
375
+ }), te = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
461
376
  ...T,
462
377
  ...e,
463
- children: [/* @__PURE__ */ (0, p.jsx)("path", { d: "M18 6 6 18" }), /* @__PURE__ */ (0, p.jsx)("path", { d: "m6 6 12 12" })]
464
- }), ee = (e) => /* @__PURE__ */ (0, p.jsxs)("svg", {
378
+ children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M18 6 6 18" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "m6 6 12 12" })]
379
+ }), ne = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
465
380
  ...T,
466
381
  ...e,
467
- children: [/* @__PURE__ */ (0, p.jsx)("rect", {
382
+ children: [/* @__PURE__ */ (0, h.jsx)("rect", {
468
383
  width: "18",
469
384
  height: "11",
470
385
  x: "3",
471
386
  y: "11",
472
387
  rx: "2",
473
388
  ry: "2"
474
- }), /* @__PURE__ */ (0, p.jsx)("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })]
475
- }), O = (e) => /* @__PURE__ */ (0, p.jsxs)("svg", {
389
+ }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })]
390
+ }), D = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
476
391
  ...T,
477
392
  ...e,
478
- children: [/* @__PURE__ */ (0, p.jsx)("path", { d: "m12 19-7-7 7-7" }), /* @__PURE__ */ (0, p.jsx)("path", { d: "M19 12H5" })]
479
- }), k = (e) => /* @__PURE__ */ (0, p.jsx)("svg", {
393
+ children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "m12 19-7-7 7-7" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M19 12H5" })]
394
+ }), re = (e) => /* @__PURE__ */ (0, h.jsx)("svg", {
480
395
  ...T,
481
396
  ...e,
482
- children: /* @__PURE__ */ (0, p.jsx)("path", { d: "m6 9 6 6 6-6" })
483
- }), A = (e) => /* @__PURE__ */ (0, p.jsxs)("svg", {
397
+ children: /* @__PURE__ */ (0, h.jsx)("path", { d: "m6 9 6 6 6-6" })
398
+ }), ie = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
484
399
  ...T,
485
400
  ...e,
486
- children: [/* @__PURE__ */ (0, p.jsx)("path", { d: "M3 7v6h6" }), /* @__PURE__ */ (0, p.jsx)("path", { d: "M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13" })]
487
- }), j = (e) => /* @__PURE__ */ (0, p.jsxs)("svg", {
401
+ children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M3 7v6h6" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13" })]
402
+ }), O = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
488
403
  ...T,
489
404
  ...e,
490
- children: [/* @__PURE__ */ (0, p.jsx)("path", { d: "M21 7v6h-6" }), /* @__PURE__ */ (0, p.jsx)("path", { d: "M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7" })]
491
- }), M = (e) => /* @__PURE__ */ (0, p.jsxs)("svg", {
405
+ children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M21 7v6h-6" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7" })]
406
+ }), ae = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
492
407
  ...T,
493
408
  ...e,
494
- children: [/* @__PURE__ */ (0, p.jsx)("path", { d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" }), /* @__PURE__ */ (0, p.jsx)("circle", {
409
+ children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" }), /* @__PURE__ */ (0, h.jsx)("circle", {
495
410
  cx: "12",
496
411
  cy: "12",
497
412
  r: "3"
498
413
  })]
499
- }), N = (e) => /* @__PURE__ */ (0, p.jsxs)("svg", {
414
+ }), oe = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
500
415
  ...T,
501
416
  ...e,
502
- children: [/* @__PURE__ */ (0, p.jsx)("path", { d: "M6 2v14a2 2 0 0 0 2 2h14" }), /* @__PURE__ */ (0, p.jsx)("path", { d: "M18 22V8a2 2 0 0 0-2-2H2" })]
503
- }), P = (e) => /* @__PURE__ */ (0, p.jsxs)("svg", {
417
+ children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M6 2v14a2 2 0 0 0 2 2h14" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M18 22V8a2 2 0 0 0-2-2H2" })]
418
+ }), se = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
504
419
  ...T,
505
420
  ...e,
506
421
  children: [
507
- /* @__PURE__ */ (0, p.jsx)("rect", {
422
+ /* @__PURE__ */ (0, h.jsx)("rect", {
508
423
  width: "18",
509
424
  height: "18",
510
425
  x: "3",
@@ -512,32 +427,32 @@ var T = {
512
427
  rx: "2",
513
428
  ry: "2"
514
429
  }),
515
- /* @__PURE__ */ (0, p.jsx)("circle", {
430
+ /* @__PURE__ */ (0, h.jsx)("circle", {
516
431
  cx: "9",
517
432
  cy: "9",
518
433
  r: "2"
519
434
  }),
520
- /* @__PURE__ */ (0, p.jsx)("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })
435
+ /* @__PURE__ */ (0, h.jsx)("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })
521
436
  ]
522
- }), F = (e) => /* @__PURE__ */ (0, p.jsx)("svg", {
437
+ }), ce = (e) => /* @__PURE__ */ (0, h.jsx)("svg", {
523
438
  ...T,
524
439
  ...e,
525
- children: /* @__PURE__ */ (0, p.jsx)("rect", {
440
+ children: /* @__PURE__ */ (0, h.jsx)("rect", {
526
441
  width: "18",
527
442
  height: "18",
528
443
  x: "3",
529
444
  y: "3",
530
445
  rx: "2"
531
446
  })
532
- }), I = (e) => /* @__PURE__ */ (0, p.jsxs)("svg", {
447
+ }), k = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
533
448
  ...T,
534
449
  ...e,
535
450
  children: [
536
- /* @__PURE__ */ (0, p.jsx)("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }),
537
- /* @__PURE__ */ (0, p.jsx)("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }),
538
- /* @__PURE__ */ (0, p.jsx)("path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }),
539
- /* @__PURE__ */ (0, p.jsx)("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" }),
540
- /* @__PURE__ */ (0, p.jsx)("rect", {
451
+ /* @__PURE__ */ (0, h.jsx)("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }),
452
+ /* @__PURE__ */ (0, h.jsx)("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }),
453
+ /* @__PURE__ */ (0, h.jsx)("path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }),
454
+ /* @__PURE__ */ (0, h.jsx)("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" }),
455
+ /* @__PURE__ */ (0, h.jsx)("rect", {
541
456
  width: "10",
542
457
  height: "8",
543
458
  x: "7",
@@ -545,12 +460,42 @@ var T = {
545
460
  rx: "1"
546
461
  })
547
462
  ]
548
- }), L = (e) => /* @__PURE__ */ (0, p.jsx)("svg", {
463
+ }), le = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
464
+ ...T,
465
+ ...e,
466
+ children: [
467
+ /* @__PURE__ */ (0, h.jsx)("path", { d: "M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3" }),
468
+ /* @__PURE__ */ (0, h.jsx)("path", { d: "M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3" }),
469
+ /* @__PURE__ */ (0, h.jsx)("path", { d: "M12 20v2" }),
470
+ /* @__PURE__ */ (0, h.jsx)("path", { d: "M12 14v2" }),
471
+ /* @__PURE__ */ (0, h.jsx)("path", { d: "M12 8v2" }),
472
+ /* @__PURE__ */ (0, h.jsx)("path", { d: "M12 2v2" })
473
+ ]
474
+ }), ue = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
475
+ ...T,
476
+ ...e,
477
+ children: [
478
+ /* @__PURE__ */ (0, h.jsx)("path", { d: "M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3" }),
479
+ /* @__PURE__ */ (0, h.jsx)("path", { d: "M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3" }),
480
+ /* @__PURE__ */ (0, h.jsx)("path", { d: "M4 12H2" }),
481
+ /* @__PURE__ */ (0, h.jsx)("path", { d: "M10 12H8" }),
482
+ /* @__PURE__ */ (0, h.jsx)("path", { d: "M16 12h-2" }),
483
+ /* @__PURE__ */ (0, h.jsx)("path", { d: "M22 12h-2" })
484
+ ]
485
+ }), de = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
486
+ ...T,
487
+ ...e,
488
+ children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M21 3v5h-5" })]
489
+ }), fe = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
549
490
  ...T,
550
491
  ...e,
551
- children: /* @__PURE__ */ (0, p.jsx)("path", {
492
+ children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M3 3v5h5" })]
493
+ }), A = (e) => /* @__PURE__ */ (0, h.jsx)("svg", {
494
+ ...T,
495
+ ...e,
496
+ children: /* @__PURE__ */ (0, h.jsx)("path", {
552
497
  d: "M21 12a9 9 0 1 1-6.219-8.56",
553
- children: /* @__PURE__ */ (0, p.jsx)("animateTransform", {
498
+ children: /* @__PURE__ */ (0, h.jsx)("animateTransform", {
554
499
  attributeType: "xml",
555
500
  attributeName: "transform",
556
501
  type: "rotate",
@@ -560,256 +505,327 @@ var T = {
560
505
  repeatCount: "indefinite"
561
506
  })
562
507
  })
563
- }), R = () => {
564
- let e = r(g);
565
- if (!e) throw Error("useImageEditorContext must be used within an ImageEditorProvider");
508
+ }), j = () => {
509
+ let e = n(f);
510
+ if (!e) throw Error("usePixediContext must be used within an PixediProvider");
566
511
  return e;
567
- }, z = t(({ className: e = "", variant: t = "default", children: n, ...r }, i) => /* @__PURE__ */ (0, p.jsx)("button", {
568
- ref: i,
569
- className: `btn ${`btn-${t}`} ${e}`.trim(),
570
- ...r,
512
+ }, M = {
513
+ button: "_button_snd36_1",
514
+ default: "_default_snd36_32",
515
+ outline: "_outline_snd36_39",
516
+ ghost: "_ghost_snd36_47",
517
+ rect: "_rect_snd36_54"
518
+ }, N = ({ className: e = "", variant: t = "default", children: n, ref: r, ...i }) => /* @__PURE__ */ (0, h.jsx)("button", {
519
+ ref: r,
520
+ className: `${M.button} ${M[t]} ${e}`.trim(),
521
+ ...i,
571
522
  children: n
572
- })), B = t(({ className: e = "", active: t = !1, icon: n, label: r, ...i }, a) => /* @__PURE__ */ (0, p.jsxs)("button", {
573
- ref: a,
523
+ }), P = {
524
+ root: "_root_kw2xl_8",
525
+ textRed: "_textRed_kw2xl_73",
526
+ bgRed: "_bgRed_kw2xl_76",
527
+ bgGreen: "_bgGreen_kw2xl_79",
528
+ textGreen: "_textGreen_kw2xl_82",
529
+ mask: "_mask_kw2xl_85",
530
+ semibold: "_semibold_kw2xl_88",
531
+ bold: "_bold_kw2xl_92",
532
+ system: "_system_kw2xl_96",
533
+ wrapper: "_wrapper_kw2xl_105",
534
+ main: "_main_kw2xl_111",
535
+ grid: "_grid_kw2xl_119"
536
+ }, pe = { button: "_button_gf7m5_1" }, me = ({ className: e = "", active: t = !1, icon: n, label: r, ref: i, ...a }) => /* @__PURE__ */ (0, h.jsxs)("button", {
537
+ ref: i,
574
538
  type: "button",
575
539
  "aria-pressed": t,
576
- className: `btn-crop ${e}`.trim(),
577
- ...i,
578
- children: [n, /* @__PURE__ */ (0, p.jsx)("span", {
579
- className: "semibold",
540
+ className: `${pe.button} ${e}`.trim(),
541
+ ...a,
542
+ children: [n, /* @__PURE__ */ (0, h.jsx)("span", {
543
+ className: P.semibold,
580
544
  children: r
581
545
  })]
582
- }));
583
- B.displayName = "ButtonCrop";
584
- //#endregion
585
- //#region src/shared/components/ImageEditor/ui/separator/Separator.tsx
586
- var V = t(({ className: e = "", orientation: t = "horizontal", ...n }, r) => /* @__PURE__ */ (0, p.jsx)("hr", {
546
+ }), he = { separator: "_separator_rqskq_1" }, F = t(({ className: e = "", orientation: t = "horizontal", ...n }, r) => /* @__PURE__ */ (0, h.jsx)("hr", {
587
547
  ref: r,
588
548
  role: "separator",
589
549
  "aria-orientation": t,
590
550
  "data-orientation": t,
591
- className: `separator ${e}`.trim(),
551
+ className: `${he.separator} ${e}`.trim(),
592
552
  ...n
593
553
  }));
594
- V.displayName = "Separator";
595
- //#endregion
596
- //#region src/shared/components/ImageEditor/ui/select/Select.tsx
597
- var te = ({ items: e, value: t, onChange: n, placeholder: r = "Select an option", className: l = "", renderOption: u }) => {
598
- let [d, f] = c(!1), m = s(null), h = s(null), g = s(null), _ = o(() => {
554
+ F.displayName = "Separator";
555
+ var I = {
556
+ wrapper: "_wrapper_12rgt_1",
557
+ trigger: "_trigger_12rgt_6",
558
+ triggerArrow: "_triggerArrow_12rgt_29",
559
+ content: "_content_12rgt_38",
560
+ groupLabel: "_groupLabel_12rgt_68",
561
+ item: "_item_12rgt_75",
562
+ itemLeft: "_itemLeft_12rgt_91",
563
+ itemAddon: "_itemAddon_12rgt_95",
564
+ itemRightContainer: "_itemRightContainer_12rgt_112",
565
+ itemRight: "_itemRight_12rgt_112",
566
+ itemCheck: "_itemCheck_12rgt_121"
567
+ }, ge = ({ items: e, value: t, onChange: n, placeholder: c = "Select an option", className: l = "", renderOption: u }) => {
568
+ let [d, f] = s(!1), p = o(null), m = o(null), g = o(null), _ = a(() => {
599
569
  let t = (e) => e.reduce((e, n) => n.options ? [...e, ...t(n.options.map((e) => ({
600
570
  ...e,
601
571
  fullName: `${n.label} ${e.label}`
602
572
  })))] : [...e, n], []);
603
573
  return t(e);
604
574
  }, [e]).find((e) => e.value === t);
605
- i(() => {
575
+ r(() => {
606
576
  let e = (e) => {
607
- m.current && !m.current.contains(e.target) && f(!1);
577
+ p.current && !e.composedPath().includes(p.current) && f(!1);
608
578
  };
609
579
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
610
- }, []), a(() => {
611
- if (!d || !h.current || !g.current) return;
612
- let e = m.current?.closest(".picedi.main")?.getBoundingClientRect(), t = h.current.getBoundingClientRect(), n = g.current.getBoundingClientRect(), r = (e?.bottom ?? window.innerHeight) - 16, i = t.bottom + n.height + 4, a = "calc(100% + 4px)";
580
+ }, []), i(() => {
581
+ if (!d || !m.current || !g.current) return;
582
+ let e = p.current?.closest(`.${P.main}`)?.getBoundingClientRect(), t = m.current.getBoundingClientRect(), n = g.current.getBoundingClientRect(), r = (e?.bottom ?? window.innerHeight) - 16, i = t.bottom + n.height + 4, a = "calc(100% + 4px)";
613
583
  i > r && (a = `calc(100% + 4px - ${i - r}px)`), g.current.style.top = a;
614
584
  }, [d, e]);
615
585
  let v = (e) => {
616
586
  n(e), f(!1);
617
587
  };
618
- return /* @__PURE__ */ (0, p.jsxs)("div", {
619
- ref: m,
620
- className: `select-wrapper ${l}`.trim(),
588
+ return /* @__PURE__ */ (0, h.jsxs)("div", {
589
+ ref: p,
590
+ className: `${I.wrapper} ${l}`.trim(),
621
591
  "data-state": d ? "open" : "closed",
622
- children: [/* @__PURE__ */ (0, p.jsxs)("button", {
623
- ref: h,
592
+ children: [/* @__PURE__ */ (0, h.jsxs)("button", {
593
+ ref: m,
624
594
  type: "button",
625
- className: "select-trigger",
595
+ className: I.trigger,
626
596
  onClick: () => f(!d),
627
- children: [/* @__PURE__ */ (0, p.jsx)("span", { children: _ ? _.fullName : r }), /* @__PURE__ */ (0, p.jsx)(k, { className: "select-trigger-arrow" })]
628
- }), /* @__PURE__ */ (0, p.jsx)("div", {
597
+ children: [/* @__PURE__ */ (0, h.jsx)("span", { children: _ ? _.fullName : c }), /* @__PURE__ */ (0, h.jsx)(re, { className: I.triggerArrow })]
598
+ }), /* @__PURE__ */ (0, h.jsx)("div", {
629
599
  ref: g,
630
- className: "select-content",
631
- children: e.map((e, n) => e.options ? /* @__PURE__ */ (0, p.jsxs)("div", { children: [/* @__PURE__ */ (0, p.jsx)("div", {
632
- className: "select-group-label semibold",
600
+ className: I.content,
601
+ children: e.map((e, n) => e.options ? /* @__PURE__ */ (0, h.jsxs)("div", { children: [/* @__PURE__ */ (0, h.jsx)("div", {
602
+ className: `${I.groupLabel} ${P.semibold}`,
633
603
  children: e.label
634
- }), e.options.map((e) => /* @__PURE__ */ (0, p.jsxs)("div", {
635
- className: "select-item",
604
+ }), e.options.map((e) => /* @__PURE__ */ (0, h.jsxs)("div", {
605
+ className: I.item,
636
606
  onClick: () => v(e.value),
637
- children: [u ? u(e) : /* @__PURE__ */ (0, p.jsx)("span", {
638
- className: "select-item-left",
607
+ children: [u ? u(e) : /* @__PURE__ */ (0, h.jsx)("span", {
608
+ className: I.itemLeft,
639
609
  children: e.label
640
- }), /* @__PURE__ */ (0, p.jsxs)("div", {
641
- className: "select-item-addon",
610
+ }), /* @__PURE__ */ (0, h.jsxs)("div", {
611
+ className: I.itemAddon,
642
612
  children: [
643
- e.rightLabel && /* @__PURE__ */ (0, p.jsx)("span", { children: e.rightLabel }),
644
- t === e.value && /* @__PURE__ */ (0, p.jsx)(E, { className: "select-item-check" }),
645
- t !== e.value && /* @__PURE__ */ (0, p.jsx)("b", {})
613
+ e.rightLabel && /* @__PURE__ */ (0, h.jsx)("span", { children: e.rightLabel }),
614
+ t === e.value && /* @__PURE__ */ (0, h.jsx)(E, { className: I.itemCheck }),
615
+ t !== e.value && /* @__PURE__ */ (0, h.jsx)("b", {})
646
616
  ]
647
617
  })]
648
- }, e.value))] }, `group-${n}`) : /* @__PURE__ */ (0, p.jsxs)("div", {
649
- className: "select-item",
618
+ }, e.value))] }, `group-${n}`) : /* @__PURE__ */ (0, h.jsxs)("div", {
619
+ className: I.item,
650
620
  onClick: () => v(e.value),
651
- children: [u ? u(e) : /* @__PURE__ */ (0, p.jsxs)("span", {
652
- className: "select-item-left",
653
- children: [e.label, "1"]
654
- }), t === e.value && /* @__PURE__ */ (0, p.jsx)(E, { className: "select-item-check" })]
621
+ children: [u ? u(e) : /* @__PURE__ */ (0, h.jsx)("span", {
622
+ className: I.itemLeft,
623
+ children: e.label
624
+ }), t === e.value && /* @__PURE__ */ (0, h.jsx)(E, { className: I.itemCheck })]
655
625
  }, e.value))
656
626
  })]
657
627
  });
658
- }, ne = t(({ className: e = "", type: t = "text", hideArrows: n = !0, ...r }, i) => /* @__PURE__ */ (0, p.jsx)("input", {
659
- ref: i,
660
- type: t,
661
- className: `input ${t === "number" && n ? "input-number-clean" : ""} ${e}`.trim(),
662
- ...r
663
- }));
664
- ne.displayName = "Input";
665
- //#endregion
666
- //#region src/shared/components/ImageEditor/ui/input-pixel/InputPixel.tsx
667
- var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ */ (0, p.jsxs)("div", {
668
- className: `input-pixel-container ${t}`.trim(),
628
+ }, _e = {
629
+ input: "_input_j55nq_1",
630
+ numberClean: "_numberClean_j55nq_34"
631
+ }, ve = ({ className: e = "", type: t = "text", hideArrows: n = !0, ref: r, ...i }) => {
632
+ let a = t === "number" && n ? _e.numberClean : "";
633
+ return /* @__PURE__ */ (0, h.jsx)("input", {
634
+ ref: r,
635
+ type: t,
636
+ className: `${_e.input} ${a} ${e}`.trim(),
637
+ ...i
638
+ });
639
+ }, ye = {
640
+ container: "_container_14vsv_1",
641
+ legend: "_legend_14vsv_4",
642
+ suffix: "_suffix_14vsv_13"
643
+ }, be = ({ label: e, className: t = "", style: n, ref: r, ...i }) => /* @__PURE__ */ (0, h.jsxs)("div", {
644
+ className: `${ye.container} ${t}`.trim(),
669
645
  style: n,
670
646
  children: [
671
- /* @__PURE__ */ (0, p.jsx)("span", {
672
- className: "input-pixel-legend",
647
+ /* @__PURE__ */ (0, h.jsx)("span", {
648
+ className: ye.legend,
673
649
  children: e
674
650
  }),
675
- /* @__PURE__ */ (0, p.jsx)(ne, {
676
- ref: i,
651
+ /* @__PURE__ */ (0, h.jsx)(ve, {
652
+ ref: r,
677
653
  type: "number",
678
- ...r
654
+ ...i
679
655
  }),
680
- /* @__PURE__ */ (0, p.jsx)("span", {
681
- className: "input-pixel-suffix",
656
+ /* @__PURE__ */ (0, h.jsx)("span", {
657
+ className: ye.suffix,
682
658
  children: "px"
683
659
  })
684
660
  ]
685
- })), re = ({ onBack: e, onSave: t }) => {
686
- let [n, r] = c(!1), { history: i, undo: a, redo: o, resetHistory: s, resetHistoryAfterSave: l, getLastHistoryItem: u } = R(), { base64: d } = u(), f = i.items.length > 1 && !n, m = i.pointer === 0, h = i.pointer === i.items.length - 1, g = i.items.length < 2 || n;
687
- return /* @__PURE__ */ (0, p.jsxs)("div", {
688
- className: "header",
689
- children: [/* @__PURE__ */ (0, p.jsx)(z, {
690
- variant: "ghost",
691
- className: "btn-rect",
692
- onClick: e,
693
- children: /* @__PURE__ */ (0, p.jsx)(O, {})
694
- }), /* @__PURE__ */ (0, p.jsxs)("div", {
695
- className: "header-tools",
696
- children: [
697
- f && /* @__PURE__ */ (0, p.jsxs)("div", {
698
- className: "header-history",
699
- children: [
700
- /* @__PURE__ */ (0, p.jsx)(z, {
701
- variant: "outline",
702
- disabled: m,
703
- className: "btn-rect",
704
- onClick: a,
705
- children: /* @__PURE__ */ (0, p.jsx)(A, {})
706
- }),
707
- /* @__PURE__ */ (0, p.jsxs)("div", {
708
- className: "header-history-text",
709
- children: [
710
- i.pointer + 1,
711
- "/",
712
- i.items.length
713
- ]
714
- }),
715
- /* @__PURE__ */ (0, p.jsx)(z, {
716
- variant: "outline",
717
- disabled: h,
718
- className: "btn-rect",
719
- onClick: o,
720
- children: /* @__PURE__ */ (0, p.jsx)(j, {})
721
- })
722
- ]
723
- }),
724
- /* @__PURE__ */ (0, p.jsx)(z, {
725
- variant: "outline",
726
- disabled: n,
727
- onClick: s,
728
- children: "Reset"
729
- }),
730
- /* @__PURE__ */ (0, p.jsxs)(z, {
731
- disabled: g,
732
- onClick: async () => {
733
- if (d) {
734
- r(!0);
735
- try {
736
- await t(d), l();
737
- } finally {
738
- r(!1);
739
- }
740
- }
741
- },
742
- children: [n ? /* @__PURE__ */ (0, p.jsx)(L, {}) : /* @__PURE__ */ (0, p.jsx)(E, {}), "Save"]
743
- })
744
- ]
661
+ }), xe = {
662
+ group: "_group_qpue1_1",
663
+ save: "_save_qpue1_6",
664
+ close: "_close_qpue1_13"
665
+ }, L = ({ onSave: e, onClose: t, saving: n = !1, disabled: r = !1 }) => /* @__PURE__ */ (0, h.jsxs)("div", {
666
+ className: xe.group,
667
+ children: [/* @__PURE__ */ (0, h.jsx)(N, {
668
+ variant: "outline",
669
+ className: xe.save,
670
+ disabled: r || n,
671
+ onClick: e,
672
+ children: n ? /* @__PURE__ */ (0, h.jsx)(A, {}) : /* @__PURE__ */ (0, h.jsx)(E, {})
673
+ }), /* @__PURE__ */ (0, h.jsx)(N, {
674
+ variant: "outline",
675
+ className: xe.close,
676
+ disabled: n,
677
+ onClick: t,
678
+ children: /* @__PURE__ */ (0, h.jsx)(te, {})
679
+ })]
680
+ }), R = {
681
+ sliderContainer: "_sliderContainer_1ntcm_1",
682
+ disabled: "_disabled_1ntcm_12",
683
+ sliderTrack: "_sliderTrack_1ntcm_18",
684
+ sliderRange: "_sliderRange_1ntcm_30",
685
+ sliderThumb: "_sliderThumb_1ntcm_38",
686
+ hiddenInput: "_hiddenInput_1ntcm_53"
687
+ }, Se = ({ min: e, max: t, value: n, step: r = 1, disabled: i = !1, onChange: o, className: s, ...c }) => {
688
+ let l = a(() => {
689
+ let r = t - e;
690
+ return r <= 0 ? 0 : (n - e) / r * 100;
691
+ }, [
692
+ n,
693
+ e,
694
+ t
695
+ ]);
696
+ return /* @__PURE__ */ (0, h.jsxs)("div", {
697
+ className: `${R.sliderContainer} ${i ? R.disabled : ""} ${s || ""}`,
698
+ style: { "--slider-progress": `${l}%` },
699
+ children: [/* @__PURE__ */ (0, h.jsxs)("div", {
700
+ className: R.sliderTrack,
701
+ children: [/* @__PURE__ */ (0, h.jsx)("div", { className: R.sliderRange }), /* @__PURE__ */ (0, h.jsx)("div", {
702
+ className: R.sliderThumb,
703
+ style: { left: `${l}%` }
704
+ })]
705
+ }), /* @__PURE__ */ (0, h.jsx)("input", {
706
+ type: "range",
707
+ min: e,
708
+ max: t,
709
+ step: r,
710
+ value: n,
711
+ disabled: i,
712
+ onChange: (e) => {
713
+ i || o(Number(e.target.value));
714
+ },
715
+ className: R.hiddenInput,
716
+ ...c
745
717
  })]
746
718
  });
747
- }, U = 32, W = (e) => ({
748
- x: e.offsetLeft,
749
- y: e.offsetTop,
750
- w: e.offsetWidth,
751
- h: e.offsetHeight
752
- }), ie = (e, t, n, r, i, a, o, s) => {
753
- let { x: c } = o, { y: l, w: u, h: d } = o;
754
- if (e) u += r - n, u + c > i && (u = i - c), u < U && (u = U);
755
- else {
756
- let e = r - n, o = Math.round(e / t);
757
- if (u += e, d += o, l -= o / 2, l < 0 || d + l > a || u + c > i || u < U || d < U) return W(s);
758
- }
759
- return {
760
- x: c,
761
- y: l,
762
- w: u,
763
- h: d
764
- };
765
- }, ae = (e, t, n, r, i, a, o, s) => {
766
- let { x: c, y: l, w: u, h: d } = o;
767
- if (e) {
768
- let e = i - o.w - o.x;
769
- c += r - n, c < 0 && (c = 0), u = i - c - e, u < U && (u = U, c = i - e - U);
770
- } else {
771
- let e = r - n, i = Math.round(e / t);
772
- if (u -= e, d -= i, c += e, l += i / 2, l < 0 || c < 0 || d + l > a || u < U || d < U) return W(s);
773
- }
774
- return {
775
- x: c,
776
- y: l,
777
- w: u,
778
- h: d
779
- };
780
- }, oe = (e, t, n, r, i, a, o, s) => {
781
- let { x: c, y: l, w: u, h: d } = o, f = a - d - l;
782
- if (e) l += r - n, l < 0 && (l = 0), d = a - l - f, d < U && (d = U, l = a - f - U);
783
- else {
784
- let e = r - n, a = Math.round(e * t);
785
- if (d -= e, u -= a, c += a / 2, l += e, l < 0 || c < 0 || u + c > i || u < U || d < U) return W(s);
786
- }
787
- return {
788
- x: c,
789
- y: l,
790
- w: u,
791
- h: d
792
- };
793
- }, se = (e, t, n, r, i, a, o, s) => {
794
- let { y: c } = o, { x: l, w: u, h: d } = o;
795
- if (e) d += r - n, d + c > a && (d = a - c), d < U && (d = U);
796
- else {
797
- let e = r - n, o = Math.round(e * t);
798
- if (d += e, u += o, l -= o / 2, d + c > a || l < 0 || u + l > i || u < U || d < U) return W(s);
719
+ }, Ce = 1920, we = .85, Te = [
720
+ {
721
+ label: "Facebook",
722
+ value: "facebook",
723
+ options: [
724
+ {
725
+ value: "facebook-post",
726
+ label: "Post",
727
+ w: 1200,
728
+ h: 630,
729
+ rightLabel: "1200 x 630"
730
+ },
731
+ {
732
+ value: "facebook-cover",
733
+ label: "Cover",
734
+ w: 851,
735
+ h: 315,
736
+ rightLabel: "851 x 315"
737
+ },
738
+ {
739
+ value: "facebook-profile",
740
+ label: "Profile",
741
+ w: 170,
742
+ h: 170,
743
+ rightLabel: "170 x 170"
744
+ },
745
+ {
746
+ value: "facebook-story",
747
+ label: "Story",
748
+ w: 1080,
749
+ h: 1920,
750
+ rightLabel: "1080 x 1920"
751
+ }
752
+ ]
753
+ },
754
+ {
755
+ label: "Instagram",
756
+ value: "instagram",
757
+ options: [
758
+ {
759
+ value: "instagram-landscape",
760
+ label: "Landscape",
761
+ w: 1080,
762
+ h: 566,
763
+ rightLabel: "1080 x 566"
764
+ },
765
+ {
766
+ value: "instagram-portait",
767
+ label: "Portait",
768
+ w: 1080,
769
+ h: 1350,
770
+ rightLabel: "1080 x 1350"
771
+ },
772
+ {
773
+ value: "instagram-square",
774
+ label: "Square",
775
+ w: 1080,
776
+ h: 1080,
777
+ rightLabel: "1080 x 1080"
778
+ },
779
+ {
780
+ value: "instagram-story",
781
+ label: "Story",
782
+ w: 1080,
783
+ h: 1920,
784
+ rightLabel: "1080 x 1920"
785
+ },
786
+ {
787
+ value: "instagram-thumbnail",
788
+ label: "Thumbnail",
789
+ w: 161,
790
+ h: 161,
791
+ rightLabel: "161 x 161"
792
+ }
793
+ ]
794
+ },
795
+ {
796
+ label: "LinkedIn",
797
+ value: "linkedin",
798
+ options: [
799
+ {
800
+ value: "linkedin-blog-post",
801
+ label: "Blog Post",
802
+ w: 1200,
803
+ h: 627,
804
+ rightLabel: "1200 x 627"
805
+ },
806
+ {
807
+ value: "linkedin-cover",
808
+ label: "Cover",
809
+ w: 1128,
810
+ h: 191,
811
+ rightLabel: "1128 x 191"
812
+ },
813
+ {
814
+ value: "linkedin-profile",
815
+ label: "Profile",
816
+ w: 400,
817
+ h: 400,
818
+ rightLabel: "400 x 400"
819
+ }
820
+ ]
799
821
  }
800
- return {
801
- x: l,
802
- y: c,
803
- w: u,
804
- h: d
805
- };
806
- }, ce = (e, t, n, r, i, a, o, s, c, l) => {
822
+ ], z = 32, Ee = (e, t, n, r, i, a, o, s, c, l) => {
807
823
  let { x: u, y: d, w: f, h: p } = c;
808
824
  if (e) {
809
825
  let e = o - c.w - c.x;
810
- u += i - n, u < 0 && (u = 0), f = o - u - e, f < U && (f = U, u = o - e - U);
826
+ u += i - n, u < 0 && (u = 0), f = o - u - e, f < z && (f = z, u = o - e - z);
811
827
  let t = s - p - d;
812
- d += a - r, d < 0 && (d = 0), p = s - d - t, p < U && (p = U, d = s - t - U);
828
+ d += a - r, d < 0 && (d = 0), p = s - d - t, p < z && (p = z, d = s - t - z);
813
829
  } else {
814
830
  if (t >= 1) {
815
831
  let e = i - n, r = Math.round(e / t);
@@ -818,7 +834,7 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
818
834
  let e = a - r, n = Math.round(e * t);
819
835
  f -= n, p -= e, u += n, d += e;
820
836
  }
821
- if (u < 0 || d < 0 || f < U || p < U) return W(l);
837
+ if (u < 0 || d < 0 || f < z || p < z) return l;
822
838
  }
823
839
  return {
824
840
  x: u,
@@ -826,12 +842,12 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
826
842
  w: f,
827
843
  h: p
828
844
  };
829
- }, le = (e, t, n, r, i, a, o, s, c, l) => {
845
+ }, De = (e, t, n, r, i, a, o, s, c, l) => {
830
846
  let { x: u } = c, { y: d, w: f, h: p } = c;
831
847
  if (e) {
832
- f += i - n, f + u > o && (f = o - u), f < U && (f = U);
848
+ f += i - n, f + u > o && (f = o - u), f < z && (f = z);
833
849
  let e = s - p - d;
834
- d += a - r, d < 0 && (d = 0), p = s - d - e, p < U && (p = U, d = s - e - U);
850
+ d += a - r, d < 0 && (d = 0), p = s - d - e, p < z && (p = z, d = s - e - z);
835
851
  } else {
836
852
  if (t > 1) {
837
853
  let e = i - n, r = Math.round(e / t);
@@ -840,7 +856,7 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
840
856
  let e = a - r, n = Math.round(e * t);
841
857
  f -= n, p -= e, d += e;
842
858
  }
843
- if (f + u > o || d < 0 || f < U || p < U) return W(l);
859
+ if (f + u > o || d < 0 || f < z || p < z) return l;
844
860
  }
845
861
  return {
846
862
  x: u,
@@ -848,12 +864,12 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
848
864
  w: f,
849
865
  h: p
850
866
  };
851
- }, ue = (e, t, n, r, i, a, o, s, c, l) => {
867
+ }, Oe = (e, t, n, r, i, a, o, s, c, l) => {
852
868
  let { y: u } = c, { x: d, w: f, h: p } = c;
853
869
  if (e) {
854
- p += a - r, p + u > s && (p = s - u), p < U && (p = U);
870
+ p += a - r, p + u > s && (p = s - u), p < z && (p = z);
855
871
  let e = o - c.w - c.x;
856
- d += i - n, d < 0 && (d = 0), f = o - d - e, f < U && (f = U, d = o - e - U);
872
+ d += i - n, d < 0 && (d = 0), f = o - d - e, f < z && (f = z, d = o - e - z);
857
873
  } else {
858
874
  if (t >= 1) {
859
875
  let e = i - n, r = Math.round(e / t);
@@ -862,7 +878,7 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
862
878
  let e = a - r, n = Math.round(e * t);
863
879
  f += n, p += e, d -= n;
864
880
  }
865
- if (p + u > s || d < 0 || f < U || p < U) return W(l);
881
+ if (p + u > s || d < 0 || f < z || p < z) return l;
866
882
  }
867
883
  return {
868
884
  x: d,
@@ -870,9 +886,9 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
870
886
  w: f,
871
887
  h: p
872
888
  };
873
- }, de = (e, t, n, r, i, a, o, s, c, l) => {
889
+ }, ke = (e, t, n, r, i, a, o, s, c, l) => {
874
890
  let { x: u, y: d } = c, { w: f, h: p } = c;
875
- if (e) f += i - n, f + u > o && (f = o - u), f < U && (f = U), p += a - r, p + d > s && (p = s - d), p < U && (p = U);
891
+ if (e) f += i - n, f + u > o && (f = o - u), f < z && (f = z), p += a - r, p + d > s && (p = s - d), p < z && (p = z);
876
892
  else {
877
893
  if (t >= 1) {
878
894
  let e = i - n, r = Math.round(e / t);
@@ -881,7 +897,7 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
881
897
  let e = a - r, n = Math.round(e * t);
882
898
  f += n, p += e;
883
899
  }
884
- if (p + d > s || f + u > o || f < U || p < U) return W(l);
900
+ if (p + d > s || f + u > o || f < z || p < z) return l;
885
901
  }
886
902
  return {
887
903
  x: u,
@@ -889,474 +905,857 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
889
905
  w: f,
890
906
  h: p
891
907
  };
892
- }, fe = (e, t, n, r, i, a, o, s, c, l, u) => e === "r" ? ie(t, n, r, a, s, c, l, u) : e === "l" ? ae(t, n, r, a, s, c, l, u) : e === "t" ? oe(t, n, i, o, s, c, l, u) : e === "b" ? se(t, n, i, o, s, c, l, u) : e === "tl" ? ce(t, n, r, i, a, o, s, c, l, u) : e === "tr" ? le(t, n, r, i, a, o, s, c, l, u) : e === "bl" ? ue(t, n, r, i, a, o, s, c, l, u) : e === "br" ? de(t, n, r, i, a, o, s, c, l, u) : {
908
+ }, Ae = (e, t, n, r, i, a, o, s, c, l, u) => e === "tl" ? Ee(t, n, r, i, a, o, s, c, l, u) : e === "tr" ? De(t, n, r, i, a, o, s, c, l, u) : e === "bl" ? Oe(t, n, r, i, a, o, s, c, l, u) : e === "br" ? ke(t, n, r, i, a, o, s, c, l, u) : {
893
909
  x: 0,
894
910
  y: 0,
895
911
  w: 0,
896
912
  h: 0
897
- }, G = (e, t, n) => {
898
- let r = .1, i = t / n, a = 0, o = 0;
913
+ }, je = (e, t, n) => {
914
+ let r = .12, i = t / n, a = 0, o = 0;
899
915
  e === 1 && (a = (i > 1 ? n : t) * (1 - r * 2), o = a), e > 1 && (i > e ? (o = n * (1 - r * 2), a = o * e) : (a = t * (1 - r * 2), o = a / e)), e < 1 && (i > e ? (o = n * (1 - r * 2), a = o * e) : (a = t * (1 - r * 2), o = a / e));
900
916
  let s = a / t * 100, c = o / n * 100;
901
917
  return {
902
918
  x: (t - a) / 2 / t * 100,
903
919
  y: (n - o) / 2 / n * 100,
904
920
  w: s,
905
- h: c,
906
- xPx: Math.round((t - a) / 2),
907
- yPx: Math.round((n - o) / 2),
908
- wPx: a,
909
- hPx: o
921
+ h: c
922
+ };
923
+ }, Me = (e, t, n, r) => {
924
+ let i = e.w / 100 * n, a = e.h / 100 * r;
925
+ t >= 1 ? a = i / t : i = a * t;
926
+ let o = i / n * 100, s = a / r * 100, c = Math.max(o / (100 - e.x), s / (100 - e.y), 1);
927
+ return o /= c, s /= c, {
928
+ ...e,
929
+ w: o,
930
+ h: s
910
931
  };
911
- }, pe = () => {
912
- let { getCurrentAction: e, getLastHistoryItem: t } = R(), n = e(), r = S(), i = s(null), a = s(null), { handleCropStart: o } = be({
913
- imgRef: i,
914
- cropRef: a
932
+ }, B = (e) => Math.abs(Math.round(e / 90)) % 2 == 1, Ne = (e, t, n, r) => B(n) === B(r) ? {
933
+ width: e,
934
+ height: t
935
+ } : {
936
+ width: t,
937
+ height: e
938
+ }, Pe = async (e) => {
939
+ let { width: t, height: n } = e, r = Math.min(1, Ce / Math.max(t, n)), i = Math.round(t * r), a = Math.round(n * r), o = new OffscreenCanvas(i, a), s = o.getContext("2d");
940
+ if (!s) throw Error("Failed to get 2D context for preview canvas");
941
+ return s.drawImage(e, 0, 0, i, a), o.convertToBlob({
942
+ type: "image/webp",
943
+ quality: we
915
944
  });
916
- if (!n || n.name !== "crop") return null;
917
- let { width: c, height: l, base64: u } = t(), { x: d, y: f, w: m, h } = G(n.args.ratio, c, l);
918
- return /* @__PURE__ */ (0, p.jsxs)(p.Fragment, { children: [/* @__PURE__ */ (0, p.jsx)("img", {
919
- ref: i,
920
- src: u,
921
- alt: "Image",
922
- className: "crop-image",
923
- style: { clipPath: `xywh(${d}% ${f}% ${m}% ${h}%)` }
924
- }), /* @__PURE__ */ (0, p.jsxs)("div", {
925
- ref: a,
926
- className: "crop-box",
927
- style: {
928
- width: `${m}%`,
929
- height: `${h}%`,
930
- top: `${f}%`,
931
- left: `${d}%`
945
+ };
946
+ function Fe(e) {
947
+ let t = new OffscreenCanvas(e.width, e.height), n = t.getContext("2d");
948
+ if (!n) throw Error("Failed to create 2D context for canvas.");
949
+ n.drawImage(e, 0, 0);
950
+ try {
951
+ let e = n.getImageData(0, 0, t.width, t.height).data;
952
+ for (let t = 3; t < e.length; t += 4) if (e[t] < 255) return !0;
953
+ return !1;
954
+ } catch (e) {
955
+ throw Error(`Error reading pixels: ${e}`, { cause: e });
956
+ }
957
+ }
958
+ //#endregion
959
+ //#region src/shared/components/Pixedi/utils/imageProcessor.ts
960
+ var Ie = (e) => new Promise((t, n) => {
961
+ let r = new FileReader();
962
+ r.onloadend = () => {
963
+ let e = r.result;
964
+ typeof e == "string" ? t(e) : n(/* @__PURE__ */ Error("Failed to read blob as base64"));
965
+ }, r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("FileReader error")), r.readAsDataURL(e);
966
+ });
967
+ async function Le(e) {
968
+ let t = await createImageBitmap(e), n = e.type || "image/png", r = n === "image/gif" ? "image/png" : n, i = document.createElement("canvas"), a = i.getContext("2d", { alpha: !0 });
969
+ i.width = t.width, i.height = t.height, a?.drawImage(t, 0, 0), t.close();
970
+ let o = () => {
971
+ let e = document.createElement("canvas");
972
+ return e.width = i.width, e.height = i.height, e.getContext("2d", { alpha: !0 })?.drawImage(i, 0, 0), e;
973
+ };
974
+ return {
975
+ crop: (e, t, n, r) => {
976
+ if (!a) return;
977
+ let s = o();
978
+ i.width = n, i.height = r, a.clearRect(0, 0, n, r), a.drawImage(s, e, t, n, r, 0, 0, n, r);
932
979
  },
933
- children: [/* @__PURE__ */ (0, p.jsx)(ge, {}), r ? /* @__PURE__ */ (0, p.jsx)(xe, { onMouseDown: o }) : /* @__PURE__ */ (0, p.jsxs)(p.Fragment, { children: [/* @__PURE__ */ (0, p.jsx)(he, { onMouseDown: o }), /* @__PURE__ */ (0, p.jsx)(_e, { onMouseDown: o })] })]
934
- })] });
935
- }, K = new EventTarget(), q = (e) => {
936
- let t = new CustomEvent("crop-update", { detail: e });
937
- K.dispatchEvent(t);
938
- }, me = () => {
939
- let { setCurrentAction: e, getCurrentAction: t, getLastHistoryItem: n, addToHistory: r, setSidebar: a } = R(), { crop: o, resize: l } = b(), [u, d] = c(!1), f = t(), { base64: m, width: h, height: g } = n(), _ = s(null), v = s(null), y = s(null), x = s(null), S = s(null);
940
- return i(() => {
941
- if (f?.name !== "crop") return;
942
- let { x: e, y: t, w: n, h: r } = G(f.args.ratio, h, g), i = Math.round(e / 100 * h), a = Math.round(t / 100 * g), o = Math.round(n / 100 * h), s = Math.round(r / 100 * g);
943
- _.current && (_.current.textContent = i.toString()), v.current && (v.current.textContent = a.toString()), y.current && (y.current.textContent = o.toString()), x.current && (x.current.textContent = s.toString()), S.current = {
944
- x: i,
945
- y: a,
946
- w: o,
947
- h: s
948
- };
949
- let c = (e) => {
950
- let t = e, { x: n, y: r, w: i, h: a } = t.detail;
951
- S.current = t.detail, _.current && (_.current.textContent = n.toString()), v.current && (v.current.textContent = r.toString()), y.current && (y.current.textContent = i.toString()), x.current && (x.current.textContent = a.toString());
952
- };
953
- return K.addEventListener("crop-update", c), () => {
954
- K.removeEventListener("crop-update", c);
955
- };
956
- }, [
957
- f,
958
- h,
959
- g
960
- ]), /* @__PURE__ */ (0, p.jsxs)("div", {
961
- className: "crop-tools",
962
- children: [
963
- /* @__PURE__ */ (0, p.jsxs)("div", {
964
- className: "crop-tools-info",
965
- children: [/* @__PURE__ */ (0, p.jsx)("div", {
966
- className: "crop-tools-info-label",
967
- children: "left"
968
- }), /* @__PURE__ */ (0, p.jsx)("div", {
969
- className: "crop-tools-info-value semibold",
970
- ref: _
971
- })]
972
- }),
973
- /* @__PURE__ */ (0, p.jsxs)("div", {
974
- className: "crop-tools-info",
975
- children: [/* @__PURE__ */ (0, p.jsx)("div", {
976
- className: "crop-tools-info-label",
977
- children: "top"
978
- }), /* @__PURE__ */ (0, p.jsx)("div", {
979
- className: "crop-tools-info-value semibold",
980
- ref: v
981
- })]
982
- }),
983
- /* @__PURE__ */ (0, p.jsxs)("div", {
984
- className: "crop-tools-info",
985
- children: [/* @__PURE__ */ (0, p.jsx)("div", {
986
- className: "crop-tools-info-label",
987
- children: "width"
988
- }), /* @__PURE__ */ (0, p.jsx)("div", {
989
- className: "crop-tools-info-value semibold",
990
- ref: y
991
- })]
992
- }),
993
- /* @__PURE__ */ (0, p.jsxs)("div", {
994
- className: "crop-tools-info",
995
- children: [/* @__PURE__ */ (0, p.jsx)("div", {
996
- className: "crop-tools-info-label",
997
- children: "height"
998
- }), /* @__PURE__ */ (0, p.jsx)("div", {
999
- className: "crop-tools-info-value semibold",
1000
- ref: x
1001
- })]
1002
- }),
1003
- /* @__PURE__ */ (0, p.jsx)(V, { orientation: "vertical" }),
1004
- /* @__PURE__ */ (0, p.jsx)(z, {
1005
- variant: "ghost",
1006
- className: "text-green",
1007
- style: {
1008
- height: "36px",
1009
- width: "36px"
1010
- },
1011
- disabled: u,
1012
- onClick: async () => {
1013
- if (!(!f || f.name !== "crop")) try {
1014
- if (d(!0), !S.current) return;
1015
- let { x: e, y: t, w: n, h: i } = S.current, { preset: s } = f.args, c = await o(m, e, t, n, i);
1016
- if (s) {
1017
- let { w: e, h: t } = s;
1018
- c = await l(c, e, t);
1019
- }
1020
- r({
1021
- name: "Crop",
1022
- base64: c,
1023
- width: s ? s.w : S.current.w,
1024
- height: s ? s.h : S.current.h
1025
- }), a(!0);
1026
- } catch (e) {
1027
- console.error("Failed to process image:", e);
1028
- } finally {
1029
- d(!1);
1030
- }
1031
- },
1032
- children: u ? /* @__PURE__ */ (0, p.jsx)(L, {}) : /* @__PURE__ */ (0, p.jsx)(E, {})
1033
- }),
1034
- /* @__PURE__ */ (0, p.jsx)(V, { orientation: "vertical" }),
1035
- /* @__PURE__ */ (0, p.jsx)(z, {
1036
- variant: "ghost",
1037
- style: {
1038
- height: "36px",
1039
- width: "36px"
1040
- },
1041
- disabled: u,
1042
- onClick: () => {
1043
- e(null), a(!0);
980
+ flip: (e, t) => {
981
+ if (!a) return;
982
+ let n = o();
983
+ a.clearRect(0, 0, i.width, i.height), a.save(), a.translate(e ? i.width : 0, t ? i.height : 0), a.scale(e ? -1 : 1, t ? -1 : 1), a.drawImage(n, 0, 0), a.restore();
984
+ },
985
+ rotate: (e) => {
986
+ if (!a) return;
987
+ let t = o(), n = e * Math.PI / 180, r = Math.abs(Math.sin(n)), s = Math.abs(Math.cos(n));
988
+ i.width = Math.round(t.width * s + t.height * r), i.height = Math.round(t.width * r + t.height * s), a.clearRect(0, 0, i.width, i.height), a.save(), a.translate(i.width / 2, i.height / 2), a.rotate(n), a.drawImage(t, -t.width / 2, -t.height / 2), a.restore();
989
+ },
990
+ resize: (e, t) => {
991
+ if (!a) return;
992
+ let n = o();
993
+ i.width = e, i.height = t, a.clearRect(0, 0, e, t), a.drawImage(n, 0, 0, e, t);
994
+ },
995
+ get: async (e) => {
996
+ let { quality: t = .85, saveAsWEBP: n = !1 } = e, a = n ? "image/webp" : r, o = await new Promise((e, o) => {
997
+ r === "image/jpeg" || r === "image/webp" || n ? i.toBlob((t) => {
998
+ t ? e(t) : o(/* @__PURE__ */ Error(`Failed to encode image as ${a}`));
999
+ }, a, t) : i.toBlob((t) => {
1000
+ t ? e(t) : o(/* @__PURE__ */ Error("Failed to encode image as image/png"));
1001
+ }, "image/png");
1002
+ }), s = await createImageBitmap(o), c = await Pe(s), { width: l, height: u } = s, d = Fe(s);
1003
+ return s.close(), {
1004
+ newBlob: o,
1005
+ previewBlob: c,
1006
+ mimeType: a,
1007
+ width: l,
1008
+ height: u,
1009
+ isAlpha: d
1010
+ };
1011
+ }
1012
+ };
1013
+ }
1014
+ //#endregion
1015
+ //#region src/shared/components/Pixedi/utils/preview.ts
1016
+ var V = (e, t, n) => Math.max(t, Math.min(n, e)), Re = (e, t) => [[e[0][0] * t[0][0] + e[0][1] * t[1][0], e[0][0] * t[0][1] + e[0][1] * t[1][1]], [e[1][0] * t[0][0] + e[1][1] * t[1][0], e[1][0] * t[0][1] + e[1][1] * t[1][1]]], ze = (e) => (Math.round(e / 90) % 4 + 4) % 4 * 90, Be = (e) => {
1017
+ switch (ze(e)) {
1018
+ case 90: return [[0, -1], [1, 0]];
1019
+ case 180: return [[-1, 0], [0, -1]];
1020
+ case 270: return [[0, 1], [-1, 0]];
1021
+ default: return [[1, 0], [0, 1]];
1022
+ }
1023
+ }, Ve = (e, t) => [[e ? -1 : 1, 0], [0, t ? -1 : 1]], He = (e, t, n) => Re(Ve(t, n), Be(-e)), Ue = (e) => [+(e[0][0] < 0 || e[0][1] < 0), +(e[1][0] < 0 || e[1][1] < 0)], H = (e, t, n) => {
1024
+ let r = Ue(e);
1025
+ return [e[0][0] * t + e[0][1] * n + r[0], e[1][0] * t + e[1][1] * n + r[1]];
1026
+ }, We = (e) => {
1027
+ let t = 1, n = 1, r = {
1028
+ x: 0,
1029
+ y: 0,
1030
+ w: 1,
1031
+ h: 1
1032
+ }, i = 0, a = !1, o = !1;
1033
+ for (let s = 0; s < e.length; s++) {
1034
+ let c = e[s];
1035
+ if (c.action.name === "initial") t = c.width, n = c.height, r = {
1036
+ x: 0,
1037
+ y: 0,
1038
+ w: 1,
1039
+ h: 1
1040
+ }, i = 0, a = !1, o = !1;
1041
+ else if (c.action.name === "crop") {
1042
+ let e = (c.action.args.x ?? 0) / 100, t = (c.action.args.y ?? 0) / 100, n = (c.action.args.w ?? 100) / 100, s = (c.action.args.h ?? 100) / 100, l = He(i, a, o), u = [
1043
+ H(l, e, t),
1044
+ H(l, e + n, t),
1045
+ H(l, e, t + s),
1046
+ H(l, e + n, t + s)
1047
+ ], d = Math.min(...u.map((e) => e[0])), f = Math.max(...u.map((e) => e[0])), p = Math.min(...u.map((e) => e[1])), m = Math.max(...u.map((e) => e[1]));
1048
+ r = {
1049
+ x: r.x + d * r.w,
1050
+ y: r.y + p * r.h,
1051
+ w: r.w * (f - d),
1052
+ h: r.h * (m - p)
1053
+ };
1054
+ } else if (c.action.name === "flip") {
1055
+ let e = B(i), t = e ? c.action.args.vertical : c.action.args.horizontal, n = e ? c.action.args.horizontal : c.action.args.vertical;
1056
+ t && (a = !a), n && (o = !o);
1057
+ } else c.action.name === "rotate" && (i = c.action.args.degrees);
1058
+ }
1059
+ let s = r.w * t, c = r.h * n, l = B(i), u = l ? c : s, d = l ? s : c, f = e.at(-1)?.width || 0, p = e.at(-1)?.height || 0;
1060
+ return {
1061
+ box: r,
1062
+ boxWidth: s,
1063
+ boxHeight: c,
1064
+ newWidth: f,
1065
+ newHeight: p,
1066
+ initWidth: t,
1067
+ initHeight: n,
1068
+ viewWidth: u,
1069
+ viewHeight: d,
1070
+ rotation: i,
1071
+ flipH: a,
1072
+ flipV: o
1073
+ };
1074
+ }, Ge = (e) => {
1075
+ let { box: t, flipH: n, flipV: r, rotation: i, newWidth: a, newHeight: o, initWidth: s, initHeight: c, viewWidth: l, viewHeight: u } = We(e), d = V(t.x, 0, 1), f = V(t.y, 0, 1), p = {
1076
+ x: d,
1077
+ y: f,
1078
+ w: V(t.w, 0, 1 - d),
1079
+ h: V(t.h, 0, 1 - f)
1080
+ }, m = ze(i);
1081
+ return {
1082
+ ...p.x === 0 && p.y === 0 && p.w === 1 && p.h === 1 ? {} : { crop: {
1083
+ x: Math.round(s * t.x),
1084
+ y: Math.round(c * t.y),
1085
+ w: Math.round(s * t.w),
1086
+ h: Math.round(c * t.h)
1087
+ } },
1088
+ ...m === 0 ? {} : { rotate: { degrees: m } },
1089
+ ...n || r ? { flip: {
1090
+ horizontal: n,
1091
+ vertical: r
1092
+ } } : {},
1093
+ ...Math.round(l) !== a || Math.round(u) !== o ? { resize: {
1094
+ width: a,
1095
+ height: o
1096
+ } } : {}
1097
+ };
1098
+ }, Ke = (e) => {
1099
+ let [t, n] = s(!1), { setImage: r, settings: i, history: a, originalBlob: o, setCurrentAction: c, resetHistory: l } = j();
1100
+ return {
1101
+ save: async () => {
1102
+ if (!o) return;
1103
+ n(!0);
1104
+ let t = Ge(a.items.slice(0, a.pointer + 1));
1105
+ try {
1106
+ let n = await Le(o);
1107
+ t.crop && n.crop(t.crop.x, t.crop.y, t.crop.w, t.crop.h), t.flip && n.flip(t.flip.horizontal, t.flip.vertical), t.rotate && n.rotate(t.rotate.degrees), t.resize && n.resize(t.resize.width, t.resize.height);
1108
+ let { newBlob: a, previewBlob: s, mimeType: c, width: l, height: u, isAlpha: d } = await n.get(i), f = "";
1109
+ i.exportAs === "base64" && (f = await Ie(a)), await e(f || a), r({
1110
+ newBlob: a,
1111
+ previewBlob: s,
1112
+ mimeType: c,
1113
+ width: l,
1114
+ height: u,
1115
+ isAlpha: d
1116
+ });
1117
+ } catch (e) {
1118
+ throw Error(`Error saving image: ${e}`, { cause: e });
1119
+ } finally {
1120
+ n(!1);
1121
+ }
1122
+ },
1123
+ reset: () => {
1124
+ c(null), l();
1125
+ },
1126
+ isSaving: t
1127
+ };
1128
+ }, U = {
1129
+ header: "_header_msw8l_1",
1130
+ tools: "_tools_msw8l_11",
1131
+ history: "_history_msw8l_15",
1132
+ historyText: "_historyText_msw8l_20"
1133
+ }, qe = ({ onBack: e, onSave: t }) => {
1134
+ let { save: n, reset: r, isSaving: i } = Ke(t), { history: a, undo: o, redo: s } = j(), c = a.items.length > 1 && !i, l = a.pointer === 0, u = a.pointer === a.items.length - 1, d = a.items.length < 2 || i, f = d || a.pointer === 0;
1135
+ return /* @__PURE__ */ (0, h.jsxs)("div", {
1136
+ className: U.header,
1137
+ children: [/* @__PURE__ */ (0, h.jsx)(N, {
1138
+ variant: "ghost",
1139
+ className: M.rect,
1140
+ onClick: e,
1141
+ children: /* @__PURE__ */ (0, h.jsx)(D, {})
1142
+ }), /* @__PURE__ */ (0, h.jsxs)("div", {
1143
+ className: U.tools,
1144
+ children: [
1145
+ c && /* @__PURE__ */ (0, h.jsxs)("div", {
1146
+ className: U.history,
1147
+ children: [
1148
+ /* @__PURE__ */ (0, h.jsx)(N, {
1149
+ variant: "outline",
1150
+ disabled: l,
1151
+ className: M.rect,
1152
+ onClick: o,
1153
+ children: /* @__PURE__ */ (0, h.jsx)(ie, {})
1154
+ }),
1155
+ /* @__PURE__ */ (0, h.jsxs)("div", {
1156
+ className: U.historyText,
1157
+ children: [
1158
+ a.pointer + 1,
1159
+ "/",
1160
+ a.items.length
1161
+ ]
1162
+ }),
1163
+ /* @__PURE__ */ (0, h.jsx)(N, {
1164
+ variant: "outline",
1165
+ disabled: u,
1166
+ className: M.rect,
1167
+ onClick: s,
1168
+ children: /* @__PURE__ */ (0, h.jsx)(O, {})
1169
+ })
1170
+ ]
1171
+ }),
1172
+ /* @__PURE__ */ (0, h.jsx)(N, {
1173
+ variant: "outline",
1174
+ disabled: d,
1175
+ onClick: r,
1176
+ children: "Reset"
1177
+ }),
1178
+ /* @__PURE__ */ (0, h.jsxs)(N, {
1179
+ disabled: f,
1180
+ onClick: n,
1181
+ children: [i ? /* @__PURE__ */ (0, h.jsx)(A, {}) : /* @__PURE__ */ (0, h.jsx)(E, {}), "Save"]
1182
+ })
1183
+ ]
1184
+ })]
1185
+ });
1186
+ }, Je = (e, t) => {
1187
+ let n = new CustomEvent("crop-update", { detail: t });
1188
+ e.dispatchEvent(n);
1189
+ }, Ye = (e, t) => {
1190
+ let n = new CustomEvent("clip-path-update", { detail: t });
1191
+ e.dispatchEvent(n);
1192
+ }, W = (e, t) => {
1193
+ let n = new CustomEvent("resize-update", { detail: t });
1194
+ e.dispatchEvent(n);
1195
+ }, G = {
1196
+ resize: "_resize_11cwi_1",
1197
+ slider: "_slider_11cwi_14",
1198
+ border: "_border_11cwi_18",
1199
+ tools: "_tools_11cwi_24",
1200
+ toolsLock: "_toolsLock_11cwi_30"
1201
+ }, K = 10, q = 200, J = (e, t, n) => (e < K && (e = K), e > q && (e = q), {
1202
+ updatedScale: e,
1203
+ updatedWidth: Math.round(e / 100 * t),
1204
+ updatedHeight: Math.round(e / 100 * n)
1205
+ }), Xe = () => {
1206
+ let { getLastHistoryItem: e, setCurrentAction: t, addToHistory: n, setSidebar: i, eventBus: a } = j(), { width: c, height: l } = e(), [u, d] = s(c), [f, p] = s(l), [m, g] = s(100), _ = o(0), v = S(), y = (e) => {
1207
+ let { updatedScale: t, updatedWidth: n, updatedHeight: r } = J(e, c, l);
1208
+ d(n), p(r), g(t), W(a, t);
1209
+ }, b = (e) => {
1210
+ let { updatedScale: t, updatedWidth: n, updatedHeight: r } = J(parseInt(e.target?.value ?? "1") / c * 100, c, l);
1211
+ d(n), p(r), g(t), W(a, t);
1212
+ }, x = (e) => {
1213
+ let { updatedScale: t, updatedWidth: n, updatedHeight: r } = J(parseInt(e.target.value) / l * 100, c, l);
1214
+ p(r), d(n), g(t), W(a, t);
1215
+ }, C = () => {
1216
+ W(a, 100), t(null), i(!0);
1217
+ }, w = () => {
1218
+ n({
1219
+ width: u,
1220
+ height: f,
1221
+ action: {
1222
+ name: "resize",
1223
+ args: {
1224
+ width: u,
1225
+ height: f
1226
+ }
1227
+ }
1228
+ }), W(a, 100), i(!0);
1229
+ };
1230
+ return r(() => {
1231
+ let e = Math.round(u / c * 100), t = (e) => {
1232
+ let { updatedHeight: t, updatedWidth: n } = J(e, c, l);
1233
+ p(t), d(n), g(e), W(a, e);
1234
+ }, n = (n) => {
1235
+ let r = Math.sign(n.deltaY);
1236
+ e -= r * 2, e <= K && (e = K), e >= q && (e = q), t(e);
1237
+ }, r = (e) => {
1238
+ _.current = e.touches[0].clientY;
1239
+ }, i = (n) => {
1240
+ let r = n.touches[0].clientY, i = _.current - r;
1241
+ Math.abs(i) < 10 || (e += Math.sign(i) * 2, e <= K && (e = K), e >= q && (e = q), t(e), _.current = r);
1242
+ }, o = new AbortController(), { signal: s } = o;
1243
+ return window.addEventListener("wheel", n, { signal: s }), window.addEventListener("touchstart", r, { signal: s }), window.addEventListener("touchmove", i, { signal: s }), () => o.abort();
1244
+ }, [
1245
+ l,
1246
+ c,
1247
+ v,
1248
+ u,
1249
+ a
1250
+ ]), /* @__PURE__ */ (0, h.jsxs)("div", {
1251
+ className: G.resize,
1252
+ children: [/* @__PURE__ */ (0, h.jsx)(Se, {
1253
+ min: K,
1254
+ max: q,
1255
+ value: m,
1256
+ className: G.slider,
1257
+ onChange: y
1258
+ }), /* @__PURE__ */ (0, h.jsxs)("div", {
1259
+ className: G.tools,
1260
+ children: [
1261
+ /* @__PURE__ */ (0, h.jsx)(be, {
1262
+ value: u,
1263
+ name: "width",
1264
+ label: "Width",
1265
+ style: { width: "88px" },
1266
+ onChange: (e) => d(Number(e.target.value)),
1267
+ onBlur: b
1268
+ }),
1269
+ /* @__PURE__ */ (0, h.jsx)(ne, { className: G.toolsLock }),
1270
+ /* @__PURE__ */ (0, h.jsx)(be, {
1271
+ value: f,
1272
+ name: "height",
1273
+ label: "Height",
1274
+ style: { width: "88px" },
1275
+ onChange: (e) => p(Number(e.target.value)),
1276
+ onBlur: x
1277
+ }),
1278
+ /* @__PURE__ */ (0, h.jsx)(L, {
1279
+ onSave: () => w(),
1280
+ onClose: C,
1281
+ disabled: u === c
1282
+ })
1283
+ ]
1284
+ })]
1285
+ });
1286
+ }, Y = {
1287
+ preview: "_preview_dvanl_1",
1288
+ rotate: "_rotate_dvanl_12",
1289
+ flip: "_flip_dvanl_24",
1290
+ image: "_image_dvanl_32"
1291
+ }, Ze = ({ isClipped: e, style: t = {} }) => {
1292
+ let { history: n, previewUrl: i, currentAction: a, getLastRotation: s, eventBus: c } = j(), l = o(null), u = [];
1293
+ if (a) {
1294
+ let { width: e, height: t } = n.items.at(n.pointer);
1295
+ u.push({
1296
+ ...a.name === w.ROTATE ? Ne(e, t, s(), a.args.degrees) : {
1297
+ width: e,
1298
+ height: t
1299
+ },
1300
+ action: a
1301
+ });
1302
+ }
1303
+ let { box: d, boxWidth: f, boxHeight: p, viewWidth: m, viewHeight: g, rotation: _, flipH: v, flipV: y } = We([...n.items.slice(0, n.pointer + 1), ...u]);
1304
+ return r(() => {
1305
+ e && l.current && (l.current.style.transition = "none");
1306
+ let t = (e) => {
1307
+ let t = e.detail;
1308
+ l.current && (l.current.style.transform = `scale(${t / 100})`);
1309
+ }, n = (t) => {
1310
+ if (!e) return;
1311
+ let { x: n, y: r, w: i, h: a } = t.detail;
1312
+ l.current && (l.current.style.clipPath = `xywh(${n}% ${r}% ${i}% ${a}%)`);
1313
+ };
1314
+ return c.addEventListener("resize-update", t), c.addEventListener("clip-path-update", n), () => {
1315
+ c.removeEventListener("resize-update", t), c.removeEventListener("clip-path-update", n);
1316
+ };
1317
+ }, [e, c]), /* @__PURE__ */ (0, h.jsx)("div", {
1318
+ ref: l,
1319
+ className: Y.preview,
1320
+ style: {
1321
+ aspectRatio: `${m} / ${g}`,
1322
+ ...t
1323
+ },
1324
+ children: /* @__PURE__ */ (0, h.jsx)("div", {
1325
+ className: Y.rotate,
1326
+ style: {
1327
+ width: `${f / m * 100}%`,
1328
+ height: `${p / g * 100}%`,
1329
+ transform: `translate(-50%, -50%) rotate(${_}deg)`
1330
+ },
1331
+ children: /* @__PURE__ */ (0, h.jsx)("div", {
1332
+ className: Y.flip,
1333
+ style: { transform: `scale(${v ? -1 : 1}, ${y ? -1 : 1})` },
1334
+ children: /* @__PURE__ */ (0, h.jsx)("img", {
1335
+ className: Y.image,
1336
+ src: i,
1337
+ alt: "Preview Image",
1338
+ style: {
1339
+ width: `${1 / d.w * 100}%`,
1340
+ height: `${1 / d.h * 100}%`,
1341
+ left: `${-(d.x / d.w) * 100}%`,
1342
+ top: `${-(d.y / d.h) * 100}%`
1343
+ }
1344
+ })
1345
+ })
1346
+ })
1347
+ });
1348
+ }, X = {
1349
+ wrapper: "_wrapper_13nh3_1",
1350
+ box: "_box_13nh3_9",
1351
+ tools: "_tools_13nh3_18",
1352
+ toolsInfo: "_toolsInfo_13nh3_34",
1353
+ toolsInfoLabel: "_toolsInfoLabel_13nh3_41",
1354
+ toolsInfoValue: "_toolsInfoValue_13nh3_46",
1355
+ linesBox: "_linesBox_13nh3_51",
1356
+ line: "_line_13nh3_51",
1357
+ lineV: "_lineV_13nh3_61",
1358
+ lineH: "_lineH_13nh3_69",
1359
+ pointer: "_pointer_13nh3_77",
1360
+ pointerTopLeft: "_pointerTopLeft_13nh3_83",
1361
+ pointerTopRight: "_pointerTopRight_13nh3_90",
1362
+ pointerBottomRight: "_pointerBottomRight_13nh3_97",
1363
+ pointerBottomLeft: "_pointerBottomLeft_13nh3_104",
1364
+ mobileBorder: "_mobileBorder_13nh3_111",
1365
+ mobilePointer: "_mobilePointer_13nh3_117"
1366
+ }, Qe = () => {
1367
+ let { getLastHistoryItem: e } = j(), t = S(), n = o(null), { handleCropStart: r, initialCrop: i } = st({ boxRef: n }), { width: a, height: s } = e(), { x: c, y: l, w: u, h: d } = i;
1368
+ return /* @__PURE__ */ (0, h.jsxs)(h.Fragment, { children: [/* @__PURE__ */ (0, h.jsx)(Ze, {
1369
+ isClipped: !0,
1370
+ style: { clipPath: `xywh(${c}% ${l}% ${u}% ${d}%)` }
1371
+ }), /* @__PURE__ */ (0, h.jsx)("div", {
1372
+ className: X.wrapper,
1373
+ style: { aspectRatio: `${a} / ${s}` },
1374
+ children: /* @__PURE__ */ (0, h.jsxs)("div", {
1375
+ ref: n,
1376
+ className: X.box,
1377
+ style: {
1378
+ width: `${u}%`,
1379
+ height: `${d}%`,
1380
+ top: `${l}%`,
1381
+ left: `${c}%`
1382
+ },
1383
+ children: [/* @__PURE__ */ (0, h.jsx)(et, {}), t ? /* @__PURE__ */ (0, h.jsx)(ct, { onMouseDown: r }) : /* @__PURE__ */ (0, h.jsx)(tt, { onMouseDown: r })]
1384
+ })
1385
+ })] });
1386
+ }, $e = () => {
1387
+ let { setCurrentAction: e, currentAction: t, getLastHistoryItem: n, addToHistory: i, setSidebar: a, eventBus: s } = j(), { width: c, height: l } = n(), u = o(null), d = o(null), f = o(null), p = o(null), m = o({
1388
+ x: 0,
1389
+ y: 0,
1390
+ w: 0,
1391
+ h: 0
1392
+ });
1393
+ return r(() => {
1394
+ if (t?.name !== "crop") return;
1395
+ let e = je(t.args.ratio, c, l), { x: n, y: r, w: i, h: a } = e, o = Math.round(n / 100 * c), h = Math.round(r / 100 * l), g = Math.round(i / 100 * c), _ = Math.round(a / 100 * l);
1396
+ m.current = e, u.current && (u.current.textContent = o.toString()), d.current && (d.current.textContent = h.toString()), f.current && (f.current.textContent = g.toString()), p.current && (p.current.textContent = _.toString());
1397
+ let v = (e) => {
1398
+ let { x: t, y: n, w: r, h: i } = e.detail;
1399
+ u.current && (u.current.textContent = t.toString()), d.current && (d.current.textContent = n.toString()), f.current && (f.current.textContent = r.toString()), p.current && (p.current.textContent = i.toString());
1400
+ }, y = (e) => {
1401
+ m.current = e.detail;
1402
+ };
1403
+ return s.addEventListener("crop-update", v), s.addEventListener("clip-path-update", y), () => {
1404
+ s.removeEventListener("crop-update", v), s.removeEventListener("clip-path-update", y);
1405
+ };
1406
+ }, [
1407
+ t,
1408
+ c,
1409
+ l,
1410
+ s
1411
+ ]), /* @__PURE__ */ (0, h.jsxs)("div", {
1412
+ className: X.tools,
1413
+ children: [
1414
+ /* @__PURE__ */ (0, h.jsxs)("div", {
1415
+ className: X.toolsInfo,
1416
+ children: [/* @__PURE__ */ (0, h.jsx)("div", {
1417
+ className: X.toolsInfoLabel,
1418
+ children: "left"
1419
+ }), /* @__PURE__ */ (0, h.jsx)("div", {
1420
+ className: `${X.toolsInfoValue} ${P.semibold}`,
1421
+ ref: u
1422
+ })]
1423
+ }),
1424
+ /* @__PURE__ */ (0, h.jsxs)("div", {
1425
+ className: X.toolsInfo,
1426
+ children: [/* @__PURE__ */ (0, h.jsx)("div", {
1427
+ className: X.toolsInfoLabel,
1428
+ children: "top"
1429
+ }), /* @__PURE__ */ (0, h.jsx)("div", {
1430
+ className: `${X.toolsInfoValue} ${P.semibold}`,
1431
+ ref: d
1432
+ })]
1433
+ }),
1434
+ /* @__PURE__ */ (0, h.jsxs)("div", {
1435
+ className: X.toolsInfo,
1436
+ children: [/* @__PURE__ */ (0, h.jsx)("div", {
1437
+ className: X.toolsInfoLabel,
1438
+ children: "width"
1439
+ }), /* @__PURE__ */ (0, h.jsx)("div", {
1440
+ className: `${X.toolsInfoValue} ${P.semibold}`,
1441
+ ref: f
1442
+ })]
1443
+ }),
1444
+ /* @__PURE__ */ (0, h.jsxs)("div", {
1445
+ className: X.toolsInfo,
1446
+ children: [/* @__PURE__ */ (0, h.jsx)("div", {
1447
+ className: X.toolsInfoLabel,
1448
+ children: "height"
1449
+ }), /* @__PURE__ */ (0, h.jsx)("div", {
1450
+ className: `${X.toolsInfoValue} ${P.semibold}`,
1451
+ ref: p
1452
+ })]
1453
+ }),
1454
+ /* @__PURE__ */ (0, h.jsx)(L, {
1455
+ onSave: async () => {
1456
+ if (!t || t.name !== w.CROP) return;
1457
+ let e = t.args?.preset?.width || Math.round(c * m.current.w / 100), n = t.args?.preset?.height || Math.round(l * m.current.h / 100);
1458
+ i({
1459
+ width: e,
1460
+ height: n,
1461
+ action: {
1462
+ name: "crop",
1463
+ args: {
1464
+ ...t.args,
1465
+ ...m.current
1466
+ }
1467
+ }
1468
+ }), a(!0);
1044
1469
  },
1045
- children: /* @__PURE__ */ (0, p.jsx)(D, { className: "text-red" })
1470
+ onClose: () => {
1471
+ e(null), a(!0);
1472
+ }
1046
1473
  })
1047
1474
  ]
1048
1475
  });
1049
- }, he = ({ onMouseDown: e }) => /* @__PURE__ */ (0, p.jsxs)(p.Fragment, { children: [
1050
- /* @__PURE__ */ (0, p.jsx)("span", {
1051
- className: "crop-b crop-b-t",
1052
- onMouseDown: (t) => e(t, "t", "ns")
1053
- }),
1054
- /* @__PURE__ */ (0, p.jsx)("span", {
1055
- className: "crop-b crop-b-r",
1056
- onMouseDown: (t) => e(t, "r", "ew")
1057
- }),
1058
- /* @__PURE__ */ (0, p.jsx)("span", {
1059
- className: "crop-b crop-b-b",
1060
- onMouseDown: (t) => e(t, "b", "ns")
1061
- }),
1062
- /* @__PURE__ */ (0, p.jsx)("span", {
1063
- className: "crop-b crop-b-l",
1064
- onMouseDown: (t) => e(t, "l", "ew")
1065
- })
1066
- ] }), ge = () => /* @__PURE__ */ (0, p.jsxs)("div", {
1067
- className: "crop-l-box",
1068
- children: [/* @__PURE__ */ (0, p.jsx)("span", { className: "crop-l crop-l-v" }), /* @__PURE__ */ (0, p.jsx)("span", { className: "crop-l crop-l-h" })]
1069
- }), _e = ({ onMouseDown: e }) => /* @__PURE__ */ (0, p.jsxs)(p.Fragment, { children: [
1070
- /* @__PURE__ */ (0, p.jsx)("span", {
1071
- className: "crop-ps crop-ps-tl",
1476
+ }, et = () => /* @__PURE__ */ (0, h.jsxs)("div", {
1477
+ className: X.linesBox,
1478
+ children: [/* @__PURE__ */ (0, h.jsx)("span", { className: `${X.line} ${X.lineV}` }), /* @__PURE__ */ (0, h.jsx)("span", { className: `${X.line} ${X.lineH}` })]
1479
+ }), tt = ({ onMouseDown: e }) => /* @__PURE__ */ (0, h.jsxs)(h.Fragment, { children: [
1480
+ /* @__PURE__ */ (0, h.jsx)("div", {
1481
+ className: `${X.pointer} ${X.pointerTopLeft}`,
1072
1482
  onMouseDown: (t) => e(t, "tl", "nwse")
1073
1483
  }),
1074
- /* @__PURE__ */ (0, p.jsx)("span", {
1075
- className: "crop-ps crop-ps-t",
1076
- onMouseDown: (t) => e(t, "t", "ns")
1077
- }),
1078
- /* @__PURE__ */ (0, p.jsx)("span", {
1079
- className: "crop-ps crop-ps-tr",
1484
+ /* @__PURE__ */ (0, h.jsx)("div", {
1485
+ className: `${X.pointer} ${X.pointerTopRight}`,
1080
1486
  onMouseDown: (t) => e(t, "tr", "nesw")
1081
1487
  }),
1082
- /* @__PURE__ */ (0, p.jsx)("span", {
1083
- className: "crop-ps crop-ps-r",
1084
- onMouseDown: (t) => e(t, "r", "ew")
1085
- }),
1086
- /* @__PURE__ */ (0, p.jsx)("span", {
1087
- className: "crop-ps crop-ps-br",
1488
+ /* @__PURE__ */ (0, h.jsx)("div", {
1489
+ className: `${X.pointer} ${X.pointerBottomRight}`,
1088
1490
  onMouseDown: (t) => e(t, "br", "nwse")
1089
1491
  }),
1090
- /* @__PURE__ */ (0, p.jsx)("span", {
1091
- className: "crop-ps crop-ps-b",
1092
- onMouseDown: (t) => e(t, "b", "ns")
1093
- }),
1094
- /* @__PURE__ */ (0, p.jsx)("span", {
1095
- className: "crop-ps crop-ps-bl",
1492
+ /* @__PURE__ */ (0, h.jsx)("div", {
1493
+ className: `${X.pointer} ${X.pointerBottomLeft}`,
1096
1494
  onMouseDown: (t) => e(t, "bl", "nesw")
1097
- }),
1098
- /* @__PURE__ */ (0, p.jsx)("span", {
1099
- className: "crop-ps crop-ps-l",
1100
- onMouseDown: (t) => e(t, "l", "ew")
1101
1495
  })
1102
1496
  ] });
1103
1497
  //#endregion
1104
- //#region src/shared/components/ImageEditor/crop/useCropInteraction.ts
1105
- function J(e, t, n) {
1498
+ //#region src/shared/components/Pixedi/crop/useCropInteraction.ts
1499
+ function nt(e, t, n) {
1106
1500
  return Math.min(Math.max(e, t), n);
1107
1501
  }
1108
- function Y(e, t) {
1109
- return e / t * 100;
1110
- }
1111
- function ve(e, t, n, r, i) {
1502
+ function rt(e, { x: t, y: n, w: r, h: i }) {
1112
1503
  e.style.left = `${t}%`, e.style.top = `${n}%`, e.style.width = `${r}%`, e.style.height = `${i}%`;
1113
1504
  }
1114
- function ye(e, t, n, r, i) {
1115
- e.style.clipPath = `xywh(${t}% ${n}% ${r}% ${i}%)`;
1505
+ function it(e) {
1506
+ let { width: t, height: n } = e.getBoundingClientRect();
1507
+ return {
1508
+ frameW: t,
1509
+ frameH: n
1510
+ };
1116
1511
  }
1117
- var be = ({ imgRef: e, cropRef: t }) => {
1118
- let { getCurrentAction: n, getLastHistoryItem: r } = R(), a = S(), o = s(null), c = s(""), l = s({
1119
- xPct: 0,
1120
- yPct: 0
1121
- }), u = s({
1122
- x: 0,
1123
- y: 0,
1124
- w: 0,
1125
- h: 0
1126
- });
1127
- return i(() => {
1128
- let i = (e) => {
1129
- if (t.current) {
1130
- let e = t.current.parentElement;
1131
- e && (l.current = {
1132
- xPct: Y(t.current.offsetLeft, e.offsetWidth),
1133
- yPct: Y(t.current.offsetTop, e.offsetHeight)
1134
- });
1135
- }
1136
- let n = "clientX" in e ? e.clientX : e.touches[0].clientX, r = "clientY" in e ? e.clientY : e.touches[0].clientY;
1137
- o.current = {
1138
- x: n,
1139
- y: r
1512
+ function at({ x: e, y: t, w: n, h: r }, i, a) {
1513
+ return {
1514
+ x: e / 100 * i,
1515
+ y: t / 100 * a,
1516
+ w: n / 100 * i,
1517
+ h: r / 100 * a
1518
+ };
1519
+ }
1520
+ function ot({ x: e, y: t, w: n, h: r }, i, a) {
1521
+ return {
1522
+ x: e / i * 100,
1523
+ y: t / a * 100,
1524
+ w: n / i * 100,
1525
+ h: r / a * 100
1526
+ };
1527
+ }
1528
+ var st = ({ boxRef: e }) => {
1529
+ let { currentAction: t, getLastHistoryItem: n, eventBus: i } = j(), s = S(), { width: c, height: l } = n(), u = t?.name === w.CROP, d = u ? t.args.ratio : 1, f = !u || t.args.isFree, p = a(() => je(d, c, l), [
1530
+ d,
1531
+ c,
1532
+ l
1533
+ ]), m = o(null), h = o(""), g = o(p), _ = o(p);
1534
+ return r(() => {
1535
+ g.current = p, Ye(i, p);
1536
+ }, [p, i]), r(() => {
1537
+ let t = (e, t) => {
1538
+ g.current = t, rt(e, t), Je(i, {
1539
+ x: Math.round(t.x / 100 * c),
1540
+ y: Math.round(t.y / 100 * l),
1541
+ w: Math.round(t.w / 100 * c),
1542
+ h: Math.round(t.h / 100 * l)
1543
+ }), Ye(i, t);
1544
+ }, n = (e) => {
1545
+ e.preventDefault(), _.current = g.current;
1546
+ let t = "clientX" in e ? e.clientX : e.touches[0].clientX, n = "clientY" in e ? e.clientY : e.touches[0].clientY;
1547
+ m.current = {
1548
+ x: t,
1549
+ y: n
1140
1550
  }, document.body.style.cursor = "move";
1141
- }, a = (n) => {
1142
- if (!e.current || !t.current || !o.current) return;
1143
- let r = t.current, i = e.current, a = r.parentElement;
1144
- if (!a) return;
1145
- let l = a.offsetWidth, u = a.offsetHeight;
1146
- if (c.current) {
1147
- s(n, r, i, l, u);
1551
+ }, r = (t) => {
1552
+ if (!e.current || !m.current) return;
1553
+ t.preventDefault();
1554
+ let n = e.current, r = n.parentElement;
1555
+ if (!r) return;
1556
+ let { frameW: i, frameH: s } = it(r);
1557
+ if (h.current) {
1558
+ a(t, n, i, s);
1148
1559
  return;
1149
1560
  }
1150
- d(n, r, i, l, u);
1151
- }, s = (e, t, i, a, s) => {
1152
- let l = n();
1153
- if (!l || l.name !== "crop" || !o.current) return;
1154
- let { isFree: d, ratio: f } = l.args, p = "clientX" in e ? e.clientX : e.touches[0].clientX, m = "clientY" in e ? e.clientY : e.touches[0].clientY, { x: h, y: g, w: _, h: v } = fe(c.current, d, f, o.current.x, o.current.y, p, m, a, s, u.current, t), y = Y(h, a), b = Y(g, s), x = Y(_, a), S = Y(v, s);
1155
- ve(t, y, b, x, S), ye(i, y, b, x, S);
1156
- let C = r();
1157
- if (!C) return;
1158
- let { width: w, height: T } = C;
1159
- q({
1160
- x: Math.round(y / 100 * w),
1161
- y: Math.round(b / 100 * T),
1162
- w: Math.round(x / 100 * w),
1163
- h: Math.round(S / 100 * T)
1164
- });
1165
- }, d = (e, t, n, i, a) => {
1166
- if (!o.current) return;
1167
- console.log("HandleDrag");
1168
- let s = t.offsetWidth, c = t.offsetHeight, u = "clientX" in e ? e.clientX : e.touches[0].clientX, d = "clientY" in e ? e.clientY : e.touches[0].clientY, f = Y(u - o.current.x, i), p = Y(d - o.current.y, a);
1169
- o.current = {
1170
- x: u,
1171
- y: d
1172
- };
1173
- let m = Y(i - s, i), h = Y(a - c, a), g = J(l.current.xPct + f, 0, m), _ = J(l.current.yPct + p, 0, h), v = Y(s, i), y = Y(c, a);
1174
- l.current = {
1175
- xPct: g,
1176
- yPct: _
1177
- }, ve(t, g, _, v, y), ye(n, g, _, v, y);
1178
- let { width: b, height: x } = r();
1179
- q({
1180
- x: Math.round(g / 100 * b),
1181
- y: Math.round(_ / 100 * x),
1182
- w: Math.round(v / 100 * b),
1183
- h: Math.round(y / 100 * x)
1561
+ o(t, n, i, s);
1562
+ }, a = (e, n, r, i) => {
1563
+ if (!m.current) return;
1564
+ let a = "clientX" in e ? e.clientX : e.touches[0].clientX, o = "clientY" in e ? e.clientY : e.touches[0].clientY, s = ot(Ae(h.current, f, d, m.current.x, m.current.y, a, o, r, i, at(_.current, r, i), at(g.current, r, i)), r, i);
1565
+ t(n, f ? s : Me(s, d, c, l));
1566
+ }, o = (e, n, r, i) => {
1567
+ if (!m.current) return;
1568
+ let { x: a, y: o, w: s, h: c } = _.current, l = "clientX" in e ? e.clientX : e.touches[0].clientX, u = "clientY" in e ? e.clientY : e.touches[0].clientY, d = (l - m.current.x) / r * 100, f = (u - m.current.y) / i * 100;
1569
+ t(n, {
1570
+ x: nt(a + d, 0, Math.max(0, 100 - s)),
1571
+ y: nt(o + f, 0, Math.max(0, 100 - c)),
1572
+ w: s,
1573
+ h: c
1184
1574
  });
1185
- }, f = () => {
1186
- t.current && (o.current = null, c.current = "", t.current.style.cursor = "move", document.body.style.cursor = "auto");
1575
+ }, s = () => {
1576
+ e.current && (m.current = null, h.current = "", e.current.style.cursor = "move", document.body.style.cursor = "auto");
1187
1577
  };
1188
- if (!t.current) return;
1189
- let p = new AbortController(), { signal: m } = p;
1190
- return t.current.addEventListener("mousedown", i, { signal: m }), t.current.addEventListener("touchstart", i, { signal: m }), document.addEventListener("mousemove", a, { signal: m }), document.addEventListener("touchmove", a, { signal: m }), document.addEventListener("mouseup", f, { signal: m }), document.addEventListener("touchend", f, { signal: m }), () => p.abort();
1578
+ if (!e.current) return;
1579
+ let u = new AbortController(), { signal: p } = u;
1580
+ return e.current.addEventListener("mousedown", n, { signal: p }), e.current.addEventListener("touchstart", n, {
1581
+ signal: p,
1582
+ passive: !1
1583
+ }), document.addEventListener("mousemove", r, { signal: p }), document.addEventListener("touchmove", r, {
1584
+ signal: p,
1585
+ passive: !1
1586
+ }), document.addEventListener("mouseup", s, { signal: p }), document.addEventListener("touchend", s, { signal: p }), () => u.abort();
1191
1587
  }, [
1192
- n,
1193
- r,
1588
+ f,
1589
+ d,
1590
+ c,
1591
+ l,
1194
1592
  e,
1195
- t
1196
- ]), { handleCropStart: (e, n, r) => {
1197
- if (!t.current) return;
1198
- e.stopPropagation(), u.current = {
1199
- x: t.current.offsetLeft,
1200
- y: t.current.offsetTop,
1201
- w: t.current.offsetWidth,
1202
- h: t.current.offsetHeight
1203
- };
1204
- let i = "clientX" in e ? e.clientX : e.touches[0].clientX, s = "clientY" in e ? e.clientY : e.touches[0].clientY;
1205
- o.current = {
1206
- x: i,
1207
- y: s
1208
- }, c.current = n, a || (t.current.style.cursor = `${r}-resize`, document.body.style.cursor = `${r}-resize`);
1209
- } };
1210
- }, xe = ({ onMouseDown: e }) => /* @__PURE__ */ (0, p.jsx)("div", {
1211
- className: "crop-p-b",
1212
- children: /* @__PURE__ */ (0, p.jsx)("div", {
1213
- className: "crop-p-p",
1593
+ i
1594
+ ]), {
1595
+ handleCropStart: (t, n, r) => {
1596
+ if (!e.current) return;
1597
+ t.stopPropagation(), t.preventDefault(), _.current = g.current;
1598
+ let i = "clientX" in t ? t.clientX : t.touches[0].clientX, a = "clientY" in t ? t.clientY : t.touches[0].clientY;
1599
+ m.current = {
1600
+ x: i,
1601
+ y: a
1602
+ }, h.current = n, s || (e.current.style.cursor = `${r}-resize`, document.body.style.cursor = `${r}-resize`);
1603
+ },
1604
+ initialCrop: p
1605
+ };
1606
+ }, ct = ({ onMouseDown: e }) => /* @__PURE__ */ (0, h.jsx)("div", {
1607
+ className: X.mobileBorder,
1608
+ children: /* @__PURE__ */ (0, h.jsx)("div", {
1609
+ className: X.mobilePointer,
1214
1610
  onTouchStart: (t) => e(t, "br", "nwse")
1215
1611
  })
1216
- }), X = 10, Z = 200, Q = (e, t, n) => (e < X && (e = X), e > Z && (e = Z), {
1217
- updatedScale: e,
1218
- updatedWidth: Math.round(e / 100 * t),
1219
- updatedHeight: Math.round(e / 100 * n)
1220
- }), Se = ({ onResizing: e }) => {
1221
- let { getLastHistoryItem: t, setCurrentAction: n, addToHistory: r, setSidebar: a } = R(), { width: o, height: l, base64: u } = t(), [d, f] = c(!1), [m, h] = c(o), [g, _] = c(l), v = s(0), { resize: y } = b(), x = S(), C = (t) => {
1222
- let { updatedScale: n, updatedWidth: r, updatedHeight: i } = Q(parseInt(t.target.value) / o * 100, o, l);
1223
- h(r), _(i), e(n);
1224
- }, w = (t) => {
1225
- let { updatedScale: n, updatedWidth: r, updatedHeight: i } = Q(parseInt(t.target.value) / l * 100, o, l);
1226
- _(i), h(r), e(n);
1227
- }, T = () => {
1228
- e(100), n(null), a(!0);
1229
- }, O = async () => {
1230
- try {
1231
- f(!0);
1232
- let t = await y(u, m, g);
1233
- r({
1234
- name: "Resize",
1235
- base64: t,
1236
- width: m,
1237
- height: g
1238
- }), e(100), a(!0);
1239
- } catch (e) {
1240
- console.error("Failed to process image:", e);
1241
- } finally {
1242
- f(!1);
1243
- }
1612
+ }), Z = {
1613
+ flip: "_flip_17ic5_1",
1614
+ btnH: "_btnH_17ic5_14",
1615
+ btnV: "_btnV_17ic5_20"
1616
+ }, lt = () => {
1617
+ let { getLastHistoryItem: e, setCurrentAction: t, addToHistory: n, setSidebar: r } = j(), [i, a] = s(!1), [o, c] = s(!1), { width: l, height: u } = e();
1618
+ return /* @__PURE__ */ (0, h.jsxs)("div", {
1619
+ className: Z.flip,
1620
+ children: [/* @__PURE__ */ (0, h.jsxs)("div", {
1621
+ className: Z.scGroup,
1622
+ children: [/* @__PURE__ */ (0, h.jsx)(N, {
1623
+ variant: "outline",
1624
+ className: `${Z.btnH}`,
1625
+ onClick: () => {
1626
+ a((e) => !e), t({
1627
+ name: w.FLIP,
1628
+ args: {
1629
+ horizontal: !i,
1630
+ vertical: o
1631
+ }
1632
+ });
1633
+ },
1634
+ children: /* @__PURE__ */ (0, h.jsx)(le, { style: { color: i ? "var(--accent-blue)" : "var(--foreground)" } })
1635
+ }), /* @__PURE__ */ (0, h.jsx)(N, {
1636
+ variant: "outline",
1637
+ className: `${Z.btnV} `,
1638
+ onClick: () => {
1639
+ c((e) => !e), t({
1640
+ name: w.FLIP,
1641
+ args: {
1642
+ horizontal: i,
1643
+ vertical: !o
1644
+ }
1645
+ });
1646
+ },
1647
+ children: /* @__PURE__ */ (0, h.jsx)(ue, { style: { color: o ? "var(--accent-blue)" : "var(--foreground)" } })
1648
+ })]
1649
+ }), /* @__PURE__ */ (0, h.jsx)(L, {
1650
+ disabled: !i && !o,
1651
+ onSave: () => {
1652
+ n({
1653
+ width: l,
1654
+ height: u,
1655
+ action: {
1656
+ name: w.FLIP,
1657
+ args: {
1658
+ horizontal: i,
1659
+ vertical: o
1660
+ }
1661
+ }
1662
+ }), r(!0);
1663
+ },
1664
+ onClose: () => {
1665
+ t(null), r(!0);
1666
+ }
1667
+ })]
1668
+ });
1669
+ }, Q = {
1670
+ rotate: "_rotate_gkt07_1",
1671
+ btnH: "_btnH_gkt07_14",
1672
+ btnV: "_btnV_gkt07_20"
1673
+ }, ut = () => {
1674
+ let { getLastRotation: e, getLastHistoryItem: t, addToHistory: n, setSidebar: r, setCurrentAction: i } = j(), { width: a, height: s } = t(), c = e(), l = o(c), u = o(c), d = (e) => {
1675
+ u.current += e, i({
1676
+ name: "rotate",
1677
+ args: { degrees: u.current }
1678
+ });
1244
1679
  };
1245
- return i(() => {
1246
- let t = Math.round(m / o * 100), n = (t) => {
1247
- let { updatedHeight: n, updatedWidth: r } = Q(t, o, l);
1248
- _(n), h(r), e(t);
1249
- }, r = (e) => {
1250
- if (d) return;
1251
- let r = Math.sign(e.deltaY);
1252
- t -= r * 2, t <= X && (t = X), t >= Z && (t = Z), n(t);
1253
- }, i = (e) => {
1254
- v.current = e.touches[0].clientY;
1255
- }, a = (e) => {
1256
- if (d) return;
1257
- let r = e.touches[0].clientY, i = v.current - r;
1258
- Math.abs(i) < 10 || (t += Math.sign(i) * 2, t <= X && (t = X), t >= Z && (t = Z), n(t), v.current = r);
1259
- }, s = new AbortController(), { signal: c } = s;
1260
- return window.addEventListener("wheel", r, { signal: c }), window.addEventListener("touchstart", i, { signal: c }), window.addEventListener("touchmove", a, { signal: c }), () => s.abort();
1261
- }, [
1262
- l,
1263
- o,
1264
- d,
1265
- x,
1266
- e,
1267
- m
1268
- ]), /* @__PURE__ */ (0, p.jsxs)("div", {
1269
- className: "resize",
1270
- children: [
1271
- /* @__PURE__ */ (0, p.jsx)("div", {
1272
- className: "resize-text",
1273
- children: x ? "Slide UP/Down to Resize" : "Scroll UP/Down to Resize"
1274
- }),
1275
- /* @__PURE__ */ (0, p.jsx)("div", { className: "resize-border" }),
1276
- /* @__PURE__ */ (0, p.jsxs)("div", {
1277
- className: "resize-tools",
1278
- children: [
1279
- /* @__PURE__ */ (0, p.jsx)(H, {
1280
- value: m,
1281
- name: "width",
1282
- label: "Width",
1283
- disabled: d,
1284
- style: { width: "88px" },
1285
- onChange: C
1286
- }),
1287
- /* @__PURE__ */ (0, p.jsx)(ee, { className: "resize-tools-lock" }),
1288
- /* @__PURE__ */ (0, p.jsx)(H, {
1289
- value: g,
1290
- name: "height",
1291
- label: "Height",
1292
- disabled: d,
1293
- style: { width: "88px" },
1294
- onChange: w
1295
- }),
1296
- /* @__PURE__ */ (0, p.jsxs)("div", {
1297
- className: "resize-tools-buttons",
1298
- children: [/* @__PURE__ */ (0, p.jsx)(z, {
1299
- variant: "outline",
1300
- className: "resize-tools-save text-green",
1301
- disabled: m === o || d,
1302
- onClick: () => O(),
1303
- children: d ? /* @__PURE__ */ (0, p.jsx)(L, {}) : /* @__PURE__ */ (0, p.jsx)(E, {})
1304
- }), /* @__PURE__ */ (0, p.jsx)(z, {
1305
- variant: "outline",
1306
- className: "resize-tools-close text-red",
1307
- disabled: d,
1308
- onClick: T,
1309
- children: /* @__PURE__ */ (0, p.jsx)(D, {})
1310
- })]
1311
- })
1312
- ]
1313
- })
1314
- ]
1680
+ return /* @__PURE__ */ (0, h.jsxs)("div", {
1681
+ className: Q.rotate,
1682
+ children: [/* @__PURE__ */ (0, h.jsxs)("div", {
1683
+ className: Q.scGroup,
1684
+ children: [/* @__PURE__ */ (0, h.jsx)(N, {
1685
+ variant: "outline",
1686
+ className: `${Q.btnH}`,
1687
+ onClick: () => d(90),
1688
+ children: /* @__PURE__ */ (0, h.jsx)(de, {})
1689
+ }), /* @__PURE__ */ (0, h.jsx)(N, {
1690
+ variant: "outline",
1691
+ className: `${Q.btnV} `,
1692
+ onClick: () => d(-90),
1693
+ children: /* @__PURE__ */ (0, h.jsx)(fe, {})
1694
+ })]
1695
+ }), /* @__PURE__ */ (0, h.jsx)(L, {
1696
+ onSave: async () => {
1697
+ n({
1698
+ ...Ne(a, s, l.current, u.current),
1699
+ action: {
1700
+ name: "rotate",
1701
+ args: { degrees: u.current }
1702
+ }
1703
+ }), r(!0);
1704
+ },
1705
+ onClose: () => {
1706
+ i(null), r(!0);
1707
+ }
1708
+ })]
1315
1709
  });
1316
- }, Ce = () => {
1317
- let { getLastHistoryItem: e, currentAction: t } = R(), n = s(null), r = s(null), { width: i, height: a, base64: o } = e(), c = t?.name === "crop", l = t?.name === "resize", u = c || l, d = (e) => {
1318
- n.current && (n.current.style.transform = `scale(${e / 100})`);
1319
- }, f = `frame ${u ? "mask" : ""}`, m = `frame-image ${u ? "frame-image--faded" : ""}`;
1320
- return /* @__PURE__ */ (0, p.jsxs)("div", {
1321
- className: f,
1710
+ }, dt = { frame: "_frame_xffug_1" }, ft = () => {
1711
+ let { currentAction: e } = j(), t = e?.name === w.CROP, n = e?.name === w.RESIZE, r = e?.name === w.FLIP, i = e?.name === w.ROTATE, a = t;
1712
+ return /* @__PURE__ */ (0, h.jsxs)("div", {
1713
+ className: `${dt.frame} ${a ? P.mask : ""}`,
1322
1714
  children: [
1323
- /* @__PURE__ */ (0, p.jsxs)("div", {
1324
- ref: n,
1325
- style: { aspectRatio: `${i} / ${a}` },
1326
- className: "frame-preview",
1327
- children: [/* @__PURE__ */ (0, p.jsx)("img", {
1328
- ref: r,
1329
- src: o,
1330
- alt: "Image",
1331
- className: m
1332
- }), c && /* @__PURE__ */ (0, p.jsx)(pe, {}, t?.args?.id)]
1333
- }),
1334
- l && /* @__PURE__ */ (0, p.jsx)(Se, { onResizing: d }),
1335
- c && /* @__PURE__ */ (0, p.jsx)(me, {})
1715
+ /* @__PURE__ */ (0, h.jsx)(Ze, { style: t ? { opacity: .4 } : {} }),
1716
+ t && /* @__PURE__ */ (0, h.jsx)(Qe, {}, e?.args?.id),
1717
+ n && /* @__PURE__ */ (0, h.jsx)(Xe, {}),
1718
+ t && /* @__PURE__ */ (0, h.jsx)($e, {}),
1719
+ r && /* @__PURE__ */ (0, h.jsx)(lt, {}),
1720
+ i && /* @__PURE__ */ (0, h.jsx)(ut, {})
1336
1721
  ]
1337
1722
  });
1338
- }, we = () => {
1339
- let { getLastHistoryItem: e, setCurrentAction: t, setSidebar: n } = R(), { width: r, height: i } = e() ?? {
1723
+ }, $ = {
1724
+ sidebar: "_sidebar_8qtha_1",
1725
+ settings: "_settings_8qtha_11",
1726
+ container: "_container_8qtha_25",
1727
+ content: "_content_8qtha_31",
1728
+ closeBtn: "_closeBtn_8qtha_47",
1729
+ separator: "_separator_8qtha_52",
1730
+ resize: "_resize_8qtha_56",
1731
+ resizeIcon: "_resizeIcon_8qtha_61",
1732
+ resizeSize: "_resizeSize_8qtha_66",
1733
+ crop: "_crop_8qtha_70",
1734
+ ratio: "_ratio_8qtha_75",
1735
+ sidebarPreset: "_sidebarPreset_8qtha_80",
1736
+ flipRotate: "_flipRotate_8qtha_85"
1737
+ }, pt = () => {
1738
+ let { getLastHistoryItem: e, setCurrentAction: t, setSidebar: n } = j(), { width: r, height: i } = e() ?? {
1340
1739
  width: 0,
1341
1740
  height: 0
1342
1741
  };
1343
- return /* @__PURE__ */ (0, p.jsxs)(z, {
1742
+ return /* @__PURE__ */ (0, h.jsxs)(N, {
1344
1743
  variant: "outline",
1345
- className: "sidebar-resize",
1744
+ className: $.resize,
1346
1745
  onClick: () => {
1347
1746
  t({
1348
- name: "resize",
1747
+ name: w.RESIZE,
1349
1748
  args: {
1350
1749
  width: r,
1351
1750
  height: i
1352
1751
  }
1353
1752
  }), n(!1);
1354
1753
  },
1355
- children: [/* @__PURE__ */ (0, p.jsxs)("div", {
1356
- className: "sidebar-resize-icon",
1357
- children: [/* @__PURE__ */ (0, p.jsx)(I, {}), "Resize"]
1358
- }), /* @__PURE__ */ (0, p.jsxs)("div", {
1359
- className: "sidebar-resize-size",
1754
+ children: [/* @__PURE__ */ (0, h.jsxs)("div", {
1755
+ className: $.resizeIcon,
1756
+ children: [/* @__PURE__ */ (0, h.jsx)(k, {}), "Resize"]
1757
+ }), /* @__PURE__ */ (0, h.jsxs)("div", {
1758
+ className: $.resizeSize,
1360
1759
  children: [
1361
1760
  r,
1362
1761
  " x ",
@@ -1364,239 +1763,189 @@ var be = ({ imgRef: e, cropRef: t }) => {
1364
1763
  ]
1365
1764
  })]
1366
1765
  });
1367
- }, Te = () => {
1368
- let { currentAction: e, setCurrentAction: t, getLastHistoryItem: n, setSidebar: r } = R(), { name: i, args: a } = e || {}, o = i === "crop" ? a?.id : "", { width: s, height: c } = n(), l = s / c, u = (e) => {
1766
+ }, mt = () => {
1767
+ let { currentAction: e, setCurrentAction: t, getLastHistoryItem: n, setSidebar: r } = j(), { name: i, args: a } = e || {}, o = i === "crop" ? a?.id : "", { width: s, height: c } = n(), l = s / c, u = (e) => {
1369
1768
  e !== o && (t({
1370
1769
  name: "crop",
1371
1770
  args: {
1372
1771
  id: e,
1373
1772
  ratio: e === "1:1" ? 1 : l,
1374
- isFree: e === "freeform",
1375
- preset: null
1773
+ isFree: e === "freeform"
1376
1774
  }
1377
1775
  }), r(!1));
1378
1776
  };
1379
- return /* @__PURE__ */ (0, p.jsxs)("div", {
1380
- className: "sidebar-crop",
1381
- children: [/* @__PURE__ */ (0, p.jsx)("h4", { children: "Crop" }), /* @__PURE__ */ (0, p.jsxs)("div", {
1382
- className: "sidebar-crop-ratios",
1777
+ return /* @__PURE__ */ (0, h.jsxs)("div", {
1778
+ className: $.crop,
1779
+ children: [/* @__PURE__ */ (0, h.jsx)("h4", { children: "Crop" }), /* @__PURE__ */ (0, h.jsxs)("div", {
1780
+ className: $.ratio,
1383
1781
  children: [
1384
- /* @__PURE__ */ (0, p.jsx)(B, {
1782
+ /* @__PURE__ */ (0, h.jsx)(me, {
1385
1783
  label: "Freeform",
1386
- icon: /* @__PURE__ */ (0, p.jsx)(N, {}),
1784
+ icon: /* @__PURE__ */ (0, h.jsx)(oe, {}),
1387
1785
  active: o === "freeform",
1388
1786
  onClick: () => u("freeform")
1389
1787
  }),
1390
- /* @__PURE__ */ (0, p.jsx)(B, {
1788
+ /* @__PURE__ */ (0, h.jsx)(me, {
1391
1789
  label: "Original",
1392
- icon: /* @__PURE__ */ (0, p.jsx)(P, {}),
1790
+ icon: /* @__PURE__ */ (0, h.jsx)(se, {}),
1393
1791
  active: o === "original",
1394
1792
  onClick: () => u("original")
1395
1793
  }),
1396
- /* @__PURE__ */ (0, p.jsx)(B, {
1794
+ /* @__PURE__ */ (0, h.jsx)(me, {
1397
1795
  label: "1:1",
1398
- icon: /* @__PURE__ */ (0, p.jsx)(F, {}),
1796
+ icon: /* @__PURE__ */ (0, h.jsx)(ce, {}),
1399
1797
  active: o === "1:1",
1400
1798
  onClick: () => u("1:1")
1401
1799
  })
1402
1800
  ]
1403
1801
  })]
1404
1802
  });
1405
- }, $ = [
1406
- {
1407
- label: "Facebook",
1408
- value: "facebook",
1409
- options: [
1410
- {
1411
- value: "facebook-post",
1412
- label: "Post",
1413
- w: 1200,
1414
- h: 630,
1415
- rightLabel: "1200 x 630"
1416
- },
1417
- {
1418
- value: "facebook-cover",
1419
- label: "Cover",
1420
- w: 851,
1421
- h: 315,
1422
- rightLabel: "851 x 315"
1423
- },
1424
- {
1425
- value: "facebook-profile",
1426
- label: "Profile",
1427
- w: 170,
1428
- h: 170,
1429
- rightLabel: "170 x 170"
1430
- },
1431
- {
1432
- value: "facebook-story",
1433
- label: "Story",
1434
- w: 1080,
1435
- h: 1920,
1436
- rightLabel: "1080 x 1920"
1437
- }
1438
- ]
1439
- },
1440
- {
1441
- label: "Instagram",
1442
- value: "instagram",
1443
- options: [
1444
- {
1445
- value: "instagram-landscape",
1446
- label: "Landscape",
1447
- w: 1080,
1448
- h: 566,
1449
- rightLabel: "1080 x 566"
1450
- },
1451
- {
1452
- value: "instagram-portait",
1453
- label: "Portait",
1454
- w: 1080,
1455
- h: 1350,
1456
- rightLabel: "1080 x 1350"
1457
- },
1458
- {
1459
- value: "instagram-square",
1460
- label: "Square",
1461
- w: 1080,
1462
- h: 1080,
1463
- rightLabel: "1080 x 1080"
1464
- },
1465
- {
1466
- value: "instagram-story",
1467
- label: "Story",
1468
- w: 1080,
1469
- h: 1920,
1470
- rightLabel: "1080 x 1920"
1471
- },
1472
- {
1473
- value: "instagram-thumbnail",
1474
- label: "Thumbnail",
1475
- w: 161,
1476
- h: 161,
1477
- rightLabel: "161 x 161"
1478
- }
1479
- ]
1480
- },
1481
- {
1482
- label: "LinkedIn",
1483
- value: "linkedin",
1484
- options: [
1485
- {
1486
- value: "linkedin-blog-post",
1487
- label: "Blog Post",
1488
- w: 1200,
1489
- h: 627,
1490
- rightLabel: "1200 x 627"
1491
- },
1492
- {
1493
- value: "linkedin-cover",
1494
- label: "Cover",
1495
- w: 1128,
1496
- h: 191,
1497
- rightLabel: "1128 x 191"
1803
+ }, ht = Te.map((e) => e.options).flat(), gt = () => {
1804
+ let { setCurrentAction: e, currentAction: t, setSidebar: n } = j(), r = t?.name === "crop" && ht.some((e) => e.value === t.args.id) ? t.args.id : "";
1805
+ return /* @__PURE__ */ (0, h.jsxs)("div", {
1806
+ className: $.sidebarPreset,
1807
+ children: [/* @__PURE__ */ (0, h.jsx)("h4", { children: "Presets" }), /* @__PURE__ */ (0, h.jsx)("div", { children: /* @__PURE__ */ (0, h.jsx)(ge, {
1808
+ value: r,
1809
+ placeholder: "Select a preset",
1810
+ onChange: (t) => {
1811
+ if (!t) return;
1812
+ let r = Te.map((e) => e.options).flat().find((e) => e.value === t);
1813
+ if (!r) return;
1814
+ let i = {
1815
+ id: t,
1816
+ ratio: r.w / r.h,
1817
+ isFree: !1,
1818
+ preset: {
1819
+ width: r.w,
1820
+ height: r.h
1821
+ }
1822
+ };
1823
+ e({
1824
+ name: "crop",
1825
+ args: i
1826
+ }), n(!1);
1498
1827
  },
1499
- {
1500
- value: "linkedin-profile",
1501
- label: "Profile",
1502
- w: 400,
1503
- h: 400,
1504
- rightLabel: "400 x 400"
1505
- }
1506
- ]
1507
- }
1508
- ], Ee = $.map((e) => e.options).flat(), De = () => {
1509
- let { setCurrentAction: e, currentAction: t, setSidebar: n } = R(), r = t?.name === "crop" && Ee.some((e) => e.value === t.args.id) ? t.args.id : "";
1510
- return /* @__PURE__ */ (0, p.jsxs)("div", {
1511
- className: "sidebar-preset",
1512
- children: [/* @__PURE__ */ (0, p.jsx)("h4", { children: "Presets" }), /* @__PURE__ */ (0, p.jsx)("div", {
1513
- className: "relative",
1514
- children: /* @__PURE__ */ (0, p.jsx)(te, {
1515
- value: r,
1516
- placeholder: "Select a preset",
1517
- onChange: (t) => {
1518
- if (!t) return;
1519
- let r = $.map((e) => e.options).flat().find((e) => e.value === t);
1520
- if (!r) return;
1521
- let i = {
1522
- id: t,
1523
- ratio: r.w / r.h,
1524
- isFree: !1,
1525
- preset: {
1526
- w: r.w,
1527
- h: r.h
1528
- }
1529
- };
1530
- e({
1531
- name: "crop",
1532
- args: i
1533
- }), n(!1);
1534
- },
1535
- items: $
1536
- })
1537
- })]
1828
+ items: Te
1829
+ }) })]
1830
+ });
1831
+ }, _t = () => {
1832
+ let { setCurrentAction: e, setSidebar: t } = j();
1833
+ return /* @__PURE__ */ (0, h.jsx)(N, {
1834
+ variant: "outline",
1835
+ className: $.resize,
1836
+ onClick: () => {
1837
+ e({
1838
+ name: w.FLIP,
1839
+ args: {
1840
+ horizontal: !1,
1841
+ vertical: !1
1842
+ }
1843
+ }), t(!1);
1844
+ },
1845
+ children: /* @__PURE__ */ (0, h.jsxs)("div", {
1846
+ className: $.resizeIcon,
1847
+ children: [/* @__PURE__ */ (0, h.jsx)(le, {}), "Flip"]
1848
+ })
1538
1849
  });
1539
- }, Oe = () => {
1540
- let { getSidebar: e, setSidebar: t } = R(), n = e(), r = w("md");
1541
- return /* @__PURE__ */ (0, p.jsxs)(p.Fragment, { children: [/* @__PURE__ */ (0, p.jsx)(z, {
1850
+ }, vt = () => {
1851
+ let { getLastRotation: e, setCurrentAction: t, setSidebar: n } = j();
1852
+ return /* @__PURE__ */ (0, h.jsx)(N, {
1542
1853
  variant: "outline",
1543
- className: "sidebar-settings",
1854
+ className: $.resize,
1855
+ onClick: () => {
1856
+ t({
1857
+ name: "rotate",
1858
+ args: { degrees: e() }
1859
+ }), n(!1);
1860
+ },
1861
+ children: /* @__PURE__ */ (0, h.jsxs)("div", {
1862
+ className: $.resizeIcon,
1863
+ children: [/* @__PURE__ */ (0, h.jsx)(de, {}), "Rotate"]
1864
+ })
1865
+ });
1866
+ }, yt = () => {
1867
+ let { sidebar: e, setSidebar: t } = j(), n = ee("md");
1868
+ return /* @__PURE__ */ (0, h.jsxs)(h.Fragment, { children: [/* @__PURE__ */ (0, h.jsx)(N, {
1869
+ variant: "outline",
1870
+ className: $.settings,
1544
1871
  onClick: () => t(!0),
1545
- children: /* @__PURE__ */ (0, p.jsx)(M, {})
1546
- }), /* @__PURE__ */ (0, p.jsx)("div", {
1547
- className: "sidebar",
1548
- style: { transform: r && n ? "translateX(-320px)" : "translateX(0%)" },
1549
- children: /* @__PURE__ */ (0, p.jsx)("div", {
1550
- className: "sidebar-container",
1551
- children: /* @__PURE__ */ (0, p.jsxs)("div", {
1552
- className: "sidebar-content",
1872
+ children: /* @__PURE__ */ (0, h.jsx)(ae, {})
1873
+ }), /* @__PURE__ */ (0, h.jsx)("div", {
1874
+ className: $.sidebar,
1875
+ style: { transform: n && e ? "translateX(-320px)" : "translateX(0%)" },
1876
+ children: /* @__PURE__ */ (0, h.jsx)("div", {
1877
+ className: $.container,
1878
+ children: /* @__PURE__ */ (0, h.jsxs)("div", {
1879
+ className: $.content,
1553
1880
  children: [
1554
- r && /* @__PURE__ */ (0, p.jsx)(z, {
1881
+ n && /* @__PURE__ */ (0, h.jsx)(N, {
1555
1882
  variant: "ghost",
1556
- className: "sidebar-close-btn btn-rect",
1883
+ className: `${$.closeBtn} ${M.rect}`,
1557
1884
  onClick: () => t(!1),
1558
- children: /* @__PURE__ */ (0, p.jsx)(D, {})
1885
+ children: /* @__PURE__ */ (0, h.jsx)(te, {})
1559
1886
  }),
1560
- /* @__PURE__ */ (0, p.jsx)(we, {}),
1561
- /* @__PURE__ */ (0, p.jsx)(V, { className: "sidebar-separator" }),
1562
- /* @__PURE__ */ (0, p.jsx)(Te, {}),
1563
- /* @__PURE__ */ (0, p.jsx)(V, { className: "sidebar-separator" }),
1564
- /* @__PURE__ */ (0, p.jsx)(De, {})
1887
+ /* @__PURE__ */ (0, h.jsx)(pt, {}),
1888
+ /* @__PURE__ */ (0, h.jsx)(F, { className: $.separator }),
1889
+ /* @__PURE__ */ (0, h.jsx)(mt, {}),
1890
+ /* @__PURE__ */ (0, h.jsx)(F, { className: $.separator }),
1891
+ /* @__PURE__ */ (0, h.jsx)(gt, {}),
1892
+ /* @__PURE__ */ (0, h.jsx)(F, { className: $.separator }),
1893
+ /* @__PURE__ */ (0, h.jsxs)("div", {
1894
+ className: $.flipRotate,
1895
+ children: [/* @__PURE__ */ (0, h.jsx)(_t, {}), /* @__PURE__ */ (0, h.jsx)(vt, {})]
1896
+ })
1565
1897
  ]
1566
1898
  })
1567
1899
  })
1568
1900
  })] });
1569
- }, ke = ({ image: e, onSave: t, onBack: n }) => {
1570
- let { loading: r, error: i, width: a, height: o, base64: s, extension: c } = y(e);
1571
- return r || i || !s || !c ? /* @__PURE__ */ (0, p.jsxs)("div", {
1572
- className: "picedi sys",
1573
- children: [
1574
- r && /* @__PURE__ */ (0, p.jsx)(m, { size: 48 }),
1575
- i && /* @__PURE__ */ (0, p.jsx)("div", {
1576
- className: "text-red",
1577
- children: i
1578
- }),
1579
- !r && !i && (!s || !c) && /* @__PURE__ */ (0, p.jsx)("div", {
1580
- className: "text-red",
1581
- children: "Failed to load image."
1901
+ }, bt = ({ image: e, onSave: t, onBack: n, theme: r = "light", settings: i = u }) => {
1902
+ let { loading: a, error: o, mimeType: s, width: c, height: l, originalBlob: d, previewUrl: f, isAlpha: p } = b(e);
1903
+ return a || o || !d || !s ? /* @__PURE__ */ (0, h.jsx)("div", {
1904
+ className: `${P.root} ${P.wrapper}`,
1905
+ "data-theme": r,
1906
+ children: /* @__PURE__ */ (0, h.jsxs)("div", {
1907
+ className: P.system,
1908
+ children: [
1909
+ a && /* @__PURE__ */ (0, h.jsx)(A, { style: {
1910
+ width: 48,
1911
+ height: 48
1912
+ } }),
1913
+ o && /* @__PURE__ */ (0, h.jsx)("div", {
1914
+ className: P.textRed,
1915
+ children: o
1916
+ }),
1917
+ !a && !o && (!d || !s) && /* @__PURE__ */ (0, h.jsx)("div", {
1918
+ className: P.textRed,
1919
+ children: "Failed to load image."
1920
+ })
1921
+ ]
1922
+ })
1923
+ }) : /* @__PURE__ */ (0, h.jsx)(g, {
1924
+ mimeType: s,
1925
+ width: c,
1926
+ height: l,
1927
+ originalBlob: d,
1928
+ previewUrl: f,
1929
+ isAlpha: p,
1930
+ settings: {
1931
+ ...u,
1932
+ ...i
1933
+ },
1934
+ children: /* @__PURE__ */ (0, h.jsx)("div", {
1935
+ className: `${P.root} ${P.wrapper}`,
1936
+ "data-theme": r,
1937
+ children: /* @__PURE__ */ (0, h.jsxs)("div", {
1938
+ className: P.main,
1939
+ children: [/* @__PURE__ */ (0, h.jsx)(qe, {
1940
+ onSave: t,
1941
+ onBack: n
1942
+ }), /* @__PURE__ */ (0, h.jsxs)("div", {
1943
+ className: P.grid,
1944
+ children: [/* @__PURE__ */ (0, h.jsx)(ft, {}), /* @__PURE__ */ (0, h.jsx)(yt, {})]
1945
+ })]
1582
1946
  })
1583
- ]
1584
- }) : /* @__PURE__ */ (0, p.jsx)(_, {
1585
- base64: s,
1586
- width: a,
1587
- height: o,
1588
- ext: c,
1589
- children: /* @__PURE__ */ (0, p.jsxs)("div", {
1590
- className: "picedi main",
1591
- children: [/* @__PURE__ */ (0, p.jsx)(re, {
1592
- onSave: t,
1593
- onBack: n
1594
- }), /* @__PURE__ */ (0, p.jsxs)("div", {
1595
- className: "grid",
1596
- children: [/* @__PURE__ */ (0, p.jsx)(Ce, {}), /* @__PURE__ */ (0, p.jsx)(Oe, {})]
1597
- })]
1598
1947
  })
1599
1948
  });
1600
1949
  };
1601
1950
  //#endregion
1602
- export { ke as ImageEditor };
1951
+ export { bt as Pixedi };