1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Files
netbox-community-netbox/netbox/project-static/dist/netbox.js

38 lines
428 KiB
JavaScript
Raw Normal View History

(()=>{var mw=Object.create;var Zo=Object.defineProperty,gw=Object.defineProperties,vw=Object.getOwnPropertyDescriptor,bw=Object.getOwnPropertyDescriptors,yw=Object.getOwnPropertyNames,eh=Object.getOwnPropertySymbols,Ew=Object.getPrototypeOf,th=Object.prototype.hasOwnProperty,_w=Object.prototype.propertyIsEnumerable;var iu=(ii,ti,ei)=>ti in ii?Zo(ii,ti,{enumerable:!0,configurable:!0,writable:!0,value:ei}):ii[ti]=ei,Vi=(ii,ti)=>{for(var ei in ti||(ti={}))th.call(ti,ei)&&iu(ii,ei,ti[ei]);if(eh)for(var ei of eh(ti))_w.call(ti,ei)&&iu(ii,ei,ti[ei]);return ii},rl=(ii,ti)=>gw(ii,bw(ti)),ih=ii=>Zo(ii,"__esModule",{value:!0});var _i=(ii,ti)=>()=>(ti||ii((ti={exports:{}}).exports,ti),ti.exports),ww=(ii,ti)=>{ih(ii);for(var ei in ti)Zo(ii,ei,{get:ti[ei],enumerable:!0})},xw=(ii,ti,ei)=>{if(ti&&typeof ti=="object"||typeof ti=="function")for(let ri of yw(ti))!th.call(ii,ri)&&ri!=="default"&&Zo(ii,ri,{get:()=>ti[ri],enumerable:!(ei=vw(ti,ri))||ei.enumerable});return ii},Ln=ii=>xw(ih(Zo(ii!=null?mw(Ew(ii)):{},"default",ii&&ii.__esModule&&"default"in ii?{get:()=>ii.default,enumerable:!0}:{value:ii,enumerable:!0})),ii);var Yi=(ii,ti,ei)=>(iu(ii,typeof ti!="symbol"?ti+"":ti,ei),ei);var Fr=(ii,ti,ei)=>new Promise((ri,ni)=>{var si=li=>{try{ai(ei.next(li))}catch(ci){ni(ci)}},oi=li=>{try{ai(ei.throw(li))}catch(ci){ni(ci)}},ai=li=>li.done?ri(li.value):Promise.resolve(li.value).then(si,oi);ai((ei=ei.apply(ii,ti)).next())});var Hp=_i((exports,module)=>{(function(ii,ti){typeof define=="function"&&define.amd?define([],ti):ii.htmx=ii.htmx||ti()})(typeof self!="undefined"?self:exports,function(){return function(){"use strict";var U={onLoad:t,process:vt,on:X,off:F,trigger:$,ajax:nr,find:R,findAll:O,closest:N,values:function(ii,ti){var ei=Pt(ii,ti||"post");return ei.values},remove:q,addClass:L,removeClass:T,toggleClass:A,takeClass:H,defineExtension:fr,removeExtension:cr,logAll:C,logger:null,config:{historyEnabled:!0,historyCacheSize:10,refreshOnHistoryMiss:!1,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:!0,indicatorClass:"htmx-indicator",requestClass:"htmx-request",addedClass:"htmx-added",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",allowEval:!0,inlineScriptNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:!1,timeout:0,wsReconnectDelay:"full-jitter",disableSelector:"[hx-disable], [data-hx-disable]",useTemplateFragments:!1,scrollBehavior:"smooth",defaultFocusScroll:!1},parseInterval:v,_:e,createEventSource:function(ii){return new EventSource(ii,{withCredentials:!0})},createWebSocket:function(ii){return new WebSocket(ii,[])},version:"1.8.0"},r={addTriggerHandler:st,bodyContains:K,canAccessLocalStorage:E,filterValues:Ut,hasAttribute:o,getAttributeValue:V,getClosestMatch:h,getExpressionVars:Qt,getHeaders:Bt,getInputValues:Pt,getInternalData:W,getSwapSpecification:_t,getTriggerSpecs:Me,getTarget:re,makeFragment:g,mergeObjects:Y,makeSettleInfo:Gt,oobSwap:ae,selectAndSwap:Ee,settleImmediately:Lt,shouldCancel:je,triggerEvent:$,triggerErrorEvent:J,withExtensions:xt},n=["get","post","put","delete","patch"],i=n.map(function(ii){return"[hx-"+ii+"], [data-hx-"+ii+"]"}).join(", ");function v(ii){if(ii!=null)return ii.slice(-2)=="ms"?parseFloat(ii.slice(0,-2))||void 0:ii.slice(-1)=="s"?parseFloat(ii.slice(0,-1))*1e3||void 0:ii.slice(-1)=="m"?parseFloat(ii.slice(0,-1))*1e3*60||void 0:parseFloat(ii)||void 0}function f(ii,ti){return ii.getAttribute&&ii.getAttribute(ti)}function o(ii,ti){return ii.hasAttribute&&(ii.hasAttribute(ti)||ii.hasAttribute("data-"+ti))}function V(ii,ti){return f(ii,ti)||f(ii,"data-"+ti)}function u(ii){return ii.parentElement}function _(){return document}function h(ii,ti){for(;ii&&!ti(ii);)ii=u(ii);return ii||null}function a(ii,ti,ei){var ri=V(ti,ei),ni=V(ti,"hx-disinherit");return ii!==ti&&ni&&(ni==="*"||ni.split(" ").indexOf(ei)>=0)?"unset":ri}function z(ii,ti){var ei=null;if(h(ii,function(ri){return ei=a(ii,ri,ti)}),ei!=="unset")return ei}function d(ii,ti){var ei=ii.matches||ii.matchesSelector||ii.msMatchesSelector||ii.mozMatchesSelector||ii.webkitMatc
\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`});var zg=_i((vq,Bg)=>{var tC=Gs(),iC=ys(),rC=fd(),Wl="["+rC+"]",nC=RegExp("^"+Wl+Wl+"*"),sC=RegExp(Wl+Wl+"*$"),hd=function(ii){return function(ti){var ei=iC(tC(ti));return ii&1&&(ei=ei.replace(nC,"")),ii&2&&(ei=ei.replace(sC,"")),ei}};Bg.exports={start:hd(1),end:hd(2),trim:hd(3)}});var Wg=_i((bq,Ug)=>{var oC=kr(),aC=ys(),lC=zg().trim,Fg=fd(),Vl=oC.parseInt,cC=/^[+-]?0[Xx]/,uC=Vl(Fg+"08")!==8||Vl(Fg+"0x16")!==22;Ug.exports=uC?function(ti,ei){var ri=lC(aC(ti));return Vl(ri,ei>>>0||(cC.test(ri)?16:10))}:Vl});var pd=_i((Eq,Gg)=>{var fC=ld(),hC=Fl();Gg.exports=Object.keys||function(ti){return fC(ti,hC)}});var Jg=_i((_q,Xg)=>{"use strict";var Yg=ms(),pC=Br(),md=pd(),mC=cd(),gC=sd(),vC=Ys(),bC=Da(),Ao=Object.assign,Kg=Object.defineProperty;Xg.exports=!Ao||pC(function(){if(Yg&&Ao({b:1},Ao(Kg({},"a",{enumerable:!0,get:function(){Kg(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var ii={},ti={},ei=Symbol(),ri="abcdefghijklmnopqrst";return ii[ei]=7,ri.split("").forEach(function(ni){ti[ni]=ni}),Ao({},ii)[ei]!=7||md(Ao({},ti)).join("")!=ri})?function(ti,ei){for(var ri=vC(ti),ni=arguments.length,si=1,oi=mC.f,ai=gC.f;ni>si;)for(var li=bC(arguments[si++]),ci=oi?md(li).concat(oi(li)):md(li),ui=ci.length,fi=0,di;ui>fi;)di=ci[fi++],(!Yg||ai.call(li,di))&&(ri[di]=li[di]);return ri}:Ao});var ev=_i((xq,Zg)=>{var EC=Br(),_C=Kr(),wC=kl(),xC=_C("species");Zg.exports=function(ii){return wC>=51||!EC(function(){var ti=[],ei=ti.constructor={};return ei[xC]=function(){return{foo:1}},ti[ii](Boolean).foo!==1})}});var iv=_i((Tq,tv)=>{var CC=ms(),AC=gs(),LC=pn(),MC=pd();tv.exports=CC?Object.defineProperties:function(ti,ei){LC(ti);for(var ri=MC(ei),ni=ri.length,si=0,oi;ni>si;)AC.f(ti,oi=ri[si++],ei[oi]);return ti}});var nv=_i((Oq,rv)=>{var RC=wa();rv.exports=RC("document","documentElement")});var Kl=_i((Dq,dv)=>{var NC=pn(),kC=iv(),sv=Fl(),IC=Ta(),PC=nv(),jC=zu(),HC=Hl(),ov=">",av="<",gd="prototype",vd="script",lv=HC("IE_PROTO"),bd=function(){},cv=function(ii){return av+vd+ov+ii+av+"/"+vd+ov},uv=function(ii){ii.write(cv("")),ii.close();var ti=ii.parentWindow.Object;return ii=null,ti},qC=function(){var ii=jC("iframe"),ti="java"+vd+":",ei;return ii.style.display="none",PC.appendChild(ii),ii.src=String(ti),ei=ii.contentWindow.document,ei.open(),ei.write(cv("document.F=Object")),ei.close(),ei.F},Gl,Yl=function(){try{Gl=new ActiveXObject("htmlfile")}catch(ti){}Yl=typeof document!="undefined"?document.domain&&Gl?uv(Gl):qC():uv(Gl);for(var ii=sv.length;ii--;)delete Yl[gd][sv[ii]];return Yl()};IC[lv]=!0;dv.exports=Object.create||function(ti,ei){var ri;return ti!==null?(bd[gd]=NC(ti),ri=new bd,bd[gd]=null,ri[lv]=ti):ri=Yl(),ei===void 0?ri:kC(ri,ei)}});var hv=_i((Cq,fv)=>{var $C=Kr(),BC=Kl(),zC=gs(),yd=$C("unscopables"),Ed=Array.prototype;Ed[yd]==null&&zC.f(Ed,yd,{configurable:!0,value:BC(null)});fv.exports=function(ii){Ed[yd][ii]=!0}});var Lo=_i((Aq,pv)=>{pv.exports={}});var gv=_i((Lq,mv)=>{var FC=Br();mv.exports=!FC(function(){function ii(){}return ii.prototype.constructor=null,Object.getPrototypeOf(new ii)!==ii.prototype})});var _d=_i((Mq,bv)=>{var UC=wn(),WC=Ys(),VC=Hl(),GC=gv(),vv=VC("IE_PROTO"),YC=Object.prototype;bv.exports=GC?Object.getPrototypeOf:function(ii){return ii=WC(ii),UC(ii,vv)?ii[vv]:typeof ii.constructor=="function"&&ii instanceof ii.constructor?ii.constructor.prototype:ii instanceof Object?YC:null}});var Td=_i((Rq,wv)=>{"use strict";var KC=Br(),yv=_d(),XC=ts(),JC=wn(),QC=Kr(),ZC=Cl(),wd=QC("iterator"),Ev=!1,eA=function(){return this},Zs,xd,Sd;[].keys&&(Sd=[].keys(),"next"in Sd?(xd=yv(yv(Sd)),xd!==Object.prototype&&(Zs=xd)):Ev=!0);var _v=Zs==null||KC(function(){var ii={};return Zs[wd].call(ii)!==ii});_v&&(Zs={});(!ZC||_v)&&!JC(Zs,wd)&&XC(Zs,wd,eA);wv.exports={IteratorPrototype:Zs,BUGGY_SAFARI_ITERATORS:Ev}});var Xl=_i((Nq,Sv)=>{var tA=gs().f,iA=wn(),rA=Kr(),xv=rA("toStringTag");Sv.exports=function(ii,ti,ei){ii&&!iA(ii=ei?ii:ii.prototype,xv)&&tA(ii,xv,{configurable:!0,value:ti})}});var Ov=_i((kq,Tv)=>{"use strict";
`)&&ii.flags==="s")})});var Iy=_i((wB,ky)=>{var xR=Br(),SR=kr(),TR=SR.RegExp;ky.exports=xR(function(){var ii=TR("(?<a>b)","g");return ii.exec("b").groups.a!=="b"||"b".replace(ii,"$<a>c")!=="bc"})});var vc=_i((xB,Hy)=>{"use strict";var OR=ys(),DR=Cy(),Py=My(),CR=Ml(),AR=Kl(),LR=Xs().get,MR=Ny(),RR=Iy(),gc=RegExp.prototype.exec,NR=CR("native-string-replace",String.prototype.replace),gf=gc,vf=function(){var ii=/a/,ti=/b*/g;return gc.call(ii,"a"),gc.call(ti,"a"),ii.lastIndex!==0||ti.lastIndex!==0}(),jy=Py.UNSUPPORTED_Y||Py.BROKEN_CARET,bf=/()??/.exec("")[1]!==void 0,kR=vf||bf||jy||MR||RR;kR&&(gf=function(ti){var ei=this,ri=LR(ei),ni=OR(ti),si=ri.raw,oi,ai,li,ci,ui,fi,di;if(si)return si.lastIndex=ei.lastIndex,oi=gf.call(si,ni),ei.lastIndex=si.lastIndex,oi;var hi=ri.groups,gi=jy&&ei.sticky,vi=DR.call(ei),yi=ei.source,Ei=0,xi=ni;if(gi&&(vi=vi.replace("y",""),vi.indexOf("g")===-1&&(vi+="g"),xi=ni.slice(ei.lastIndex),ei.lastIndex>0&&(!ei.multiline||ei.multiline&&ni.charAt(ei.lastIndex-1)!==`
`)&&(yi="(?: "+yi+")",xi=" "+xi,Ei++),ai=new RegExp("^(?:"+yi+")",vi)),bf&&(ai=new RegExp("^"+yi+"$(?!\\s)",vi)),vf&&(li=ei.lastIndex),ci=gc.call(gi?ai:ei,xi),gi?ci?(ci.input=ci.input.slice(Ei),ci[0]=ci[0].slice(Ei),ci.index=ei.lastIndex,ei.lastIndex+=ci[0].length):ei.lastIndex=0:vf&&ci&&(ei.lastIndex=ei.global?ci.index+ci[0].length:li),bf&&ci&&ci.length>1&&NR.call(ci[0],ai,function(){for(ui=1;ui<arguments.length-2;ui++)arguments[ui]===void 0&&(ci[ui]=void 0)}),ci&&hi)for(ci.groups=fi=AR(null),ui=0;ui<hi.length;ui++)di=hi[ui],fi[di[0]]=ci[di[1]];return ci});Hy.exports=gf});var yf=_i(()=>{"use strict";var IR=is(),qy=vc();IR({target:"RegExp",proto:!0,forced:/./.exec!==qy},{exec:qy})});var _f=_i((OB,Fy)=>{"use strict";yf();var $y=Js(),PR=vc(),By=Br(),zy=Kr(),jR=ts(),HR=zy("species"),Ef=RegExp.prototype;Fy.exports=function(ii,ti,ei,ri){var ni=zy(ii),si=!By(function(){var ci={};return ci[ni]=function(){return 7},""[ii](ci)!=7}),oi=si&&!By(function(){var ci=!1,ui=/a/;return ii==="split"&&(ui={},ui.constructor={},ui.constructor[HR]=function(){return ui},ui.flags="",ui[ni]=/./[ni]),ui.exec=function(){return ci=!0,null},ui[ni](""),!ci});if(!si||!oi||ei){var ai=/./[ni],li=ti(ni,""[ii],function(ci,ui,fi,di,hi){var gi=ui.exec;return gi===PR||gi===Ef.exec?si&&!hi?{done:!0,value:ai.call(ui,fi,di)}:{done:!0,value:ci.call(fi,ui,di)}:{done:!1}});$y(String.prototype,ii,li[0]),$y(Ef,ni,li[1])}ri&&jR(Ef[ni],"sham",!0)}});var wf=_i((DB,Uy)=>{"use strict";var qR=Rd().charAt;Uy.exports=function(ii,ti,ei){return ti+(ei?qR(ii,ti).length:1)}});var xf=_i((CB,Wy)=>{var $R=Do(),BR=vc();Wy.exports=function(ii,ti){var ei=ii.exec;if(typeof ei=="function"){var ri=ei.call(ii,ti);if(typeof ri!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return ri}if($R(ii)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return BR.call(ii,ti)}});var Ky=_i((MB,Yy)=>{var JR=Ys(),QR=Math.floor,ZR="".replace,eN=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,tN=/\$([$&'`]|\d{1,2})/g;Yy.exports=function(ii,ti,ei,ri,ni,si){var oi=ei+ii.length,ai=ri.length,li=tN;return ni!==void 0&&(ni=JR(ni),li=eN),ZR.call(si,li,function(ci,ui){var fi;switch(ui.charAt(0)){case"$":return"$";case"&":return ii;case"`":return ti.slice(0,ei);case"'":return ti.slice(oi);case"<":fi=ni[ui.slice(1,-1)];break;default:var di=+ui;if(di===0)return ci;if(di>ai){var hi=QR(di/10);return hi===0?ci:hi<=ai?ri[hi-1]===void 0?ui.charAt(1):ri[hi-1]+ui.charAt(1):ci}fi=ri[di-1]}return fi===void 0?"":fi})}});var xE=_i((hz,wE)=>{"use strict";wE.exports=ii=>encodeURIComponent(ii).replace(/[!'()*]/g,ti=>`%${ti.charCodeAt(0).toString(16).toUpperCase()}`)});var CE=_i((pz,DE)=>{"use strict";var SE="%[a-f0-9]{2}",TE=new RegExp(SE,"gi"),OE=new RegExp("("+SE+")+","gi");function Rf(ii,ti){try{return decodeURIComponent(ii.join(""))}catch(ni){}if(ii.length===1)return ii;ti=ti||1;var ei=ii.slice(0,ti),ri=ii.slice(ti);return Array.prototype.concat.call([],Rf(ei),Rf(ri))}function jN(ii){try{return decodeURIComponent(ii)}catch(ri){for(var ti=ii.match(TE),ei=1;ei<ti.length;ei++)ii=Rf(ti,ei).join(""),ti=ii.match(TE);return ii}}function HN(ii){for(var ti={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},ei=OE.exec(ii);ei;){try{ti[ei[0]]=decodeURIComponent(ei[0])}catch(ai){var ri=jN(ei[0]);ri!==ei[0]&&(ti[ei[0]]=ri)}ei=OE.exec(ii)}ti["%C2"]="\uFFFD";for(var ni=Object.keys(ti),si=0;si<ni.length;si++){var oi=ni[si];ii=ii.replace(new RegExp(oi,"g"),ti[oi])}return ii}DE.exports=function(ii){if(typeof ii!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof ii+"`");try{return ii=ii.replace(/\+/g," "),decodeURIComponent(ii)}catch(ti){return HN(ii)}}});var LE=_i((mz,AE)=>{"use strict";AE.exports=(ii,ti)=>{if(!(typeof ii=="string"&&typeof ti=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(ti==="")return[ii];let ei=ii.indexOf(ti);return ei===-1?[ii]:[ii.slice(0,ei),ii.slice(ei+ti.length)]}});var RE=_i((gz,ME)=>{"use strict";ME.exports=function(ii,ti){for(var ei={},ri=Object.keys(ii),ni=Array.isArray(ti),si=0;si<ri.leng
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(ti={},ei=".grid-stack"){let ri=[];return Ar.getGridElements(ei).forEach(ni=>{ni.gridstack||(ni.gridstack=new Ar(ni,Mi.Utils.cloneDeep(ti)),delete ti.dragIn,delete ti.dragInOptions),ri.push(ni.gridstack)}),ri.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+ei+`" - element missing or wrong selector ?
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`),ri}static addGrid(ti,ei={}){if(!ti)return null;let ri=ti;if(!ti.classList.contains("grid-stack")){let si=document.implementation.createHTMLDocument("");si.body.innerHTML=`<div class="grid-stack ${ei.class||""}"></div>`,ri=si.body.children[0],ti.appendChild(ri)}return Ar.init(ei,ri)}static registerEngine(ti){Ar.engineClass=ti}get placeholder(){if(!this._placeholder){let ti=document.createElement("div");ti.className="placeholder-content",this.opts.placeholderText&&(ti.innerHTML=this.opts.placeholderText),this._placeholder=document.createElement("div"),this._placeholder.classList.add(this.opts.placeholderClass,gn.gridDefaults.itemClass,this.opts.itemClass),this.placeholder.appendChild(ti)}return this._placeholder}addWidget(ti,ei){function ri(ai){return ai.el!==void 0||ai.x!==void 0||ai.y!==void 0||ai.w!==void 0||ai.h!==void 0||ai.content!==void 0}let ni,si;if(typeof ti=="string"){let ai=document.implementation.createHTMLDocument("");ai.body.innerHTML=ti,ni=ai.body.children[0]}else if(arguments.length===0||arguments.length===1&&ri(ti))if(si=ei=ti,si==null?void 0:si.el)ni=si.el;else if(this.opts.addRemoveCB)ni=this.opts.addRemoveCB(this,ei,!0);else{let ai=(ei==null?void 0:ei.content)||"",li=document.implementation.createHTMLDocument("");li.body.innerHTML=`<div class="grid-stack-item ${this.opts.itemClass||""}"><div class="grid-stack-item-content">${ai}</div></div>`,ni=li.body.children[0]}else ni=ti;if(!ni)return;let oi=this._readAttr(ni);return ei=Mi.Utils.cloneDeep(ei)||{},Mi.Utils.defaults(ei,oi),si=this.engine.prepareNode(ei),this._writeAttr(ni,ei),this._insertNotAppend?this.el.prepend(ni):this.el.appendChild(ni),this._prepareElement(ni,!0,ei),this._updateContainerHeight(),si.subGrid&&this.makeSubGrid(si.el,void 0,void 0,!1),this._prevColumn&&this.opts.column===1&&(this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,ni}makeSubGrid(ti,ei,ri,ni=!0){var si,oi,ai;let li=ti.gridstackNode;if(li||(li=this.makeWidget(ti).gridstackNode),(si=li.subGrid)===null||si===void 0?void 0:si.el)return li.subGrid;let ci,ui=this;for(;ui&&!ci;)ci=(oi=ui.opts)===null||oi===void 0?void 0:oi.subGrid,ui=(ai=ui.parentGridItem)===null||ai===void 0?void 0:ai.grid;ei=Mi.Utils.cloneDeep(Object.assign(Object.assign(Object.assign({},ci||{}),{children:void 0}),ei||li.subGrid)),li.subGrid=ei;let fi;ei.column==="auto"&&(fi=!0,ei.column=Math.max(li.w||1,(ri==null?void 0:ri.w)||1),ei.disableOneColumnMode=!0);let di=li.el.querySelector(".grid-stack-item-content"),hi,gi;if(ni){this._removeDD(li.el);let yi=document.implementation.createHTMLDocument("");yi.body.innerHTML='<div class="grid-stack-item"></div>',hi=yi.body.children[0],hi.appendChild(di),gi=Object.assign(Object.assign({},li),{x:0,y:0}),Mi.Utils.removeInternalForSave(gi),delete gi.subGrid,li.content&&(gi.content=li.content,delete li.content),yi.body.innerHTML='<div class="grid-stack-item-content"></div>',di=yi.body.children[0],li.el.appendChild(di),this._prepareDragDropByNode(li)}if(ri){let yi=fi?ei.column:li.w,Ei=li.h+ri.h,xi=li.el.style;xi.transition="none",this.update(li.el,{w:yi,h:Ei}),setTimeout(()=>xi.transition=null)}let vi=li.subGrid=Ar.addGrid(di,ei);return(ri==null?void 0:ri._moving)&&(vi._isTemp=!0),fi&&(vi._autoColumn=!0),ni&&vi.addWidget(hi,gi),ri&&(ri._moving?window.setTimeout(()=>Mi.Utils.simulateMouseEvent(ri._event,"mouseenter",vi.el),0):vi.addWidget(li.el,li)),vi}removeAsSubGrid(ti){var ei;let ri=(ei=this.parentGridItem)===null||ei===void 0?void 0:ei.grid;!ri||(ri.batchUpdate(),ri.removeWidget(this.parentGridItem.el,!0,!0),this.engine.nodes.forEach(ni=>{ni.x+=this.parentGridItem.x,ni.y+=this.parentGridItem.y,ri.addWidget(ni.el,ni)}),ri.batchUpdate(!1),delete this.parentGridItem,ti&&window.setTimeout(()=>Mi.Utils.simulateMouseEvent(ti._event,"mouseenter",ri.el),0))}save(ti=!0,ei=!1){let ri=this.engine.save(ti);if(ri.forEach(ni=>{var si;if(ti&&ni.el&&!ni.subGrid){let oi=ni.el.querySelector(".grid-stack-item-content");n
`)}:!oi.ok&&"detail"in li?{error:li.detail}:li})}function Po(ii,ti){return Fr(this,null,function*(){return yield iE(ii,"PATCH",ti)})}function vN(ii){return Fr(this,null,function*(){return yield iE(ii,"GET")})}function rE(ii){return Fr(this,null,function*(){return yield vN(ii)})}function*Li(...ii){for(let ti of ii)for(let ei of document.querySelectorAll(ti))ei!==null&&(yield ei)}function qa(ii){return document.getElementById(ii)}function nE(ii,ti=0){let ei=ti,ri=document.getElementById("content-title");ri!==null&&(ei+=ri.getBoundingClientRect().bottom);let ni=ii.getBoundingClientRect().top+window.pageYOffset+ei;window.scrollTo({top:ni,behavior:"smooth"})}function sE(ii,ti="select"){let ei=[];for(let ri of ii.querySelectorAll(ti))if(ri!==null){let ni={name:ri.name,options:[]};for(let si of ri.options)si.selected&&ni.options.push(si.value);ei=[...ei,ni]}return ei}function Lf(ii,ti){ii!==null&&(typeof ti=="undefined"?window.getComputedStyle(ii).display==="none"?ii.style.display="":ii.style.display="none":ti==="show"?ii.style.display="":ii.style.display="none")}function _s(ii,ti,ei){function ri(si){return!!(typeof ei=="string"&&si!==null&&si.matches(ei))}function ni(si){if(si!==null&&si.parentElement!==null&&!ri(si)){for(let oi of si.parentElement.querySelectorAll(ti))if(oi!==null)return oi;return ni(si.parentElement.parentElement)}return null}return ni(ii)}function jo(ii,ti,ei=null,ri=[]){let ni=document.createElement(ii);if(ti!==null)for(let si of Object.keys(ti)){let oi=si,ai=ti[oi];oi in ni&&(ni[oi]=ai)}ei!==null&&ei.length>0&&ni.classList.add(...ei);for(let si of ri)ni.appendChild(si);return ni}function oE(ii,ti){let ei=new Map;for(let ri of ii){let ni=ri[ti];ei.has(ni)||ei.set(ni,ri)}return Array.from(ei.values())}function ws(ii,ti,ei){if(typeof ii!="string")throw new TypeError("replaceAll 'input' argument must be a string");if(typeof ti!="string"&&!(ti instanceof RegExp))throw new TypeError("replaceAll 'pattern' argument must be a string or RegExp instance");switch(typeof ei){case"boolean":ei=String(ei);break;case"number":ei=String(ei);break;case"string":break;default:throw new TypeError("replaceAll 'replacement' argument must be stringifyable")}if(ti instanceof RegExp){let ri=Array.from(new Set([...ti.flags.split(""),"g"])).join("");ti=new RegExp(ti.source,ri)}else ti=new RegExp(ti,"g");return ii.replace(ti,ei)}function bN(ii,ti){let ei=new Set;for(let ri of ti.querySelectorAll("*[name]"))ri.validity.valid?ri.classList.contains("is-invalid")&&ri.classList.remove("is-invalid"):(ei.add(ri.name),ri.classList.contains("is-invalid")||ri.classList.add("is-invalid"));if(ei.size!==0){let ri=ti.elements.namedItem(Array.from(ei)[0]);nE(ri),ii.preventDefault()}}function aE(){for(let ii of Li("form")){let ti=ii.querySelectorAll("button[type=submit]");for(let ei of ti)ei.addEventListener("click",ri=>bN(ri,ii))}}function lE(){for(let ii of Li("a.set_speed"))if(ii!==null){let ti=function(ei){ei.preventDefault();let ri=ii.getAttribute("data"),ni=document.getElementById(ii.target);ni!==null&&ri!==null&&(ni.value=ri)};ii.addEventListener("click",ti)}}var cE={vlangroup:{region:{hide:["id_sitegroup","id_site","id_location","id_rack","id_clustergroup","id_cluster"],show:["id_region"]},"site group":{hide:["id_region","id_site","id_location","id_rack","id_clustergroup","id_cluster"],show:["id_sitegroup"]},site:{hide:["id_location","id_rack","id_clustergroup","id_cluster"],show:["id_region","id_sitegroup","id_site"]},location:{hide:["id_rack","id_clustergroup","id_cluster"],show:["id_region","id_sitegroup","id_site","id_location"]},rack:{hide:["id_clustergroup","id_cluster"],show:["id_region","id_sitegroup","id_site","id_location","id_rack"]},"cluster group":{hide:["id_region","id_sitegroup","id_site","id_location","id_rack","id_cluster"],show:["id_clustergroup"]},cluster:{hide:["id_region","id_sitegroup","id_site","id_location","id_rack"],show:["id_clustergroup","id_cluster"]},default:{hide:["id_region","id_sitegroup","id_site","id_location","id_rack","id_clustergroup","id_cluster"],show:[]}}},uE={vlangroup_add:"vlangroup",vlangroup_edit:"
div.ss-values div.ss-value[data-id="${ei}"],
div.ss-list div.ss-option:not(.ss-disabled)[data-id="${ei}"]
{
background-color: ${si} !important;
color: ${oi} !important;
}
`,`
`,"").trim(),document.head.appendChild(ni)}}resetClasses(){let ti=this.slim.slim;if(ti)for(let ei of this.base.classList)ti.container.classList.remove(ei)}initResetButton(){let ti=_s(this.base,"button[data-reset-select]");ti!==null&&ti.addEventListener("click",()=>{window.location.assign(window.location.origin+window.location.pathname)})}initRefreshButton(){if(this.allowRefresh){let ti=jo("button",{type:"button"},["btn","btn-sm","btn-ghost-dark"],[jo("i",null,["mdi","mdi-reload"])]);ti.addEventListener("click",()=>this.loadData()),ti.type="button",this.slim.slim.search.container.appendChild(ti)}}};function YE(){for(let ii of Li(".netbox-api-select:not([data-ssid])"))new Pf(ii)}function KE(ii){return typeof ii.value=="string"&&ii.value!==""}function XE(ii,ti){if(ii.slim.singleSelected!==null)if(KE(ti)){let ei=`#${ti.value}`,ri=za(ei);ii.slim.singleSelected.container.style.backgroundColor=ei,ii.slim.singleSelected.container.style.color=ri}else ii.slim.singleSelected.container.removeAttribute("style")}function JE(){for(let ii of Li("select.netbox-color-select:not([data-ssid])")){for(let ei of ii.options)if(KE(ei)){let ri=`#${ei.value}`,ni=za(ri);ei.style.backgroundColor=ri,ei.style.color=ni}let ti=new Ho({select:ii,allowDeselect:!0,deselectLabel:'<i class="mdi mdi-close-circle" style="color: currentColor;"></i>'});for(let ei of ti.data.data)if("selected"in ei&&ei.selected){XE(ti,ei);break}for(let ei of ii.classList)ti.slim.container.classList.remove(ei);ti.onChange=ei=>XE(ti,ei)}}function QE(){for(let ii of Li(".netbox-static-select:not([data-ssid])"))if(ii!==null){let ti=document.querySelector(`label[for="${ii.id}"]`),ei;ti!==null&&(ei=`Select ${ti.innerText.trim()}`);let ri=new Ho({select:ii,allowDeselect:!0,deselectLabel:'<i class="mdi mdi-close-circle"></i>',placeholder:ei});for(let ni of ii.classList)ri.slim.container.classList.remove(ni)}}function wc(){for(let ii of[YE,JE,QE])ii()}function GN(ii){let ti=ii.getAttribute("data-url"),ei=ii.classList.contains("connected"),ri=ei?"planned":"connected";yr(ti)&&Po(ti,{status:ri}).then(ni=>{var si;if(ns(ni)){Un("danger","Error",ni.error).show();return}else{let oi=(si=ii.parentElement)==null?void 0:si.parentElement,ai=ii.querySelector("i.mdi, span.mdi");ei?(oi.classList.remove("success"),oi.classList.add("info"),ii.classList.remove("connected","btn-warning"),ii.classList.add("btn-info"),ii.title="Mark Installed",ai.classList.remove("mdi-lan-disconnect"),ai.classList.add("mdi-lan-connect")):(oi.classList.remove("info"),oi.classList.add("success"),ii.classList.remove("btn-success"),ii.classList.add("connected","btn-warning"),ii.title="Mark Installed",ai.classList.remove("mdi-lan-connect"),ai.classList.add("mdi-lan-disconnect"))}})}function ZE(){for(let ii of Li("button.cable-toggle"))ii.addEventListener("click",()=>GN(ii))}var e_=class{set(ti,ei,ri){return ti[ei]=ri,!0}get(ti,ei){return ti[ei]}has(ti,ei){return ei in ti}},xc=class{constructor(ti,ei){Yi(this,"handlers");Yi(this,"proxy");Yi(this,"options");Yi(this,"key","");if(this.options=ei,typeof this.options.key=="string"?this.key=this.options.key:this.key=this.generateStateKey(ti),this.options.persist){let ri=this.retrieve();ri!==null&&(ti=Vi(Vi({},ti),ri))}this.handlers=new e_,this.proxy=new Proxy(ti,this.handlers),this.options.persist&&this.save()}generateStateKey(ti){return`netbox-${window.btoa(Object.keys(ti).join("---"))}`}get(ti){return this.handlers.get(this.proxy,ti)}set(ti,ei){this.handlers.set(this.proxy,ti,ei),this.options.persist&&this.save()}all(){return this.proxy}keys(){return Object.keys(this.proxy)}values(){return Object.values(this.proxy)}save(){let ti=JSON.stringify(this.proxy);localStorage.setItem(this.key,ti)}retrieve(){let ti=localStorage.getItem(this.key);return ti!==null?JSON.parse(ti):null}};function qo(ii,ti={}){return new xc(ii,ti)}var jf=qo({hidden:!1},{persist:!0,key:"netbox-object-depth"});var Hf=qo({view:"images-and-labels"},{persist:!0});var t_=qo({element:null},{persist:!1});function i_(ii,ti){ti.setAttribute("data-depth-indicators",ii?"hidden":"shown"),ti.innerText=ii?"Show Depth Indicators":
2022-10-04 15:02:37 +02:00
<span class='flatpickr-weekday'>
`+mi.join("</span><span class='flatpickr-weekday'>")+`
2022-10-04 15:02:37 +02:00
</span>
`}}function $i(){ei.calendarContainer.classList.add("hasWeeks");var pi=Qi("div","flatpickr-weekwrapper");pi.appendChild(Qi("span","flatpickr-weekday",ei.l10n.weekAbbreviation));var mi=Qi("div","flatpickr-weeks");return pi.appendChild(mi),{weekWrapper:pi,weekNumbers:mi}}function ji(pi,mi){mi===void 0&&(mi=!0);var bi=mi?pi:pi-ei.currentMonth;bi<0&&ei._hidePrevMonthArrow===!0||bi>0&&ei._hideNextMonthArrow===!0||(ei.currentMonth+=bi,(ei.currentMonth<0||ei.currentMonth>11)&&(ei.currentYear+=ei.currentMonth>11?1:-1,ei.currentMonth=(ei.currentMonth+12)%12,Tr("onYearChange"),Er()),wr(),Tr("onMonthChange"),il())}function Ii(pi,mi){if(pi===void 0&&(pi=!0),mi===void 0&&(mi=!0),ei.input.value="",ei.altInput!==void 0&&(ei.altInput.value=""),ei.mobileInput!==void 0&&(ei.mobileInput.value=""),ei.selectedDates=[],ei.latestSelectedDateObj=void 0,mi===!0&&(ei.currentYear=ei._initialDate.getFullYear(),ei.currentMonth=ei._initialDate.getMonth()),ei.config.enableTime===!0){var bi=Mc(ei.config),wi=bi.hours,Ci=bi.minutes,Ai=bi.seconds;hi(wi,Ci,Ai)}ei.redraw(),pi&&Tr("onChange")}function zi(){ei.isOpen=!1,ei.isMobile||(ei.calendarContainer!==void 0&&ei.calendarContainer.classList.remove("open"),ei._input!==void 0&&ei._input.classList.remove("active")),Tr("onClose")}function Pi(){ei.config!==void 0&&Tr("onDestroy");for(var pi=ei._handlers.length;pi--;)ei._handlers[pi].remove();if(ei._handlers=[],ei.mobileInput)ei.mobileInput.parentNode&&ei.mobileInput.parentNode.removeChild(ei.mobileInput),ei.mobileInput=void 0;else if(ei.calendarContainer&&ei.calendarContainer.parentNode)if(ei.config.static&&ei.calendarContainer.parentNode){var mi=ei.calendarContainer.parentNode;if(mi.lastChild&&mi.removeChild(mi.lastChild),mi.parentNode){for(;mi.firstChild;)mi.parentNode.insertBefore(mi.firstChild,mi);mi.parentNode.removeChild(mi)}}else ei.calendarContainer.parentNode.removeChild(ei.calendarContainer);ei.altInput&&(ei.input.type="text",ei.altInput.parentNode&&ei.altInput.parentNode.removeChild(ei.altInput),delete ei.altInput),ei.input&&(ei.input.type=ei.input._type,ei.input.classList.remove("flatpickr-input"),ei.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(bi){try{delete ei[bi]}catch(wi){}})}function Bi(pi){return ei.calendarContainer.contains(pi)}function mr(pi){if(ei.isOpen&&!ei.config.inline){var mi=ln(pi),bi=Bi(mi),wi=mi===ei.input||mi===ei.altInput||ei.element.contains(mi)||pi.path&&pi.path.indexOf&&(~pi.path.indexOf(ei.input)||~pi.path.indexOf(ei.altInput)),Ci=!wi&&!bi&&!Bi(pi.relatedTarget),Ai=!ei.config.ignoredFocusElements.some(function(Gi){return Gi.contains(mi)});Ci&&Ai&&(ei.config.allowInput&&ei.setDate(ei._input.value,!1,ei.config.altInput?ei.config.altFormat:ei.config.dateFormat),ei.timeContainer!==void 0&&ei.minuteElement!==void 0&&ei.hourElement!==void 0&&ei.input.value!==""&&ei.input.value!==void 0&&li(),ei.close(),ei.config&&ei.config.mode==="range"&&ei.selectedDates.length===1&&ei.clear(!1))}}function xr(pi){if(!(!pi||ei.config.minDate&&pi<ei.config.minDate.getFullYear()||ei.config.maxDate&&pi>ei.config.maxDate.getFullYear())){var mi=pi,bi=ei.currentYear!==mi;ei.currentYear=mi||ei.currentYear,ei.config.maxDate&&ei.currentYear===ei.config.maxDate.getFullYear()?ei.currentMonth=Math.min(ei.config.maxDate.getMonth(),ei.currentMonth):ei.config.minDate&&ei.currentYear===ei.config.minDate.getFullYear()&&(ei.currentMonth=Math.max(ei.config.minDate.getMonth(),ei.currentMonth)),bi&&(ei.redraw(),Tr("onYearChange"),Er())}}function Sr(pi,mi){var bi;mi===void 0&&(mi=!0);var wi=ei.parseDate(pi,void 0,mi);if(ei.config.minDate&&wi&&cn(wi,ei.config.m
/*!
2021-08-30 11:02:47 -07:00
* Bootstrap v5.0.2 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* GridStack 7.2.3
* https://gridstackjs.com/
*
* Copyright (c) 2021-2022 Alain Dumesny
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
*/
/*!
2022-10-04 15:02:37 +02:00
* clipboard.js v2.0.11
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
*/