pixedi 1.0.6 → 1.1.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,11 @@
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)}})();
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}._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}:host{height:100%;display:block}:host *{box-sizing:border-box}._root_1kq9x_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-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);position:relative}._root_1kq9x_8[data-theme=dark]{--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)}._root_1kq9x_8 h1,._root_1kq9x_8 h2,._root_1kq9x_8 h3,._root_1kq9x_8 h4,._root_1kq9x_8 h5,._root_1kq9x_8 h6{margin:0;font-weight:600}._textRed_1kq9x_97{color:var(--color-red)}._bgRed_1kq9x_100{background-color:var(--color-red)}._bgGreen_1kq9x_103{background-color:var(--color-green)}._textGreen_1kq9x_106{color:var(--color-green)}._mask_1kq9x_109{background-color:var(--overlay-bg)}._semibold_1kq9x_112{letter-spacing:.4px;font-weight:600}._bold_1kq9x_116{letter-spacing:.4px;font-weight:700}._system_1kq9x_120{color:var(--muted-foreground);background-color:var(--background);justify-content:center;align-items:center;display:flex;position:absolute;inset:0}._wrapper_1kq9x_129{width:100%;height:100%;min-height:480px;position:relative}._main_1kq9x_135{background-color:var(--background);grid-template-rows:auto 1fr;display:grid;position:absolute;inset:0;overflow:hidden}._grid_1kq9x_143{grid-template-columns:1fr auto;min-height:0;display:grid;position:relative;overflow:hidden}._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}._scGroup_ih963_1{margin-left:4px;display:flex}._scGroupSave_ih963_6{border-top-right-radius:0;border-bottom-right-radius:0;width:36px}._scGroupClose_ih963_12{border-top-left-radius:0;border-bottom-left-radius:0;width:36px;margin-left:-1px}._header_1ff13_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}._headerTools_1ff13_11{gap:8px;display:flex}._headerHistory_1ff13_15{align-items:center;gap:8px;display:flex}._headerHistoryText_1ff13_20{color:var(--muted-foreground);font-size:14px}._resize_lyibl_1{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}._resizeText_lyibl_13{text-align:center;color:var(--muted-foreground);font-size:14px}._resizeBorder_lyibl_18{border-bottom:1px solid var(--border);width:60px;margin:12px auto 4px;display:inline-block}._resizeTools_lyibl_24{align-items:center;gap:6px;margin-top:16px;display:flex}._resizeToolsLock_lyibl_30{width:12px;height:12px;color:var(--muted-foreground)}._resizeToolsButtons_lyibl_35{margin-left:4px;display:flex}._resizeToolsSave_lyibl_39{border-top-right-radius:0;border-bottom-right-radius:0;width:36px}._resizeToolsClose_lyibl_44{border-top-left-radius:0;border-bottom-left-radius:0;width:36px;margin-left:-1px}._cropImage_1m63v_1{width:100%;height:100%;position:absolute;inset:0}._cropBox_1m63v_7{cursor:move;position:absolute}._cropTools_1m63v_11{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}._cropToolsInfo_1m63v_27{min-width:54px;margin-top:-2px;display:inline-block}._cropToolsInfoLabel_1m63v_32{color:var(--muted-foreground);font-size:12px;line-height:12px}._cropToolsInfoValue_1m63v_37{font-size:14px;line-height:14px}._cropBorder_1m63v_41{background-color:var(--accent-blue);position:absolute}._cropBorderTop_1m63v_45{cursor:ns-resize;width:100%;height:2px;top:0;left:0}._cropBorderRight_1m63v_52{cursor:ew-resize;width:2px;height:100%;top:0;right:0}._cropBorderBottom_1m63v_59{cursor:ns-resize;width:100%;height:2px;bottom:0;left:0;transform:translateY(1px)}._cropBorderLeft_1m63v_67{cursor:ew-resize;width:2px;height:100%;top:0;left:-1px;transform:translate(1px)}._cropLinesBox_1m63v_75{pointer-events:none;position:absolute;inset:2px}._cropLine_1m63v_75{border:1px dashed var(--color-white);opacity:.5;position:absolute}._cropLineVertical_1m63v_85{border-top:0;border-bottom:0;width:33%;height:100%;top:0;left:33%}._cropLineHorizontal_1m63v_93{border-left:0;border-right:0;width:100%;height:33%;top:33%;left:0}._cropPointer_1m63v_101{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}._cropPointerTopLeft_1m63v_110{cursor:nwse-resize;top:-5px;left:-5px}._cropPointerTop_1m63v_110{cursor:ns-resize;top:-5px;left:50%;transform:translate(-50%)}._cropPointerTopRight_1m63v_121{cursor:nesw-resize;top:-5px;right:-5px}._cropPointerRight_1m63v_126{cursor:ew-resize;top:50%;right:-5px;transform:translateY(-50%)}._cropPointerBottomRight_1m63v_132{cursor:nwse-resize;bottom:-5px;right:-5px}._cropPointerBottom_1m63v_132{cursor:ns-resize;bottom:-5px;left:50%;transform:translate(-50%)}._cropPointerBottomLeft_1m63v_143{cursor:nesw-resize;bottom:-5px;left:-5px}._cropPointerLeft_1m63v_148{cursor:ew-resize;top:50%;left:-5px;transform:translateY(-50%)}._cropMobileBorder_1m63v_154{box-sizing:border-box;border:2px solid var(--accent-blue);position:absolute;inset:0}._cropMobilePointer_1m63v_160{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_70quv_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}._flipBtnH_70quv_14{border-top-right-radius:0;border-bottom-right-radius:0;width:36px}._flipBtnV_70quv_20{border-top-left-radius:0;border-bottom-left-radius:0;width:36px;margin-left:-1px}._frame_ihor9_1{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}._framePreview_ihor9_13{-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%;display:block;position:relative}._frameImage_ihor9_25{object-fit:contain;width:100%;height:100%}._frameImageFaded_ihor9_30{opacity:.4}._sidebar_1obd8_1{z-index:10;width:0;transition:transform .15s ease-out;position:relative}@media (width>=768px){._sidebar_1obd8_1{width:320px;transition:none}}._sidebarSettings_1obd8_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){._sidebarSettings_1obd8_11{display:none}}._sidebarContainer_1obd8_25{box-sizing:border-box;border-left:1px solid var(--border);position:absolute;inset:0}._sidebarContent_1obd8_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){._sidebarContent_1obd8_31{padding-top:48px}}._sidebarCloseBtn_1obd8_47{position:absolute;top:8px;right:8px}._sidebarSeparator_1obd8_52{margin-top:20px;margin-bottom:12px}._sidebarResize_1obd8_56{justify-content:space-between;align-items:center;display:flex}._sidebarResizeIcon_1obd8_61{align-items:center;gap:8px;display:flex}._sidebarResizeSize_1obd8_66{color:var(--muted-foreground);font-size:14px}._sidebarCrop_1obd8_70{flex-direction:column;gap:8px;display:flex}._sidebarCropRatios_1obd8_75{grid-template-columns:repeat(3,1fr);gap:8px;display:grid}._sidebarPreset_1obd8_80{flex-direction:column;gap:8px;display:flex}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
2
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";
3
+ import { flushSync as l } from "react-dom";
3
4
  //#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) {
