PageSourceSearch

https://www.24sata.hr/static/unicorn/js/unicorn.min.js?bust=20240329

js 24sata.hr collected 2026-10-01 10:18:53 UTC 29,031 bytes, 2 lines download raw bytes

1/* Version: 0.61.0 */
2var Unicorn=function(e){"use strict";function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function r(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return o(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function a(e,t,i){var n,r=this;return void 0===i&&(i=!0),function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var l=r,u=function(){n=null,i||e.apply(l,a)},c=i&&!n;clearTimeout(n),n=setTimeout(u,t),c&&e.apply(l,a)}}function s(e){return null==e||0===Object.keys(e).length&&e.constructor===Object||""===e}function l(e){return!s(e)}function u(e){return e&&"function"==typeof e}function c(e,t){return!!e&&e.indexOf(t)>-1}function h(e,t){return void 0===t&&(t=document),t.querySelector(e)}var d={acceptNode:function(e){return NodeFilter.FILTER_ACCEPT}},f={acceptNode:function(e){return e.getAttribute("unicorn:checksum")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}};function m(e,t){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:d,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,i,!1);n.nextNode();)t(n.currentNode)}var p=function(){function e(i){t(this,e),this.attribute=i,this.name=this.attribute.name,this.value=this.attribute.value,this.isUnicorn=!1,this.isModel=!1,this.isPoll=!1,this.isLoading=!1,this.isTarget=!1,this.isPartial=!1,this.isDirty=!1,this.isVisible=!1,this.isKey=!1,this.isError=!1,this.modifiers={},this.eventType=null,this.init()}return n(e,[{key:"init",value:function(){var e=this;if(this.name.startsWith("unicorn:")||this.name.startsWith("u:")){if(this.isUnicorn=!0,c(this.name,":model"))this.isModel=!0;else if(c(this.name,":poll.disable"))this.isPollDisable=!0;else if(c(this.name,":poll"))this.isPoll=!0;else if(c(this.name,":loading"))this.isLoading=!0;else if(c(this.name,":target"))this.isTarget=!0;else if(c(this.name,":partial"))this.isPartial=!0;else if(c(this.name,":dirty"))this.isDirty=!0;else if(c(this.name,":visible"))this.isVisible=!0;else if("unicorn:key"===this.name||"u:key"===this.name)this.isKey=!0;else if(c(this.name,":error:"))this.isError=!0;else{var t=this.name.replace("unicorn:","").replace("u:","");"id"!==t&&"name"!==t&&"checksum"!==t&&(this.eventType=t)}var i=this.name;this.eventType&&(i=this.eventType),i.split(".").slice(1).forEach((function(t){var i=t.split("-");e.modifiers[i[0]]=!(i.length>1)||i[1],e.eventType&&(e.eventType=e.eventType.replace(".".concat(t),""))}))}}}]),e}(),v=function(){function e(i){t(this,e),this.el=i,this.init()}return n(e,[{key:"init",value:function(){var t=this;if(this.id=this.el.id,this.isUnicorn=!1,this.attributes=[],this.value=this.getValue(),this.parent=null,this.el.parentElement&&(this.parent=new e(this.el.parentElement)),this.model={},this.poll={},this.loading={},this.dirty={},this.actions=[],this.partials=[],this.target=null,this.visibility={},this.key=null,this.events=[],this.errors=[],this.el.attributes)for(var i=function(e){var i=new p(t.el.attributes[e]);if(t.attributes.push(i),i.isUnicorn&&(t.isUnicorn=!0),i.isModel){var n="model";t[n].name=i.value,t[n].eventType=i.modifiers.lazy?"blur":"input",t[n].isLazy=!!i.modifiers.lazy,t[n].isDefer=!!i.modifiers.defer,t[n].debounceTime=i.modifiers.debounce&&parseInt(i.modifiers.debounce,10)||-1}else if(i.isPoll){t.poll.method=i.value?i.value:"refresh",t.poll.timing=2e3,t.poll.disable=!1;var r=i.name.split("-").slice(1);r.length>0&&(t.poll.timing=parseInt(r[0],10)||2e3)}else if(i.isPollDisable)t.poll.disableData=i.value;else if(i.isLoading||i.isDirty){var o="dirty";i.isLoading&&(o="loading"),i.modifiers.attr?t[o].attr=i.value:i.modifiers.class&&i.modifiers.remove?t[o].removeClasses=i.value.split(" "):i.modifiers.class?t[o].classes=i.value.split(" "):i.isLoading&&i.modifiers.remove?t.loading.hide=!0:i.isLoading&&(t.loading.show=!0)}else if(i.isTarget)t.target=i.value;else if(i.isPartial)i.modifiers.id?t.partials.push({id:i.value}):i.modifiers.key?t.partials.push({key:i.value}):t.partials.push({target:i.value});else if(i.isVisible){var a=i.modifiers.threshold||0;a>1&&(a/=100),t.visibility.method=i.value,t.visibility.threshold=a,t.visibility.debounceTime=i.modifiers.debounce&&parseInt(i.modifiers.debounce,10)||0}else if(i.eventType){var s={};s.name=i.value,s.eventType=i.eventType,s.isPrevent=!1,s.isStop=!1,s.isDiscard=!1,s.debounceTime=0,i.modifiers&&Object.keys(i.modifiers).forEac
2h((function(e){"prevent"===e?s.isPrevent=!0:"stop"===e?s.isStop=!0:"discard"===e?s.isDiscard=!0:"debounce"===e?s.debounceTime=i.modifiers.debounce&&parseInt(i.modifiers.debounce,10)||0:s.key=e})),t.actions.push(s)}if(i.isKey&&(t.key=i.value),i.isError){var l=i.name.replace("unicorn:error:","");t.errors.push({code:l,message:i.value})}},n=0;n<this.el.attributes.length;n++)i(n)}},{key:"focus",value:function(){this.el.focus()}},{key:"hide",value:function(){this.el.hidden="hidden"}},{key:"show",value:function(){this.el.hidden=null}},{key:"getUnicornParent",value:function(){for(var e=this.parent;e&&!e.isUnicorn;){if(e.isRoot())return null;e=e.parent}return e}},{key:"handleLoading",value:function(e){this.handleInterfacer("loading",e)}},{key:"handleDirty",value:function(e){this.handleInterfacer("dirty",e)}},{key:"handleInterfacer",value:function(e,t){if(t=t||!1,l(this[e])){var i,n,o,a;if(this[e].attr&&(t?this.el.removeAttribute(this[e].attr):this.el.setAttribute(this[e].attr,this[e].attr)),this[e].classes)if(t)(i=this.el.classList).remove.apply(i,r(this[e].classes)),0===this.el.classList.length&&this.el.removeAttribute("class");else(n=this.el.classList).add.apply(n,r(this[e].classes));if(this[e].removeClasses)if(t)(o=this.el.classList).add.apply(o,r(this[e].removeClasses));else(a=this.el.classList).remove.apply(a,r(this[e].removeClasses))}}},{key:"isSame",value:function(e){return this.isSameEl(e.el)}},{key:"isSameEl",value:function(e){return this.el.isSameNode(e)}},{key:"isSameId",value:function(e){return this.key&&e.key&&this.key===e.key||this.id&&e.id&&this.id===e.id}},{key:"getValue",value:function(){var e=this.el.value;if(this.el.type)if("checkbox"===this.el.type.toLowerCase())e=this.el.checked;else if("select-multiple"===this.el.type.toLowerCase()){e=[];for(var t=0;t<this.el.selectedOptions.length;t++)e.push(this.el.selectedOptions[t].value)}return e}},{key:"setValue",value:function(e){s(this.el.type)||("radio"===this.el.type.toLowerCase()?this.el.value===e&&(this.el.checked=!0):"checkbox"===this.el.type.toLowerCase()?this.el.checked=e:"select-one"===this.el.type.toLowerCase()&&null==e||(this.el.value=e))}},{key:"addError",value:function(e){this.errors.push(e),this.el.setAttribute("unicorn:error:".concat(e.code),e.message)}},{key:"removeErrors",value:function(){var e=this;this.errors.forEach((function(t){e.el.removeAttribute("unicorn:error:".concat(t.code))})),this.errors=[]}},{key:"isRoot",value:function(){return l(this.el.getAttribute("unicorn:checksum"))}}]),e}();function y(e,t){t.handleLoading(),e.loadingEls.forEach((function(i){if(i.target)if(i.target.includes("*")){var n=(s=i.target,l=s.split("*"),u="",l.forEach((function(e,t){0===t&&""===e?u=u.concat("[a-zA-Z0-9_:.\\-]*"):t===l.length-1?""!==e&&(u=u.concat("(".concat(e,")"))):u=u.concat("(".concat(e,")"),"[a-zA-Z0-9_:.\\-]*")})),new RegExp(u)),o=[];r(e.root.getElementsByTagName("*")).forEach((function(e){r(e.attributes).forEach((function(t){["id","unicorn:key","u:key"].includes(t.name)&&t.value.match(n)&&o.push(e)}))})),o.forEach((function(e){t.el.isSameNode(e)&&(i.handleLoading(),i.loading.hide?i.hide():i.loading.show&&i.show())}))}else{var a=h("#".concat(i.target),e.root);a||e.keyEls.forEach((function(e){a||e.key!==i.target||(a=e.el)})),a&&t.el.isSameNode(a)&&(i.handleLoading(),i.loading.hide?i.hide():i.loading.show&&i.show())}else i.handleLoading(),i.loading.hide?i.hide():i.loading.show&&i.show();var s,l,u}))}function g(e,t,i){return(t=t.trim().slice(t.indexOf(i)+i.length).trim()).split(".").forEach((function(t){if(t=t.trim())if(t.endsWith("()")){var i=t.slice(0,t.length-2);e=e[i]()}else{if(!l(e[t]))throw Error("'".concat(t,"' could not be retrieved"));e=e[t]}})),"string"==typeof e&&(e='"'.concat(e,'"')),e}function b(e,t){e.document.addEventListener(t,(function(i){var n=new v(i.target);n&&!n.isUnicorn&&(n=n.getUnicornParent()),n&&n.isUnicorn&&n.actions.length>0&&t in e.actionEvents&&e.actionEvents[t].forEach((function(t){var r=t.action,o=t.element;if(n.isSame(o)){e.walker(o.el,(function(t){e.modelEls.filter((function(e){return e.isSameEl(t)})).forEach((function(t){if(l(t.model)&&t.model.isLazy){var i={type:"syncInput",payload:{name:t.model.name,value:t.getValue()}};e.actionQueue.push(i)}}))})),r.isPrevent&&i.preventDefault(),r.isStop&&i.stopPropagation(),r.isDiscard&&(e.actionQueue=[]);
2var a=r.name;(function(e){if(!c(e=e.trim(),"(")||!e.endsWith(")"))return[];e=e.slice(e.indexOf("(")+1,e.length-1);for(var t=[],i="",n=!1,r=!1,o=0,a=0,s=0;s<e.length;s++){var l=e.charAt(s);i+=l,"["===l?a++:"]"===l?a--:"("===l?o++:")"===l?o--:"{"===l||"}"===l||("'"===l?n=!n:'"'===l?r=!r:","===l&&(n||r||0!==a||0!==o||(i=i.slice(0,i.length-1),t.push(i),i=""))),s===e.length-1&&(n||r||0!==a||0!==o||(t.push(i.trim()),i=""))}return t})(a).forEach((function(t){if(t.startsWith("$event"))try{var n=g(i,t,"$event");a=a.replace(t,n)}catch(e){a=a.replace(t,"")}else if(t.startsWith("$returnValue"))if(l(e.return)&&l(e.return.value))try{var r=g(e.return.value,t,"$returnValue");a=a.replace(t,r)}catch(e){a=a.replace(t,"")}else a=a.replace(t,"")})),r.key&&r.key!==function(e){if(!e)return"";var t=e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g);return t?t.map((function(e){return e.toLowerCase()})).join("-"):e}(i.key)||(y(e,n),e.callMethod(a,r.debounceTime,n.partials))}}))}))}function E(e,t,i){i=i||t.model.eventType,t.events.push(i),t.el.addEventListener(i,(function(n){var r=!1;if(e.data[t.model.name]!==t.getValue()?(r=!0,t.handleDirty()):t.handleDirty(!0),t.model.isLazy){if("input"===i)return;if(!r)return}var o={type:"syncInput",payload:{name:t.model.name,value:t.getValue()},partials:t.partials};if(e.lastTriggeringElements.some((function(e){return e.isSame(t)}))||e.lastTriggeringElements.push(t),t.model.isDefer){var a=-1;return e.actionQueue.forEach((function(e,i){e.payload.name===t.model.name&&(e.payload.value=t.getValue(),a=i)})),r&&-1===a&&e.actionQueue.push(o),void(!r&&a>-1&&e.actionQueue.splice(a))}e.actionQueue.push(o),e.queueMessage(t.model.debounceTime,(function(i,n,r){r?console.error(r):((i=i||[]).some((function(e){return e.isSame(t)}))||i.push(t),e.setModelValues(i,n,!0))}))}))}var k={},T={};function w(e,t){if(0!==e.actionQueue.length&&e.currentActionQueue!==e.actionQueue){var i=e.actionQueue.some((function(e){return"callMethod"===e.type}));e.currentActionQueue=e.actionQueue,e.actionQueue=[];var n={id:e.id,data:e.data,checksum:e.checksum,actionQueue:e.currentActionQueue,epoch:Date.now(),hash:e.hash},r={Accept:"application/json","X-Requested-With":"XMLHttpRequest"};if(e.useCsrfToken)try{r[e.csrfTokenHeaderName]=function(e){var t=e.csrfTokenCookieName+"=",i=e.document.cookie.split(";").filter((function(e){return e.trim().startsWith(t)}));if(i.length>0)return i[0].replace(t,"");var n=e.document.getElementsByName("csrfmiddlewaretoken");if(n&&n.length>0)return n[0].getAttribute("value");throw Error("CSRF token is missing. Do you need to add {% csrf_token %}?")}(e)}catch(e){console.error(e)}fetch(e.syncUrl,{method:"POST",headers:r,body:JSON.stringify(n)}).then((function(t){if(t.ok)return t.json();if(e.loadingEls.forEach((function(e){e.loading.hide?e.show():e.loading.show&&e.hide(),e.handleLoading(!0),e.handleDirty(!0)})),304===t.status)return null;throw Error("Error when getting response: ".concat(t.statusText," (").concat(t.status,")"))})).then((function(n){if(n&&(!n.queued||!0!==n.queued)){if(n.error)throw"Checksum does not match"===n.error&&u(t)&&t([],!0,null),Error(n.error);if(n.redirect)if(n.redirect.url){if(!n.redirect.refresh)return void(e.window.location.href=n.redirect.url);n.redirect.title&&(e.window.document.title=n.redirect.title),e.window.history.pushState({},"",n.redirect.url)}else n.redirect.hash&&(e.window.location.hash=n.redirect.hash);e.modelEls.forEach((function(e){e.init(),e.removeErrors(),e.handleDirty(!0)})),Object.keys(n.data||{}).forEach((function(t){e.data[t]=n.data[t]})),e.errors=n.errors||{},e.return=n.return||{},e.hash=n.hash;var r=n.parent||{},o=n.dom||"",a=n.partials||[],s=n.checksum,c=n.poll||{};for(l(c)&&(e.poll.timer&&clearInterval(e.poll.timer),c.timing&&(e.poll.timing=c.timing),c.method&&(e.poll.method=c.method),e.poll.disable=c.disable||!1,e.startPolling());l(r)&&l(r.id);){var d=e.getParentComponent(r.id);d&&d.id===r.id&&(l(r.data)&&(d.data=r.data),r.dom&&(d.morphRoot(r.dom),d.loadingEls.forEach((function(e){e.loading.hide?e.show():e.loading.show&&e.hide(),e.handleLoading(!0),e.handleDirty(!0)}))),r.checksum&&(d.root.setAttribute("unicorn:checksum",r.checksum),d.refreshChecksum()),d.hash=r.hash,d.refreshEventListeners()),r=r.parent||{}}if(a.length>0){for(var f=0;f<a.length;f++){var m=a[f],p=null;
2m.key?p=h('[unicorn\\:key="'.concat(m.key,'"]'),e.root):m.id&&(p=h("#".concat(m.id),e.root)),!p&&e.root.parentElement&&(p=h('[unicorn\\:key="'.concat(m.key,'"]'),e.root.parentElement)),p&&e.morph(p,m.dom)}s&&(e.root.setAttribute("unicorn:checksum",s),e.refreshChecksum())}else o&&e.morphRoot(o);e.triggerLifecycleEvent("updated");try{e.init()}catch(e){return}e.refreshEventListeners();var v=!0;e.visibilityEls.forEach((function(t){t.visibility.method===e.return.method&&!1===e.return.value&&(v=!1)})),v&&e.initVisibility(),e.modelEls.forEach((function(t){Object.keys(e.errors).forEach((function(i){if(t.model.name===i){var n=e.errors[i][0];t.addError(n)}}))})),e.callCalls(n.calls);var y=e.lastTriggeringElements;e.lastTriggeringElements=[],e.currentActionQueue=null,u(t)&&t(y,i,null)}})).catch((function(i){e.actionQueue=[],e.currentActionQueue=null,e.lastTriggeringElements=[],u(t)&&t(null,null,i)}))}}var A,N=function(){function e(i){t(this,e),this.id=i.id,this.name=i.name,this.key=i.key,this.messageUrl=i.messageUrl,this.csrfTokenHeaderName=i.csrfTokenHeaderName,this.useCsrfToken=i.useCsrfToken,this.csrfTokenCookieName=i.csrfTokenCookieName,this.hash=i.hash,this.data=i.data||{},this.syncUrl="".concat(this.messageUrl,"/").concat(this.name),this.document=i.document||document,this.walker=i.walker||m,this.window=i.window||window,this.morpher=i.morpher,this.root=void 0,this.modelEls=[],this.loadingEls=[],this.keyEls=[],this.visibilityEls=[],this.errors={},this.return={},this.poll={},this.actionQueue=[],this.currentActionQueue=null,this.lastTriggeringElements=[],this.actionEvents={},this.attachedEventTypes=[],this.attachedModelEvents=[],this.init(),this.refreshEventListeners(),this.initVisibility(),this.initPolling(),this.callCalls(i.calls)}return n(e,[{key:"init",value:function(){if(this.root=h('[unicorn\\:id="'.concat(this.id,'"]'),this.document),!this.root)throw Error("No id found");this.refreshChecksum()}},{key:"getChildrenComponents",value:function(){var e=this,t=[];return this.walker(this.root,(function(i){if(!i.isSameNode(e.root)){var n=i.getAttribute("unicorn:id");if(n){var r=k[n]||null;r&&t.push(r)}}})),t}},{key:"getParentComponent",value:function(e){if(void 0!==e)return k[e]||null;for(var t=this.root,i=null;!i&&null!==t.parentElement;){var n=(t=t.parentElement).getAttribute("unicorn:id");n&&(i=k[n]||null)}return i}},{key:"callCalls",value:function(e){var t=this,i=[];return(e=e||[]).forEach((function(e){var n,o=e.fn,a=t.window;(e.fn.split(".").forEach((function(t,i){i<e.fn.split(".").length-1&&(a=a[t],o=o.slice(t.length+1))})),e.args)?i.push((n=a)[o].apply(n,r(e.args))):i.push(a[o]())})),i}},{key:"refreshEventListeners",value:function(){var e=this;this.actionEvents={},this.modelEls=[],this.loadingEls=[],this.visibilityEls=[];try{this.walker(this.root,(function(t){if(!t.isSameNode(e.root)){var i=new v(t);i.isUnicorn&&(l(i.model)?(e.attachedModelEvents.some((function(e){return e.isSame(i)}))||(e.attachedModelEvents.push(i),E(e,i),i.model.isLazy&&E(e,i,"input")),e.modelEls.some((function(e){return e.isSame(i)}))||e.modelEls.push(i)):l(i.loading)&&(e.loadingEls.push(i),i.loading.show&&i.hide()),l(i.key)&&e.keyEls.push(i),l(i.visibility)&&e.visibilityEls.push(i),i.actions.forEach((function(t){e.actionEvents[t.eventType]?e.actionEvents[t.eventType].push({action:t,element:i}):(e.actionEvents[t.eventType]=[{action:t,element:i}],e.attachedEventTypes.some((function(e){return e===t.eventType}))||(e.attachedEventTypes.push(t.eventType),b(e,t.eventType),i.events.push(t.eventType)))})))}}),f)}catch(e){}}},{key:"callMethod",value:function(e,t,i,n){var r=this,o={type:"callMethod",payload:{name:e},partials:i};this.actionQueue.push(o),this.queueMessage(t,(function(e,t,i){i&&u(n)?n(i):i?console.error(i):r.setModelValues(e,!0,!0)}))}},{key:"initVisibility",value:function(){var e=this;"undefined"!=typeof window&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype&&this.visibilityEls.forEach((function(t){new IntersectionObserver((function(i){i[0].isIntersecting&&e.callMethod(t.visibility.method,t.visibility.debounceTime,t.partials,(function(e){e&&console.error(e)}))}),{threshold:[t.visibility.threshold]}).observe(t.el)}))}},{key:"handlePollError",value:function(e){e?console.error(e):this.poll.timer&&clearInterval(this.poll.timer)}},{key:"isPollEnabled",value:function(){if(!this.poll.disable){if(!l(this.poll.disableData))return!0;
2if(this.poll.disableData.startsWith("!")){if(this.poll.disableData=this.poll.disableData.slice(1),this.data[this.poll.disableData])return this.poll.disableData="!".concat(this.poll.disableData),!0;this.poll.disableData="!".concat(this.poll.disableData)}else if(!this.data[this.poll.disableData])return!0}return!1}},{key:"initPolling",value:function(){var e=this,t=new v(this.root);t.isUnicorn&&l(t.poll)&&(this.poll=t.poll,this.poll.timer=null,this.document.addEventListener("visibilitychange",(function(){e.document.hidden?e.poll.timer&&clearInterval(e.poll.timer):e.startPolling(!0)}),!1),this.poll.partials=t.partials,this.startPolling(!0))}},{key:"startPolling",value:function(e){var t=this;e&&this.isPollEnabled()&&this.callMethod(this.poll.method,0,this.poll.partials,this.handlePollError),this.poll.timer=setInterval((function(){t.isPollEnabled()&&t.callMethod(t.poll.method,0,t.poll.partials,t.handlePollError)}),this.poll.timing)}},{key:"refreshChecksum",value:function(){this.checksum=this.root.getAttribute("unicorn:checksum")}},{key:"setValue",value:function(e){s(e.model)||this.setNestedValue(e,e.model.name,this.data)}},{key:"setNestedValue",value:function(e,t,i){for(var n=t.split("."),r=i,o=0;o<n.length;o++){var a=n[o];if(null==r)return;Object.prototype.hasOwnProperty.call(r,a)&&(o===n.length-1?e.setValue(r[a]):r=r[a])}}},{key:"setModelValues",value:function(e,t,i){var n=this;t=t||!1,i=i||!1;var r=null;if((e=e||[]).length>0){var o=!1;l(r=e.slice(-1)[0])&&l(r.model)&&!r.model.isLazy&&["id","key"].forEach((function(e){n.modelEls.forEach((function(t){o||r[e]&&r[e]===t[e]&&(t.focus(),o=!0)}))}))}if(this.modelEls.forEach((function(e){!t&&r&&r.isSame(e)||n.setValue(e)})),this.getChildrenComponents().forEach((function(i){i.setModelValues(e,t,!1)})),i){var a=this.getParentComponent();a&&a.setModelValues(e,t,i)}}},{key:"queueMessage",value:function(e,t){-1===e?a(w,250,!1)(this,t):a(w,e,!1)(this,t)}},{key:"triggerLifecycleEvent",value:function(e){var t=this;e in T&&T[e].forEach((function(e){return e(t)}))}},{key:"trigger",value:function(e){this.modelEls.forEach((function(t){if(t.key===e){var i=t.model.isLazy?"blur":"input";t.el.dispatchEvent(new Event(i))}}))}},{key:"morph",value:function(e,t){if(t){var i=function(){return r(e.querySelectorAll("[unicorn\\:id]"))},n=new Set(i().map((function(e){return e.getAttribute("unicorn:id")})));this.morpher.morph(e,t);var o=new Set(i().map((function(e){return e.getAttribute("unicorn:id")})));r(n).filter((function(e){return!o.has(e)})).forEach((function(e){Unicorn.deleteComponent(e)}
2)),i().forEach((function(e){Unicorn.insertComponentFromDom(e)}))}}},{key:"morphRoot",value:function(e){this.morph(this.root,e)}}]),e}();var C="undefined"==typeof document?void 0:document,S=!!C&&"content"in C.createElement("template"),L=!!C&&C.createRange&&"createContextualFragment"in C.createRange();function P(e){return e=e.trim(),S?function(e){var t=C.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}(e):L?function(e){return A||(A=C.createRange()).selectNode(C.body),A.createContextualFragment(e).childNodes[0]}(e):function(e){var t=C.createElement("body");return t.innerHTML=e,t.childNodes[0]}(e)}function O(e,t){var i,n,r=e.nodeName,o=t.nodeName;return r===o||(i=r.charCodeAt(0),n=o.charCodeAt(0),i<=90&&n>=97?r===o.toUpperCase():n<=90&&i>=97&&o===r.toUpperCase())}function M(e,t,i){e[i]!==t[i]&&(e[i]=t[i],e[i]?e.setAttribute(i,""):e.removeAttribute(i))}var U={OPTION:function(e,t){var i=e.parentNode;if(i){var n=i.nodeName.toUpperCase();"OPTGROUP"===n&&(n=(i=i.parentNode)&&i.nodeName.toUpperCase()),"SELECT"!==n||i.hasAttribute("multiple")||(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),i.selectedIndex=-1)}M(e,t,"selected")},INPUT:function(e,t){M(e,t,"checked"),M(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var i=t.value;e.value!==i&&(e.value=i);var n=e.firstChild;if(n){var r=n.nodeValue;if(r==i||!i&&r==e.placeholder)return;n.nodeValue=i}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var i,n,r=-1,o=0,a=e.firstChild;a;)if("OPTGROUP"===(n=a.nodeName&&a.nodeName.toUpperCase()))a=(i=a).firstChild;else{if("OPTION"===n){if(a.hasAttribute("selected")){r=o;break}o++}!(a=a.nextSibling)&&i&&(a=i.nextSibling,i=null)}e.selectedIndex=r}}};function V(){}function D(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}var I=function(e){return function(t,i,n){if(n||(n={}),"string"==typeof i)if("#document"===t.nodeName||"HTML"===t.nodeName||"BODY"===t.nodeName){var r=i;(i=C.createElement("html")).innerHTML=r}else i=P(i);var o=n.getNodeKey||D,a=n.onBeforeNodeAdded||V,s=n.onNodeAdded||V,l=n.onBeforeElUpdated||V,u=n.onElUpdated||V,c=n.onBeforeNodeDiscarded||V,h=n.onNodeDiscarded||V,d=n.onBeforeElChildrenUpdated||V,f=!0===n.childrenOnly,m=Object.create(null),p=[];function v(e){p.push(e)}function y(e,t){if(1===e.nodeType)for(var i=e.firstChild;i;){var n=void 0;t&&(n=o(i))?v(n):(h(i),i.firstChild&&y(i,t)),i=i.nextSibling}}function g(e,t,i){!1!==c(e)&&(t&&t.removeChild(e),h(e),y(e,i))}function b(e){s(e);for(var t=e.firstChild;t;){var i=t.nextSibling,n=o(t);if(n){var r=m[n];r&&O(t,r)?(t.parentNode.replaceChild(r,t),E(r,t)):b(t)}else b(t);t=i}}function E(t,i,n){var r=o(i);if(r&&delete m[r],!n){if(!1===l(t,i))return;if(t.hasAttribute("u:ignore")||t.hasAttribute("unicorn:ignore"))return;if(e(t,i),u(t),!1===d(t,i))return}"TEXTAREA"!==t.nodeName?function(e,t){var i,n,r,s,l,u=t.firstChild,c=e.firstChild;e:for(;u;){for(s=u.nextSibling,i=o(u);c;){if(r=c.nextSibling,u.isSameNode&&u.isSameNode(c)){u=s,c=r;continue e}n=o(c);var h=c.nodeType,d=void 0;if(h===u.nodeType&&(1===h?(i?i!==n&&((l=m[i])?r===l?d=!1:(e.insertBefore(l,c),n?v(n):g(c,e,!0),c=l):d=!1):n&&(d=!1),(d=!1!==d&&O(c,u))&&E(c,u)):3!==h&&8!=h||(d=!0,c.nodeValue!==u.nodeValue&&(c.nodeValue=u.nodeValue))),d){u=s,c=r;continue e}n?v(n):g(c,e,!0),c=r}if(i&&(l=m[i])&&O(l,u))e.appendChild(l),E(l,u);else{var f=a(u);!1!==f&&(f&&(u=f),u.actualize&&(u=u.actualize(e.ownerDocument||C)),e.appendChild(u),b(u))}u=s,c=r}!function(e,t,i){for(;t;){var n=t.nextSibling;(i=o(t))?v(i):g(t,e,!0),t=n}}(e,c,n);var p=U[e.nodeName];p&&p(e,t)}(t,i):t.innerHTML!=i.innerHTML&&U.TEXTAREA(t,i)}!function e(t){if(1===t.nodeType||11===t.nodeType)for(var i=t.firstChild;i;){var n=o(i);n&&(m[n]=i),e(i),i=i.nextSibling}}(t);var k,T,w=t,A=w.nodeType,N=i.nodeType;if(!f)if(1===A)1===N?O(t,i)||(h(t),w=function(e,t){for(var i=e.firstChild;i;){var n=i.nextSibling;t.appendChild(i),i=n}return t}(t,(k=i.nodeName,(T=i.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==T?C.createElementNS(T,k):C.createElement(k)))):w=i;else if(3===A||8===A){if(N===A)return w.nodeValue!==i.nodeValue&&(w.nodeValue=i.nodeValue),w;w=i}if(w===i)h(t);else{if(i.isSameNode&&i.isSameNode(w))return;if(E(w,i,f),p)for(var S=0,L=p.length;S<L;S++){var M=m[p[S]];M&&g(M,M.parentNode,!1)}}return!f&&w!==t&&t.parentNode&&(w.actualize&&(w=w.actualize(t.ownerDocument||C)),t.parentNode.replaceChild(w,t)),w}}((function(e,t){var i,n,r,o,a=t.attributes;if(11!==t.nodeType&&11!==e.nodeType){for(var s=a.length-1;s>=0;s--)n=(i=a[s]).name,r=i.namespaceURI,o=i.value,r?(n=i.localName||n,e.getAttributeNS(r,n)!==o&&("xmlns"===i.prefix&&(n=i.name),e.setAttributeNS(r,n,o))):e.getAttribute(n)!==o&&e.setAttribute(n,o);for(var l=e.attributes,u=l.length-1;u>=0;u--)n=(i=l[u]).name,(r=i.namespaceURI)?(n=i.localName||n,t.hasAttributeNS(r,n)||e.removeAttributeNS(r,n)):t.hasAttribute(n)||e.removeAttribute(n)}})),R={morphdom:function(){function e(i){t(this,e),this.options=i}return n(e,[{key:"morph",value:function(e,t){return I(e,t,this.getOptions())}},{key:"getOptions",value:function(){var e=this.options.RELOAD_SCRIPT_ELEMENTS||!1;return{childrenOnly:!1,getNodeKey:function(e){if(e.attributes){var t=e.getAttribute("unicorn:id")||e.getAttribute("unicorn:key")||e.id;if(t)return t}},onBeforeElUpdated:function(t,i){if(t.isEqualNode(i))return!1;if(e&&"SCRIPT"===t.nodeName&&"SCRIPT"===i.nodeName){var n=document.createElement("script");
2return r(i.attributes).forEach((function(e){n.setAttribute(e.nodeName,e.nodeValue)})),n.innerHTML=i.innerHTML,t.replaceWith(n),!1}return!0},onNodeAdded:function(t){if(e&&"SCRIPT"===t.nodeName){var i=document.createElement("script");r(t.attributes).forEach((function(e){i.setAttribute(e.nodeName,e.nodeValue)})),i.innerHTML=t.innerHTML,t.replaceWith(i)}}}}}]),e}(),alpine:function(){function e(i){t(this,e),this.options=i}return n(e,[{key:"morph",value:function(e,t){if(t){if(!window.Alpine||!window.Alpine.morph)throw Error("\n  Alpine.js and the Alpine morph plugin can not be found.\n  See https://www.django-unicorn.com/docs/custom-morphers/#alpine for more information.\n  ");return window.Alpine.morph(e,t,this.getOptions())}}},{key:"getOptions",value:function(){return{key:function(e){if(e.attributes){var t=e.getAttribute("unicorn:key")||e.getAttribute("u:key")||e.id;if(t)return t}return e.id}}}}]),e}()};var x,Q="",j="X-CSRFToken",H=!0,z="csrftoken";function F(e){e.messageUrl=Q,e.csrfTokenHeaderName=j,e.csrfTokenCookieName=z,e.morpher=x,e.useCsrfToken=H;var t=new N(e);k[t.id]=t,t.setModelValues()}function W(e){var t;if(Object.keys(k).forEach((function(i){if(s(t)){var n=k[i];n.key===e&&(t=n)}})),s(t)&&Object.keys(k).forEach((function(i){if(s(t)){var n=k[i];n.name===e&&(t=n)}})),!t)throw Error("No component found for: ".concat(e));return t}return e.addEventListener=function(e,t){e in T||(T[e]=[]),T[e].push(t)},e.call=function(e,t){for(var i=W(e),n="",r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];o.forEach((function(e){void 0!==e&&(n="string"==typeof e?"".concat(n,"'").concat(e,"', "):"".concat(n).concat(e,", "))})),n&&(n=n.slice(0,-2),t="".concat(t,"(").concat(n,")")),i.callMethod(t,0,null,(function(e){console.error(e)}))},e.componentInit=F,e.deleteComponent=function(e){delete k[e]},e.getComponent=W,e.getReturnValue=function(e){return W(e).return.value},e.init=function(e,t,i,n,r){return Q=e,x=function(e){var t=e.NAME;if(s(t))throw Error(" Missing morpher name");var i=R[t];if(i)return new i(e);throw Error("Unknown morpher: ".concat(t))}(n),l(t)&&(j=t),void 0!==r&&(H=r),l(i)&&(z=i),{messageUrl:Q,csrfTokenHeaderName:j,csrfTokenCookieName:z,morpher:x,useCsrfToken:H}},e.insertComponentFromDom=function(e){var t=e.getAttribute("unicorn:id");k[t]||F({id:t,name:e.getAttribute("unicorn:name"),key:e.getAttribute("unicorn:key"),checksum:e.getAttribute("unicorn:checksum"),data:JSON.parse(e.getAttribute("unicorn:data")),calls:JSON.parse(e.getAttribute("unicorn:calls"))})},e.trigger=function(e,t){W(e).trigger(t)},Object.defineProperty(e,"__esModule",{value:!0}),e}({});

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.