PageSourceSearch

https://ecopowerhub.ai/assets/OwnerModeToggle-CbBNhq-P.js

js ecopowerhub.ai collected 2026-10-05 14:21:53 UTC 2,513 bytes, 1 lines download raw bytes

1import{r as m,j as r}from"./vendor-react-DR-s3MyR.js";import{a3 as d,a4 as l,u as c}from"./App-DrNoFNrD.js";import{S as u}from"./shield-off-C2UhsvSs.js";import"./index-Bku6MSn9.js";import"./vendor-data-BkyUpT8a.js";import"./radix-toast-D0Eg9mYr.js";import"./radix-primitive-BUriELsH.js";import"./radix-slot-DnLuwATg.js";import"./radix-compose-refs-D6dqqAdo.js";import"./radix-collection-30cVg4Vi.js";import"./radix-context-PrlSO5z7.js";import"./radix-dismissable-layer-6HGUYkYJ.js";import"./radix-use-callback-ref-_8_ho4y0.js";import"./radix-use-escape-keydown-ByAYFp_N.js";import"./radix-portal-xSClgmal.js";import"./radix-use-layout-effect-CIo0b4zP.js";import"./radix-presence-BbBgUYEO.js";import"./radix-use-controllable-state-pUF16jyx.js";import"./radix-visually-hidden-CIGFplQ_.js";import"./radix-tooltip-BUM68zcN.js";import"./radix-id-BRVmICFe.js";import"./radix-popper-B0p01UYd.js";import"./radix-arrow-BfTiT5zn.js";import"./radix-use-size-BbCXqNyQ.js";import"./radix-dialog-BeZ4gGxl.js";import"./radix-focus-scope-C7NswZYd.js";import"./radix-focus-guards-arAEqobq.js";import"./radix-label-B4hKXXVP.js";import"./radix-select-D4l0cAFC.js";import"./radix-number-BdQq_4o_.js";import"./radix-direction-CID-gv9T.js";import"./radix-use-previous-D31bNXQt.js";const t="ecopowerhub_owner_mode";function J(){const{isAdmin:a,loading:s}=d(),[o,i]=m.useState(!1);if(m.useEffect(()=>{try{i(localStorage.getItem(t)==="true")}catch{}const e=n=>{n.key===t&&i(n.newValue==="true")};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[]),s||!a)return null;const p=()=>{const e=!o;try{e?localStorage.setItem(t,"true"):localStorage.removeItem(t),window.dispatchEvent(new StorageEvent("storage",{key:t,newValue:e?"true":null}))}catch{}i(e),c(e?"Owner mode on":"Owner mode off",{description:e?"Copy, selection, and right-click are unlocked on this device.":"Content protection restored."})};return r.jsxs("button",{type:"button",onClick:p,"aria-label":o?"Disable owner mode":"Enable owner mode",title:o?"Owner mode: on":"Owner mode: off",className:"fixed bottom-4 left-4 z-50 flex h-10 items-center gap-2 rounded-full border px-3 text-xs font-medium shadow-md backdrop-blur transition "+(o?"border-primary/40 bg-primary/10 text-primary":"border-border bg-background/80 text-muted-foreground hover:text-foreground"),children:[o?r.jsx(u,{className:"h-4 w-4"}):r.jsx(l,{className:"h-4 w-4"}),r.jsxs("span",{children:["Owner mode: ",o?"on":"off"]})]})}export{J as OwnerModeToggle,J as default};

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.