5
+ var u = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), d = /* @__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
6
  if (typeof require < "u") return require.apply(this, arguments);
6
7
  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) => {
8
+ }), f = /* @__PURE__ */ u(((e) => {
8
9
  var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
9
10
  function r(e, n, r) {
10
11
  var i = null;
@@ -19,11 +20,11 @@ var l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
19
20
  };
20
21
  }
21
22
  e.Fragment = n, e.jsx = r, e.jsxs = r;
22
- })), f = /* @__PURE__ */ l(((e) => {
23
+ })), p = /* @__PURE__ */ u(((e) => {
23
24
  process.env.NODE_ENV !== "production" && (function() {
24
25
  function t(e) {
25
26
  if (e == null) return null;
26
- if (typeof e == "function") return e.$$typeof === O ? null : e.displayName || e.name || null;
27
+ if (typeof e == "function") return e.$$typeof === ee ? null : e.displayName || e.name || null;
27
28
  if (typeof e == "string") return e;
28
29
  switch (e) {
29
30
  case v: return "Fragment";
@@ -31,7 +32,7 @@ var l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
31
32
  case y: return "StrictMode";
32
33
  case w: return "Suspense";
33
34
  case T: return "SuspenseList";
34
- case ee: return "Activity";
35
+ case O: return "Activity";
35
36
  }
36
37
  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
38
  case _: return "Portal";
@@ -91,7 +92,7 @@ var l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
91
92
  }
92
93
  function c(e, t) {
93
94
  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));
95
+ M || (M = !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
96
  }
96
97
  n.isReactWarning = !0, Object.defineProperty(e, "key", {
97
98
  get: n,
@@ -100,9 +101,9 @@ var l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
100
101
  }
101
102
  function l() {
102
103
  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;
104
+ return ne[e] || (ne[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
105
  }
105
- function d(e, t, n, r, i, a) {
106
+ function u(e, t, n, r, i, a) {
106
107
  var o = n.ref;
107
108
  return e = {
108
109
  $$typeof: g,
@@ -138,9 +139,9 @@ var l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
138
139
  value: a
139
140
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
140
141
  }
141
- function f(e, n, i, o, l, u) {
142
+ function f(e, n, i, o, l, d) {
142
143
  var f = n.children;
143
- if (f !== void 0) if (o) if (j(f)) {
144
+ if (f !== void 0) if (o) if (te(f)) {
144
145
  for (o = 0; o < f.length; o++) p(f[o]);
145
146
  Object.freeze && Object.freeze(f);
146
147
  } 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.");
@@ -150,11 +151,11 @@ var l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
150
151
  var m = Object.keys(n).filter(function(e) {
151
152
  return e !== "key";
152
153
  });
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);
154
+ o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", ae[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), ae[f + o] = !0);
154
155
  }
155
156
  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
157
  else i = n;
157
- return f && c(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), d(e, f, i, a(), l, u);
158
+ return f && c(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), u(e, f, i, a(), l, d);
158
159
  }
159
160
  function p(e) {
160
161
  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));
@@ -162,26 +163,26 @@ var l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
162
163
  function m(e) {
163
164
  return typeof e == "object" && !!e && e.$$typeof === g;
164
165
  }
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() {
166
+ var h = d("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"), O = Symbol.for("react.activity"), ee = Symbol.for("react.client.reference"), k = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, te = Array.isArray, j = console.createTask ? console.createTask : function() {
166
167
  return null;
167
168
  };
168
169
  h = { react_stack_bottom_frame: function(e) {
169
170
  return e();
170
171
  } };
171
- var N, P = {}, F = h.react_stack_bottom_frame.bind(h, o)(), I = M(i(o)), L = {};
172
+ var M, ne = {}, re = h.react_stack_bottom_frame.bind(h, o)(), ie = j(i(o)), ae = {};
172
173
  e.Fragment = v, e.jsx = function(e, t, n) {
173
174
  var r = 1e4 > k.recentlyCreatedOwnerStacks++;
174
- return f(e, t, n, !1, r ? Error("react-stack-top-frame") : F, r ? M(i(e)) : I);
175
+ return f(e, t, n, !1, r ? Error("react-stack-top-frame") : re, r ? j(i(e)) : ie);
175
176
  }, e.jsxs = function(e, t, n) {
176
177
  var r = 1e4 > k.recentlyCreatedOwnerStacks++;
177
- return f(e, t, n, !0, r ? Error("react-stack-top-frame") : F, r ? M(i(e)) : I);
178
+ return f(e, t, n, !0, r ? Error("react-stack-top-frame") : re, r ? j(i(e)) : ie);
178
179
  };
179
180
  })();
180
- })), p = (/* @__PURE__ */ l(((e, t) => {
181
- process.env.NODE_ENV === "production" ? t.exports = d() : t.exports = f();
181
+ })), m = (/* @__PURE__ */ u(((e, t) => {
182
+ process.env.NODE_ENV === "production" ? t.exports = f() : t.exports = p();
182
183
  })))();
183
- function m({ size: e = 36, className: t, style: n, color: r = "currentColor" }) {
184
- return /* @__PURE__ */ (0, p.jsxs)("svg", {
184
+ function h({ size: e = 36, className: t, style: n, color: r = "currentColor" }) {
185
+ return /* @__PURE__ */ (0, m.jsxs)("svg", {
185
186
  xmlns: "http://www.w3.org/2000/svg",
186
187
  x: "0px",
187
188
  y: "0px",
@@ -191,9 +192,9 @@ function m({ size: e = 36, className: t, style: n, color: r = "currentColor" })
191
192
  fill: r,
192
193
  className: t,
193
194
  style: n,
194
- children: [/* @__PURE__ */ (0, p.jsx)("path", {
195
+ children: [/* @__PURE__ */ (0, m.jsx)("path", {
195
196
  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
+ children: /* @__PURE__ */ (0, m.jsx)("animateTransform", {
197
198
  attributeType: "xml",
198
199
  attributeName: "transform",
199
200
  type: "rotate",
@@ -202,10 +203,10 @@ function m({ size: e = 36, className: t, style: n, color: r = "currentColor" })
202
203
  dur: "0.8s",
203
204
  repeatCount: "indefinite"
204
205
  })
205
- }), /* @__PURE__ */ (0, p.jsx)("path", {
206
+ }), /* @__PURE__ */ (0, m.jsx)("path", {
206
207
  fill: "currentColor",
207
208
  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
+ children: /* @__PURE__ */ (0, m.jsx)("animateTransform", {
209
210
  attributeType: "xml",
210
211
  attributeName: "transform",
211
212
  type: "rotate",
@@ -219,7 +220,7 @@ function m({ size: e = 36, className: t, style: n, color: r = "currentColor" })
219
220
  }
220
221
  //#endregion
221
222
  //#region src/shared/components/ImageEditor/provider/initialState.ts
222
- var h = (e, t, n, r) => ({
223
+ var g = (e, t, n, r) => ({
223
224
  history: {
224
225
  pointer: 0,
225
226
  items: [{
@@ -232,8 +233,8 @@ var h = (e, t, n, r) => ({
232
233
  currentAction: null,
233
234
  extension: e,
234
235
  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) => ({
236
+ }), _ = e(void 0), v = ({ children: e, base64: t, width: n, height: r, ext: i }) => {
237
+ let [a, o] = c(g(i, n, r, t)), s = () => a.currentAction, l = (e) => o((t) => ({
237
238
  ...t,
238
239
  currentAction: e
239
240
  })), u = (e) => o((t) => {
@@ -248,8 +249,8 @@ var h = (e, t, n, r) => ({
248
249
  };
249
250
  }), d = () => a.history.items.at(a.history.pointer), f = () => o((e) => ({
250
251
  ...e,
251
- history: h(i, n, r, t).history
252
- })), m = () => o((e) => {
252
+ history: g(i, n, r, t).history
253
+ })), p = () => o((e) => {
253
254
  let t = e.history.items.at(e.history.pointer);
254
255
  return {
255
256
  ...e,
@@ -258,7 +259,7 @@ var h = (e, t, n, r) => ({
258
259
  pointer: 0
259
260
  }
260
261
  };
261
- }), _ = () => o((e) => e.history.pointer <= 0 ? e : {
262
+ }), h = () => o((e) => e.history.pointer <= 0 ? e : {
262
263
  ...e,
263
264
  history: {
264
265
  ...e.history,
@@ -274,15 +275,15 @@ var h = (e, t, n, r) => ({
274
275
  ...t,
275
276
  sidebar: e
276
277
  }));
277
- return /* @__PURE__ */ (0, p.jsx)(g, {
278
+ return /* @__PURE__ */ (0, m.jsx)(_, {
278
279
  value: {
279
280
  ...a,
280
281
  getCurrentAction: s,
281
282
  setCurrentAction: l,
282
283
  addToHistory: u,
283
284
  resetHistory: f,
284
- resetHistoryAfterSave: m,
285
- undo: _,
285
+ resetHistoryAfterSave: p,
286
+ undo: h,
286
287
  redo: v,
287
288
  getLastHistoryItem: d,
288
289
  getSidebar: y,
@@ -290,13 +291,13 @@ var h = (e, t, n, r) => ({
290
291
  },
291
292
  children: e
292
293
  });
293
- }, v = {
294
+ }, y = {
294
295
  "image/jpeg": "jpg",
295
296
  "image/jpg": "jpg",
296
297
  "image/png": "png",
297
298
  "image/gif": "gif",
298
299
  "image/webp": "webp"
299
- }, y = (e) => {
300
+ }, b = (e) => {
300
301
  let [t, n] = c({
301
302
  loading: !0,
302
303
  error: null,
@@ -311,7 +312,7 @@ var h = (e, t, n, r) => ({
311
312
  try {
312
313
  let r = await fetch(e);
313
314
  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
+ let i = (r.headers.get("content-type") || "").split(";")[0].toLowerCase().trim(), a = i.startsWith("image/"), o = y[i] || "unknown";
315
316
  if (!a) {
316
317
  t && n((e) => ({
317
318
  ...e,
@@ -350,7 +351,7 @@ var h = (e, t, n, r) => ({
350
351
  t = !1;
351
352
  };
352
353
  }, [e]), t;
353
- }, b = () => {
354
+ }, x = () => {
354
355
  let e = s(null), t = n((e) => {
355
356
  let t = e.match(/^data:(image\/[a-zA-Z+.-]+);base64,(.+)$/);
356
357
  if (!t) throw Error("Invalid Base64 image format");
@@ -417,14 +418,14 @@ var h = (e, t, n, r) => ({
417
418
  a
418
419
  ])
419
420
  };
420
- }, x = () => {
421
+ }, S = () => {
421
422
  if (typeof window > "u" || !window.navigator) return null;
422
423
  let e = window.navigator.userAgent.toLowerCase();
423
424
  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
- }, S = () => {
425
- let [e] = c(() => x());
425
+ }, C = () => {
426
+ let [e] = c(() => S());
426
427
  return e;
427
- }, C = {
428
+ }, w = {
428
429
  sm: 640,
429
430
  md: 768,
430
431
  lg: 1024,
@@ -432,18 +433,18 @@ var h = (e, t, n, r) => ({
432
433
  };
433
434
  //#endregion
434
435
  //#region src/shared/components/ImageEditor/hooks/useBellow.tsx
435
- function w(e) {
436
- let [t, n] = c(() => window.innerWidth < C[e]);
436
+ function T(e) {
437
+ let [t, n] = c(() => window.innerWidth < w[e]);
437
438
  return i(() => {
438
439
  function t() {
439
- n(window.innerWidth < C[e]);
440
+ n(window.innerWidth < w[e]);
440
441
  }
441
442
  return window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
442
443
  }, [e]), t;
443
444
  }
444
445
  //#endregion
445
446
  //#region src/shared/components/ImageEditor/assets/icons.tsx
446
- var T = {
447
+ var E = {
447
448
  xmlns: "http://w3.org",
448
449
  width: "24",
449
450
  height: "24",
@@ -453,58 +454,58 @@ var T = {
453
454
  strokeWidth: "2",
454
455
  strokeLinecap: "round",
455
456
  strokeLinejoin: "round"
456
- }, E = (e) => /* @__PURE__ */ (0, p.jsx)("svg", {
457
- ...T,
457
+ }, D = (e) => /* @__PURE__ */ (0, m.jsx)("svg", {
458
+ ...E,
458
459
  ...e,
459
- children: /* @__PURE__ */ (0, p.jsx)("path", { d: "M20 6 9 17l-5-5" })
460
- }), D = (e) => /* @__PURE__ */ (0, p.jsxs)("svg", {
461
- ...T,
460
+ children: /* @__PURE__ */ (0, m.jsx)("path", { d: "M20 6 9 17l-5-5" })
461
+ }), O = (e) => /* @__PURE__ */ (0, m.jsxs)("svg", {
462
+ ...E,
462
463
  ...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", {
465
- ...T,
464
+ children: [/* @__PURE__ */ (0, m.jsx)("path", { d: "M18 6 6 18" }), /* @__PURE__ */ (0, m.jsx)("path", { d: "m6 6 12 12" })]
465
+ }), ee = (e) => /* @__PURE__ */ (0, m.jsxs)("svg", {
466
+ ...E,
466
467
  ...e,
467
- children: [/* @__PURE__ */ (0, p.jsx)("rect", {
468
+ children: [/* @__PURE__ */ (0, m.jsx)("rect", {
468
469
  width: "18",
469
470
  height: "11",
470
471
  x: "3",
471
472
  y: "11",
472
473
  rx: "2",
473
474
  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", {
476
- ...T,
475
+ }), /* @__PURE__ */ (0, m.jsx)("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })]
476
+ }), k = (e) => /* @__PURE__ */ (0, m.jsxs)("svg", {
477
+ ...E,
477
478
  ...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", {
480
- ...T,
479
+ children: [/* @__PURE__ */ (0, m.jsx)("path", { d: "m12 19-7-7 7-7" }), /* @__PURE__ */ (0, m.jsx)("path", { d: "M19 12H5" })]
480
+ }), A = (e) => /* @__PURE__ */ (0, m.jsx)("svg", {
481
+ ...E,
481
482
  ...e,
482
- children: /* @__PURE__ */ (0, p.jsx)("path", { d: "m6 9 6 6 6-6" })
483
- }), A = (e) => /* @__PURE__ */ (0, p.jsxs)("svg", {
484
- ...T,
483
+ children: /* @__PURE__ */ (0, m.jsx)("path", { d: "m6 9 6 6 6-6" })
484
+ }), te = (e) => /* @__PURE__ */ (0, m.jsxs)("svg", {
485
+ ...E,
485
486
  ...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", {
488
- ...T,
487
+ children: [/* @__PURE__ */ (0, m.jsx)("path", { d: "M3 7v6h6" }), /* @__PURE__ */ (0, m.jsx)("path", { d: "M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13" })]
488
+ }), j = (e) => /* @__PURE__ */ (0, m.jsxs)("svg", {
489
+ ...E,
489
490
  ...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", {
492
- ...T,
491
+ children: [/* @__PURE__ */ (0, m.jsx)("path", { d: "M21 7v6h-6" }), /* @__PURE__ */ (0, m.jsx)("path", { d: "M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7" })]
492
+ }), M = (e) => /* @__PURE__ */ (0, m.jsxs)("svg", {
493
+ ...E,
493
494
  ...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", {
495
+ children: [/* @__PURE__ */ (0, m.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, m.jsx)("circle", {
495
496
  cx: "12",
496
497
  cy: "12",
497
498
  r: "3"
498
499
  })]
499
- }), N = (e) => /* @__PURE__ */ (0, p.jsxs)("svg", {
500
- ...T,
500
+ }), ne = (e) => /* @__PURE__ */ (0, m.jsxs)("svg", {
501
+ ...E,
501
502
  ...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", {
504
- ...T,
503
+ children: [/* @__PURE__ */ (0, m.jsx)("path", { d: "M6 2v14a2 2 0 0 0 2 2h14" }), /* @__PURE__ */ (0, m.jsx)("path", { d: "M18 22V8a2 2 0 0 0-2-2H2" })]
504
+ }), re = (e) => /* @__PURE__ */ (0, m.jsxs)("svg", {
505
+ ...E,
505
506
  ...e,
506
507
  children: [
507
- /* @__PURE__ */ (0, p.jsx)("rect", {
508
+ /* @__PURE__ */ (0, m.jsx)("rect", {
508
509
  width: "18",
509
510
  height: "18",
510
511
  x: "3",
@@ -512,32 +513,32 @@ var T = {
512
513
  rx: "2",
513
514
  ry: "2"
514
515
  }),
515
- /* @__PURE__ */ (0, p.jsx)("circle", {
516
+ /* @__PURE__ */ (0, m.jsx)("circle", {
516
517
  cx: "9",
517
518
  cy: "9",
518
519
  r: "2"
519
520
  }),
520
- /* @__PURE__ */ (0, p.jsx)("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })
521
+ /* @__PURE__ */ (0, m.jsx)("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })
521
522
  ]
522
- }), F = (e) => /* @__PURE__ */ (0, p.jsx)("svg", {
523
- ...T,
523
+ }), ie = (e) => /* @__PURE__ */ (0, m.jsx)("svg", {
524
+ ...E,
524
525
  ...e,
525
- children: /* @__PURE__ */ (0, p.jsx)("rect", {
526
+ children: /* @__PURE__ */ (0, m.jsx)("rect", {
526
527
  width: "18",
527
528
  height: "18",
528
529
  x: "3",
529
530
  y: "3",
530
531
  rx: "2"
531
532
  })
532
- }), I = (e) => /* @__PURE__ */ (0, p.jsxs)("svg", {
533
- ...T,
533
+ }), ae = (e) => /* @__PURE__ */ (0, m.jsxs)("svg", {
534
+ ...E,
534
535
  ...e,
535
536
  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", {
537
+ /* @__PURE__ */ (0, m.jsx)("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }),
538
+ /* @__PURE__ */ (0, m.jsx)("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }),
539
+ /* @__PURE__ */ (0, m.jsx)("path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }),
540
+ /* @__PURE__ */ (0, m.jsx)("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" }),
541
+ /* @__PURE__ */ (0, m.jsx)("rect", {
541
542
  width: "10",
542
543
  height: "8",
543
544
  x: "7",
@@ -545,12 +546,34 @@ var T = {
545
546
  rx: "1"
546
547
  })
547
548
  ]
548
- }), L = (e) => /* @__PURE__ */ (0, p.jsx)("svg", {
549
- ...T,
549
+ }), oe = (e) => /* @__PURE__ */ (0, m.jsxs)("svg", {
550
+ ...E,
550
551
  ...e,
551
- children: /* @__PURE__ */ (0, p.jsx)("path", {
552
+ children: [
553
+ /* @__PURE__ */ (0, m.jsx)("path", { d: "M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3" }),
554
+ /* @__PURE__ */ (0, m.jsx)("path", { d: "M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3" }),
555
+ /* @__PURE__ */ (0, m.jsx)("path", { d: "M12 20v2" }),
556
+ /* @__PURE__ */ (0, m.jsx)("path", { d: "M12 14v2" }),
557
+ /* @__PURE__ */ (0, m.jsx)("path", { d: "M12 8v2" }),
558
+ /* @__PURE__ */ (0, m.jsx)("path", { d: "M12 2v2" })
559
+ ]
560
+ }), se = (e) => /* @__PURE__ */ (0, m.jsxs)("svg", {
561
+ ...E,
562
+ ...e,
563
+ children: [
564
+ /* @__PURE__ */ (0, m.jsx)("path", { d: "M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3" }),
565
+ /* @__PURE__ */ (0, m.jsx)("path", { d: "M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3" }),
566
+ /* @__PURE__ */ (0, m.jsx)("path", { d: "M4 12H2" }),
567
+ /* @__PURE__ */ (0, m.jsx)("path", { d: "M10 12H8" }),
568
+ /* @__PURE__ */ (0, m.jsx)("path", { d: "M16 12h-2" }),
569
+ /* @__PURE__ */ (0, m.jsx)("path", { d: "M22 12h-2" })
570
+ ]
571
+ }), ce = (e) => /* @__PURE__ */ (0, m.jsx)("svg", {
572
+ ...E,
573
+ ...e,
574
+ children: /* @__PURE__ */ (0, m.jsx)("path", {
552
575
  d: "M21 12a9 9 0 1 1-6.219-8.56",
553
- children: /* @__PURE__ */ (0, p.jsx)("animateTransform", {
576
+ children: /* @__PURE__ */ (0, m.jsx)("animateTransform", {
554
577
  attributeType: "xml",
555
578
  attributeName: "transform",
556
579
  type: "rotate",
@@ -560,42 +583,67 @@ var T = {
560
583
  repeatCount: "indefinite"
561
584
  })
562
585
  })
563
- }), R = () => {
564
- let e = r(g);
586
+ }), N = () => {
587
+ let e = r(_);
565
588
  if (!e) throw Error("useImageEditorContext must be used within an ImageEditorProvider");
566
589
  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,
590
+ }, P = {
591
+ button: "_button_snd36_1",
592
+ default: "_default_snd36_32",
593
+ outline: "_outline_snd36_39",
594
+ ghost: "_ghost_snd36_47",
595
+ rect: "_rect_snd36_54"
596
+ }, F = ({ className: e = "", variant: t = "default", children: n, ref: r, ...i }) => /* @__PURE__ */ (0, m.jsx)("button", {
597
+ ref: r,
598
+ className: `${P.button} ${P[t]} ${e}`.trim(),
599
+ ...i,
571
600
  children: n
572
- })), B = t(({ className: e = "", active: t = !1, icon: n, label: r, ...i }, a) => /* @__PURE__ */ (0, p.jsxs)("button", {
573
- ref: a,
601
+ }), le = { button: "_button_gf7m5_1" }, I = {
602
+ root: "_root_1kq9x_8",
603
+ textRed: "_textRed_1kq9x_97",
604
+ bgRed: "_bgRed_1kq9x_100",
605
+ bgGreen: "_bgGreen_1kq9x_103",
606
+ textGreen: "_textGreen_1kq9x_106",
607
+ mask: "_mask_1kq9x_109",
608
+ semibold: "_semibold_1kq9x_112",
609
+ bold: "_bold_1kq9x_116",
610
+ system: "_system_1kq9x_120",
611
+ wrapper: "_wrapper_1kq9x_129",
612
+ main: "_main_1kq9x_135",
613
+ grid: "_grid_1kq9x_143"
614
+ }, L = ({ className: e = "", active: t = !1, icon: n, label: r, ref: i, ...a }) => /* @__PURE__ */ (0, m.jsxs)("button", {
615
+ ref: i,
574
616
  type: "button",
575
617
  "aria-pressed": t,
576
- className: `btn-crop ${e}`.trim(),
577
- ...i,
578
- children: [n, /* @__PURE__ */ (0, p.jsx)("span", {
579
- className: "semibold",
618
+ className: `${le.button} ${e}`.trim(),
619
+ ...a,
620
+ children: [n, /* @__PURE__ */ (0, m.jsx)("span", {
621
+ className: I.semibold,
580
622
  children: r
581
623
  })]
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", {
624
+ }), ue = { separator: "_separator_rqskq_1" }, R = t(({ className: e = "", orientation: t = "horizontal", ...n }, r) => /* @__PURE__ */ (0, m.jsx)("hr", {
587
625
  ref: r,
588
626
  role: "separator",
589
627
  "aria-orientation": t,
590
628
  "data-orientation": t,
591
- className: `separator ${e}`.trim(),
629
+ className: `${ue.separator} ${e}`.trim(),
592
630
  ...n
593
631
  }));
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(() => {
632
+ R.displayName = "Separator";
633
+ var z = {
634
+ wrapper: "_wrapper_12rgt_1",
635
+ trigger: "_trigger_12rgt_6",
636
+ triggerArrow: "_triggerArrow_12rgt_29",
637
+ content: "_content_12rgt_38",
638
+ groupLabel: "_groupLabel_12rgt_68",
639
+ item: "_item_12rgt_75",
640
+ itemLeft: "_itemLeft_12rgt_91",
641
+ itemAddon: "_itemAddon_12rgt_95",
642
+ itemRightContainer: "_itemRightContainer_12rgt_112",
643
+ itemRight: "_itemRight_12rgt_112",
644
+ itemCheck: "_itemCheck_12rgt_121"
645
+ }, de = ({ items: e, value: t, onChange: n, placeholder: r = "Select an option", className: l = "", renderOption: u }) => {
646
+ let [d, f] = c(!1), p = s(null), h = s(null), g = s(null), _ = o(() => {
599
647
  let t = (e) => e.reduce((e, n) => n.options ? [...e, ...t(n.options.map((e) => ({
600
648
  ...e,
601
649
  fullName: `${n.label} ${e.label}`
@@ -604,157 +652,290 @@ var te = ({ items: e, value: t, onChange: n, placeholder: r = "Select an option"
604
652
  }, [e]).find((e) => e.value === t);
605
653
  i(() => {
606
654
  let e = (e) => {
607
- m.current && !m.current.contains(e.target) && f(!1);
655
+ p.current && !e.composedPath().includes(p.current) && f(!1);
608
656
  };
609
657
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
610
658
  }, []), a(() => {
611
659
  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)";
660
+ let e = p.current?.closest(`.${I.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)";
613
661
  i > r && (a = `calc(100% + 4px - ${i - r}px)`), g.current.style.top = a;
614
662
  }, [d, e]);
615
663
  let v = (e) => {
616
664
  n(e), f(!1);
617
665
  };
618
- return /* @__PURE__ */ (0, p.jsxs)("div", {
619
- ref: m,
620
- className: `select-wrapper ${l}`.trim(),
666
+ return /* @__PURE__ */ (0, m.jsxs)("div", {
667
+ ref: p,
668
+ className: `${z.wrapper} ${l}`.trim(),
621
669
  "data-state": d ? "open" : "closed",
622
- children: [/* @__PURE__ */ (0, p.jsxs)("button", {
670
+ children: [/* @__PURE__ */ (0, m.jsxs)("button", {
623
671
  ref: h,
624
672
  type: "button",
625
- className: "select-trigger",
673
+ className: z.trigger,
626
674
  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", {
675
+ children: [/* @__PURE__ */ (0, m.jsx)("span", { children: _ ? _.fullName : r }), /* @__PURE__ */ (0, m.jsx)(A, { className: z.triggerArrow })]
676
+ }), /* @__PURE__ */ (0, m.jsx)("div", {
629
677
  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",
678
+ className: z.content,
679
+ children: e.map((e, n) => e.options ? /* @__PURE__ */ (0, m.jsxs)("div", { children: [/* @__PURE__ */ (0, m.jsx)("div", {
680
+ className: `${z.groupLabel} ${I.semibold}`,
633
681
  children: e.label
634
- }), e.options.map((e) => /* @__PURE__ */ (0, p.jsxs)("div", {
635
- className: "select-item",
682
+ }), e.options.map((e) => /* @__PURE__ */ (0, m.jsxs)("div", {
683
+ className: z.item,
636
684
  onClick: () => v(e.value),
637
- children: [u ? u(e) : /* @__PURE__ */ (0, p.jsx)("span", {
638
- className: "select-item-left",
685
+ children: [u ? u(e) : /* @__PURE__ */ (0, m.jsx)("span", {
686
+ className: z.itemLeft,
639
687
  children: e.label
640
- }), /* @__PURE__ */ (0, p.jsxs)("div", {
641
- className: "select-item-addon",
688
+ }), /* @__PURE__ */ (0, m.jsxs)("div", {
689
+ className: z.itemAddon,
642
690
  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", {})
691
+ e.rightLabel && /* @__PURE__ */ (0, m.jsx)("span", { children: e.rightLabel }),
692
+ t === e.value && /* @__PURE__ */ (0, m.jsx)(D, { className: z.itemCheck }),
693
+ t !== e.value && /* @__PURE__ */ (0, m.jsx)("b", {})
646
694
  ]
647
695
  })]
648
- }, e.value))] }, `group-${n}`) : /* @__PURE__ */ (0, p.jsxs)("div", {
649
- className: "select-item",
696
+ }, e.value))] }, `group-${n}`) : /* @__PURE__ */ (0, m.jsxs)("div", {
697
+ className: z.item,
650
698
  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" })]
699
+ children: [u ? u(e) : /* @__PURE__ */ (0, m.jsx)("span", {
700
+ className: z.itemLeft,
701
+ children: e.label
702
+ }), t === e.value && /* @__PURE__ */ (0, m.jsx)(D, { className: z.itemCheck })]
655
703
  }, e.value))
656
704
  })]
657
705
  });
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(),
706
+ }, fe = {
707
+ input: "_input_j55nq_1",
708
+ numberClean: "_numberClean_j55nq_34"
709
+ }, pe = ({ className: e = "", type: t = "text", hideArrows: n = !0, ref: r, ...i }) => {
710
+ let a = t === "number" && n ? fe.numberClean : "";
711
+ return /* @__PURE__ */ (0, m.jsx)("input", {
712
+ ref: r,
713
+ type: t,
714
+ className: `${fe.input} ${a} ${e}`.trim(),
715
+ ...i
716
+ });
717
+ }, B = {
718
+ container: "_container_14vsv_1",
719
+ legend: "_legend_14vsv_4",
720
+ suffix: "_suffix_14vsv_13"
721
+ }, me = ({ label: e, className: t = "", style: n, ref: r, ...i }) => /* @__PURE__ */ (0, m.jsxs)("div", {
722
+ className: `${B.container} ${t}`.trim(),
669
723
  style: n,
670
724
  children: [
671
- /* @__PURE__ */ (0, p.jsx)("span", {
672
- className: "input-pixel-legend",
725
+ /* @__PURE__ */ (0, m.jsx)("span", {
726
+ className: B.legend,
673
727
  children: e
674
728
  }),
675
- /* @__PURE__ */ (0, p.jsx)(ne, {
676
- ref: i,
729
+ /* @__PURE__ */ (0, m.jsx)(pe, {
730
+ ref: r,
677
731
  type: "number",
678
- ...r
732
+ ...i
679
733
  }),
680
- /* @__PURE__ */ (0, p.jsx)("span", {
681
- className: "input-pixel-suffix",
734
+ /* @__PURE__ */ (0, m.jsx)("span", {
735
+ className: B.suffix,
682
736
  children: "px"
683
737
  })
684
738
  ]
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, {
739
+ }), V = {
740
+ scGroup: "_scGroup_ih963_1",
741
+ scGroupSave: "_scGroupSave_ih963_6",
742
+ scGroupClose: "_scGroupClose_ih963_12"
743
+ }, H = ({ onSave: e, onClose: t, saving: n = !1, disabled: r = !1 }) => /* @__PURE__ */ (0, m.jsxs)("div", {
744
+ className: V.scGroup,
745
+ children: [/* @__PURE__ */ (0, m.jsx)(F, {
746
+ variant: "outline",
747
+ className: `${V.scGroupSave} ${I.textGreen}`,
748
+ disabled: r || n,
749
+ onClick: e,
750
+ children: n ? /* @__PURE__ */ (0, m.jsx)(ce, {}) : /* @__PURE__ */ (0, m.jsx)(D, {})
751
+ }), /* @__PURE__ */ (0, m.jsx)(F, {
752
+ variant: "outline",
753
+ className: `${V.scGroupClose} ${I.textRed}`,
754
+ disabled: n,
755
+ onClick: t,
756
+ children: /* @__PURE__ */ (0, m.jsx)(O, {})
757
+ })]
758
+ }), U = {
759
+ header: "_header_1ff13_1",
760
+ headerTools: "_headerTools_1ff13_11",
761
+ headerHistory: "_headerHistory_1ff13_15",
762
+ headerHistoryText: "_headerHistoryText_1ff13_20"
763
+ }, he = ({ onBack: e, onSave: t }) => {
764
+ let [n, r] = c(!1), { history: i, undo: a, redo: o, resetHistory: s, resetHistoryAfterSave: l, getLastHistoryItem: u, setCurrentAction: d } = N(), { base64: f } = u(), p = i.items.length > 1 && !n, h = i.pointer === 0, g = i.pointer === i.items.length - 1, _ = i.items.length < 2 || n;
765
+ return /* @__PURE__ */ (0, m.jsxs)("div", {
766
+ className: U.header,
767
+ children: [/* @__PURE__ */ (0, m.jsx)(F, {
690
768
  variant: "ghost",
691
- className: "btn-rect",
769
+ className: P.rect,
692
770
  onClick: e,
693
- children: /* @__PURE__ */ (0, p.jsx)(O, {})
694
- }), /* @__PURE__ */ (0, p.jsxs)("div", {
695
- className: "header-tools",
771
+ children: /* @__PURE__ */ (0, m.jsx)(k, {})
772
+ }), /* @__PURE__ */ (0, m.jsxs)("div", {
773
+ className: U.headerTools,
696
774
  children: [
697
- f && /* @__PURE__ */ (0, p.jsxs)("div", {
698
- className: "header-history",
775
+ p && /* @__PURE__ */ (0, m.jsxs)("div", {
776
+ className: U.headerHistory,
699
777
  children: [
700
- /* @__PURE__ */ (0, p.jsx)(z, {
778
+ /* @__PURE__ */ (0, m.jsx)(F, {
701
779
  variant: "outline",
702
- disabled: m,
703
- className: "btn-rect",
780
+ disabled: h,
781
+ className: P.rect,
704
782
  onClick: a,
705
- children: /* @__PURE__ */ (0, p.jsx)(A, {})
783
+ children: /* @__PURE__ */ (0, m.jsx)(te, {})
706
784
  }),
707
- /* @__PURE__ */ (0, p.jsxs)("div", {
708
- className: "header-history-text",
785
+ /* @__PURE__ */ (0, m.jsxs)("div", {
786
+ className: U.headerHistoryText,
709
787
  children: [
710
788
  i.pointer + 1,
711
789
  "/",
712
790
  i.items.length
713
791
  ]
714
792
  }),
715
- /* @__PURE__ */ (0, p.jsx)(z, {
793
+ /* @__PURE__ */ (0, m.jsx)(F, {
716
794
  variant: "outline",
717
- disabled: h,
718
- className: "btn-rect",
795
+ disabled: g,
796
+ className: P.rect,
719
797
  onClick: o,
720
- children: /* @__PURE__ */ (0, p.jsx)(j, {})
798
+ children: /* @__PURE__ */ (0, m.jsx)(j, {})
721
799
  })
722
800
  ]
723
801
  }),
724
- /* @__PURE__ */ (0, p.jsx)(z, {
802
+ /* @__PURE__ */ (0, m.jsx)(F, {
725
803
  variant: "outline",
726
- disabled: n,
727
- onClick: s,
804
+ disabled: _,
805
+ onClick: () => {
806
+ d(null), s();
807
+ },
728
808
  children: "Reset"
729
809
  }),
730
- /* @__PURE__ */ (0, p.jsxs)(z, {
731
- disabled: g,
810
+ /* @__PURE__ */ (0, m.jsxs)(F, {
811
+ disabled: _,
732
812
  onClick: async () => {
733
- if (d) {
813
+ if (f) {
734
814
  r(!0);
735
815
  try {
736
- await t(d), l();
816
+ await t(f), d(null), l();
737
817
  } finally {
738
818
  r(!1);
739
819
  }
740
820
  }
741
821
  },
742
- children: [n ? /* @__PURE__ */ (0, p.jsx)(L, {}) : /* @__PURE__ */ (0, p.jsx)(E, {}), "Save"]
822
+ children: [n ? /* @__PURE__ */ (0, m.jsx)(ce, {}) : /* @__PURE__ */ (0, m.jsx)(D, {}), "Save"]
743
823
  })
744
824
  ]
745
825
  })]
746
826
  });
747
- }, U = 32, W = (e) => ({
827
+ }, W = {
828
+ resize: "_resize_lyibl_1",
829
+ resizeText: "_resizeText_lyibl_13",
830
+ resizeBorder: "_resizeBorder_lyibl_18",
831
+ resizeTools: "_resizeTools_lyibl_24",
832
+ resizeToolsLock: "_resizeToolsLock_lyibl_30",
833
+ resizeToolsButtons: "_resizeToolsButtons_lyibl_35",
834
+ resizeToolsSave: "_resizeToolsSave_lyibl_39",
835
+ resizeToolsClose: "_resizeToolsClose_lyibl_44"
836
+ }, G = 10, K = 200, ge = (e, t, n) => (e < G && (e = G), e > K && (e = K), {
837
+ updatedScale: e,
838
+ updatedWidth: Math.round(e / 100 * t),
839
+ updatedHeight: Math.round(e / 100 * n)
840
+ }), _e = ({ frameRef: e }) => {
841
+ let { getLastHistoryItem: t, setCurrentAction: r, addToHistory: a, setSidebar: o } = N(), { width: l, height: u, base64: d } = t(), [f, p] = c(!1), [h, g] = c(l), [_, v] = c(u), y = s(0), { resize: b } = x(), S = C(), w = n((t) => {
842
+ e.current && (e.current.style.transition = "transform 0.2s ease", e.current.style.transform = `scale(${t / 100})`);
843
+ }, [e]), T = (e) => {
844
+ let { updatedScale: t, updatedWidth: n, updatedHeight: r } = ge(parseInt(e.target.value) / l * 100, l, u);
845
+ g(n), v(r), w(t);
846
+ }, E = (e) => {
847
+ let { updatedScale: t, updatedWidth: n, updatedHeight: r } = ge(parseInt(e.target.value) / u * 100, l, u);
848
+ v(r), g(n), w(t);
849
+ }, D = () => {
850
+ w(100), r(null), o(!0);
851
+ }, O = async () => {
852
+ try {
853
+ p(!0);
854
+ let e = await b(d, h, _);
855
+ a({
856
+ name: "Resize",
857
+ base64: e,
858
+ width: h,
859
+ height: _
860
+ }), w(100), o(!0);
861
+ } catch (e) {
862
+ console.error("Failed to process image:", e);
863
+ } finally {
864
+ p(!1);
865
+ }
866
+ };
867
+ return i(() => {
868
+ let e = Math.round(h / l * 100), t = (e) => {
869
+ let { updatedHeight: t, updatedWidth: n } = ge(e, l, u);
870
+ v(t), g(n), w(e);
871
+ }, n = (n) => {
872
+ if (f) return;
873
+ let r = Math.sign(n.deltaY);
874
+ e -= r * 2, e <= G && (e = G), e >= K && (e = K), t(e);
875
+ }, r = (e) => {
876
+ y.current = e.touches[0].clientY;
877
+ }, i = (n) => {
878
+ if (f) return;
879
+ let r = n.touches[0].clientY, i = y.current - r;
880
+ Math.abs(i) < 10 || (e += Math.sign(i) * 2, e <= G && (e = G), e >= K && (e = K), t(e), y.current = r);
881
+ }, a = new AbortController(), { signal: o } = a;
882
+ return window.addEventListener("wheel", n, { signal: o }), window.addEventListener("touchstart", r, { signal: o }), window.addEventListener("touchmove", i, { signal: o }), () => a.abort();
883
+ }, [
884
+ u,
885
+ l,
886
+ w,
887
+ f,
888
+ S,
889
+ h
890
+ ]), /* @__PURE__ */ (0, m.jsxs)("div", {
891
+ className: W.resize,
892
+ children: [
893
+ /* @__PURE__ */ (0, m.jsx)("div", {
894
+ className: W.resizeText,
895
+ children: S ? "Slide UP/Down to Resize" : "Scroll UP/Down to Resize"
896
+ }),
897
+ /* @__PURE__ */ (0, m.jsx)("div", { className: W.resizeBorder }),
898
+ /* @__PURE__ */ (0, m.jsxs)("div", {
899
+ className: W.resizeTools,
900
+ children: [
901
+ /* @__PURE__ */ (0, m.jsx)(me, {
902
+ value: h,
903
+ name: "width",
904
+ label: "Width",
905
+ disabled: f,
906
+ style: { width: "88px" },
907
+ onChange: T
908
+ }),
909
+ /* @__PURE__ */ (0, m.jsx)(ee, { className: W.resizeToolsLock }),
910
+ /* @__PURE__ */ (0, m.jsx)(me, {
911
+ value: _,
912
+ name: "height",
913
+ label: "Height",
914
+ disabled: f,
915
+ style: { width: "88px" },
916
+ onChange: E
917
+ }),
918
+ /* @__PURE__ */ (0, m.jsx)(H, {
919
+ onSave: () => O(),
920
+ onClose: D,
921
+ saving: f,
922
+ disabled: h === l || f
923
+ })
924
+ ]
925
+ })
926
+ ]
927
+ });
928
+ }, q = 32, J = (e) => ({
748
929
  x: e.offsetLeft,
749
930
  y: e.offsetTop,
750
931
  w: e.offsetWidth,
751
932
  h: e.offsetHeight
752
- }), ie = (e, t, n, r, i, a, o, s) => {
933
+ }), ve = (e, t, n, r, i, a, o, s) => {
753
934
  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);
935
+ if (e) u += r - n, u + c > i && (u = i - c), u < q && (u = q);
755
936
  else {
756
937
  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);
938
+ if (u += e, d += o, l -= o / 2, l < 0 || d + l > a || u + c > i || u < q || d < q) return J(s);
758
939
  }
759
940
  return {
760
941
  x: c,
@@ -762,14 +943,14 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
762
943
  w: u,
763
944
  h: d
764
945
  };
765
- }, ae = (e, t, n, r, i, a, o, s) => {
946
+ }, ye = (e, t, n, r, i, a, o, s) => {
766
947
  let { x: c, y: l, w: u, h: d } = o;
767
948
  if (e) {
768
949
  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);
950
+ c += r - n, c < 0 && (c = 0), u = i - c - e, u < q && (u = q, c = i - e - q);
770
951
  } else {
771
952
  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);
953
+ if (u -= e, d -= i, c += e, l += i / 2, l < 0 || c < 0 || d + l > a || u < q || d < q) return J(s);
773
954
  }
774
955
  return {
775
956
  x: c,
@@ -777,12 +958,12 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
777
958
  w: u,
778
959
  h: d
779
960
  };
780
- }, oe = (e, t, n, r, i, a, o, s) => {
961
+ }, be = (e, t, n, r, i, a, o, s) => {
781
962
  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);
963
+ if (e) l += r - n, l < 0 && (l = 0), d = a - l - f, d < q && (d = q, l = a - f - q);
783
964
  else {
784
965
  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);
966
+ if (d -= e, u -= a, c += a / 2, l += e, l < 0 || c < 0 || u + c > i || u < q || d < q) return J(s);
786
967
  }
787
968
  return {
788
969
  x: c,
@@ -790,12 +971,12 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
790
971
  w: u,
791
972
  h: d
792
973
  };
793
- }, se = (e, t, n, r, i, a, o, s) => {
974
+ }, xe = (e, t, n, r, i, a, o, s) => {
794
975
  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);
976
+ if (e) d += r - n, d + c > a && (d = a - c), d < q && (d = q);
796
977
  else {
797
978
  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);
979
+ if (d += e, u += o, l -= o / 2, d + c > a || l < 0 || u + l > i || u < q || d < q) return J(s);
799
980
  }
800
981
  return {
801
982
  x: l,
@@ -803,13 +984,13 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
803
984
  w: u,
804
985
  h: d
805
986
  };
806
- }, ce = (e, t, n, r, i, a, o, s, c, l) => {
987
+ }, Se = (e, t, n, r, i, a, o, s, c, l) => {
807
988
  let { x: u, y: d, w: f, h: p } = c;
808
989
  if (e) {
809
990
  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);
991
+ u += i - n, u < 0 && (u = 0), f = o - u - e, f < q && (f = q, u = o - e - q);
811
992
  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);
993
+ d += a - r, d < 0 && (d = 0), p = s - d - t, p < q && (p = q, d = s - t - q);
813
994
  } else {
814
995
  if (t >= 1) {
815
996
  let e = i - n, r = Math.round(e / t);
@@ -818,7 +999,7 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
818
999
  let e = a - r, n = Math.round(e * t);
819
1000
  f -= n, p -= e, u += n, d += e;
820
1001
  }
821
- if (u < 0 || d < 0 || f < U || p < U) return W(l);
1002
+ if (u < 0 || d < 0 || f < q || p < q) return J(l);
822
1003
  }
823
1004
  return {
824
1005
  x: u,
@@ -826,12 +1007,12 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
826
1007
  w: f,
827
1008
  h: p
828
1009
  };
829
- }, le = (e, t, n, r, i, a, o, s, c, l) => {
1010
+ }, Ce = (e, t, n, r, i, a, o, s, c, l) => {
830
1011
  let { x: u } = c, { y: d, w: f, h: p } = c;
831
1012
  if (e) {
832
- f += i - n, f + u > o && (f = o - u), f < U && (f = U);
1013
+ f += i - n, f + u > o && (f = o - u), f < q && (f = q);
833
1014
  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);
1015
+ d += a - r, d < 0 && (d = 0), p = s - d - e, p < q && (p = q, d = s - e - q);
835
1016
  } else {
836
1017
  if (t > 1) {
837
1018
  let e = i - n, r = Math.round(e / t);
@@ -840,7 +1021,7 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
840
1021
  let e = a - r, n = Math.round(e * t);
841
1022
  f -= n, p -= e, d += e;
842
1023
  }
843
- if (f + u > o || d < 0 || f < U || p < U) return W(l);
1024
+ if (f + u > o || d < 0 || f < q || p < q) return J(l);
844
1025
  }
845
1026
  return {
846
1027
  x: u,
@@ -848,12 +1029,12 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
848
1029
  w: f,
849
1030
  h: p
850
1031
  };
851
- }, ue = (e, t, n, r, i, a, o, s, c, l) => {
1032
+ }, we = (e, t, n, r, i, a, o, s, c, l) => {
852
1033
  let { y: u } = c, { x: d, w: f, h: p } = c;
853
1034
  if (e) {
854
- p += a - r, p + u > s && (p = s - u), p < U && (p = U);
1035
+ p += a - r, p + u > s && (p = s - u), p < q && (p = q);
855
1036
  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);
1037
+ d += i - n, d < 0 && (d = 0), f = o - d - e, f < q && (f = q, d = o - e - q);
857
1038
  } else {
858
1039
  if (t >= 1) {
859
1040
  let e = i - n, r = Math.round(e / t);
@@ -862,7 +1043,7 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
862
1043
  let e = a - r, n = Math.round(e * t);
863
1044
  f += n, p += e, d -= n;
864
1045
  }
865
- if (p + u > s || d < 0 || f < U || p < U) return W(l);
1046
+ if (p + u > s || d < 0 || f < q || p < q) return J(l);
866
1047
  }
867
1048
  return {
868
1049
  x: d,
@@ -870,9 +1051,9 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
870
1051
  w: f,
871
1052
  h: p
872
1053
  };
873
- }, de = (e, t, n, r, i, a, o, s, c, l) => {
1054
+ }, Te = (e, t, n, r, i, a, o, s, c, l) => {
874
1055
  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);
1056
+ if (e) f += i - n, f + u > o && (f = o - u), f < q && (f = q), p += a - r, p + d > s && (p = s - d), p < q && (p = q);
876
1057
  else {
877
1058
  if (t >= 1) {
878
1059
  let e = i - n, r = Math.round(e / t);
@@ -881,7 +1062,7 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
881
1062
  let e = a - r, n = Math.round(e * t);
882
1063
  f += n, p += e;
883
1064
  }
884
- if (p + d > s || f + u > o || f < U || p < U) return W(l);
1065
+ if (p + d > s || f + u > o || f < q || p < q) return J(l);
885
1066
  }
886
1067
  return {
887
1068
  x: u,
@@ -889,12 +1070,12 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
889
1070
  w: f,
890
1071
  h: p
891
1072
  };
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) : {
1073
+ }, Ee = (e, t, n, r, i, a, o, s, c, l, u) => e === "r" ? ve(t, n, r, a, s, c, l, u) : e === "l" ? ye(t, n, r, a, s, c, l, u) : e === "t" ? be(t, n, i, o, s, c, l, u) : e === "b" ? xe(t, n, i, o, s, c, l, u) : e === "tl" ? Se(t, n, r, i, a, o, s, c, l, u) : e === "tr" ? Ce(t, n, r, i, a, o, s, c, l, u) : e === "bl" ? we(t, n, r, i, a, o, s, c, l, u) : e === "br" ? Te(t, n, r, i, a, o, s, c, l, u) : {
893
1074
  x: 0,
894
1075
  y: 0,
895
1076
  w: 0,
896
1077
  h: 0
897
- }, G = (e, t, n) => {
1078
+ }, De = (e, t, n) => {
898
1079
  let r = .1, i = t / n, a = 0, o = 0;
899
1080
  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
1081
  let s = a / t * 100, c = o / n * 100;
@@ -908,39 +1089,66 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
908
1089
  wPx: a,
909
1090
  hPx: o
910
1091
  };
911
- }, pe = () => {
912
- let { getCurrentAction: e, getLastHistoryItem: t } = R(), n = e(), r = S(), i = s(null), a = s(null), { handleCropStart: o } = be({
1092
+ }, Y = {
1093
+ cropImage: "_cropImage_1m63v_1",
1094
+ cropBox: "_cropBox_1m63v_7",
1095
+ cropTools: "_cropTools_1m63v_11",
1096
+ cropToolsInfo: "_cropToolsInfo_1m63v_27",
1097
+ cropToolsInfoLabel: "_cropToolsInfoLabel_1m63v_32",
1098
+ cropToolsInfoValue: "_cropToolsInfoValue_1m63v_37",
1099
+ cropBorder: "_cropBorder_1m63v_41",
1100
+ cropBorderTop: "_cropBorderTop_1m63v_45",
1101
+ cropBorderRight: "_cropBorderRight_1m63v_52",
1102
+ cropBorderBottom: "_cropBorderBottom_1m63v_59",
1103
+ cropBorderLeft: "_cropBorderLeft_1m63v_67",
1104
+ cropLinesBox: "_cropLinesBox_1m63v_75",
1105
+ cropLine: "_cropLine_1m63v_75",
1106
+ cropLineVertical: "_cropLineVertical_1m63v_85",
1107
+ cropLineHorizontal: "_cropLineHorizontal_1m63v_93",
1108
+ cropPointer: "_cropPointer_1m63v_101",
1109
+ cropPointerTopLeft: "_cropPointerTopLeft_1m63v_110",
1110
+ cropPointerTop: "_cropPointerTop_1m63v_110",
1111
+ cropPointerTopRight: "_cropPointerTopRight_1m63v_121",
1112
+ cropPointerRight: "_cropPointerRight_1m63v_126",
1113
+ cropPointerBottomRight: "_cropPointerBottomRight_1m63v_132",
1114
+ cropPointerBottom: "_cropPointerBottom_1m63v_132",
1115
+ cropPointerBottomLeft: "_cropPointerBottomLeft_1m63v_143",
1116
+ cropPointerLeft: "_cropPointerLeft_1m63v_148",
1117
+ cropMobileBorder: "_cropMobileBorder_1m63v_154",
1118
+ cropMobilePointer: "_cropMobilePointer_1m63v_160"
1119
+ }, Oe = () => {
1120
+ let { getCurrentAction: e, getLastHistoryItem: t } = N(), n = e(), r = C(), i = s(null), a = s(null), { handleCropStart: o } = Re({
913
1121
  imgRef: i,
914
1122
  cropRef: a
915
1123
  });
916
1124
  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", {
1125
+ let { width: c, height: l, base64: u } = t(), { x: d, y: f, w: p, h } = De(n.args.ratio, c, l);
1126
+ return /* @__PURE__ */ (0, m.jsxs)(m.Fragment, { children: [/* @__PURE__ */ (0, m.jsx)("img", {
919
1127
  ref: i,
920
1128
  src: u,
921
1129
  alt: "Image",
922
- className: "crop-image",
923
- style: { clipPath: `xywh(${d}% ${f}% ${m}% ${h}%)` }
924
- }), /* @__PURE__ */ (0, p.jsxs)("div", {
1130
+ className: Y.cropImage,
1131
+ style: { clipPath: `xywh(${d}% ${f}% ${p}% ${h}%)` }
1132
+ }), /* @__PURE__ */ (0, m.jsxs)("div", {
925
1133
  ref: a,
926
- className: "crop-box",
1134
+ className: Y.cropBox,
927
1135
  style: {
928
- width: `${m}%`,
1136
+ width: `${p}%`,
929
1137
  height: `${h}%`,
930
1138
  top: `${f}%`,
931
1139
  left: `${d}%`
932
1140
  },
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 })] })]
1141
+ children: [/* @__PURE__ */ (0, m.jsx)(Ne, {}), r ? /* @__PURE__ */ (0, m.jsx)(ze, { onMouseDown: o }) : /* @__PURE__ */ (0, m.jsxs)(m.Fragment, { children: [/* @__PURE__ */ (0, m.jsx)(Me, { onMouseDown: o }), /* @__PURE__ */ (0, m.jsx)(Pe, { onMouseDown: o })] })]
934
1142
  })] });
935
- }, K = new EventTarget(), q = (e) => {
1143
+ }, ke = new EventTarget(), Ae = (e) => {
936
1144
  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);
1145
+ ke.dispatchEvent(t);
1146
+ }, je = () => {
1147
+ let { setCurrentAction: e, getCurrentAction: t, getLastHistoryItem: n, addToHistory: r, setSidebar: a } = N(), { crop: o, resize: l } = x(), [u, d] = c(!1), f = t(), { base64: p, width: h, height: g } = n(), _ = s(null), v = s(null), y = s(null), b = s(null), S = s(null);
940
1148
  return i(() => {
941
1149
  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 = {
1150
+ let { x: e, y: t, w: n, h: r } = De(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);
1151
+ _.current && (_.current.textContent = i.toString()), v.current && (v.current.textContent = a.toString()), y.current && (y.current.textContent = o.toString()), b.current && (b.current.textContent = s.toString()), S.current = {
944
1152
  x: i,
945
1153
  y: a,
946
1154
  w: o,
@@ -948,71 +1156,64 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
948
1156
  };
949
1157
  let c = (e) => {
950
1158
  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());
1159
+ S.current = t.detail, _.current && (_.current.textContent = n.toString()), v.current && (v.current.textContent = r.toString()), y.current && (y.current.textContent = i.toString()), b.current && (b.current.textContent = a.toString());
952
1160
  };
953
- return K.addEventListener("crop-update", c), () => {
954
- K.removeEventListener("crop-update", c);
1161
+ return ke.addEventListener("crop-update", c), () => {
1162
+ ke.removeEventListener("crop-update", c);
955
1163
  };
956
1164
  }, [
957
1165
  f,
958
1166
  h,
959
1167
  g
960
- ]), /* @__PURE__ */ (0, p.jsxs)("div", {
961
- className: "crop-tools",
1168
+ ]), /* @__PURE__ */ (0, m.jsxs)("div", {
1169
+ className: Y.cropTools,
962
1170
  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",
1171
+ /* @__PURE__ */ (0, m.jsxs)("div", {
1172
+ className: Y.cropToolsInfo,
1173
+ children: [/* @__PURE__ */ (0, m.jsx)("div", {
1174
+ className: Y.cropToolsInfoLabel,
967
1175
  children: "left"
968
- }), /* @__PURE__ */ (0, p.jsx)("div", {
969
- className: "crop-tools-info-value semibold",
1176
+ }), /* @__PURE__ */ (0, m.jsx)("div", {
1177
+ className: `${Y.cropToolsInfoValue} ${I.semibold}`,
970
1178
  ref: _
971
1179
  })]
972
1180
  }),
973
- /* @__PURE__ */ (0, p.jsxs)("div", {
974
- className: "crop-tools-info",
975
- children: [/* @__PURE__ */ (0, p.jsx)("div", {
976
- className: "crop-tools-info-label",
1181
+ /* @__PURE__ */ (0, m.jsxs)("div", {
1182
+ className: Y.cropToolsInfo,
1183
+ children: [/* @__PURE__ */ (0, m.jsx)("div", {
1184
+ className: Y.cropToolsInfoLabel,
977
1185
  children: "top"
978
- }), /* @__PURE__ */ (0, p.jsx)("div", {
979
- className: "crop-tools-info-value semibold",
1186
+ }), /* @__PURE__ */ (0, m.jsx)("div", {
1187
+ className: `${Y.cropToolsInfoValue} ${I.semibold}`,
980
1188
  ref: v
981
1189
  })]
982
1190
  }),
983
- /* @__PURE__ */ (0, p.jsxs)("div", {
984
- className: "crop-tools-info",
985
- children: [/* @__PURE__ */ (0, p.jsx)("div", {
986
- className: "crop-tools-info-label",
1191
+ /* @__PURE__ */ (0, m.jsxs)("div", {
1192
+ className: Y.cropToolsInfo,
1193
+ children: [/* @__PURE__ */ (0, m.jsx)("div", {
1194
+ className: Y.cropToolsInfoLabel,
987
1195
  children: "width"
988
- }), /* @__PURE__ */ (0, p.jsx)("div", {
989
- className: "crop-tools-info-value semibold",
1196
+ }), /* @__PURE__ */ (0, m.jsx)("div", {
1197
+ className: `${Y.cropToolsInfoValue} ${I.semibold}`,
990
1198
  ref: y
991
1199
  })]
992
1200
  }),
993
- /* @__PURE__ */ (0, p.jsxs)("div", {
994
- className: "crop-tools-info",
995
- children: [/* @__PURE__ */ (0, p.jsx)("div", {
996
- className: "crop-tools-info-label",
1201
+ /* @__PURE__ */ (0, m.jsxs)("div", {
1202
+ className: Y.cropToolsInfo,
1203
+ children: [/* @__PURE__ */ (0, m.jsx)("div", {
1204
+ className: Y.cropToolsInfoLabel,
997
1205
  children: "height"
998
- }), /* @__PURE__ */ (0, p.jsx)("div", {
999
- className: "crop-tools-info-value semibold",
1000
- ref: x
1206
+ }), /* @__PURE__ */ (0, m.jsx)("div", {
1207
+ className: `${Y.cropToolsInfoValue} ${I.semibold}`,
1208
+ ref: b
1001
1209
  })]
1002
1210
  }),
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 () => {
1211
+ /* @__PURE__ */ (0, m.jsx)(H, {
1212
+ saving: u,
1213
+ onSave: async () => {
1013
1214
  if (!(!f || f.name !== "crop")) try {
1014
1215
  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);
1216
+ let { x: e, y: t, w: n, h: i } = S.current, { preset: s } = f.args, c = await o(p, e, t, n, i);
1016
1217
  if (s) {
1017
1218
  let { w: e, h: t } = s;
1018
1219
  c = await l(c, e, t);
@@ -1029,93 +1230,82 @@ var H = t(({ label: e, className: t = "", style: n, ...r }, i) => /* @__PURE__ *
1029
1230
  d(!1);
1030
1231
  }
1031
1232
  },
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: () => {
1233
+ onClose: () => {
1043
1234
  e(null), a(!0);
1044
- },
1045
- children: /* @__PURE__ */ (0, p.jsx)(D, { className: "text-red" })
1235
+ }
1046
1236
  })
1047
1237
  ]
1048
1238
  });
1049
- }, he = ({ onMouseDown: e }) => /* @__PURE__ */ (0, p.jsxs)(p.Fragment, { children: [
1050
- /* @__PURE__ */ (0, p.jsx)("span", {
1051
- className: "crop-b crop-b-t",
1239
+ }, Me = ({ onMouseDown: e }) => /* @__PURE__ */ (0, m.jsxs)(m.Fragment, { children: [
1240
+ /* @__PURE__ */ (0, m.jsx)("span", {
1241
+ className: `${Y.cropBorder} ${Y.cropBorderTop}`,
1052
1242
  onMouseDown: (t) => e(t, "t", "ns")
1053
1243
  }),
1054
- /* @__PURE__ */ (0, p.jsx)("span", {
1055
- className: "crop-b crop-b-r",
1244
+ /* @__PURE__ */ (0, m.jsx)("span", {
1245
+ className: `${Y.cropBorder} ${Y.cropBorderRight}`,
1056
1246
  onMouseDown: (t) => e(t, "r", "ew")
1057
1247
  }),
1058
- /* @__PURE__ */ (0, p.jsx)("span", {
1059
- className: "crop-b crop-b-b",
1248
+ /* @__PURE__ */ (0, m.jsx)("span", {
1249
+ className: `${Y.cropBorder} ${Y.cropBorderBottom}`,
1060
1250
  onMouseDown: (t) => e(t, "b", "ns")
1061
1251
  }),
1062
- /* @__PURE__ */ (0, p.jsx)("span", {
1063
- className: "crop-b crop-b-l",
1252
+ /* @__PURE__ */ (0, m.jsx)("span", {
1253
+ className: `${Y.cropBorder} ${Y.cropBorderLeft}`,
1064
1254
  onMouseDown: (t) => e(t, "l", "ew")
1065
1255
  })
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",
1256
+ ] }), Ne = () => /* @__PURE__ */ (0, m.jsxs)("div", {
1257
+ className: Y.cropLinesBox,
1258
+ children: [/* @__PURE__ */ (0, m.jsx)("span", { className: `${Y.cropLine} ${Y.cropLineVertical}` }), /* @__PURE__ */ (0, m.jsx)("span", { className: `${Y.cropLine} ${Y.cropLineHorizontal}` })]
1259
+ }), Pe = ({ onMouseDown: e }) => /* @__PURE__ */ (0, m.jsxs)(m.Fragment, { children: [
1260
+ /* @__PURE__ */ (0, m.jsx)("span", {
1261
+ className: `${Y.cropPointer} ${Y.cropPointerTopLeft}`,
1072
1262
  onMouseDown: (t) => e(t, "tl", "nwse")
1073
1263
  }),
1074
- /* @__PURE__ */ (0, p.jsx)("span", {
1075
- className: "crop-ps crop-ps-t",
1264
+ /* @__PURE__ */ (0, m.jsx)("span", {
1265
+ className: `${Y.cropPointer} ${Y.cropPointerTop}`,
1076
1266
  onMouseDown: (t) => e(t, "t", "ns")
1077
1267
  }),
1078
- /* @__PURE__ */ (0, p.jsx)("span", {
1079
- className: "crop-ps crop-ps-tr",
1268
+ /* @__PURE__ */ (0, m.jsx)("span", {
1269
+ className: `${Y.cropPointer} ${Y.cropPointerTopRight}`,
1080
1270
  onMouseDown: (t) => e(t, "tr", "nesw")
1081
1271
  }),
1082
- /* @__PURE__ */ (0, p.jsx)("span", {
1083
- className: "crop-ps crop-ps-r",
1272
+ /* @__PURE__ */ (0, m.jsx)("span", {
1273
+ className: `${Y.cropPointer} ${Y.cropPointerRight}`,
1084
1274
  onMouseDown: (t) => e(t, "r", "ew")
1085
1275
  }),
1086
- /* @__PURE__ */ (0, p.jsx)("span", {
1087
- className: "crop-ps crop-ps-br",
1276
+ /* @__PURE__ */ (0, m.jsx)("span", {
1277
+ className: `${Y.cropPointer} ${Y.cropPointerBottomRight}`,
1088
1278
  onMouseDown: (t) => e(t, "br", "nwse")
1089
1279
  }),
1090
- /* @__PURE__ */ (0, p.jsx)("span", {
1091
- className: "crop-ps crop-ps-b",
1280
+ /* @__PURE__ */ (0, m.jsx)("span", {
1281
+ className: `${Y.cropPointer} ${Y.cropPointerBottom}`,
1092
1282
  onMouseDown: (t) => e(t, "b", "ns")
1093
1283
  }),
1094
- /* @__PURE__ */ (0, p.jsx)("span", {
1095
- className: "crop-ps crop-ps-bl",
1284
+ /* @__PURE__ */ (0, m.jsx)("span", {
1285
+ className: `${Y.cropPointer} ${Y.cropPointerBottomLeft}`,
1096
1286
  onMouseDown: (t) => e(t, "bl", "nesw")
1097
1287
  }),
1098
- /* @__PURE__ */ (0, p.jsx)("span", {
1099
- className: "crop-ps crop-ps-l",
1288
+ /* @__PURE__ */ (0, m.jsx)("span", {
1289
+ className: `${Y.cropPointer} ${Y.cropPointerLeft}`,
1100
1290
  onMouseDown: (t) => e(t, "l", "ew")
1101
1291
  })
1102
1292
  ] });
1103
1293
  //#endregion
1104
1294
  //#region src/shared/components/ImageEditor/crop/useCropInteraction.ts
1105
- function J(e, t, n) {
1295
+ function Fe(e, t, n) {
1106
1296
  return Math.min(Math.max(e, t), n);
1107
1297
  }
1108
- function Y(e, t) {
1298
+ function X(e, t) {
1109
1299
  return e / t * 100;
1110
1300
  }
1111
- function ve(e, t, n, r, i) {
1301
+ function Ie(e, t, n, r, i) {
1112
1302
  e.style.left = `${t}%`, e.style.top = `${n}%`, e.style.width = `${r}%`, e.style.height = `${i}%`;
1113
1303
  }
1114
- function ye(e, t, n, r, i) {
1304
+ function Le(e, t, n, r, i) {
1115
1305
  e.style.clipPath = `xywh(${t}% ${n}% ${r}% ${i}%)`;
1116
1306
  }
1117
- var be = ({ imgRef: e, cropRef: t }) => {
1118
- let { getCurrentAction: n, getLastHistoryItem: r } = R(), a = S(), o = s(null), c = s(""), l = s({
1307
+ var Re = ({ imgRef: e, cropRef: t }) => {
1308
+ let { getCurrentAction: n, getLastHistoryItem: r } = N(), a = C(), o = s(null), c = s(""), l = s({
1119
1309
  xPct: 0,
1120
1310
  yPct: 0
1121
1311
  }), u = s({
@@ -1129,8 +1319,8 @@ var be = ({ imgRef: e, cropRef: t }) => {
1129
1319
  if (t.current) {
1130
1320
  let e = t.current.parentElement;
1131
1321
  e && (l.current = {
1132
- xPct: Y(t.current.offsetLeft, e.offsetWidth),
1133
- yPct: Y(t.current.offsetTop, e.offsetHeight)
1322
+ xPct: X(t.current.offsetLeft, e.offsetWidth),
1323
+ yPct: X(t.current.offsetTop, e.offsetHeight)
1134
1324
  });
1135
1325
  }
1136
1326
  let n = "clientX" in e ? e.clientX : e.touches[0].clientX, r = "clientY" in e ? e.clientY : e.touches[0].clientY;
@@ -1151,12 +1341,12 @@ var be = ({ imgRef: e, cropRef: t }) => {
1151
1341
  }, s = (e, t, i, a, s) => {
1152
1342
  let l = n();
1153
1343
  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);
1344
+ 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 } = Ee(c.current, d, f, o.current.x, o.current.y, p, m, a, s, u.current, t), y = X(h, a), b = X(g, s), x = X(_, a), S = X(v, s);
1345
+ Ie(t, y, b, x, S), Le(i, y, b, x, S);
1156
1346
  let C = r();
1157
1347
  if (!C) return;
1158
1348
  let { width: w, height: T } = C;
1159
- q({
1349
+ Ae({
1160
1350
  x: Math.round(y / 100 * w),
1161
1351
  y: Math.round(b / 100 * T),
1162
1352
  w: Math.round(x / 100 * w),
@@ -1164,19 +1354,18 @@ var be = ({ imgRef: e, cropRef: t }) => {
1164
1354
  });
1165
1355
  }, d = (e, t, n, i, a) => {
1166
1356
  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);
1357
+ 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 = X(u - o.current.x, i), p = X(d - o.current.y, a);
1169
1358
  o.current = {
1170
1359
  x: u,
1171
1360
  y: d
1172
1361
  };
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);
1362
+ let m = X(i - s, i), h = X(a - c, a), g = Fe(l.current.xPct + f, 0, m), _ = Fe(l.current.yPct + p, 0, h), v = X(s, i), y = X(c, a);
1174
1363
  l.current = {
1175
1364
  xPct: g,
1176
1365
  yPct: _
1177
- }, ve(t, g, _, v, y), ye(n, g, _, v, y);
1366
+ }, Ie(t, g, _, v, y), Le(n, g, _, v, y);
1178
1367
  let { width: b, height: x } = r();
1179
- q({
1368
+ Ae({
1180
1369
  x: Math.round(g / 100 * b),
1181
1370
  y: Math.round(_ / 100 * x),
1182
1371
  w: Math.round(v / 100 * b),
@@ -1207,142 +1396,118 @@ var be = ({ imgRef: e, cropRef: t }) => {
1207
1396
  y: s
1208
1397
  }, c.current = n, a || (t.current.style.cursor = `${r}-resize`, document.body.style.cursor = `${r}-resize`);
1209
1398
  } };
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",
1399
+ }, ze = ({ onMouseDown: e }) => /* @__PURE__ */ (0, m.jsx)("div", {
1400
+ className: Y.cropMobileBorder,
1401
+ children: /* @__PURE__ */ (0, m.jsx)("div", {
1402
+ className: Y.cropMobilePointer,
1214
1403
  onTouchStart: (t) => e(t, "br", "nwse")
1215
1404
  })
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
- }
1405
+ }), Z = {
1406
+ flip: "_flip_70quv_1",
1407
+ flipBtnH: "_flipBtnH_70quv_14",
1408
+ flipBtnV: "_flipBtnV_70quv_20"
1409
+ }, Be = ({ frameRef: e }) => {
1410
+ let { getLastHistoryItem: t, setCurrentAction: n, addToHistory: r, setSidebar: i } = N(), { flip: a } = x(), [o, s] = c(!1), [u, d] = c(!1), [f, p] = c(!1), { base64: h, width: g, height: _ } = t(), v = () => {
1411
+ e.current && (e.current.style.transition = "transform 0.2s ease");
1412
+ }, y = () => {
1413
+ e.current && (e.current.style.transition = "none");
1414
+ }, b = (t = !1, n = !1) => {
1415
+ e.current && (e.current.style.transform = `scale(${t ? -1 : 1}, ${n ? -1 : 1})`);
1244
1416
  };
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
- ]
1417
+ return /* @__PURE__ */ (0, m.jsxs)("div", {
1418
+ className: Z.flip,
1419
+ children: [/* @__PURE__ */ (0, m.jsxs)("div", {
1420
+ className: Z.scGroup,
1421
+ children: [/* @__PURE__ */ (0, m.jsx)(F, {
1422
+ variant: "outline",
1423
+ className: `${Z.flipBtnH}`,
1424
+ disabled: o,
1425
+ onClick: () => {
1426
+ d((e) => !e), v(), b(!u, f);
1427
+ },
1428
+ children: /* @__PURE__ */ (0, m.jsx)(oe, { style: { color: u ? "var(--accent-blue)" : "var(--foreground)" } })
1429
+ }), /* @__PURE__ */ (0, m.jsx)(F, {
1430
+ variant: "outline",
1431
+ className: `${Z.flipBtnV} `,
1432
+ disabled: o,
1433
+ onClick: () => {
1434
+ p((e) => !e), v(), b(u, !f);
1435
+ },
1436
+ children: /* @__PURE__ */ (0, m.jsx)(se, { style: { color: f ? "var(--accent-blue)" : "var(--foreground)" } })
1437
+ })]
1438
+ }), /* @__PURE__ */ (0, m.jsx)(H, {
1439
+ saving: o,
1440
+ disabled: o || !u && !f,
1441
+ onSave: async () => {
1442
+ try {
1443
+ s(!0);
1444
+ let e = await a(h, u, f);
1445
+ y(), l(() => {
1446
+ r({
1447
+ name: "Flip",
1448
+ base64: e,
1449
+ width: g,
1450
+ height: _
1451
+ });
1452
+ }), b(!1, !1), d(!1), p(!1), i(!0);
1453
+ } catch (e) {
1454
+ console.error("Failed to process image:", e);
1455
+ } finally {
1456
+ s(!1);
1457
+ }
1458
+ },
1459
+ onClose: () => {
1460
+ n(null), v(), b(!1, !1), i(!0);
1461
+ }
1462
+ })]
1315
1463
  });
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", {
1464
+ }, Q = {
1465
+ frame: "_frame_ihor9_1",
1466
+ framePreview: "_framePreview_ihor9_13",
1467
+ frameImage: "_frameImage_ihor9_25",
1468
+ frameImageFaded: "_frameImageFaded_ihor9_30"
1469
+ }, Ve = () => {
1470
+ let { getLastHistoryItem: e, currentAction: t } = N(), n = s(null), r = s(null), { width: i, height: a, base64: o } = e(), c = t?.name === "crop", l = t?.name === "resize", u = t?.name === "flip", d = c, f = `${Q.frame} ${d ? I.mask : ""}`, p = `${Q.frameImage} ${d ? Q.frameImageFaded : ""}`;
1471
+ return /* @__PURE__ */ (0, m.jsxs)("div", {
1321
1472
  className: f,
1322
1473
  children: [
1323
- /* @__PURE__ */ (0, p.jsxs)("div", {
1474
+ /* @__PURE__ */ (0, m.jsxs)("div", {
1324
1475
  ref: n,
1325
1476
  style: { aspectRatio: `${i} / ${a}` },
1326
- className: "frame-preview",
1327
- children: [/* @__PURE__ */ (0, p.jsx)("img", {
1477
+ className: Q.framePreview,
1478
+ children: [/* @__PURE__ */ (0, m.jsx)("img", {
1328
1479
  ref: r,
1329
1480
  src: o,
1330
1481
  alt: "Image",
1331
- className: m
1332
- }), c && /* @__PURE__ */ (0, p.jsx)(pe, {}, t?.args?.id)]
1482
+ className: p
1483
+ }), c && /* @__PURE__ */ (0, m.jsx)(Oe, {}, t?.args?.id)]
1333
1484
  }),
1334
- l && /* @__PURE__ */ (0, p.jsx)(Se, { onResizing: d }),
1335
- c && /* @__PURE__ */ (0, p.jsx)(me, {})
1485
+ l && /* @__PURE__ */ (0, m.jsx)(_e, { frameRef: n }),
1486
+ c && /* @__PURE__ */ (0, m.jsx)(je, {}),
1487
+ u && /* @__PURE__ */ (0, m.jsx)(Be, { frameRef: n })
1336
1488
  ]
1337
1489
  });
1338
- }, we = () => {
1339
- let { getLastHistoryItem: e, setCurrentAction: t, setSidebar: n } = R(), { width: r, height: i } = e() ?? {
1490
+ }, $ = {
1491
+ sidebar: "_sidebar_1obd8_1",
1492
+ sidebarSettings: "_sidebarSettings_1obd8_11",
1493
+ sidebarContainer: "_sidebarContainer_1obd8_25",
1494
+ sidebarContent: "_sidebarContent_1obd8_31",
1495
+ sidebarCloseBtn: "_sidebarCloseBtn_1obd8_47",
1496
+ sidebarSeparator: "_sidebarSeparator_1obd8_52",
1497
+ sidebarResize: "_sidebarResize_1obd8_56",
1498
+ sidebarResizeIcon: "_sidebarResizeIcon_1obd8_61",
1499
+ sidebarResizeSize: "_sidebarResizeSize_1obd8_66",
1500
+ sidebarCrop: "_sidebarCrop_1obd8_70",
1501
+ sidebarCropRatios: "_sidebarCropRatios_1obd8_75",
1502
+ sidebarPreset: "_sidebarPreset_1obd8_80"
1503
+ }, He = () => {
1504
+ let { getLastHistoryItem: e, setCurrentAction: t, setSidebar: n } = N(), { width: r, height: i } = e() ?? {
1340
1505
  width: 0,
1341
1506
  height: 0
1342
1507
  };
1343
- return /* @__PURE__ */ (0, p.jsxs)(z, {
1508
+ return /* @__PURE__ */ (0, m.jsxs)(F, {
1344
1509
  variant: "outline",
1345
- className: "sidebar-resize",
1510
+ className: $.sidebarResize,
1346
1511
  onClick: () => {
1347
1512
  t({
1348
1513
  name: "resize",
@@ -1352,11 +1517,11 @@ var be = ({ imgRef: e, cropRef: t }) => {
1352
1517
  }
1353
1518
  }), n(!1);
1354
1519
  },
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",
1520
+ children: [/* @__PURE__ */ (0, m.jsxs)("div", {
1521
+ className: $.sidebarResizeIcon,
1522
+ children: [/* @__PURE__ */ (0, m.jsx)(ae, {}), "Resize"]
1523
+ }), /* @__PURE__ */ (0, m.jsxs)("div", {
1524
+ className: $.sidebarResizeSize,
1360
1525
  children: [
1361
1526
  r,
1362
1527
  " x ",
@@ -1364,8 +1529,8 @@ var be = ({ imgRef: e, cropRef: t }) => {
1364
1529
  ]
1365
1530
  })]
1366
1531
  });
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) => {
1532
+ }, Ue = () => {
1533
+ let { currentAction: e, setCurrentAction: t, getLastHistoryItem: n, setSidebar: r } = N(), { name: i, args: a } = e || {}, o = i === "crop" ? a?.id : "", { width: s, height: c } = n(), l = s / c, u = (e) => {
1369
1534
  e !== o && (t({
1370
1535
  name: "crop",
1371
1536
  args: {
@@ -1376,33 +1541,33 @@ var be = ({ imgRef: e, cropRef: t }) => {
1376
1541
  }
1377
1542
  }), r(!1));
1378
1543
  };
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",
1544
+ return /* @__PURE__ */ (0, m.jsxs)("div", {
1545
+ className: $.sidebarCrop,
1546
+ children: [/* @__PURE__ */ (0, m.jsx)("h4", { children: "Crop" }), /* @__PURE__ */ (0, m.jsxs)("div", {
1547
+ className: $.sidebarCropRatios,
1383
1548
  children: [
1384
- /* @__PURE__ */ (0, p.jsx)(B, {
1549
+ /* @__PURE__ */ (0, m.jsx)(L, {
1385
1550
  label: "Freeform",
1386
- icon: /* @__PURE__ */ (0, p.jsx)(N, {}),
1551
+ icon: /* @__PURE__ */ (0, m.jsx)(ne, {}),
1387
1552
  active: o === "freeform",
1388
1553
  onClick: () => u("freeform")
1389
1554
  }),
1390
- /* @__PURE__ */ (0, p.jsx)(B, {
1555
+ /* @__PURE__ */ (0, m.jsx)(L, {
1391
1556
  label: "Original",
1392
- icon: /* @__PURE__ */ (0, p.jsx)(P, {}),
1557
+ icon: /* @__PURE__ */ (0, m.jsx)(re, {}),
1393
1558
  active: o === "original",
1394
1559
  onClick: () => u("original")
1395
1560
  }),
1396
- /* @__PURE__ */ (0, p.jsx)(B, {
1561
+ /* @__PURE__ */ (0, m.jsx)(L, {
1397
1562
  label: "1:1",
1398
- icon: /* @__PURE__ */ (0, p.jsx)(F, {}),
1563
+ icon: /* @__PURE__ */ (0, m.jsx)(ie, {}),
1399
1564
  active: o === "1:1",
1400
1565
  onClick: () => u("1:1")
1401
1566
  })
1402
1567
  ]
1403
1568
  })]
1404
1569
  });
1405
- }, $ = [
1570
+ }, We = [
1406
1571
  {
1407
1572
  label: "Facebook",
1408
1573
  value: "facebook",
@@ -1505,98 +1670,121 @@ var be = ({ imgRef: e, cropRef: t }) => {
1505
1670
  }
1506
1671
  ]
1507
1672
  }
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
- })]
1673
+ ], Ge = We.map((e) => e.options).flat(), Ke = () => {
1674
+ let { setCurrentAction: e, currentAction: t, setSidebar: n } = N(), r = t?.name === "crop" && Ge.some((e) => e.value === t.args.id) ? t.args.id : "";
1675
+ return /* @__PURE__ */ (0, m.jsxs)("div", {
1676
+ className: $.sidebarPreset,
1677
+ children: [/* @__PURE__ */ (0, m.jsx)("h4", { children: "Presets" }), /* @__PURE__ */ (0, m.jsx)("div", { children: /* @__PURE__ */ (0, m.jsx)(de, {
1678
+ value: r,
1679
+ placeholder: "Select a preset",
1680
+ onChange: (t) => {
1681
+ if (!t) return;
1682
+ let r = We.map((e) => e.options).flat().find((e) => e.value === t);
1683
+ if (!r) return;
1684
+ let i = {
1685
+ id: t,
1686
+ ratio: r.w / r.h,
1687
+ isFree: !1,
1688
+ preset: {
1689
+ w: r.w,
1690
+ h: r.h
1691
+ }
1692
+ };
1693
+ e({
1694
+ name: "crop",
1695
+ args: i
1696
+ }), n(!1);
1697
+ },
1698
+ items: We
1699
+ }) })]
1538
1700
  });
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, {
1701
+ }, qe = () => {
1702
+ let { setCurrentAction: e, setSidebar: t } = N();
1703
+ return /* @__PURE__ */ (0, m.jsx)(F, {
1704
+ variant: "outline",
1705
+ className: $.sidebarResize,
1706
+ onClick: () => {
1707
+ e({
1708
+ name: "flip",
1709
+ args: null
1710
+ }), t(!1);
1711
+ },
1712
+ children: /* @__PURE__ */ (0, m.jsxs)("div", {
1713
+ className: $.sidebarResizeIcon,
1714
+ children: [/* @__PURE__ */ (0, m.jsx)(oe, {}), "Flip"]
1715
+ })
1716
+ });
1717
+ }, Je = () => {
1718
+ let { getSidebar: e, setSidebar: t } = N(), n = e(), r = T("md");
1719
+ return /* @__PURE__ */ (0, m.jsxs)(m.Fragment, { children: [/* @__PURE__ */ (0, m.jsx)(F, {
1542
1720
  variant: "outline",
1543
- className: "sidebar-settings",
1721
+ className: $.sidebarSettings,
1544
1722
  onClick: () => t(!0),
1545
- children: /* @__PURE__ */ (0, p.jsx)(M, {})
1546
- }), /* @__PURE__ */ (0, p.jsx)("div", {
1547
- className: "sidebar",
1723
+ children: /* @__PURE__ */ (0, m.jsx)(M, {})
1724
+ }), /* @__PURE__ */ (0, m.jsx)("div", {
1725
+ className: $.sidebar,
1548
1726
  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",
1727
+ children: /* @__PURE__ */ (0, m.jsx)("div", {
1728
+ className: $.sidebarContainer,
1729
+ children: /* @__PURE__ */ (0, m.jsxs)("div", {
1730
+ className: $.sidebarContent,
1553
1731
  children: [
1554
- r && /* @__PURE__ */ (0, p.jsx)(z, {
1732
+ r && /* @__PURE__ */ (0, m.jsx)(F, {
1555
1733
  variant: "ghost",
1556
- className: "sidebar-close-btn btn-rect",
1734
+ className: `${$.sidebarCloseBtn} ${P.rect}`,
1557
1735
  onClick: () => t(!1),
1558
- children: /* @__PURE__ */ (0, p.jsx)(D, {})
1736
+ children: /* @__PURE__ */ (0, m.jsx)(O, {})
1559
1737
  }),
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, {})
1738
+ /* @__PURE__ */ (0, m.jsx)(He, {}),
1739
+ /* @__PURE__ */ (0, m.jsx)(R, { className: $.sidebarSeparator }),
1740
+ /* @__PURE__ */ (0, m.jsx)(Ue, {}),
1741
+ /* @__PURE__ */ (0, m.jsx)(R, { className: $.sidebarSeparator }),
1742
+ /* @__PURE__ */ (0, m.jsx)(Ke, {}),
1743
+ /* @__PURE__ */ (0, m.jsx)(R, { className: $.sidebarSeparator }),
1744
+ /* @__PURE__ */ (0, m.jsx)(qe, {})
1565
1745
  ]
1566
1746
  })
1567
1747
  })
1568
1748
  })] });
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."
1749
+ }, Ye = ({ image: e, onSave: t, onBack: n, theme: r = "light" }) => {
1750
+ let { loading: i, error: a, width: o, height: s, base64: c, extension: l } = b(e);
1751
+ return i || a || !c || !l ? /* @__PURE__ */ (0, m.jsx)("div", {
1752
+ className: `${I.root} ${I.wrapper}`,
1753
+ "data-theme": r,
1754
+ children: /* @__PURE__ */ (0, m.jsxs)("div", {
1755
+ className: I.system,
1756
+ children: [
1757
+ i && /* @__PURE__ */ (0, m.jsx)(h, { size: 48 }),
1758
+ a && /* @__PURE__ */ (0, m.jsx)("div", {
1759
+ className: I.textRed,
1760
+ children: a
1761
+ }),
1762
+ !i && !a && (!c || !l) && /* @__PURE__ */ (0, m.jsx)("div", {
1763
+ className: I.textRed,
1764
+ children: "Failed to load image."
1765
+ })
1766
+ ]
1767
+ })
1768
+ }) : /* @__PURE__ */ (0, m.jsx)(v, {
1769
+ base64: c,
1770
+ width: o,
1771
+ height: s,
1772
+ ext: l,
1773
+ children: /* @__PURE__ */ (0, m.jsx)("div", {
1774
+ className: `${I.root} ${I.wrapper}`,
1775
+ "data-theme": r,
1776
+ children: /* @__PURE__ */ (0, m.jsxs)("div", {
1777
+ className: I.main,
1778
+ children: [/* @__PURE__ */ (0, m.jsx)(he, {
1779
+ onSave: t,
1780
+ onBack: n
1781
+ }), /* @__PURE__ */ (0, m.jsxs)("div", {
1782
+ className: I.grid,
1783
+ children: [/* @__PURE__ */ (0, m.jsx)(Ve, {}), /* @__PURE__ */ (0, m.jsx)(Je, {})]
1784
+ })]
1582
1785
  })
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
1786
  })
1599
1787
  });
1600
1788
  };
1601
1789
  //#endregion
1602
- export { ke as ImageEditor };
1790
+ export { Ye as Pixedi };