1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5056],{3959:(t,e,s)=>{"use strict";s.d(e,{Bu:()=>o,Ig:()=>a,m0:()=>u});var r=s(36142),n=s(8777),i=s(8620);let a=t=>{let{alarmType:e}=t;return i.A.getInstance().get("/account/v4/alarm/type/".concat(e))},u=t=>{let{alarmType:e}=t;return(0,r.j)({queryKey:["alarm","type",e],queryFn:()=>a({alarmType:e}),select:t=>{let{data:e}=t;return e},staleTime:1/0})},o=t=>{let{alarmType:e,...s}=t;return(0,n.I)({...u({alarmType:e}),...s})}},8777:(t,e,s)=>{"use strict";s.d(e,{I:()=>i});var r=s(1572),n=s(87338);function i(t,e){return(0,n.t)(t,r.$,e)}},29299:(t,e,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/test/alarm/[alarmType]",function(){return s(57575)}])},33856:(t,e,s)=>{"use strict";s.d(e,{C:()=>u,a:()=>o});var r=s(64146),n=s(36104),i=s(3959),a=s(8620);let u=t=>{let{alarmType:e,value:s}=t;return a.A.getInstance().put("/account/v4/alarm/alarm-type",{alarmType:e,value:s})},o=function(){let{invalidateOnSuccess:t=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(0,r.jE)();return(0,n.n)({mutationFn:u,onSuccess:(s,r)=>{t&&e.invalidateQueries({queryKey:(0,i.m0)({alarmType:r.alarmType}).queryKey})}})}},36104:(t,e,s)=>{"use strict";s.d(e,{n:()=>h});var r=s(51733),n=s(61101),i=s(27750),a=s(45699),u=s(21763),o=class extends a.Q{#t;#e=void 0;#s;#r;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#t.defaultMutationOptions(t),(0,u.f8)(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),e?.mutationKey&&this.options.mutationKey&&(0,u.EN)(e.mutationKey)!==(0,u.EN)(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(t){this.#n(),this.#i(t)}getCurrentResult(){return this.#e}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#n(),this.#i()}mutate(t,e){return this.#r=e,this.#s?.removeObserver(this),this.#s=this.#t.getMutationCache().build(this.#t,this.options),this.#s.addObserver(this),this.#s.execute(t)}#n(){let t=this.#s?.state??(0,n.$)();this.#e={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#i(t){i.j.batch(()=>{if(this.#r&&this.hasListeners()){let e=this.#e.variables,s=this.#e.context;t?.type==="success"?(this.#r.onSuccess?.(t.data,e,s),this.#r.onSettled?.(t.data,null,e,s)):t?.type==="error"&&(this.#r.onError?.(t.error,e,s),this.#r.onSettled?.(void 0,t.error,e,s))}this.listeners.forEach(t=>{t(this.#e)})})}},l=s(64146),c=s(78117);function h(t,e){let s=(0,l.jE)(e),[n]=r.useState(()=>new o(s,t));r.useEffect(()=>{n.setOptions(t)},[n,t]);let a=r.useSyncExternalStore(r.useCallback(t=>n.subscribe(i.j.batchCalls(t)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),u=r.useCallback((t,e)=>{n.mutate(t,e).catch(c.l)},[n]);if(a.error&&(0,c.G)(n.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:u,mutateAsync:a.mutate}}},36142:(t,e,s)=>{"use strict";function r(t){return t}s.d(e,{j:()=>r})},57575:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>f});var r=s(88233),n=s(51733),i=s(64146),a=s(9312),u=s(57063),o=s(51450),l=s(42780),c=s(36142),h=s(8777),d=s(8620);let p=async t=>{let{data:e}=await d.A.getInstance().get("/account/v4/alarm/used-category/".concat(t));return e},m=t=>{let{category:e}=t;return(0,c.j)({queryKey:["alarm-by-used-category",e],queryFn:()=>p(e)})};var y=s(33856),v=s(8350);function f(){let t,e=(0,n.useRef)(null),s=(0,n.useRef)(null),{query:c}=(0,l.useRouter)(),d=c.alarmType,p=(0,i.jE)(),{data:f}=(t={category:d},(0,h.I)(m(t))),{mutateAsync:b}=(0,y.a)(),g=async t=>{let{alarmType:e,value:s}=t;await b({alarmType:e,value:!s}),p.invalidateQueries(m({category:d}))};return(0,n.useEffect)(()=>{if(e.current){let t=document.createElement("div");return t.classList.add("portal-container"),e.current.appendChild(t),s.current=t,document.body.style.backgroundColor="transparent",document.body.style.opacity="1",()=>{t&&e.current&&e.current.removeChild(t),document.body.style.backgroundColor=""}}},[]),(0,r.jsx)("div",{ref:e,className:"relative h-screen [&_.bg-mono-00\\/40]:bg-transparent",children:s.current&&(0,r.jsx)(u.A,{isOpen:!0,onClose:()=>{},detent:"content-height",portalRoot:s.current,children:(0,r.jsxs)(u.A.Container,{children:[(0,r.jsxs)(u.A.Content,{children:[(0,r.jsxs)(u.A.HGroup,{children:[(0,r.jsxs)(u.A.Title,{children:['alarmType "',d,'"']}),(0,r.jsx)(u.A.Description,{children:"ìë ê´ë ¨ íë ì¸ ì¹ë·° í
ì¤í¸ì
ëë¤."})]}),(0,r.jsx)(u.A.Body,{className:"flex h-[300px] flex-col gap-2 overflow-y-scroll",children:null==f?void 0:f.map(t=>(0,r.jsxs)("figure",{className:"flex items-center justify-between",children:[(0,r.jsx)(u.A.ListItem,{className:"shrink-0",title:t.alarmName,description:t.alarmDesc}),(0,r.jsx)(o.A,{onClick:()=>g({alarmType:t.alarmType,value:t.value}),size:"S",variant:t.value?"primary":"secondary",children:t.value?"ON":"OFF"})]},t.alarmId))})]}),(0,r.jsx)(a.A,{sheetType:"full",relative:!0,size:"S",children:(0,r.jsx)(a.A.PrimaryButton,{variant:"primary",size:"FULL",onClick:()=>v.A.popPlainWebview(),children:"íë ì¸ì¹ë·° ë«ê¸°"})})]})})})}}},t=>{t.O(0,[1465,286,1129,7063,636,6593,8792],()=>t(t.s=29299)),_N_E=t.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.