"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@aplus-frontend/antdv"),f=require("lodash-unified");require("../../utils/index.js");const l=require("../../utils/is.js");function c(t){return typeof t=="object"&&typeof t.then=="function"?t:!1}const u=(t,n)=>typeof t=="function"&&c(t?.(n)),y=(t,n="0.7")=>{try{let e=t?.toLowerCase();if(e&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e)){if(e.length===4){let o="#";for(let s=1;s<4;s+=1)o+=e.slice(s,s+1).concat(e.slice(s,s+1));e=o}const r=[];for(let o=1;o<7;o+=2)r.push(parseInt(`0x${e.slice(o,o+2)}`,10));return`rgba(${r.join(",")},${n})`}if(e&&e.startsWith("rgb")){let r=e.match(/(\d(\.\d+)?)+/g);return r=r?.slice(0,3)?.concat(n),`rgba(${r.join(",")})`}return e}catch{return}},g=t=>{const{onOk:n=()=>({})}=t;return new Promise((e,i)=>{a.Modal.confirm({onOk:async()=>{try{await n(),e(!0)}catch(r){i(r)}},onCancel:()=>{e(!1)},...f.omit(t,["onOk"])})})},h=t=>{if(l.isDef(t))return typeof t=="string"?t:`${t}px`};exports.confirmHandle=g;exports.getPxStr=h;exports.isAsynchronous=u;exports.isPromise=c;exports.transferOpacityColor=y;
