import{af as s,aw as l,cF as g,ai as d}from"./D3l4Cb4m.js";import{g as p,b as h}from"./C4Om2k4R.js";import{v as w}from"./BbpBKUVh.js";function c(t){const n=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&n==="[object Date]"?new t.constructor(+t):typeof t=="number"||n==="[object Number]"||typeof t=="string"||n==="[object String]"?new Date(t):new Date(NaN)}function f(t,n){return t instanceof Date?new t.constructor(n):new Date(n)}function y(t,n){const e=c(t);if(isNaN(n))return f(t,NaN);const i=e.getDate(),r=f(t,e.getTime());r.setMonth(e.getMonth()+n+1,0);const o=r.getDate();return i>=o?r:(e.setFullYear(r.getFullYear(),r.getMonth(),i),e)}function b(t){const n=c(t);return n.setHours(0,0,0,0),n}function D(t,n){return y(t,n*12)}function S(t){const n=c(t);return n.setHours(23,59,59,999),n}function m(t){return c(t).getTime()}function N(t,n){return D(t,-n)}const{guestSign:A}=d();function T(t){const n="/cloudcc-ms-im/im/guest/imGuestLogin.api",{systemName:e,systemVersion:i}=p(),{browserName:r,browserVersion:o}=h(),a={os:`${e} ${i}`,browserName:`${r} ${o}`,deviceCode:w(),sign:A.value,...t};return s.formData(n,a).then(u=>{if(u.statusCode!==200)throw new Error(u.message);return u.data})}function I(t){const n="/linkcircle-im/imApi/queryChatHistory.api",e=new Date,i=m(N(b(e),1)),r=m(S(e)),o={requestId:l(),timestamp:m(e),startTime:i,endTime:r,...t};return o.sign=g(o),s.post(n,o).then(a=>{if(a.code!==0)throw new Error(a.message);return a.result??[]})}function O(t){return s.post("/cloudcc-ms-im/im/sessionTransfer/add",t).then(e=>{if(e.code!==200)throw new Error(e.message);return e})}function j(t){return s.get("/cloudcc-ms-im/im/ImLanguage/translationConfig",t).then(e=>{if(e.code!==200)throw new Error(e.message);return e})}function q(t){return s.get("/cloudcc-ms-im/im/sessionSetting/query",t).then(e=>{if(e.code!==200)throw new Error(e.message);return e.result||{}})}function F(t){const n="/linkcircle-im/imApi/updateContent";return t.requestId=l(),s.post(n,t).then(e=>{if(e.code!==200)throw new Error(e.message);return e})}function _(t){return s.get("/cloudcc-ms-im/im/guest/getOne",t).then(e=>{if(e.code!==200)throw new Error(e.message);return e.result||{}})}function H(t){return s.post("/cloudcc-ms-im/im/sessionLabelRecord/queryBySessionId",t).then(e=>{if(e.code!==200)throw new Error(e.message);return e.result||[]})}export{H as a,q as b,I as c,f as d,m as e,b as f,j as g,S as h,_ as i,T as l,O as s,c as t,F as u};
