KeymailSpecials2/wwwroot/js/components/bs-select.js

9 lines
56 KiB
JavaScript
Raw Normal View History

2024-02-19 12:54:56 +00:00
/*!
* Bootstrap-select v1.14.0-beta2 (https://developer.snapappointments.com/bootstrap-select)
*
* Copyright 2012-2021 SnapAppointments, LLC
* Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
*/
!function(e,t){void 0===e&&void 0!==window&&(e=window),"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,function(e){!function(e){"use strict";var t=["sanitize","whiteList","sanitizeFn"],i=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],s={"*":["class","dir","id","lang","role","tabindex","style",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},n=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:\/?#]*(?:[\/?#]|$))/gi,o=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i,l=["title","placeholder"];function r(t,s){var l=t.nodeName.toLowerCase();if(-1!==e.inArray(l,s))return-1===e.inArray(l,i)||Boolean(t.nodeValue.match(n)||t.nodeValue.match(o));for(var r=e(s).filter(function(e,t){return t instanceof RegExp}),a=0,c=r.length;a<c;a++)if(l.match(r[a]))return!0;return!1}function a(e,t,i){if(i&&"function"==typeof i)return i(e);for(var s=Object.keys(t),n=0,o=e.length;n<o;n++)for(var l=e[n].querySelectorAll("*"),a=0,c=l.length;a<c;a++){var d=l[a],h=d.nodeName.toLowerCase();if(-1!==s.indexOf(h))for(var p=[].slice.call(d.attributes),u=[].concat(t["*"]||[],t[h]||[]),f=0,m=p.length;f<m;f++){var v=p[f];r(v,u)||d.removeAttribute(v.nodeName)}else d.parentNode.removeChild(d)}}function c(e){var t,i={};return l.forEach(function(s){(t=e.attr(s))&&(i[s]=t)}),!i.placeholder&&i.title&&(i.placeholder=i.title),i}"classList"in document.createElement("_")||function(t){if("Element"in t){var i=t.Element.prototype,s=Object,n=function(){var t=e(this);return{add:function(e){return e=Array.prototype.slice.call(arguments).join(" "),t.addClass(e)},remove:function(e){return e=Array.prototype.slice.call(arguments).join(" "),t.removeClass(e)},toggle:function(e,i){return t.toggleClass(e,i)},contains:function(e){return t.hasClass(e)}}};if(s.defineProperty){var o={get:n,enumerable:!0,configurable:!0};try{s.defineProperty(i,"classList",o)}catch(e){void 0!==e.number&&-2146823252!==e.number||(o.enumerable=!1,s.defineProperty(i,"classList",o))}}else s.prototype.__defineGetter__&&i.__defineGetter__("classList",n)}}(window);var d,h,p=document.createElement("_");if(p.classList.add("c1","c2"),!p.classList.contains("c2")){var u=DOMTokenList.prototype.add,f=DOMTokenList.prototype.remove;DOMTokenList.prototype.add=function(){Array.prototype.forEach.call(arguments,u.bind(this))},DOMTokenList.prototype.remove=function(){Array.prototype.forEach.call(arguments,f.bind(this))}}if(p.classList.toggle("c3",!1),p.classList.contains("c3")){var m=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:m.call(this,e)}}function v(){var e=this.selectpicker.main.data.filter(function(e){return!!e.selected&&(!this.options.hideDisabled||!e.disabled)},this);if(this.options.source.data&&!this.multiple&&e.length>1){for(var t=0;t<e.length-1;t++)e[t].selected=!1;e=[e[e.length-1]]}return e}function g(e){for(var t,i=[],s=e||v.call(this),n=0,o=s.length;n<o;n++)(t=s[n]).disabled||i.push(void 0===t.value?t.text:t.value);return this.multiple?i:i.length?i[0]:null}p=null,String.prototype.startsWith||(d={}.toString,h=function(e){if(null==this)throw new TypeError;var t=String(this);if(e&&"[object RegExp]"==d.call(e))throw new TypeError;var i=t.length,s=String(e),n=s.length,o=arguments.length>1?arguments[1]:void 0,l=o?Number(o):0;l!=l&&(l=0);var r=Math.min(Math.max(l,0),i);if(n+r>i)return!1;for(var a=-1;++a<n;)if(t.charCodeAt(r+a)!=s.charCodeAt(a))return!1;return!0},Object.defineProperty?Object.defineProperty(String.prototype,"startsWith",{value:h,configurable:!0,writable:!0}):String.prototype.startsWith=h);var b={useDefault:!1,_set:e.valHooks.select.set};e.valHooks.select.set=function(t,i){return i