PageSourceSearch

https://bimform.be/modules/Pages/js/clientAdminMenu.js?v=1784206844489

js bimform.be collected 2026-09-25 02:59:52 UTC 16,572 bytes, 6 lines download raw bytes

1import{c as F,m as q}from"./mount-on-element.js";import{l as W,m as G,n as J,o as Y,p as X}from"./index3.js";import{F as I}from"./index.es.js";import{r as w,d as $,e as Z,o as v,c as _,b as M,u as m,i as x,f as T,F as Q,s as ee,K as te,t as ie,j as ne,N as oe,O as re,P as ae}from"./runtime-core.esm-bundler.js";import{u as se}from"./index2.js";import{u as ce}from"./use-builder-provider.js";var b={};/*!
2 * cookie
3 * Copyright(c) 2012-2014 Roman Shtylman
4 * Copyright(c) 2015 Douglas Christopher Wilson
5 * MIT Licensed
6 */var U;function le(){if(U)return b;U=1,b.parse=f,b.serialize=l;var n=Object.prototype.toString,e=Object.prototype.hasOwnProperty,t=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,i=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,c=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,g=/^[\u0020-\u003A\u003D-\u007E]*$/;function f(r,u){if(typeof r!="string")throw new TypeError("argument str must be a string");var o={},C=r.length;if(C<2)return o;var y=u&&u.decode||A,s=0,p=0,h=0;do{if(p=r.indexOf("=",s),p===-1)break;if(h=r.indexOf(";",s),h===-1)h=C;else if(p>h){s=r.lastIndexOf(";",p-1)+1;continue}var O=d(r,s,p),L=a(r,p,O),P=r.slice(O,L);if(!e.call(o,P)){var S=d(r,p+1,h),D=a(r,h,S);r.charCodeAt(S)===34&&r.charCodeAt(D-1)===34&&(S++,D--);var K=r.slice(S,D);o[P]=j(K,y)}s=h+1}while(s<C);return o}function d(r,u,o){do{var C=r.charCodeAt(u);if(C!==32&&C!==9)return u}while(++u<o);return o}function a(r,u,o){for(;u>o;){var C=r.charCodeAt(--u);if(C!==32&&C!==9)return u+1}return o}function l(r,u,o){var C=o&&o.encode||encodeURIComponent;if(typeof C!="function")throw new TypeError("option encode is invalid");if(!t.test(r))throw new TypeError("argument name is invalid");var y=C(u);if(!i.test(y))throw new TypeError("argument val is invalid");var s=r+"="+y;if(!o)return s;if(o.maxAge!=null){var p=Math.floor(o.maxAge);if(!isFinite(p))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+p}if(o.domain){if(!c.test(o.domain))throw new TypeError("option domain is invalid");s+="; Domain="+o.domain}if(o.path){if(!g.test(o.path))throw new TypeError("option path is invalid");s+="; Path="+o.path}if(o.expires){var h=o.expires;if(!k(h)||isNaN(h.valueOf()))throw new TypeError("option expires is invali
6d");s+="; Expires="+h.toUTCString()}if(o.httpOnly&&(s+="; HttpOnly"),o.secure&&(s+="; Secure"),o.partitioned&&(s+="; Partitioned"),o.priority){var O=typeof o.priority=="string"?o.priority.toLowerCase():o.priority;switch(O){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(o.sameSite){var L=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(L){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s}function A(r){return r.indexOf("%")!==-1?decodeURIComponent(r):r}function k(r){return n.call(r)==="[object Date]"}function j(r,u){try{return u(r)}catch{return r}}return b}var E=le();function ue(){const n=typeof global>"u"?void 0:global.TEST_HAS_DOCUMENT_COOKIE;return typeof n=="boolean"?n:typeof document=="object"&&typeof document.cookie=="string"}function de(n){return typeof n=="string"?E.parse(n):typeof n=="object"&&n!==null?n:{}}function N(n,e={}){const t=Ce(n);if(!e.doNotParse)try{return JSON.parse(t)}catch{}return n}function Ce(n){return n&&n[0]==="j"&&n[1]===":"?n.substr(2):n}class he{constructor(e,t={}){this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.update=()=>{if(!this.HAS_DOCUMENT_COOKIE)return;const c=this.cookies;this.cookies=E.parse(document.cookie),this._checkChanges(c)};const i=typeof document>"u"?"":document.cookie;this.cookies=de(e||i),this.defaultSetOptions=t,this.HAS_DOCUMENT_COOKIE=ue()}_emitChange(e){for(let t=0;t<this.changeListeners.length;++t)this.changeListeners[t](e)}_checkChanges(e){new Set(Object.keys(e).concat(Object.keys(this.cookies))).forEach(i=>{e[i]!==this.cookies[i]&&this._emitChange({name:i,value:N(this.cookies[i])})})}_startPolling(){this.pollingInterval=setInterval(this.update,300)}_stopPolling(){this.pollingInterval&&clearInterval(this.pollingInterval)}get(e,t={}){return t.doNotUpdate||this.update(),N(this.cookies[e],t)}getAll(e={}){e.doNotUpdate||this.update();const t={};for(let i in this.cookies)t[i]=N(this.cookies[i],e);return t}set(e,t,i){i?i=Object.assign(Object.assign({},this.defaultSetOptions),i):i=this.defaultSetOptions;const c=typeof t=="string"?t:JSON.stringify(t);this.cookies=Object.assign(Object.assign({},this.cookies),{[e]:c}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=E.serialize(e,c,i)),this._emitChange({name:e,value:t,options:i})}remove(e,t){const i=t=Object.assign(Object.assign(Object.assign({},this.defaultSetOptions),t),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=E.serialize(e,"",i)),this._emitChange({name:e,value:void 0,options:t})}addChangeListener(e){this.changeListeners.push(e),this.HAS_DOCUMENT_COOKIE&&this.changeListeners.length===1&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(e){const t=this.changeListeners.indexOf(e);t>=0&&this.changeListeners.splice(t,1),this.HAS_DOCUMENT_COOKIE&&this.changeListeners.length===0&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.removeEventListener("change",this.update):this._stopPolling())}}const me={key:0,viewBox:"0 0 18 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"cam-h-8 md:cam-h-12"},fe=oe('<path d="M0.43326 11.829C0.299857 11.9593 0.209008 12.1252 0.1722 12.3059C0.
6135393 12.4866 0.154281 12.6738 0.226476 12.844C0.298671 13.0142 0.420931 13.1597 0.577794 13.262C0.734657 13.3644 0.919078 13.419 1.10774 13.419C1.29639 13.419 1.48081 13.3644 1.63768 13.262C1.79454 13.1597 1.9168 13.0142 1.989 12.844C2.06119 12.6738 2.08008 12.4866 2.04327 12.3059C2.00646 12.1252 1.91561 11.9593 1.78221 11.829C1.60333 11.6544 1.36071 11.5563 1.10774 11.5563C0.85476 11.5563 0.612144 11.6544 0.43326 11.829" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path><path d="M4.61828 11.5403C4.49072 11.6649 4.38954 11.8127 4.3205 11.9755C4.25147 12.1382 4.21594 12.3126 4.21594 12.4888C4.21594 12.6649 4.25147 12.8393 4.3205 13.002C4.38954 13.1648 4.49072 13.3126 4.61828 13.4372C4.74583 13.5617 4.89726 13.6605 5.06392 13.7279C5.23058 13.7953 5.40921 13.83 5.5896 13.83C5.76999 13.83 5.94861 13.7953 6.11527 13.7279C6.28193 13.6605 6.43336 13.5617 6.56092 13.4372C7.70147 12.3233 8.33923 13.0871 9.02551 13.7531C9.28222 14.0032 9.60911 14.1735 9.96486 14.2423C10.3206 14.3111 10.6893 14.2754 11.0243 14.1398C11.3593 14.0041 11.6456 13.7745 11.847 13.48C12.0484 13.1855 12.1559 12.8393 12.1559 12.4852C12.1559 12.1311 12.0484 11.7849 11.847 11.4904C11.6456 11.196 11.3593 10.9664 11.0243 10.8307C10.6893 10.695 10.3206 10.6593 9.96486 10.7281C9.60911 10.797 9.28222 10.9672 9.02551 11.2173V11.2173C8.33923 11.8864 7.70253 12.6515 6.5607 11.5335C6.30239 11.2833 5.95331 11.143 5.58949 11.143C5.22567 11.143 4.87659 11.2833 4.61828 11.5335" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path><path d="M0.386828 23.3912C0.245132 23.2528 0.148639 23.0766 0.10955 22.8846C0.0704619 22.6927 0.0905338 22.4938 0.167228 22.313C0.243922 22.1323 0.373794 21.9777 0.54042 21.869C0.707047 21.7603 0.902946 21.7023 1.10334 21.7023C1.30374 21.7023 1.49964 21.7603 1.66627 21.869C1.8329 21.9777 1.96277 22.1323 2.03946 22.313C2.11616 22.4938 2.13623 22.6927 2.09714 22.8846C2.05805 23.0766 1.96156 23.2528 1.81986 23.3912V23.3912C1.6294 23.576 1.37182 23.6796 1.10334 23.6796C0.834869 23.6796 0.577293 23.576 0.386828 23.3912" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path><path d="M14.3078 5.8347C13.2039 6.9126 13.1024 7.49956 11.5938 6.02654C11.3428 5.78149 11.023 5.61462 10.6748 5.54702C10.3267 5.47943 9.96586 5.51414 9.63793 5.64678C9.31001 5.77942 9.02973 6.00403 8.83254 6.2922C8.63534 6.58037 8.53009 6.91916 8.53009 7.26574C8.53009 7.61231 8.63534 7.9511 8.83254 8.23927C9.02973 8.52744 9.31001 8.75205 9.63793 8.88469C9.96586 9.01733 10.3267 9.05205 10.6748 8.98445C11.023 8.91685 11.3428 8.74998 11.5938 8.50493C13.1051 7.02921 13.2039 7.61887 14.3078 8.69677C14.5977 8.97998 14.9671 9.17289 15.3693 9.25109C15.7715 9.32929 16.1884 9.28927 16.5673 9.1361C16.9461 8.98292 17.27 8.72347 17.4978 8.39056C17.7257 8.05766 17.8473 7.66625 17.8473 7.26584C17.8473 6.86543 17.7257 6.47402 17.4978 6.14112C17.27 5.80821 16.9461 5.54876 16.5673 5.39558C16.1884 5.24241 15.7715 5.20239 15.3693 5.28059C14.9671 5.35879 14.5977 5.5517 14.3078 5.83491" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path><path d="M4.65828 23.6232C4.13377 23.111 4.09502 22.2323 4.65828 21.7613C6.49917 20.2186 3.90344 17.205 1.88374 18.3524C1.35923 18.6506 0.752769 18.7739 0.323199 18.3524C0.220732 18.2523 0.139451 18.1335 0.0839967 18.0028C0.0285421 17.8721 4.03973e-09 17.732 0 17.5905C-4.03972e-09 17.449 0.0285421 17.3089 0.0839967 17.1782C0.139451 17.0474 0.220732 16.9287 0.323199 16.8286C0.425666 16.7286 0.547311 16.6492 0.68119 16.5951C0.81507 16.5409 0.95856 16.513 1.10347 16.513C1.24838 16.513 1.39187 16.5409 1.52575 16.5951C1.65963 16.6492 1.78127 16.7286 1.88374 16.8286C2.68881 17.6147 3.97199 17.1067 4.58164 16.5125C4.72569 16.369 4.89742 16.2549 5.08691 16.1767C5.2764 16.0984 5.47989 16.0576 5.68562 16.0566C5.89136 16.0556 6.09526 16.0944 6.28554 16.1708C6.47582 16.2472 6.64872 16.3596 6.79423 16.5016C6.93974 16.6437 7.05499 16.8124 7.13332 16.9982C7.21164 17.1839 7.25149 17.383 7.25056 17.5839C7.24962 17.7848 7.20793 17.9835 7.12788 18.1685C7.04784 18.3536 6.93102 18.5213 6.7842 18.662V18.662C5.96508 19.4618 5.7256 20.9317 6.56835 21.7577C6.81732 22.006 6.95596 22.34 6.95416 22.6875C6.95235 23.0349 6.81025 23.3676 6.55872 23.6134C6.30718 23.8591 5.96651 23.998 5.61069 24C5.25487 24.0019 4.91263 23.8668 4.65828 23.6238" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path><path d="M4.61823 6.32149C4.36177 6.57357 4.21783 6.91447 4.21783 7.26979C4.21783 7.62511 4.36177 7.96601 4.61823 8.2181V8.2181C4.87654 8.46826 5.22562 8.60862 5.58944 8.60862C5.95326 8.60862 6.30235 8.46826 6.56066 8.2181V8.2181C6.68821 8.09355 6.7894 7.94569 6.85843 7.78297C6.92746 7.62024 6.96299 7.44583 6.96299 7.26969C6.96299 7.09356 6.92746 6.91914 6.85843 6.75642C6.7894 6.59369 6.68821 6.44583 6.56066 6.32128C6.4331 6.19673 6.28167 6.09794 6.11501 6.03053C5.94835 5.96313 5.76973 5.92844 5.58934 5.92844C5.40894 5.92844 5.23032 5.96313 5.06366 6.03053C4.897 6.09794 4.74557 6.19673 4.61801 6.32128" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path><path d="M0.43326 1.13214C0.299857 1.26239 0.209008 1.42835 0.1722 1.60902C0.135393 1.78968 0.154281 1.97695 0.226476 2.14714C0.298671 2.31733 0.420931 2.46279 0.577794 2.56513C0.734657 2.66747 0.919078 2.72209 1.10774 2.72209C1.29639 2.72209 1.48081 2.66747 1.63768 2.56513C1.79454 2.46279 1.9168 2.31733 1.989 2.14714C2.06119 1.97695 2.08008 1.78968 2.04327 1.60902C2.00646 1.42835 1.91561 1.26239 1.78221 1.13214C1.60333 0.957482 1.36071 0.85936 1.10774 0.85936C0.85476 0.85936 0.612144 0.957482 0.43326 1.13214" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path><path d="M4.61828 0.842407C4.49072 0.966954 4.38954 1.11481 4.3205 1.27754C4.25147 1.44027 4.21594 1.61468 4.21594 1.79082C4.21594 1.96695 4.25147 2.14136 4.3205 2.30409C4.38954 2.46682 4.49072 2.61468 4.61828 2.73923C4.74583 2.86377 4.89726 2.96257 5.06392 3.02997C5.23058 3.09738 5.40921 3.13207 5.5896 3.13207C5.76999 3.13207 5.94861 3.09738 6.11527 3.02997C6.28193 2.96257 6.43336 2.86377 6.56092 2.73923C7.70147 1.62412 8.34008 2.38921 9.02552 3.05516C9.28172 3.30638 9.60852 3.47771 9.96452 3.54746C10.3205 3.61721 10.6897 3.58224 11.0253 3.44698C11.361 3.31172 11.6479 3.08225 11.8499 2.78763C12.0519 2.49302 12.1598 2.1465 12.1599 1.79197C12.1601 1.43744 12.0525 1.09084 11.8508 0.796059C11.649 0.501279 11.3622 0.271581 11.0267 0.136051C10.6912 0.000520772 10.3221 -0.0347446 9.966 0.0347205C9.60994 0.104186 9.283 0.275257 9.02658 0.52627V0.52627C8.34029 1.19637 7.7036 1.96042 6.56177 0.842407C6.30346 0.592249 5.95438 0.451884 5.59056 0.451884C5.22674 0.451884 4.87765 0.592249 4.61934 0.842407" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path>
6',8),pe=[fe],ge=["href"],ve=$({__name:"FloatingAdminMenu",props:{links:{}},setup(n){const e=n,t=w(!1),i=w(null),c=w(!1),g=Z(()=>i.value?c.value?"0":"-"+i.value.offsetWidth+"px":"-100%");return(f,d)=>{var a;return(a=e.links)!=null&&a.length?(v(),_("div",{key:0,class:"cam-fixed cam-left-0 cam-top-1/2 cam-z-[1000] cam-flex -cam-translate-x-full -cam-translate-y-1/2 cam-flex-row-reverse cam-items-stretch cam-rounded-r-2xl cam-bg-white cam-shadow-[0px_4px_6px_-2px_#0000000D,0px_10px_15px_-3px_#0000001A] cam-transition-transform",style:ne({transform:`translateX(${m(g)})`})},[M("button",{class:"cam-flex cam-min-h-16 cam-w-10 cam-items-center cam-justify-center cam-rounded-r-2xl cam-px-2 cam-py-4 cam-text-[#2196f3] hover:cam-bg-slate-50 hover:cam-text-slate-500 md:cam-min-h-20 md:cam-w-16",onMouseenter:d[0]||(d[0]=l=>t.value=!0),onMouseleave:d[1]||(d[1]=l=>t.value=!1),onClick:d[2]||(d[2]=l=>c.value=!m(c))},[m(t)?x("",!0):(v(),_("svg",me,pe)),m(t)?(v(),T(m(I),{key:1,icon:m(c)?m(W):m(G),class:"cam-size-6"},null,8,["icon"])):x("",!0)],32),M("ul",{ref_key:"menuList",ref:i,class:"cam-block cam-rounded-br-2xl cam-p-2 cam-text-sm cam-text-slate-500"},[(v(!0),_(Q,null,ee(e.links,l=>(v(),_("li",{key:l.href},[M("a",{href:l.href,target:"_blank",class:"cam-block cam-rounded cam-px-3 cam-py-2 hover:cam-bg-slate-50"},[l.icon?(v(),T(m(I),{key:0,icon:l.icon,class:"cam-mr-1 cam-w-4"},null,8,["icon"])):x("",!0),te(" "+ie(l.title),1)],8,ge)]))),128))],512)],4)):x("",!0)}}});function we(n){return re()?(ae(n),!0):!1}typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function z(n,{doNotParse:e=!1,autoUpdateDependencies:t=!1}={},i=new he){const c=t?[...n||[]]:n;let g=i.getAll({doNotParse:!0});const f=w(0),d=()=>{const a=i.getAll({doNotParse:!0});ke(c||null,a,g)&&f.value++,g=a};return i.addChangeListener(d),we(()=>{i.removeChangeListener(d)}),{get:(...a)=>(t&&c&&!c.includes(a[0])&&c.push(a[0]),f.value,i.get(a[0],{doNotParse:e,...a[1]})),getAll:(...a)=>(f.value,i.getAll({doNotParse:e,...a[0]})),set:(...a)=>i.set(...a),remove:(...a)=>i.remove(...a),addChangeListener:(...a)=>i.addChangeListener(...a),removeChangeListener:(...a)=>i.removeChangeListener(...a)}}function ke(n,e,t){if(!n)return!0;for(const i of n)if(e[i]!==t[i])return!0;return!1}const V=z(["is_admin","test_token"]),_e=()=>{const n=window.location.search,e=new URLSearchParams(n);if(e.has("test_token")){const t=new Date,i=new Date;t.setFullYear(t.getFullYear()+1),V.set("is_admin",1,{path:"/",expires:t}),i.setMinutes(i.getMinutes()+55),V.set("test_token",e.get("test_token"),{path:"/",expires:i}),e.delete("test_token");let c=e.toString();c&&(c="?"+c),window.history.replaceState(null,"",window.location.origin+window.location.pathname+c)}};function ye(){return{setClientCookies:_e}}const{get:H,addChangeListener:Oe}=z(["fired_once","is_admin","test_token"]),R=w(H("is_admin")||!1),Se=w(window.location.pathname.substring(1,8).toLowerCase()==="preview"),B=w(H("test_token"));Oe(n=>{n.name==="test_token"?B.value=String(n.value):n.name==="is_admin"&&(R.value=!!n.value)});function xe(){return{isAdmin:R,isPreview:Se,isTest:B}}const be={key:1},Ee=$({__name:"FloatingAdminMenu",setup(n){const e=se,t=document.querySelector('meta[name="uuid"]')?.content,i=document.querySelector('meta[name="tid"]')?.content;ye().setClientCookies();const{isAdmin:g}=xe(),f="admin.plugandpay.com",a=`https://${f.startsWith("admin.")?f:`admin.${f}`}`,l=k=>i?`${a}/auth/tenants/${i}/redirect?to=${encodeURIComponent(k)}`:`${a}${k}`,A=[{href:l(`/pages/builder/${t}/build`),title:e("common.edit"),icon:J},{href:l(`/statistics/pages?url=${encodeURIComponent(location.pathname)}&unit=views`),title:e("common.statistics"),icon:Y},{href:l("/"),title:e("common.dashboard"),icon:X}];return(k,j)=>m(g)?(v(),T(m(ve),{key:0,links:A})):(v(),_("div",be))}});function Ae(n){const e=F(Ee,{...[],ownInstance:!0,isClientSide:!0}),{provideBuilderState:t}=ce();return t(e,"client"),q(e,n),e}const Le=document.getElementById("floating-admin-menu-app-container");Ae(Le);

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.