ilx1-x-tool 1.2.4 → 1.2.5
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/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -106,6 +106,17 @@ declare const decompressJsonGzip: (file: File) => Promise<any>;
|
|
|
106
106
|
* @return {*}
|
|
107
107
|
********************************************************************************/
|
|
108
108
|
declare function isShowPopover(popId: string): boolean;
|
|
109
|
+
/********************************************************************************
|
|
110
|
+
* @brief: 关闭指定Popover
|
|
111
|
+
* @param {string} id
|
|
112
|
+
* @return {*}
|
|
113
|
+
********************************************************************************/
|
|
114
|
+
declare const closePopoverByID: (id: string) => void;
|
|
115
|
+
/********************************************************************************
|
|
116
|
+
* @brief: 关闭页面所有原生Popover
|
|
117
|
+
* @return {*}
|
|
118
|
+
********************************************************************************/
|
|
119
|
+
declare const closeAllNativePopover: () => void;
|
|
109
120
|
/********************************************************************************
|
|
110
121
|
* @brief: 判断图片是否有效
|
|
111
122
|
* @param {string} src
|
|
@@ -465,4 +476,4 @@ declare const calculateOutputSize: any;
|
|
|
465
476
|
declare const getSamplingModeDescription: any;
|
|
466
477
|
declare const getDefaultConfig: any;
|
|
467
478
|
|
|
468
|
-
export { type ConsoleType, Endianness, type Hex, type IConfig, ImageSamplingCol, ImageSamplingColRow, ImageSamplingRow, ImageSamplingRowCol, ImageToHexArray, type LoggerConfig, type ParsedColor, type ParsedHSL, type ParsedHSLA, type ParsedHSV, type ParsedRGB, type ParsedRGBA, type Result, arrayToHex, asciiArrToNum, base64ToImageData, bits16ToNum, bytesToNum, calculateOutputSize, colorImageSampling, compressJsonGzip, createImageData, debug, decompressJsonGzip, disableAllLogs, enableAllLogs, error, errorResult, formatHexOutput, generate, generatePreview, getDefaultConfig, getHIDCodeMapStr, getHIDCodeMapStrNum, getSamplingModeDescription, hex2hex, hidKeyCode, hslToHsv, hslToRgb, hsvToHsl, imageDataToHexArray, info, isImageValid, isShowPopover, log, numToAsciiArr, numToBits16, numToBytes, parseColorString, resetLoggerConfig, resizeImageWithCanvas, resizeImageWithKonva, rgbToHsl, setLoggerConfig, successResult, warn };
|
|
479
|
+
export { type ConsoleType, Endianness, type Hex, type IConfig, ImageSamplingCol, ImageSamplingColRow, ImageSamplingRow, ImageSamplingRowCol, ImageToHexArray, type LoggerConfig, type ParsedColor, type ParsedHSL, type ParsedHSLA, type ParsedHSV, type ParsedRGB, type ParsedRGBA, type Result, arrayToHex, asciiArrToNum, base64ToImageData, bits16ToNum, bytesToNum, calculateOutputSize, closeAllNativePopover, closePopoverByID, colorImageSampling, compressJsonGzip, createImageData, debug, decompressJsonGzip, disableAllLogs, enableAllLogs, error, errorResult, formatHexOutput, generate, generatePreview, getDefaultConfig, getHIDCodeMapStr, getHIDCodeMapStrNum, getSamplingModeDescription, hex2hex, hidKeyCode, hslToHsv, hslToRgb, hsvToHsl, imageDataToHexArray, info, isImageValid, isShowPopover, log, numToAsciiArr, numToBits16, numToBytes, parseColorString, resetLoggerConfig, resizeImageWithCanvas, resizeImageWithKonva, rgbToHsl, setLoggerConfig, successResult, warn };
|
package/dist/index.d.ts
CHANGED
|
@@ -106,6 +106,17 @@ declare const decompressJsonGzip: (file: File) => Promise<any>;
|
|
|
106
106
|
* @return {*}
|
|
107
107
|
********************************************************************************/
|
|
108
108
|
declare function isShowPopover(popId: string): boolean;
|
|
109
|
+
/********************************************************************************
|
|
110
|
+
* @brief: 关闭指定Popover
|
|
111
|
+
* @param {string} id
|
|
112
|
+
* @return {*}
|
|
113
|
+
********************************************************************************/
|
|
114
|
+
declare const closePopoverByID: (id: string) => void;
|
|
115
|
+
/********************************************************************************
|
|
116
|
+
* @brief: 关闭页面所有原生Popover
|
|
117
|
+
* @return {*}
|
|
118
|
+
********************************************************************************/
|
|
119
|
+
declare const closeAllNativePopover: () => void;
|
|
109
120
|
/********************************************************************************
|
|
110
121
|
* @brief: 判断图片是否有效
|
|
111
122
|
* @param {string} src
|
|
@@ -465,4 +476,4 @@ declare const calculateOutputSize: any;
|
|
|
465
476
|
declare const getSamplingModeDescription: any;
|
|
466
477
|
declare const getDefaultConfig: any;
|
|
467
478
|
|
|
468
|
-
export { type ConsoleType, Endianness, type Hex, type IConfig, ImageSamplingCol, ImageSamplingColRow, ImageSamplingRow, ImageSamplingRowCol, ImageToHexArray, type LoggerConfig, type ParsedColor, type ParsedHSL, type ParsedHSLA, type ParsedHSV, type ParsedRGB, type ParsedRGBA, type Result, arrayToHex, asciiArrToNum, base64ToImageData, bits16ToNum, bytesToNum, calculateOutputSize, colorImageSampling, compressJsonGzip, createImageData, debug, decompressJsonGzip, disableAllLogs, enableAllLogs, error, errorResult, formatHexOutput, generate, generatePreview, getDefaultConfig, getHIDCodeMapStr, getHIDCodeMapStrNum, getSamplingModeDescription, hex2hex, hidKeyCode, hslToHsv, hslToRgb, hsvToHsl, imageDataToHexArray, info, isImageValid, isShowPopover, log, numToAsciiArr, numToBits16, numToBytes, parseColorString, resetLoggerConfig, resizeImageWithCanvas, resizeImageWithKonva, rgbToHsl, setLoggerConfig, successResult, warn };
|
|
479
|
+
export { type ConsoleType, Endianness, type Hex, type IConfig, ImageSamplingCol, ImageSamplingColRow, ImageSamplingRow, ImageSamplingRowCol, ImageToHexArray, type LoggerConfig, type ParsedColor, type ParsedHSL, type ParsedHSLA, type ParsedHSV, type ParsedRGB, type ParsedRGBA, type Result, arrayToHex, asciiArrToNum, base64ToImageData, bits16ToNum, bytesToNum, calculateOutputSize, closeAllNativePopover, closePopoverByID, colorImageSampling, compressJsonGzip, createImageData, debug, decompressJsonGzip, disableAllLogs, enableAllLogs, error, errorResult, formatHexOutput, generate, generatePreview, getDefaultConfig, getHIDCodeMapStr, getHIDCodeMapStrNum, getSamplingModeDescription, hex2hex, hidKeyCode, hslToHsv, hslToRgb, hsvToHsl, imageDataToHexArray, info, isImageValid, isShowPopover, log, numToAsciiArr, numToBits16, numToBytes, parseColorString, resetLoggerConfig, resizeImageWithCanvas, resizeImageWithKonva, rgbToHsl, setLoggerConfig, successResult, warn };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var A=Object.create;var S=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var F=(e,t)=>{for(var r in t)S(e,r,{get:t[r],enumerable:!0})},C=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of P(t))!O.call(e,a)&&a!==r&&S(e,a,{get:()=>t[a],enumerable:!(n=D(t,a))||n.enumerable});return e};var U=(e,t,r)=>(r=e!=null?A(M(e)):{},C(t||!e||!e.__esModule?S(r,"default",{value:e,enumerable:!0}):r,e)),H=e=>C(S({},"__esModule",{value:!0}),e);var De={};F(De,{Endianness:()=>y,ImageSamplingCol:()=>xe,ImageSamplingColRow:()=>ke,ImageSamplingRow:()=>pe,ImageSamplingRowCol:()=>we,ImageToHexArray:()=>d,arrayToHex:()=>Se,asciiArrToNum:()=>X,base64ToImageData:()=>ye,bits16ToNum:()=>Q,bytesToNum:()=>j,calculateOutputSize:()=>Ce,colorImageSampling:()=>me,compressJsonGzip:()=>W,createImageData:()=>Te,debug:()=>de,decompressJsonGzip:()=>B,disableAllLogs:()=>ge,enableAllLogs:()=>ue,error:()=>le,errorResult:()=>$,formatHexOutput:()=>Ee,generate:()=>fe,generatePreview:()=>Ie,getDefaultConfig:()=>Ae,getHIDCodeMapStr:()=>G,getHIDCodeMapStrNum:()=>N,getSamplingModeDescription:()=>Le,hex2hex:()=>Re,hidKeyCode:()=>T,hslToHsv:()=>re,hslToRgb:()=>Z,hsvToHsl:()=>te,imageDataToHexArray:()=>he,info:()=>se,isImageValid:()=>_,isShowPopover:()=>V,log:()=>oe,numToAsciiArr:()=>q,numToBits16:()=>J,numToBytes:()=>K,parseColorString:()=>Y,resetLoggerConfig:()=>ce,resizeImageWithCanvas:()=>ve,resizeImageWithKonva:()=>be,rgbToHsl:()=>ee,setLoggerConfig:()=>E,successResult:()=>z,warn:()=>ie});module.exports=H(De);var T=[{key:0,word:"a",dec:"4",hex:"04",kind:1,value:4,aliases:["A"]},{key:2,word:"b",dec:"5",hex:"05",kind:1,value:5,aliases:["B"]},{key:4,word:"c",dec:"6",hex:"06",kind:1,value:6,aliases:["C"]},{key:6,word:"d",dec:"7",hex:"07",kind:1,value:7,aliases:["D"]},{key:8,word:"e",dec:"8",hex:"08",kind:1,value:8,aliases:["E"]},{key:10,word:"f",dec:"9",hex:"09",kind:1,value:9,aliases:["F"]},{key:12,word:"g",dec:"10",hex:"0A",kind:1,value:10,aliases:["G"]},{key:14,word:"h",dec:"11",hex:"0B",kind:1,value:11,aliases:["H"]},{key:16,word:"i",dec:"12",hex:"0C",kind:1,value:12,aliases:["I"]},{key:18,word:"j",dec:"13",hex:"0D",kind:1,value:13,aliases:["J"]},{key:20,word:"k",dec:"14",hex:"0E",kind:1,value:14,aliases:["K"]},{key:22,word:"l",dec:"15",hex:"0F",kind:1,value:15,aliases:["L"]},{key:24,word:"m",dec:"16",hex:"10",kind:1,value:16,aliases:["M"]},{key:26,word:"n",dec:"17",hex:"11",kind:1,value:17,aliases:["N"]},{key:28,word:"o",dec:"18",hex:"12",kind:1,value:18,aliases:["O"]},{key:30,word:"p",dec:"19",hex:"13",kind:1,value:19,aliases:["P"]},{key:32,word:"q",dec:"20",hex:"14",kind:1,value:20,aliases:["Q"]},{key:34,word:"r",dec:"21",hex:"15",kind:1,value:21,aliases:["R"]},{key:36,word:"s",dec:"22",hex:"16",kind:1,value:22,aliases:["S"]},{key:38,word:"t",dec:"23",hex:"17",kind:1,value:23,aliases:["T"]},{key:40,word:"u",dec:"24",hex:"18",kind:1,value:24,aliases:["U"]},{key:42,word:"v",dec:"25",hex:"19",kind:1,value:25,aliases:["V"]},{key:44,word:"w",dec:"26",hex:"1A",kind:1,value:26,aliases:["W"]},{key:46,word:"x",dec:"27",hex:"1B",kind:1,value:27,aliases:["X"]},{key:48,word:"y",dec:"28",hex:"1C",kind:1,value:28,aliases:["Y"]},{key:50,word:"z",dec:"29",hex:"1D",kind:1,value:29,aliases:["Z"]},{key:52,word:"1",dec:"30",hex:"1E",kind:1,value:30,aliases:["!","1!"]},{key:54,word:"2",dec:"31",hex:"1F",kind:1,value:31,aliases:["@","2@"]},{key:56,word:"3",dec:"32",hex:"20",kind:1,value:32,aliases:["#","3#"]},{key:58,word:"4",dec:"33",hex:"21",kind:1,value:33,aliases:["$","4$"]},{key:60,word:"5",dec:"34",hex:"22",kind:1,value:34,aliases:["%","5%"]},{key:62,word:"6",dec:"35",hex:"23",kind:1,value:35,aliases:["^","6^"]},{key:64,word:"7",dec:"36",hex:"24",kind:1,value:36,aliases:["&","7&"]},{key:66,word:"8",dec:"37",hex:"25",kind:1,value:37,aliases:["*","8*"]},{key:68,word:"9",dec:"38",hex:"26",kind:1,value:38,aliases:["(","9("]},{key:70,word:"0",dec:"39",hex:"27",kind:1,value:39,aliases:[")","0)"]},{key:77,word:"-",dec:"45",hex:"2D",kind:1,value:45,aliases:["_","-_"]},{key:79,word:"=",dec:"46",hex:"2E",kind:1,value:46,aliases:["+","=+"]},{key:81,word:"[",dec:"47",hex:"2F",kind:1,value:47,aliases:["{","[{"]},{key:83,word:"]",dec:"48",hex:"30",kind:1,value:48,aliases:["}","}]"]},{key:85,word:"\\",dec:"49",hex:"31",kind:1,value:49,aliases:["|","\\|"]},{key:87,word:"`",dec:"50",hex:"32",kind:1,value:50,aliases:["~","`~"]},{key:89,word:";",dec:"51",hex:"33",kind:1,value:51,aliases:[":",";:"]},{key:91,word:"'",dec:"52",hex:"34",kind:1,value:52,aliases:['"',`'"`]},{key:95,word:",",dec:"54",hex:"36",kind:1,value:54,aliases:["<",",<"]},{key:97,word:".",dec:"55",hex:"37",kind:1,value:55,aliases:[">",".>"]},{key:99,word:"/",dec:"56",hex:"38",kind:1,value:56,aliases:["?","/?"]},{key:72,word:"Enter",dec:"40",hex:"28",kind:1,value:40,aliases:["enter","ENTER"]},{key:73,word:"Escape",dec:"41",hex:"29",kind:1,value:41,aliases:["escape","ESCAPE"]},{key:74,word:"Backspace",dec:"42",hex:"2A",kind:1,value:42,aliases:["backspace","backSpace","BACKSPACE","Back Space","BACK SPACE","back space"]},{key:75,word:"Tab",dec:"43",hex:"2B",kind:1,value:43,aliases:["tab","TAB"]},{key:76,word:" ",dec:"44",hex:"2C",kind:1,value:44,aliases:["Space","SPACE","space"]},{key:101,word:"CapsLock",dec:"57",hex:"39",kind:1,value:57,aliases:["capsLock","capslock","CAPSLOCK","Caps Lock","CAPS LOCK","caps lock"]},{key:102,word:"F1",dec:"58",hex:"3A",kind:1,value:58,aliases:["f1","f 1"]},{key:103,word:"F2",dec:"59",hex:"3B",kind:1,value:59,aliases:["f2","f 2"]},{key:104,word:"F3",dec:"60",hex:"3C",kind:1,value:60,aliases:["f3","f 3"]},{key:105,word:"F4",dec:"61",hex:"3D",kind:1,value:61,aliases:["f4","f 4"]},{key:106,word:"F5",dec:"62",hex:"3E",kind:1,value:62,aliases:["f5","f 5"]},{key:107,word:"F6",dec:"63",hex:"3F",kind:1,value:63,aliases:["f6","f 6"]},{key:108,word:"F7",dec:"64",hex:"40",kind:1,value:64,aliases:["f7","f 7"]},{key:109,word:"F8",dec:"65",hex:"41",kind:1,value:65,aliases:["f8","f 8"]},{key:110,word:"F9",dec:"66",hex:"42",kind:1,value:66,aliases:["f9","f 9"]},{key:111,word:"F10",dec:"67",hex:"43",kind:1,value:67,aliases:["f10","f 10"]},{key:112,word:"F11",dec:"68",hex:"44",kind:1,value:68,aliases:["f11","f 11"]},{key:113,word:"F12",dec:"69",hex:"45",kind:1,value:69,aliases:["f12","f 12"]},{key:114,word:"PrintScreen",dec:"70",hex:"46",kind:1,value:70,aliases:["printScreen","printscreen","PRINTSCREEN","Print Screen","PRINT SCREEN","print screen"]},{key:115,word:"ScrollLock",dec:"71",hex:"47",kind:1,value:71,aliases:["scrollLock","scrolllock","SCROLLLOCK","Scroll Lock","SCROLL LOCK","scroll lock"]},{key:116,word:"Pause",dec:"72",hex:"48",kind:1,value:72,aliases:["pause","PAUSE"]},{key:117,word:"Insert",dec:"73",hex:"49",kind:1,value:73,aliases:["insert","INSERT"]},{key:118,word:"Home",dec:"74",hex:"4A",kind:1,value:74,aliases:["home","HOME"]},{key:119,word:"PageUp",dec:"75",hex:"4B",kind:1,value:75,aliases:["pageUp","pageup","PAGEUP","Page Up","PAGE UP","page up"]},{key:120,word:"DeleteForward",dec:"76",hex:"4C",kind:1,value:76,aliases:["deleteForward","deleteforward","DELETEFORWARD","Delete Forward","DELETE FORWARD","delete forward","Delete","DELETE","delete"]},{key:121,word:"End",dec:"77",hex:"4D",kind:1,value:77,aliases:["end","END"]},{key:122,word:"PageDown",dec:"78",hex:"4E",kind:1,value:78,aliases:["pageDown","pagedown","PAGEDOWN","Page Down","PAGE DOWN","page down"]},{key:123,word:"ArrowRight",dec:"79",hex:"4F",kind:1,value:79,aliases:["arrowRight","arrowright","ARROWRIGHT","Arrow Right","ARROW RIGHT","arrow right"]},{key:124,word:"ArrowLeft",dec:"80",hex:"50",kind:1,value:80,aliases:["arrowLeft","arrowleft","ARROWLEFT","Arrow Left","ARROW LEFT","arrow left"]},{key:125,word:"ArrowDown",dec:"81",hex:"51",kind:1,value:81,aliases:["arrowDown","arrowdown","ARROWDOWN","Arrow Down","ARROW DOWN","arrow down"]},{key:126,word:"ArrowUp",dec:"82",hex:"52",kind:1,value:82,aliases:["arrowUp","arrowup","ARROWUP","Arrow Up","ARROW UP","arrow up"]},{key:127,word:"NumLock",dec:"83",hex:"53",kind:1,value:83,aliases:["numLock","numlock","NUMLOCK","Num Lock","NUM LOCK","num lock"]},{key:128,word:"Clear",dec:"83",hex:"53",kind:1,value:83,aliases:["clear","CLEAR"]},{key:160,word:"F13",dec:"104",hex:"68",kind:0,value:104,aliases:["f13","f 13"]},{key:161,word:"F14",dec:"105",hex:"69",kind:0,value:105,aliases:["f14","f 14"]},{key:162,word:"F15",dec:"106",hex:"6A",kind:0,value:106,aliases:["f15","f 15"]},{key:163,word:"F16",dec:"107",hex:"6B",kind:0,value:107,aliases:["f16","f 16"]},{key:164,word:"LeftControl",dec:"224",hex:"E0",kind:0,value:224,aliases:["leftControl","leftcontrol","LEFTCONTROL","Left Control","LEFT CONTROL","left control","control","CONTROL","ctrl","CTRL"]},{key:165,word:"LeftShift",dec:"225",hex:"E1",kind:0,value:225,aliases:["leftShift","leftshift","LEFTSHIFT","Left Shift","LEFT SHIFT","left shift","shift","SHIFT"]},{key:166,word:"LeftAlt",dec:"226",hex:"E2",kind:0,value:226,aliases:["leftAlt","leftalt","LEFTALT","Left Alt","LEFT ALT","left alt","alt","ALT"]},{key:167,word:"LeftGUI",dec:"227",hex:"E3",kind:0,value:227,aliases:["leftGUI","leftgui","LEFTGUI","Left GUI","LEFT GUI","left gui","gui","GUI","meta","META"]},{key:168,word:"RightControl",dec:"228",hex:"E4",kind:0,value:228,aliases:["rightControl","rightcontrol","RIGHTCONTROL","Right Control","RIGHT CONTROL","right control","RightCtrl","rightCtrl","rightctrl","RIGHTCTRL","Right Ctrl","RIGHT CTRL","right ctrl"]},{key:169,word:"RightShift",dec:"229",hex:"E5",kind:0,value:229,aliases:["rightShift","rightshift","RIGHTSHIFT","Right Shift","RIGHT SHIFT","right shift"]},{key:170,word:"RightAlt",dec:"230",hex:"E6",kind:0,value:230,aliases:["rightAlt","rightalt","RIGHTALT","Right Alt","RIGHT ALT","right alt"]},{key:171,word:"RightGUI",dec:"231",hex:"E7",kind:0,value:231,aliases:["rightGUI","rightgui","RIGHTGUI","Right GUI","Right Gui","RIGHT GUI","right gui"]}],G=()=>T.reduce((e,t)=>(e.set(t.word,t),t.aliases&&t.aliases.length>0&&t.aliases.forEach(r=>{e.set(r,t)}),e),new Map),N=()=>T.reduce((e,t)=>e.set(t.value,t),new Map);var R=require("fflate"),W=e=>{let t=JSON.stringify(e),r=new TextEncoder().encode(t),n=new Uint8Array((0,R.gzipSync)(r));return new Blob([n],{type:"application/gzip"})},B=async e=>{let t=await e.arrayBuffer(),r=(0,R.gunzipSync)(new Uint8Array(t)),n=new TextDecoder().decode(r);return JSON.parse(n)};function V(e){let t=document.getElementById(e);return t&&window.getComputedStyle(t).display!=="none"&&t.getAttribute("aria-hidden")!=="true"}function _(e){return new Promise(t=>{let r=new Image;r.src=typeof e=="string"?e:URL.createObjectURL(e),r.onload=()=>t(!0),r.onerror=()=>t(!1)})}function z(e=null,t="",r=0){return{success:!0,code:r,message:t,data:e}}function $(e,t=-1,r=null){return{success:!1,code:t,message:e,data:r}}var y={LITTLE:"little",BIG:"big"},K=(e,t,r=y.BIG)=>{if(!Number.isInteger(t)||t<=0)throw new Error("Byte count must be a positive integer.");let n=e>>>0,a=new Array(t);for(let o=0;o<t;o++){let s=r===y.LITTLE?o*8:(t-1-o)*8;a[o]=n>>s&255}return a},j=(e,t=y.BIG)=>{let r=0;if(t===y.LITTLE)for(let n=0;n<e.length;n++)r|=(e[n]&255)<<n*8;else for(let n=0;n<e.length;n++)r|=(e[n]&255)<<(e.length-1-n)*8;return r},J=(e,t=y.BIG)=>{let r=e&65535;return t===y.LITTLE?[r&255,r>>8&255]:[r>>8&255,r&255]},Q=(e,t=y.BIG)=>{if(e.length!==2)throw new Error("Input array must have exactly 2 elements");return t===y.LITTLE?e[1]<<8|e[0]:e[0]<<8|e[1]},q=e=>Math.abs(e).toString().split("").map(t=>t.charCodeAt(0)),X=e=>Number(String.fromCharCode(...e));var p=(e,t,r)=>Math.min(Math.max(e,t),r);function Y(e){let t=m=>{let x=m.endsWith("%"),k=parseFloat(m.replace("%",""));return x?Math.round(p(k/100,0,1)*255):p(Math.round(k),0,255)},r=m=>{let x=m.endsWith("%"),k=parseFloat(m.replace("%",""));return p(x?k/100:k,0,1)},n=m=>{if(!m.endsWith("%"))return 0;let x=parseFloat(m.replace("%",""));return p(x/100,0,1)},a=/^rgb\(\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,o=e.match(a);if(o){let[,m,,x,,k]=o;return{type:"rgb",r:t(m),g:t(x),b:t(k)}}let s=/^rgba\(\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,u=e.match(s);if(u){let[,m,,x,,k,,I]=u;return{type:"rgba",r:t(m),g:t(x),b:t(k),a:r(I)}}let g=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%)\s*,\s*(\d+(\.\d+)?%)\s*\)$/i,i=e.match(g);if(i){let[,m,,x,,k]=i;return{type:"hsv",h:p(parseFloat(m),0,360),s:n(x),v:n(k)}}let l=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%)\s*,\s*(\d+(\.\d+)?%)\s*\)$/i,c=e.match(l);if(c){let[,m,,x,,k]=c;return{type:"hsl",h:p(parseFloat(m),0,360),s:n(x),l:n(k)}}let f=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%)\s*,\s*(\d+(\.\d+)?%)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,h=e.match(f);if(h){let[,m,,x,,k,,I]=h;return{type:"hsla",h:p(parseFloat(m),0,360),s:n(x),l:n(k),a:r(I)}}return null}function Z(e){let t=p(e.h,0,360)/360,r=p(e.s,0,1),n=p(e.l,0,1),a=0,o=0,s=0;if(r===0)a=o=s=n;else{let u=(l,c,f)=>(f<0&&(f+=1),f>1&&(f-=1),f<.16666666666666666?l+(c-l)*6*f:f<.5?c:f<.6666666666666666?l+(c-l)*(.6666666666666666-f)*6:l),g=n<.5?n*(1+r):n+r-n*r,i=2*n-g;a=u(i,g,t+1/3),o=u(i,g,t),s=u(i,g,t-1/3)}return{type:"rgb",r:Math.round(a*255),g:Math.round(o*255),b:Math.round(s*255)}}function ee(e){let t=p(e.r,0,255)/255,r=p(e.g,0,255)/255,n=p(e.b,0,255)/255,a=Math.max(t,r,n),o=Math.min(t,r,n),s=a-o,u=(a+o)/2,g=0;s!==0&&(g=s/(1-Math.abs(2*u-1)));let i=0;if(s!==0){switch(a){case t:i=(r-n)/s%6;break;case r:i=(n-t)/s+2;break;case n:i=(t-r)/s+4;break}i=Math.round(i*60),i<0&&(i+=360)}return{type:"hsl",h:p(i,0,360),s:p(g,0,1),l:p(u,0,1)}}function te(e){let{h:t,s:r,v:n}=e,a;r===0?a=n:a=(2-r)*n/2,a=Math.max(0,Math.min(1,a));let o;return a===0||a===1?o=0:(o=r*n/(1-Math.abs(2*a-1)),o=Math.max(0,Math.min(1,o))),{type:"hsl",h:Math.max(0,Math.min(360,t)),s:o,l:a}}function re(e){let{h:t,s:r,l:n}=e,a=n+r*Math.min(n,1-n),o=Math.max(0,Math.min(1,a)),s;return o===0?s=0:(s=2*(1-n/o),s=Math.max(0,Math.min(1,s))),{type:"hsv",h:Math.max(0,Math.min(360,t)),s,v:o}}var ne=typeof window<"u",ae=()=>typeof process<"u"&&process.env?.NODE_ENV?process.env.NODE_ENV==="development":ne&&window.__ENV__?.MODE?window.__ENV__.MODE==="development":!0,L={enable:ae(),reserveTypes:["error"],prefix:"[iLx1-tool]"},w={...L},v=e=>w.enable?!0:w.reserveTypes.includes(e),oe=(...e)=>{v("log")&&console.log(`${w.prefix} [LOG]`,...e)},se=(...e)=>{v("info")&&console.info(`${w.prefix} [INFO]`,...e)},ie=(...e)=>{v("warn")&&console.warn(`${w.prefix} [WARN]`,...e)},le=(...e)=>{v("error")&&console.error(`${w.prefix} [ERROR]`,...e)},de=(...e)=>{v("debug")&&console.debug(`${w.prefix} [DEBUG]`,...e)},E=e=>{w={...w,...e}},ce=()=>{w={...L}},ue=()=>{E({enable:!0,reserveTypes:["log","info","warn","error","debug"]})},ge=()=>{E({enable:!1,reserveTypes:[]})};var b=U(require("konva")),d={generate:async function(e,t,r){try{let n=await this.base64ToImageData(e),a=this.imageDataToHexArray(n,t,r);return r[3]===0?this.hex2hex(this.arrayToHex(a)):a}catch(n){throw console.error("\u751F\u6210\u5341\u516D\u8FDB\u5236\u6570\u7EC4\u65F6\u51FA\u9519:",n),n}},imageDataToHexArray:function(e,t,r){let n=e.data,a=e.height,o=e.width,s=n.length;if(r[4]==1){let u=[];for(let c=0;c<s;c+=4){let h=n[c]*.299+n[c+1]*.587+n[c+2]*.114>t?1:0;u[c/4]=h}let i=r[1],l;switch(i){case 0:l=this.ImageSamplingRow;break;case 1:l=this.ImageSamplingCol;break;case 2:l=this.ImageSamplingColRow;break;case 3:l=this.ImageSamplingRowCol;break;default:l=this.ImageSamplingRow}if(typeof l!="function")throw new Error(`\u53D6\u6A21\u51FD\u6570\u672A\u5B9A\u4E49\uFF0CsamplingMode: ${i}`);return l.call(this,u,o,a,r)}else return this.colorImageSampling(n,o,a,r)},colorImageSampling:function(e,t,r,n){let a=new Uint8Array(t*r*2),o=0,s=0;for(;o<a.length&&s<e.length;){let u=e[s],g=e[s+1],i=e[s+2],l=u>>3&31,c=g>>2&63,f=i>>3&31,h=l<<11|c<<5|f;a[o]=h>>8&255,a[o+1]=h&255,(n[0]==0||n[2]==1)&&(a[o]=~a[o]&255,a[o+1]=~a[o+1]&255),o+=2,s+=4}return a},ImageSamplingRow:function(e,t,r,n){let a=Math.ceil(t/8),o=new Uint8Array(a*r);for(let s=0;s<e.length;s++){let u=s%t,i=Math.floor(s/t),l=u%8,c=1<<l;n[2]!=0&&(c=1<<7-l);let f=i*a+Math.floor(u/8),h=e[s];n[0]!==0&&(h=h===0?1:0),h===0?o[f]|=c:o[f]&=~c}return o},ImageSamplingCol:function(e,t,r,n){let a=Math.ceil(r/8),o=new Uint8Array(a*t);for(let s=0;s<e.length;s++){let u=s%t,g=Math.floor(s/t),i=u,l=g%8,c=1<<l;n[2]!=0&&(c=1<<7-l);let f=i*a+Math.floor(g/8),h=e[s];n[0]!==0&&(h=h===0?1:0),h===0?o[f]|=c:o[f]&=~c}return o},ImageSamplingColRow:function(e,t,r,n){let a=Math.ceil(r/8),o=new Uint8Array(a*t);for(let s=0;s<e.length;s++){let u=s%t,g=Math.floor(s/t),i=Math.floor(g/8),l=g%8,c=1<<l;n[2]!=0&&(c=1<<7-l);let f=u+i*t,h=e[s];n[0]!==0&&(h=h===0?1:0),h===0?o[f]|=c:o[f]&=~c}return o},ImageSamplingRowCol:function(e,t,r,n){let a=Math.ceil(t/8),o=new Uint8Array(a*r);for(let s=0;s<e.length;s++){let u=s%t,g=Math.floor(s/t),i=Math.floor(u/8),l=u%8,c=1<<l;n[2]!=0&&(c=1<<7-l);let f=i*r+g,h=e[s];n[0]!==0&&(h=h===0?1:0),h===0?o[f]|=c:o[f]&=~c}return o},base64ToImageData:function(e){return new Promise((t,r)=>{let n=new Image;n.crossOrigin="anonymous",n.src=e,n.onload=()=>{try{let a=document.createElement("canvas");a.width=n.width,a.height=n.height;let o=a.getContext("2d");o.drawImage(n,0,0);let s=o.getImageData(0,0,a.width,a.height);t(s)}catch(a){r(new Error(`\u8F6C\u6362\u56FE\u50CF\u6570\u636E\u5931\u8D25: ${a.message}`))}},n.onerror=()=>{r(new Error("\u52A0\u8F7D\u56FE\u50CF\u5931\u8D25"))},n.src=e})},resizeImageWithKonva:async function(e,t,r,n){if(e===0||t===0)throw new Error("\u5BBD\u5EA6\u548C\u9AD8\u5EA6\u4E0D\u80FD\u4E3A0");if(!r)throw new Error("\u56FE\u50CF\u5BF9\u8C61\u4E0D\u80FD\u4E3A\u7A7A");return new Promise(a=>{if(typeof b.default>"u"){this.resizeImageWithCanvas(e,t,r,n).then(a).catch(()=>{let i=document.createElement("canvas");i.width=r.width,i.height=r.height,i.getContext("2d").drawImage(r,0,0),a(i.toDataURL("image/png"))});return}let o=new b.default.Stage({container:document.createElement("div"),width:e,height:t}),s=new b.default.Layer;o.add(s);let u=new b.default.Image({image:r,width:e,height:t});n&&u.filters([b.default.Filters.Grayscale]),s.add(u),s.batchDraw();let g=o.toDataURL({mimeType:"image/png",quality:1,pixelRatio:1});o.destroy(),a(g)})},resizeImageWithCanvas:async function(e,t,r,n){return new Promise(a=>{let o=document.createElement("canvas");o.width=e,o.height=t;let s=o.getContext("2d");if(s.imageSmoothingEnabled=!0,s.imageSmoothingQuality="high",s.drawImage(r,0,0,e,t),n){let g=s.getImageData(0,0,e,t),i=g.data;for(let l=0;l<i.length;l+=4){let c=i[l]*.299+i[l+1]*.587+i[l+2]*.114;i[l]=i[l+1]=i[l+2]=c}s.putImageData(g,0,0)}let u=o.toDataURL("image/png");a(u)})},arrayToHex:function(e){return!e||e.length===0?"":Array.from(e).map(t=>Number(t).toString(16).padStart(2,"0")).join("")},hex2hex:function(e){if(!e||e.length===0)return[];let t=[];for(let r=0;r<e.length;r+=2)t.push("0x"+e.substring(r,r+2));return t},generatePreview:function(e,t){if(!e||e.length===0)return"";let r="";for(let n=0;n<e.length;n++)r+=e[n]===0?"0":"1",(n+1)%t===0&&(r+=`
|
|
1
|
+
var A=Object.create;var S=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var F=(e,t)=>{for(var r in t)S(e,r,{get:t[r],enumerable:!0})},C=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of D(t))!O.call(e,a)&&a!==r&&S(e,a,{get:()=>t[a],enumerable:!(n=P(t,a))||n.enumerable});return e};var U=(e,t,r)=>(r=e!=null?A(M(e)):{},C(t||!e||!e.__esModule?S(r,"default",{value:e,enumerable:!0}):r,e)),H=e=>C(S({},"__esModule",{value:!0}),e);var Me={};F(Me,{Endianness:()=>y,ImageSamplingCol:()=>we,ImageSamplingColRow:()=>ye,ImageSamplingRow:()=>ke,ImageSamplingRowCol:()=>be,ImageToHexArray:()=>d,arrayToHex:()=>Ee,asciiArrToNum:()=>Z,base64ToImageData:()=>ve,bits16ToNum:()=>X,bytesToNum:()=>q,calculateOutputSize:()=>Ae,closeAllNativePopover:()=>$,closePopoverByID:()=>_,colorImageSampling:()=>xe,compressJsonGzip:()=>B,createImageData:()=>Ce,debug:()=>ue,decompressJsonGzip:()=>W,disableAllLogs:()=>he,enableAllLogs:()=>fe,error:()=>ce,errorResult:()=>j,formatHexOutput:()=>Le,generate:()=>me,generatePreview:()=>Te,getDefaultConfig:()=>De,getHIDCodeMapStr:()=>G,getHIDCodeMapStrNum:()=>N,getSamplingModeDescription:()=>Pe,hex2hex:()=>Ie,hidKeyCode:()=>I,hslToHsv:()=>ae,hslToRgb:()=>te,hsvToHsl:()=>ne,imageDataToHexArray:()=>pe,info:()=>le,isImageValid:()=>z,isShowPopover:()=>V,log:()=>ie,numToAsciiArr:()=>Y,numToBits16:()=>Q,numToBytes:()=>J,parseColorString:()=>ee,resetLoggerConfig:()=>ge,resizeImageWithCanvas:()=>Re,resizeImageWithKonva:()=>Se,rgbToHsl:()=>re,setLoggerConfig:()=>T,successResult:()=>K,warn:()=>de});module.exports=H(Me);var I=[{key:0,word:"a",dec:"4",hex:"04",kind:1,value:4,aliases:["A"]},{key:2,word:"b",dec:"5",hex:"05",kind:1,value:5,aliases:["B"]},{key:4,word:"c",dec:"6",hex:"06",kind:1,value:6,aliases:["C"]},{key:6,word:"d",dec:"7",hex:"07",kind:1,value:7,aliases:["D"]},{key:8,word:"e",dec:"8",hex:"08",kind:1,value:8,aliases:["E"]},{key:10,word:"f",dec:"9",hex:"09",kind:1,value:9,aliases:["F"]},{key:12,word:"g",dec:"10",hex:"0A",kind:1,value:10,aliases:["G"]},{key:14,word:"h",dec:"11",hex:"0B",kind:1,value:11,aliases:["H"]},{key:16,word:"i",dec:"12",hex:"0C",kind:1,value:12,aliases:["I"]},{key:18,word:"j",dec:"13",hex:"0D",kind:1,value:13,aliases:["J"]},{key:20,word:"k",dec:"14",hex:"0E",kind:1,value:14,aliases:["K"]},{key:22,word:"l",dec:"15",hex:"0F",kind:1,value:15,aliases:["L"]},{key:24,word:"m",dec:"16",hex:"10",kind:1,value:16,aliases:["M"]},{key:26,word:"n",dec:"17",hex:"11",kind:1,value:17,aliases:["N"]},{key:28,word:"o",dec:"18",hex:"12",kind:1,value:18,aliases:["O"]},{key:30,word:"p",dec:"19",hex:"13",kind:1,value:19,aliases:["P"]},{key:32,word:"q",dec:"20",hex:"14",kind:1,value:20,aliases:["Q"]},{key:34,word:"r",dec:"21",hex:"15",kind:1,value:21,aliases:["R"]},{key:36,word:"s",dec:"22",hex:"16",kind:1,value:22,aliases:["S"]},{key:38,word:"t",dec:"23",hex:"17",kind:1,value:23,aliases:["T"]},{key:40,word:"u",dec:"24",hex:"18",kind:1,value:24,aliases:["U"]},{key:42,word:"v",dec:"25",hex:"19",kind:1,value:25,aliases:["V"]},{key:44,word:"w",dec:"26",hex:"1A",kind:1,value:26,aliases:["W"]},{key:46,word:"x",dec:"27",hex:"1B",kind:1,value:27,aliases:["X"]},{key:48,word:"y",dec:"28",hex:"1C",kind:1,value:28,aliases:["Y"]},{key:50,word:"z",dec:"29",hex:"1D",kind:1,value:29,aliases:["Z"]},{key:52,word:"1",dec:"30",hex:"1E",kind:1,value:30,aliases:["!","1!"]},{key:54,word:"2",dec:"31",hex:"1F",kind:1,value:31,aliases:["@","2@"]},{key:56,word:"3",dec:"32",hex:"20",kind:1,value:32,aliases:["#","3#"]},{key:58,word:"4",dec:"33",hex:"21",kind:1,value:33,aliases:["$","4$"]},{key:60,word:"5",dec:"34",hex:"22",kind:1,value:34,aliases:["%","5%"]},{key:62,word:"6",dec:"35",hex:"23",kind:1,value:35,aliases:["^","6^"]},{key:64,word:"7",dec:"36",hex:"24",kind:1,value:36,aliases:["&","7&"]},{key:66,word:"8",dec:"37",hex:"25",kind:1,value:37,aliases:["*","8*"]},{key:68,word:"9",dec:"38",hex:"26",kind:1,value:38,aliases:["(","9("]},{key:70,word:"0",dec:"39",hex:"27",kind:1,value:39,aliases:[")","0)"]},{key:77,word:"-",dec:"45",hex:"2D",kind:1,value:45,aliases:["_","-_"]},{key:79,word:"=",dec:"46",hex:"2E",kind:1,value:46,aliases:["+","=+"]},{key:81,word:"[",dec:"47",hex:"2F",kind:1,value:47,aliases:["{","[{"]},{key:83,word:"]",dec:"48",hex:"30",kind:1,value:48,aliases:["}","}]"]},{key:85,word:"\\",dec:"49",hex:"31",kind:1,value:49,aliases:["|","\\|"]},{key:87,word:"`",dec:"50",hex:"32",kind:1,value:50,aliases:["~","`~"]},{key:89,word:";",dec:"51",hex:"33",kind:1,value:51,aliases:[":",";:"]},{key:91,word:"'",dec:"52",hex:"34",kind:1,value:52,aliases:['"',`'"`]},{key:95,word:",",dec:"54",hex:"36",kind:1,value:54,aliases:["<",",<"]},{key:97,word:".",dec:"55",hex:"37",kind:1,value:55,aliases:[">",".>"]},{key:99,word:"/",dec:"56",hex:"38",kind:1,value:56,aliases:["?","/?"]},{key:72,word:"Enter",dec:"40",hex:"28",kind:1,value:40,aliases:["enter","ENTER"]},{key:73,word:"Escape",dec:"41",hex:"29",kind:1,value:41,aliases:["escape","ESCAPE"]},{key:74,word:"Backspace",dec:"42",hex:"2A",kind:1,value:42,aliases:["backspace","backSpace","BACKSPACE","Back Space","BACK SPACE","back space"]},{key:75,word:"Tab",dec:"43",hex:"2B",kind:1,value:43,aliases:["tab","TAB"]},{key:76,word:" ",dec:"44",hex:"2C",kind:1,value:44,aliases:["Space","SPACE","space"]},{key:101,word:"CapsLock",dec:"57",hex:"39",kind:1,value:57,aliases:["capsLock","capslock","CAPSLOCK","Caps Lock","CAPS LOCK","caps lock"]},{key:102,word:"F1",dec:"58",hex:"3A",kind:1,value:58,aliases:["f1","f 1"]},{key:103,word:"F2",dec:"59",hex:"3B",kind:1,value:59,aliases:["f2","f 2"]},{key:104,word:"F3",dec:"60",hex:"3C",kind:1,value:60,aliases:["f3","f 3"]},{key:105,word:"F4",dec:"61",hex:"3D",kind:1,value:61,aliases:["f4","f 4"]},{key:106,word:"F5",dec:"62",hex:"3E",kind:1,value:62,aliases:["f5","f 5"]},{key:107,word:"F6",dec:"63",hex:"3F",kind:1,value:63,aliases:["f6","f 6"]},{key:108,word:"F7",dec:"64",hex:"40",kind:1,value:64,aliases:["f7","f 7"]},{key:109,word:"F8",dec:"65",hex:"41",kind:1,value:65,aliases:["f8","f 8"]},{key:110,word:"F9",dec:"66",hex:"42",kind:1,value:66,aliases:["f9","f 9"]},{key:111,word:"F10",dec:"67",hex:"43",kind:1,value:67,aliases:["f10","f 10"]},{key:112,word:"F11",dec:"68",hex:"44",kind:1,value:68,aliases:["f11","f 11"]},{key:113,word:"F12",dec:"69",hex:"45",kind:1,value:69,aliases:["f12","f 12"]},{key:114,word:"PrintScreen",dec:"70",hex:"46",kind:1,value:70,aliases:["printScreen","printscreen","PRINTSCREEN","Print Screen","PRINT SCREEN","print screen"]},{key:115,word:"ScrollLock",dec:"71",hex:"47",kind:1,value:71,aliases:["scrollLock","scrolllock","SCROLLLOCK","Scroll Lock","SCROLL LOCK","scroll lock"]},{key:116,word:"Pause",dec:"72",hex:"48",kind:1,value:72,aliases:["pause","PAUSE"]},{key:117,word:"Insert",dec:"73",hex:"49",kind:1,value:73,aliases:["insert","INSERT"]},{key:118,word:"Home",dec:"74",hex:"4A",kind:1,value:74,aliases:["home","HOME"]},{key:119,word:"PageUp",dec:"75",hex:"4B",kind:1,value:75,aliases:["pageUp","pageup","PAGEUP","Page Up","PAGE UP","page up"]},{key:120,word:"DeleteForward",dec:"76",hex:"4C",kind:1,value:76,aliases:["deleteForward","deleteforward","DELETEFORWARD","Delete Forward","DELETE FORWARD","delete forward","Delete","DELETE","delete"]},{key:121,word:"End",dec:"77",hex:"4D",kind:1,value:77,aliases:["end","END"]},{key:122,word:"PageDown",dec:"78",hex:"4E",kind:1,value:78,aliases:["pageDown","pagedown","PAGEDOWN","Page Down","PAGE DOWN","page down"]},{key:123,word:"ArrowRight",dec:"79",hex:"4F",kind:1,value:79,aliases:["arrowRight","arrowright","ARROWRIGHT","Arrow Right","ARROW RIGHT","arrow right"]},{key:124,word:"ArrowLeft",dec:"80",hex:"50",kind:1,value:80,aliases:["arrowLeft","arrowleft","ARROWLEFT","Arrow Left","ARROW LEFT","arrow left"]},{key:125,word:"ArrowDown",dec:"81",hex:"51",kind:1,value:81,aliases:["arrowDown","arrowdown","ARROWDOWN","Arrow Down","ARROW DOWN","arrow down"]},{key:126,word:"ArrowUp",dec:"82",hex:"52",kind:1,value:82,aliases:["arrowUp","arrowup","ARROWUP","Arrow Up","ARROW UP","arrow up"]},{key:127,word:"NumLock",dec:"83",hex:"53",kind:1,value:83,aliases:["numLock","numlock","NUMLOCK","Num Lock","NUM LOCK","num lock"]},{key:128,word:"Clear",dec:"83",hex:"53",kind:1,value:83,aliases:["clear","CLEAR"]},{key:160,word:"F13",dec:"104",hex:"68",kind:0,value:104,aliases:["f13","f 13"]},{key:161,word:"F14",dec:"105",hex:"69",kind:0,value:105,aliases:["f14","f 14"]},{key:162,word:"F15",dec:"106",hex:"6A",kind:0,value:106,aliases:["f15","f 15"]},{key:163,word:"F16",dec:"107",hex:"6B",kind:0,value:107,aliases:["f16","f 16"]},{key:164,word:"LeftControl",dec:"224",hex:"E0",kind:0,value:224,aliases:["leftControl","leftcontrol","LEFTCONTROL","Left Control","LEFT CONTROL","left control","control","CONTROL","ctrl","CTRL"]},{key:165,word:"LeftShift",dec:"225",hex:"E1",kind:0,value:225,aliases:["leftShift","leftshift","LEFTSHIFT","Left Shift","LEFT SHIFT","left shift","shift","SHIFT"]},{key:166,word:"LeftAlt",dec:"226",hex:"E2",kind:0,value:226,aliases:["leftAlt","leftalt","LEFTALT","Left Alt","LEFT ALT","left alt","alt","ALT"]},{key:167,word:"LeftGUI",dec:"227",hex:"E3",kind:0,value:227,aliases:["leftGUI","leftgui","LEFTGUI","Left GUI","LEFT GUI","left gui","gui","GUI","meta","META"]},{key:168,word:"RightControl",dec:"228",hex:"E4",kind:0,value:228,aliases:["rightControl","rightcontrol","RIGHTCONTROL","Right Control","RIGHT CONTROL","right control","RightCtrl","rightCtrl","rightctrl","RIGHTCTRL","Right Ctrl","RIGHT CTRL","right ctrl"]},{key:169,word:"RightShift",dec:"229",hex:"E5",kind:0,value:229,aliases:["rightShift","rightshift","RIGHTSHIFT","Right Shift","RIGHT SHIFT","right shift"]},{key:170,word:"RightAlt",dec:"230",hex:"E6",kind:0,value:230,aliases:["rightAlt","rightalt","RIGHTALT","Right Alt","RIGHT ALT","right alt"]},{key:171,word:"RightGUI",dec:"231",hex:"E7",kind:0,value:231,aliases:["rightGUI","rightgui","RIGHTGUI","Right GUI","Right Gui","RIGHT GUI","right gui"]}],G=()=>I.reduce((e,t)=>(e.set(t.word,t),t.aliases&&t.aliases.length>0&&t.aliases.forEach(r=>{e.set(r,t)}),e),new Map),N=()=>I.reduce((e,t)=>e.set(t.value,t),new Map);var R=require("fflate"),B=e=>{let t=JSON.stringify(e),r=new TextEncoder().encode(t),n=new Uint8Array((0,R.gzipSync)(r));return new Blob([n],{type:"application/gzip"})},W=async e=>{let t=await e.arrayBuffer(),r=(0,R.gunzipSync)(new Uint8Array(t)),n=new TextDecoder().decode(r);return JSON.parse(n)};function V(e){let t=document.getElementById(e);return t&&window.getComputedStyle(t).display!=="none"&&t.getAttribute("aria-hidden")!=="true"}var _=e=>{document.querySelector(`#${e}`)?.hidePopover?.()},$=()=>{document.querySelectorAll("[popover]").forEach(t=>{t?.hidePopover?.()})};function z(e){return new Promise(t=>{let r=new Image;r.src=typeof e=="string"?e:URL.createObjectURL(e),r.onload=()=>t(!0),r.onerror=()=>t(!1)})}function K(e=null,t="",r=0){return{success:!0,code:r,message:t,data:e}}function j(e,t=-1,r=null){return{success:!1,code:t,message:e,data:r}}var y={LITTLE:"little",BIG:"big"},J=(e,t,r=y.BIG)=>{if(!Number.isInteger(t)||t<=0)throw new Error("Byte count must be a positive integer.");let n=e>>>0,a=new Array(t);for(let o=0;o<t;o++){let s=r===y.LITTLE?o*8:(t-1-o)*8;a[o]=n>>s&255}return a},q=(e,t=y.BIG)=>{let r=0;if(t===y.LITTLE)for(let n=0;n<e.length;n++)r|=(e[n]&255)<<n*8;else for(let n=0;n<e.length;n++)r|=(e[n]&255)<<(e.length-1-n)*8;return r},Q=(e,t=y.BIG)=>{let r=e&65535;return t===y.LITTLE?[r&255,r>>8&255]:[r>>8&255,r&255]},X=(e,t=y.BIG)=>{if(e.length!==2)throw new Error("Input array must have exactly 2 elements");return t===y.LITTLE?e[1]<<8|e[0]:e[0]<<8|e[1]},Y=e=>Math.abs(e).toString().split("").map(t=>t.charCodeAt(0)),Z=e=>Number(String.fromCharCode(...e));var p=(e,t,r)=>Math.min(Math.max(e,t),r);function ee(e){let t=m=>{let x=m.endsWith("%"),k=parseFloat(m.replace("%",""));return x?Math.round(p(k/100,0,1)*255):p(Math.round(k),0,255)},r=m=>{let x=m.endsWith("%"),k=parseFloat(m.replace("%",""));return p(x?k/100:k,0,1)},n=m=>{if(!m.endsWith("%"))return 0;let x=parseFloat(m.replace("%",""));return p(x/100,0,1)},a=/^rgb\(\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,o=e.match(a);if(o){let[,m,,x,,k]=o;return{type:"rgb",r:t(m),g:t(x),b:t(k)}}let s=/^rgba\(\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,u=e.match(s);if(u){let[,m,,x,,k,,E]=u;return{type:"rgba",r:t(m),g:t(x),b:t(k),a:r(E)}}let g=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%)\s*,\s*(\d+(\.\d+)?%)\s*\)$/i,i=e.match(g);if(i){let[,m,,x,,k]=i;return{type:"hsv",h:p(parseFloat(m),0,360),s:n(x),v:n(k)}}let l=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%)\s*,\s*(\d+(\.\d+)?%)\s*\)$/i,c=e.match(l);if(c){let[,m,,x,,k]=c;return{type:"hsl",h:p(parseFloat(m),0,360),s:n(x),l:n(k)}}let f=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%)\s*,\s*(\d+(\.\d+)?%)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,h=e.match(f);if(h){let[,m,,x,,k,,E]=h;return{type:"hsla",h:p(parseFloat(m),0,360),s:n(x),l:n(k),a:r(E)}}return null}function te(e){let t=p(e.h,0,360)/360,r=p(e.s,0,1),n=p(e.l,0,1),a=0,o=0,s=0;if(r===0)a=o=s=n;else{let u=(l,c,f)=>(f<0&&(f+=1),f>1&&(f-=1),f<.16666666666666666?l+(c-l)*6*f:f<.5?c:f<.6666666666666666?l+(c-l)*(.6666666666666666-f)*6:l),g=n<.5?n*(1+r):n+r-n*r,i=2*n-g;a=u(i,g,t+1/3),o=u(i,g,t),s=u(i,g,t-1/3)}return{type:"rgb",r:Math.round(a*255),g:Math.round(o*255),b:Math.round(s*255)}}function re(e){let t=p(e.r,0,255)/255,r=p(e.g,0,255)/255,n=p(e.b,0,255)/255,a=Math.max(t,r,n),o=Math.min(t,r,n),s=a-o,u=(a+o)/2,g=0;s!==0&&(g=s/(1-Math.abs(2*u-1)));let i=0;if(s!==0){switch(a){case t:i=(r-n)/s%6;break;case r:i=(n-t)/s+2;break;case n:i=(t-r)/s+4;break}i=Math.round(i*60),i<0&&(i+=360)}return{type:"hsl",h:p(i,0,360),s:p(g,0,1),l:p(u,0,1)}}function ne(e){let{h:t,s:r,v:n}=e,a;r===0?a=n:a=(2-r)*n/2,a=Math.max(0,Math.min(1,a));let o;return a===0||a===1?o=0:(o=r*n/(1-Math.abs(2*a-1)),o=Math.max(0,Math.min(1,o))),{type:"hsl",h:Math.max(0,Math.min(360,t)),s:o,l:a}}function ae(e){let{h:t,s:r,l:n}=e,a=n+r*Math.min(n,1-n),o=Math.max(0,Math.min(1,a)),s;return o===0?s=0:(s=2*(1-n/o),s=Math.max(0,Math.min(1,s))),{type:"hsv",h:Math.max(0,Math.min(360,t)),s,v:o}}var oe=typeof window<"u",se=()=>typeof process<"u"&&process.env?.NODE_ENV?process.env.NODE_ENV==="development":oe&&window.__ENV__?.MODE?window.__ENV__.MODE==="development":!0,L={enable:se(),reserveTypes:["error"],prefix:"[iLx1-tool]"},w={...L},v=e=>w.enable?!0:w.reserveTypes.includes(e),ie=(...e)=>{v("log")&&console.log(`${w.prefix} [LOG]`,...e)},le=(...e)=>{v("info")&&console.info(`${w.prefix} [INFO]`,...e)},de=(...e)=>{v("warn")&&console.warn(`${w.prefix} [WARN]`,...e)},ce=(...e)=>{v("error")&&console.error(`${w.prefix} [ERROR]`,...e)},ue=(...e)=>{v("debug")&&console.debug(`${w.prefix} [DEBUG]`,...e)},T=e=>{w={...w,...e}},ge=()=>{w={...L}},fe=()=>{T({enable:!0,reserveTypes:["log","info","warn","error","debug"]})},he=()=>{T({enable:!1,reserveTypes:[]})};var b=U(require("konva")),d={generate:async function(e,t,r){try{let n=await this.base64ToImageData(e),a=this.imageDataToHexArray(n,t,r);return r[3]===0?this.hex2hex(this.arrayToHex(a)):a}catch(n){throw console.error("\u751F\u6210\u5341\u516D\u8FDB\u5236\u6570\u7EC4\u65F6\u51FA\u9519:",n),n}},imageDataToHexArray:function(e,t,r){let n=e.data,a=e.height,o=e.width,s=n.length;if(r[4]==1){let u=[];for(let c=0;c<s;c+=4){let h=n[c]*.299+n[c+1]*.587+n[c+2]*.114>t?1:0;u[c/4]=h}let i=r[1],l;switch(i){case 0:l=this.ImageSamplingRow;break;case 1:l=this.ImageSamplingCol;break;case 2:l=this.ImageSamplingColRow;break;case 3:l=this.ImageSamplingRowCol;break;default:l=this.ImageSamplingRow}if(typeof l!="function")throw new Error(`\u53D6\u6A21\u51FD\u6570\u672A\u5B9A\u4E49\uFF0CsamplingMode: ${i}`);return l.call(this,u,o,a,r)}else return this.colorImageSampling(n,o,a,r)},colorImageSampling:function(e,t,r,n){let a=new Uint8Array(t*r*2),o=0,s=0;for(;o<a.length&&s<e.length;){let u=e[s],g=e[s+1],i=e[s+2],l=u>>3&31,c=g>>2&63,f=i>>3&31,h=l<<11|c<<5|f;a[o]=h>>8&255,a[o+1]=h&255,(n[0]==0||n[2]==1)&&(a[o]=~a[o]&255,a[o+1]=~a[o+1]&255),o+=2,s+=4}return a},ImageSamplingRow:function(e,t,r,n){let a=Math.ceil(t/8),o=new Uint8Array(a*r);for(let s=0;s<e.length;s++){let u=s%t,i=Math.floor(s/t),l=u%8,c=1<<l;n[2]!=0&&(c=1<<7-l);let f=i*a+Math.floor(u/8),h=e[s];n[0]!==0&&(h=h===0?1:0),h===0?o[f]|=c:o[f]&=~c}return o},ImageSamplingCol:function(e,t,r,n){let a=Math.ceil(r/8),o=new Uint8Array(a*t);for(let s=0;s<e.length;s++){let u=s%t,g=Math.floor(s/t),i=u,l=g%8,c=1<<l;n[2]!=0&&(c=1<<7-l);let f=i*a+Math.floor(g/8),h=e[s];n[0]!==0&&(h=h===0?1:0),h===0?o[f]|=c:o[f]&=~c}return o},ImageSamplingColRow:function(e,t,r,n){let a=Math.ceil(r/8),o=new Uint8Array(a*t);for(let s=0;s<e.length;s++){let u=s%t,g=Math.floor(s/t),i=Math.floor(g/8),l=g%8,c=1<<l;n[2]!=0&&(c=1<<7-l);let f=u+i*t,h=e[s];n[0]!==0&&(h=h===0?1:0),h===0?o[f]|=c:o[f]&=~c}return o},ImageSamplingRowCol:function(e,t,r,n){let a=Math.ceil(t/8),o=new Uint8Array(a*r);for(let s=0;s<e.length;s++){let u=s%t,g=Math.floor(s/t),i=Math.floor(u/8),l=u%8,c=1<<l;n[2]!=0&&(c=1<<7-l);let f=i*r+g,h=e[s];n[0]!==0&&(h=h===0?1:0),h===0?o[f]|=c:o[f]&=~c}return o},base64ToImageData:function(e){return new Promise((t,r)=>{let n=new Image;n.crossOrigin="anonymous",n.src=e,n.onload=()=>{try{let a=document.createElement("canvas");a.width=n.width,a.height=n.height;let o=a.getContext("2d");o.drawImage(n,0,0);let s=o.getImageData(0,0,a.width,a.height);t(s)}catch(a){r(new Error(`\u8F6C\u6362\u56FE\u50CF\u6570\u636E\u5931\u8D25: ${a.message}`))}},n.onerror=()=>{r(new Error("\u52A0\u8F7D\u56FE\u50CF\u5931\u8D25"))},n.src=e})},resizeImageWithKonva:async function(e,t,r,n){if(e===0||t===0)throw new Error("\u5BBD\u5EA6\u548C\u9AD8\u5EA6\u4E0D\u80FD\u4E3A0");if(!r)throw new Error("\u56FE\u50CF\u5BF9\u8C61\u4E0D\u80FD\u4E3A\u7A7A");return new Promise(a=>{if(typeof b.default>"u"){this.resizeImageWithCanvas(e,t,r,n).then(a).catch(()=>{let i=document.createElement("canvas");i.width=r.width,i.height=r.height,i.getContext("2d").drawImage(r,0,0),a(i.toDataURL("image/png"))});return}let o=new b.default.Stage({container:document.createElement("div"),width:e,height:t}),s=new b.default.Layer;o.add(s);let u=new b.default.Image({image:r,width:e,height:t});n&&u.filters([b.default.Filters.Grayscale]),s.add(u),s.batchDraw();let g=o.toDataURL({mimeType:"image/png",quality:1,pixelRatio:1});o.destroy(),a(g)})},resizeImageWithCanvas:async function(e,t,r,n){return new Promise(a=>{let o=document.createElement("canvas");o.width=e,o.height=t;let s=o.getContext("2d");if(s.imageSmoothingEnabled=!0,s.imageSmoothingQuality="high",s.drawImage(r,0,0,e,t),n){let g=s.getImageData(0,0,e,t),i=g.data;for(let l=0;l<i.length;l+=4){let c=i[l]*.299+i[l+1]*.587+i[l+2]*.114;i[l]=i[l+1]=i[l+2]=c}s.putImageData(g,0,0)}let u=o.toDataURL("image/png");a(u)})},arrayToHex:function(e){return!e||e.length===0?"":Array.from(e).map(t=>Number(t).toString(16).padStart(2,"0")).join("")},hex2hex:function(e){if(!e||e.length===0)return[];let t=[];for(let r=0;r<e.length;r+=2)t.push("0x"+e.substring(r,r+2));return t},generatePreview:function(e,t){if(!e||e.length===0)return"";let r="";for(let n=0;n<e.length;n++)r+=e[n]===0?"0":"1",(n+1)%t===0&&(r+=`
|
|
2
2
|
`);return r},createImageData:function(e,t,r=null){let n=document.createElement("canvas");n.width=e,n.height=t;let a=n.getContext("2d");if(r){let o=a.createImageData(e,t);return o.data.set(r),o}else return a.createImageData(e,t)},formatHexOutput:function(e,t=0,r=16){if(!e||e.length===0)return"\u65E0\u6570\u636E";let n="";if(t===0&&Array.isArray(e))for(let a=0;a<e.length;a++)n+=e[a]+", ",(a+1)%r===0&&(n+=`
|
|
3
3
|
`);else if(e instanceof Uint8Array)for(let a=0;a<e.length;a++)n+=e[a].toString(16).padStart(2,"0")+" ",(a+1)%r===0&&(n+=`
|
|
4
|
-
`);else n=e.toString();return n},calculateOutputSize:function(e){let t=0;(Array.isArray(e)||e instanceof Uint8Array)&&(t=e.length);let r=t/1024;return{bytes:t,kilobytes:r,formatted:`${t} \u5B57\u8282 (${r.toFixed(2)} KB)`}},getSamplingModeDescription:function(e){return{0:"\u9010\u884C\u5F0F (\u4ECE\u5DE6\u5230\u53F3\uFF0C\u4ECE\u4E0A\u5230\u4E0B)",1:"\u9010\u5217\u5F0F (\u4ECE\u4E0A\u5230\u4E0B\uFF0C\u4ECE\u5DE6\u5230\u53F3)",2:"\u5217\u884C\u5F0F (\u5148\u5217\u540E\u884C)",3:"\u884C\u5217\u5F0F (\u5148\u884C\u540E\u5217)"}[e]||"\u672A\u77E5\u53D6\u6A21\u65B9\u5F0F"},getDefaultConfig:function(){return[0,0,0,0,1]}},
|
|
4
|
+
`);else n=e.toString();return n},calculateOutputSize:function(e){let t=0;(Array.isArray(e)||e instanceof Uint8Array)&&(t=e.length);let r=t/1024;return{bytes:t,kilobytes:r,formatted:`${t} \u5B57\u8282 (${r.toFixed(2)} KB)`}},getSamplingModeDescription:function(e){return{0:"\u9010\u884C\u5F0F (\u4ECE\u5DE6\u5230\u53F3\uFF0C\u4ECE\u4E0A\u5230\u4E0B)",1:"\u9010\u5217\u5F0F (\u4ECE\u4E0A\u5230\u4E0B\uFF0C\u4ECE\u5DE6\u5230\u53F3)",2:"\u5217\u884C\u5F0F (\u5148\u5217\u540E\u884C)",3:"\u884C\u5217\u5F0F (\u5148\u884C\u540E\u5217)"}[e]||"\u672A\u77E5\u53D6\u6A21\u65B9\u5F0F"},getDefaultConfig:function(){return[0,0,0,0,1]}},me=d.generate.bind(d),pe=d.imageDataToHexArray.bind(d),xe=d.colorImageSampling.bind(d),ke=d.ImageSamplingRow.bind(d),we=d.ImageSamplingCol.bind(d),ye=d.ImageSamplingColRow.bind(d),be=d.ImageSamplingRowCol.bind(d),ve=d.base64ToImageData.bind(d),Se=d.resizeImageWithKonva.bind(d),Re=d.resizeImageWithCanvas.bind(d),Ee=d.arrayToHex.bind(d),Ie=d.hex2hex.bind(d),Te=d.generatePreview.bind(d),Ce=d.createImageData.bind(d),Le=d.formatHexOutput.bind(d),Ae=d.calculateOutputSize.bind(d),Pe=d.getSamplingModeDescription.bind(d),De=d.getDefaultConfig.bind(d);0&&(module.exports={Endianness,ImageSamplingCol,ImageSamplingColRow,ImageSamplingRow,ImageSamplingRowCol,ImageToHexArray,arrayToHex,asciiArrToNum,base64ToImageData,bits16ToNum,bytesToNum,calculateOutputSize,closeAllNativePopover,closePopoverByID,colorImageSampling,compressJsonGzip,createImageData,debug,decompressJsonGzip,disableAllLogs,enableAllLogs,error,errorResult,formatHexOutput,generate,generatePreview,getDefaultConfig,getHIDCodeMapStr,getHIDCodeMapStrNum,getSamplingModeDescription,hex2hex,hidKeyCode,hslToHsv,hslToRgb,hsvToHsl,imageDataToHexArray,info,isImageValid,isShowPopover,log,numToAsciiArr,numToBits16,numToBytes,parseColorString,resetLoggerConfig,resizeImageWithCanvas,resizeImageWithKonva,rgbToHsl,setLoggerConfig,successResult,warn});
|
|
5
5
|
//# sourceMappingURL=index.js.map
|