PageSourceSearch

https://www.siniat.pl/etex/js/assets/js/551.8859b26b8f55bd864cf9.mjs

js siniat.pl collected 2026-10-07 23:23:06 UTC 7,910 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwebpack=self.webpackChunkwebpack||[]).push([[551],{551:function(e,t,n){n.r(t),n.d(t,{default:function(){return w}});var i=n(70392),r=n.n(i),s=n(66497),o=n(21887),l=n(86900),a=n(9866),d=n(25967),c="[data-js='confirm-add-external-product']",u="[data-js='add-to-favorites']",h="[data-js='bookmarked-icon']",f="[data-js='unbookmarked-icon']",p="[data-js='add-to-favorites-form-input']",m="[data-js='upload-attachments']",y="[data-js='actual-upload-attachments']",v=".js-selected-files",g=".js-selected-files-container",b=".js-clear-file-selection",S="[data-js='add-external-product-form']",T="data-add-external-product-url",k="data-add-asset-chunk-url",C="data-create-product-asset-url";class w extends l.Z{constructor(e){super(e),this.addToFavorites=!1,this.form=this.element.querySelector(S)}bindEvents(){super.bindEvents(),this.spinnerHandler=new a.Z(this.element),this.bindAddToFavoritesToggle(),this.bindConfirmClick(),this.bindUploadFilesClick(),this.bindClearFileSelectionClick(),this.bindDialogCloseClick()}bindDialogCloseClick(){r().subscribe(o.z.dialogClose,(()=>{this.form.reset()}))}bindClearFileSelectionClick(){let e=this.element.querySelector(b);e&&e.addEventListener("click",(e=>{this.element.querySelector(y).value="",this.visualizeSelectedFiles()}))}bindUploadFilesClick(){let e=this.element.querySelector(m),t=this.element.querySelector(y);e.addEventListener("click",(()=>{let e=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});t.dispatchEvent(e)})),t.addEventListener("change",(e=>{this.visualizeSelectedFiles()}))}bindAddToFavoritesToggle(){var e=this.element.querySelector(u);e?(e.innerHTML=this.element.querySelector(f).innerHTML,e.addEventListener("click",(()=>{this.addToFavorites=!this.addToFavorites,this.addToFavorites?e.innerHTML=this.element.querySelector(h).innerHTML:e.innerHTML=this.element.querySelector(f).innerHTML,this.element.querySelector(p).value=this.addToFavorites?"true":"false"}))):this.addToFavorites=!0}visualizeSelectedFiles(){let e=this.element.querySelector(y).files,t=this.element.querySelector(v),n=this.element.querySelector(g);if(e.length>0){for(let n=0;n<e.length;n++){let i=document.createElement("li");i.innerHTML=e[n].name,t.appendChild(i)}n.classList.remove("u-hidden")}else t.innerHTML="",n.classList.add("u-hidden")}bindConfirmClick(){this.element.querySelector(c).addEventListener("click",(async()=>{let e=this.form,t=this.spinnerHandler;if(this.form.checkValidity()){t.showSpinner();const n=e.elements.Files.files,i=this.element.getAttribute(k),o=this.element.getAttribute(C),l=1048576,a=await this.createExternalProduct(this,e,t);await d.Z.doUpload(a,n,i,o,l),r().publish(s.m.externalProductCreatedOrUpdated),e.reset(),this.visualizeSelectedFiles(),t.hideSpinner(),this.hide()}else e.reportValidity()}))}async createExternalProduct(e,t,n){let i=e.element.getAttribute(T),r=this.getProjectIdentifier(t),s="true"===t.elements.addtofavorites.value,o={title:t.elements.title.value,description:t.elements.shortdescription.value,vendor:t.elements.vendor.value,projectIdentifier:r,addtofavorites:s},l=await fetch(i,{method:"POST",body:JSON.stringify(o),headers:{"Content-type":"application/json","X-Requested-With":"XMLHttpRequest"}});return await l.clone().json()}getProjectIdentifier(e){let t=e.elements.ProjectIdentifier;return t?t.value:null}}},25967:function(e,t,n){n.d(t,{Z:function(){return h}});var i={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const s=new Uint8Array(16);function o(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(s)}const l=[];for(let e=0;e<256;++e)l.push((e+256).toString(16).slice(1));function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return l[e[t+0]]+l[e[t+1]]+l[e[t+2]]+l[e[t+3]]+"-"+l[e[t+4]]+l[e[t+5]]+"-"+l[e[t+6]]+l[e[t+7]]+"-"+l[e[t+8]]+l[e[t+9]]+"-"+l[e[t+10]]+l[e[t+11]]+l[e[t+12]]+l[e[t+13]]+l[e[t+14]]+l[e[t+15]]}var d=function(e,t,n){if(i.randomUUID&&!t&&!e)return i.randomUUID();const r=(e=e||{}).random||(e.rng||o)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return a(r)},c=n(49142),u=n.n(c);class h{static async doUpload(e,t,n,i,r){for(let s=0;s<t.length;s++){const o=t[s],l=Math.ceil(o.size/r),a=this.createId();let d="",c=!0,f="";for(let e=0;e<l;e++){const t=o.slice(e*r,(e+1)*r),i=new FormData,s=o.name.normalize("NFD").replace(/[\u0300-\u036f]/g,""),l=h.reduceFilename(s,49),p=u()(l);i.append("file",t,p);let m=await fetch(n,{method:"POST",body:i,headers:{"x-asset-identifier":a,"x-file-type":o.type,"x-continuation-token":f}});if(200==m.status){let e=await m.json();d=e.token,f=e.continuationToken}else c=!1}c&&await this.createProductAsset(e,d,i)}}static reduceFilename(e,t){const n=e.substring(e.lastIndexOf(".")),i=e.substring(0,e.lastIndexOf("."));if(i.length<=t-n.length)return e;return`${i.substring(0,t-n.length)}${n}`}static createId(){return d().toString().toLowerCase().replace(/-/g,"")}static async createProductAsset(e,t,n){let i={assetToken:t,productIdentifier:e};await fetch(n,{method:"POST",body:JSON.stringify(i),headers:{"Content-type":"application/json","X-Requested-With":"XMLHttpRequest"}})}}},86900:function(e,t,n){n.d(t,{Z:function(){return l}});var i=n(58706),r=n(66497),s=n(70392),o=n.n(s);class l extends i.Dialog{constructor(e){super(e),this.userSelection=[],this.entityTitles=new Map,this.CONFIRM_BUTTON_SELECTOR=".js-confirm",this.bindEvents()}bindEvents(){o().subscribe(r.m.entitySelected,((e,t)=>{var n=t;
1let i=n.entityId;this.userSelectionType=n.entityType,this.userSelection.includes(i)||this.userSelection.push(i)})),o().subscribe(r.m.entityUnselected,((e,t)=>{var n=t;let i=n.entityId;this.userSelectionType=n.entityType,this.userSelection.includes(i)&&(this.userSelection=this.userSelection.filter((function(e){return e!=i})))}))}}},66497:function(e,t,n){n.d(t,{Q:function(){return i},m:function(){return r}});class i{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";this.entityId=e,this.entityType=t,this.entityName=n,this.entityImgUrl=i,this.entityUrl=r}}class r{}r.entitySelected="entity-selected",r.entityUnselected="entity-unselected",r.favoritesBulkDeleted="favorites-bulk-delete",r.favoritesChangedFromDialog="favoritesChangedFromDialog",r.entityRemoved="entityRemoved",r.externalProductCreatedOrUpdated="externalProductCreatedOrUpdated"},49142:function(e,t,n){var i=n(60646),r=/[\/\?<>\\:\*\|"]/g,s=/[\x00-\x1f\x80-\x9f]/g,o=/^\.+$/,l=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,a=/[\. ]+$/;function d(e,t){if("string"!=typeof e)throw new Error("Input must be string");var n=e.replace(r,t).replace(s,t).replace(o,t).replace(l,t).replace(a,t);return i(n,255)}e.exports=function(e,t){var n=t&&t.replacement||"",i=d(e,n);return""===n?i:d(i,"")}},60646:function(e,t,n){var i=n(40765),r=n(36171);e.exports=i.bind(null,r)},40765:function(e){function t(e){return e>=55296&&e<=56319}function n(e){return e>=56320&&e<=57343}e.exports=function(e,i,r){if("string"!=typeof i)throw new Error("Input must be string");for(var s,o,l=i.length,a=0,d=0;d<l;d+=1){if(s=i.charCodeAt(d),o=i[d],t(s)&&n(i.charCodeAt(d+1))&&(o+=i[d+=1]),(a+=e(o))===r)return i.slice(0,d+1);if(a>r)return i.slice(0,d-o.length+1)}return i}},36171:function(e){function t(e){return e>=55296&&e<=56319}function n(e){return e>=56320&&e<=57343}e.exports=function(e){if("string"!=typeof e)throw new Error("Input must be string");for(var i=e.length,r=0,s=null,o=null,l=0;l<i;l++)n(s=e.charCodeAt(l))?null!=o&&t(o)?r+=1:r+=3:s<=127?r+=1:s>=128&&s<=2047?r+=2:s>=2048&&s<=65535&&(r+=3),o=s;return r}}}]);

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.